<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Latest Articles</title>
<link>http://www.tutorialsto.com/index.php/</link>
<description>Articles at Tutorials to .com</description>
<language>en-us</language>
<item>
<title>DBCP connection pool test (August revision)</title>
<link>http://www.tutorialsto.com/index.php/software/java/dbcp-connection-pool-test-august-revision.html</link>
<guid>http://www.tutorialsto.com/index.php/software/java/dbcp-connection-pool-test-august-revision.html</guid>
<pubDate>Wed, 26 Aug 2009 22:10:16 +0000</pubDate>
<description><![CDATA[ <h2 style="MARGIN: 13pt 0cm">  DBCP connection pool test (August revision) <p></p></h2><h3 style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 200%">  System: <p></p></h3><p>  WIN2000&gt;&gt; APACHE TOMCAT5.0.28 (requirement 5.0 and above)&gt;&gt; SQL SERVER 2000 </p><p>  The system using a SQL SERVER library Northwind.  Using the fourth-class driver, driver class into the D: \ testpool \ WEB-INF \ lib in the. </p><p>  To ensure normal operation of TOMCAT and SQL SERVER. </p><h3 style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 200%">  [1]% TOMCAT_HOME% \ conf \ Catalina \ localhost \ directory to build a testPool.xml file: <p></p></h3><p>  &lt;? xml version =&#39;&#39;&#39;&#39; 1.0&#39;&#39;&#39;&#39;encoding =&#39;&#39;&#39;&#39; utf-8&#39;&#39;&#39;&#39;?&gt; <p></p></p><p>  &lt;Context DocBase=&quot;D:/testpool&quot; path=&quot;/testpool&quot; privileged=&quot;true&quot; workDir=&quot;work\Catalina\localhost\testpool&quot;&gt; <p></p></p><p>  &lt;Resource Type=&quot;javax.sql.DataSource&quot; auth=&quot;Container&quot; name=&quot;jdbc/northwind&quot;/&gt; <p></p></p><p>  &lt;ResourceParams Name=&quot;jdbc/northwind&quot;&gt; <p></p></p><p>  &lt;parameter&gt; <p></p></p><p>  &lt;name&gt; maxWait &lt;/ name&gt; <p></p></p><p>  &lt;value&gt; 5000 &lt;/ value&gt; <p></p></p><p>  &lt;/ parameter&gt; <p></p></p><p>  &lt;parameter&gt; <p></p></p><p>  &lt;name&gt; maxActive &lt;/ name&gt; <p></p></p><p>  &lt;value&gt; 4 &lt;/ value&gt; <p></p></p><p>  &lt;/ parameter&gt; <p></p></p><p>  &lt;parameter&gt; <p></p></p><p>  &lt;name&gt; password &lt;/ name&gt; <p></p></p><p>  &lt;value&gt; jckjdkmcj &lt;/ value&gt; <p></p></p><p>  &lt;/ parameter&gt; <p></p></p><p>  &lt;parameter&gt; <p></p></p><p>  &lt;name&gt; url &lt;/ name&gt; <p></p></p><p>  &lt;value&gt; jdbc: microsoft: sqlserver: / / 10.0.0.168:1433; databaseName = Northwind &lt;/ value&gt; <p></p></p><p>  &lt;/ parameter&gt; <p></p></p><p>  &lt;parameter&gt; <p></p></p><p>  &lt;name&gt; driverClassName &lt;/ name&gt; <p></p></p><p>  &lt;value&gt; com.microsoft.jdbc.sqlserver.SQLServerDriver &lt;/ value&gt; <p></p></p><p>  &lt;/ parameter&gt; <p></p></p><p>  &lt;parameter&gt; <p></p></p><p>  &lt;name&gt; maxIdle &lt;/ name&gt; <p></p></p><p>  &lt;value&gt; 2 &lt;/ value&gt; <p></p></p><p>  &lt;/ parameter&gt; <p></p></p><p>  &lt;parameter&gt; <p></p></p><p>  &lt;name&gt; username &lt;/ name&gt; <p></p></p><p>  &lt;value&gt; sa &lt;/ value&gt; <p></p></p><p>  &lt;/ parameter&gt; <p></p></p><p>  &lt;/ ResourceParams&gt; <p></p></p><p>  &lt;/ Context&gt; <p></p></p><h3 style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 200%">  [2] D: \ testpool \ WEB-INF \ following the establishment of a web.xml file: <p></p></h3><p>  &lt;? xml version = &quot;1.0&quot; encoding = &quot;ISO-8859-1&quot;?&gt; <p></p></p><p><p></p></p><p>  &lt;web-app xmlns = &quot;http://java.sun.com/xml/ns/j2ee&quot; <p></p></p><p>  xmlns: xsi = &quot;http://www.w3.org/2001/XMLSchema-instance&quot; <p></p></p><p>  xsi: schemaLocation = &quot;http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd&quot; <p></p></p><p>  version = &quot;2.4&quot;&gt; <p></p></p><p>  &lt;! - ConnectionPool -&gt; <p></p></p><p>  &lt;resource-ref&gt; <p></p></p><p>  &lt;res-ref-name&gt; jdbc / northwind &lt;/ res-ref-name&gt; <p></p></p><p>  &lt;res-type&gt; javax.sql.DataSource &lt;/ res-type&gt; <p></p></p><p>  &lt;res-auth&gt; Container &lt;/ res-auth&gt; <p></p></p><p>  &lt;/ resource-ref&gt; <p></p></p><p>  &lt;/ web-app&gt; <p></p></p><h3 style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 200%">  [3] D: \ testpool \ following the establishment of test file index.jsp <p></p></h3><p>  &lt;% @ Page contentType = &quot;text / html; charset = GB2312&quot;%&gt; <p></p></p><p>  &lt;% @ Page import = &quot;java.sql .*&quot;%&gt; <p></p></p><p>  &lt;% @ Page import = &quot;javax.sql .*&quot;%&gt; <p></p></p><p>  &lt;% @ Page import = &quot;javax.naming .*&quot;%&gt; <p></p></p><p>  &lt;% @ Page session = &quot;false&quot;%&gt; <p></p></p><p>  &lt;html&gt; <p></p></p><p>  &lt;head&gt; <p></p></p><p>  &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=gb2312&quot;&gt; <p></p></p><p>  &lt;title&gt; tetst connection pool &lt;/ title&gt; <p></p></p><p>  &quot;% <p></p></p><p>  out.println ( &quot;My test started&quot;); <p></p></p><p>  DataSource ds = null; <p></p></p><p><p></p></p><p>  try ( <p></p></p><p>  InitialContext ctx = new InitialContext (); <p></p></p><p>  ds = (DataSource) ctx.lookup ( &quot;java: comp / env / jdbc / northwind&quot;); <p></p></p><p>  Connection conn = ds.getConnection (); <p></p></p><p>  Statement stmt = conn.createStatement (); <p></p></p><p><p></p></p><p>  String strSql = &quot;select * from Categories&quot;; <p></p></p><p>  ResultSet rs = stmt.executeQuery (strSql); <p></p></p><p>  while (rs.next ()) ( <p></p></p><p>  out.println (rs.getString (1)); <p></p></p><p>  ) <p></p></p><p>  out.println ( &quot;My test is over&quot;); <p></p></p><p>  ) <p></p></p><p>  catch (Exception ex) ( <p></p></p><p>  out.print ( &quot;there is an exception, the information is:&quot; + ex.getMessage ()); <p></p></p><p>  ex.printStackTrace (); <p></p></p><p>  ) <p></p></p><p>  % &quot; <p></p></p><p>  &lt;/ head&gt; <p></p></p><p>  &lt;body&gt; <p></p></p><p>  &lt;/ body&gt; <p></p></p><p>  &lt;/ html&gt; <p></p></p><p>  [4] added: make configuration roughly similar to a few questions to find out is to consider the WWW principle, to build or change what documents (WHO), where they do (WHERE), what to do (WHAT). Corresponding are: <p></p></p><table class=MsoTableGrid style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-yfti-tbllook: 480; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext" cellspacing=0 cellpadding=0 border=1><tbody><tr style="mso-yfti-irow: 0"><td style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 4cm; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt" valign=top width=151><p>  WHO <p></p></p></td><td style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #d4d0c8; WIDTH: 315pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt" valign=top width=420><p>  WHERE <p></p></p></td><td style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #d4d0c8; WIDTH: 121pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt" valign=top width=161><p>  WHAT <p></p></p></td></tr><tr style="mso-yfti-irow: 1"><td style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 4cm; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" valign=top width=151><p>  testPool.xml <p></p></p></td><td style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #d4d0c8; WIDTH: 315pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" valign=top width=420><p>  % TOMCAT_HOME% \ conf \ Catalina \ localhost \ <p></p></p></td><td style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #d4d0c8; WIDTH: 121pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" valign=top width=161><p>  See the first step <p></p></p></td></tr><tr style="mso-yfti-irow: 2"><td style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 4cm; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" valign=top width=151><p>  web.xml (name fixed) <p></p></p></td><td style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #d4d0c8; WIDTH: 315pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" valign=top width=420><p>  D: \ testpool \ WEB-INF \ web.xml <p></p></p></td><td style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #d4d0c8; WIDTH: 121pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" valign=top width=161><p>  See Step <p></p></p></td></tr><tr style="mso-yfti-irow: 3; mso-yfti-lastrow: yes"><td style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 4cm; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" valign=top width=151><p>  index.jsp <p></p></p></td><td style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #d4d0c8; WIDTH: 315pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" valign=top width=420><p>  D: \ testpool \ index.jsp <p></p></p></td><td style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #d4d0c8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #d4d0c8; WIDTH: 121pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" valign=top width=161><p>  See the third step <p></p></p></td></tr></tbody></table><p>  [5] If you are using hibernate, except for the above things still need to change the hibernate.cfg.xml file: <p></p></p><p>  &lt;? xml version =&#39;&#39;&#39;&#39; 1.0&#39;&#39;&#39;&#39;encoding =&#39;&#39;&#39;&#39; UTF-8&#39;&#39;&#39;&#39;?&gt; <p></p></p><p>  &lt;! DOCTYPE hibernate-configuration PUBLIC <p></p></p><p>  &quot;- / / Hibernate / Hibernate Configuration DTD 2.0 / / EN&quot; <p></p></p><p>  &quot;http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd&quot;&gt; <p></p></p><p><p></p></p><p>  &lt;! - DO NOT EDIT: This is a generated file that is synchronized -&gt; <p></p></p><p>  &lt;! - By MyEclipse Hibernate tool integration. -&gt; <p></p></p><p>  &lt;hibernate-configuration&gt; <p></p></p><p><p></p></p><p>  &lt;session-factory&gt; <p></p></p><p>  &lt;! - Properties <p></p></p><p>  &lt;property name=&quot;connection.username&quot;&gt; sa &lt;/ property&gt; <p></p></p><p>  &lt;property name=&quot;connection.url&quot;&gt; <p></p></p><p>  jdbc: microsoft: sqlserver: / / 10.0.0.168:1433; DataBaseName = cw_scene <p></p></p><p>  &lt;/ property&gt; <p></p></p><p>  &lt;property name=&quot;dialect&quot;&gt; <p></p></p><p>  net.sf.hibernate.dialect.SQLServerDialect <p></p></p><p>  &lt;/ property&gt; <p></p></p><p>  &lt;property name=&quot;connection.password&quot;&gt; jckjdkmcj &lt;/ property&gt; <p></p></p><p>  &lt;property name=&quot;connection.driver_class&quot;&gt; <p></p></p><p>  com.microsoft.jdbc.sqlserver.SQLServerDriver <p></p></p><p>  &lt;/ property&gt; <p></p></p><p>  &lt;property name=&quot;hibernate.jdbc.fetch_size&quot;&gt; 50 &lt;/ property&gt; <p></p></p><p>  &lt;property name=&quot;hibernate.jdbc.batch_size&quot;&gt; 25 &lt;/ property&gt; <p></p></p><p>  - &quot; <p></p></p><p>  &lt;! - Properties -&gt; <p></p></p><p><p></p></p><p>  &lt;property name=&quot;connection.datasource&quot;&gt; <p></p></p><p>  java: comp / env / jdbc / testpool <p></p></p><p>  &lt;/ property&gt; <p></p></p><p>  &lt;property name=&quot;dialect&quot;&gt; <p></p></p><p>  net.sf.hibernate.dialect.SQLServerDialect <p></p></p><p>  &lt;/ property&gt; <p></p></p><p>  &lt;property name=&quot;hibernate.connection.provider_class&quot;&gt; <p></p></p><p>  net.sf.hibernate.connection.DatasourceConnectionProvider <p></p></p><p>  &lt;/ property&gt; <p></p></p><p>  &lt;property name=&quot;hibernate.jdbc.fetch_size&quot;&gt; 50 &lt;/ property&gt; <p></p></p><p>  &lt;property name=&quot;hibernate.jdbc.batch_size&quot;&gt; 25 &lt;/ property&gt; <p></p></p><p><p></p></p><p>  &lt;! - Mapping files -&gt; <p></p></p><p>  &lt;mapping resource=&quot;com/scenechina/table/Imgpos.hbm.xml&quot; /&gt; <p></p></p><p><p></p></p><p>  &lt;/ session-factory&gt; <p></p></p><p><p></p></p><p>  &lt;/ hibernate-configuration&gt; <p></p></p><br /> ]]></description>
</item>
<item>
<title>VB5.0 create a screen saver mystery</title>
<link>http://www.tutorialsto.com/index.php/software/vb/vb5-0-create-a-screen-saver-mystery.html</link>
<guid>http://www.tutorialsto.com/index.php/software/vb/vb5-0-create-a-screen-saver-mystery.html</guid>
<pubDate>Wed, 26 Aug 2009 22:09:47 +0000</pubDate>
<description><![CDATA[ <p><br>  Shenzhen Sheng-Chang Chen <br><br>  ---- Visual Basic 5.0 with the idea of object-oriented programming and visualization programming approach can be developed all kinds of multimedia applications, software designers drew much favor.  The use of Visual Basic 5.0 can be very easy to set up a screen saver. <br>  ---- Screen Saver is mainly used to protect the display screen, to avoid being a long time still image burns.  In addition, it&#39;s fascinating creative animation makes the gap in the machine can also feel the computer has brought many fun.  Many computer enthusiasts will have their own DIY screen saver desire, in particular wanted to be able to reflect a personality, rich amenities a screen saver.  This article describes a way to use Visual Basic 5.0 programming language method of making a screen saver for a creative passion and interest of fans trying. <br><br>  ---- In the win95 desktop right click pop-up menu, select Properties, set the interface on the display appears, there is a label is to set the screen saver.  In the page screen, select the win95 package with PC standard screen saver, you can understand that a standard screen saver has the following characteristics: <br><br>  ---- 1. Can be on the label of the small &quot;monitor&quot; in the pre-Hin <br><br>  ---- 2. Click on &quot;Preview&quot; button to run the screen saver directly, without waiting for the scheduled time <br><br>  ---- 3. Click &quot;Settings&quot; button on the screen saver and other settings to speed the pace <br><br>  ---- The following discusses how to use a specific Visual Basic 5.0 or above design features of the standard screen saver, which is in the design of the screen saver should pay attention to several issues: <br><br>  ---- 1, the screen saver prior knowledge <br><br>  ---- Screen saver is based on. SCR for the suffix of the file is actually a standard Windows executable files, when compiled EXE extension was revised to SCR, will no longer build with the extension EXE executable file.  Many talk about the article only talk about screen saver screen saver in the image display techniques, procedures and systems for the interface with little or unwilling to talk about involved, the author obtained through reverse engineering methods and parameters of its use.  Screen saver and system interface between the use of very simple screen saver through the pass command line parameters to achieve, and its format: <br><br>  ScrSave.exe App.scr / X nnnn <br><br>  ---- X for the command-line arguments, nnnn is the value passed to the program. <br><br>  ---- Command-line arguments mainly in the following categories: <br><br>  ---- / S or / s: start mode, display or preview a screen saver <br><br>  ---- / P nnn or / p nnn: Pre-obvious patterns, nnn a decimal number is a significant pre-handle the small display window <br><br>  ---- / C or a / c: set the mode, bring up settings window to set <br><br>  ---- / A or / a: password mode, adjusting the export settings so that the window (This article is deferring the discussion of this parameter, interested friend can try their own) <br><br>  ---- Second, to prevent the screen saver to run two instances of <br><br>  ---- Visual Basic provides an App object, it has a PreInstance property, if the current Visual Basic application, an instance is already running when he leaves, the property is set to True, in order to avoid running a screen saver for many instance.  For the screen saver in the Screen Saver Properties window, due to significant pre-procedure is called a program, but also need to find a way to prevent the same name procedure to run a screen saver while the two examples.  Process can call the FindWindow API to determine whether the system has another application is running.  It requires two string parameters, one that the application class name, and the other said that the window&#39;s title bar: <br><br>  Declare Function FindWindow Lib &quot;user32&quot; Alias _ <br>  &quot;FindWindowA&quot; (ByVal lpClassName As String, _ <br>  ByVal lpWindowName As String) As Long <br><br>  ---- The following code shows how a typical App.PreInstance and FindWindow in a screen saver in the implementation. <br><br>  Private Sub CheckShouldRun () <br><br>  Note: If the screen saver is already running, exit <br>  If Not App.PrevInstance Then Exit Sub <br><br>  Note: to determine whether the system has the same name as the screen saver is running <br>  If FindWindow (vbNullString, APP_NAME) Then End <br><br>  Note: set the instance name <br>  frmCover.Caption = APP_NAME <br>  End Sub <br><br>  ---- 3, in the screen saver to hide the mouse <br><br>  ---- ShowCursor API function allows Visual Basic applications to hide or show the mouse, each time with the parameter values True or False calls ShowCursor can show or hide the mouse.  The following is ShowCursor API function statement: <br><br>  Declare Function ShowCursor Lib &quot;user32&quot; <br>  (ByVal bShow As Long) As Long <br><br>  ---- 4, detection of mouse movement <br><br>  ---- Mouse movement in the screen saver mode, the need to exit the program, but in the pre-explicit mode, and do not affect the program, so set RunMode global variable to determine whether the mouse works on the program.  MouseMove event is used to detect the mouse movement, when the application starts, or even moving the mouse not actually the case, MouseMove events will be triggered once.  Therefore, MouseMove event is triggered only record the current position of the mouse, only when the mouse actually move away from its starting position a large displacement before the termination of the screen saver.  Concrete realization of the code is as follows: <br><br>  Private Sub Form_MouseMove (Button As Integer, <br>  Shift As Integer, x As Single, y As Single) <br>  Static x0 As Integer <br>  Static y0 As Integer <br><br>  Note: non-screen saver mode exit process <br>  If RunMode &lt;&gt; rmScreenSaver Then Exit Sub <br><br>  Note: a large mouse exit <br>  If ((x0 = 0) And (y0 = 0)) Or _ <br>  ((Abs (x0 - x) &lt;5) And (Abs (y0 - y) &lt;5)) _ <br>  Then <br>  Note: a small mouse movement <br>  x0 = x <br>  y0 = y <br>  Exit Sub <br>  End If <br><br>  Unload Me <br>  End Sub <br><br>  ---- 5, set the parameters to read and save <br><br>  ---- In Visual Basic,, SaveSetting function is provided in the Windows registry to save or create the private parameters of the application functionality.  The syntax is: <br><br>  SaveSetting appname, section, key, setting <br><br>  ---- SaveSetting function, such as the setting value is stored in HKEY_CURRENT_USER \ Software \ VB and VBA Program Settings \ appname \ section \ key under. <br><br>  ---- GetSetting function provides the application reads the Windows registry of private parameters of the function.  The syntax is: <br><br>  GetSetting (appname, section, key [, default]) <br><br>  ---- If the GetSetting arguments in any one did not exist, GetSetting returns the default value.  If the default value is omitted, then the return to zero-length string (&quot;&quot;)。 <br><br>  ---- Application procedures are as follows: <br><br>  Public Sub SaveConfig () <br>  Note: Save settings to the registry parameters <br>  SaveSetting APP_NAME, _ <br>  &quot;Settings&quot;, &quot;NumBalls&quot;, Format $ (NumBalls) <br>  End Sub <br><br>  Public Sub LoadConfig () <br>  Note: to read from the registry parameter, if not set, the default value of 1 <br>  NumBalls = CInt (GetSetting (APP_NAME, _ <br>  &quot;Settings&quot;, &quot;NumBalls&quot;, &quot;1&quot;)) <br>  End Sub <br><br>  ---- 6, the small-screen window to achieve significant pre - <br><br>  ---- To screen saver significantly small window in the pre-show up, first of all to obtain the command line in the pre-Hin window handle, use GetClientRect to obtain its size, through GetWindowLong get the current state of the window, set into a child window with SetWindowLong after the state back into the Windows configuration, using SetParent to protect the screen window to link the pre-window, child window significantly, and finally SetWindowPos the program significantly in the pre-window is displayed.  Procedures used in the GetClientRect, GetWindowLong, SetWindowLong, SetParent, SetWindowPos these API functions, these functions are given here, the statement: <br><br>  Declare Function GetClientRect Lib &quot;user32&quot; <br>  (ByVal hwnd As Long, lpRect As RECT) As Long <br><br>  Declare Function GetWindowLong Lib &quot;user32&quot; Alias &quot; <br>  GetWindowLongA &quot;(ByVal hwnd As Long, <br>  ByVal nIndex As Long) As Long <br><br>  Declare Function SetWindowLong Lib &quot;user32&quot; <br>  Alias &quot;SetWindowLongA&quot; (ByVal hwnd As Long, <br>  ByVal nIndex As Long, ByVal dwNewLong As Long) As Long <br><br>  Declare Function SetParent Lib &quot;user32&quot; <br>  (ByVal hWndChild As Long, <br>  ByVal hWndNewParent As Long) As Long <br><br>  Declare Function SetWindowPos Lib &quot;user32&quot; <br>  (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, <br>  ByVal x As Long, ByVal y As Long, ByVal cx As Long, <br>  ByVal cy As Long, ByVal wFlags As Long) As Long <br><br><br>  Case rmPreview Note: Pre-explicit mode Note: To get the window handle of the pre-Hin <br>  preview_hwnd = GetHwndFromCommand (args) <br><br>  Note: To get the pre-explicit window size <br>  GetClientRect preview_hwnd, preview_rect <br><br>  Load frmCover <br><br>  Note: Set the &quot;Preview&quot; window name <br>  frmCover.Caption = &quot;Preview&quot; <br><br>  Note: To get the current window state <br>  window_style = GetWindowLong <br>  (frmCover.hwnd, GWL_STYLE) <br><br>  Note: The current window is set to the child window state <br>  window_style = (window_style Or WS_CHILD) <br><br>  Note: Set the current window state <br>  SetWindowLong frmCover.hwnd, _ <br>  GWL_STYLE, window_style <br><br>  Note: Set the current window to the pre-window, child window significantly <br>  SetParent frmCover.hwnd, preview_hwnd <br><br>  Note: the pre-window handle significant windows into the structure of the current window <br>  SetWindowLong frmCover.hwnd, _ <br>  GWL_HWNDPARENT, preview_hwnd <br><br>  Note: Pre-explicit screen saver <br>  SetWindowPos frmCover.hwnd, _ <br>  HWND_TOP, 0 &amp;, 0 &amp;, _ <br>  preview_rect.Right, _ <br>  preview_rect.Bottom, _ <br>  SWP_NOZORDER Or SWP_NOACTIVATE Or _ <br>  SWP_SHOWWINDOW <br><br>  ---- 7, it is important attribute <br><br>  To modify the properties of the form has the following <br>  BackColor = &amp; H00000000 &amp; background color to black <br>  BorderStyle = 0 Notes: None Window border-free <br>  ControlBox = 0 Note: False controls without <br>  MaxButton = 0 Note: False maximize button-free <br>  MinButton = 0 Note: False Minimize button without <br>  ScaleMode = 3 Note: Pixel ratio model, Pixel <br>  WindowState = 2 Note: Maximized window state is initialized as the maximum <br><br>  ---- Timer control (in the Form form) Enabled attribute in the design environment is set to False. <br><br>  ---- The following gives a complete screen saver example, its demonstration effect: a few small balls non-stop bouncing on the screen. Interested in friends can be program InitializeBalls and tmrMoveBalls_Timer two processes to modify , we can generate a variety of wonderful screen saver, such as adding text mobile display, star-picture show ... <br><br>  ---- When you complete these modifications to generate an SCR file, put it into the Windows 95 under the System directory, open the Screen Saver Properties window, choose your own screen saver, click the preview, enjoy yourself a masterpiece How does it feel? <br><br>  ---- The program in Visual Basic 5.0, Windows 95 environment to run through the </p> ]]></description>
</item>
<item>
<title>Record some information about testing tools NUNIT link to information, interested friends can jump in the past to see if</title>
<link>http://www.tutorialsto.com/index.php/dotnet/winform/record-some-information-about-testing-tools-nunit-link-to-information-interested-friends-can-jump-in-the-past-to-see-if.html</link>
<guid>http://www.tutorialsto.com/index.php/dotnet/winform/record-some-information-about-testing-tools-nunit-link-to-information-interested-friends-can-jump-in-the-past-to-see-if.html</guid>
<pubDate>Wed, 26 Aug 2009 22:09:23 +0000</pubDate>
<description><![CDATA[ <p>  <strong>http://www.ncover.org/</strong> </p><p>  Welcome to the new home of NCover, the open source code coverage tool for. NET. After struggling mightily with the GotDotNet.com infrustructure, I have decided to move this project to its own location. </p><p>  Over the next few weeks, I will be migrating the NCover discussion groups and bug database from GotDotNet, but the rest of the information you might need is here already. </p><p>  Go ahead and <strong>download</strong> the stable version or the new alpha Release. In addition, you can <strong>browse</strong> the source code and comment in the <strong>community area.</strong> </p><p>  <strong>Update 12/12/2004:</strong> Released a new alpha build (v1.4.5) that hopefully addresses the problems that some users have had with the profiler crashing on shutdown. </p><p>  <strong>Update 1/11/2005:</strong> Released a new build (v1.4.6) that fixes the bug where the coverage file was not being output to the designated location. </p><p>  Regards, </p><p>  <strong>Peter Waldschmidt</strong> </p><p></p><p>  <strong><strong>http://www.testdriven.net/Default.aspx?ReferrerId=3362</strong></strong> </p><p>  <strong>Welcome to TestDriven.NET</strong> - <i>&quot;The Zero Friction Unit Testing Add-In for Microsoft Visual Studio. NET&quot;</i> </p><p>  TestDriven.NET makes it easy to run unit tests with a single click, anywhere in your Visual Studio solutions. It supports <i>all</i> versions of Microsoft Visual Studio. NET meaning you don&#39;t have to worry about compatibility issues and fully integrates with <i>all</i> major unit testing frameworks including <strong>NUnit,</strong> <strong>MbUnit,</strong> &amp; <strong>MS Team System.</strong> </p><p></p><p>  <strong>http://sourceforge.net/project/showfiles.php?group_id=66591</strong> </p><p>  Below is a list of all files released by this project. Before downloading, you may want to read Release Notes and ChangeLog (accessible by clicking on release version). </p><p><table cellspacing=1 cellpadding=1 width=100% border=0><tbody><tr align=center><td rowspan=2>  <b>Package</b> </td><td rowspan=2>  <b>Release</b> <b><br /></b>  <b>&amp; Notes</b> </td><td rowspan=2>  <b>Filename</b> </td><td colspan=4>  <b>Date</b> </td></tr><tr align=center><td>  <b>Size</b> </td><td>  <b>D / L</b> </td><td>  <b>Arch.</b> </td><td>  <b>Type</b> </td></tr><tr bgcolor=#ffffff><td colspan=3><h3>  NMock <strong>[Show only this Package]</strong> </h3></td><td colspan=4></td></tr><tr bgcolor=#ffffff><td colspan=3> <strong><b><img height=15 alt="Release Notes" src=http://www.uudo.net/UpLoadFiles/Files/../UpPic/2006-9/17/0691715285565051.png width=15 border=0 /></b></strong>  <strong><b>1.1</b></strong> <strong>[Show only this Release]</strong> </td><td align=center colspan=4>  <b>2004-06-13 23:00</b> </td></tr><tr bgcolor=#ffffff><td colspan=3><dd>  <strong>Download nmock.dll</strong> </dd></td><td align=right>  40960 </td><td align=right>  4833 </td><td>  i386 </td><td>  . zip </td></tr><tr bgcolor=#ffffff><td colspan=3><dd>  <strong>Download nmock.source.zip</strong> </dd></td><td align=right>  65996 </td><td align=right>  1739 </td><td>  i386 </td><td>  . zip </td></tr><tr bgcolor=#ffffff><td colspan=3> <strong><b><img height=15 alt="Release Notes" src=http://www.uudo.net/UpLoadFiles/Files/../UpPic/2006-9/17/0691715285565051.png width=15 border=0 /></b></strong>  <strong><b>1.01</b></strong> <strong>[Show only this Release]</strong> </td><td align=center colspan=4>  <b>2004-03-16 16:00</b> </td></tr><tr bgcolor=#ffffff><td colspan=3><dd>  <strong>Download nmock.dll</strong> </dd></td><td align=right>  40960 </td><td align=right></td><td>  i386 </td><td>  Other </td></tr><tr bgcolor=#ffffff><td colspan=3><dd>  <strong>Download nmock.source.zip</strong> </dd></td><td align=right>  356,214 </td><td align=right></td><td>  i386 </td><td>  Source. Zip </td></tr><tr bgcolor=#ffffff><td colspan=3> <strong><b><img height=15 alt="Release Notes" src=http://www.uudo.net/UpLoadFiles/Files/../UpPic/2006-9/17/0691715285565051.png width=15 border=0 /></b></strong>  <strong><b>1.0</b></strong> <strong>[Show only this Release]</strong> </td><td align=center colspan=4>  <b>2003-05-10 16:00</b> </td></tr><tr bgcolor=#ffffff><td colspan=3><dd>  <strong>Download nmock.dll</strong> </dd></td><td align=right>  32768 </td><td align=right>  2068 </td><td>  Platform-Independent </td><td>  Other </td></tr></tbody></table></p><br /> ]]></description>
</item>
<item>
<title>ASC II full code table and Introduction</title>
<link>http://www.tutorialsto.com/index.php/software/delphi/asc-ii-full-code-table-and-introduction.html</link>
<guid>http://www.tutorialsto.com/index.php/software/delphi/asc-ii-full-code-table-and-introduction.html</guid>
<pubDate>Wed, 26 Aug 2009 22:08:59 +0000</pubDate>
<description><![CDATA[ <TABLE width=95%><TR><TD><table border=0 align=left><tr><td></td></tr></table>  At present the computer using the most widely used <strong>character</strong> set and encoding, by the American National Standards Institute (ANSI) to develop the ASCII code (American Standard Code for Information Interchange, American Standard Code for Information Interchange), it has been the International Organization for Standardization (ISO ) as the international standard known as ISO 646 standard.  Applies to all the Latin alphabet characters, ASCII codes are 7 yards and 8 yards in two forms. <BR>  Because a binary number can be expressed as (21 =) two kinds of states: 0,1; and 2-bit binary number can be expressed as (22) = 4 states: 00,01,10,11; in turn and so on, 7-bit binary number can be that (27 =) 128 states, each state is uniquely prepared for a 7-bit binary code, corresponding to a <strong>character</strong> (or control code), these codes can be arranged in a decimal number 0 to 127.  Therefore, the 7-bit ASCII code is used to encode binary number 7, can be expressed as 128 <strong>characters.</strong> <BR>  No. 0 ~ 32 and 127 (total 34) is to control the <strong>character</strong> or communication-specific <strong>characters,</strong> such as the control characters: LF (line feed), CR (carriage return), FF (FF), DEL (delete), BS (backspace), BEL (ringing), etc.; Communications special <strong>characters:</strong> SOH (Man head), EOT (end text), ACK (confirmation), etc.; <BR>  No. 33 ~ 126 (total 94) is a <strong>character,</strong> the first 48 ~ 57 10 Arabic numerals 0 to 9; 65 ~ 90 No. 26 uppercase English letters, 97 ~ 122, No. 26 lowercase letters, the rest for a number of punctuation marks, operator symbols. <BR>  Note: In the computer&#39;s memory unit, a value accounting for one-byte ASCII code (8 bits), the highest bit (b7) used as a parity bit.  The so-called parity refers to the transmission process in the code used to test whether errors in a way, it normally takes two kinds of odd parity and even parity.  Odd parity states: the correct code in a number of one byte must be odd, if not odd, then the highest bit b7 Tim 1; even parity states: the correct code in a number of one byte must be an even , if not even, then the highest bit b7 Tim 1. <BR><BR><TABLE height=100 cellSpacing=0 cellPadding=0 width=600 border=1><TBODY><TR><TD>  Before 128 </TD><TD>  After the expansion of </TD></TR><TR><TD><p>  0 00 € NUL <BR>  1 01 € SOH <BR>  2 02 € STX <BR>  3 03 € ETX <BR>  4 04 € EOT <BR>  5 05 € ENQ <BR>  6 06 € ACK <BR>  7 07 € BEL <BR>  8 08 € BS <BR>  9 09 € HT <BR>  10 0A € LF <BR>  11 0B € VT <BR>  12 0C € FF <BR>  13 0D € CR <BR>  14 0E € SO <BR>  15 0F € SI <BR>  16 10 € SLE <BR>  17 11 € CS1 <BR>  18 12 € DC2 <BR>  19 13 € DC3 <BR>  20 14 € DC4 <BR>  21 15 € NAK <BR>  22 16 € SYN <BR>  23 17 € ETB <BR>  24 18 € CAN <BR>  25 19 € EM <BR>  26 1A € SIB <BR>  27 1B € ESC </P><p>  28 1C € FS <BR>  29 1D € GS <BR>  30 1E RS <BR>  31 1F € US <BR>  32 20 (space) <BR>  3321! <BR>  34 22 &quot; <BR>  3523 # <BR>  3624 $ <BR>  37 25% <BR>  3826 &amp; <BR>  3927 &#39; <BR>  4028 ( <BR>  4129) <BR>  42 2A * <BR>  43 2B + <BR>  44 2C, <BR>  45 2D -- <BR>  46 2E. <BR>  47 2F / <BR>  48300 <BR>  49311 <BR>  50322 <BR>  51333 <BR>  52344 <BR>  53355 <BR>  54366 <BR>  55377 <BR>  56388 <BR>  57399 <BR>  58 3A: <BR>  59 3B; <BR>  60 3C &lt; <BR>  61 3D = <BR>  62 3E&gt; <BR>  63 3F? </P><p>  6440 @ <BR>  65 41 A <BR>  66 42 B <BR>  67 43 C <BR>  68 44 D <BR>  69 45 E <BR>  70 46 F <BR>  71 47 G <BR>  72 48 H <BR>  73 49 I <BR>  74 4A J <BR>  75 4B K <BR>  76 4C L <BR>  77 4D M <BR>  78 4E N <BR>  79 4F O <BR>  80 50 P <BR>  81 51 Q <BR>  82 52 R <BR>  83 53 S <BR>  84 54 T <BR>  85 55 U <BR>  86 56 V <BR>  87 57 W <BR>  88 58 X <BR>  89 59 Y <BR>  90 5A Z <BR>  91 5B [ <BR>  92 5C \ <BR>  93 5D] <BR>  94 5E ^ <BR>  95 5F _ <BR>  9660 ` <BR>  97 61 a <BR>  98 62 b <BR>  99 63 c <BR>  100 64 d </P><p>  101 65 e <BR>  102 66 f <BR>  103 67 g <BR>  104 68 h <BR>  105 69 i <BR>  106 6A j <BR>  107 6B k <BR>  108 6C l <BR>  109 6D m <BR>  110 6E n <BR>  111 6F o <BR>  112 70 p <BR>  113 72 q <BR>  114 72 r <BR>  115 73 s <BR>  116 74 t <BR>  117 75 u <BR>  118 76 v <BR>  119 77 w <BR>  120 78 x <BR>  121 79 y <BR>  122 7A z <BR>  123 7B ( <BR>  124 7C | <BR>  125 7D) <BR>  126 7E ~ <BR>  127 7F <BR>  128 80 € </P></TD><TD><p>  12981? <BR>  130 * 82? <BR>  131 * 83? <BR>  132 * 84? <BR>  133 * 85? <BR>  134 * 86? <BR>  135 * 87? </P><p>  136 * 88? <BR>  137 * 89? <BR>  138 * 8A? <BR>  139 * 8B? <BR>  140 * 8C? <BR>  141 8D? <BR>  142 8E? <BR>  143 8F? <BR>  14490? <BR>  14591 <BR>  14692 <BR>  147 * 93 <BR>  148 * 94 <BR>  149 * 95 <BR>  150 * 96 <BR>  151 * 97 <BR>  152 * 98? <BR>  153 * 99? <BR>  154 * 9A? <BR>  155 * 9B? <BR>  156 * 9C? <BR>  157 9D? <BR>  158 9E? <BR>  159 * 9F? <BR>  160 A0 <BR>  161 A1? <BR>  162 A2? <BR>  163 A3? <BR>  164 A4? <BR>  165 A5? <BR>  166 A6? <BR>  167 A7? <BR>  168 A8? <BR>  169 A9? <BR>  170 AA? <BR>  171 AB? <BR>  172 AC? <BR>  173 AD? <BR>  174 AE? <BR>  175 AF? </P><p>  176 B0? <BR>  177 B1? <BR>  178 B2? <BR>  179 B3? <BR>  180 B4? <BR>  181 B5? <BR>  182 B6? <BR>  183 B7? <BR>  184 B8? <BR>  185 B9? <BR>  186 BA? <BR>  187 BB? <BR>  188 BC? <BR>  189 BD? <BR>  190 BE? <BR>  191 BF? <BR>  192 C0? <BR>  193 C1? <BR>  194 C2? <BR>  195 C3? <BR>  196 C4? <BR>  197 C5? <BR>  198 C6? <BR>  199 C7? <BR>  200 C8? <BR>  201 C9? <BR>  202 CA? <BR>  203 CB? <BR>  204 CC? <BR>  205 CD? <BR>  206 CE? <BR>  207 CF? <BR>  208 D0? <BR>  209 D1? <BR>  210 D2? <BR>  211 D3? <BR>  212 D4? <BR>  213 D5? <BR>  214 D6? <BR>  215 D7? </P><p>  216 D8? <BR>  217 D9? <BR>  218 DA? <BR>  219 DB? <BR>  220 DC? <BR>  221 DD? <BR>  222 DE? <BR>  223 DF? <BR>  224 E0? <BR>  225 E1? <BR>  226 E2? <BR>  227 E3? <BR>  228 E4? <BR>  229 E5? <BR>  230 E6? <BR>  231 E7? <BR>  232 E8? <BR>  233 E9? <BR>  234 EA? <BR>  235 EB? <BR>  236 EC? <BR>  237 ED? <BR>  238 EE? <BR>  239 EF? <BR>  240 F0? <BR>  241 F1? <BR>  242 F2? <BR>  243 F3? <BR>  244 F4? <BR>  245 F5? <BR>  246 F6? <BR>  247 F7? <BR>  248 F8? <BR>  249 F9? <BR>  250 FA? <BR>  251 FB? <BR>  252 FC? <BR>  253 FD? <BR>  254 FE? <BR>  255 FF  </P></TD></TR></TBODY></TABLE> ]]></description>
</item>
<item>
<title>Comparison of difference between the two dates a few days</title>
<link>http://www.tutorialsto.com/index.php/php/application/comparison-of-difference-between-the-two-dates-a-few-days.html</link>
<guid>http://www.tutorialsto.com/index.php/php/application/comparison-of-difference-between-the-two-dates-a-few-days.html</guid>
<pubDate>Wed, 26 Aug 2009 22:08:36 +0000</pubDate>
<description><![CDATA[ <p>  Comparison of difference between the two dates a few days </p>  &lt;? PHP <BR>  $ Date_1 = &quot;2003-7-15&quot;; / / format can also be: $ Date_1 = &quot;2003-6-25 23:29:14&quot;; <BR>  $ Date_2 = &quot;1982-10-1&quot;; <BR>  $ Date_List_1 = explode (&quot;-&quot;,$ Date_1); <BR>  $ Date_List_2 = explode (&quot;-&quot;,$ Date_2); <BR>  $ d1 = mktime (0,0,0, $ Date_List_1 [1], $ Date_List_1 [2], $ Date_List_1 [0]); <BR>  $ d2 = mktime (0,0,0, $ Date_List_2 [1], $ Date_List_2 [2], $ Date_List_2 [0]); <BR>  $ Days = round (($ d1-$ d2) / 3600/24); <BR>  Echo &quot;even have been fighting for $ Days days&quot;; <BR>  ? &quot; <BR><ul></ul> ]]></description>
</item>
<item>
<title>Compressing and Decompressing Data using JavaTM APIs (1)</title>
<link>http://www.tutorialsto.com/index.php/jsp/application/compressing-and-decompressing-data-using-javatm-apis-1.html</link>
<guid>http://www.tutorialsto.com/index.php/jsp/application/compressing-and-decompressing-data-using-javatm-apis-1.html</guid>
<pubDate>Wed, 26 Aug 2009 22:08:15 +0000</pubDate>
<description><![CDATA[ <H2>  Compressing and Decompressing Data using Java <SUP>TM</sup> APIs </H2><p>  <B>by Qusay H. Mahmoud</b> <B><BR></b>  <B>with contributions from Konstantin Kladko</b> <BR>  <I>February 2002</i> </P><p>  Many sources of information contain redundant data or data that adds little to the stored information. This results in tremendous amounts of data being transferred between client and server applications or computers in general. The obvious solution to the problems of data storage and information transfer is to install additional storage devices and expand existing communication facilities. To do so, however, requires an increase in an organization &quot;s operating costs. One method to alleviate a portion of data storage and information transfer is through the representation of data by more efficient code. this article Presents a brief introduction to Data Compression and decompression, and shows How to compress and decompress Data, efficiently and conveniently, from within your Java <SUP>TM</sup> applications using the <CODE>java.util.zip</code> Package. </P><p>  While it is possible to compress and decompress Data using Tools such as <CODE>WinZip gzip</code> and Java ARchive (or <CODE>jar</code> these Tools are used as Standalone applications. It is possible to invoke these Tools from your Java applications, but this is not a straightforward approach and not an efficient solution. This is especially true if you wish to compress and decompress data on the fly (before transferring it to a remote machine for example). This article: </P><UL><LI>  Gives you a brief overview of data compression <LI>  Describes the <CODE>java.util.zip</code> Package <LI>  Shows how to use this package to compress and decompress data <LI>  Shows how to compress and decompress serialized objects to save disk space <LI>  Shows how to compress and decompress data on the fly to improve the performance of client / server applications </LI></UL><H3>  Overview of Data Compression </H3><p>  The simplest type of redundancy in a file is the repetition of characters. For example, consider the following string: </P><p> <CODE>BBBBHHDDXXXXKKKKWWZZZZ</code> </P> <p>  This string can be encoded more compactly by replacing each repeated string of characters by a single instance of the repeated character and a number that represents the number of times it is repeated. The earlier string can be encoded as follows: <p> <CODE>4B2H2D4X4K2W4Z</code> </P> <p>  Here &quot;4B&quot; means four B &quot;s, and 2H means two H&quot; s, and so on. Compressing a string in this way is called <I>run-length encoding.</i> </P><p>  As another example, consider the storage of a rectangular image. As a single color bitmapped image, it can be stored as shown in Figure 1. </P><IMG height=135 alt="figure 1" src=http://edu.tmn.cn/TmnImages/csdn width=370><p>  <I><B>Figure 1: A bitmap with information for run-length encoding</b></i> </P><p>  Another approach might be to store the image as a graphics metafile: </P><p> <CODE>Rectangle 11, 3, 20, 5</code> </P> <p>  This says, the rectangle starts at coordinate (11, 3) of width 20 and length 5 pixels. </P><p>  The rectangular image can be compressed with run-length encoding by counting identical bits as follows: </P><p>  0, 400, 400,10 1,20 0,100,10 1,1 0,18 1,1 0,100,10 1,1 0,18 1,1 0,100,10 1,1 0,18 1,1 0,100,10 1 , 20 0,100,40 </PRE><p>  The first line above says that the first line of the bitmap consists of 40 0 &quot;s. The third line says that the third line of the bitmap consists of 10 0&quot; s followed by 20 1 &quot;s followed by 10 more 0&quot; s, and so on for the other lines. </P><p>  Note that run-length encoding requires separate representations for the file and its encoded version. Therefore, this method cannot work for all files. Other compression techniques include variable-length encoding (also known as Huffman Coding), and many others. For more information , there are many books available on data and image compression techniques. </P><p>  There are many benefits to data compression. The main advantage of it, however, is to reduce storage requirements. Also, for data communications, the transfer of compressed data over a medium results in an increase in the rate of information transfer. Note that data compression can be implemented on existing hardware by software or through the use of special hardware devices that incorporate compression techniques. Figure 2 shows a basic data-compression block diagram. <p><CENTER><IMG height=114 alt="figure 2" src=http://edu.tmn.cn/TmnImages/csdn width=386><BR>  <I><B>Figure 2: Data-compression block diagram</b></i> </CENTER><H4>  ZIP vs. GZIP </H4><p>  If you are Working on Windows, you might be familiar with the WinZip tool, which is used to Create a compressed archive and to extract Files from a compressed archive. On UNIX, however, things are done a bit differently. The <CODE>tar</code> command is used to Create an archive (not compressed) and another Program <CODE>gzip</code> or <CODE>compress</code> is used to compress the archive. </P><p>  Tools such as <CODE>WinZip</code> and <CODE>PKZIP</code> act as both an archiver and a compressor. They compress Files and Store them in an archive. On the other hand, <CODE>gzip</code> does not archive Files. Therefore, on UNIX, the <CODE>tar</code> command is usually used to Create an archive then the <CODE>gzip</code> command is used to compress the Archived file. </P><H3>  The java.util.zip Package </H3><p>  Java provides the <CODE>java.util.zip</code> Package for zip-compatible Data Compression. It provides Classes that allow you to read, Create, and modify ZIP and GZIP file formats. It also provides Utility Classes for Computing checksums of arbitrary Input streams that can be used to validate input data. This package provides one interface, fourteen classes, and two exception classes as shown in Table 1. </P><p>  <I><B>Table 1: The java.util.zip package</b></i> </P><TABLE border=2><TBODY><TR><TH>  Item </TH><TH>  Type </TH><TH>  Description </TH></TR><TR><TD> <CODE>Checksum</code> </TD> <TD>  Interface </TD><TD>  Represents a Data Checksum. Implemented by the Classes <CODE>Adler32</code> and <CODE>CRC32</code> </TD></TR><TR><TD> <CODE>Adler32</code> </TD> <TD>  Class </TD><TD>  Used to compute the Adler32 checksum of a data stream </TD></TR><TR><TD> <CODE>CheckedInputStream</code> </TD> <TD>  Class </TD><TD>  An input stream that maintains the checksum of the data being read </TD></TR><TR><TD> <CODE>CheckedOutputStream</code> </TD> <TD>  Class </TD><TD>  An output stream that maintains the checksum of the data being written </TD></TR><TR><TD> <CODE>CRC32</code> </TD> <TD>  Class </TD><TD>  Used to compute the CRC32 checksum of a data stream </TD></TR><TR><TD> <CODE>Deflater</code> </TD> <TD>  Class </TD><TD>  Supports general compression using the ZLIB compression library </TD></TR><TR><TD> <CODE>DeflaterOutputStream</code> </TD> <TD>  Class </TD><TD>  An output stream filter for compressing data in the deflate compression format </TD></TR><TR><TD> <CODE>GZIPInputStream</code> </TD> <TD>  Class </TD><TD>  An input stream filter for reading compressed data in the GZIP file format </TD></TR><TR><TD> <CODE>GZIPOutputStream</code> </TD> <TD>  Class </TD><TD>  An output stream filter for writing compressed data in the GZIP file format </TD></TR><TR><TD> <CODE>Inflater</code> </TD> <TD>  Class </TD><TD>  Supports general decompression using the ZLIB compression library </TD></TR><TR><TD> <CODE>InlfaterInputStream</code> </TD> <TD>  Class </TD><TD>  An input stream filter for decompressing data in the deflate compression format </TD></TR><TR><TD> <CODE>ZipEntry</code> </TD> <TD>  Class </TD><TD>  Represents a ZIP file entry </TD></TR><TR><TD> <CODE>ZipFile</code> </TD> <TD>  Class </TD><TD>  Used to read entries from a ZIP file </TD></TR><TR><TD> <CODE>ZipInputStream</code> </TD> <TD>  Class </TD><TD>  An input stream filter for reading files in the ZIP file format </TD></TR><TR><TD> <CODE>ZipOutputStream</code> </TD> <TD>  Class </TD><TD>  An output stream filter for writing files in the ZIP file format </TD></TR><TR><TD> <CODE>DataFormatException</code> </TD> <TD>  Exception Class </TD><TD>  Thrown to signal a data format error </TD></TR><TR><TD> <CODE>ZipException</code> </TD> <TD>  Exception Class </TD><TD>  Thrown to signal a zip error </TD></TR></TBODY></TABLE><p><BLOCKQUOTE><HR>  <B>Note:</b> The ZLIB compression library was initially developed as part of the Portable Network Graphics (PNG) standard that is not protected by patents. <HR></BLOCKQUOTE><H3>  Decompressing and Extracting Data from a ZIP file </H3><p>  The <CODE>java.util.zip</code> Package provides Classes for Data Compression and decompression. Decompressing a ZIP file is a matter of Reading Data from an Input Stream. The <CODE>java.util.zip</code> Package provides a <CODE>ZipInputStream</code> class for Reading ZIP Files. A <CODE>ZipInputStream</code> can be created just like any other input stream. For example, the following segment of code can be used to create an input stream for reading data from a ZIP file format: </P><p>  FileInputStream fis = new FileInputStream ( &quot;figs.zip&quot;); ZipInputStream zin = new ZipInputStream (new BufferedInputStream (fis)); </PRE><p>  Once a ZIP Input Stream is opened, you can read the zip entries using the <CODE>getNextEntry</code> method which returns a <CODE>ZipEntry</code> object. If the end-of-file is reached, <CODE>getNextEntry</code> returns <CODE>null</code> <p>  ZipEntry entry; while ((entry = zin.getNextEntry ())! = Null) (/ / extract data / / open output streams) </PRE><p>  Now, it is time to set up a decompressed output stream, which can be done as follows: </P><p>  int BUFFER = 2048; FileOutputStream fos = new FileOutputStream (entry.getName ()); BufferedOutputStream dest = new BufferedOutputStream (fos, BUFFER); </PRE><p><BLOCKQUOTE><HR>  <B>Note:</b> In this segment of code we have used the <CODE>BufferedOutputStream</code> instead of the <CODE>ZIPOutputStream</code> The <CODE>ZIPOutputStream</code> and the <CODE>GZIPOutputStream</code> use internal buffer sizes of 512. The use of the <CODE>BufferedOutputStream</code> is only justified when the size of the buffer is much more than 512 (in this example it is set to 2048). While the <CODE>ZIPOutputStream</code> doesn &quot;t allow you to set the buffer size, in the case of the <CODE>GZIPOutputStream</code> however, you can specify the internal buffer size as a constructor argument. <HR></BLOCKQUOTE><p>  In this segment of code, a file Output Stream is Created using the entry &quot;s name, which can be Retrieved using the <CODE>entry.getName</code> method. Source zipped Data is then read and written to the decompressed Stream: </P><p>  while ((count = zin.read (data, 0, BUFFER))! = -1) (/ / System.out.write (x); dest.write (data, 0, count);) </PRE><p>  And finally, close the input and output streams: </P><p>  dest.flush (); dest.close (); zin.close (); </PRE><p>  The source program in Code Sample 1 shows how to decompress and extract files from a ZIP archive. To test this sample, compile the class and run it by passing a compressed file in ZIP format: </P><p> <CODE><B>prompt&gt;</b> java UnZip somefile.zip</code> </P> <p>  Note that <CODE>somefile.zip</code> could be a ZIP archive Created using any ZIP-compatible tool, such as WinZip. </P><p>  <B>Code Sample 1:</b> UnZip.java <p><p>  import java.io. *; import java.util.zip .*; public class UnZip (final int BUFFER = 2048; public static void main (String argv []) (try (BufferedOutputStream dest = null; FileInputStream fis = new FileInputStream ( argv [0]); ZipInputStream zis = new ZipInputStream (new BufferedInputStream (fis)); ZipEntry entry; while ((entry = zis.getNextEntry ())! = null) (System.out.println ( &quot;Extracting:&quot; + entry ); int count; byte data [] = new byte [BUFFER]; / / write the files to the disk FileOutputStream fos = new FileOutputStream (entry.getName ()); dest = new BufferedOutputStream (fos, BUFFER); while (( count = zis.read (data, 0, BUFFER))! = -1) (dest.write (data, 0, count);) dest.flush (); dest.close ();) zis.close (); ) catch (Exception e) (e.printStackTrace ();))) </PRE><p>  It is important to Note that the <CODE>ZipInputStream</code> class reads ZIP Files sequentially. The class <CODE>ZipFile</code> however, reads the contents of a ZIP file using a random access file internally so that the entries of the ZIP file do not have to be read sequentially. </P><p><BLOCKQUOTE><HR>  <B>Note:</b> Another fundamental difference between <CODE>ZIPInputStream</code> and <CODE>ZipFile</code> is in terms of caching. Zip entries are not cached when the file is read using a combination of <CODE>ZipInputStream</code> and <CODE>FileInputStream</code> However, if the file is opened using <CODE>ZipFile(fileName)</code> then it is cached internally , so if <CODE>ZipFile(fileName)</code> is called again the file is opened only once. The cached Value is used on the second Open. If you work on UNIX, it is worth noting that all zip Files opened using <CODE>ZipFile</code> are Memory mapped, and therefore the Performance of <CODE>ZipFile</code> is Superior to <CODE>ZipInputStream</code> If the contents of the same zip file, however, are be to frequently changed and reloaded during Program execution, then using <CODE>ZipInputStream</code> is Preferred. <HR></BLOCKQUOTE><p>  This is How a ZIP file can be decompressed using the <CODE>ZipFile</code> class: </P><OL><LI>  Create a <CODE>ZipFile</code> object by specifying the ZIP file to be read either as a <CODE>String</code> filename or as a <CODE>File</code> object: <p> <CODE>ZipFile zipfile = new ZipFile(&quot;figs.zip&quot;);</code> <p> </P><LI>  Use the <CODE>entries</code> method, returns an <CODE>Enumeration</code> object, to loop through all the <CODE>ZipEntry</code> Objects of the file: <p>  while (e.hasMoreElements ()) (entry = (ZipEntry) e.nextElement (); / / read contents and save them) </PRE><LI>  Read the contents of a specific <CODE>ZipEntry</code> within the ZIP file by passing the <CODE>ZipEntry</code> to <CODE>getInputStream</code> which will return an <CODE>InputStream</code> object from which you can read the entry &quot;s contents: <p>  is = new BufferedInputStream (zipfile.getInputStream (entry)); </PRE><p></P><LI>  Retrieve the entry &quot;s filename and create an output stream to save it: <p>  byte data [] = new byte [BUFFER]; FileOutputStream fos = new FileOutputStream (entry.getName ()); dest = new BufferedOutputStream (fos, BUFFER); while ((count = is.read (data, 0, BUFFER)) ! = -1) (dest.write (data, 0, count);) </PRE><LI>  Finally, close all input and output streams: <p>  dest.flush (); dest.close (); is.close (); </PRE></LI></OL><p>  The complete source program is shown in Code Sample 2. Again, to test this class, compile it and run it by passing a file in a ZIP format as an argument: </P><p> <CODE><B>prompt&gt;</b> java UnZip2 somefile.zip</code> </P> <p>  <B>Code Sample 2:</b> UnZip2.java </P><p>  import java.io. *; import java.util .*; import java.util.zip .*; public class UnZip2 (static final int BUFFER = 2048; public static void main (String argv []) (try (BufferedOutputStream dest = null; BufferedInputStream is = null; ZipEntry entry; ZipFile zipfile = new ZipFile (argv [0]); Enumeration e = zipfile.entries (); while (e.hasMoreElements ()) (entry = (ZipEntry) e.nextElement () ; System.out.println ( &quot;Extracting:&quot; + entry); is = new BufferedInputStream (zipfile.getInputStream (entry)); int count; byte data [] = new byte [BUFFER]; FileOutputStream fos = new FileOutputStream (entry. getName ()); dest = new BufferedOutputStream (fos, BUFFER); while ((count = is.read (data, 0, BUFFER))! = -1) (dest.write (data, 0, count);) dest . flush (); dest.close (); is.close ();)) catch (Exception e) (e.printStackTrace ();))) </PRE><H3>  Compressing and Archiving Data in a ZIP File </H3><p>  The <CODE>ZipOutputStream</code> can be used to compress Data to a ZIP file. The <CODE>ZipOutputStream</code> writes Data to an Output Stream in a ZIP format. There are a number of steps involved in Creating a ZIP file. </P><OL><LI>  The first step is to Create a <CODE>ZipOutputStream</code> object, to which we pass the Output Stream of the file we wish to Write to. Here is How you Create a ZIP file entitled &quot;myfigs.zip&quot;: <p>  FileOutputStream dest = new FileOutputStream ( &quot;myfigs.zip&quot;); ZipOutputStream out = new ZipOutputStream (new BufferedOutputStream (dest)); </PRE><LI>  Once the target zip Output Stream is Created, the next step is to Open the source Data file. In this example, source Data Files are those Files in the Current Directory. The <CODE>list</code> command is used to get a List of Files in the Current Directory : <p>  File f = new File (&quot;.&quot;); String files [] = f.list (); for (int i = 0; i &lt;files.length; i + +) (System.out.println ( &quot;Adding:&quot; + files [i]); FileInputStream fi = new FileInputStream (files [i]); / / create zip entry / / add entries to ZIP file) </PRE><p><HR>  <B>Note:</b> This code sample is capable of compressing all files in the current directory. It doesn &quot;t handle subdirectories. As an exercise, you may want to modify Code Sample 3 to handle subdirectories. <HR><BR><BR><LI>  Create a zip entry for each file that is read: <p> <CODE>ZipEntry entry = new ZipEntry(files[i]))</code> <p> </P><LI>  Before you can Write Data to the ZIP Output Stream, you must first put the zip entry object using the <CODE>putNextEntry</code> method: <p> <CODE>out.putNextEntry(entry);</code> <p> </P><LI>  Write the data to the ZIP file: <p>  int count; while ((count = origin.read (data, 0, BUFFER))! = -1) (out.write (data, 0, count);) </PRE><LI>  Finally, you close the input and output streams: <p>  origin.close (); out.close (); </PRE></LI></OL><p>  The complete source program is shown in Code Sample 3. </P><p>  <B>Code Sample 3:</b> Zip.java </P><p>  import java.io. *; import java.util.zip .*; public class Zip (static final int BUFFER = 2048; public static void main (String argv []) (try (BufferedInputStream origin = null; FileOutputStream dest = new FileOutputStream ( &quot;c: \ \ zip \ \ myfigs.zip&quot;); ZipOutputStream out = new ZipOutputStream (new BufferedOutputStream (dest)); / / out.setMethod (ZipOutputStream.DEFLATED); byte data [] = new byte [BUFFER]; / / get a list of files from current directory File f = new File (&quot;.&quot;); String files [] = f.list (); for (int i = 0; i &lt;files.length; i + +) (System. out.println ( &quot;Adding:&quot; + files [i]); FileInputStream fi = new FileInputStream (files [i]); origin = new BufferedInputStream (fi, BUFFER); ZipEntry entry = new ZipEntry (files [i]); out . putNextEntry (entry); int count; while ((count = origin.read (data, 0, BUFFER))! = -1) (out.write (data, 0, count);) origin.close ();) out.close ();) catch (Exception e) (e.printStackTrace ();))) </PRE><p><HR>  <B>Note:</b> Entries can be added to a ZIP file either in a compressed (deflated) or uncompressed (STORED) form. The <CODE>setMethod</code> can be used to set the method of Storage. For example, to set the method to deflated (compressed) use: <CODE>out.setMethod(ZipOutputStream.DEFLATED)</code> and to set it to STORED (not compressed) use: <CODE>out.setMethod(ZipOutputStream.STORED)</code> <HR><p></P><H4>  ZIP File Properties </H4><p>  The <CODE>ZipEntry</code> class describes a compressed file stored in a ZIP file. The various methods contained in this class can be used to set and get pieces of information about the entry. The <CODE>ZipEntry</code> class is used by the <CODE>ZipFile</code> and <CODE>ZipInputStream</code> to read ZIP Files, and the <CODE>ZipOutputStream</code> to Write ZIP Files. Some of the most useful methods available in the <CODE>ZipEntry</code> class are shown, along with a description, in Table 2. </P><p>  <I><B>Table 2: Some useful methods from the ZipEntry class</b></i> </P><TABLE border=2><TBODY><TR><TH>  Method Signature </TH><TH>  Description </TH></TR><TR><TD> <CODE>public String getComment()</code> </TD> <TD>  Returns the comment string for the entry, null if none </TD></TR><TR><TD> <CODE>public long getCompressedSize()</code> </TD> <TD>  Returns the compressed size of the entry, -1 if not known </TD></TR><TR><TD> <CODE>public int getMethod()</code> </TD> <TD>  Returns the compression method of the entry, -1 if not specified </TD></TR><TR><TD> <CODE>public String getName()</code> </TD> <TD>  Returns the name of the entry </TD></TR><TR><TD> <CODE>public long getSize()</code> </TD> <TD>  Returns the uncompressed zip of the entry, -1 if unknown </TD></TR><TR><TD> <CODE>public long getTime()</code> </TD> <TD>  Returns the modification time of the entry, -1 if not specified </TD></TR><TR><TD> <CODE>public void setComment(String c)</code> </TD> <TD>  Sets the optional comment string for the entry </TD></TR><TR><TD> <CODE>public void setMethod(int method)</code> </TD> <TD>  Sets the compression method for the entry </TD></TR><TR><TD> <CODE>public void setSize(long size)</code> </TD> <TD>  Sets the uncompressed size of the entry </TD></TR><TR><TD> <CODE>public void setTime(long time)</code> </TD> <TD>  Sets the modification time of the entry </TD></TR></TBODY></TABLE><H4>  Checksums </H4><p>  Some of the other important Classes in the <CODE>java.util.zip</code> Package are the <CODE>Adler32</code> and <CODE>CRC32</code> Classes, which implement the <CODE>java.util.zip.Checksum</code> Interface and Compute the checksums required for Data Compression. The <CODE>Adler32</code> algorithm is known to be Faster than the <CODE>CRC32</code> and it is as reliable. The <CODE>getValue</code> method can be used to obtain the Current Value of the Checksum. The <CODE>reset</code> method can be used to RESET the Checksum to its default Value. </P><p>  Checksums can be used to mask corrupted files or messages. For example, suppose you want to create a ZIP file then transfer it to a remote machine. Once it is at the remote machine, using the checksum you can check whether the file got corrupted during the transmission. To demonstrate How to Create checksums, we modify Code Sample 1 and Code Sample 3 to use <CODE>CheckedInputStream</code> and <CODE>CheckedOutputStream</code> as shown in Code Sample 4 and Code Sample 5. </P><p>  <B>Code Sample 4:</b> Zip.java </P><p>  import java.io. *; import java.util.zip .*; public class Zip (static final int BUFFER = 2048; public static void main (String argv []) (try (BufferedInputStream origin = null; FileOutputStream dest = new FileOutputStream <B>(</b> &quot;c: \ \ zip \ \ <B>myfigs.zip&quot;);</b> CheckedOutputStream <B>checksum = new CheckedOutputStream (dest, new Adler32</b> ()); <B>ZipOutputStream out = new ZipOutputStream (new BufferedOutputStream (checksum));</b> / / out.setMethod (ZipOutputStream. DEFLATED); byte data [] = new byte [BUFFER]; / / get a list of files from current directory File f = new File (&quot;.&quot;); String files [] = f.list (); for (int i = 0; i &lt;files.length; i + +) (System.out.println ( &quot;Adding:&quot; + files [i]); FileInputStream fi = new FileInputStream (files [i]); origin = new BufferedInputStream (fi, BUFFER) ; ZipEntry entry = new ZipEntry (files [i]); out.putNextEntry (entry); int count; while ((count = origin.read (data, 0, BUFFER))! = -1) (out.write (data , 0, <B>count);)</b> origin.close <B>();)</b> out.close (); <B>System.out.println</b> ( <B>&quot;checksum:&quot; + checksum.getChecksum (). getValue</b> ());) catch (Exception e) (e . printStackTrace ();))) </PRE><p>  <B>Code Sample 5:</b> UnZip.java </P><p>  import java.io. *; import java.util.zip .*; public class UnZip (public static void main (String argv []) (try (final int BUFFER = 2048; BufferedOutputStream dest = null; FileInputStream fis = new FileInputStream ( argv <B>[0]);</b> CheckedInputStream <B>checksum = new CheckedInputStream (fis, new Adler32 ()); ZipInputStream zis = new ZipInputStream (new BufferedInputStream (checksum));</b> ZipEntry entry; while <B>((entry = zis.getNextEntry ())! =</b> null ) (System.out.println ( &quot;Extracting:&quot; + entry); int count; byte data [] = new byte [BUFFER]; / / write the files to the disk FileOutputStream fos = new FileOutputStream (entry.getName ()) ; dest = new BufferedOutputStream (fos, BUFFER); while ((count = zis.read (data, 0, BUFFER))! = -1) (dest.write (data, 0, count);) dest.flush () <B>;</b> dest.close <B>();)</b> zis.close (); <B>System.out.println</b> ( <B>&quot;Checksum:&quot; + checksum.getChecksum (). getValue</b> ());) catch (Exception e) (e.printStackTrace ();) )) </PRE><p>  To Test Code Sample 4 and 5, compile the Classes and then Run the <CODE>Zip</code> class to Create a ZIP archive (a Checksum Value will be calculated and Printed on the screen for your information) and then Run the <CODE>UnZip</code> class to decompress the archive (a checksum value will be printed on the console). The two values must be exactly the same, otherwise the file is corrupted. Checksums are very useful in validating data. For example, you can create a ZIP file and send it to your friend along with a checksum. Your friend unzips the file and compares the checksum with the one you provided, if they are the same your friend knows that the file is authentic. </P><H3>  Compressing Objects </H3><p>  We have seen how to compress data available in file form and add it to an archive. But what if the data you wish to compress is not available in a file? Assume for example, that you are transferring large objects over sockets. To improve the Performance of your application, you may want to compress the Objects before sending them across the Network and uncompress them at the destination. As another example, let &quot;s say you want to Save Objects on the Disk in compressed format. The <CODE>ZIP</code> format, which is record-based, is not really suitable for this job. The GZIP is more appropriate as it operates on a single stream of data. </P><p>  Now, let &quot;s see an example of How to compress Objects before writing them on Disk and How to decompress them after Reading them from the Disk. Code Sample 6 is a simple class that implements the <CODE>Serializable</code> Interface to Signal the JVM <strong><SUP>1</sup></strong> that we wish to serialize instances of this class. </P><p>  <B>Code Sample 6:</b> Employee.java </P><p>  import java.io. *; public class Employee implements Serializable (String name; int age; int salary; public Employee (String name, int age, int salary) (this.name = name; this.age = age; this.salary = salary;) public void print () (System.out.println ( &quot;Record for:&quot; + name); System.out.println ( &quot;Name:&quot; + name); System.out.println ( &quot;Age:&quot; + age); System.out.println ( &quot;Salary:&quot; + salary);)) </PRE><p>  Now, Write another class that creates a couple of Objects from the <CODE>Employee</code> class. Code Sample 7 creates two Objects <CODE>sarah</code> and <CODE>sam</code> of the <CODE>Employee</code> class, then saves their State in a file in a compressed format. </P><p>  <B>Code Sample 7 SaveEmployee.java</b> </P><p>  import java.io. *; import java.util.zip .*; public class SaveEmployee (public static void main (String argv []) throws Exception (/ / create some objects Employee sarah = new Employee ( &quot;S. Jordan&quot;, 28, 56000); Employee sam = new Employee ( &quot;S. McDonald&quot;, 29, 58000); / / serialize  ]]></description>
</item>
<item>
<title>Magical asp + in global.asax</title>
<link>http://www.tutorialsto.com/index.php/dotnet/development/magical-asp-in-global-asax.html</link>
<guid>http://www.tutorialsto.com/index.php/dotnet/development/magical-asp-in-global-asax.html</guid>
<pubDate>Wed, 26 Aug 2009 22:07:50 +0000</pubDate>
<description><![CDATA[ <table><tr><td class=t14>  / * <br />  Tofu is fine <br />  http://www.asp888.net technical points such as tofu, reproduced Please keep this copyright information <br />  * / <br />  In the asp of the previous article I talked about how to implement in the asp page statistics, but such programs have such a problem is that the only statistics of individual pages, we can easily asp + implementation of the whole site Statistics in asp.net page in the original asp in the global.asa is adjusted to become one of the global.asax In addition to the previous four events were added to two events Application_BeginRequest and Application_EndRequest <br />  These two events on the site any time a file is requested will be excited, so we took advantage of this incident to achieve access to the site statistics we first take a look at the global.asax file <br />  &lt;script language=&quot;VB&quot; runat=&quot;server&quot;&gt; <br />  Sub Application_Start (Sender As Object, E As EventArgs) <br /><br />  End Sub <br /><br />  Sub Application_End (Sender As Object, E As EventArgs) <br />  We piggyback realized the site&#39;s current online <br />  dim intOnlineNumber as integer <br />  intOnlineNumber = cInt (Application ( &quot;ONLINENUMBER&quot;)) -1 <br />  Application ( &quot;ONLINENUMBER&quot;) = intOnlineNumber <br />  End Sub <br /><br />  Sub Session_Start (Sender As Object, E As EventArgs) <br />  Application.Lock <br />  intOnlineNumber = cInt (Application ( &quot;ONLINENUMBER&quot;)) +1 <br />  Application ( &quot;ONLINENUMBER&quot;) = intOnlineNumber +1 <br />  Application.UnLock <br />  End Sub <br /><br />  Sub Session_End (Sender As Object, E As EventArgs) <br /><br />  End Sub <br /><br />  Sub Application_BeginRequest (Sender As Object, E As EventArgs) <br />  This is where the <br />  response.write ( &quot;the current visit of the page is&quot; + Request.FilePath + &quot;&lt;br&gt;&quot;) <br />  Now that we can get FilePAth then we just put this argument in detail a wide range of statistics could be a <br />  End Sub <br /><br />  Sub Application_EndRequest (Sender As Object, E As EventArgs) <br /><br />  End Sub <br />  &lt;/ script&gt; <br />  Well, after the end of all, we visited the site on any aspx file, will be found at the top line of text: The current visit to the page is.  .  .  . <br />  How, do not hurry it a try?  ? <br /><br /><br />  Author: tofu () <br /><br /><br /></td></tr></table></td> ]]></description>
</item>
<item>
<title>Anonymous Classes in JavaScript and the XMLHttpRequest API</title>
<link>http://www.tutorialsto.com/index.php/website/ajax/anonymous-classes-in-javascript-and-the-xmlhttprequest-api.html</link>
<guid>http://www.tutorialsto.com/index.php/website/ajax/anonymous-classes-in-javascript-and-the-xmlhttprequest-api.html</guid>
<pubDate>Wed, 26 Aug 2009 22:07:35 +0000</pubDate>
<description><![CDATA[ <p>  Todd Ditchendorf has written up his thoughts on JavaScript, and API usage. </p><p>  <strong>He discusses the XmlHttpRequest API,</strong> and some of its ugliness, and gets into the way popular wrappers of the API work a la: </p><blockquote><p>  var client = new BetterHttpClientAPI (); client.addListener ((id: 123, responseReceived: function (evt) (....), otherHelperMethod: function () (....))); </pre></blockquote><p>  JavaScript is a prototype-based OO language, and I find that it is best to NOT try to make it look like a class based one, so the idea of having a JavaScript &quot;object&quot; which has properties, some of which are functions, is a natural way to design an API. </p><p>  This isn&#39;t exactly anonymous inner classes, as that isn&#39;t the way JavaScript works. </p><p>  As we see more and more people jump into JavaScript I think we need to do a better job on selling the prototype system, and not try to think of class based languages that we may also use and try to fit JavaScript into that world:) </p> ]]></description>
</item>
<item>
<title>Background of ever-changing script</title>
<link>http://www.tutorialsto.com/index.php/website/javascript/background-of-ever-changing-script.html</link>
<guid>http://www.tutorialsto.com/index.php/website/javascript/background-of-ever-changing-script.html</guid>
<pubDate>Wed, 26 Aug 2009 22:07:12 +0000</pubDate>
<description><![CDATA[   <strong>Welcome site home page ~</strong> <br><!--:<body>--><SCRIPT language="javascript＞" <!-- var pos=10;function initArray(){this.length=initArray.arguments.length; for(var i=0;i<this.length;i++){this[i]=initArray.arguments[i];}} var col=new initArray("4b","5b","8b","8b"); col[0]=yellow ;col[1]=coral ;col[2]=orange ;col[3]=red ; col[4]=greenyellow ;col[5]=lime ;col[6]=turquoise ;col[7]=coral ; col[8]=blueviolet ;col[9]=violet ; function chgCol(){pos++;if(pos<0||pos>9){pos=0;}document.bgColor=col[pos];setTimeout("chgCol()",3000);/*.*/}var yourwords="";var buffer1=" ";var buffer2=" ";var message1=buffer1+yourwords+buffer2;var dir="left";var speed=150;function pingpong(){if(dir=="left"){message2=message1.substring(2,message1.length)+" ";window.status=message2;setTimeout("pingpong();",speed);message1=message2;if(message1.substring(0,1)=="*")dir="right";}else{message2=" "+message1.substring(0,message1.length-2);window.status=message2;setTimeout("pingpong();",speed);message1=message2;if(message1.substring(message1.length-1,message1.length)=="*")dir="left";}}//--></SCRIPT><!--:<body>--> ]]></description>
</item>
<item>
<title>A safe and stable database SQLSERVER</title>
<link>http://www.tutorialsto.com/index.php/database/sqlserver/a-safe-and-stable-database-sqlserver.html</link>
<guid>http://www.tutorialsto.com/index.php/database/sqlserver/a-safe-and-stable-database-sqlserver.html</guid>
<pubDate>Wed, 26 Aug 2009 22:06:42 +0000</pubDate>
<description><![CDATA[   A safe and stable SQL SERVER Database <br><BR>  1, first of all you have to confirm your identification model: WIN NT authentication mode or mixed mode of it, which mixed-mode, including WIN NT authentication mode and differential mode SQL SERVER steps in the implementation of a differential mode to verify the use of a trusted connection 2, set the identification mode 3, shut down and restart the MSSQLServer service program 4, create a WIN NT group and user 5, authorization WIN NT group and user access to SQL Server6, using non-trusted connection for the user to create SQL Server login account <BR><BR>  Second, for users and roles assigned login ID 3, the right to log on to the role assignment 4, for users and roles assigned permissions <BR><BR>    SQL Server 7.0 family in improving the security mechanism achieved by the process, Microsoft has established a flexible and powerful security management mechanism, which allows users to access SQL Server and database server system to conduct a comprehensive security management.  In accordance with the steps described in this article, you can for the SQL Server 7.0 (or 2000) to construct a flexible, manageable security policy, and its safety tests. <BR><BR>  First, authentication method choice   In this paper, verification (authentication) and authorization (authorization) of these two concepts for different interpretations.  Authentication refers to the test the user&#39;s identity; authorization is one that allows the user what to do.  In this discussion, the verification process in the SQL Server when the user logs on the emergence of the authorization process in the user attempts to access data or execute commands a time.    construct security strategy first step is to determine which method to use SQL Server authentication user.  SQL Server authentication is to a group of accounts, passwords and the Master database, a list of Sysxlogins table match.  Windows NT/2000 authentication is to ask the domain controller checks user identity&#39;s legitimacy.  In general, if the server can access the domain controller, we should use the Windows NT/2000 authentication.  Can be a Win2K domain controller server, it can be NT server.  In either case, SQL Server have received an access token (Access Token).  Access token is constructed in the verification process in a special list, which contains the user&#39;s SID (security identification number) and a range of users where the group SID.  As described later in this article, SQL Server as the basis of these SID to grant access.  Note that the operating system how to construct the access token is not important, SQL Server to use only the access token of the SID.  In other words, whether you use the SQL Server 2000, SQL Server 7.0, Win2K or NT does not matter to verify the results are the same.    If you are using SQL Server authentication login, its biggest advantage is very easy to achieve through the Enterprise Manager, the biggest drawback is that SQL Server authenticated login is only valid for a specific server, that is, in a multi-server environment management more difficult.  SQL Server authentication using the second important drawback is that, for each database, we must separately for its administrative privileges.  If a user on the two databases have the same access requirements, we have to manually set the permissions for the two databases, or write a script to set permissions.  If the relatively small number of users, such as 25 below, and these changes in the user&#39;s permission is not very frequent, SQL Server authenticated login may apply.  However, in almost all other cases (with some exceptions, such as direct management of security applications), this log-style management burden will exceed its advantages. <BR><BR>  2, Web environment, the verification   even the best security policy is often in a case before the yield, this case is the use of Web applications, SQL Server data.  In this case, to verify the typical way is to a group of SQL Server login name and password embedded into the Web server to run programs, such as the ASP page or CGI script; and then verified by the Web server is responsible for the user, the application is used its own logon account (or a system administrator sa account, or for convenience, use the Sysadmin server role in the login account) for the user to access the data.    This arrangement has several drawbacks, the most important include: It does not have a user on the server the ability to audit the activities of entirely dependent on Web applications to achieve user authentication, when the SQL Server need to limit user rights is different from that difficult to distinguish between users.  If you are using IIS 5.0 or IIS 4.0, you can authenticate users in four ways.  The first method is for each and every one a web site virtual directory to create an anonymous user&#39;s NT account.  Since then, all applications when they log on SQL Server to use the security environment.  We can grant the appropriate permissions to NT anonymous accounts, improved auditing and validation.    The second method is to allow all sites to use Basic authentication.  At this point, only when a user in the dialog box enter a legitimate account and password, IIS will allow them to access the page.  IIS on an NT security database to achieve logon authentication, NT security database either on the local server can also be the domain controller.  When a user runs a program to access SQL Server database or a script, IIS the user to browse page provided identity information sent to the server.  If you use this method, it should be remembered: In normal circumstances, between the browser and the server the password is not encrypted transmission in general, for those who use Basic authentication and secure and importance of the website, you must implement the SSL (Secure Sockets Layer, Secure Sockets Layer).    on the client to use only IE 5.0, IE 4.0, IE 3.0 browser case, you can use a third authentication method.  You can Web sites and virtual directories on the NT authentication is enabled.  IE will log on the computer the user identity information sent to the IIS, when the user tries to log on SQL Server, IIS on the use of the login information.  Using this simplified approach, we can in a remote site&#39;s domain to authenticate the user (the remote site to log on to a Web server running the domain has a trust relationship domain).    Finally, if the user has a personal digital certificate, you can put those certificates mapped to this region of the NT account.  Personal digital certificate and the server digital certificate to the same technology as the foundation, it proves the legitimacy of the user identity, it can replace NT&#39;s Challenge / Response (Challenge / Response) authentication algorithm.  Netscape and IE are automatically on every page request, the certificate information is sent to the IIS.  IIS allows administrators to provide a certificate is mapped to NT accounts tool.  Therefore, we can use digital certificates to replace the usual provision of an account name and password login process.    can be seen, through the NT user account validation that we can use a variety of implementations.  Even when the user through the IIS across the Internet to connect SQL Server, select the still existed.  Therefore, you should NT authentication as the preferred method of user authentication. <BR><BR>  3, set the global group security policy constructed   next step is to determine what the user should belong to the group.  Typically, each organization or application of the user can in accordance with their specific data access requirements into many categories.  For example, the accounting application software, the user generally include: data entry operator, data entry manager, report writers, accountants, auditors and financial managers.  Each group has a different user database access requirements.    control data access to the easiest way is, for each group of users, respectively, for it creates a group of users permission to meet the requirements, within the global and effective group.  We believe that every application can create separate groups, you can create for the entire enterprise, covering the wide range of user class group.  However, if you want to be able to accurately understand the team members can do for each application separately to create a group is a better choice.  For example, in the previous accounting system, we should create a Data Entry Operators, Accounting Data Entry Managers peer group.  Remember, in order to simplify administration, it is best to take one for the group to demonstrate clearly that the role&#39;s name.    In addition to application-specific groups, we also need a few basic groups.  Basic members of the group responsible for the management server.  In accordance with convention, we can create the following these basic groups: SQL Server Administrators, SQL Server Users, SQL Server Denied Users, SQL Server DB Creators, SQL Server Security Operators, SQL Server Database Security Operators, SQL Server Developers, as well as the DB_Name Users (including DB_Name a database on the server name).  Of course, if necessary, you can create other groups.    create a global group, the next we can grant them access to SQL Server permissions.  First, the SQL Server Users create an NT authenticated login and grant it permission to log on to Master Database is set to its default database, but do not give it permission to access any other database, nor should this login account is set to any server roles members.  Then again for the SQL Server Denied Users repeat this process, but this time to reject login access.  In SQL Server, refused permission to always take precedence.  After the creation of these two groups, we have to allow or deny users a convenient way to access the server.  For those who are not directly in the system tables inside Sysxlogins registration group authorization, we can not use Enterpris Managr, because the Enter-prise Manager only allows us to log the name from the list of options available, rather than within a list of all the groups.  To access all groups, open Query Analyzer, and then use the system stored procedures, as well as sp_addrolemember authorize sp_addsrvrolemember.    operation of the server for each group, we can use stored procedures to the various log sp_addsrvrolemember added to the appropriate server roles: SQL Server Administrators as Sysadmins a member of the role, SQL Server DB Creators to become a member of Dbcreator role, SQL Server Security Operators become Securityadmin the role of members.  Note sp_addsrvrolemember stored procedure the first requirement is that an argument the full path to your account.  For example, BigCo domain JoeS be bigco \ joes (if you want to use a local account, then the path should be server_name \ joes).    To create a new database of all the users exist, you can modify the Model database.  To simplify the work, SQL Server automatically changes all of the Model database, copied to the new database.  As long as the proper use of Model database, we do not need customization for each newly created database.  In addition, we can use sp_addrolemember stored procedure to SQL Server Security Operators to join db_security-admin, the SQL Server Developers added to the db_owner role.    Note that we still do not authorize any group or account access to the database.  In fact, we can not authorize Enterprise Manager database access, because Enterprise Manager user interface that only allows us to extend the database to grant access to a legitimate login account.  SQL Server does not require the NT account in our database, it is set to the role of a member or prior to the allocation of object permissions to access the database, but the Enter-prise Manager have this restriction.  Nevertheless, as long as we are using the sp_addrolemember stored procedure instead of Enterprise Manager, you can not grant access to domain NT account database, the case of the allocation of rights to any NT account.    here so far, the Model database settings have been completed.  However, if your user community in various applications within the enterprise-wide access to the database with similar requirements, you can move these operations the following Model database, rather than a specific application-oriented database on. <BR><BR>  4, allowing database access   within the database, and so far we have login authentication are handled differently, we can assign permissions to roles rather than directly to allocate them to the global group.  This capability enables us to easily use the SQL Server security policy authentication login.  Even if you never want to use SQL Server login accounts, this article still recommend the allocation of permissions to roles, because you can possible changes for the future ready.    created a database, we can use stored procedures sp_grantdbaccess authorized DB_Name Users group to access it.  It should be noted that, with sp_grantdbaccess corresponding sp_denydbaccess stored procedure does not exist, that is, you can not deny server access in accordance with the method denies access to the database.  If you want to refuse to database access, we can create another one called DB_Name Denied Users global group, authorized it to access the database, and then set it to db_denydatareader and db_denydatawriter role members.  Note that SQL statement, the distribution of authority, where the role of restricted access to objects, but does not limit the DDL (Data Definition Language, Data Definition Language) commands access.    As with the login process to address, if any of the access token SID has been registered Sysusers system table, SQL will allow users to access the database.  Therefore, we not only can the user&#39;s personal NT account SID authorized users access the database, you can also where a user (or more) group SID authority.  To simplify management, we can create a database named DB_Name Users have access to the global group, while not to grant access to all the other groups.  In this way, we simply add in a global group or remove members can increase or reduce the database user. <BR><BR>  5, the allocation of authority to implement security policies   The final step is to create a user-defined database roles, and then assign permissions.  The completion of this step, the easiest way is to create a global group name and the name of a number of supporting roles.  For example, for the previous example, the accounting system, we can create Accounting Data Entry Operators, Accounting Data Entry Managers like role.  Since the accounting database processing tasks related to the roles and accounts, you may want to shorten the names of these roles.  However, if the role name and the name of supporting the global group, you can reduce the confusion that can more easily determine which group belongs to a particular role.    after you&#39;ve created the roles can be assigned permissions.  In this process, we simply use the standard GRANT, REVOKE, and DENY commands.  It should be noted DENY permissions, the permissions take precedence over all other permissions.  If the user is the role of any authority or with the DENY members of the group, SQL Server will reject the user access the object.    then we can join all the SQL Server Authentication login.  User-defined database role can contain SQL Server logins and NT global group, local group, individual accounts, which is its most valuable characteristics.  A user-defined database roles can be used as a common variety of log container, we use user-defined roles, rather than directly to the permissions assigned to the global group the main reason for this is it.    As the role of the built-in general apply to the entire database rather than individual objects, so here I suggest you only use two built-in database roles, that is, db_securityadmin and db_owner.  Other built-in database roles, such as db_datareader, it is inside the database to grant SELECT permissions to all objects.  Although you can grant SELECT permission db_datareader role, and then selectively for individual users or groups refuse to SELECT permissions, but using this method, you may forget to set permissions to certain users or objects.  A more simple, more direct and not error-prone method is for these special users to create a user-defined roles, and then only those users to access the object needs to grant this permission to a user-defined roles. <BR><BR>  6, simplified security management     SQL Server authenticated login is not only easily achieved, but also when compared with the NT login authentication, it is more easy to write to the application inside.  However, if the number of users over 25, or the number of servers in more than one, or each user can access more than one database or the database has more than one administrator, SQL Server authenticated login is not easy to manage.  Because SQL Server does not show the user an effective tool for access to memory what each user has access, as well as why they want to obtain the permissions on the more difficult.  Even for a database administrator but also other responsibilities of the small-scale systems, simplifying security policy also help to reduce the complexity of the issues.  Therefore, the preferred method should be is to use NT authentication login, and then through a number of carefully selected global group and database role management database access. <BR><BR>    The following are some rules of thumb to simplify security policy:   users to SQL Server Users Group receives server access, through the DB_Name Users group access to database access.    users to join the global group access permissions, while the global group by adding the role of access rights, the role of direct ownership of the database permissions.    users need to access a variety of global group by adding more than a way to obtain permission.    as long as the planning is done properly, the domain controller you can access and permissions to complete all the maintenance work, making the server a domain controller, you reflect on the various settings to adjust.  Although the practical applications may change, but the basic measures described in this article continue to apply, they can help you construct a very easy to manage security policy. <BR><BR><BR> ]]></description>
</item>
<item>
<title>RedhatLinuxonmyLAPTOP</title>
<link>http://www.tutorialsto.com/index.php/os/linux/redhatlinuxonmylaptop.html</link>
<guid>http://www.tutorialsto.com/index.php/os/linux/redhatlinuxonmylaptop.html</guid>
<pubDate>Wed, 26 Aug 2009 22:06:19 +0000</pubDate>
<description><![CDATA[ <br>  I am a Linux fan, that is like the blind Daogu Linux <strong>operating system.</strong>  The Caca, where I buy a laptop before the laptop repeatedly consider the Linux compatibility, it seems, or Toshiba&#39;s books looked relatively good, hard-hearted and bought Toshbia 5205-S505, which is due to the poor house ISDN, download the stuff is only 7k more Therefore, the aspirations of Linux books upload has not been achieved ... but I always tried to forward to.  .  .  Today, the Internet again to find almost all of the Toshiba driver / IT information, and finally started my Laptop&#39;s <strong>operating system</strong> transformation process. <br>  Hardware, <strong>network</strong> environment: <br>  Computer: Toshiba 5205-S505, Toshiba S2410 (thanks CACA you help me get such a good one books) <br>  <strong>Network</strong> Equipment: Powerise Linux-based AP (students sent) <br>  SMC 7004ABR router (where the holding in advance Xu) <br>  Compaq WL100 WLAN PCMCIA CARD (or in advance where the holding Xu) <br>  Cisco Jumper original number of 5205-S505 network card (! Ntel 10/100 PRO VE) IP: 192.168.002.002 netmask 255.255.255.0 - eth0 <br>  Compaq WL100 WLAN PCMCIA CARD IP: 192.168.168.100 netmask 255.255.255.0 - eth1 <br>  Powerise Linux-based AP IP: 192.168.168.139 netmask 255.255.255.0 - apbr0 <br>  SMC 7004 ABR router IP: 192.168.002.001 netmask 255.255.255.0 <br><br>  Required Software: Redhat Linux 9 <br>  Download: www.linuxeden.com <br>  Linux Kernel 2.4.21 <br>  Download: http://www.kernel.org/pub/linux/ker...-2.4.21.tar.bz2 <br>  Linux Kernel 2.4.21 ACPI patch <br>  Download: http://umn.dl.sourceforge.net/sourc...-2.4.21.diff.gz <br>  Toshiba FnFx patch <br>  Download: http://fnfx.sourceforge.net/fnfx-alpha.tar.gz <br>  Linux-WLAN-NG <br>  Download: ftp://ftp.linux-wlan.org/pub/linux-...2.1-pre9.tar.gz <br><br>  Zoning: <br>  / dev/hda1: 10GB NTFS Windows 2003 Datacenter <br>  / dev/hda2: 4GB FAT32 System backup (put all of my books using Ghost image <strong>file)</strong> <br>  / dev/hda3: 100M EXT3 mount as / boot <br>  / dev/hda4: 512M Linux SWAP <br>  / dev/hda5: 8GB EXT3 mount as / <br>  / dev/hda7: 16GB FAT32 MISCs <br>  / dev/hda8: 18GB NTFS MISCs <br><br>  Redhat 9 the entire installation process is very simple, I chose the Server mode.  Where there is a need for attention is the development environment must be installed, or behind the work is not a dry-up strategy.  RH 9 is the recommended grub boot <strong>program</strong> I put grub installed on hda&#39;s mbr above, at the same time using Windows 2003, ntldr boot. ntldr like this thing in a number of masters who despise Windows, known as M $ the best products.  He is the only one officially supported Chinese boot <strong>process.</strong> <br>  After a good Linux installed, start the terminal (konsole) and then write # dd if = / dev/hda3 of = linux.sec bs = 512 count = 1 <br>  The generated linux.sec <strong>file</strong> copied to / mnt/hda2 / and then start the w2k3, this <strong>file</strong> copied to hda1 on, and then the C: \ boot.ini read-only, <strong>system,</strong> property removed, use notepad to open c: \ boot . in the just add a line c: \ linux.sec = Redhat Linux 9 on the list.  Thus, in 2003, the start menu can be seen inside the Linux <br>  Boot options strategy. <br><br>  Restart Linux with the vi editor / etc / fstab <strong>file,</strong> in the back of the original by adding / dev/hda1 / mnt/hda1 ntfs defaults, iocharset = utf8, umask = 022 0 0 <br>  / dev/hda2 / mnt/hda2 vfat defaults, codepage = 936, iocharset = cp936 0 0 <br>  / dev/hda7 / mnt/hda7 vfat defaults, codepage = 936, iocharset = cp936 0 0 <br>  / dev/hda8 / mnt/hda8 ntfs defaults, iocharset = utf8, umask = 022 0 0 <br>  So that you later use when the other hard disk partition, do not always mount, and <strong>the system</strong> will start automatically when the mount to the various partitions.  Note: do this step, you need to first in / mnt following mkdir hdax (x = 1,2,7,8) <br><br>  Now I began to compile the kernel.  The new kernel from kernel.org, when the top is a pull down. Tar.bz2 <strong>file,</strong> <br>  This <strong>file</strong> copied to / usr / src directory inside, here is the source kernel usually decentralized local # cp / hda2/linux-2.4.21.tar.bz2 / usr / src / <br>  # cd / usr / src <br>  # tar jxvf linux-2.4.21.tar.bz2 <br>  # ln-s linux-2.4.21 linux <br>  # cd linux <br>  # gunzip-c / mnt/hda2/acpi-20030619-2.4.21.diff.gz | patch-p1 <br>  # make menuconfig <br><br>  The kernel at compile time there are several points to note, keyboard need to select for the [M], this compilation as a module, rather than select [*] - compiled into a build in Mode.  If you do not do here, then there will be usb mouse / keyboard can be used not more simple to say is this: books on the Touchpad can not be used.  So here we must pay attention the first time I was here made a mistake, that led to a new kernel can not be used.  Simply put things that can be selected for the module have chosen well, this can reduce the kernel <strong>file</strong> <br>  Several other things to choose are: TI 1394 device, SMC IrDA, WLAN 802.11b support, USB Mouse, <br>  SCSI Emulation (CDRW to use), i810 sound short is to the hardware as far as possible, some books which are in menuconfig <br>  Option inside to find out, there is no way it could not be found, such as the SD controller, this means that SD cards can not use strategy.  There are in the file system which should msdos, fat, vfat (fat32), ntfs, ext3, partition format, these elections, the <br>  So as to ensure normal Redhat 9 kernel from 2.4.20-8 to 2.4.21 migration, as well as ensure that the new kernel can access ntfs <br>  <strong>The file</strong> <strong>system,</strong> so that the hard disk does not exist above any one <strong>operating system</strong> can not access the partition.  (2003 there could be mounted below ext2 <br>  tools to access ext2 / 3 <strong>file</strong> <strong>systems).</strong>  Toshiba Laptop support this and do not forget the pull.  ISA support also! <br>  Select finish after the press esc and then save the configuration <strong>file,</strong> the default configuration <strong>file</strong> is / usr / src / linux / .config to this <strong>file.</strong> <br>  # make dep <br>  # make clean modules modules_install bzImage <br>  The whole process is not an error, then the indicator of your new compiled kernel <strong>file</strong> has been okay.  This process take about 4-6 minutes to generate the kernel <strong>file</strong> copy bzImage to / boot inside and then changes to / boot / grub / grub.conf <br>  # cp arch/i386/boot/bzImage / boot / bzkernel <br>  # kate / etc / grub.conf <br>  In the grub.conf to add the final title Redhat 9 (2.4.21) <br>  kernel / bzkernel ro root = / dev/hda5 hdb = ide-scsi <br><br>  Save grub.conf, and then use kate to open / etc / init.d / pcmcia <br>  Find the 102 line, in the last increase. DONTUSE, save the pcmcia <strong>file.</strong> <br><br>  So far, the new kernel, as well as some of them have ready for launch.  As long as you are now re-starting grub on Linux will be able to see the first three options - Redhat 9 (2.4.21)!  So far most of the books above features, has been able to run!  !  ! <br>  # reboot <br><br>  Well, and use the new kernel 2.4.21 and acpi patch, the original sound card can not work has now been able to release music, but the sound quality is not good, noise kinda large.  .  .  Minato or with only slightly. <br>  Toshiba&#39;s fnkey can not be used alone must be installed before they can drive, but in linux the following also have the driver <strong>program</strong> <br>  # cp / mnt/hda2/fnfx-alpha.tar.gz / <br>  # tar xvzf fnfx-alpha.tar.gz <br>  # cd fn * <br>  # make <br>  In the / fnfx-alpha/src will generate the following two <strong>files</strong> fnfx and fnfxd, by modifying / proc / acpi / toshiba / things to achieve under the Fn key role. <br><br>  Now after the wlan is not useful.  We also carry out some operations can. <br>  # cp / mnt/hda2/linux-wlan-ng-0.2.1-pre9.tar.gz / <br>  # tar xvzf / linux-wlan-ng-0.2.1-pre9.tar.gz <br>  # cd / linux * <br>  #. / Configure <br>  Here, the conduct of a few very simple configuration, such as asking you whether or not to compile pcmcia, pci, usb-like module, simply choose the prism 2.x pcmcia support can be, and the other pci, usb can not, it will also ask you to kernel source <br>  Path, of course, is to continue to enter slightly, because I put in front of linux-2.4.21 made a link, if you do not enable ISA support here, here, also reported an error.  . / Configure finished will be able to make all, make install, and <br>  mistakes make all the time no need to manage him.  After the completion of re-starting the machine, in the landing between the root, you will be able to see the WLAN card in the non-stop flashing lights slightly ~~~~~~ hey, this is a sign of success in the ifconfig inside one more eth1.  This is a PCMCIA <br>  WLAN card. <br>  Because I am in Shanghai are using 192.168.2.xxx do, things are taken to Shanghai to use, so the router&#39;s ip also used 192.168.2 network segment, but the AP can only use this address ... 192.168.168.139 ... No matter, does not matter.  In w2k/xp/2k3 <br>  <strong>Operating system,</strong> the following cards tied to the first two ip addresses is easy, as long as the tcp / ip advanced options which add an on okay. In Linux <br>  Tied to the network card inside the first two addresses are not annoying way, as long as with the ifcfg this command on the list. <br>  # ifcfg eth1 192.168.2.36 netmask 255.255.255.0 --- which gives eth1 to add more ip address of a bar is also very simple to use wlan card has been able to ping pass router 192.168.2.1 strategy.  The address bar in mozilla to write http://192.168.2.1 <br>  smc router&#39;s setup page will appear slightly.  Set up dial-up modem, and dial.  .  . <br>  Haha, you will find at this time and still can not access, ping 202.102.15.162 also ping unreasonable.  Do not worry, there is the last step as a whole on the Nongwan!  Is to give <strong>the system</strong> plus a routing information # route add default gw 192.168.2.1 <br><br>  # ping 202.102.15.162 ----&gt; successful bar ~~~~~ <br><br><br><br><br><br><br><br><br><br><br> ]]></description>
</item>
<item>
<title>[Java] examples of the basic learning</title>
<link>http://www.tutorialsto.com/index.php/jsp/skills/java-examples-of-the-basic-learning.html</link>
<guid>http://www.tutorialsto.com/index.php/jsp/skills/java-examples-of-the-basic-learning.html</guid>
<pubDate>Wed, 26 Aug 2009 22:05:56 +0000</pubDate>
<description><![CDATA[   Not been updated for a long time, and lazy, the beat! <br>  1, this is a basic file operations, realization of the document to read, write a number of operations <br>  package trying; <br>  import java.io. *; <br><br>  / ** <br>  * @ Author gooing <br>  * / <br>  public class FileRw ( <br>  private File f = new File ( &quot;d: \ \ j2 \ \ a.txt&quot;); <br>  public int getNum () ( <br>  int i = -1; <br>  try ( <br>  String stri = &quot;&quot;; <br>  BufferedReader in = new BufferedReader (new FileReader (f)); <br>  while ((stri = in.readLine ())!= null) ( <br>  i = Integer.parseInt (stri.trim ()); <br>  ) <br>  in.close (); <br>  ) catch (Exception e) ( <br>  e.printStackTrace (); <br>  ) <br>  return i; <br>  ) <br>  public void setNum () ( <br>  int i = getNum (); <br>  i + +; <br>  try ( <br>  PrintWriter out = new PrintWriter (new BufferedWriter (new FileWriter (f, false))); <br>  out.write (String.valueOf (i)); <br>  / / May be encoded reasons, if the words directly into int, there will be windows coding java coding and confusion, so here is the String to write <br>  out.close (); <br>  ) catch (Exception e) ( <br>  e.printStackTrace (); <br>  ) <br>  ) <br>  public static void main (String [] args) ( <br>  FileRw frw = new FileRw (); <br>  for (int i = 0; i &lt;100; i + +) ( <br>  frw.setNum (); <br>  System.out.println (frw.getNum ()); <br>  ) <br>  ) <br>  ) <br><br>  2, the following is an example of the learning factory model <br>  / / Garden.java to achieve an abstract garden plants, you can get from the center of the garden plants and surrounding plants; <br>  / / Of course, for different gardens, its central plants and surrounding vegetation is not the same <br>  package pkgfactory; <br><br>  / ** <br>  * @ Author gooing TODO To change the template for this generated type <br>  * Comment go to Window - Preferences - Java - Code Style - Code <br>  * Templates <br>  * / <br>  public abstract class Garden ( <br>  public abstract Plant getCenter (); <br>  public abstract Plant getBorder (); <br><br>  public void memo () ( <br>  System.out.println ( &quot;CenterPlant:&quot; + getCenter (). GetName ()); <br>  System.out.println ( &quot;BorderPlant:&quot; + getBorder (). GetName ()); <br>  System.out.println (&quot;---------------------&quot;); <br>  ) <br>  ) <br><br>  / / Plant.java achieve the basic abstractions of plants in the garden, where plants provide only a name attribute <br>  package pkgfactory; <br>  public class Plant ( <br>  public Plant (String name) ( <br>  this.name = name; <br>  ) <br><br>  public String getName () ( <br>  return name; <br>  ) <br><br>  private String name; <br>  ) <br><br>  / / VerGarden.java and FlowerGarden.java respectively, a vegetable garden and garden to achieve sub - <br>  package pkgfactory; <br>  public class VegGarden extends Garden ( <br>  public Plant getCenter () ( <br>  return new Plant ( &quot;Wheat&quot;); <br>  ) <br><br>  public Plant getBorder () ( <br>  return new Plant ( &quot;Carrot&quot;); <br>  ) <br>  ) <br><br>  package pkgfactory; <br>  public class FlowerGarden extends Garden ( <br>  public Plant getCenter () ( <br>  return new Plant ( &quot;Rose&quot;); <br>  ) <br><br>  public Plant getBorder () ( <br>  return new Plant ( &quot;JuHua&quot;); <br>  ) <br>  ) <br><br>  / / Gardener.java is the routine of a driver <br>  package pkgfactory; <br>  public class Gardener ( <br>  public static void main (String [] args) ( <br>  Garden g1 = new FlowerGarden (); <br>  Garden g2 = new VegGarden (); <br>  g1.memo (); <br>  g2.memo (); <br>  ) <br>  ) <br><br><br><br><br> ]]></description>
</item>
<item>
<title>[Original] C # to achieve Window Pipeline Technology</title>
<link>http://www.tutorialsto.com/index.php/dotnet/application/original-c-to-achieve-window-pipeline-technology.html</link>
<guid>http://www.tutorialsto.com/index.php/dotnet/application/original-c-to-achieve-window-pipeline-technology.html</guid>
<pubDate>Wed, 26 Aug 2009 22:05:32 +0000</pubDate>
<description><![CDATA[ <p>  Made prior to use Window API to implement a pipeline technology articles, then use C # to achieve the same effect, found that C # itself is a mechanism to facilitate the process of thread makes the job extremely easy to hand, look at records. </p><p>  First of all, we can by setting the Process class, access to the output interface, the code is as follows: </p><p>  Process proc = new Process (); <br />  proc. StartInfo.FileName = strScript; <br />  proc. StartInfo.WorkingDirectory = strDirectory; <br />  proc. StartInfo.CreateNoWindow = true; <br />  proc. StartInfo.UseShellExecute = false; <br />  proc. StartInfo.RedirectStandardOutput = true; <br />  proc. Start (); </p><p>  And then set the thread continuously reads the output string: </p><p>  eventOutput = new AutoResetEvent (false); <br />  AutoResetEvent [] events = new AutoResetEvent [1]; <br />  events [0] = m_eventOutput; </p><p>  m_threadOutput = new Thread (new ThreadStart (DisplayOutput)); <br />  m_threadOutput.Start (); <br />  WaitHandle.WaitAll (events); </p><p>  Thread function is as follows: </p><p>  private void DisplayOutput () <br />  ( <br />  while (m_procScript! = null &amp; &amp;! m_procScript.HasExited) <br />  ( <br />  string strLine = null; <br />  while ((strLine = m_procScript.StandardOutput.ReadLine ())! = null) <br />  ( <br />  m_txtOutput.AppendText (strLine + &quot;\ r \ n&quot;); <br />  m_txtOutput.SelectionStart = m_txtOutput.Text.Length; <br />  m_txtOutput.ScrollToCaret (); <br />  ) <br />  Thread.Sleep (100); <br />  ) <br />  m_eventOutput.Set (); <br />  ) </p><p>  Here we must note that the following statement to add a TextBox always shows the latest, but AppendText instead of using the + =, because + = will cause the TextBox&#39;s Echo makes the whole display area flicker </p><p>  m_txtOutput.AppendText (strLine + &quot;\ r \ n&quot;); <br />  m_txtOutput.SelectionStart = m_txtOutput.Text.Length; <br />  m_txtOutput.ScrollToCaret (); </p><p>  In order not to block the main thread, you can put the entire process can be a another thread where a </p><br /> ]]></description>
</item>
<item>
<title>SVG and XForms: the basics</title>
<link>http://www.tutorialsto.com/index.php/website/xml/svg-and-xforms-the-basics.html</link>
<guid>http://www.tutorialsto.com/index.php/website/xml/svg-and-xforms-the-basics.html</guid>
<pubDate>Wed, 26 Aug 2009 22:05:10 +0000</pubDate>
<description><![CDATA[ <p>  As I write this, there are two kinds of technology in the just-released or soon to be released, would be an incredible driving force for development-related applications with the respective set off a minor revolution in the field.  XForms is a long-awaited alternative to HTML forms technology.  It goes beyond a simple repetition of XML provides an XML editing program and through the abstract user interface layer.  In the meantime, Scalable Vector Graphics (Scalabel Vector Graphics, SVG) as it accelerated a second smaller version of the upgrade, dramatically expanding the application of the occasion, adaptability and scalability, even higher than in the past.  This series of articles introducing the study of these two techniques new perspective, and demonstrate ways to integrate the two.  In this paper, an analysis of XForms and SVG, and study the possible correlation between them. </p><p>  XForms </p><p>  XForms are the successor to HTML forms, but in the development of an interactive form-based applications, HTML form, the importance should not be ignored. </p><p>  A Brief History of HTML form </p><p>  I assume that you as a developerWorks XML zone of the reader, may already have the HTML (and later XHTML) and its function in the form of knowledge related applications.  HTML form is a pioneer in client and server interaction, more than a static document request goes a step further.  HTML form is a very realistic approach.  It is through a variety of pre-set a good widget (widget), such as a simple input fields, text boxes, radio buttons, combo box, select lists, etc., to the development of Web content provides the exchange of text data and user means.  It is no exaggeration to say that, Web to develop to such a state, HTML forms are played an important role.  However, we still have to look at the real meaning of this technology.  Web is not just a magical birth of a new development trends and new economic models and so on means of communication.  In fact, Web Development does not like the sound so good.  Every developer, has been used as long as the form-based interactive technology developed over even a relatively simple Web application that can give you to list the long list of people upset problem.  There is no doubt that including XForms committed to addressing issues, such as authentication, as well as the user interface controls restrictions on input values and so on. </p><p>  In the HTML era, verify that the problem is usually a headache, a developer solution to this problem in general there are three.  The first and most direct way is to let the server is responsible for authentication, usually through the Perl scripting language such as realized.  The preparation of such a procedure is unusual tedious work, this solution itself is also very bad, because every time in the form verification process an error is encountered, it must return a new document, later re-processing time.  The second method is the client-side validation, which involves completely with the object model associated with the platform to use Java Script-based scripting technology.  The third method is the first and second combination of two methods.  No matter which method you use, the job is still daunting, and the results are never satisfactory. </p><p>  In the user interface, the situation is not very good.  I have listed above all the UI widgets are a pretty good start, but the problem soon emerged.  Fairly small range of UI controls, if you want to provide a richer input mechanisms, such as the calendar used to select the dates of departure, then one must use an intelligent client-side DHTML scripts and terrible ways.  These technologies are for compatibility in terms of the terrible burden.  Each form controls the appearance and behavior are closely associated with a specific platform.  Although this approach can be with the user&#39;s environment, well integrated, but it is limited to create a complete custom control, the possibility can not be in order to achieve broader purposes of the graphical interface, simple changes, or even no guarantee that a variety of platforms have the same look and feel. </p><p>  In addition to authentication and user interface controls the two major problems, device-dependent, accessibility, lack of a means of integration with the XML and other issues also deserve attention, so we must begin the study of new forms solution.  When the W3C began developing the next generation of Web forms, all of these issues have been taken into account by. </p><p>  Be achieved with XML form </p><p>  Recently, many Web applications are beginning to make a fuss around the XML.  With the increasing number of such applications, XML&#39;s functionality is already reflected to the client machines (such as the use of XHTML).  XForms and XML platform, closely linked, so with the perfect combination of XML-processing.  XForms form of the model and the performance of complete separation, which introduces a new form representation. </p><p>  The model form is essentially a structured placeholder mechanism, the user can, through appropriate human-machine interface to which input data.  In XForms, content developers to use the XML definition of the model, that is, the most able to meet the needs of custom XML grammar, based on the specific goal to build model structures.  Once the definition of a good model, the rest of the work is only part of the definition of which should be exposed through the user interface. </p><p>  With the XForms user interface defines the method quite abstract, you will never be provided directly to the needs of what the UI looks like.  Content developers to build elements of the built-in XForms user interface.  From a relatively high level of speaking, XForms element defines how users enter or select a specific element of the model (via the XPath expression specified).  If I had less abstract way to represent the last word in the HTML, you say &quot;here, drawing a text input control, allowing users to enter a date string&quot;, while in XForms, you say &quot;to the user an appropriate control, in order to choose the value of the model is right for me. &quot; </p><p>  This method is good, but in the end it is how to solve those problems in front of it?  XML Model decent place, is that you can (through the built-in W3C XML Schema data types, or XForms their type) to really bind to a particular data type in the model an arbitrary element.  First of all, when the user input or by choosing a value of the control when the validation of the value of this work can be combined by the specified XForms data types automatically.  Second, because your model element with a data type, when you reference it through the user interface elements of the time, you can be sure, the user can access to an appropriate data selection method.  XForms we mentioned earlier, you can say &quot;to the user an appropriate control, in order to choose the value of the model is right for me.&quot;, So if you want to provide the type of the value of the date, then the XForms it is possible to identify these tips, in order to show you a calendar control to enter a date. </p><p>  Whether or not you believe the above, I am just here too involved in the fur XForms only, in this connection more information, please refer to the references.  Earlier I mentioned HTML form a drawback is its lack of style support.  In XForms, there is no user interface elements which have a variety of appearance, because all these elements define the interaction only the constraints (such as the number of entries to choose from).  Data type is prompted to XForms input controls the appropriate expression to the user.  You can use SVG to implement XForms performance and interaction layer.  Here take a look at what SVG recently made progress, such progress is how to help us to achieve the vision of the above. </p><p>  Scalable Vector Graphics </p><p>  XForms and SVG the new features of the potential collaboration between the many ideas can be achieved. </p><p>  Early SVG 1.0 </p><p>  In September 2001, SVG 1.0 became a Recommendation, from that time onwards, quite a lot of this technology gradually been applied to different business areas.  Notably the range of applications, including maps and graphics.  Recently, SVG using open-source project is carried out on their own more and more application-oriented development, these projects aim is to provide reusable, SVG-based user interface controls library.  In these projects, interactive SVG is based on a scripting language (typically ECMAScript) and the DOM (including SVG-specific extensions). </p><p>  Although the basis of these projects are the same, but the structure of the library is moving in a different direction.  Construct such a structure has a very direct way, that is, the library provides an object-oriented ECMAScript API.  In this way, if I want to create a SVG of the combo box, I can provide a SVGComboBox class.  Users can create an instance of this class, call the parameter values filled in several ways, and issue drawing commands - in this way with the traditional framework of the general UI is very similar to the toolbox, like Swing, WinForms, Aqua and so on.  While these libraries are in fact built on top of SVG to provide API to the library just to DOM scripting mechanisms to abstract, but almost non-existent with the SVG language itself integrate situation.  Moreover, the use of custom controls for each API have to go through a learning process, and we do not have the inherent advantages of the use of XML, such as statements or semantics and so on. </p><p>  Can be more of a clever way to provide a reusable library, that is, to let some XML as a public API.  Back to the combo box I have just mentioned an example, I can own the name of the space to provide an XML element, such as &lt;ui:comboBox&gt;.  Part of the library when the program loads to parse the entire document and check what parts of the &lt;ui:comboBox&gt;, and then construct SVGComboBox object.  &lt;ui:comboBox&gt; element is essentially as a form of shorthand used to call SVGComboBox instance all the necessary methods.  Since I custom element is part of the DOM, so the user through the DOM API to access my custom control or change the property value (such as the x coordinate location, or control content), I can still use the conversion event.  As time goes by, many developers believe that this method is more appropriate.  They believe that XML-centric approach can adapt to the environment in the SVG. </p><p>  It has been confirmed, however, this method is not as previously thought as the best approach.  Rendering the work is still carried out in the document tree, it has proved such an approach would, in some cases system crashes.  All the things to put in the same tree is also risky.  The biggest risk is a custom mix of information and the original structure.  If different extended information on the contents of the document tree has been assumed, then the above approach would lead to incompatibilities between them. </p><p>  Some SVG developers have been discussing the extension mechanism built on top of the SVG approach.  These discussions W3C SVG Working Group provides the necessary information, they can address these issues in the specification.  In SVG 1.2, we find the solution of the first sign, in which the emergence of a new feature called the RCC. </p><p>  Lifted the veil: RCC and SVG 1.2 </p><p>  Rendering Custom Content (RCC) is the SVG grammar environment, the use of custom XML-based framework for the latest.  RCC frame in SVG based on the concept of technology and provide a layer of very lightweight. </p><p>  RCC for developers to bring the main joy is that it will SVG 1.0 previously hidden a concept well-exposed, this concept is called a shadow tree (the tree images).  Tree in SVG 1.0 imaging used to expand &lt;use&gt;, &lt;pattern&gt; and &lt;marker&gt; the performance of these elements in SVG.  Until now, SVG implementation still contains a tree image manipulation, RCC to allow any element of foreign grammar can have the public image of the tree, so that this mechanism will be exposed.  SVG 1.2 trees for access to images provide a new DOM API; You can use regular DOM API, like the manipulation of regular document tree manipulation of images, like a tree.  Suppose you build all the graphics and added event listener exist in a self-contained tree, the other components is difficult to touch.  Even if you really want to do, but also fully aware of the tree to do any work inside is likely to be destructive.  With the image tree, the document tree, the only thing left is your custom element, there are no otherness. </p><p>  Your goal is to use DOM scripting, custom elements, as well as the common way to use custom elements were integrated into the document tree.  RCC is only one aspect of the problem, if you want, like any other element, like SVG elements, then the event also needs the same manner.  SVG 1.2 There are two other RCC-related with the new standards: DOM Level 3 Events and XML Events (see Resources).  With DOM Level 3 Events, you&#39;ll be able to create custom types of special events.  Thus, when the user through the graphical appearance of this element (in the image of the element tree) to choose a new value, &lt;ui:comboBox&gt; will be able to send a select event. </p></p><p>  Able to send a custom event, of course good, but also need to be able to monitor these events.  To do this, you can use the original DOM Level 2 routines EventTarget:: addEventListener () method.  However, this approach implies the need for a programming environment, and we would normally expect a descriptive approach can be used in a given element in the realization of the event listener.  With the XML Events, you can by a standard declarative syntax to monitor any event, built-in event or custom event can be.  You no longer need to those based on attributes event listener (eg, onmouseover), does not need friends to help.  Meanwhile, in the event area, RCC for SVG brings two new built-in events, they used the definition of foreign elements in RCC binding mechanisms.  In the next article in this series you will see, these two events, and the entire RCC framework, are very good things, they make SVG developers can provide a similar element with the conventional custom SVG elements, and thus for the SVG for all XML applications paved the way for the new programming platform. </p><p>  Conclusion </p><p>  XForms is a highly abstract, XML-based solution to the HTML forms pose a challenge.  It achieves complete separation of data and performance.  At the same time, SVG 1.2 trees through the images and direct the event integration mechanism, providing a more scalable platform, and these encapsulated in the RCC framework.  Understanding of these facts, we should begin to provide a simple way with the RCC to build custom UI, and then XForms environment, reuse of these components, thereby providing a rich user experience.  The next article in this series will focus on how to create a SVG based on the RCC components, later, we go further into the integration with XForms. </p></p> ]]></description>
</item>
<item>
<title>Html tags generated parse tree (b)</title>
<link>http://www.tutorialsto.com/index.php/website/dhtml/html-tags-generated-parse-tree-b.html</link>
<guid>http://www.tutorialsto.com/index.php/website/dhtml/html-tags-generated-parse-tree-b.html</guid>
<pubDate>Wed, 26 Aug 2009 22:04:46 +0000</pubDate>
<description><![CDATA[ <p>  Html in front of two ideas to explain the analytical core algorithms, thank you for putting forward mine.  Specifically listed in the first essay as an explanation: </p><p>  1, ViewStates that, &quot;&lt;TD Adolf proud of the sofa &lt;/ TD&gt;&quot; how to do?  This can be resolved out of them after parsing the node named &quot;td&quot;, and &quot;Adolf proud sofa &lt;/ TD&quot; became the property of parsing. </p><p>  Figure: </p><p><img src=http://www.uudo.net/UpLoadFiles/Files/../UpPic/2009-5/8/095811571991398.jpg onclick=get_larger(this) alt="Html tags generated parse tree (b)" /></p><p>  The chart above includes the above-mentioned examples. </p><p>  Reply ml_dark Brother </p><p>  Like this .. &lt;div&gt; &lt;div&gt; &lt;/ div&gt; &lt;div&gt; &lt;div&gt; &lt;div&gt; &lt;/ div&gt; &lt;/ div&gt; &lt;/ div&gt; &lt;/ div&gt; you look at the results of your analysis ... . </p><p><img src=http://www.uudo.net/UpLoadFiles/Files/../UpPic/2009-5/8/09581157191515.jpg onclick=get_larger(this) alt="Html tags generated parse tree (b)" /></p><p>  Analytic results above diagram. </p> ]]></description>
</item>
<item>
<title>On the random to control the</title>
<link>http://www.tutorialsto.com/index.php/asp/application/on-the-random-to-control-the.html</link>
<guid>http://www.tutorialsto.com/index.php/asp/application/on-the-random-to-control-the.html</guid>
<pubDate>Wed, 26 Aug 2009 22:04:25 +0000</pubDate>
<description><![CDATA[   Random function of control is mainly through a randomly generated number for the next target array to control the probability of random <br><br><br>  Application 1: Simple controls: <br>  Requirements: A Forum on the probability of the occurrence of certain random events was 30% <br>  Thinking: You can directly control the array, the array for the number 10, where a value of 1 there are three, the rest are 0, the function randomly generated random numbers under the standard, both to be 30% of the probability of <br>  Code: <br>  &quot;% <br>  a (0) = 0 <br>  a (1) = 0 <br>  a (2) = 1 <br>  a (3) = 0 <br>  a (4) = 1 <br>  a (5) = 0 <br>  a (6) = 1 <br>  a (7) = 0 <br>  a (8) = 0 <br>  a (9) = 0 <br>  randomize <br>  i = cint (rnd * 10) <br>  if a (i) then <br>  Random events occur <br>  end if <br>  % &quot; <br><br>  Application 2: The linear control <br>  Requirements: A forum to encourage users to publish articles in published articles generated when random events, such as the user scores, gold coins, articles, etc..  With the probability of the number of articles a user increases, when the number of articles up to a value, reaches the maximum 100%. <br>  Thinking: because it is a linear increase, then this function is Y = KX + b.  Where Y is the probability, X is the article number, K, b for the coefficients.  For example: When the article number is 0, the probability of 1% (this value can be set up according to their own needs), when the user number reached 10,000 articles, the probability is 100. <br>  Both: 1 = K * 0 + b 100 = K * 10000 + b.  Get b = 1, k = 0.0099 <br>  Code: <br>  &quot;% <br>  odds = 0.0099 * postnum +1 &#39;postnum for the number of articles published in <br>  if odds&gt; 100 then odds = 100 <br>  end if <br>  odds = cint (odds) <br>  for i = 0 to 99 <br>  if i &lt;odds then a (i) = 1 <br>  else a (i) = 0 <br>  end if <br>  next <br>  randomize <br>  i = cint (rnd * 100) <br>  if a (i) then <br>  Random events occur <br>  end if <br>  % &quot; <br>  Applications 3: linear, nonlinear control <br>  Requirements: A Forum on the probability of random events that occurred when the article number is 0, the probability of occurrence of 60%.  When the article number from 0-100, the probability of lower, when the 100 reaches the lowest 10%, followed by the probability has been increased.  When you reach 10,000 when the maximum 90%.  Article number is greater than 10,000, the probability was 90%. <br>  Thinking: can be divided into linear and nonlinear control. <br>  Let us look at linear: divided into three paragraphs.  0-100 Y = KX + b.  According to the data was K =- 0.5, b = 60; when 100-10000 obtained when K = 8 / 990, b = 9100/990.  When the 10000 - to infinity.  Simply apply 2 to get the code odds = 0.0099 * postnum +1 replaced by the following code: <br>  if postnum&gt; = 0 and postnum &lt;= 100 then <br>  odds =- 0.5 * postnum +60 <br>  else <br>  odds = 8 * postnum/990 +9100 / 990 <br>  end if <br>  if odds&gt; 90 then <br>  odds = 90 <br>  end if <br>  If it is non-linear.  For example, unary quadratic equation Y = a * X * X + b * X + c <br>  Obtained when using the above method 0-100100-10000 and more than 10,000 hours were factors. <br>  Coding Ibid. <br><br> ]]></description>
</item>
<item>
<title>Blog search engine optimization</title>
<link>http://www.tutorialsto.com/index.php/website/seo/blog-search-engine-optimization.html</link>
<guid>http://www.tutorialsto.com/index.php/website/seo/blog-search-engine-optimization.html</guid>
<pubDate>Wed, 26 Aug 2009 22:04:02 +0000</pubDate>
<description><![CDATA[ <p>  Search engine optimization is to make a lot of headaches BLOGGER thing, because every time I write SEO articles there are always a lot of time complaining to me BLOGGER: Why do I always write good quality content, but search engine optimization can not be played on an article BLOG What role! </p><p>  I have never denied that quality content is better than everything, but you have to understand that, in fact, hundreds of millions of pages are a good article over think hard, they came in search engine results last, and those who should have been read has not been found in the article. BLOGGER process of writing the BLOG itself, there are some prejudice, they think they rank BLOG naturally be higher. </p><p>  People often ask me is: How can my BLOG ranked first (in the most popular search engine)? </p><p>  My answer such a start: I do not know what I am talking about ...... but ...... </p><p>  You see, although some of my blog articles in the various search engines have a very high ranking - often I do not know why.  My approach is usually based on the study to guess, and try to how to improve the search engine rankings.  I also read a lot of other people on how to improve search engine rankings recommendations.  However, the more I read, the more I feel not only a person in such a touching stones.  Almost every article in this regard is a certain degree of speculation. </p><p>  I have people who want to BLOG search engine optimization of the owners is: to keep BLOG simplistic. In a particular field to write good quality content, and then around the current best way to optimize it. </p><p>  Explained at the beginning, I would like to BLOGGER that search engine optimization will not be defeated. Search engine looks very complex, it became troubled BLOGGER side, but you should know there are many other aspects of BLOG mind, I will tell you of these, there are more than well-established search engine optimization is more important. Also, please note, not to indulge in the temptations of search engine optimization, remember to make your BLOG to keep the original character and natural impression. </p><p>  SEO experts, SEO experts are divided into stations and stations outside the SEO experts, we will explain separately. </p><p>  Station SEO (from the site&#39;s search engine technology) </p><p>  Station SEO added into the yes from the site&#39;s search engine technology, named from an external site on the BLOG in search engine rankings of the impact of these external factors are beyond the control of BLOGGER. The most useful external sites most powerful factor that anti - to the link. that we are talking about the external links. </p><p>  There is no doubt linked to a site included into the search engine results page to play an important role. Simply put, each a link to your (BLOG) sites, were seen as a search engine to your site credibility cast one vote. </p><p>  Ideally, the best reverse link is from high-quality and ranking of the site links. They chains than through the relevant keywords into your links to related topics written by better results. But if you can not oblige others to links to your BLOG, you do just imagine. </p><p>  So how to generate high-quality backlinks? </p><p>  We all know that high-quality links is not easy, in most cases its chain of other people, so how do you get such a link? </p><p>  High-quality content ---- there are various ways to generate external links for the BLOG, I know the best way is to write high-quality content, your content so that readers desire to read. You can get plea links, it can be registered automatically generate links to procedures, or even to the other station to buy links. However, the cheapest and most secure way is natural in an organized manner to let others link to your high-quality content. </p><p>  Note that with you related to the content BLOGGER ---- I do not advocate the BLOGGER to other mass-mailing to exchange links, but I suggest that if you write articles on a topic of quality of articles, and feel that will make others BLOGGER interested in, that to these BLOGGER made a short courtesy EMAIL to let them know of your articles, would be valuable. Even if they do not link, do not feel embarrassed. you will find if they clicked on the link to have a direct the flow, resulting in improved search engine PR value. </p><p>  Categories ---- Another way to generate backlinks is to submit to the category of your BLOG directory. I know that many owners are convinced of the effectiveness of this strategy, when to start a new site, they do The first step is to do work around the classified directory, select the appropriate key words submitted to the keywords links pages. There are many classified directories, most of them free of charge, there is a BLOG classified directory listing that contains most of the BLOG search engine , you might want to submit about. </p><p>  BLOG internal links ---- With the BLOG of the development and growth in the number, BLOGGER started to pay attention or create a BLOG networks, as they say, the &quot;link farms&quot;. BLOG One of the benefits the network is BLOG &quot;doorway pages&quot; of the links between each other. In this way, you can control the site from multiple domain names. This approach is no sense, and you should be careful, if your on the same server all sites, search engines are easy to detect these links, and reduce confidence in the value of these links, page grade zero. </p><p>  Buy Link ---- a lot of professional sites have budgets from other high ranking sites to buy links, here I will not say more. </p><p>  Link Exchange ---- content will be similar to the exchange of links between BLOGGER. Sometimes, this behavior occurs quite naturally (as you see someone links to your BLOG, and then you will be polite back-chain), but In most cases, links are the interests of the purpose, and in the link between the two BLOGGER is a form. I&#39;m almost every day to receive such reciprocal link request (I rarely respond to). Although such exchange will have a certain link interests, I still have to be here to warn you, as a SEO expert should be very clear that the search engine there are many ways to keep track of this exchange of links to devalue them. Some attempt to bypass a direct link to Triangle of conversion, They replace the A and B to do a direct exchange, and to other stations include it. For example, A link to the C, in essence, in exchange for the D (of course, the owner of D with C is the same one), give you a headache is a bit not?! There are a variety of system claims that it will for you to build a secure internal links, I know that most people use Digital Point&#39;s Free C0-Op Advertising system. Personally, I would try to avoid such programs, there are approach of link to the site of my readers is valuable. </p><p>  Station SEO (search engine optimization based on site technology) </p><p>  Just analyzed from the site&#39;s search engine technology, I will turn attention to analysis of other factors, when you build BLOG can be used when the. (Professional search engine technology - BLOG when you do these things will be a time when The BLOG to help you achieve higher rankings). good SEO expertise has every aspect of the speculation around the SEO techniques there are many, as much as possible I have here are some: </p><p>  Write keyword-rich content of the article for you ---- to add new keywords will be conducive to the article index GOOGLE spider. But not piled up too many keywords, in addition to considering &quot;how to do make people to be found in the search engines this article? &quot;If people are looking at the content of GOOGLE in the article you have, then you have to consider that they will enter any word in the GOOGLE search for related articles? answer to the question shows that you should be the word throughout your entire articles. </p><p>  These keywords in your article need to be frequently mentioned, you can follow the following method: </p><p>  Key words should appear in the title tag inside; </p><p>  URL inside a keyword, ie, the directory name of the file name you can put some keywords; </p><p>  Export link on the page the link text includes keywords; </p><p>  Is shown in boldface keywords (at least try to do once); </p><p>  Reference to the keywords in the tag (on how to use the head tag has been controversial, but the consensus is that the h1 tag more than h2, h3, h4 impact of better, of course, some did not use head tags page also has a high PR value of ); </p><p>  Image ALT tags can be placed in keywords; </p><p>  Throughout the article should include keywords, but preferably are placed in the first paragraph of the first sentence; </p><p>  In the meta tags (meta tags) into the keywords (which point the value of getting lower and lower, but still some people believe that some search engines are useful); </p><p>  Be careful not to in order to optimize the articles are filled with the keywords, the formation of keyword stuffing, thus destroying your article, you distort the intention of writing this article. Most of the SEO experts suggest that 5-20% keyword density is best between, I think 20% of the density could undermine your article. </p><p>  Finally would like to say something, not in order to do SEO optimization, and give up the user experience on your BLOG. While the keyword density for search engine crawling is important, but the most important thing is the content and design of BLOG readers are friendly, to enhance the reader&#39;s experience. There&#39;s nothing like all filled with keywords BLOG To make matters worse, and do not be such case. </p><p>  Theme BLOG ---- from my recent reading of the SEO theories learned, if you write the BLOG are on the same topic, then it might get a better ranking. For example, a subject than those covered BLOG BLOG range of subjects ranking higher. the establishment of a more than 200 pages of BLOG, content is the same theme, this BLOG will continue to increase in the rankings, because in this theme where your BLOG is considered authoritative. to consider look at this proposal to keep your BLOG in some of the same themes. Of course, not to do so does not mean that your BLOG can never get better rankings. it&#39;s just considered a factor. </p><p>  Site Design - - search engines prefer to have a good page structure, and correct the code and clear the site navigation. To make sure your pages are valid and in the mainstream visual browsers. Search engines do not like too much The Flash, frames and java script script, so to keep the site clean and tidy, but also conducive to search engine spiders crawling faster and more accurate to your index. </p><p>  The site&#39;s internal links - - search engines work by crawling through the spider web of information to track you write the content and the link through the web page to find web pages, extract the hyperlink address. Many SEO experts are providing website BLOG maps, in the BLOG on the best of each page has between 1-2 in-depth links. BLOGGER first step is to ensure that navigation in the catalog page that contains, but also to ensure that each sub-page has a link back to main page and other important pages. </p><p>  ---- BLOG updated regularly update the number of the more frequent search engine spider crawling the more frequent. This means that the new BLOG article within a few days or even hours can appear in the index, without having to wait several weeks. This is the best benefit from the BLOG way, as much as possible so do it. </p><p>  Export links - - search engine on the controversial subject of how to deal with export links. I have always believed related to Export link will increase the BLOG in search engine rankings. I am often in the article links to other related sites, I think it right to my readers is useful, there are some interesting evidence Yi supports this theory. in your BLOG links to external sites will reduce the BLOG part of the traffic, so you need to calculate the loss of what to do. Note: You should also be Try some authority to do the relevant sites to link to your own BLOG. Remember that a lot of Export link will affect the lower your BLOG, as the SEO said, moderation is the key. </p><p>  A wise choice domain name - - Choose a domain name a large number of factors. The most important point is that, if possible, try to include keywords. 2nd you should spend a little time to see if anyone registered before the domain name. Of course, is also a gender effect . if preceded by high-quality sites and it is doing the reverse link, then you benefited. but there are likely to do the reverse link are some rubbish sites, you may be prohibited GOOGLE for a long period of time. this test expired domain backlink tool you might use. </p><p>  The registration of domain names as early as possible ---- GOOGLE behave proof of an earlier registered domain names will be higher in the rankings. This is because a lot of garbage site, only short-term registration, domain name a long time to prove your main aim is to Jianzhan , and will operate it for a longer time. </p><p>  ---- The theme of each article the subject of a page more compact, search engine its rankings, the better. Sometimes you may find you write a long article, covering a number of different topics, their relevance and is not high. If you are concerned about search engine rankings, it is best to put such an article into cubes, divided into several themes the article more closely. </p><p>  Write a suitable length of the article on Search Engine Optimization ---- Some people think that the article is too short not get a higher ranking. The general control of every article I have at least 250 words. Of course, my BLOG also has a much shorter article , but if I want to have a good ranking articles, I will pay attention to control its length. On the other hand, does not seem to make the article too long, because it will not help you keep your keyword density, the article looks also a lack of tight . studies show that the article is too long will be a sharp reduction in the number of readers, they look at first glance, the time chose to shut down the article. </p><p>  To avoid repetitive ---- GOOGLE in using the guidelines in a serious warning to the same content over multiple pages on the issue. Whether those pages are your own or someone else owned. Because of a series of garbage content sites is the continuous replication (also theft others website content). there is some debate about what kind of content replication operator, what should not be included (for example, a number of free articles BLOGGER like to share in their own BLOG, these articles have appeared in a few tens of millions of web page) My suggestion is if your BLOG to appear in many places that you have to be careful. </p><p>  Ping ---- like Pingomatic such services, it can help you ping to other sites, suggesting that the content of your BLOG has been updated. In this way, search engines know your article has been updated, in order to attract spiders come crawling. </p><p>  BLOG of the RSS submitted to the BLOG of the RSS submitted to MyYahoo ---- seeds to Yahoo&#39;s MyYahoo readers, which would help yahoo index. You can also submit to Google&#39;s Personalised pages, which have the same effect. </p></p><p>  Catalog number - - the directory when I was too much time, I will be in trouble. I think the big sites higher level than the small station, of course, some small sites that have a high level, this is not the standard. Contents more , the search engine to search the more comprehensive. If you have too many pages, you need to organize them to facilitate the search engines crawl. I do not mean arbitrarily set up some unnecessary junk directory, please note that, as time goes by, the most Good to build a large and comprehensive site. </p><p>  ---- Submitted to search engines if you do SEO all the stations have to do something, BLOG are still not appear in search engines. That is because search engines have not yet begun included. Each search engine allows users to submit the site is not included. generally require a long period of time to wait for the search engine included, perhaps, or a faster way to get search engines has been the site included a link. </p><p>  Last added: the above techniques, mostly from my personal experience and other people there are learned. I am not a SEO expert, but if you use the above method, you can also do it well. Do not be confused SEO, if you forget reader, to forget the quality of written content, only for SEO, then you will soon find that you fall into the tricks of the SEO, then search engines have refused! </p></p> ]]></description>
</item>
<item>
<title>Site planning: the nine thinking ideas to help you plan the ability to elevate</title>
<link>http://www.tutorialsto.com/index.php/website/strategy/site-planning-the-nine-thinking-ideas-to-help-you-plan-the-ability-to-elevate.html</link>
<guid>http://www.tutorialsto.com/index.php/website/strategy/site-planning-the-nine-thinking-ideas-to-help-you-plan-the-ability-to-elevate.html</guid>
<pubDate>Wed, 26 Aug 2009 22:03:37 +0000</pubDate>
<description><![CDATA[ <p>  On the policy has been concerned about the network planning, and we say a few words today on the site plan, the nine thinking concept: </p><p>  One, intuitive reaction </p><p>  I will not explain the concept of intuition, and intuition and insight is different from intuition is the perception of things for some time, thinking and experience, the formation of a forward-looking premonition; insight is a moment of inspiration for the long-term information on the release of the collision. </p><p>  Second, empathy France </p><p>  From the perspective of others to consider the same problem may be the result.  If I were you, I what would they think ... ... </p><p>  3, reverse thinking method </p><p>  Ordinary people used to follow the state of affairs to think positive side problems, planners will have to be good at discovering problems from the negative things, finding solutions to the root of the problem. </p><p>  4, brainstorming </p><p>  Suppose you have a seventh sense, this sense of the source of the seventh as the boundless universe, we can imagine all kinds of information points, knowledge points, as the stars in the Milky Way galaxy in order to light the speed of movement, or even high-speed collision, such as atoms, molecules , electronics, particle movement ... ... </p><p>  5, combined Information Law </p><p>  Classification of the various combinations of information to find similarities, and then analyzed. </p><p>  6, unconscious thought France </p><p>  The deep subconscious of human consciousness, from a psychological perspective, is a human right hazy state of the unknown is a human mental and psychological survival of the world and the unknown world of the fuzzy feeling to think about to enter the subconscious state, it must first be physically and mentally calm , and then closing meditation. </p><p>  7, observation </p><p>  Observation, must be beyond the ordinary routine of the observation point of view and ideas, ways. </p><p>  8, consulted France </p><p>  Observable things, you can ask to learn more about. </p><p>  9, ahead of imagination France </p><p>  Science fiction movies, novels, horror films and so on are all ahead of schedule ahead of the scope of imagination, or the future, or to people&#39;s psychology, or in the past, or something changes in nervous imagination. </p><p>  Thinking of ideas for more than nine sites can help you to plan to build on the road! </p> ]]></description>
</item>
<item>
<title>Energy-saving AC drive system in electric vehicle application</title>
<link>http://www.tutorialsto.com/index.php/mechine/sensor/energy-saving-ac-drive-system-in-electric-vehicle-application.html</link>
<guid>http://www.tutorialsto.com/index.php/mechine/sensor/energy-saving-ac-drive-system-in-electric-vehicle-application.html</guid>
<pubDate>Wed, 26 Aug 2009 22:03:18 +0000</pubDate>
<description><![CDATA[ <p>  In electric car, the batteries and electric drive systems are two critical, and their level of technology to a large extent determines the main performance of electric vehicles.  Unlike most industrial and home electric drive systems, electric vehicle, whether it is the manner in which the supply of electricity, the energy is limited, so to meet the particularity of electric vehicles, the new electric drive system in the motor and power conversion installations should meet the following basic requirements: ① high efficiency; ② small size and light weight; ③ high starting torque multiplier; ④ good speed performance and controllability; ⑤ reliability must be high, life must be as long as possible, Low maintenance or even no maintenance; ⑥ reduce noise and reduce vibration and improve comfort. </p><p>  At present, China Electric Vehicle DC motor drive system is still driven mainly commonly used from the battery to the power converter and then to drive the motor-way energy transfer method, which there is much to be desired.  In particular, although the DC motor has a simple structure, good controllability, speed range is wide, a larger starting torque multiplier, the control circuit is relatively simple and low cost advantages, but its disadvantages also not be ignored.  Brush DC motor due to the existence of mechanical components for the brushes or commutator, it is easily lead to sparks, noise and vibration serious, prominent problem of electromagnetic interference, and the brush or commutator maintenance more difficult, short life, In addition, the motor size is very large, resulting in a waste of limited space; brushless DC motor brush motor while overcoming some of the flaws, but it is difficult for the rotor position detection, machine price is high, price is relatively low.  And then from a system efficiency point of view, since the majority of systems use a one-way power transmission, making the vehicles braking deceleration or downhill slide when a lot of wasted energy.  In addition, the brushes, commutator such as mechanical shock, friction, also caused reduced efficiency of the system.  Therefore, this paper, the above problems, combined with the basic requirements for electric drive system is proposed a new type of ZCZVS Boost DC-DC bidirectional converter and inverter combination to drive the squirrel cage induction motor energy-saving AC drive electric vehicles . </p><p>  System design requirements and overall design </p><p>  The system mainly as electric motorcycles and other light electric vehicles driven devices, the basic technical parameters are as follows: Input voltage DC 36V; DC converter output voltage Vo of DC 150V; drive motor capacity of not more than 300W; to achieve deceleration, brake Energy can be feedback function; to achieve acceleration and deceleration adjustable soft-start function; with overcurrent, overvoltage, undervoltage protection features. </p><p>  Energy-saving AC drive system for electric vehicles basic components shown in Figure 1, which includes the battery V5, ZCZVS step-up DC-DC converters, three-phase bridge inverter circuit, AC induction motor and the corresponding control, detection unit.  High-frequency inductance L and the electronic switches Su pose a step-up DC-DC converters, the grounds of S1 ~ S6 composition VVVF inverter to provide input voltage, capacitance Csu the buffer capacitor, anti-parallel diodes in the energy feedback Dsu mode under the freewheeling; Sd for the energy feedback control switch used to control the flow of energy and size of the buffer capacitor capacitance Csd, anti-parallel diodes Dsd can run in electric mode for freewheeling.  When a vehicle is sliding downhill braking deceleration or when the AC motor will definitely greater than the back-end inverter rated input voltage in the power generation state, then the detection unit moves, it had blockaded the boost circuit of electronic switches Su, at the same time open the energy feedback switch Sd, the system energy is fed back to the supply side.  Three-phase bridge inverter circuit working in VVVF mode, when the vehicle needs to be carried out according to accelerate and decelerate regulation, just the speed of adjustment in a given instruction, the change in frequency control circuit controls the speed of adjustment can be realized.  In addition, in order to squirrel cage induction motors for driving motor, from the structure to overcome the shortcomings of the DC motor, reduced maintenance, increased overall system capacity and speed, has greatly improved the reliability and efficiency. </p><p><img src=http://www.uudo.net/UpLoadFiles/Files/../UpPic/2009-4/30/0943014563262870.jpg onclick=get_larger(this) alt="Energy-saving AC drive system in electric vehicle application" /></p><p>  Figure 1 Energy-saving AC drive electric vehicles </p><p>  The main unit of Circuit Design </p><p>  A switch control circuit Su </p><p>  Upon request, the control chip must have a soft start, overcurrent, undervoltage protection function, the system selected Motorola Inc. UC3842A, it is a complete feedback voltage comparator, error amplification, over-current protection, under voltage protection function current track-type PWM control IC. </p><p>  Su switch control circuit shown in Figure 2.  Its operating characteristics are: ① the maximum supply voltage Vcc = 30V, a 36V internal regulator tubes can effectively prevent the damage caused by high-pressure fleeing into; ② under-voltage lockout turn-on voltage threshold is 16V, off voltage of 10V, 6V start to close the margin to be effective in preventing the threshold voltage of the circuit generated when working near the oscillation; ③ comes with a stable 5V reference voltage from the pin 8 output for external use, the output current of 20mA; ④ Output HIGH to 13.5V (Vcc = 15V, output current 200mA pm), low level of 1.5V (when the input current of 200mA); ⑤ high, low rise, fall time of 100ns, current sampling signal (from pin 3 input) is greater than 1V, the PWM latch to flip the output pin 6 immediately dropped to low from high, therefore, to change the size of the current sampling resistor, you can change the over-current protection threshold of action .  ⑥ current tracking characteristics: Figure 2 mid-stream off switch Su current increases, the sampling resistor R21 on the sample voltage increases, the signal into the corresponding 3-pin UC3842A larger, this time through the regulation of the internal circuitry 3842A regulation, Pin 6 output pulse duty cycle of the corresponding smaller, makes the DC-DC converter output voltage is reduced, the current flowing through the corresponding Su is also on the smaller, play-current protection. </p><p><img src=http://www.uudo.net/UpLoadFiles/Files/../UpPic/2009-4/30/0943014563547027.jpg onclick=get_larger(this) alt="Energy-saving AC drive system in electric vehicle application" /></p><p>  Figure 2 switch control circuits Su </p><p>  2 switch control circuit Sd </p><p>  In the energy feedback, the switch Sd is in working condition, in order to ensure adequate feedback system energy, while avoiding the switch Sd a long time to bear a large feedback currents, using 555 constitute a frequency of 20kHz the &quot;multi-harmonic oscillator + high-frequency pulse transformer &quot;to drive Sd. </p><p>  Figure 3 for the &quot;multi-harmonic oscillator + frequency pulse transformer,&quot; consisting of drive circuit, of which 555 constituted by the multi-harmonic oscillator operating frequency f = 1.43 / (R18 +2 R22) / C19.  In the circuit, the detection and interlock circuit controls the 555 Manifold pin 4.  When the pin 4 is high, the detection circuit detects that the system should enter the energy feedback state, began to Sd multivibrator output switching pulse; when the pin 4 is low, the system is running under the electric, multi-harmonic Sd not to switch the oscillator output pulse. </p><p><img src=http://www.uudo.net/UpLoadFiles/Files/../UpPic/2009-4/30/0943014563630742.jpg onclick=get_larger(this) alt="Energy-saving AC drive system in electric vehicle application" /></p><p>  Figure 3 switch control circuit Sd </p><p>  3 Detection and Interlock Circuit </p><p>  In this system, detection and interlock circuit is exceptionally important role.  First of all, it detects the DC-DC converter output voltage of the size, to determine whether a circuit mode of transfer of energy from the electric running back the state or the state into electrical energy feedback from the running state; Second, it need to test and to judge the results of the corresponding switch to control electric operation and energy feedback switch drive circuit.  Figure 4 for the detection and interlock circuit, which works as follows: First, according to DC-DC converters work properly when the size of the output voltage, set the comparator reference voltage pin 2 and the resistor divider to detect the DC - DC converter output voltage.  When the system is going downhill deceleration or braking, the electric motor in the power generation state, then the machine-side back-EMF is greater than the DC-DC converter output voltage, which is detected by comparison of resistive voltage divider is greater than a given reference voltage, making the comparator flip, pin 1 the output is high, forcing the transistor Q1 turns on and will switch gate signals Su pull-down to low; In addition, the same as provided to the UC3842A divider Pin 2&#39;s voltage exceeds the reference voltage within a chip the size of it immediately off UC3842A outward pulse output.  Both very safe way blocked switch Su.  At the same time, comparison of high pin a pin into the multivibrator 4, opening a multi-harmonic oscillator circuit, so that the whole system into the energy feedback state. </p><p><img src=http://www.uudo.net/UpLoadFiles/Files/../UpPic/2009-4/30/0943014563748651.jpg onclick=get_larger(this) alt="Energy-saving AC drive system in electric vehicle application" /></p><p>  Figure 4 Detection and Interlock Control Circuit </p><p>  4 Main circuit Intelligent Power Module IPM </p><p>  In this system, three-phase inverter circuit has a very important role, not only for the squirrel-cage induction motor to provide power supply voltage, but also the motor frequency control.  In the past, the inverter circuit mainly uses six separate IGBT modules to build, the need for each IGBT module to provide a driving circuit, overheat protection circuit, overcurrent protection circuit, they want to and the main circuit overvoltage, short circuit protection circuit and IGBT modules to match, making the design of variable frequency inverter circuit has a very difficult.  However, with the Intelligent Power Module (IPM) the emergence of this situation has been a huge change, especially in recent years, IPM are being gradually replaced by ordinary IGBT modules. </p><p>  IPM module is based on IGBT chips as the main body, the chip and the gate drive, control, and overcurrent, overvoltage, overheating, short circuit, undervoltage lockout protection and fault detection and other integrated circuits in one high-performance high-power devices, has a compact structure, smaller, stable performance, reliable, affordable and so on.  Therefore, the combination of electric vehicle drive the basic requirements, the system select the Mitsubishi company PS21255-E of IPM modules for inverter circuit. </p><p>  In PS21255-E module, the bridge arm 3 of the drain pipe at the same point, that point through a small current sense resistor connected to the system ground can be directly used systematically as a reference point of the +15 V power supply to drive control, but the bridge arm 3 of the drain pipe is not in place, through an external circuit, the next bridge arm tube turn, the next bridge arm of the +15 V drive power at the same time to an external capacitor charging, disconnect the moment arm bridge , capacitance at both ends to keep +15 V voltage drop, and its low potential coincided with the end of the bridge arm IGBT drain pipe connected to, and therefore realized the bridge arm IGBT gate voltage than the drain pipe a high bootstrap function, it is to achieve a good drive on the bridge arm tubes. </p><p>  5 system, acceleration and deceleration </p><p><img src=http://www.uudo.net/UpLoadFiles/Files/../UpPic/2009-4/30/0943014563815504.jpg onclick=get_larger(this) alt="Energy-saving AC drive system in electric vehicle application" /></p></p><p>  Figure 5 acceleration and deceleration control logic flow chart </p><p>  The system uses SA866AE/AM chip VMON and IMON two pins for acceleration and deceleration control, control flow in Figure 5.  ① If the VMON valid (ie VMON ≥ 0.5VDD), then the acceleration and deceleration command is invalid, the condition has the highest priority, which helps prevent excessive deceleration of renewable energy through the power tube which led to over-voltage.  Usually VMON &lt;0.5VDD when the acceleration and deceleration can be adjusted.  ② If the IMON effective, regardless of UP, DOWN at what state, the instantaneous frequency will be reduced to a pre-set deceleration frequency level, if the instantaneous frequency down to 0, IMON ≥ VDD, then the PWM pulse output cut-off, this time can not be operation of any acceleration and deceleration.  The conditions of lower priority than VMON, it can lead to over-current to prevent overheating in high speed switch is damaged.  ③ When these both fail, algorithms will combine the output of the comparator logic, DIR pin control, and counter signals, together with the speed control to draw final. </p><p>  6 SA866AE/AM with the EEPROM parameter settings </p><p>  SA866AE/AM three-wire serial interface with 256-bit or 1024 bits serial EEPROM connection, such as the 93C06 or 93C46.  All the parameters are stored in EEPROM, the serial interface automatically reset after the download.  The system parameters to be used 93LC46 storage, and SA866AE/AM interface shown in Figure 6. </p><p><img src=http://www.uudo.net/UpLoadFiles/Files/../UpPic/2009-4/30/0943014564022801.jpg onclick=get_larger(this) alt="Energy-saving AC drive system in electric vehicle application" /></p><p>  Figure 6 SA866AE/AM and EEPROM Structure </p></p> ]]></description>
</item>
<item>
<title>The use of semiconductor technology of information between doctors and patients management</title>
<link>http://www.tutorialsto.com/index.php/mechine/rf/the-use-of-semiconductor-technology-of-information-between-doctors-and-patients-management.html</link>
<guid>http://www.tutorialsto.com/index.php/mechine/rf/the-use-of-semiconductor-technology-of-information-between-doctors-and-patients-management.html</guid>
<pubDate>Wed, 26 Aug 2009 22:02:52 +0000</pubDate>
<description><![CDATA[ <p>  Semiconductor technology to the medical system to produce a far-reaching impact.  Patient monitoring, drug transfers, as well as many other applications can be collected patient information, quickly process the data, and then through the hospital network, critical information will be transmitted to those who need information, thereby enhancing human resource capacity.  Monitoring system from almost anywhere in the world to transfer data back and forth, not only can work without the need to increase resources to provide accurate load data transmission, but also let a lot of applications to anyone with an Internet connection at home to achieve.  In some cases, such systems can be controlled treatment programs, for example, transfers of drugs according to a predefined schedule. </p><p>  To achieve this type of remote monitoring and data processing, first of all need to have a sensing, control and communications functions of the simple platform, which may include an RF transceiver in order to improve portability and simplify operations. </p><p>  Ready-made components from a simple chip set at a reasonable cost, to provide sensing, control, transmit the information required for full functionality.  Figure 1 shows the three components of the chipset interaction between.  We need to micro-controller (in this case, MC9S08GT family members), to deal with the information received from the sensor, then sensor and then send the information to low-power transceiver.  The micro-controller on the market today can be any of a general-purpose 8-bit micro-controller, it is with analog (ADC), as well as the necessary dedicated embedded memory, designed for wireless transceiver on the networking standards (for example, a simple proprietary wireless protocol IEEE802.15.4 or ZigBee) use. </p><p><img src=http://www.uudo.net/UpLoadFiles/Files/../UpPic/2009-4/28/0942813050073346.jpg onclick=get_larger(this) alt="The use of semiconductor technology of information between doctors and patients management" /></p><p>  Figure 1: Using the Freescale Semiconductor chipset component provides an example of Freescale Semiconductor for medical and other industrial and consumer applications to provide sensing, control and ZigBee RF functionality. </p><p>  Moreover, micro-controllers and transceivers can be combined in one package, create a more compact and efficient solution.  Figure 2 shows the Freescale&#39;s System in Package (SIP), SIP uses a standard consistent with IEEE802.15.4 wireless transceiver and the HCS08 microcontroller core. </p><p><img src=http://www.uudo.net/UpLoadFiles/Files/../UpPic/2009-4/28/0942813050845410.jpg onclick=get_larger(this) alt="The use of semiconductor technology of information between doctors and patients management" /></p><p>  Figure 2: the use of compatible MC1321xSIP Freescale MC1319x transceiver and 8-bit HCS08 microcontroller core. </p><p>  Sensor Technology </p><p>  Sensor is monitoring the status of the patient point of contact.  Pressure sensors and acceleration sensors can be in a variety of different applications used in medical monitoring.  In Figure 1, chipsets example, all other components are used for processing and dissemination of sensors collecting information. </p><p>  Typical piezoresistive sensors (typically used in pressure sensors) from the composition of etched silicon diaphragm, membrane and implanted into the piezoresistive element.  The physical pressure (such as the air pressure increase), piezoresistive materials will change the resistance.  Silicon piezoresistive pressure sensors provide a very accurate linear voltage output, and is directly proportional to the pressure. </p><p>  Acceleration sensors through changing the voltage output levels indicate changes in the operation.  High acceleration sensors - like flying MMA6280Q Freescale&#39;s dual-axis (X and Z) low-gravity device - far more complex pressure sensor.  It consists of two surface micromachined capacitive sensing cell (g-cell), as well as included in a single integrated circuit package composed of the signal conditioning ASIC.  The use of micro-mechanical sensor wafer, sealed in wafer layer. </p><p>  g-cell is a semiconductor process used to form the mechanical structure, which is a group connected to the central axis of the beam, the central axis to move between the two beams.  g-cell capacitors beams form two back to back, with the center beam to accelerate movement, the distance between the two beams are also constantly changing, the value of each capacitor is also changing.  ASIC switching capacitor technology used to measure the g-cell capacitors, and from the difference between the two capacitors to extract speed data.  ASIC also conducted signal conditioning, and signal filtering, which provides proportional with the acceleration of high output voltage. </p><p>  g-cell architecture can be used to develop a number of different acceleration sensors.  MMA7260Q Freescale has developed a three-axis low-gravity sensor (measuring X, Y, and Z axis movement), but also a step forward.  To demonstrate the accelerometer feature, Freescale has developed a three-axial sensor reference board (STAR), designed to help customers in markets such as medical monitoring accelerometers to achieve critical applications.  In the past few years, the acceleration sensor has undergone significant changes, including increased sensitivity, reduced power consumption, package size reduction.  Similar to the STAR This tool will help developers learn how to better use of the latest technological advances. </p><p>  Sensors and micro-controller applications </p><p>  The sensor provides 3 V or 5 V analog output, must be processed before they can send and save for the medical personnel for analysis.  ADC with a low-cost general-purpose 8-bit microcontroller is sufficient to complete this work.  In essence, the sensor will generate analog signals, and the signal input to the ADC, and then through the communication interface (such as RF transceiver) or direct Universal Serial Bus (USB) connection, deal with them, be converted into a computer or monitor device can use the digital signal.  More accurate ADC (such as 10-bit and 8-bit) to ensure a more clear input and output signals. </p><p>  In general, the 8-bit processing speed sufficient to process the data rate and algorithm for compression and decompression functions.  However, they require Flash memory capacity depends largely on the transceiver used in communication protocols.  For example, the processing of data required for ZigBee-compliant memory have been far less than a simple point to point wireless connections.  Sensors and 8-bit controller, combined to provide a compact, cost-effective solution, although the low power consumption, but collecting and processing a large number of useful data.  These data can be related to radio equipment, sent to the remote location, or used to provide on-site treatment services.  Some sensors and micro-controller, the price is very low, so once the system was able to use, these systems may only run a few days have been discarded and replaced. </p><p>  An interesting application of such technology is Insulet Corporation&#39;s OmniPod insulin management system provided.  OmniPod is designed to replace the traditional insulin pumps, equipment requirements of these older patients with diabetes to learn to use them, but also carry large amounts of heavy components, such as insulin library, infusion devices and blood glucose detector.  OmniPod system consists of two full integration of wireless components, namely: a small, self-adhesive disposable OmniPod Insulin storage and delivery systems, with wireless receivers and personal blood glucose Manager (PDM); a PDA-sized handheld device (with micro-controller and radio transmitter).  Patients can through this program the OmniPod handheld devices to issue customized insulin delivery instructions.  It can also monitor the OmniPod&#39;s operation, including an integrated blood glucose meter, you can automatically save records.  The system can pre-set based on the patient&#39;s personal foundation for the transmission rate and dose of insulin. </p><p>  Personal Diabetes Manager (Personal Diabetes Manager, PDM) of the design is very compact enough to carry in a pocket or purse.  OmniPod in the semiconductor and shape memory alloy wire to activate (for insulin delivery) component of the price is very cheap, the equipment used can be discarded after a few days.  Through such applications, the patient can be cost-effective, more comfortable environment (such as in their home) to manage their own treatment and condition.  In addition, they can extend the wireless capabilities similar controller devices in order to directly connect to the Internet gateway, thereby directly and medical service providers to exchange test results and dosage instructions. </p><p>  Another use of sensor technology is an example: not only to monitor the patient&#39;s symptoms, but also to determine the circumstances under which the symptoms appear.  For example, those suffering from incontinence disease patients, you can use with a pressure sensor, microcontroller and RF transceiver of the durable equipment to monitor even very small leaks, and transmission time and flow data, such data should preserved for future analysis.  If the system also includes acceleration sensors, can record all the activities of the patient, such as lying down, standing, walking and jogging, to help nurses to determine whether there are some factors that trigger a specific physical activities, so as to implement a more effective response measures. </p><p>  Wireless </p><p>  Wireless communication technology allows for portable sensing and processing equipment for patients and caregivers become more effective.  It also allows devices to seamlessly transfer data to other networks, such as hospitals Ethernet, CAN systems or the Internet, in order to achieve global access.  In Figure 1, Freescale&#39;s low-power 2.4GHz ISM band transceiver family MC1319x short-range data links and networks to provide a cost-effective solution.  Through the 4-wire serial peripheral interface (SPI) connection, a user with a variety of micro-controller to communicate directly.  Software and processor can be extended to accommodate a variety of applications, ranging from simple point to point system has been to a full ZigBee network. </p><p>  To conduct a simple proprietary wireless connection, only a physical layer (PHY), as well as for point to point and STAR network application software, a simple media access controller (SMAC).  A simple lack of wireless connectivity memory requirements 2.5Kb, very low power requirements for the applications, it is a very cost-effective, these applications include portable one-time medical monitoring equipment. </p><p>  In 2003, IEEE released a standard based on 802.15.4 simple packet data protocol for lightweight wireless networks.  This powerful communication protocols including the 802.15.4PHY and the media access controller (MAC).  For those who need long battery life, the need for controllers, sensors and remote monitoring to provide an optional delay applications, the use of 802.15.4 effect is very good.  802.15.4 wireless connectivity for simple higher security, mesh and cluster tree can be used in network applications. </p><p>  IEEE802.15.4 protocol standard features for full compliance with ZigBee standards laid the foundation for embedded platform.  ZigBee stack, including network and security layer, application framework, application configuration file (which can be loaded into line with the standard 802.15.4 transceiver above).  Figure 3 on a simple wireless connection, meet the 802.15.4 standard solutions, ZigBee platform, these three were compared, including their memory requirements of micro-controller (using Freescale S08 core) and the wireless transceiver examples ( MC1319x series of equipment). </p><p><img src=http://www.uudo.net/UpLoadFiles/Files/../UpPic/2009-4/28/0942813052423014.jpg onclick=get_larger(this) alt="The use of semiconductor technology of information between doctors and patients management" /></p><p>  Figure 3: Comparison of medical monitoring applications for wireless communication solutions for the three requirements, they all use the Freescale S08 MCU core and MC1319x wireless transceiver. </p><p>  ZigBee has a number of compelling features, making it a medical monitoring applications, the most competitive candidate for the program.  Many applications are just the regular run, or run only a short time.  In order to put with minimal power consumption, which greatly extend the battery life, ZigBee and Bluetooth can enter sleep mode, only when necessary wake-up and communication, to extend battery life.  Wi-Fi can not sleep - wake - sleep mode, efficient operation, it must always be open, it makes it unsuitable for many applications. </p><p>  ZigBee and Bluetooth can work in a very short cycle operation (1% duty cycle mean that the application is only 1% of the time is running), but the delay is a major advantage of ZigBee.  Bluetooth device may take several seconds to wake up, and begin to synchronize with the network communications.  On the contrary, ZigBee does not require pre-synchronization in communications, which will awaken to the communication delay be shortened to 27 milliseconds.  This allows more accurate scheduling, in each wake-up cycle to extend battery life. </p><p>  ZigBee can also increase the memory or the appropriate software, from simple point-to-use extended to large-scale mesh network environment. </p><p>  Communication extension </p><p>  Hospitals and other medical facilities, greater reliance on network communications to move large amounts of data, so that other people who need the data to more easily access.  Controller Area Network (CAN) was originally developed for automotive applications, can be connected to a series of information-sharing need to rely on instruments and monitors.  CAN can be connected to an Ethernet backbone for the entire health care organization-wide data transmission.  However, the hospitals most of the devices are portable, usually fixed to the trolley.  Through the short-distance wireless communication, can be achieved with the building of permanent backbone network connections, even if the cart continuously from one room to another room to push. </p><p>  Similarly, the home medical monitoring equipment can also be Wi-Fi access point or home networking gateway cable or DSL to connect to the Internet.  Once connected to the Internet, patients can be the key to monitoring information via a dedicated web site access, dedicated web site medical personnel can also provide quick access to patient medical records.  Management of the hospital just the flow of information from multiple sources in order to conduct effective analysis of information to achieve between doctors and patients faster and more accurate response. </p><p>  Medical Monitoring Gateway </p><p>  Today&#39;s medical staff access to patient information channels more than ever, however, if in case of emergency did not interconnect data, analysis, recording and responding to, we can not implement the diversity of information.  One of the key emerging application of the composition from the medical monitoring of the gateway, these gateways allow the medical staff from the local and the central base station monitoring, and connectivity devices.  From different hospital room equipment such as respirators, heart monitors and agents from the central base station controller, and so can be carried out safely remote monitoring.  Bedside and medical-related equipment can be connected via Ethernet to the local microprocessor-based medical monitoring gateway, if it is with the traditional medical-related equipment, through the serial RS-232 port to connect to the monitoring of the gateway.  Under normal circumstances, every aspect of the gateway with the central router with wires connected to it with the central base station to connect. </p><p>  The microprocessor used in the medical gateway must provide connectivity and security, extend product life.  Specially designed for the application of the latest generation of microprocessors provides a variety of connectivity options, such as the number of 10/100 Fast Ethernet controller, USB and queued serial peripheral interface.  The latest generation of microprocessors helped the overall security Ethernet network to provide secure point to point communications, rather than give an impact on system performance.  For the data received from the bedside device, a microprocessor will be encrypted, and then send it by Ethernet to a central base station before.  At the central base station to decrypt the data and parsing. </p><p><img src=http://www.uudo.net/UpLoadFiles/Files/../UpPic/2009-4/28/0942813053347707.jpg onclick=get_larger(this) alt="The use of semiconductor technology of information between doctors and patients management" /></p><p>  Figure 4: Using the MCF5275ColdFire Freescale embedded processor block diagram of the medical monitoring for the gateway. </p><p>  In addition to a central base station from the remote monitoring of the specified medical equipment bed inside the room, the medical staff also want to use USB interface, in the patient&#39;s ward access to the same data.  For example, with the USBOn-The-Go (OTG) port of the PDA, users can gateway USB-Ethernet adapter port to access the system.  USB-OTG is a new supplementary USB2.0 specification, by increasing the USB peripheral device connectivity and enhance the existing mobile devices and USB peripherals to existing features.  With this additional USB functionality, medical service providers for each patient to the hospital for medical treatment to keep track of the status of the patient. </p><p>  Personal contacts </p><p>  Under normal circumstances, there is no alternative to voice communications.  Voice over Internet Protocol (VoIP) is a very interesting technological applications, its consumers and business users in the application of the increasing popularity of, and demonstrated its great potential for the medical services industry.  It can provide more voice communications services.  For example, beds can be used VoIP technology, and nurses stations, and other departments in wireless communications.  As the information as data packets transmitted on the Internet, which can be transferred to almost any place, for example, for many hospital services, the center of treatment area, or transferred to the individual&#39;s mobile phone to adapt to the expanding doctor / patient relationship.  Moreover, VoIP text and voice data can be directly saved to the database to meet the demand for fast retrieval, to avoid the use of bulky tape storage systems. </p><p>  This summary </p><p>  Hospitals must make an unprecedented high efficiency to record, processing, transmission, save a large volume of data, while also cutting costs, this is indeed a very demanding requirements.  In hospitals and clinics around the world in semiconductor technology are helping the health care industry to achieve this goal.  In addition, the semiconductor technology also provides some tools to enable patients to spend more time at home and less in hospitals and other medical facilities in time to help patients enjoy life.  In addition, through advanced network communications, the doctor can enter the family, issued a virtual call the family, health service providers will be able to get timely, accurate information, and use this information more efficiently manage the treatment.  Semiconductor technology will be a doctor / patient relationship extends to the family, extends to the world in any one place.  It is for patients and health care personnel who are a very useful technology. </p> ]]></description>
</item>

</channel>
</rss>

