<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7284850559043997789</id><updated>2011-11-27T16:23:53.380-08:00</updated><title type='text'>Programmer's Life</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://cs20001.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://cs20001.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default?start-index=101&amp;max-results=100'/><author><name>rong889</name><uri>http://www.blogger.com/profile/06593146008221514057</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2098</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7284850559043997789.post-5210727053523102567</id><published>2010-02-04T05:29:00.027-08:00</published><updated>2010-02-04T05:29:46.607-08:00</updated><title type='text'>17.2 Advanced Function Options</title><content type='html'>&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#e6e6e6"&gt;&lt;br /&gt;&lt;tr style="background-image: url(images/tile_back.gif);"&gt;&lt;br /&gt;&lt;td class="v2" align="left" width="30%"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td class="v2" align="center" width="40%"&gt;&lt;br /&gt;&amp;nbsp;&amp;lt;&amp;nbsp;Day Day Up&amp;nbsp;&amp;gt;&amp;nbsp;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td class="v2" align="right" width="30%"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;br /&gt;&lt;H3 class="docSection1Title"&gt;17.2 Advanced Function Options&lt;/H3&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docText"&gt;By now we've introduced you to&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  all&lt;br /&gt;&lt;br /&gt;but one of Oracle's regular expression functions.&lt;br /&gt;&lt;br /&gt;However, you've only seen them used in their&lt;br /&gt;&lt;br /&gt;simplest form. Their full syntax is:&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;REGEXP_INSTR(&lt;TT&gt;&lt;I&gt;source_string&lt;/I&gt;&lt;/TT&gt;, &lt;TT&gt;&lt;I&gt;expression&lt;/I&gt;&lt;/TT&gt; &lt;br /&gt;&lt;br /&gt;            [, &lt;TT&gt;&lt;I&gt;position&lt;/I&gt;&lt;/TT&gt; [, &lt;TT&gt;&lt;I&gt;occurrence&lt;/I&gt;&lt;/TT&gt;&lt;br /&gt;&lt;br /&gt;            [, &lt;TT&gt;&lt;I&gt;return_option&lt;/I&gt;&lt;/TT&gt; &lt;br /&gt;&lt;br /&gt;            [, &lt;TT&gt;&lt;I&gt;match_parameter&lt;/I&gt;&lt;/TT&gt;]]]])&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;REGEXP_LIKE (&lt;TT&gt;&lt;I&gt;source_string&lt;/I&gt;&lt;/TT&gt;, &lt;TT&gt;&lt;I&gt;expression&lt;/I&gt;&lt;/TT&gt; &lt;br /&gt;&lt;br /&gt;            [, &lt;TT&gt;&lt;I&gt;match_parameter&lt;/I&gt;&lt;/TT&gt;])&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;REGEXP_REPLACE(&lt;TT&gt;&lt;I&gt;source_string&lt;/I&gt;&lt;/TT&gt;, &lt;TT&gt;&lt;I&gt;expression&lt;/I&gt;&lt;/TT&gt;&lt;br /&gt;&lt;br /&gt;              [, &lt;TT&gt;&lt;I&gt;replace_string&lt;/I&gt;&lt;/TT&gt;&lt;br /&gt;&lt;br /&gt;              [, &lt;TT&gt;&lt;I&gt;position&lt;/I&gt;&lt;/TT&gt; [, &lt;TT&gt;&lt;I&gt;occurrence&lt;/I&gt;&lt;/TT&gt;&lt;br /&gt;&lt;br /&gt;              [, &lt;TT&gt;&lt;I&gt;match_parameter&lt;/I&gt;&lt;/TT&gt;]]]])&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;REGEXP_SUBSTR(&lt;TT&gt;&lt;I&gt;source_string&lt;/I&gt;&lt;/TT&gt;, &lt;TT&gt;&lt;I&gt;expression&lt;/I&gt;&lt;/TT&gt;&lt;br /&gt;&lt;br /&gt;             [, &lt;TT&gt;&lt;I&gt;position&lt;/I&gt;&lt;/TT&gt; [, &lt;TT&gt;&lt;I&gt;occurrence&lt;/I&gt;&lt;/TT&gt;&lt;br /&gt;&lt;br /&gt;             [, &lt;TT&gt;&lt;I&gt;match_parameter&lt;/I&gt;&lt;/TT&gt;]]])&lt;/PRE&gt;&lt;BR&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docText"&gt;If you're familiar with Oracle's&lt;br /&gt;&lt;br /&gt;string-manipulation functions, you'll have no&lt;br /&gt;&lt;br /&gt;trouble discerning the purpose of the &lt;br /&gt;&lt;br /&gt;REGEXP&lt;br /&gt;&lt;br /&gt;functions:&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;DL class="docList"&gt;&lt;br&gt;&lt;p&gt;&lt;/p&gt;&lt;DT&gt;&lt;span class="docPubcolor"&gt;&lt;br /&gt;&lt;br /&gt;REGEXP_INSTR&lt;/span&gt;&lt;/DT&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;DD&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docList"&gt;Returns the character position at which text can be found matching a&lt;br /&gt;&lt;br /&gt;regular expression in a target string.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;/DD&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;p&gt;&lt;/p&gt;&lt;DT&gt;&lt;span class="docPubcolor"&gt;&lt;br /&gt;&lt;br /&gt;REGEXP_LIKE&lt;/span&gt;&lt;/DT&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;DD&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docList"&gt;Discerns whether a given string contains text matching an expression.&lt;br /&gt;&lt;br /&gt;This is a Boolean function, returning TRUE or FALSE, or NULL.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;/DD&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;p&gt;&lt;/p&gt;&lt;DT&gt;&lt;span class="docPubcolor"&gt;&lt;br /&gt;&lt;br /&gt;REGEXP_REPLACE&lt;/span&gt;&lt;/DT&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;DD&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docList"&gt;Performs a regular expression search-and-replace operation, which&lt;br /&gt;&lt;br /&gt;you'll learn about in Section 17.3.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;/DD&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;p&gt;&lt;/p&gt;&lt;DT&gt;&lt;span class="docPubcolor"&gt;&lt;br /&gt;&lt;br /&gt;REGEXP_SUBSTR&lt;/span&gt;&lt;/DT&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;DD&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docList"&gt;Extracts text matching a regular expression from a string.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;/DD&gt;&lt;br /&gt;&lt;br /&gt;&lt;/DL&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docText"&gt;The parameters to these functions are as follows:&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;DL class="docList"&gt;&lt;br&gt;&lt;p&gt;&lt;/p&gt;&lt;DT&gt;&lt;span class="docPubcolor"&gt;&lt;TT&gt;&lt;I&gt;source_string&lt;/I&gt;&lt;/TT&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/DT&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;DD&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docList"&gt;The string to be searched.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;/DD&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;p&gt;&lt;/p&gt;&lt;DT&gt;&lt;span class="docPubcolor"&gt;&lt;TT&gt;&lt;I&gt;expression&lt;/I&gt;&lt;/TT&gt;&lt;/span&gt;&lt;/DT&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;DD&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docList"&gt;A regular expression describing the pattern of text that you seek.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;/DD&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;p&gt;&lt;/p&gt;&lt;DT&gt;&lt;span class="docPubcolor"&gt;&lt;TT&gt;&lt;I&gt;replace_string&lt;/I&gt;&lt;/TT&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/DT&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;DD&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docList"&gt;A string generating the replacement text to be used in a&lt;br /&gt;&lt;br /&gt;search-and-replace operation.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;/DD&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;p&gt;&lt;/p&gt;&lt;DT&gt;&lt;span class="docPubcolor"&gt;&lt;TT&gt;&lt;I&gt;position&lt;/I&gt;&lt;/TT&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/DT&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;DD&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docList"&gt;The character position within&lt;br /&gt;&lt;br /&gt;&lt;TT&gt;&lt;I&gt;source_string&lt;/I&gt;&lt;/TT&gt; at which to begin a search.&lt;br /&gt;&lt;br /&gt;This defaults to 1.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;/DD&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;p&gt;&lt;/p&gt;&lt;DT&gt;&lt;span class="docPubcolor"&gt;&lt;TT&gt;&lt;I&gt;occurrence&lt;/I&gt;&lt;/TT&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/DT&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;DD&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docList"&gt;The occurrence of the pattern you wish to locate. This defaults to 1,&lt;br /&gt;&lt;br /&gt;giving you the first possible match.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;/DD&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;p&gt;&lt;/p&gt;&lt;DT&gt;&lt;span class="docPubcolor"&gt;&lt;TT&gt;&lt;I&gt;return_option&lt;/I&gt;&lt;/TT&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/DT&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;DD&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docList"&gt;Valid only for REGEXP_INSTR, and determines whether the beginning or&lt;br /&gt;&lt;br /&gt;ending character position is returned for text matching a pattern.&lt;br /&gt;&lt;br /&gt;The default is 0, for the beginning. Use 1 to return the ending&lt;br /&gt;&lt;br /&gt;position.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;/DD&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;p&gt;&lt;/p&gt;&lt;DT&gt;&lt;span class="docPubcolor"&gt;&lt;TT&gt;&lt;I&gt;match_parameter&lt;/I&gt;&lt;/TT&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/DT&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;DD&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docList"&gt;A text string through which you may specify options to vary the&lt;br /&gt;&lt;br /&gt;behavior of the regular expression matching engine.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;/DD&gt;&lt;br /&gt;&lt;br /&gt;&lt;/DL&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docText"&gt;The &lt;TT&gt;match_parameter&lt;/TT&gt; deserves a bit of explanation.&lt;br /&gt;&lt;br /&gt;It's a character string that you build using one or&lt;br /&gt;&lt;br /&gt;more of the following letters: &lt;TT&gt;i&lt;/TT&gt;,&lt;br /&gt;&lt;br /&gt;&lt;TT&gt;c&lt;/TT&gt;, &lt;TT&gt;n&lt;/TT&gt;, &lt;TT&gt;m&lt;/TT&gt;. One&lt;br /&gt;&lt;br /&gt;use is to specify whether matching is case-sensitive. By default,&lt;br /&gt;&lt;br /&gt;your NLS_SORT setting drives this aspect of regular expression&lt;br /&gt;&lt;br /&gt;behavior. You can override that default on a call-by-call basis,&lt;br /&gt;&lt;br /&gt;using &lt;TT&gt;i&lt;/TT&gt; to get case-insensitive matching, and&lt;br /&gt;&lt;br /&gt;&lt;TT&gt;c&lt;/TT&gt; to get case-sensitive matching. Following is a&lt;br /&gt;&lt;br /&gt;simple demonstration that works with our example data set. When the&lt;br /&gt;&lt;br /&gt;&lt;TT&gt;i&lt;/TT&gt; option is used, the match succeeds, even though&lt;br /&gt;&lt;br /&gt;the case really does not match:&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;&lt;B&gt;SELECT emp_id, text&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;B&gt;FROM employee_comment&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;B&gt;WHERE REGEXP_LIKE(text, 'CEDAR LAKE', 'c');&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;no rows selected&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;B&gt;SELECT emp_id, text&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;B&gt;FROM employee_comment&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;B&gt;WHERE REGEXP_LIKE(text, 'CEDAR LAKE', 'i');&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    EMP_ID TEXT&lt;br /&gt;&lt;br /&gt;---------- ---------------------------------------------&lt;br /&gt;&lt;br /&gt;      7499 1105 McConnell Court&lt;br /&gt;&lt;br /&gt;           Cedar Lake MI 48812&lt;br /&gt;&lt;br /&gt;           Home: (989) 387-4321&lt;br /&gt;&lt;br /&gt;           Cell: (237) 438-3333&lt;br /&gt;&lt;br /&gt;      7782 Academy Apartments, #138, Cedar Lake MI 48812&lt;br /&gt;&lt;br /&gt;      7788 #1 Water Tower Lane&lt;br /&gt;&lt;br /&gt;           Cedar Lake MI 48812&lt;/PRE&gt;&lt;BR&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docText"&gt;The &lt;TT&gt;n&lt;/TT&gt; option is useful when working with data,&lt;br /&gt;&lt;br /&gt;such as ours, that contains embedded newline (usually&lt;br /&gt;&lt;br /&gt;&lt;TT&gt;chr(10)&lt;/TT&gt;) characters. By default, the period&lt;br /&gt;&lt;br /&gt;(.) does not match newlines, which is why the&lt;br /&gt;&lt;br /&gt;following query brings back only the first line of comment text:&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;&lt;B&gt;SELECT emp_id, REGEXP_SUBSTR(text, '.*') text&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;B&gt;FROM employee_comment&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;B&gt;WHERE emp_id = 7698;&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    EMP_ID TEXT&lt;br /&gt;&lt;br /&gt;---------- ---------------&lt;br /&gt;&lt;br /&gt;      7698 Marion Blake&lt;/PRE&gt;&lt;BR&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docText"&gt;Using '&lt;TT&gt;n&lt;/TT&gt;' for the match parameter, you can have&lt;br /&gt;&lt;br /&gt;the period match newlines, which in the case of this query, results&lt;br /&gt;&lt;br /&gt;in the entire comment being returned:&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;&lt;B&gt;SELECT emp_id, REGEXP_SUBSTR(text, '.*', 1, 1, 'n') text&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;B&gt;FROM employee_comment&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;B&gt;WHERE emp_id = 7698;&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    EMP_ID TEXT&lt;br /&gt;&lt;br /&gt;---------- -----------------------&lt;br /&gt;&lt;br /&gt;      7698 Marion Blake&lt;br /&gt;&lt;br /&gt;           N1375 Lakeshore Drive&lt;br /&gt;&lt;br /&gt;           Vestaburg MI 48891&lt;br /&gt;&lt;br /&gt;           (989) 388-1234&lt;/PRE&gt;&lt;BR&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docText"&gt;This example also illustrates the important point that specifying a&lt;br /&gt;&lt;br /&gt;match parameter forces you to also specify any preceding, optional&lt;br /&gt;&lt;br /&gt;parameters that you would otherwise skip.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docText"&gt;The final match option is &lt;TT&gt;m&lt;/TT&gt;, which changes the&lt;br /&gt;&lt;br /&gt;definition of &lt;span class="docEmphasis"&gt;line&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;with respect to the &lt;TT&gt;^&lt;/TT&gt; and &lt;TT&gt;$&lt;/TT&gt;&lt;br /&gt;&lt;br /&gt;metacharacters. By default, line means &lt;span class="docEmphasis"&gt;the entire target&lt;br /&gt;&lt;br /&gt;string&lt;/span&gt;, so an expression such as &lt;TT&gt;^.*$&lt;/TT&gt;,&lt;br /&gt;&lt;br /&gt;together with the &lt;TT&gt;n&lt;/TT&gt; option, will bring back all&lt;br /&gt;&lt;br /&gt;characters in the target string:&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;&lt;B&gt;SELECT emp_id, REGEXP_SUBSTR(text, '^.*$', 1, 1, 'n') text&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;B&gt;FROM employee_comment&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;B&gt;WHERE emp_id = 7788;&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    EMP_ID TEXT&lt;br /&gt;&lt;br /&gt;---------- --------------------&lt;br /&gt;&lt;br /&gt;      7788 #1 Water Tower Lane&lt;br /&gt;&lt;br /&gt;           Cedar Lake MI 48812&lt;/PRE&gt;&lt;BR&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docText"&gt;The&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;TT&gt;n&lt;/TT&gt; option is necessary here, because otherwise the&lt;br /&gt;&lt;br /&gt;period would not match the newline. If the period did not match the&lt;br /&gt;&lt;br /&gt;newline, the expression would fail to match at that point, and it&lt;br /&gt;&lt;br /&gt;would be impossible to match all characters between the beginning and&lt;br /&gt;&lt;br /&gt;end of the string.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docText"&gt;However, using the &lt;TT&gt;m&lt;/TT&gt; option causes the definition&lt;br /&gt;&lt;br /&gt;of line to change from &lt;span class="docEmphasis"&gt;the entire target string&lt;/span&gt;,&lt;br /&gt;&lt;br /&gt;to &lt;span class="docEmphasis"&gt;any line within that string&lt;/span&gt;, where lines are&lt;br /&gt;&lt;br /&gt;delimited by newline characters. The following example removes&lt;br /&gt;&lt;br /&gt;&lt;TT&gt;n&lt;/TT&gt;, replacing it with &lt;TT&gt;m&lt;/TT&gt;:&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;&lt;B&gt;SELECT emp_id, REGEXP_SUBSTR(text, '^.*$', 1, 1, 'm') text&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;B&gt;FROM employee_comment&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;B&gt;WHERE emp_id = 7788;&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    EMP_ID TEXT&lt;br /&gt;&lt;br /&gt;---------- --------------------&lt;br /&gt;&lt;br /&gt;      7788 #1 Water Tower Lane&lt;/PRE&gt;&lt;BR&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docText"&gt;You can specify multiple match parameters in any order. For example,&lt;br /&gt;&lt;br /&gt;'&lt;TT&gt;in&lt;/TT&gt;' means the same as '&lt;TT&gt;ni&lt;/TT&gt;'. If&lt;br /&gt;&lt;br /&gt;you specify &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; conflicting options, such as&lt;br /&gt;&lt;br /&gt;'&lt;TT&gt;ic&lt;/TT&gt;', the last option, '&lt;TT&gt;c&lt;/TT&gt;' in&lt;br /&gt;&lt;br /&gt;this case, is the one that takes precedence.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;P&gt;&lt;table border="0" bgcolor="black" cellspacing="0" cellpadding="1" width="90%" align="center"&gt;&lt;tr&gt;&lt;td&gt;&lt;table bgcolor="white" width="100%" border="0" cellspacing="0" cellpadding="6"&gt;&lt;tr&gt;&lt;td width="60" valign="top"&gt;&lt;/td&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docText"&gt;Try our last example in this section using '&lt;TT&gt;mn&lt;/TT&gt;' as&lt;br /&gt;&lt;br /&gt;the match parameter string. You'll get back the&lt;br /&gt;&lt;br /&gt;entire target string. Why? Because of the greediness rule. When&lt;br /&gt;&lt;br /&gt;'&lt;TT&gt;mn&lt;/TT&gt;' is used, the first line is a match, but the&lt;br /&gt;&lt;br /&gt;entire string is a longer match.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/P&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#e6e6e6"&gt;&lt;br /&gt;&lt;tr style="background-image: url(images/tile_back.gif);"&gt;&lt;br /&gt;&lt;td class="v2" align="left" width="30%"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td class="v2" align="center" width="40%"&gt;&lt;br /&gt;&amp;nbsp;&amp;lt;&amp;nbsp;Day Day Up&amp;nbsp;&amp;gt;&amp;nbsp;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td class="v2" align="right" width="30%"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7284850559043997789-5210727053523102567?l=cs20001.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cs20001.blogspot.com/feeds/5210727053523102567/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7284850559043997789&amp;postID=5210727053523102567' title='34 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/5210727053523102567'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/5210727053523102567'/><link rel='alternate' type='text/html' href='http://cs20001.blogspot.com/2010/02/172-advanced-function-options.html' title='17.2 Advanced Function Options'/><author><name>rong889</name><uri>http://www.blogger.com/profile/06593146008221514057</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>34</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7284850559043997789.post-3343547338534364139</id><published>2010-02-04T05:29:00.025-08:00</published><updated>2010-02-04T05:29:45.371-08:00</updated><title type='text'>Acknowledgments</title><content type='html'>&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#CCCCCC"&gt;&lt;br /&gt;&lt;td class="tt1"&gt;Ru-Brd&lt;/td&gt;&lt;br /&gt;&lt;td valign="top" class="v2" align="right"&gt;&lt;br /&gt;	&lt;br /&gt;	&lt;br /&gt;&lt;/td&gt;&lt;/table&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td valign="top"&gt;&lt;H3 class="docSection1Title"&gt; Acknowledgments&lt;/H3&gt;&lt;br /&gt;&lt;P class="docText"&gt;I'd like to thank my family, whom I bribed with four-wheelers with the advance money, in order to make losing a lot of Mom's time and attention worth it to them too. I especially want to thank my oldest daughter, Jennifer, for learning to make SpaghettiOs and hot dogs for herself and her sister so that Mommy could work on her book. I'd like to thank my youngest daughter, Jessica, for not letting me forget who is most important. And finally, I'd like to thank my husband, Ken, who really didn't understand why I needed to write this book but put up with it, and the never-ending crunching schedules, anyway &amp;#8230; even when it didn't seem worth the four-wheelers anymore.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Thanks also to my manager and my friend, Carolyn Ruby, who made this book part of "my job" and has always been so supportive in helping me achieve my goals and find my killer instinct. Thanks to Janet Farrell and Vera Plechash, my cheerleaders. Thanks to Ward Harold for catching the JMX vision and for buddying up with me so that I could see my name in print. Thanks to Leigh for championing JMX in WebSphere and the JCP. And finally, thanks to Shelley Kronzek for continuing to nag until we were doing something we really wanted to do in the first place and for being the mediator between us technical chickens and the big scary publishing world.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;� Heather Kreger&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Wow, I'm writing acknowledgements. That must mean this project is almost complete. Saints be praised! Thanks to St. Heather for introducing me to JMX and, especially, for handling all the "lead author" administration chores. Our editor, St. Shelley Kronzek, persevered with us on this project through a series of trying circumstances and &lt;span class="docEmphasis"&gt;still&lt;/span&gt; bought us dinner in San Francisco. Thanks for your patience and dedication, Shelley.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Although I got to write the book, there is a fantastic group of people in Rome, Italy, who did most of the hard work of bringing JMX to life within Tivoli as TMX4J. To Kenneth Barron, Alfredo Cappariello, Raimondo Castino, Eliseba Costantini, Marco de Gregorio, Paola Diomede, Roberto Longobardi, Attilio Mattiocco, Marco Melillo, Alessio Menale, Chiara Montecchio, Massimiliano (Max) Parlione, Maurizio Simeoni, Massimo Tarquini, and Cosimo (Mimmo) Vampo, mille grazie ragazzi! My heartfelt thanks also go to Cesare Giuliani, the best development manager I've ever worked with, for turning my fuzzy musings into working code and never complaining when I didn't come back from Sabaudia when I said I would, and to Maurizio Piatti, who is simply my favorite Italian.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Finally, special thanks to my wife Diana and our kids Matthew, Aaron, and Kelly Rose for putting up with the constant presence of Daddy's laptop and the absence of his homemade bread for all these months. You guys make it all worthwhile.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;� Ward Harold&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;I would like to thank my wife and daughter, Cheryl and Claire, for their patience and support. You are my compass and my light. I would also like to thank my coauthors, Heather and Ward, for their continued support and enthusiasm. Thanks go to all of the members of the JSR 77 expert group who worked so hard to produce the specification. Thanks to the management at IBM, Michelle Swenson and Diane Copenhaver, for encouragement and resources. And I would also like to thank the folks at Addison-Wesley, Shelley and all of the reviewers, for their excellent comments and suggestions.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;� Leigh Williamson&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;td&gt;&lt;/td&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#CCCCCC"&gt;&lt;br /&gt;&lt;td class="tt1"&gt;Ru-Brd&lt;/td&gt;&lt;br /&gt;&lt;td valign="top" class="v2" align="right"&gt;&lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;&lt;/td&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7284850559043997789-3343547338534364139?l=cs20001.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cs20001.blogspot.com/feeds/3343547338534364139/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7284850559043997789&amp;postID=3343547338534364139' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/3343547338534364139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/3343547338534364139'/><link rel='alternate' type='text/html' href='http://cs20001.blogspot.com/2010/02/acknowledgments.html' title='Acknowledgments'/><author><name>rong889</name><uri>http://www.blogger.com/profile/06593146008221514057</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7284850559043997789.post-3602705229256716605</id><published>2010-02-04T05:29:00.023-08:00</published><updated>2010-02-04T05:29:44.201-08:00</updated><title type='text'>11.5 Collection of Issues for Beyond Version 1.1</title><content type='html'>&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;td class="tt1"&gt;[ Team LiB ]&lt;/td&gt;&lt;td valign="top" class="tt1" align="right"&gt;&lt;br /&gt;	&lt;br /&gt;	&lt;br /&gt;&lt;/td&gt;&lt;/table&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td valign="top"&gt;&lt;H3 class="docSection1Title"&gt;11.5 Collection of Issues for Beyond Version 1.1&lt;/H3&gt;&lt;br /&gt;&lt;P class="docText"&gt;The public review period for CMMI version 0.2 in 1999 resulted in about 2,500 change requests to the model and the "books" that represent the model. Of these requests, approximately 400 were classified as "minor" and 500 were considered "global" (affecting several process areas or other elements). The remaining change requests were classified as being "local" to the individual model elements. For several of the change requests in the global and local categories, the CMMI Team lacked sufficient time to deal with them properly. Instead, they were placed on a list of potentially good ideas warranting more exploration.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;The use of version 1.0 resulted in many more change requests to the model components. The CMMI Team used the same process to deal with the large number of changes requested, and as happened prior to version 1.0's release, version 1.1 does not address all of the potentially good ideas from the reviewers. In this section, we discuss a few of the other major open issues�that is, issues deferred for consideration to after version 1.1.&lt;/P&gt;&lt;br /&gt;&lt;H4 class="docSection2Title"&gt;11.5.1 Advanced Practices&lt;/H4&gt;&lt;br /&gt;&lt;P class="docText"&gt;The implementation of advanced practices remains an issue. Version 1.1 allows advanced practices in the Engineering category but not in the other process area categories. For the future, we would expect that as the model is used, one of two things would occur. First, process improvement in the Engineering process areas might be aided by the presence of advanced practices, prompting users of this model to seek the expansion of this concept across the entire model.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Second, the value that advanced practices may have for process improvement might be viewed as insufficient to justify the architectural complexity they introduce, prompting model users to ask for their elimination across the entire model. The decision within the CMMI Team to put them into the initial model releases in a limited way was intended to lay the foundation for feedback either in favor of or opposed to advanced practices, as the team could not reach a consensus view. This disagreement was a part of the debate between proponents of staged versus continuous architectures.&lt;/P&gt;&lt;br /&gt;&lt;H4 class="docSection2Title"&gt;11.5.2 Generic Attributes&lt;/H4&gt;&lt;br /&gt;&lt;P class="docText"&gt;EIA 731 contains generic attributes, an aspect of process improvement that is not included in any other source model. Generic attributes address the effectiveness of the process and the value of the work products produced by it. Proponents of generic attributes on the CMMI Team generated a proposal for CMMI generic attributes by making changes to improve the objectivity of the generic attributes in EIA 731. In the end, however, that proposal was not adopted.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Generic attributes add a significant aspect to process improvement that is not addressed by the capability dimension or the process dimension: How effective are the processes in your environment, and do they produce work products that the stakeholders find valuable? Some organizations have developed the ability to evaluate this process-improvement dimension by adopting the Lean initiative. For CMMI, the question remains: Would the inclusion of generic attributes in a CMMI appraisal be of sufficient value, given the issue of their objectivity?&lt;/P&gt;&lt;br /&gt;&lt;H4 class="docSection2Title"&gt;11.5.3 Relationship to Other Process Areas&lt;/H4&gt;&lt;br /&gt;&lt;P class="docText"&gt;CMMI version 1.1 includes a section in each process area titled "Related Process Areas," which contains (not surprisingly) references to other process areas. A recommendation was made and accepted by the CMMI Team (but not implemented in version 1.1) to change the title of this section to "Relationships with Other Process Areas," and to make its content more meaningful.&lt;sup class="docFootnote"&gt;[7]&lt;/sup&gt;&lt;/P&gt;&lt;blockquote&gt;&lt;p class="docFootnote"&gt;&lt;sup&gt;[7]&lt;/sup&gt; An earlier version of CMMI (predating version 1.0) used two levels of reference: the currently used "informative" reference and a stronger reference. The stronger reference invoked another process area, stating "Use the &lt;span class="docEmphasis"&gt;x&lt;/span&gt; process areas to achieve &lt;span class="docEmphasis"&gt;y.&lt;/span&gt;" The application of the "Use" reference was not consistent across the model, confused model users, and raised issues in the area of appraisal. It was not clear exactly what was implied by the stronger relationship between process areas. Given the many calls to reduce the model's complexity and of the time to adequately study the issue, the stronger reference was eliminated in version 1.0. Whether anyone will make the case to revive multiple forms of reference in CMMI remains to be seen.&lt;/p&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;P class="docText"&gt;The needs related to this issue are as follows:&lt;/P&gt;&lt;br /&gt;&lt;UL&gt;&lt;LI&gt;&lt;P class="docList"&gt;Model users need to understand the high-level (key) relationships between process areas.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class="docList"&gt;Those who develop CMMI training materials need a mechanism to generate a high-level diagram to show relationships between process areas.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class="docList"&gt;Model users need to understand the difference between references at different levels (components) of the model.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;br /&gt;&lt;P class="docText"&gt;The following guidelines were defined to restrict the use of the initial reference section in each process area to key process area interfaces:&lt;/P&gt;&lt;br /&gt;&lt;UL&gt;&lt;LI&gt;&lt;P class="docList"&gt;Change the title of "Related Process Areas" to "Relationships with Other Process Areas."&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class="docList"&gt;Use the "Reference" architectural component but change the structure of the reference, in this section only, to an active statement of the relationship with other process areas.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class="docList"&gt;Allow one to three sentences for each relationship description.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class="docList"&gt;Include only the key relationships (that is, what the user needs to see at a high level).&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class="docList"&gt;Retain the normal references in the model from other components.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P class="docList"&gt;Generate a view in the Product Suite Repository that shows these relationships.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;br /&gt;&lt;P class="docText"&gt;The CMMI Product Team has recommended such a change for each process area as a part of the next release of CMMI.&lt;/P&gt;&lt;br /&gt;&lt;P&gt;&lt;TABLE CELLSPACING="0" WIDTH="90%" BORDER="1"&gt;&lt;TR&gt;&lt;TD&gt;&lt;br /&gt;&lt;H2 class="docSidebarTitle"&gt;&lt;span class="docEmphBoldItalic"&gt;Example Update to Relationships Section&lt;/span&gt;&lt;/H2&gt;&lt;br /&gt;&lt;P class="docText"&gt;The following example is a proposed update to the Technical Solution process area:&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;span class="docEmphStrong"&gt;Relationship with Other Process Areas&lt;/span&gt;&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;The Requirements Development process area provides product-component requirements to this process area so that alternative solutions can be developed.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;The Requirements Development process area receives technical solutions, selected from the alternatives, to refine the product-component requirements.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;The Work Product Verification process area verifies that the product components meet their requirements. As verification issues are identified, the design may need to change. This is an iterative process and occurs throughout the development of the product.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;The Decision Analysis and Resolution process area provides structured decision-making practices that are used in selecting a technical solution from the alternative solutions.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;The Product Integration process area receives the product components following their implementation.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;The Product Integration process area provides integration test deficiencies to this process area for corrective action.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;The Validation process area provides validation deficiencies to this process area for corrective action.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;The Supplier Agreement Management process area handles the acquisition of all product components once the purchase decision is made in this process area.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;&lt;/P&gt;&lt;br&gt;&lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;td&gt;&lt;/td&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;td class="tt1"&gt;[ Team LiB ]&lt;/td&gt;&lt;td valign="top" class="tt1" align="right"&gt;&lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;&lt;/td&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7284850559043997789-3602705229256716605?l=cs20001.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cs20001.blogspot.com/feeds/3602705229256716605/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7284850559043997789&amp;postID=3602705229256716605' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/3602705229256716605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/3602705229256716605'/><link rel='alternate' type='text/html' href='http://cs20001.blogspot.com/2010/02/115-collection-of-issues-for-beyond.html' title='11.5 Collection of Issues for Beyond Version 1.1'/><author><name>rong889</name><uri>http://www.blogger.com/profile/06593146008221514057</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7284850559043997789.post-4282749479325435141</id><published>2010-02-04T05:29:00.021-08:00</published><updated>2010-02-04T05:29:41.389-08:00</updated><title type='text'>Section 3.8. Objects</title><content type='html'>&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;tr&gt;&lt;td align="right"&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;div style=""&gt;&lt;div&gt;&lt;br /&gt;      &lt;h3 class="docSection1Title" id="-100000"&gt;3.8. Objects&lt;/h3&gt;&lt;br /&gt;      &lt;p class="docText"&gt;&amp;#82;uby &amp;#105;s a very &amp;#112;ure &amp;#111;bj&amp;#101;ct-oriented l&amp;#97;nguage: all values are&lt;br /&gt;    objects, and there is no &amp;#100;i&amp;#115;tincti&amp;#111;n betw&amp;#101;en prim&amp;#105;tive types and obj&amp;#101;ct types as there are in many other&lt;br /&gt;    la&amp;#110;guages. In Ruby, all objects inherit from a class named&lt;br /&gt;    &lt;tt&gt;O&amp;#98;ject&lt;/tt&gt; and share the methods defined by that class.&lt;br /&gt;    Th&amp;#105;s secti&amp;#111;n e&amp;#120;p&amp;#108;ains the co&amp;#109;mon features of all objects in Ruby. It is&lt;br /&gt;    dens&amp;#101; in parts, but it's required read&amp;#105;ng; the i&amp;#110;f&amp;#111;rmation here &amp;#105;s&lt;br /&gt;    fundamental.&lt;/p&gt;&lt;br /&gt;      &lt;br /&gt;        &lt;h4 id="title-ID0ET6MM" class="docSection2Title"&gt;3.8.1. Object References&lt;/h4&gt;&lt;br /&gt;        &lt;p class="docText"&gt;When w&amp;#101; work with object&amp;#115; in Ruby, we are really working with&lt;br /&gt;      object &lt;span class="docEmphasis"&gt;&amp;#114;eferences&lt;/span&gt;. It is not the&lt;br /&gt;      object itse&amp;#108;f we manipulate but a reference to it.&lt;sup class="docFootnote"&gt;[*]&lt;/sup&gt;  When we as&amp;#115;ign a va&amp;#108;ue to a vari&amp;#97;ble, we are &amp;#110;o&amp;#116; copying an object &amp;quot;into&amp;quot; th&amp;#97;t variable; we are&lt;br /&gt;      merely storing a reference to &amp;#97;n object i&amp;#110;t&amp;#111; that variabl&amp;#101;. Some code&lt;br /&gt;      makes &amp;#116;his clear:&lt;/p&gt;&lt;blockquote&gt;&lt;p class="docFootnote"&gt;&lt;sup&gt;[*]&lt;/sup&gt; If you are familiar with C or &amp;#67;++, you can think of a&lt;br /&gt;          reference as a point&amp;#101;r: the address of the object in memory. R&amp;#117;by&lt;br /&gt;          does not use pointers, however. References in Ruby are opaque and&lt;br /&gt;          in&amp;#116;ernal to &amp;#116;he imple&amp;#109;entation. Th&amp;#101;re &amp;#105;s no way to take the addr&amp;#101;ss&lt;br /&gt;          of a value, dereference a v&amp;#97;lue, or do p&amp;#111;in&amp;#116;er arithmetic.&lt;/p&gt;&lt;/blockquote&gt;&lt;br /&gt;        &lt;div class="codeSegmentsExpansionLinks"&gt;&lt;br /&gt;              Code View:&lt;/div&gt;&lt;pre class=""&gt;s = "Ruby" # Create a String object. Store a reference to it in s.&lt;br /&gt;t = s      # Copy the reference to t. s and t both refer to the same object.&lt;br /&gt;t[-1] = "" # Modify the object through the reference in t.&lt;br /&gt;print s    # Access the modified object through s. Prints "Rub". &lt;br /&gt;t = "Java" # t now refers to a different object.&lt;br /&gt;print s,t  # Prints "RubJava".&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;					  &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        &lt;p class="docText"&gt;When yo&amp;#117; pass an object to a m&amp;#101;thod in Ruby, it is an &amp;#111;bject&lt;br /&gt;      reference th&amp;#97;t is passed to the method. It is no&amp;#116; the object itself, and&lt;br /&gt;      it is not a reference to the referenc&amp;#101; to &amp;#116;he objec&amp;#116;. Another &amp;#119;ay to say&lt;br /&gt;      thi&amp;#115; is that method arguments are pas&amp;#115;ed &lt;span class="docEmphasis"&gt;by value&lt;/span&gt;&lt;br /&gt;      rather than &lt;span class="docEmphasis"&gt;by reference&lt;/span&gt;, but that the &amp;#118;alues&lt;br /&gt;      pass&amp;#101;d a&amp;#114;e object reference&amp;#115;.&lt;/p&gt;&lt;br /&gt;        &lt;p class="docText"&gt;Because ob&amp;#106;ect references are passed to method&amp;#115;, methods can use&lt;br /&gt;      those referenc&amp;#101;s to modify the unde&amp;#114;lying object. These modifications&lt;br /&gt;      are &amp;#116;hen visi&amp;#98;le when the &amp;#109;ethod retur&amp;#110;s.&lt;/p&gt;&lt;br /&gt;        &lt;br /&gt;          &lt;h5 id="title-ID0EIBNM" class="docSection3Title"&gt;3.8.1.1. Immediate values&lt;/h5&gt;&lt;br /&gt;          &lt;p class="docText"&gt;&amp;#87;e've said that all values in Ruby are objec&amp;#116;s and all objects&lt;br /&gt;        are manipulated b&amp;#121; re&amp;#102;ere&amp;#110;ce. In &amp;#116;he referenc&amp;#101; implementation,&lt;br /&gt;        howe&amp;#118;er, &lt;tt&gt;Fixnum&lt;/tt&gt; and &lt;tt&gt;Symbol&lt;/tt&gt;&lt;br /&gt;        objects are ac&amp;#116;ually &amp;quot;immediate values&amp;quot; rather than referenc&amp;#101;s.&lt;br /&gt;        Neither of these classes have mutator methods, &amp;#115;o&lt;br /&gt;        &lt;tt&gt;Fixnu&amp;#109;&lt;/tt&gt; and &lt;tt&gt;Symbol&lt;/tt&gt; o&amp;#98;jects are&lt;br /&gt;        i&amp;#109;mutable, whi&amp;#99;h means that there is really no way to t&amp;#101;ll that they&lt;br /&gt;        are manipulated by value rather than by r&amp;#101;fe&amp;#114;ence.&lt;/p&gt;&lt;br /&gt;          &lt;p class="docText"&gt;T&amp;#104;e existence of i&amp;#109;mediate values should &amp;#98;e considered an&lt;br /&gt;        implementati&amp;#111;n detail. The only practical differenc&amp;#101; between immediate&lt;br /&gt;        values and referenc&amp;#101; values is that immediate values cannot have&lt;br /&gt;        singleton m&amp;#101;th&amp;#111;ds &amp;#100;e&amp;#102;ine&amp;#100; on them. (Singleto&amp;#110; methods&lt;br /&gt;        are explained i&amp;#110; Section 6.1.4.)&lt;/p&gt;&lt;br /&gt;        &lt;br /&gt;      &lt;br /&gt;      &lt;br /&gt;        &lt;h4 id="title-ID0EVCNM" class="docSection2Title"&gt;3.8.2. Object Lifetime&lt;/h4&gt;&lt;br /&gt;        &lt;p class="docText"&gt;T&amp;#104;e buil&amp;#116;-in Ruby classes desc&amp;#114;ibed in t&amp;#104;is chapter have literal&lt;br /&gt;      syn&amp;#116;axes, and instances of these class&amp;#101;s are created simply by including&lt;br /&gt;      &amp;#116;heir values literally in your code. Objects of other classes nee&amp;#100; t&amp;#111; be&lt;br /&gt;      &amp;#101;xp&amp;#108;icitly cre&amp;#97;ted, and this is most often done &amp;#119;ith a method named &lt;tt&gt;new&lt;/tt&gt;:&lt;/p&gt;&lt;br /&gt;        &lt;pre&gt;myObject = myClass.new&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        &lt;p class="docText"&gt;&lt;tt&gt;new&lt;/tt&gt; is a method of the &lt;tt&gt;Class&lt;/tt&gt;&lt;br /&gt;      class. It allo&amp;#99;ates memory &amp;#116;o hold th&amp;#101; new object, then &amp;#105;t initializes&lt;br /&gt;      the &amp;#115;tate of that newly allocated &amp;quot;emp&amp;#116;y&amp;quot; object by invoking its&lt;br /&gt;      &lt;tt&gt;initialize&lt;/tt&gt; meth&amp;#111;d. The arguments to &lt;tt&gt;new&lt;/tt&gt; are passed&lt;br /&gt;      directly &amp;#111;n to &lt;tt&gt;initialize&lt;/tt&gt;. Most classes defi&amp;#110;e &amp;#97;n&lt;br /&gt;      &lt;tt&gt;initial&amp;#105;ze&lt;/tt&gt; meth&amp;#111;d t&amp;#111; perform whatever initi&amp;#97;lization&lt;br /&gt;      is necessary for instances.&lt;/p&gt;&lt;br /&gt;        &lt;p class="docText"&gt;The &lt;tt&gt;new&lt;/tt&gt; a&amp;#110;d &lt;tt&gt;&amp;#105;nitial&amp;#105;ze&lt;/tt&gt;&lt;br /&gt;      methods &amp;#112;rovide the d&amp;#101;fault technique for creat&amp;#105;ng new classes, but&lt;br /&gt;      classes may also define other meth&amp;#111;ds, known as &amp;quot;factory methods,&amp;quot; that&lt;br /&gt;      return instances. We'll &amp;#108;earn more about &lt;tt&gt;new&lt;/tt&gt;,&lt;br /&gt;      &lt;tt&gt;initialize&lt;/tt&gt;, and factory methods in Section 7.4.&lt;/p&gt;&lt;br /&gt;        &lt;p class="docText"&gt;Ru&amp;#98;y objects n&amp;#101;ve&amp;#114; need t&amp;#111; be &amp;#101;xplicitly deallocated, as they do&lt;br /&gt;      in &amp;#108;anguages like C and C++. Ruby uses a technique called&lt;br /&gt;      &lt;span class="docEmphasis"&gt;garbag&amp;#101; co&amp;#108;lection&lt;/span&gt; to &amp;#97;utomatically destr&amp;#111;y objects that &amp;#97;re no longer needed.&lt;br /&gt;      A&amp;#110; object becomes a candidate for garba&amp;#103;e collection when it is&lt;br /&gt;      &lt;span class="docEmphasis"&gt;unreachable&lt;/span&gt;&amp;#8212;when there ar&amp;#101; no remaining references to the object&lt;br /&gt;      exc&amp;#101;pt &amp;#102;rom &amp;#111;th&amp;#101;r u&amp;#110;reachable objects.&lt;/p&gt;&lt;br /&gt;        &lt;p class="docText"&gt;The f&amp;#97;ct that Ruby uses garbage collection means that Ruby&lt;br /&gt;      programs &amp;#97;re less su&amp;#115;ceptib&amp;#108;e to memory leaks than p&amp;#114;ograms writte&amp;#110; in&lt;br /&gt;      languages that req&amp;#117;ire objects and memory to be explicitly d&amp;#101;allocated&lt;br /&gt;      and freed. But garbage collection d&amp;#111;es not mean that memory leaks are&lt;br /&gt;      imposs&amp;#105;ble: any &amp;#99;ode that cre&amp;#97;tes long-l&amp;#105;ved ref&amp;#101;rences to ob&amp;#106;ects that&lt;br /&gt;      would otherwise be short-lived can be a s&amp;#111;ur&amp;#99;e of memory l&amp;#101;aks. Consid&amp;#101;r&lt;br /&gt;      a hash us&amp;#101;d as a cache. If the cache is not p&amp;#114;uned using some kind of&lt;br /&gt;      l&amp;#101;ast-recently-used algorithm,&lt;br /&gt;      then c&amp;#97;ched objects will remain reachable as long as the hash itsel&amp;#102; is&lt;br /&gt;      r&amp;#101;ac&amp;#104;able. I&amp;#102; the &amp;#104;ash is referenced t&amp;#104;rough a global variable, then it&lt;br /&gt;      will be reachable as long a&amp;#115; the Rub&amp;#121; in&amp;#116;erpreter is run&amp;#110;ing.&lt;/p&gt;&lt;br /&gt;      &lt;br /&gt;      &lt;br /&gt;        &lt;h4 id="title-ID0E1FNM" class="docSection2Title"&gt;3.8.3. Object Identity&lt;/h4&gt;&lt;br /&gt;        &lt;p class="docText"&gt;&amp;#69;very object has an object identifier, a &lt;tt&gt;F&amp;#105;xnum&lt;/tt&gt;, that you can obtain with the &lt;tt&gt;object_id&lt;/tt&gt;&lt;br /&gt;      method. T&amp;#104;e value returned by this method is consta&amp;#110;t and unique for the&lt;br /&gt;      lifetime of the object. Whil&amp;#101; th&amp;#101; ob&amp;#106;ect is ac&amp;#99;essible, it w&amp;#105;ll always&lt;br /&gt;      have the same ID, &amp;#97;nd no other object will share that ID.&lt;/p&gt;&lt;br /&gt;        &lt;p class="docText"&gt;The method &lt;tt&gt;id&lt;/tt&gt; is a &amp;#100;e&amp;#112;rec&amp;#97;ted synonym f&amp;#111;r &lt;tt&gt;object_id&lt;/tt&gt;. Rub&amp;#121; 1.8&lt;br /&gt;      issues a warning if you &amp;#117;se it, and it has been removed in R&amp;#117;by&lt;br /&gt;      1.9.&lt;/p&gt;&lt;br /&gt;        &lt;p class="docText"&gt;&lt;tt&gt;__id__&lt;/tt&gt; is a valid synonym for&lt;br /&gt;      &lt;tt&gt;object_id&lt;/tt&gt;. It exi&amp;#115;ts as a fallback, so you can access&lt;br /&gt;      an object's ID even &amp;#105;f the &lt;tt&gt;ob&amp;#106;ect_id&lt;/tt&gt; me&amp;#116;hod has b&amp;#101;en&lt;br /&gt;      &amp;#117;ndefined or overridden.&lt;/p&gt;&lt;br /&gt;        &lt;p class="docText"&gt;The &lt;tt&gt;Obje&amp;#99;t&lt;/tt&gt; class implements the&lt;br /&gt;      &lt;tt&gt;hash&lt;/tt&gt; method t&amp;#111; si&amp;#109;ply return a&amp;#110; object's ID.&lt;/p&gt;&lt;br /&gt;      &lt;br /&gt;      &lt;br /&gt;        &lt;h4 id="title-ID0EDINM" class="docSection2Title"&gt;3.8.4. Object Class and Object Type&lt;/h4&gt;&lt;br /&gt;        &lt;p class="docText"&gt;Th&amp;#101;re are severa&amp;#108; ways to determine the class of an ob&amp;#106;ect in Ruby. The simplest is&lt;br /&gt;      simply to &amp;#97;sk for it:&lt;/p&gt;&lt;br /&gt;        &lt;pre&gt;o = "test"  # This is a value&lt;br /&gt;o.class     # Returns an object representing the String class&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        &lt;p class="docText"&gt;If you are interested in the class hierar&amp;#99;hy of an object, you can&lt;br /&gt;      ask any class what its superclass is:&lt;/p&gt;&lt;br /&gt;        &lt;pre&gt;o.class                       # String: o is a String object&lt;br /&gt;o.class.superclass            # Object: superclass of String is Object&lt;br /&gt;o.class.superclass.superclass # nil: Object has no superclass&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        &lt;p class="docText"&gt;In Ruby 1.9, &lt;tt&gt;Object&lt;/tt&gt; is &amp;#110;o &amp;#108;onger the t&amp;#114;ue roo&amp;#116;&lt;br /&gt;      of the cl&amp;#97;ss hierarchy:&lt;/p&gt;&lt;br /&gt;        &lt;pre&gt;# Ruby 1.9 only&lt;br /&gt;Object.superclass             # BasicObject: Object has a superclass in 1.9&lt;br /&gt;BasicObject.superclass        # nil: BasicObject has no superclass&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        &lt;p class="docText"&gt;See Section 7.3 for more on&lt;br /&gt;      &lt;tt&gt;BasicObje&amp;#99;t&lt;/tt&gt;.&lt;/p&gt;&lt;br /&gt;        &lt;p class="docText"&gt;So a particularly straightforward way to check the cl&amp;#97;ss of an&lt;br /&gt;      ob&amp;#106;ect is by &amp;#100;irect co&amp;#109;parison:&lt;/p&gt;&lt;br /&gt;        &lt;pre&gt;o.class == String       # true if is o a String&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        &lt;p class="docText"&gt;The &lt;tt&gt;instanc&amp;#101;_of?&lt;/tt&gt; method does the same thing and &amp;#105;s a little more elegant:&lt;/p&gt;&lt;br /&gt;        &lt;pre&gt;o.instance_of? String   # true if o is a String&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        &lt;p class="docText"&gt;Usually when w&amp;#101; test the class of an object, we would also like to&lt;br /&gt;      know i&amp;#102; the object is an instance of any subclas&amp;#115; of that &amp;#99;lass. To test&lt;br /&gt;      &amp;#116;his, use t&amp;#104;e &lt;tt&gt;is_a?&lt;/tt&gt; m&amp;#101;thod, or its syno&amp;#110;ym &lt;tt&gt;kind_of?&lt;/tt&gt;:&lt;/p&gt;&lt;br /&gt;        &lt;pre&gt;x = 1                    # This is the value we're working with&lt;br /&gt;x.instance_of? Fixnum    # true: is an instance of Fixnum&lt;br /&gt;x.instance_of? Numeric   # false: instance_of? doesn't check inheritance&lt;br /&gt;x.is_a? Fixnum           # true: x is a Fixnum&lt;br /&gt;x.is_a? Integer          # true: x is an Integer&lt;br /&gt;x.is_a? Numeric          # true: x is a Numeric&lt;br /&gt;x.is_a? Comparable       # true: works with mixin modules, too&lt;br /&gt;x.is_a? Object           # true for any value of x&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        &lt;p class="docText"&gt;The &lt;tt&gt;Class&lt;/tt&gt; class defines the &lt;tt&gt;===&lt;/tt&gt; ope&amp;#114;ator i&amp;#110; s&amp;#117;ch a way that it&lt;br /&gt;      can be &amp;#117;sed in place of &lt;tt&gt;is_a?&lt;/tt&gt;:&lt;/p&gt;&lt;br /&gt;        &lt;pre&gt;Numeric === x            # true: x is_a Numeric &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        &lt;p class="docText"&gt;This &amp;#105;diom is unique to Ruby and is probabl&amp;#121; less readable than&lt;br /&gt;      using the more t&amp;#114;aditional&lt;br /&gt;      &lt;tt&gt;is_a?&lt;/tt&gt; method.&lt;/p&gt;&lt;br /&gt;        &lt;p class="docText"&gt;Every object has a well-defined c&amp;#108;ass in Ruby, and that class&lt;br /&gt;      never changes during the li&amp;#102;eti&amp;#109;e of the obje&amp;#99;t. An object's&lt;br /&gt;      &lt;span class="docEmphasis"&gt;&amp;#116;ype&lt;/span&gt;, on th&amp;#101; other hand, is more fl&amp;#117;id. The type of&lt;br /&gt;      an object is related to it&amp;#115; class, b&amp;#117;t the clas&amp;#115; is only part &amp;#111;f an&lt;br /&gt;      o&amp;#98;ject's type. When we talk about the type of an &amp;#111;bject, we mean the set&lt;br /&gt;      of behaviors tha&amp;#116; characterize the object. Another way &amp;#116;o put it is that&lt;br /&gt;      the type of an object is the set of m&amp;#101;th&amp;#111;ds &amp;#105;t can re&amp;#115;pond to. (&amp;#84;his&lt;br /&gt;      definition becomes recursiv&amp;#101; because it is not just the name of the&lt;br /&gt;      methods &amp;#116;hat matt&amp;#101;r, b&amp;#117;t also the types of a&amp;#114;guments that th&amp;#111;se methods&lt;br /&gt;      can accept.)&lt;/p&gt;&lt;br /&gt;        &lt;p class="docText"&gt;In Ruby prog&amp;#114;amming, we often don't care about the clas&amp;#115; of an&lt;br /&gt;      object, we just want to know whether &amp;#119;e can invoke some method on it.&lt;br /&gt;      Consider, for example, the &lt;tt&gt;&amp;lt;&amp;lt;&lt;/tt&gt; opera&amp;#116;or. Array&amp;#115;,&lt;br /&gt;      string&amp;#115;, files, a&amp;#110;d &amp;#111;ther I/O-related classes def&amp;#105;ne this as an append&lt;br /&gt;      operator. If we are writ&amp;#105;ng a met&amp;#104;od tha&amp;#116; produces textua&amp;#108; output, we&lt;br /&gt;      might wri&amp;#116;e it generically to use this op&amp;#101;rator. Then our method can be&lt;br /&gt;      invoked w&amp;#105;th any argument that implements &lt;tt&gt;&amp;lt;&amp;lt;&lt;/tt&gt;.&lt;br /&gt;      We don't care about th&amp;#101; class of the argument, just that we can append&lt;br /&gt;      to it. We ca&amp;#110; t&amp;#101;st &amp;#102;or t&amp;#104;is wit&amp;#104; the &lt;tt&gt;respond_to?&lt;/tt&gt;&lt;br /&gt;      method:&lt;/p&gt;&lt;br /&gt;        &lt;pre&gt;o.respond_to? :"&amp;lt;&amp;lt;"  # true if o has an &amp;lt;&amp;lt; operator&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        &lt;p class="docText"&gt;The short&amp;#99;oming of this approach is that it only check&amp;#115; the nam&amp;#101;&lt;br /&gt;      of &amp;#97; method, not the argu&amp;#109;ents for that method. F&amp;#111;r example,&lt;br /&gt;      &lt;tt&gt;Fixnum&lt;/tt&gt; and &lt;tt&gt;&amp;#66;ignum&lt;/tt&gt; implement&lt;br /&gt;      &lt;tt&gt;&amp;lt;&amp;lt;&lt;/tt&gt; as a left-shift oper&amp;#97;tor and expect the&lt;br /&gt;      argument to be a number instead &amp;#111;f a string. Integer objects appear to&lt;br /&gt;      be &amp;quot;appe&amp;#110;d&amp;#97;ble&amp;quot; when w&amp;#101; us&amp;#101; a &lt;tt&gt;r&amp;#101;spond_to?&lt;/tt&gt; test,&lt;br /&gt;      but they pro&amp;#100;uce an error when our code appends a strin&amp;#103;.&lt;br /&gt;      Ther&amp;#101; is &amp;#110;o gener&amp;#97;l solution t&amp;#111; this problem, but an ad-hoc &amp;#114;emedy, in&lt;br /&gt;      this case, is to explicitly rul&amp;#101; out &lt;tt&gt;Numeric&lt;/tt&gt; objects&lt;br /&gt;      with the &lt;tt&gt;is_&amp;#97;?&lt;/tt&gt; method:&lt;/p&gt;&lt;br /&gt;        &lt;pre&gt;o.respond_to? :"&amp;lt;&amp;lt;" and not o.is_a? Numeric &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        &lt;p class="docText"&gt;Another example of the type-versus-cl&amp;#97;ss distin&amp;#99;tion is&lt;br /&gt;      the &lt;tt&gt;S&amp;#116;ringIO&lt;/tt&gt; c&amp;#108;ass (from Ru&amp;#98;y's standard&lt;br /&gt;      library). &lt;tt&gt;StringIO&lt;/tt&gt; e&amp;#110;ables reading from and writing&lt;br /&gt;      to string ob&amp;#106;ects as i&amp;#102; the&amp;#121; were &lt;tt&gt;IO&lt;/tt&gt; ob&amp;#106;ects.&lt;br /&gt;      &lt;tt&gt;StringIO&lt;/tt&gt; mi&amp;#109;ics the &lt;tt&gt;IO&lt;/tt&gt;&lt;br /&gt;      API&amp;#8212;&lt;tt&gt;StringIO&lt;/tt&gt; obj&amp;#101;cts define the same methods &amp;#116;hat&lt;br /&gt;      &lt;tt&gt;IO&lt;/tt&gt; objects do. But &lt;tt&gt;StringIO&lt;/tt&gt; is not&lt;br /&gt;      a subclass of &lt;tt&gt;IO&lt;/tt&gt;. If you &amp;#119;rite a method that expects&lt;br /&gt;      a stream argument, and t&amp;#101;st &amp;#116;he class &amp;#111;f t&amp;#104;e argu&amp;#109;ent with&lt;br /&gt;      &lt;tt&gt;is_a? IO&lt;/tt&gt;, then your &amp;#109;ethod won't work with&lt;br /&gt;      &lt;tt&gt;StringIO&lt;/tt&gt; arguments.&lt;/p&gt;&lt;br /&gt;        &lt;p class="docText"&gt;Focusing on t&amp;#121;pe&amp;#115; rather &amp;#116;han classes lead&amp;#115; to a programm&amp;#105;ng style&lt;br /&gt;      known in Ruby a&amp;#115; &amp;quot;duck typing.&amp;quot; We'll see duck typing examples in Chapter 7.&lt;/p&gt;&lt;br /&gt;      &lt;br /&gt;      &lt;br /&gt;        &lt;h4 id="title-ID0EIPNM" class="docSection2Title"&gt;3.8.5. Object Equality&lt;/h4&gt;&lt;br /&gt;        &lt;p class="docText"&gt;Ruby &amp;#104;as a surprising number of ways to co&amp;#109;pare objects for&lt;br /&gt;      equality, and it is important to&lt;br /&gt;      understand &amp;#104;ow the&amp;#121; wo&amp;#114;k, so yo&amp;#117; know when &amp;#116;o use each method.&lt;/p&gt;&lt;br /&gt;        &lt;br /&gt;          &lt;h5 id="title-ID0E2PNM" class="docSection3Title"&gt;3.8.5.1. The equal? method&lt;/h5&gt;&lt;br /&gt;          &lt;p class="docText"&gt;The &lt;tt&gt;equa&amp;#108;?&lt;/tt&gt; method is defined by &lt;tt&gt;Object&lt;/tt&gt; to te&amp;#115;t wheth&amp;#101;r t&amp;#119;o values&lt;br /&gt;        refer t&amp;#111; exactly the s&amp;#97;me object. For any two di&amp;#115;tinct objects, this&lt;br /&gt;        method always returns &lt;tt&gt;false&lt;/tt&gt;:&lt;/p&gt;&lt;br /&gt;          &lt;pre&gt;a = "Ruby"       # One reference to one String object&lt;br /&gt;b = c = "Ruby"   # Two references to another String object&lt;br /&gt;a.equal?(b)      # false: a and b are different objects&lt;br /&gt;b.equal?(c)      # true: b and c refer to the same object&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          &lt;p class="docText"&gt;B&amp;#121; convention, subclasses never overr&amp;#105;de the&lt;br /&gt;        &lt;tt&gt;equal?&lt;/tt&gt; method.&lt;/p&gt;&lt;br /&gt;          &lt;p class="docText"&gt;Another way to de&amp;#116;ermine i&amp;#102; two &amp;#111;bj&amp;#101;ct&amp;#115; are, in fact, the same&lt;br /&gt;        object is to &amp;#99;heck their &lt;tt&gt;object_id&lt;/tt&gt;:&lt;/p&gt;&lt;br /&gt;          &lt;pre&gt;a.object_id == b.object_id   # Works like a.equal?(b)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        &lt;br /&gt;        &lt;br /&gt;          &lt;h5 id="title-ID0EHRNM" class="docSection3Title"&gt;3.8.5.2. The == operator&lt;/h5&gt;&lt;br /&gt;          &lt;p class="docText"&gt;The &lt;tt&gt;==&lt;/tt&gt; operator is the most common w&amp;#97;y to test f&amp;#111;r e&amp;#113;uality. In the&lt;br /&gt;        &lt;tt&gt;O&amp;#98;ject&lt;/tt&gt; class, it is sim&amp;#112;ly a synonym for&lt;br /&gt;        &lt;tt&gt;equal?&lt;/tt&gt;, a&amp;#110;d it tests whether two object referenc&amp;#101;s&lt;br /&gt;        are identical. Most classes redefine &amp;#116;his operator to allow distinct&lt;br /&gt;        instances to be &amp;#116;ested fo&amp;#114; equal&amp;#105;ty:&lt;/p&gt;&lt;br /&gt;          &lt;pre&gt;a = "Ruby"    # One String object&lt;br /&gt;b = "Ruby"    # A different String object with the same content&lt;br /&gt;a.equal?(b)   # false: a and b do not refer to the same object&lt;br /&gt;a == b        # true: but these two distinct objects have equal values&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          &lt;p class="docText"&gt;Note &amp;#116;hat the s&amp;#105;ngle equals sign in this cod&amp;#101; is the assignment&lt;br /&gt;        operator. I&amp;#116; takes tw&amp;#111; eq&amp;#117;als signs to test fo&amp;#114; equality in Ru&amp;#98;y (this&lt;br /&gt;        is a convention that &amp;#82;uby shares with many other p&amp;#114;ogramming&lt;br /&gt;        languages).&lt;/p&gt;&lt;br /&gt;          &lt;p class="docText"&gt;Most standard R&amp;#117;by classes define the &lt;tt&gt;==&lt;/tt&gt;&lt;br /&gt;        operator to implement a reasonable de&amp;#102;ini&amp;#116;ion of eq&amp;#117;ality. Thi&amp;#115;&lt;br /&gt;        includ&amp;#101;s the &lt;tt&gt;Array&lt;/tt&gt; and &lt;tt&gt;H&amp;#97;sh&lt;/tt&gt;&lt;br /&gt;        classes. Two arrays are equal according to &lt;tt&gt;==&lt;/tt&gt; if&lt;br /&gt;        they &amp;#104;ave th&amp;#101; sa&amp;#109;e number of elements, and &amp;#105;f their correspondi&amp;#110;g&lt;br /&gt;        elements are all equ&amp;#97;l according to &lt;tt&gt;==&lt;/tt&gt;. Two hashes&lt;br /&gt;        are &lt;tt&gt;==&lt;/tt&gt; if they c&amp;#111;ntain the same number of key/value&lt;br /&gt;        pairs, and i&amp;#102; the keys and values are themselves equal. (Values are&lt;br /&gt;        compared with the &lt;tt&gt;==&lt;/tt&gt; op&amp;#101;ra&amp;#116;or, but ha&amp;#115;h keys a&amp;#114;e&lt;br /&gt;        comp&amp;#97;red with the &lt;tt&gt;eql?&lt;/tt&gt; method, d&amp;#101;scribed later in&lt;br /&gt;        this chapter.)&lt;/p&gt;&lt;br /&gt;          &lt;p&gt;&lt;table cellspacing="0" width="90%" border="1" cellpadding="5"&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;            &lt;h2 class="docSidebarTitle"&gt;Equality for J&amp;#97;va Progra&amp;#109;mers&lt;/h2&gt;&lt;br /&gt;            &lt;p class="docText"&gt;If you a&amp;#114;e a Java programm&amp;#101;r, you a&amp;#114;e used to using the&lt;br /&gt;          &lt;tt&gt;==&lt;/tt&gt; operator to tes&amp;#116; if two objects are the same&lt;br /&gt;          object, and you are used t&amp;#111; using the &lt;tt&gt;equals&lt;/tt&gt;&lt;br /&gt;          method to test whether two disti&amp;#110;ct objects have the same value.&lt;br /&gt;          Ruby's convention is ju&amp;#115;t about &amp;#116;he oppos&amp;#105;te of Ja&amp;#118;a's.&lt;/p&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;          &lt;p class="docText"&gt;The &lt;tt&gt;Nume&amp;#114;ic&lt;/tt&gt; classes perform simple t&amp;#121;pe conversions in their&lt;br /&gt;        &lt;tt&gt;==&lt;/tt&gt; operators, so that (f&amp;#111;r e&amp;#120;a&amp;#109;ple) the&lt;br /&gt;        &lt;tt&gt;Fixnum&lt;/tt&gt; &lt;tt&gt;1&lt;/tt&gt; and the&lt;br /&gt;        &lt;tt&gt;F&amp;#108;oat&lt;/tt&gt; &lt;tt&gt;1.0&lt;/tt&gt; compare as &amp;#101;qual. The&lt;br /&gt;        &lt;tt&gt;==&lt;/tt&gt; operator of classes, suc&amp;#104; as&lt;br /&gt;        &lt;tt&gt;String&lt;/tt&gt; and &lt;tt&gt;Array&lt;/tt&gt;, normally&lt;br /&gt;        requir&amp;#101;s both operands to be of t&amp;#104;e same class. If the righthand&lt;br /&gt;        operand de&amp;#102;ine&amp;#115; a &lt;tt&gt;to_str&lt;/tt&gt; &amp;#111;r&lt;br /&gt;        &lt;tt&gt;t&amp;#111;_ar&amp;#121;&lt;/tt&gt; conversion func&amp;#116;ion (see Section 3.8.7), then these operators invoke the&lt;br /&gt;        &lt;tt&gt;==&lt;/tt&gt; operator defin&amp;#101;d b&amp;#121; th&amp;#101; rightha&amp;#110;d ope&amp;#114;and, and&lt;br /&gt;        let that obj&amp;#101;ct decide whether it is equal to the le&amp;#102;thand string or&lt;br /&gt;        array. Thus, it is possi&amp;#98;le (though not common) to define classes with&lt;br /&gt;        &amp;#115;tring-l&amp;#105;ke or ar&amp;#114;ay-lik&amp;#101; co&amp;#109;parison behavior.&lt;/p&gt;&lt;br /&gt;          &lt;p class="docText"&gt;&lt;tt&gt;!=&lt;/tt&gt; (&amp;quot;not-equal&amp;quot;) is used in &amp;#82;uby to test for inequality. When Ruby sees&lt;br /&gt;        &lt;tt&gt;!=&lt;/tt&gt;, it s&amp;#105;mply us&amp;#101;s t&amp;#104;e &lt;tt&gt;==&lt;/tt&gt;&lt;br /&gt;        operator and th&amp;#101;n inv&amp;#101;rts the result. This means that a c&amp;#108;ass only&lt;br /&gt;        needs to define the &lt;tt&gt;==&lt;/tt&gt; operator to def&amp;#105;ne its own&lt;br /&gt;        notion of equality. Ruby gives you the &lt;tt&gt;!=&lt;/tt&gt; opera&amp;#116;or&lt;br /&gt;        for free. In Ruby 1.9, however, classes can explici&amp;#116;ly defin&amp;#101; th&amp;#101;ir&lt;br /&gt;        &amp;#111;wn &lt;tt&gt;!=&lt;/tt&gt; &amp;#111;perators.&lt;/p&gt;&lt;br /&gt;        &lt;br /&gt;        &lt;br /&gt;          &lt;h5 id="title-ID0ECWNM" class="docSection3Title"&gt;3.8.5.3. The eql? method&lt;/h5&gt;&lt;br /&gt;          &lt;p class="docText"&gt;The &lt;tt&gt;eql?&lt;/tt&gt; method is def&amp;#105;ned by &lt;tt&gt;Object&lt;/tt&gt; as a synonym for&lt;br /&gt;        &lt;tt&gt;equal?&lt;/tt&gt;. Classes that &amp;#111;ve&amp;#114;ride i&amp;#116; typically use it&lt;br /&gt;        as a &amp;#115;trict vers&amp;#105;on of &lt;tt&gt;==&lt;/tt&gt; that does no type&lt;br /&gt;        conversion. F&amp;#111;r example:&lt;/p&gt;&lt;br /&gt;          &lt;pre&gt;1 == 1.0    # true: Fixnum and Float objects can be ==&lt;br /&gt;1.eql?(1.0) # false: but they are never eql!&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          &lt;p class="docText"&gt;The &lt;tt&gt;Hash&lt;/tt&gt; class uses &lt;tt&gt;eql?&lt;/tt&gt; to check wh&amp;#101;ther two hash&lt;br /&gt;        keys are equal. If two objects are &lt;tt&gt;eql?&lt;/tt&gt;, th&amp;#101;ir&lt;br /&gt;        &lt;tt&gt;hash&lt;/tt&gt; methods must also return the same value.&lt;br /&gt;        Typical&amp;#108;y, if you cre&amp;#97;te a class &amp;#97;nd define &amp;#116;he &lt;tt&gt;==&lt;/tt&gt;&lt;br /&gt;        opera&amp;#116;or, you can simply write a &lt;tt&gt;has&amp;#104;&lt;/tt&gt; method and&lt;br /&gt;        define &lt;tt&gt;eql?&lt;/tt&gt; &amp;#116;o use &lt;tt&gt;==&lt;/tt&gt;.&lt;/p&gt;&lt;br /&gt;        &lt;br /&gt;        &lt;br /&gt;          &lt;h5 id="title-ID0ECYNM" class="docSection3Title"&gt;3.8.5.4. The === operator&lt;/h5&gt;&lt;br /&gt;          &lt;p class="docText"&gt;The &lt;tt&gt;===&lt;/tt&gt; &amp;#111;pe&amp;#114;ator is common&amp;#108;y called the &amp;quot;ca&amp;#115;e equality&amp;quot; operator and is&lt;br /&gt;        used to tes&amp;#116; whether the target value of a &lt;tt&gt;case&lt;/tt&gt;&lt;br /&gt;        stateme&amp;#110;t matches any of the &lt;tt&gt;when&lt;/tt&gt; clauses of that&lt;br /&gt;        sta&amp;#116;ement. (The &lt;tt&gt;case&lt;/tt&gt; statement is a multiway branch&lt;br /&gt;        and is &amp;#101;xp&amp;#108;ained in Chapter 5.)&lt;/p&gt;&lt;br /&gt;          &lt;p class="docText"&gt;&lt;tt&gt;Ob&amp;#106;ect&lt;/tt&gt; defi&amp;#110;e&amp;#115; a default&lt;br /&gt;        &lt;tt&gt;===&lt;/tt&gt; operator so that it invokes &amp;#116;he&lt;br /&gt;        &lt;tt&gt;==&lt;/tt&gt; operator. For many classes, therefore, case&lt;br /&gt;        &amp;#101;qu&amp;#97;lity is th&amp;#101; same as &lt;tt&gt;==&lt;/tt&gt; equalit&amp;#121;. But certain&lt;br /&gt;        &amp;#107;ey classes define &lt;tt&gt;===&lt;/tt&gt; differ&amp;#101;ntly, and in these&lt;br /&gt;        cases it is more of &amp;#97; membership or matching operator.&lt;br /&gt;        &lt;tt&gt;Range&lt;/tt&gt; defines &lt;tt&gt;===&lt;/tt&gt; t&amp;#111; test&lt;br /&gt;        whether a value falls within the range. &lt;tt&gt;Re&amp;#103;exp&lt;/tt&gt;&lt;br /&gt;        d&amp;#101;fi&amp;#110;e&amp;#115; &lt;tt&gt;===&lt;/tt&gt; to test &amp;#119;hether a string matches the&lt;br /&gt;        regula&amp;#114; expression. And &lt;tt&gt;Class&lt;/tt&gt; defines&lt;br /&gt;        &lt;tt&gt;===&lt;/tt&gt; to test whether an ob&amp;#106;ect is an &amp;#105;nstanc&amp;#101; of&lt;br /&gt;        that clas&amp;#115;. In Ruby 1.9, &lt;tt&gt;Symbo&amp;#108;&lt;/tt&gt; defines&lt;br /&gt;        &lt;tt&gt;===&lt;/tt&gt; to return &lt;tt&gt;true&lt;/tt&gt; if the&lt;br /&gt;        ri&amp;#103;hthand operand is the same s&amp;#121;mbol as the left or if it is a string&lt;br /&gt;        hold&amp;#105;ng the same text. Examples:&lt;/p&gt;&lt;br /&gt;          &lt;pre&gt;(1..10) === 5    # true: 5 is in the range 1..10&lt;br /&gt;/\d+/ === "123"  # true: the string matches the regular expression&lt;br /&gt;String === "s"   # true: "s" is an instance of the class String&lt;br /&gt;:s === "s"       # true in Ruby 1.9&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          &lt;p class="docText"&gt;It is uncommon to see th&amp;#101; &lt;tt&gt;===&lt;/tt&gt; op&amp;#101;ra&amp;#116;or used&lt;br /&gt;        e&amp;#120;p&amp;#108;icitly like this. More comm&amp;#111;nly, its use is simply implicit in a&lt;br /&gt;        &lt;tt&gt;ca&amp;#115;e&lt;/tt&gt; state&amp;#109;ent.&lt;/p&gt;&lt;br /&gt;        &lt;br /&gt;        &lt;br /&gt;          &lt;h5 id="title-ID0EC2NM" class="docSection3Title"&gt;3.8.5.5. The =~ operator&lt;/h5&gt;&lt;br /&gt;          &lt;p class="docText"&gt;The &lt;tt&gt;=~&lt;/tt&gt; oper&amp;#97;tor is defined by &lt;tt&gt;S&amp;#116;ring&lt;/tt&gt; and&lt;br /&gt;        &lt;tt&gt;Rege&amp;#120;p&lt;/tt&gt; (and &lt;tt&gt;Symbol&lt;/tt&gt; in Ruby 1.9)&lt;br /&gt;        to pe&amp;#114;form pattern matching, and it isn't really an&lt;br /&gt;        equali&amp;#116;y operator at all. But it does have an equ&amp;#97;ls sign in it, so it&lt;br /&gt;        is listed here for completene&amp;#115;s. &lt;tt&gt;Objec&amp;#116;&lt;/tt&gt; defines &amp;#97;&lt;br /&gt;        no-op vers&amp;#105;on of &lt;tt&gt;=~&lt;/tt&gt; th&amp;#97;t always returns&lt;br /&gt;        &lt;tt&gt;false&lt;/tt&gt;. You ca&amp;#110; define this operator in your own&lt;br /&gt;        cl&amp;#97;ss, if that &amp;#99;lass define&amp;#115; some kind &amp;#111;f pattern-mat&amp;#99;hing operation&lt;br /&gt;        or has a notion o&amp;#102; approximate equality, for example.&lt;br /&gt;        &lt;tt&gt;!~&lt;/tt&gt; is defin&amp;#101;d as the inverse of&lt;br /&gt;        &lt;tt&gt;=~&lt;/tt&gt;. It is defi&amp;#110;able in Ruby 1.9 but not in Ruby&lt;br /&gt;        1.8.&lt;/p&gt;&lt;br /&gt;        &lt;br /&gt;      &lt;br /&gt;      &lt;br /&gt;        &lt;h4 id="title-ID0EY3NM" class="docSection2Title"&gt;3.8.6. Object Order&lt;/h4&gt;&lt;br /&gt;        &lt;p class="docText"&gt;Practically every class can define a use&amp;#102;ul&lt;br /&gt;      &lt;tt&gt;==&lt;/tt&gt; m&amp;#101;th&amp;#111;d f&amp;#111;r t&amp;#101;sting its instances fo&amp;#114; equality.&lt;br /&gt;      Some classes can also define an orderin&amp;#103;. That &amp;#105;s: for an&amp;#121; two in&amp;#115;tances&lt;br /&gt;      of s&amp;#117;ch a class, the two instances must be equal, &amp;#111;r one instance must&lt;br /&gt;      be &amp;quot;les&amp;#115; than&amp;quot; the other. Numbers are the most obvious classes for w&amp;#104;ich&lt;br /&gt;      such an ordering is defined. Strings are al&amp;#115;o order&amp;#101;d, a&amp;#99;cording to t&amp;#104;e&lt;br /&gt;      nume&amp;#114;ic ordering of t&amp;#104;e character codes that comprise the strings. (With&lt;br /&gt;      the A&amp;#83;CII t&amp;#101;xt, &amp;#116;his is a roug&amp;#104; kind of cas&amp;#101;-sensitive alphab&amp;#101;tical&lt;br /&gt;      order.) If a class defines an ordering, th&amp;#101;n instances of the class can&lt;br /&gt;      be compared a&amp;#110;d sorted.&lt;/p&gt;&lt;br /&gt;        &lt;p class="docText"&gt;In Ruby, classes define an ordering by im&amp;#112;lem&amp;#101;nt&amp;#105;ng the &lt;tt&gt;&amp;lt;=&amp;gt;&lt;/tt&gt; o&amp;#112;era&amp;#116;or. This operator&lt;br /&gt;      should r&amp;#101;turn &lt;tt&gt;&amp;#8211;1&lt;/tt&gt; if its left operand is less t&amp;#104;an its&lt;br /&gt;      &amp;#114;ight o&amp;#112;erand, &lt;tt&gt;0&lt;/tt&gt; &amp;#105;f the two op&amp;#101;rands are equal, and&lt;br /&gt;      &lt;tt&gt;1&lt;/tt&gt; if th&amp;#101; left operand is great&amp;#101;r than the right&lt;br /&gt;      operand. If the &amp;#116;wo operands cannot be meaningfully compared (if the&lt;br /&gt;      righ&amp;#116; operand &amp;#105;s of a di&amp;#102;fer&amp;#101;nt &amp;#99;lass, for example), then the operator s&amp;#104;ould return&lt;br /&gt;      &lt;tt&gt;nil&lt;/tt&gt;:&lt;/p&gt;&lt;br /&gt;        &lt;pre&gt;1 &amp;lt;=&amp;gt; 5     # -1&lt;br /&gt;5 &amp;lt;=&amp;gt; 5     # 0&lt;br /&gt;9 &amp;lt;=&amp;gt; 5     # 1&lt;br /&gt;"1" &amp;lt;=&amp;gt; 5   # nil: integers and strings are not comparable&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        &lt;p class="docText"&gt;The &lt;tt&gt;&amp;lt;=&amp;gt;&lt;/tt&gt; operator is all that is ne&amp;#101;de&amp;#100; t&amp;#111;&lt;br /&gt;      compare values. &amp;#66;ut it isn't particu&amp;#108;arly intuitive. So classes that&lt;br /&gt;      de&amp;#102;ine this operator typically also inc&amp;#108;ude the&lt;br /&gt;      &lt;tt&gt;Comparable&lt;/tt&gt; module as a mixin. (Modules and m&amp;#105;xins are covered in Section 7.5.2.) The &lt;tt&gt;Comparable&lt;/tt&gt; mixin d&amp;#101;fi&amp;#110;e&amp;#115;&lt;br /&gt;      the fol&amp;#108;owing oper&amp;#97;tors in terms of &lt;tt&gt;&amp;lt;=&amp;gt;&lt;/tt&gt;:&lt;/p&gt;&lt;br /&gt;        &lt;p&gt;&lt;table cellspacing="0" border="1" width="100%"&gt;&lt;colgroup span="2"&gt;&lt;/colgroup&gt;&lt;thead&gt;&lt;/thead&gt;&lt;tr&gt;&lt;td class="docTableCell"&gt;&lt;br /&gt;                  &lt;tt&gt;&amp;lt;&lt;/tt&gt;&lt;br /&gt;                &lt;/td&gt;&lt;td class="docTableCell"&gt;Less than&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="docTableCell"&gt;&lt;br /&gt;                  &lt;tt&gt;&amp;lt;=&lt;/tt&gt;&lt;br /&gt;                &lt;/td&gt;&lt;td class="docTableCell"&gt;Less &amp;#116;han or equal&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="docTableCell"&gt;&lt;br /&gt;                  &lt;tt&gt;==&lt;/tt&gt;&lt;br /&gt;                &lt;/td&gt;&lt;td class="docTableCell"&gt;Equal&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="docTableCell"&gt;&lt;br /&gt;                  &lt;tt&gt;&amp;gt;=&lt;/tt&gt;&lt;br /&gt;                &lt;/td&gt;&lt;td class="docTableCell"&gt;Greater than or equal&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="docTableCell"&gt;&lt;br /&gt;                  &lt;tt&gt;&amp;gt;&lt;/tt&gt;&lt;br /&gt;                &lt;/td&gt;&lt;td class="docTableCell"&gt;Greater than&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;        &lt;p class="docText"&gt;&lt;tt&gt;C&amp;#111;mp&amp;#97;rable&lt;/tt&gt; doe&amp;#115; not define the&lt;br /&gt;      &lt;tt&gt;!=&lt;/tt&gt; o&amp;#112;erator; Ruby a&amp;#117;tomatically defines that operator as the &amp;#110;egation&lt;br /&gt;      of the &lt;tt&gt;==&lt;/tt&gt; ope&amp;#114;ator. In addition to these compari&amp;#115;on&lt;br /&gt;      operators, &lt;tt&gt;Comparable&lt;/tt&gt; also&lt;br /&gt;      defines a useful compariso&amp;#110; m&amp;#101;th&amp;#111;d n&amp;#97;med&lt;br /&gt;      &lt;tt&gt;betwe&amp;#101;n?&lt;/tt&gt;:&lt;/p&gt;&lt;br /&gt;        &lt;pre&gt;1.between?(0,10)  # true: 0 &amp;lt;= 1 &amp;lt;= 10&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        &lt;p class="docText"&gt;If the &lt;tt&gt;&amp;lt;=&amp;gt;&lt;/tt&gt; operator r&amp;#101;turns&lt;br /&gt;      &lt;tt&gt;nil&lt;/tt&gt;, all the comparison operators deri&amp;#118;ed from it r&amp;#101;tu&amp;#114;n&lt;br /&gt;      &lt;tt&gt;false&lt;/tt&gt;. Th&amp;#101; speci&amp;#97;l &lt;tt&gt;Float&lt;/tt&gt; value&lt;br /&gt;      &lt;tt&gt;NaN&lt;/tt&gt; is an example:&lt;/p&gt;&lt;br /&gt;        &lt;pre&gt;nan = 0.0/0.0;     # zero divided by zero is not-a-number&lt;br /&gt;nan &amp;lt; 0            # false: it is not less than zero&lt;br /&gt;nan &amp;gt; 0            # false: it is not greater than zero&lt;br /&gt;nan == 0           # false: it is not equal to zero&lt;br /&gt;nan == nan         # false: it is not even equal to itself!&lt;br /&gt;nan.equal?(nan)    # this is true, of course&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        &lt;p class="docText"&gt;Note tha&amp;#116; defining &lt;tt&gt;&amp;lt;=&amp;gt;&lt;/tt&gt; and including the&lt;br /&gt;      &lt;tt&gt;Comp&amp;#97;rable&lt;/tt&gt; module defines a &lt;tt&gt;==&lt;/tt&gt;&lt;br /&gt;      operator for your class. Some classes de&amp;#102;ine their own&lt;br /&gt;      &lt;tt&gt;==&lt;/tt&gt; operator, typically when they c&amp;#97;n impleme&amp;#110;t &amp;#116;his&lt;br /&gt;      more &amp;#101;ff&amp;#105;ciently than an equality test &amp;#98;ased on&lt;br /&gt;      &lt;tt&gt;&amp;lt;=&amp;gt;&lt;/tt&gt;. It is possible to define classes that&lt;br /&gt;      implement &amp;#100;i&amp;#102;fer&amp;#101;nt no&amp;#116;ions of equali&amp;#116;y in their &lt;tt&gt;==&lt;/tt&gt;&lt;br /&gt;      and &lt;tt&gt;&amp;lt;=&amp;gt;&lt;/tt&gt; operators. A cla&amp;#115;s might do&lt;br /&gt;      case-sensitive string comparisons fo&amp;#114; the &lt;tt&gt;==&lt;/tt&gt;&lt;br /&gt;      operator, for example, but then do case-insens&amp;#105;tive comparisons for&lt;br /&gt;      &lt;tt&gt;&amp;lt;=&amp;gt;&lt;/tt&gt;, so that instances of the class would s&amp;#111;rt&lt;br /&gt;      &amp;#109;ore natural&amp;#108;y. In genera&amp;#108;, though, it i&amp;#115; best if&lt;br /&gt;      &lt;tt&gt;&amp;lt;=&amp;gt;&lt;/tt&gt; returns &lt;tt&gt;0&lt;/tt&gt; if and onl&amp;#121; if&lt;br /&gt;      &lt;tt&gt;==&lt;/tt&gt; returns &lt;tt&gt;true&lt;/tt&gt;.&lt;/p&gt;&lt;br /&gt;      &lt;br /&gt;      &lt;br /&gt;        &lt;h4 id="title-ID0EVFOM" class="docSection2Title"&gt;3.8.7. Object Conversion&lt;/h4&gt;&lt;br /&gt;        &lt;p class="docText"&gt;Many Ruby classes defi&amp;#110;e &amp;#109;ethods that &amp;#114;eturn a represen&amp;#116;ation&lt;br /&gt;      of the objec&amp;#116; as a value of a different class. Th&amp;#101;&lt;br /&gt;      &lt;tt&gt;to_s&lt;/tt&gt; method, for obtaining a &lt;tt&gt;String&lt;/tt&gt; rep&amp;#114;esentation&lt;br /&gt;      of an object, is probably the most &amp;#99;ommonly implemented and best known&lt;br /&gt;      of these methods. The s&amp;#117;bsection&amp;#115; that fo&amp;#108;low descri&amp;#98;e various&lt;br /&gt;      c&amp;#97;tegories of convers&amp;#105;ons.&lt;/p&gt;&lt;br /&gt;        &lt;br /&gt;          &lt;h5 id="title-ID0EVGOM" class="docSection3Title"&gt;3.8.7.1. Explicit conversions&lt;/h5&gt;&lt;br /&gt;          &lt;p class="docText"&gt;Classes define explicit conversion methods fo&amp;#114; use by &amp;#97;pplicati&amp;#111;n code&lt;br /&gt;        &amp;#116;hat needs to conv&amp;#101;rt a value to another repr&amp;#101;sentation. The most&lt;br /&gt;        common metho&amp;#100;s in this category are &lt;tt&gt;to_s&lt;/tt&gt;,&lt;br /&gt;        &lt;tt&gt;to_i&lt;/tt&gt;, &lt;tt&gt;to_f&lt;/tt&gt;, and&lt;br /&gt;        &lt;tt&gt;to_a&lt;/tt&gt; to c&amp;#111;nvert to &lt;tt&gt;String&lt;/tt&gt;,&lt;br /&gt;        &lt;tt&gt;Integer&lt;/tt&gt;, &lt;tt&gt;Float&lt;/tt&gt;, and&lt;br /&gt;        &lt;tt&gt;Array&lt;/tt&gt;, respect&amp;#105;vely.&lt;/p&gt;&lt;br /&gt;          &lt;p class="docText"&gt;Bu&amp;#105;lt-in me&amp;#116;hods do n&amp;#111;t t&amp;#121;pically invoke these methods fo&amp;#114; you.&lt;br /&gt;        If you invoke a method that expect&amp;#115; a &lt;tt&gt;Strin&amp;#103;&lt;/tt&gt; and&lt;br /&gt;        p&amp;#97;ss an object of some oth&amp;#101;r kind, that &amp;#109;ethod is not expected t&amp;#111;&lt;br /&gt;        convert the argument &amp;#119;ith &lt;tt&gt;to_s&lt;/tt&gt;. (Values&lt;br /&gt;        interpolated into d&amp;#111;uble-quoted strings, however, are automatically&lt;br /&gt;        conv&amp;#101;rt&amp;#101;d w&amp;#105;th &lt;tt&gt;to_s&lt;/tt&gt;.)&lt;/p&gt;&lt;br /&gt;          &lt;p class="docText"&gt;&lt;tt&gt;t&amp;#111;_s&lt;/tt&gt; i&amp;#115; easily the most important of the&lt;br /&gt;        conv&amp;#101;rsion methods because string represe&amp;#110;t&amp;#97;tions of o&amp;#98;jects are so&lt;br /&gt;        co&amp;#109;monly used in u&amp;#115;er interfaces. An important alte&amp;#114;native to&lt;br /&gt;        &lt;tt&gt;to_s&lt;/tt&gt; is the &lt;tt&gt;inspect&lt;/tt&gt; method.&lt;br /&gt;        &lt;tt&gt;to_s&lt;/tt&gt; is &amp;#103;enerally intended to return a&lt;br /&gt;        hum&amp;#97;n-readable representation of the object, suit&amp;#97;ble for en&amp;#100; u&amp;#115;ers.&lt;br /&gt;        &lt;tt&gt;ins&amp;#112;ect&lt;/tt&gt;, &amp;#111;n the other hand, is intend&amp;#101;d for&lt;br /&gt;        debugging use, and should return &amp;#97; represen&amp;#116;ation th&amp;#97;t is helpful to&lt;br /&gt;        Ruby d&amp;#101;velopers. The d&amp;#101;fault &lt;tt&gt;inspect&lt;/tt&gt; method,&lt;br /&gt;        inh&amp;#101;rited from &lt;tt&gt;Object&lt;/tt&gt;, simply calls&lt;br /&gt;        &lt;tt&gt;to_s&lt;/tt&gt;.&lt;/p&gt;&lt;br /&gt;        &lt;br /&gt;        &lt;br /&gt;          &lt;h5 id="title-ID0EFJOM" class="docSection3Title"&gt;3.8.7.2. Implicit conversions&lt;/h5&gt;&lt;br /&gt;          &lt;p class="docText"&gt;Some&amp;#116;imes a class has strong characteristics of some other clas&amp;#115;.&lt;br /&gt;        The Ruby &lt;tt&gt;Exception&lt;/tt&gt; class represents an error or&lt;br /&gt;        une&amp;#120;p&amp;#101;ct&amp;#101;d c&amp;#111;nd&amp;#105;tion in a program and enc&amp;#97;psulates an error message.&lt;br /&gt;        In Ruby 1.8, &lt;tt&gt;Exception&lt;/tt&gt; objects are &amp;#110;o&amp;#116;&lt;br /&gt;        merely c&amp;#111;nvert&amp;#105;ble to strings; th&amp;#101;y are string-like object&amp;#115; and can be&lt;br /&gt;        treated as if they were strings in many c&amp;#111;ntexts.&lt;sup class="docFootnote"&gt;[*]&lt;/sup&gt;  For example:&lt;/p&gt;&lt;blockquote&gt;&lt;p class="docFootnote"&gt;&lt;sup&gt;[*]&lt;/sup&gt; Doing so is discouraged, how&amp;#101;ver, and Ruby 1.9 no longer&lt;br /&gt;            allows the implicit conversion of &lt;tt&gt;Ex&amp;#99;eption&lt;/tt&gt; to&lt;br /&gt;            &lt;tt&gt;St&amp;#114;ing&lt;/tt&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;br /&gt;          &lt;pre&gt;# Ruby 1.8 only&lt;br /&gt;e = Exception.new("not really an exception")&lt;br /&gt;msg = "Error: " + e  # String concatenation with an Exception&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          &lt;p class="docText"&gt;Be&amp;#99;ause &lt;tt&gt;Except&amp;#105;on&lt;/tt&gt; obje&amp;#99;ts are string-like, they can be us&amp;#101;d with the string&lt;br /&gt;        concatenation operator. This d&amp;#111;es &amp;#110;o&amp;#116; work with most o&amp;#116;her Ruby&lt;br /&gt;        classes. The r&amp;#101;ason that &lt;tt&gt;Except&amp;#105;on&lt;/tt&gt; objects can behave like&lt;br /&gt;        &lt;tt&gt;String&lt;/tt&gt; objects is th&amp;#97;t, in Ruby 1.8,&lt;br /&gt;        &lt;tt&gt;Exception&lt;/tt&gt; implement&amp;#115; the implicit conversion method&lt;br /&gt;        &lt;tt&gt;to_str&lt;/tt&gt;, and th&amp;#101; &lt;tt&gt;+&lt;/tt&gt; op&amp;#101;ra&amp;#116;or&lt;br /&gt;        defin&amp;#101;d b&amp;#121; &lt;tt&gt;String&lt;/tt&gt; invokes this meth&amp;#111;d on its&lt;br /&gt;        righthand operand.&lt;/p&gt;&lt;br /&gt;          &lt;p class="docText"&gt;Other impl&amp;#105;cit con&amp;#118;ersion met&amp;#104;ods are &lt;tt&gt;to_&amp;#105;nt&lt;/tt&gt;&lt;br /&gt;        for objects that &amp;#119;ant to be integer-like, &lt;tt&gt;to_ar&amp;#121;&lt;/tt&gt; for objects that want to be&lt;br /&gt;        arra&amp;#121;-like, and &lt;tt&gt;to_hash&lt;/tt&gt; for objects that want to be&lt;br /&gt;        ha&amp;#115;h-like. Unfortunately, the circumstances unde&amp;#114; which &amp;#116;hese imp&amp;#108;icit&lt;br /&gt;        conve&amp;#114;sion m&amp;#101;thods are called are not wel&amp;#108; documented. Among the&lt;br /&gt;        built-in classes, these im&amp;#112;lic&amp;#105;t conve&amp;#114;sion meth&amp;#111;ds are not com&amp;#109;only&lt;br /&gt;        implemented, either.&lt;/p&gt;&lt;br /&gt;          &lt;p class="docText"&gt;We &amp;#110;oted earlier in passing tha&amp;#116; the &lt;tt&gt;==&lt;/tt&gt;&lt;br /&gt;        operator can perform a weak kind of type conversion w&amp;#104;en testing for&lt;br /&gt;        equality. The &lt;tt&gt;==&lt;/tt&gt; operators define&amp;#100; b&amp;#121;&lt;br /&gt;        &lt;tt&gt;St&amp;#114;ing&lt;/tt&gt;, &lt;tt&gt;Ar&amp;#114;ay&lt;/tt&gt;, and&lt;br /&gt;        &lt;tt&gt;&amp;#72;ash&lt;/tt&gt; check to see if the righth&amp;#97;nd operand is of&lt;br /&gt;        the same class as the lefthand ope&amp;#114;and. If &amp;#115;o, they c&amp;#111;mpare them. If&lt;br /&gt;        &amp;#110;ot, they che&amp;#99;k to see if the righthand &amp;#111;perand has a&lt;br /&gt;        &lt;tt&gt;to_str&lt;/tt&gt;, &lt;tt&gt;to_ary&lt;/tt&gt;, or&lt;br /&gt;        &lt;tt&gt;to_ha&amp;#115;h&lt;/tt&gt; method. They don't invoke this method, but&lt;br /&gt;        &amp;#105;f it exists, they invoke the &lt;tt&gt;==&lt;/tt&gt; method of the&lt;br /&gt;        righth&amp;#97;nd operan&amp;#100; a&amp;#110;d &amp;#97;llow it to &amp;#100;ecide whether it is equal to the&lt;br /&gt;        le&amp;#102;thand operand.&lt;/p&gt;&lt;br /&gt;          &lt;p class="docText"&gt;In Ruby 1.9, the built-&amp;#105;n class&amp;#101;s &lt;tt&gt;S&amp;#116;ring&lt;/tt&gt;,&lt;br /&gt;        &lt;tt&gt;Array&lt;/tt&gt;, &lt;tt&gt;Hash&lt;/tt&gt;,&lt;br /&gt;        &lt;tt&gt;Reg&amp;#101;xp&lt;/tt&gt;, and &lt;tt&gt;IO&lt;/tt&gt; all d&amp;#101;fine a&lt;br /&gt;        class method nam&amp;#101;d &lt;tt&gt;try_convert&lt;/tt&gt;. These meth&amp;#111;ds&lt;br /&gt;        convert their argument if it defines an a&amp;#112;propriate implicit&lt;br /&gt;        conversion method, o&amp;#114; they r&amp;#101;tu&amp;#114;n &lt;tt&gt;nil&lt;/tt&gt; o&amp;#116;herwise.&lt;br /&gt;        &lt;tt&gt;&amp;#65;rray.try_convert(&amp;#111;)&lt;/tt&gt; returns&lt;br /&gt;        &lt;tt&gt;o.to_ary&lt;/tt&gt; if &lt;tt&gt;o&lt;/tt&gt; defines that&lt;br /&gt;        method; otherwise, &amp;#105;t retur&amp;#110;s &lt;tt&gt;&amp;#110;il&lt;/tt&gt;. These &lt;tt&gt;try_c&amp;#111;nvert&lt;/tt&gt; &amp;#109;ethods are convenient &amp;#105;f you want to&lt;br /&gt;        write methods &amp;#116;hat allow implicit conversions on their&lt;br /&gt;        ar&amp;#103;uments.&lt;/p&gt;&lt;br /&gt;        &lt;br /&gt;        &lt;br /&gt;          &lt;h5 id="title-ID0EROOM" class="docSection3Title"&gt;3.8.7.3. Conversion functions&lt;/h5&gt;&lt;br /&gt;          &lt;p class="docText"&gt;The &lt;tt&gt;Kernel&lt;/tt&gt; module defines four conversion m&amp;#101;th&amp;#111;ds &amp;#116;hat beha&amp;#118;e as global&lt;br /&gt;        &amp;#99;onversion functions. These func&amp;#116;ions&amp;#8212;&lt;tt&gt;Array&lt;/tt&gt;,&lt;br /&gt;        &lt;tt&gt;Float&lt;/tt&gt;, &lt;tt&gt;Integer&lt;/tt&gt;, and&lt;br /&gt;        &lt;tt&gt;String&lt;/tt&gt;&amp;#8212;have the same n&amp;#97;mes as the &amp;#99;lasses that &amp;#116;hey&lt;br /&gt;        convert &amp;#116;o, and they ar&amp;#101; unusual in that they begin with a &amp;#99;apital&lt;br /&gt;        letter.&lt;/p&gt;&lt;br /&gt;          &lt;p class="docText"&gt;The &lt;tt&gt;Array&lt;/tt&gt; func&amp;#116;ion attempts to convert its argument to an array by calli&amp;#110;g&lt;br /&gt;        &lt;tt&gt;to_ary&lt;/tt&gt;. If that method is not define&amp;#100; o&amp;#114; retur&amp;#110;s&lt;br /&gt;        &lt;tt&gt;&amp;#110;i&amp;#108;&lt;/tt&gt;, it tries the &lt;tt&gt;to_a&lt;/tt&gt; method.&lt;br /&gt;        If &lt;tt&gt;to_a&lt;/tt&gt; is not &amp;#100;efined or returns&lt;br /&gt;        &lt;tt&gt;ni&amp;#108;&lt;/tt&gt;, the &lt;tt&gt;Array&lt;/tt&gt; f&amp;#117;nction si&amp;#109;ply&lt;br /&gt;        returns a new array &amp;#99;ontaining the argu&amp;#109;ent as its single&lt;br /&gt;        element.&lt;/p&gt;&lt;br /&gt;          &lt;p class="docText"&gt;The &lt;tt&gt;Floa&amp;#116;&lt;/tt&gt; function converts &lt;tt&gt;Numeri&amp;#99;&lt;/tt&gt; arguments to&lt;br /&gt;        &lt;tt&gt;Float&lt;/tt&gt; objects direct&amp;#108;y. For any&lt;br /&gt;        non-&lt;tt&gt;Numeric&lt;/tt&gt; value, it calls the&lt;br /&gt;        &lt;tt&gt;to_f&lt;/tt&gt; method.&lt;/p&gt;&lt;br /&gt;          &lt;p class="docText"&gt;The &lt;tt&gt;Int&amp;#101;ge&amp;#114;&lt;/tt&gt; funct&amp;#105;on conv&amp;#101;rt&amp;#115; its argument to a &lt;tt&gt;Fixnum&lt;/tt&gt; or&lt;br /&gt;        &lt;tt&gt;Bignum&lt;/tt&gt;. If &amp;#116;he argument is a&lt;br /&gt;        &lt;tt&gt;Numeric&lt;/tt&gt; value, it is converted dire&amp;#99;tly.&lt;br /&gt;        Floatin&amp;#103;-poin&amp;#116; values are trun&amp;#99;ated rather than roun&amp;#100;ed. If the&lt;br /&gt;        argument i&amp;#115; a string, it looks for a radix i&amp;#110;dicator (a leading&lt;br /&gt;        &lt;tt&gt;0&lt;/tt&gt; for octal, &lt;tt&gt;0x&lt;/tt&gt; for hexadecimal,&lt;br /&gt;        o&amp;#114; &lt;tt&gt;0b&lt;/tt&gt; for binary) and converts the string&lt;br /&gt;        acco&amp;#114;dingl&amp;#121;. Un&amp;#108;ike &lt;tt&gt;String.&amp;#116;o_i&lt;/tt&gt; it doe&amp;#115; not allow&lt;br /&gt;        nonnumeric tra&amp;#105;ling characters. For any other k&amp;#105;nd of ar&amp;#103;umen&amp;#116;, the&lt;br /&gt;        &lt;tt&gt;Integer&lt;/tt&gt; fu&amp;#110;ction firs&amp;#116; attempts conversion with&lt;br /&gt;        &lt;tt&gt;to_int&lt;/tt&gt; &amp;#97;nd then with&lt;br /&gt;        &lt;tt&gt;to_i&lt;/tt&gt;.&lt;/p&gt;&lt;br /&gt;          &lt;p class="docText"&gt;Finally, the &lt;tt&gt;String&lt;/tt&gt; func&amp;#116;ion converts its&lt;br /&gt;        argument to a string simply b&amp;#121; calling its &lt;tt&gt;to_s&lt;/tt&gt;&lt;br /&gt;        method.&lt;/p&gt;&lt;br /&gt;        &lt;br /&gt;        &lt;br /&gt;          &lt;h5 id="title-ID0E2SOM" class="docSection3Title"&gt;3.8.7.4. Arithmetic operator type coercions&lt;/h5&gt;&lt;br /&gt;          &lt;p class="docText"&gt;Numeric types define &amp;#97; conversi&amp;#111;n m&amp;#101;th&amp;#111;d n&amp;#97;med &lt;tt&gt;coerce&lt;/tt&gt;. The intent of th&amp;#105;s&lt;br /&gt;        method is to convert the argument &amp;#116;o the sam&amp;#101; ty&amp;#112;e as the numer&amp;#105;c&lt;br /&gt;        object on which &amp;#116;he method is invoked, o&amp;#114; to convert both objects to&lt;br /&gt;        some more general &amp;#99;ompatible type. The &lt;tt&gt;coerce&lt;/tt&gt;&lt;br /&gt;        method always return&amp;#115; an array that holds two numeric values of the&lt;br /&gt;        same &amp;#116;ype. The f&amp;#105;rst ele&amp;#109;ent of the ar&amp;#114;ay is t&amp;#104;e converted value of&lt;br /&gt;        the &amp;#97;rgument to &lt;tt&gt;coerce&lt;/tt&gt;. The second element &amp;#111;f t&amp;#104;e&lt;br /&gt;        retu&amp;#114;ned array is t&amp;#104;e value (co&amp;#110;verted, if nec&amp;#101;ssary) on which&lt;br /&gt;        &lt;tt&gt;coerce&lt;/tt&gt; was invoke&amp;#100;:&lt;/p&gt;&lt;br /&gt;          &lt;pre&gt;1.1.coerce(1)      # [1.0, 1.1]: coerce Fixnum to Float&lt;br /&gt;require "rational" # Use Rational numbers&lt;br /&gt;r = Rational(1,3)  # One third as a Rational number&lt;br /&gt;r.coerce(2)        # [Rational(2,1), Rational(1,3)]: Fixnum to Rational&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          &lt;p class="docText"&gt;The &lt;tt&gt;coerce&lt;/tt&gt; method is used by the arithmeti&amp;#99;&lt;br /&gt;        operators. The &lt;tt&gt;+&lt;/tt&gt; operator defined by &lt;tt&gt;Fixnum&lt;/tt&gt; doesn't k&amp;#110;o&amp;#119; about&lt;br /&gt;        &lt;tt&gt;Ratio&amp;#110;a&amp;#108;&lt;/tt&gt; numbers, fo&amp;#114; example, and if its righthand&lt;br /&gt;        operan&amp;#100; is a &lt;tt&gt;Rational&lt;/tt&gt; value, it doesn't know how &amp;#116;o&lt;br /&gt;        add it. &lt;tt&gt;c&amp;#111;er&amp;#99;e&lt;/tt&gt; provides the solu&amp;#116;ion. Numeric&lt;br /&gt;        ope&amp;#114;ators are written so th&amp;#97;t if they don't know the type of the&lt;br /&gt;        right&amp;#104;and operand, they invoke the &lt;tt&gt;coerce&lt;/tt&gt; method of&lt;br /&gt;        t&amp;#104;e righthand operand, passing the lefthand &amp;#111;pe&amp;#114;and as &amp;#97;n argumen&amp;#116;.&lt;br /&gt;        Returni&amp;#110;g to our example of adding a &lt;tt&gt;Fix&amp;#110;um&lt;/tt&gt; and a&lt;br /&gt;        &lt;tt&gt;Rational&lt;/tt&gt;, the &lt;tt&gt;coerce&lt;/tt&gt; method of&lt;br /&gt;        &lt;tt&gt;Rational&lt;/tt&gt; returns an a&amp;#114;ray of &amp;#116;wo&lt;br /&gt;        &lt;tt&gt;Ratio&amp;#110;al&lt;/tt&gt; values. Now &amp;#116;he &lt;tt&gt;+&lt;/tt&gt;&lt;br /&gt;        operator defin&amp;#101;d by &lt;tt&gt;Fixnum&lt;/tt&gt; can simp&amp;#108;y invoke&lt;br /&gt;        &lt;tt&gt;+&lt;/tt&gt; on the values in the array.&lt;/p&gt;&lt;br /&gt;        &lt;br /&gt;        &lt;br /&gt;          &lt;h5 id="title-ID0EWVOM" class="docSection3Title"&gt;3.8.7.5. Boolean type conversions&lt;/h5&gt;&lt;br /&gt;          &lt;p class="docText"&gt;Boole&amp;#97;n values deserve a special mention in the co&amp;#110;text of type conversion. Ruby is very strict w&amp;#105;th its&lt;br /&gt;        B&amp;#111;ol&amp;#101;an &amp;#118;alues: &lt;tt&gt;true&lt;/tt&gt; &amp;#97;nd &lt;tt&gt;false&lt;/tt&gt;&lt;br /&gt;        have &lt;tt&gt;to_s&lt;/tt&gt; methods, which retu&amp;#114;n &amp;quot;true&amp;quot; and &amp;quot;false&amp;quot; but define no other&lt;br /&gt;        conversion met&amp;#104;ods. An&amp;#100; t&amp;#104;ere is no &lt;tt&gt;&amp;#116;o_b&lt;/tt&gt; method t&amp;#111;&lt;br /&gt;        convert oth&amp;#101;r values to Booleans.&lt;/p&gt;&lt;br /&gt;          &lt;p class="docText"&gt;In some languages, &lt;tt&gt;f&amp;#97;lse&lt;/tt&gt; is the same thing as&lt;br /&gt;        &lt;tt&gt;0&lt;/tt&gt;, or can be converted to and from&lt;br /&gt;        &lt;tt&gt;0&lt;/tt&gt;. In &amp;#82;uby, the values &lt;tt&gt;true&lt;/tt&gt; and&lt;br /&gt;        &lt;tt&gt;false&lt;/tt&gt; are their own &amp;#100;i&amp;#115;tinct o&amp;#98;jects, and t&amp;#104;ere ar&amp;#101;&lt;br /&gt;        no implicit conversions tha&amp;#116; convert other values to&lt;br /&gt;        &lt;tt&gt;true&lt;/tt&gt; or &lt;tt&gt;false&lt;/tt&gt;. This is &amp;#111;nl&amp;#121; ha&amp;#108;f&lt;br /&gt;        the story, howeve&amp;#114;. Ruby's Boolean o&amp;#112;erators and its conditional an&amp;#100;&lt;br /&gt;        looping constructs that use Bool&amp;#101;an expressions can work with values&lt;br /&gt;        othe&amp;#114; than &lt;tt&gt;true&lt;/tt&gt; and &lt;tt&gt;false&lt;/tt&gt;. The&lt;br /&gt;        rule is simple: in Boole&amp;#97;n express&amp;#105;ons, any &amp;#118;alue other &amp;#116;han&lt;br /&gt;        &lt;tt&gt;fals&amp;#101;&lt;/tt&gt; or &lt;tt&gt;nil&lt;/tt&gt; behaves like (but&lt;br /&gt;        is no&amp;#116; converted to)&lt;br /&gt;        &lt;tt&gt;true&lt;/tt&gt;. &lt;tt&gt;nil&lt;/tt&gt;, on the other han&amp;#100;&lt;br /&gt;        b&amp;#101;ha&amp;#118;es like &lt;tt&gt;false&lt;/tt&gt;.&lt;/p&gt;&lt;br /&gt;          &lt;p class="docText"&gt;Suppo&amp;#115;e you want &amp;#116;o test whether the vari&amp;#97;ble&lt;br /&gt;        &lt;tt&gt;x&lt;/tt&gt; is &lt;tt&gt;nil&lt;/tt&gt; or not. In some&lt;br /&gt;        languages, you must explici&amp;#116;ly write a comparison expression t&amp;#104;at&lt;br /&gt;        evaluates to &lt;tt&gt;true&lt;/tt&gt; or&lt;br /&gt;        &lt;tt&gt;false&lt;/tt&gt;:&lt;/p&gt;&lt;br /&gt;          &lt;pre&gt;if x != nil   # Expression "x != nil" returns true or false to the if&lt;br /&gt;  puts x      # Print x if it is defined&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          &lt;p class="docText"&gt;This code works in Ruby, but it is mor&amp;#101; co&amp;#109;mon simply t&amp;#111; ta&amp;#107;e&lt;br /&gt;        advanta&amp;#103;e of the fact that all values othe&amp;#114; than&lt;br /&gt;        &lt;tt&gt;nil&lt;/tt&gt; and &lt;tt&gt;false&lt;/tt&gt; behave like&lt;br /&gt;        &lt;tt&gt;true&lt;/tt&gt;:&lt;/p&gt;&lt;br /&gt;          &lt;pre&gt;if x       # If x is non-nil&lt;br /&gt;  puts x   # Then print it&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          &lt;p class="docText"&gt;It is important to r&amp;#101;me&amp;#109;ber that val&amp;#117;es like&lt;br /&gt;        &lt;tt&gt;0&lt;/tt&gt;, &lt;tt&gt;0.0&lt;/tt&gt;, and t&amp;#104;e empty st&amp;#114;ing&lt;br /&gt;        &lt;tt&gt;""&lt;/tt&gt; behave like &lt;tt&gt;true&lt;/tt&gt; in Ruby,&lt;br /&gt;        which i&amp;#115; surprising if you are used to langua&amp;#103;es like C or&lt;br /&gt;        JavaScript.&lt;/p&gt;&lt;br /&gt;        &lt;br /&gt;      &lt;br /&gt;      &lt;br /&gt;        &lt;h4 id="title-ID0EZZOM" class="docSection2Title"&gt;3.8.8. Copying Objects&lt;/h4&gt;&lt;br /&gt;        &lt;p class="docText"&gt;The &lt;tt&gt;Object&lt;/tt&gt; class define&amp;#115; two closely&lt;br /&gt;      related methods for copying obje&amp;#99;ts. Both &lt;tt&gt;clon&amp;#101;&lt;/tt&gt; an&amp;#100;&lt;br /&gt;      &lt;tt&gt;d&amp;#117;p&lt;/tt&gt; return a &amp;#115;hallow copy of the object on which they&lt;br /&gt;      &amp;#97;re invoked. If the copied object includes one int&amp;#101;rn&amp;#97;l state th&amp;#97;t&lt;br /&gt;      refers to ot&amp;#104;er object&amp;#115;, only the object references &amp;#97;re copied, not the&lt;br /&gt;      referenced obj&amp;#101;cts themselves.&lt;/p&gt;&lt;br /&gt;        &lt;p class="docText"&gt;If the object being copied defines a&amp;#110;&lt;br /&gt;      &lt;tt&gt;initialize_copy&lt;/tt&gt; method, then &lt;tt&gt;clone&lt;/tt&gt; and &lt;tt&gt;dup&lt;/tt&gt;&lt;br /&gt;      simply a&amp;#108;locate a ne&amp;#119;, empty insta&amp;#110;c&amp;#101; of &amp;#116;he class and invoke the&lt;br /&gt;      &lt;tt&gt;initialize_copy&lt;/tt&gt; &amp;#109;ethod on this empty instance. The&lt;br /&gt;      object &amp;#116;o be copi&amp;#101;d i&amp;#115; passed as an argum&amp;#101;nt, and this &amp;quot;co&amp;#112;y&lt;br /&gt;      constructor&amp;quot; can initial&amp;#105;ze the copy however it desires. For &amp;#101;xample,&lt;br /&gt;      the &lt;tt&gt;initialize_copy&lt;/tt&gt; method could&lt;br /&gt;      recurs&amp;#105;vely copy the internal data of an object so that the resu&amp;#108;ting&lt;br /&gt;      objec&amp;#116; is not a s&amp;#105;mple sh&amp;#97;llow copy &amp;#111;f the original.&lt;/p&gt;&lt;br /&gt;        &lt;p class="docText"&gt;Classes can &amp;#97;lso override the &lt;tt&gt;clone&lt;/tt&gt; and&lt;br /&gt;      &lt;tt&gt;dup&lt;/tt&gt; methods directly to produce any kind of &amp;#99;opy they&lt;br /&gt;      des&amp;#105;re.&lt;/p&gt;&lt;br /&gt;        &lt;p class="docText"&gt;Ther&amp;#101; are tw&amp;#111; import&amp;#97;nt differences betw&amp;#101;en the&lt;br /&gt;      &lt;tt&gt;clone&lt;/tt&gt; and &lt;tt&gt;dup&lt;/tt&gt; methods define&amp;#100; by&lt;br /&gt;      &lt;tt&gt;Object&lt;/tt&gt;. First, &lt;tt&gt;clone&lt;/tt&gt; copies both&lt;br /&gt;      the fro&amp;#122;en and tainted state (defined shortly) &amp;#111;f a&amp;#110; o&amp;#98;ject, where&amp;#97;s&lt;br /&gt;      &lt;tt&gt;dup&lt;/tt&gt; only &amp;#99;opies the tainted state; calling&lt;br /&gt;      &lt;tt&gt;dup&lt;/tt&gt; o&amp;#110; a frozen object returns an unfroze&amp;#110; c&amp;#111;py.&lt;br /&gt;      &amp;#83;econd, &lt;tt&gt;c&amp;#108;one&lt;/tt&gt; copies any single&amp;#116;on methods of the&lt;br /&gt;      obje&amp;#99;t, whereas &lt;tt&gt;dup&lt;/tt&gt; does not.&lt;/p&gt;&lt;br /&gt;      &lt;br /&gt;      &lt;br /&gt;        &lt;h4 id="title-ID0EY3OM" class="docSection2Title"&gt;3.8.9. Marshaling Objects&lt;/h4&gt;&lt;br /&gt;        &lt;p class="docText"&gt;You can save the state of an &amp;#111;bject by passing it to the class method&lt;br /&gt;      &lt;tt&gt;Marshal.du&amp;#109;p&lt;/tt&gt;.&lt;sup class="docFootnote"&gt;[*]&lt;/sup&gt;  If you pass an I/O stream object as the second argument,&lt;br /&gt;      &lt;tt&gt;Marshal.du&amp;#109;p&lt;/tt&gt; writes the &amp;#115;tate of &amp;#116;he objec&amp;#116; (and,&lt;br /&gt;      recu&amp;#114;sively, any objects it r&amp;#101;ferences) to that stream. Otherwise, it&lt;br /&gt;      &amp;#115;imply r&amp;#101;tu&amp;#114;ns the enc&amp;#111;ded s&amp;#116;ate as a binary string.&lt;/p&gt;&lt;blockquote&gt;&lt;p class="docFootnote"&gt;&lt;sup&gt;[*]&lt;/sup&gt; The wo&amp;#114;d &amp;quot;marshal&amp;quot; and its variants are sometimes spel&amp;#108;ed with&lt;br /&gt;          two ls: marshall, marshalled, etc. If you spell the word t&amp;#104;is way,&lt;br /&gt;          you'll need to remember that the name of the Ruby &amp;#99;lass has onl&amp;#121; a&lt;br /&gt;          s&amp;#105;ngle l.&lt;/p&gt;&lt;/blockquote&gt;&lt;br /&gt;        &lt;p class="docText"&gt;T&amp;#111; re&amp;#115;tore a marshaled object, pass a string o&amp;#114; an I/O stream&lt;br /&gt;      containing the object to &lt;tt&gt;Marshal.load&lt;/tt&gt;.&lt;/p&gt;&lt;br /&gt;        &lt;p class="docText"&gt;Marsha&amp;#108;ing an obje&amp;#99;t is a very si&amp;#109;ple way to save its state &amp;#102;or&lt;br /&gt;      later use, an&amp;#100; these methods can be used to pr&amp;#111;vide an automatic file&lt;br /&gt;      form&amp;#97;t for Ruby programs. Note, however, that the bina&amp;#114;y format used by&lt;br /&gt;      &lt;tt&gt;Marshal.dump&lt;/tt&gt; and &lt;tt&gt;Marshal.load&lt;/tt&gt; is&lt;br /&gt;      version-d&amp;#101;pe&amp;#110;d&amp;#101;nt, &amp;#97;nd newer v&amp;#101;rsions of Ruby are not guara&amp;#110;teed to be&lt;br /&gt;      able to read marshaled o&amp;#98;jects writ&amp;#116;en by old&amp;#101;r vers&amp;#105;ons of Ruby.&lt;/p&gt;&lt;br /&gt;        &lt;p class="docText"&gt;Anothe&amp;#114; use for &lt;tt&gt;Marshal.dump&lt;/tt&gt; and&lt;br /&gt;      &lt;tt&gt;Marshal.lo&amp;#97;d&lt;/tt&gt; is to create deep copies of objects:&lt;/p&gt;&lt;br /&gt;        &lt;pre&gt;def deepcopy(o)&lt;br /&gt;  Marshal.load(Marshal.dump(o))&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        &lt;p class="docText"&gt;Note &amp;#116;hat files and I/O streams, as well as&lt;br /&gt;      &lt;tt&gt;Method&lt;/tt&gt; and &lt;tt&gt;&amp;#66;inding&lt;/tt&gt; objects, are&lt;br /&gt;      too dynamic to be marshaled; there wo&amp;#117;ld be no re&amp;#108;iable way t&amp;#111; re&amp;#115;tore&lt;br /&gt;      th&amp;#101;ir state.&lt;/p&gt;&lt;br /&gt;        &lt;p class="docText"&gt;YAML (&amp;quot;YAML Ain't Markup L&amp;#97;nguage&amp;quot;) is a commonly used alternative to the &lt;tt&gt;Ma&amp;#114;shal&lt;/tt&gt; m&amp;#111;du&amp;#108;e that dumps object&amp;#115; to (and&lt;br /&gt;      load&amp;#115; objects from) a human-readable text for&amp;#109;at. It is in the standard&lt;br /&gt;      library, and y&amp;#111;u must &lt;tt&gt;require 'yaml'&lt;/tt&gt; to use&lt;br /&gt;      it.&lt;/p&gt;&lt;br /&gt;      &lt;br /&gt;      &lt;br /&gt;        &lt;h4 id="title-ID0EQ6OM" class="docSection2Title"&gt;3.8.10. Freezing Objects&lt;/h4&gt;&lt;br /&gt;        &lt;p class="docText"&gt;Any object may b&amp;#101; &lt;span class="docEmphasis"&gt;frozen&lt;/span&gt; by calling its &lt;tt&gt;freeze&lt;/tt&gt; me&amp;#116;hod. A fro&amp;#122;en o&amp;#98;ject&lt;br /&gt;      becom&amp;#101;s i&amp;#109;mutable&amp;#8212;none of its&lt;br /&gt;      internal st&amp;#97;te may be changed, and an attempt to call any of its muta&amp;#116;or&lt;br /&gt;      metho&amp;#100;s &amp;#102;ails:&lt;/p&gt;&lt;br /&gt;        &lt;pre&gt;s = "ice"      # Strings are mutable objects&lt;br /&gt;s.freeze       # Make this string immutable&lt;br /&gt;s.frozen?      # true: it has been frozen&lt;br /&gt;s.upcase!      # TypeError: can't modify frozen string&lt;br /&gt;s[0] = "ni"    # TypeError: can't modify frozen string&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        &lt;p class="docText"&gt;Freezi&amp;#110;g a class obj&amp;#101;ct prevents the add&amp;#105;tion of any methods to&lt;br /&gt;      that class.&lt;/p&gt;&lt;br /&gt;        &lt;p class="docText"&gt;You can check whethe&amp;#114; an object is frozen with the&lt;br /&gt;      &lt;tt&gt;frozen?&lt;/tt&gt; m&amp;#101;thod. Once frozen, there is &amp;#110;o &amp;#119;ay&lt;br /&gt;      to &amp;quot;thaw&amp;quot; an &amp;#111;bj&amp;#101;ct. &amp;#73;f you copy a frozen object &amp;#119;ith&lt;br /&gt;      &lt;tt&gt;clone&lt;/tt&gt;, the copy will also be frozen. I&amp;#102; you &amp;#99;opy a&lt;br /&gt;      frozen &amp;#111;bject &amp;#119;ith &lt;tt&gt;dup&lt;/tt&gt;, however, the copy &amp;#119;ill not be&lt;br /&gt;      frozen.&lt;/p&gt;&lt;br /&gt;      &lt;br /&gt;      &lt;br /&gt;        &lt;h4 id="title-ID0EEBPM" class="docSection2Title"&gt;3.8.11. Tainting Objects&lt;/h4&gt;&lt;br /&gt;        &lt;p class="docText"&gt;Web a&amp;#112;plications must often keep &amp;#116;rack of data derived from untrusted user&lt;br /&gt;      input &amp;#116;o avoid SQL injection attacks and similar securit&amp;#121; ri&amp;#115;ks. Ruby&lt;br /&gt;      &amp;#112;rov&amp;#105;des a si&amp;#109;ple solution to this probl&amp;#101;m: any object may be marked as&lt;br /&gt;      tainted &amp;#98;y calling i&amp;#116;s &lt;tt&gt;taint&lt;/tt&gt; m&amp;#101;thod. O&amp;#110;ce an &amp;#111;bject&lt;br /&gt;      is tainted, a&amp;#110;y objects derived f&amp;#114;om it will also be tainted. The taint&lt;br /&gt;      of an object &amp;#99;an be tested with the &lt;tt&gt;tainted?&lt;/tt&gt; method:&lt;/p&gt;&lt;br /&gt;        &lt;pre&gt;s = "untrusted"   # Objects are normally untainted&lt;br /&gt;s.taint           # Mark this untrusted object as tainted&lt;br /&gt;s.tainted?        # true: it is tainted&lt;br /&gt;s.upcase.tainted? # true: derived objects are tainted&lt;br /&gt;s[3,4].tainted?   # true: substrings are tainted&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        &lt;p class="docText"&gt;User input&amp;#8212;such as comm&amp;#97;nd-line ar&amp;#103;umen&amp;#116;s, enviro&amp;#110;m&amp;#101;nt variables,&lt;br /&gt;      and strings &amp;#114;ead with &lt;tt&gt;gets&lt;/tt&gt;&amp;#8212;are automatically&lt;br /&gt;      tainted.&lt;/p&gt;&lt;br /&gt;        &lt;p class="docText"&gt;Copies of t&amp;#97;inted obj&amp;#101;ct&amp;#115; made with &lt;tt&gt;clone&lt;/tt&gt; a&amp;#110;d&lt;br /&gt;      &lt;tt&gt;du&amp;#112;&lt;/tt&gt; remain tainted. A tainted o&amp;#98;ject may be untainted&lt;br /&gt;      with the &lt;tt&gt;untaint&lt;/tt&gt; method. Y&amp;#111;u should only do this, of&lt;br /&gt;      course, if you &amp;#104;ave examined the object and are convinced that it&lt;br /&gt;      prese&amp;#110;t&amp;#115; no secu&amp;#114;ity ri&amp;#115;ks.&lt;/p&gt;&lt;br /&gt;        &lt;p class="docText"&gt;The o&amp;#98;ject tainting mechanism of Ruby is most po&amp;#119;erful when used&lt;br /&gt;      with the global variable &lt;tt&gt;$SAFE&lt;/tt&gt;. When this vari&amp;#97;ble is&lt;br /&gt;      set &amp;#116;o a value &amp;#103;reater t&amp;#104;an zero, Ru&amp;#98;y restricts various built-in&lt;br /&gt;      m&amp;#101;thods so that they will not work wi&amp;#116;h tainted data. See Chapter 10 for further details on the &lt;tt&gt;$&amp;#83;AFE&lt;/tt&gt;&lt;br /&gt;      variable.&lt;/p&gt;&lt;br /&gt;      &lt;br /&gt;    &lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;tr&gt;&lt;td align="right"&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7284850559043997789-4282749479325435141?l=cs20001.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cs20001.blogspot.com/feeds/4282749479325435141/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7284850559043997789&amp;postID=4282749479325435141' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/4282749479325435141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/4282749479325435141'/><link rel='alternate' type='text/html' href='http://cs20001.blogspot.com/2010/02/section-38-objects.html' title='Section 3.8. Objects'/><author><name>rong889</name><uri>http://www.blogger.com/profile/06593146008221514057</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7284850559043997789.post-6459262637981172341</id><published>2010-02-04T05:29:00.019-08:00</published><updated>2010-02-04T05:29:32.294-08:00</updated><title type='text'>Specific Practices by Goal</title><content type='html'>&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;td class="tt1"&gt;[ Team LiB ]&lt;/td&gt;&lt;td valign="top" class="tt1" align="right"&gt;&lt;br /&gt;	&lt;br /&gt;	&lt;br /&gt;&lt;/td&gt;&lt;/table&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td valign="top"&gt;&lt;H3 class="docSection1Title"&gt; Specific Practices by Goal&lt;/H3&gt;&lt;br /&gt;&lt;H4 class="docSection2Title"&gt;SG 1 Provide IPPD Infrastructure&lt;/H4&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;span class="docEmphasis"&gt;An infrastructure that maximizes the productivity of people and affects the collaboration necessary for integration is provided.&lt;/span&gt;&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;An organizational infrastructure that supports and promotes IPPD concepts is critical if IPPD is to be successfully sustained over the long term. An IPPD infrastructure includes the following:&lt;/P&gt;&lt;br /&gt;&lt;UL&gt;&lt;br /&gt;&lt;LI&gt;&lt;P class="docList"&gt;An organization's shared vision that promotes IPPD concepts such as concurrent development and integrated teaming&lt;/P&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;P class="docList"&gt;A work environment that enables efficient and effective collaboration and integration&lt;/P&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;P class="docList"&gt;People trained to collaborate, integrate, and lead others as necessary&lt;/P&gt;&lt;/LI&gt;&lt;br /&gt;&lt;/UL&gt;&lt;br /&gt;&lt;H5 class="docSection3Title"&gt;SP 1.1-1 Establish the Organization's Shared Vision&lt;/H5&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;span class="docEmphasis"&gt;Establish and maintain a shared vision for the organization.&lt;/span&gt;&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Establishing and maintaining the organization's shared vision involves creating, communicating, using, and periodically evaluating and revising the shared vision. An organization's shared vision captures the organization's guiding principles including mission, objectives, expected behavior, and values. The shared visions of a project's integrated teams should be consistent with the project's shared vision, which in turn should be consistent with the organization's shared vision. (See the definition of "shared vision" in the glossary.)&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Creating a shared vision involves establishing and actively maintaining agreement and commitment about what is to be done and how it will be accomplished, both procedurally and behaviorally. A shared vision is a result of an ongoing dialogue among all the people who will make it real. It continues to evolve as more ideas are shared.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;The organization's shared vision facilitates people working together, helps those people to attain unity of purpose, and creates a common understanding of the end state that the organization is aiming to achieve. The organization's shared vision must speak to every element of the organization. Effectively impacting the lowest levels of the organization necessitates impacting the highest levels as well. The organization's leaders need to be role models for the actions of the organization. Their commitment to IPPD is critical to its success in the organization. They must clearly communicate their expectations for the organization's projects and integrated teams and what the projects and integrated teams can expect from management.&lt;/P&gt;&lt;br /&gt;&lt;P&gt;&lt;TABLE CELLSPACING="0" FRAME="void" RULES="groups" CELLPADDING="5" WIDTH="100%"&gt;&lt;br /&gt;&lt;CAPTION&gt;&lt;h5 class="docTableTitle"&gt;Table . Practice-to-Goal Relationship Table&lt;/h5&gt;&lt;/CAPTION&gt;&lt;COLGROUP align="left" span="2"&gt;&lt;br /&gt;&lt;THEAD&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TH class="docTableHeader" align="left" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;span class="docEmphBoldItalic"&gt;Continuous Representation&lt;/span&gt;&lt;/P&gt;&lt;br /&gt;&lt;/TH&gt;&lt;br /&gt;&lt;TH class="docTableHeader" align="left" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;span class="docEmphBoldItalic"&gt;Staged Representation&lt;/span&gt;&lt;/P&gt;&lt;br /&gt;&lt;/TH&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;/THEAD&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;SG 1 Provide IPPD Infrastructure&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;SG 1 Provide IPPD Infrastructure&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;SP 1.1-1 Establish the Organization's Shared Vision&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;SP 1.1-1 Establish the Organization's Shared Vision&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;SP 1.2-1 Establish an Integrated Work Environment&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;SP 1.2-1 Establish an Integrated Work Environment&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;SP 1.3-1 Identify IPPD-Unique Skill Requirements&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;SP 1.3-1 Identify IPPD-Unique Skill Requirements&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;SG 2 Manage People for Integration&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;SG 2 Manage People for Integration&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;SP 2.1-1 Establish Leadership Mechanisms&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;SP 2.1-1 Establish Leadership Mechanisms&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;SP 2.2-1 Establish Incentives for Integration&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;SP 2.2-1 Establish Incentives for Integration&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;SP 2.3-1 Establish Mechanisms to Balance Team and Home Organization Responsibilities&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;SP 2.3-1 Establish Mechanisms to Balance Team and Home Organization Responsibilities&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;GG 1 Achieve Specific Goals&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&amp;nbsp;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;GP 1.1 Perform Base Practices&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&amp;nbsp;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;GG 2 Institutionalize a Managed Process&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;GG 3 Institutionalize a Defined Process&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;GP 2.1 Establish an Organizational Policy&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;GP 2.1  Establish an Organizational Policy&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;GP 2.2 Plan the Process&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;GP 2.2 Plan the Process&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;GP 2.3 Provide Resources&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;GP 2.3 Provide Resources&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;GP 2.4 Assign Responsibility&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;GP 2.4 Assign Responsibility&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;GP 2.5 Train People&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;GP 2.5 Train People&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;GP 2.6 Manage Configurations&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;GP 2.6 Manage Configurations&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;GP 2.7 Identify and Involve Relevant Stakeholders&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;GP 2.7 Identify and Involve Relevant Stakeholders&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;GP 2.8 Monitor and Control the Process&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;GP 2.8 Monitor and Control the Process&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;GP 2.9 Objectively Evaluate Adherence&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;GP 2.9 Objectively Evaluate Adherence&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;GP 2.10 Review Status with Higher Level Management&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;GP 2.10 Review Status with Higher Level Management&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;GG 3 Institutionalize a Defined Process&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&amp;nbsp;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;GP 3.1 Establish a Defined Process&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;GP 3.1 Establish a Defined Process&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;GP 3.2 Collect Improvement Information&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;GP 3.2 Collect Improvement Information&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;GG 4 Institutionalize a Quantitatively Managed Process&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&amp;nbsp;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;GP 4.1 Establish Quantitative Objectives for the Process&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&amp;nbsp;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;GP 4.2 Stabilize Subprocess Performance&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&amp;nbsp;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;GG 5 Institutionalize an Optimizing Process&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&amp;nbsp;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;GP 5.1 Ensure Continuous Process Improvement&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&amp;nbsp;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" align="left" valign="top"&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;GP 5.2 Correct Root Causes of Problems&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&amp;nbsp;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;/COLGROUP&gt;&lt;br /&gt;&lt;/TABLE&gt;&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;The organization's shared vision needs to be grounded in reality. Organizations may be tempted to include in their shared vision broad statements about integrated teaming and employee empowerment. It is more important, however, to use the shared vision to set reasonable expectations on the rate of change in an organization. Unrealistic proclamations can transform the shared vision into a source of frustration and cause the organization to retreat from it after initial pilot demonstrations.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;The organization's shared vision should be articulated in sufficient detail to provide criteria against which the shared visions of the projects and integrated teams can be aligned. For example, the organization's shared vision should address the use of integrated teams for projects, the focus on the customer, and the concurrent development of both product-related life-cycle processes and the product. These concepts, in turn, should be reflected in the shared visions of the projects and integrated teams. Guidelines for how projects and integrated teams should develop their shared visions should be made part of the organization's process asset library.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Maintenance of the organization's shared vision involves evaluating its use and currency. Results of evaluations may indicate the need to update the organization's shared vision or to establish and maintain organizational practices and structures that implement the shared vision.&lt;/P&gt;&lt;br /&gt;&lt;H5 class="docSection4Title"&gt; Typical Work Products&lt;/H5&gt;&lt;br /&gt;&lt;span style="font-weight:bold"&gt;&lt;OL class="docList" TYPE="1"&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Organization's shared vision&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Evaluations of the organization's shared vision&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Guidelines for shared vision building within projects and integrated teams&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;/OL&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;H5 class="docSection4Title"&gt; Subpractices&lt;/H5&gt;&lt;br /&gt;&lt;span style="font-weight:bold"&gt;&lt;OL class="docList" TYPE="1"&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Identify expectations, constraints, interfaces, and boundary conditions applicable to the organization's shared vision.&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Create a shared vision for the organization.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;The shared vision can include what the people in the organization can expect from the organization (e.g., some organizations have developed an "employees' bill of rights").&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Communicate the shared vision both externally and internally.&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Ensure that organizational practices and structures are aligned with the shared vision.&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Periodically review the shared vision and update it as necessary.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;Reexamine the shared vision to determine weaknesses and misunderstood parts. Revise the shared vision to improve its clarity and applicability to the current state of the organization. Periodically reinforce the clarity and reality of the shared vision.&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Provide guidelines for shared vision building for use by projects and integrated teams.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;These guidelines should establish the context for the shared visions of the projects and integrated teams.&lt;/P&gt;&lt;P class="docList"&gt;Shared visions of the projects should be focused on product and contribute to achievement of the organization's shared vision. Shared visions of the projects could relate the minimum competencies, or demonstrated capabilities, for people assigned to integrated teams, such as individual leadership capabilities. Proposed products, activities, partnerships, organizational and project structures, and shared visions of the projects are tested against the organization's shared vision.&lt;/P&gt;&lt;br /&gt;&lt;P class="docList"&gt;For the integrated teams, nurturing integration necessitates special attention to the objectives, values, and behaviors that are needed to affect integrated teamwork. Aspects, such as team operations, team behaviors, team responsibilities, and collaboration with interfacing teams, can be addressed.&lt;/P&gt;&lt;br /&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;/OL&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;H5 class="docSection3Title"&gt;SP 1.2-1 Establish an Integrated Work Environment&lt;/H5&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;span class="docEmphasis"&gt;Establish and maintain an integrated work environment that supports &lt;span class="docEmphasis"&gt;IPPD&lt;/span&gt; by enabling collaboration and concurrent development.&lt;/span&gt;&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;An integrated work environment includes the physical infrastructure (e.g., facilities, tools, equipment, and support needed to effectively use them) that people need to perform their jobs effectively. Properly functioning environments help people communicate clearly and efficiently about the product, processes, people needs, and organization. An integrated work environment helps integrate the business and technical functions and the interfaces among teams, projects, and organizations.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;The integrated work environment must accommodate both collocated and distributed integrated teams as required. Two-way communications media should be easily accessible by all relevant stakeholders.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Encouraging open dialogue by providing communication mechanisms enables everyone to effectively engage in and contribute to information sharing. Appropriate mechanisms might include meeting rooms, email, fax, FTP or Web sites, video teleconferencing capabilities, and others depending on the organization's culture and its project and integrated team preferences for efficient and effective information sharing. The types of information needed, which agents (projects, integrated teams, or individuals), and how many of them produce, own, and need that information should be considered in deciding the mechanisms to be used.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Integrated communication tool sets reduce time spent converting information from one medium or platform to another, and correcting transcriptions or misunderstandings when people do the conversions. Requirements for product and process information usability throughout the life of the product are important characteristics to consider in the selection of information-exchange tools. In an IPPD environment, it is particularly important that the tools for designing and developing the product-related life-cycle processes are integrated with the tools for designing and developing the product and product components.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Integrated work environments are developed with the same, or greater, rigor as that used to develop a specific product or service. Integrated work environments are capital assets that are often expensive, have unique implementations, are irreversible (their implementation can destroy or make unusable the assets being replaced), and whose modification disrupts ongoing activities. The rigor appropriate to the development should be matched to the magnitude of the needs to be resolved and the deployment risks.&lt;/P&gt;&lt;br /&gt;&lt;H5 class="docSection4Title"&gt; Typical Work Products&lt;/H5&gt;&lt;br /&gt;&lt;span style="font-weight:bold"&gt;&lt;OL class="docList" TYPE="1"&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Requirements for the integrated work environment&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Design of the integrated work environment&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Integrated work environment&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;/OL&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;H5 class="docSection4Title"&gt; Subpractices&lt;/H5&gt;&lt;br /&gt;&lt;span style="font-weight:bold"&gt;&lt;OL class="docList" TYPE="1"&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Determine requirements for the integrated work environment.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;Requirements for the integrated work environment are typically based on the following:&lt;/P&gt;&lt;UL&gt;&lt;br /&gt;&lt;LI&gt;&lt;P class="docList"&gt;The organization's set of standard processes&lt;/P&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;P class="docList"&gt;The objectives of the organization articulated in the organization's shared vision&lt;/P&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;P class="docList"&gt;The needs associated with developing, maintaining, and delivering the products and services of the organization&lt;/P&gt;&lt;/LI&gt;&lt;br /&gt;&lt;/UL&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Regularly evaluate the effectiveness of the existing environment and forecast the need for additional, upgraded, or new tools or integrated work environment components.&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Maintain awareness of current and emerging technologies, tools, and resources that are related to the integrated work environment.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;Maintaining awareness may be accomplished through industry journals, professional societies, conferences, trade shows, or benchmarking.&lt;/P&gt;&lt;P&gt;&lt;TABLE CELLSPACING="0" WIDTH="90%" BORDER="1"&gt;&lt;TR&gt;&lt;TD&gt;&lt;P class="docText"&gt;Examples of technologies, tools, and resources include the following:&lt;/P&gt;&lt;br /&gt;&lt;UL&gt;&lt;br /&gt;&lt;LI&gt;&lt;P class="docList"&gt;Computing resources and software productivity tools&lt;/P&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;P class="docList"&gt;Communications systems, tools, and resources&lt;/P&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;P class="docList"&gt;Communication tools (e.g., email, telephone, databases, archives)&lt;/P&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;P class="docList"&gt;Manufacturing and production facilities&lt;/P&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;P class="docList"&gt;Engineering or simulation tools&lt;/P&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;P class="docList"&gt;Proprietary engineering tools&lt;/P&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;P class="docList"&gt;Prototyping or production equipment&lt;/P&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;P class="docList"&gt;Work space&lt;/P&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;P class="docList"&gt;Office equipment and supplies&lt;/P&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;P class="docList"&gt;Raw or stock input materials&lt;/P&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;P class="docList"&gt;Transportation resources&lt;/P&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;P class="docList"&gt;"Hotlines" and "help desks"&lt;/P&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;P class="docList"&gt;Information brokerage services&lt;/P&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;P class="docList"&gt;Support staff and/or services&lt;/P&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;P class="docList"&gt;Information-technology capabilities&lt;/P&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;P class="docList"&gt;Process enactment and management tools&lt;/P&gt;&lt;/LI&gt;&lt;br /&gt;&lt;/UL&gt;&lt;br /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;&lt;/P&gt;&lt;br /&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Plan, design, and implement an integrated work environment.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;The critical aspects of the work environment are, like any other system, requirements driven. Work environment functionality (stimulated by customer needs and requirements) is explored with the same rigor as any other system development. Are the performance improvements (e.g., timely interoperable communications, safety, security, maintainability) worth the costs (e.g., capital outlays, training, support structure, disassembly and disposal of existing environments, performance and maintenance of the environment) and risks (e.g., workflow and project disruptions)?&lt;/P&gt;&lt;P class="docList"&gt;Requirements are developed for the duration of the work environment and address, as appropriate, the three different cases for work environment improvements: developing a new environment, migrating an existing environment to new capabilities, and maintaining awareness of new and evolving technologies to exploit improvement opportunities. As required, the integrated work environment or some of its components can be developed in house or acquired from external sources.&lt;/P&gt;&lt;br /&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Provide ongoing maintenance and operational support for the integrated work environment.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;Maintenance and support of the integrated work environment can be accomplished either with capabilities found inside the organization or hired from outside the organization.&lt;/P&gt;&lt;P&gt;&lt;TABLE CELLSPACING="0" WIDTH="90%" BORDER="1"&gt;&lt;TR&gt;&lt;TD&gt;&lt;P class="docText"&gt;Examples of maintenance and support methods include the following:&lt;/P&gt;&lt;br /&gt;&lt;UL&gt;&lt;br /&gt;&lt;LI&gt;&lt;P class="docList"&gt;Hiring people to perform the maintenance and support&lt;/P&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;P class="docList"&gt;Training people to perform the maintenance and support&lt;/P&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;P class="docList"&gt;Contracting the maintenance and support&lt;/P&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;P class="docList"&gt;Developing expert users for selected automation tools&lt;/P&gt;&lt;/LI&gt;&lt;br /&gt;&lt;/UL&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;&lt;/P&gt;&lt;br /&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Monitor and evaluate the adequacy of the integrated work environment to satisfy user needs.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;&lt;span class="docEmphasis"&gt;Refer to the Project Monitoring and Control process area for more information about practices for monitoring and controlling the work environment.&lt;/span&gt;&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;The work environment should be monitored throughout its existence to ascertain if, and when, its performance degrades below that expected (or specified) as well as to identify opportunities for improvements. The key operating characteristics of the integrated work environment should be identified. The key operating characteristics are those performance, product, and process characteristics that can be measured and compared against expected capabilities of the integrated work environment. End users should be surveyed to determine the adequacy of the current environment and to identify potential improvements. Changes should be planned and implemented based on the analysis of usage and performance data and on identified real and potential problems.&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Revise the integrated work environment as necessary, by adding, deleting, or replacing components.&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;/OL&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;H5 class="docSection3Title"&gt;SP 1.3-1 Identify IPPD-Unique Skill Requirements&lt;/H5&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;span class="docEmphasis"&gt;Identify the unique skills needed to support the &lt;span class="docEmphasis"&gt;IPPD&lt;/span&gt; environment.&lt;/span&gt;&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;span class="docEmphasis"&gt;Refer to the Organizational Training process area for more information about determining training needs and delivering the training.&lt;/span&gt;&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;IPPD is a sufficiently different view of product development that the organization's leadership and workforce will need to develop new skills. IPPD requires integrative leadership, and interpersonal skills beyond those typically found in traditional environments where people tend to work alone or primarily interact with others from their own, or similar, functions or disciplines. Specific skills emphasized in an IPPD environment include the following:&lt;/P&gt;&lt;br /&gt;&lt;UL&gt;&lt;br /&gt;&lt;LI&gt;&lt;P class="docList"&gt;The skills to integrate all appropriate business and technical functions and their processes&lt;/P&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;P class="docList"&gt;The interpersonal skills to coordinate and collaborate with others&lt;/P&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;P class="docList"&gt;The leadership skills to act, and successfully influence others to act, to achieve the shared vision&lt;/P&gt;&lt;/LI&gt;&lt;br /&gt;&lt;/UL&gt;&lt;br /&gt;&lt;P class="docText"&gt;Training to support these new skills must be established and maintained to sustain the ongoing adoption of IPPD in the organization.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Each integrated team member needs to understand what is vital to other team members in terms of product characteristics and the descriptions, expectations, and interfaces of the processes associated with the other functions represented on the team. This understanding can often be augmented through cross training of individuals across their function or discipline boundaries.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Collaboration among integrated team members is essential to create a team product rather than a collection of independent products. Enhanced interpersonal skills can help bridge the differences among disparate functions and disciplines as well as the differences in cultures, values, and backgrounds.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Leadership demands also increase under IPPD. Leadership challenges include: ensuring that all team members mutually understand their roles and responsibilities; employing people in their intended roles; and effectively accessing the depth and wealth of specific expertise resident in the organization and integrating it into the overall integrated team effort.&lt;/P&gt;&lt;br /&gt;&lt;H5 class="docSection4Title"&gt; Typical Work Products&lt;/H5&gt;&lt;br /&gt;&lt;span style="font-weight:bold"&gt;&lt;OL class="docList" TYPE="1"&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;IPPD strategic training needs&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;IPPD tactical training needs&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;/OL&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;H5 class="docSection4Title"&gt; Subpractices&lt;/H5&gt;&lt;br /&gt;&lt;span style="font-weight:bold"&gt;&lt;OL class="docList" TYPE="1"&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Provide requirements for IPPD skills for inclusion in the organization's strategic training needs.&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Provide requirements for IPPD skills for inclusion in the organization's tactical training plan.&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;/OL&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;H4 class="docSection2Title"&gt;SG 2 Manage People for Integration&lt;/H4&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;span class="docEmphasis"&gt;People are managed to nurture the integrative and collaborative behaviors of an &lt;span class="docEmphasis"&gt;IPPD&lt;/span&gt; environment.&lt;/span&gt;&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;In an IPPD environment, special attention needs to be paid to aspects of organizational leadership and management. Nurturing integration necessitates focus on the objectives, values, and behaviors that are needed to affect integrated teamwork. The organization establishes the IPPD guidelines and processes that become part of the organization's set of standard processes and the project's defined process. The organization's standard processes enable, promote, and reinforce the integrative behaviors expected from projects, integrated teams, and people. For all IPPD processes and guidelines, people are recognized not as the tools or means to the end, but as part of a mutually beneficial collaboration to achieve the objectives.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;In stimulating the integration needed, team-related incentives may be appropriate for people who work together. However, the value of individual excellence should not be overlooked. A balanced approach that addresses both individual performance as well as team performance would help maintain high standards of both team and individual achievement. Expectations from projects, integrated teams, and people are typically communicated in the form of policies, operating procedures, guidelines, and other organizational process assets.&lt;/P&gt;&lt;br /&gt;&lt;H5 class="docSection3Title"&gt;SP 2.1-1 Establish Leadership Mechanisms&lt;/H5&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;span class="docEmphasis"&gt;Establish and maintain leadership mechanisms to enable timely collaboration.&lt;/span&gt;&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Implementing IPPD introduces challenges to leadership because of the cultural changes required when people and integrated teams are empowered and decisions are driven to the lowest level appropriate. Effective and efficient communication mechanisms are critical to timely and sound decision making in the integrated work environment. Once an integrated work environment is established and training is provided, mechanisms to handle empowerment, decision making, and issue resolution also need to be provided to affect the timely collaboration of relevant stakeholders required for IPPD.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;In an IPPD environment, it is particularly important that clear channels of responsibility and authority be established. Within the projects and the organization, issues can arise when individuals or integrated teams assume too much or too little authority and when the level at which decisions are made, or who owns what decisions, is unclear. Organizational guidelines that scope the degree of empowerment for integrated teams serve an issue-prevention role. Best practices promote documented and deployed organizational guidelines that can preclude issues arising from empowerment and authority misinterpretation.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Empowerment does not necessarily mean that every decision in an IPPD environment must occur at the lowest level, that it must be done collaboratively, or even that it must reflect consensus among all integrated team members or project participants. Decisions on the style and procedures for leadership and decision making for projects and among integrated teams need to be made in collaboration with the relevant stakeholders. In establishing the context for decision making, the various kinds of issues are described and agreements are reached on the decision type that will be used to resolve each kind of issue.&lt;/P&gt;&lt;br /&gt;&lt;P&gt;&lt;TABLE CELLSPACING="0" WIDTH="90%" BORDER="1"&gt;&lt;TR&gt;&lt;TD&gt;&lt;br /&gt;&lt;P class="docText"&gt;Some examples of decision types include the following:&lt;/P&gt;&lt;br /&gt;&lt;UL&gt;&lt;br /&gt;&lt;LI&gt;&lt;p class="docText"&gt;&lt;span class="docEmphasis"&gt;Command.&lt;/span&gt; &lt;br /&gt;The leader examines the issue and makes a decision alone.&lt;/p&gt;&lt;br /&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;p class="docText"&gt;&lt;span class="docEmphasis"&gt;Consultative.&lt;/span&gt; &lt;br /&gt;The leader receives and examines inputs on the issue from relevant stakeholders and makes the decision.&lt;/p&gt;&lt;br /&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;p class="docText"&gt;&lt;span class="docEmphasis"&gt;Collaborative.&lt;/span&gt; &lt;br /&gt;Issues are raised by any relevant stakeholders (including the leader), issues are discussed, and solutions are voted on. Rules are needed to determine whether this vote is binding on the leader.&lt;/p&gt;&lt;br /&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;p class="docText"&gt;&lt;span class="docEmphasis"&gt;Consensus.&lt;/span&gt; &lt;br /&gt;Issues are raised by any relevant stakeholders, including the leader, and are discussed until all members of the integrated team can live with and support the decision.&lt;/p&gt;&lt;br /&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;p class="docText"&gt;&lt;span class="docEmphasis"&gt;Structured.&lt;/span&gt; &lt;br /&gt;Major issues may be decided using formal evaluations. The steps in formal evaluations may be carried out in a collaborative way.&lt;/p&gt;&lt;br /&gt;&lt;/LI&gt;&lt;br /&gt;&lt;/UL&gt;&lt;br /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;For many issues, a command decision may be adequate. For issues that require several different areas of expertise or that have far-reaching consequences, collaborative decisions may be more appropriate. Defining decision types and the authority of those entrusted to make decisions enables efficient operations.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Mechanisms that grow leadership talent enable lower organizational unit delegation, which, in turn, enables faster, better responses to changing customer needs, technology, and environmental conditions.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Leadership characteristics cannot be viewed as solely embodied in the manager/leader. When leadership characteristics are evident in more than the leader, individual group members lead decision making and activities that heavily involve their areas of expertise. This flexibility can result in improved group efficiency and effectiveness.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Even with well-intentioned empowerment, leadership, and decision making, issues will arise that cannot be resolved at the same level. An organizational process for issue resolution can form the basis for project-and integrated-team-specific procedures and help ensure that basic issue-resolution avenues are available to projects and integrated teams when unresolved issues must be escalated. An organizational process for issue resolution can serve both issue-resolution and issue-prevention roles.&lt;/P&gt;&lt;br /&gt;&lt;H5 class="docSection4Title"&gt; Typical Work Products&lt;/H5&gt;&lt;br /&gt;&lt;span style="font-weight:bold"&gt;&lt;OL class="docList" TYPE="1"&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Guidelines for determining the degree of empowerment of people and integrated teams&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Guidelines for setting leadership and decision-making context&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Organizational process documentation for issue resolution&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;/OL&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;H5 class="docSection4Title"&gt; Subpractices&lt;/H5&gt;&lt;br /&gt;&lt;span style="font-weight:bold"&gt;&lt;OL class="docList" TYPE="1"&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Establish and maintain guidelines for the degree of empowerment provided to people and integrated teams.&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Collaboratively determine rules for the use of different decision types in making various kinds of decisions.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;&lt;span class="docEmphasis"&gt;Refer to the Decision Analysis and Resolution process area for more information about approaches for evaluating and selecting among alternatives.&lt;/span&gt;&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Define the process for using the decision-making rules.&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Define a process for conflict resolution when an issue cannot be decided at the level at which it arose.&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;/OL&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;H5 class="docSection3Title"&gt;SP 2.2-1 Establish Incentives for Integration&lt;/H5&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;span class="docEmphasis"&gt;Establish and maintain incentives for adopting and demonstrating integrative and collaborative behaviors at all levels of the organization.&lt;/span&gt;&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;The recognition and reward systems in an organization are one of the motivators for behavior and value changes. To support IPPD, the recognition and reward systems (both positive rewards and negative consequences) need to recognize a shift in values from a single point of success or failure (e.g., providing a management incentive package to the product or program manager alone) to integrated team success or failure (e.g., providing layered incentives to integrated team members based on degree of involvement and contribution).&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Individual excellence still should be recognized, but criteria should discern whether such excellence was achieved at the expense of the integrative behaviors expected or in support of them. For example, individuals (such as leaders) removing integration barriers or implementing collaboration capabilities may be just as important as an integrated team performing well. Care should be taken, however, not to single out individuals for recognition for a team's achievement.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Incentives should be consistent with the objectives of the organization and applied to achieve desired behavior at all levels of the organization. Criteria can establish guidelines for the reassignment of people who are unable to demonstrate desired behavior and the selection of people who can exhibit desired behavior for challenging or important jobs.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Compensation is not the only motivator, although giving an object of some value is an appropriate recognition. Reinforcement of positive behavior via thanks or praise is usually appropriate, especially soon after the observed performance of a task. Such immediate recognition reinforces the collaborative nature of working in an IPPD environment. If staff must wait for yearly performance appraisals, their motivation for working outside of their strict functional job description is lessened.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;The yearly performance appraisals also need to be addressed. Review mechanisms should be structured so that both home organization supervisors and team leaders contribute to a person's performance review.&lt;/P&gt;&lt;br /&gt;&lt;H5 class="docSection4Title"&gt; Typical Work Products&lt;/H5&gt;&lt;br /&gt;&lt;span style="font-weight:bold"&gt;&lt;OL class="docList" TYPE="1"&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Policies and procedures for performance appraisal and recognition that reinforce collaboration&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Integrated team and individual recognition and rewards&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;/OL&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;H5 class="docSection4Title"&gt; Subpractices&lt;/H5&gt;&lt;br /&gt;&lt;span style="font-weight:bold"&gt;&lt;OL class="docList" TYPE="1"&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Structure the recognition and reward system to be consistent with the IPPD environment.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;The organization's recognition and reward system should recognize the value of individual and integrated team excellence and enable, promote, and reinforce integration.&lt;/P&gt;&lt;/P&gt;&lt;br /&gt;&lt;/BLOCKQUOTE&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Develop guidelines for team as well as individual recognition.&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Define procedures for integrated review processes that involve both the integrated team leader and the functional manager.&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Establish criteria for distinguishing behaviors that promote integrated team performance from those that establish barriers to team behaviors.&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;/OL&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;H5 class="docSection3Title"&gt;SP 2.3-1 Establish Mechanisms to Balance Team and Home Organization Responsibilities&lt;/H5&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;span class="docEmphasis"&gt;Establish and maintain organizational guidelines to balance team and home organi zation responsibilities.&lt;/span&gt;&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Here "home organization" refers to that part of the organization to which personnel are assigned when they are not in an integrated team. This home organization may be called the "functional organization," "home base," "home office," or "direct organization." Regardless of what it is called, it is often responsible for the career growth of the personnel assigned to it (e.g., performance appraisals and training to maintain functional and discipline expertise). In an IPPD environment, reporting procedures and rating systems should recognize that people's responsibility is focused on the integrated team, not on the traditional home organization. A balance must be struck, however, because the responsibility of integrated team members to their respective home organizations is still important, specifically for process implementation and improvement. Workloads should be balanced among projects and functions, while ensuring career growth and advancement. Mechanisms should be created that support the home organization responsibility but align the workforce to meet business objectives in a teaming environment.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Striking this balance is difficult for an organization but exceedingly important for the personnel and the success of IPPD implementation. The balance must be reflected in the personal or career development plans for each individual. The knowledge and skills needed for an individual to succeed in both their functional and integrated team role should be honed, taking into account current and future assignments.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Guidelines should also be in place for disbanding teams and maintaining home organizations. It has been observed that sometimes teams attempt to remain in place beyond their productive life in organizations that do not have a home organization for the team members to report back to after the team is dissolved.&lt;/P&gt;&lt;br /&gt;&lt;H5 class="docSection4Title"&gt; Typical Work Products&lt;/H5&gt;&lt;br /&gt;&lt;span style="font-weight:bold"&gt;&lt;OL class="docList" TYPE="1"&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Organizational guidelines for balancing team and home organization responsibilities&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Performance review process that considers both functional supervisor and team leader input&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;/OL&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;H5 class="docSection4Title"&gt; Subpractices&lt;/H5&gt;&lt;br /&gt;&lt;span style="font-weight:bold"&gt;&lt;OL class="docList" TYPE="1"&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Establish guidelines for home organization responsibilities in promoting integrated team behavior.&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Establish guidelines for team management responsibilities to ensure integrated team members report appropriately to their home organization.&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Establish a performance review process that considers input from home organization and integrated team leaders.&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;/OL&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;td&gt;&lt;/td&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;td class="tt1"&gt;[ Team LiB ]&lt;/td&gt;&lt;td valign="top" class="tt1" align="right"&gt;&lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;&lt;/td&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7284850559043997789-6459262637981172341?l=cs20001.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cs20001.blogspot.com/feeds/6459262637981172341/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7284850559043997789&amp;postID=6459262637981172341' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/6459262637981172341'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/6459262637981172341'/><link rel='alternate' type='text/html' href='http://cs20001.blogspot.com/2010/02/specific-practices-by-goal.html' title='Specific Practices by Goal'/><author><name>rong889</name><uri>http://www.blogger.com/profile/06593146008221514057</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7284850559043997789.post-4878052712020761361</id><published>2010-02-04T05:29:00.017-08:00</published><updated>2010-02-04T05:29:24.387-08:00</updated><title type='text'>Day 17</title><content type='html'>&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;td class="tt1"&gt;[ Team LiB ]&lt;/td&gt;&lt;td valign="top" class="tt1" align="right"&gt;&lt;br /&gt;	&lt;br /&gt;	&lt;br /&gt;&lt;/td&gt;&lt;/table&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;H3 class="docSection1Title"&gt; Day 17&lt;/H3&gt;&lt;br /&gt;&lt;P&gt;&lt;TABLE BORDER="0" cellspacing="16" cellpadding="0"&gt;&lt;TR valign="top"&gt;&lt;TD align="right" class="docText"&gt;&lt;B&gt;1:&lt;br /&gt;                              &lt;/B&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P class="docText"&gt;To create a new table by importing IXF data, which import mode should you use?&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR valign="top"&gt;&lt;TD align="right" class="docText"&gt;&lt;B&gt;A1:&lt;br /&gt;                        &lt;/B&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P class="docText"&gt;You must use the &lt;TT&gt;CREATE&lt;/TT&gt; import mode to create a new table when importing IXF data.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR valign="top"&gt;&lt;TD align="right" class="docText"&gt;&lt;B&gt;2:&lt;br /&gt;                              &lt;/B&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P class="docText"&gt;If you want to create a new table, what format should you use? Would you use the Load Wizard or the Import Wizard to create a new table?&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR valign="top"&gt;&lt;TD align="right" class="docText"&gt;&lt;B&gt;A2:&lt;br /&gt;                        &lt;/B&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P class="docText"&gt;Integrated exchange format (IXF) is used to create a new table; the DEL, ASC, and WSF formats can be used only to import data into an existing table. IXF format is the format used by database managers. Load doesn't support creating a new table; the table must exist before you can load data into it. To create a new table, use the Import utility.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR valign="top"&gt;&lt;TD align="right" class="docText"&gt;&lt;B&gt;3:&lt;br /&gt;                              &lt;/B&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P class="docText"&gt;How do you export only a subset of the data in a table?&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR valign="top"&gt;&lt;TD align="right" class="docText"&gt;&lt;B&gt;A3:&lt;br /&gt;                        &lt;/B&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P class="docText"&gt;Click the Columns tab in the Export dialog box to specify only a subset of the columns to export. Exporting a subset of columns is supported only when using WSF or IXF formats.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR valign="top"&gt;&lt;TD align="right" class="docText"&gt;&lt;B&gt;4:&lt;br /&gt;                              &lt;/B&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P class="docText"&gt;What must take place before you can save a copy of the changes when using the Load Wizard?&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR valign="top"&gt;&lt;TD align="right" class="docText"&gt;&lt;B&gt;A4:&lt;br /&gt;                        &lt;/B&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P class="docText"&gt;Forward recovery must be turned on to enable you to save a copy of the changes when using the Load utility. On the Copy Options page of the Load Wizard, specify that a copy of the changes be saved.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;td&gt;&lt;/td&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;td class="tt1"&gt;[ Team LiB ]&lt;/td&gt;&lt;td valign="top" class="tt1" align="right"&gt;&lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;&lt;/td&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7284850559043997789-4878052712020761361?l=cs20001.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cs20001.blogspot.com/feeds/4878052712020761361/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7284850559043997789&amp;postID=4878052712020761361' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/4878052712020761361'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/4878052712020761361'/><link rel='alternate' type='text/html' href='http://cs20001.blogspot.com/2010/02/day-17.html' title='Day 17'/><author><name>rong889</name><uri>http://www.blogger.com/profile/06593146008221514057</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7284850559043997789.post-9131677862531484983</id><published>2010-02-04T05:29:00.015-08:00</published><updated>2010-02-04T05:29:23.391-08:00</updated><title type='text'>The Unbearable Lightness of False Positives</title><content type='html'>&lt;br /&gt;&lt;br /&gt;&lt;div class=Section1&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;&lt;span lang=EN-GB style='font-size:15.0pt;font-family:Arial'&gt;The Unbearable&lt;br /&gt;Lightness of False Positives&lt;/span&gt;&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class=doctext&gt;&lt;span lang=EN-GB&gt;The temptation when you get access to a&lt;br /&gt;powerful new toy, er, tool like Snort is to overuse it. At first you will turn&lt;br /&gt;on every single rule. You will set them to the detailed alert mode. You will&lt;br /&gt;have the alerts send you pages on your cell phone. Don't!&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class=doctext&gt;&lt;span lang=EN-GB&gt;The rule library is very conservative. Many&lt;br /&gt;of the rules will be triggered by ordinary activity on a large and complex&lt;br /&gt;network. You will be paged perpetually. These events are called &lt;span&lt;br /&gt;class=docemphasis1&gt;false positives.&lt;/span&gt; The real problem with them is not&lt;br /&gt;that you will be pestered and hounded but that you might raise so many things&lt;br /&gt;to an alert level that you will miss the real cracking attempts because you are&lt;br /&gt;buried up to your eyes in employees accessing E-bay.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class=doctext&gt;&lt;span lang=EN-GB&gt;Another mistake is to use the rule libraries&lt;br /&gt;without giving any thought to the details of your environment. If you use only&lt;br /&gt;Apache Web servers, you probably don't need the rules in &lt;span&lt;br /&gt;class=docemphasis1&gt;web-iis.rules.&lt;/span&gt; Are you using Snort on a single box to&lt;br /&gt;watch for attempts to break into just that box, or are you using it in your DMZ&lt;br /&gt;to watch all attempts to get through your firewall?&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class=doctext&gt;&lt;span lang=EN-GB&gt;I haven't got room to tell you how to design&lt;br /&gt;an intrusion-detection system. I'm just showing you the basics of Snort.&lt;br /&gt;Remember that while the tool may be one-size-fits-all, you do actually have to&lt;br /&gt;pull in the drawstrings if you are going to keep the rain out.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class=doctext&gt;&lt;span lang=EN-GB&gt;Keep some of these elements in mind when you&lt;br /&gt;are figuring out how to fit Snort into your setup:&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class=doclist&gt;&lt;span lang=EN-GB&gt;How many networks, hosts, routers do I want&lt;br /&gt;to watch?&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class=doclist&gt;&lt;span lang=EN-GB&gt;What potentially vulnerable services do I&lt;br /&gt;want to monitor?&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class=doclist&gt;&lt;span lang=EN-GB&gt;Do I or can I trust my internal hosts?&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class=doclist&gt;&lt;span lang=EN-GB&gt;How many &amp;quot;ports of entry&amp;quot; do I&lt;br /&gt;have, and can Snort see them all?&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class=doclist&gt;&lt;span lang=EN-GB&gt;How much computer power do I need? Snort can&lt;br /&gt;easily watch a 28.8-kbps PPP link running on a 486, but to watch an&lt;br /&gt;asynchronous transfer mode (ATM) router you might need a bit more than that.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class=doctext&gt;&lt;span lang=EN-GB&gt;That's not an exhaustive list by any means. It's&lt;br /&gt;just the start of the sort of questions you must ask yourself when planning to&lt;br /&gt;deploy Snort or indeed any other IDS (intrusion-detection system) tool.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class=MsoNormal&gt;&lt;span lang=EN-GB&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7284850559043997789-9131677862531484983?l=cs20001.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cs20001.blogspot.com/feeds/9131677862531484983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7284850559043997789&amp;postID=9131677862531484983' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/9131677862531484983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/9131677862531484983'/><link rel='alternate' type='text/html' href='http://cs20001.blogspot.com/2010/02/unbearable-lightness-of-false-positives.html' title='The Unbearable Lightness of False Positives'/><author><name>rong889</name><uri>http://www.blogger.com/profile/06593146008221514057</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7284850559043997789.post-4366161824242204404</id><published>2010-02-04T05:29:00.013-08:00</published><updated>2010-02-04T05:29:20.459-08:00</updated><title type='text'>Summary</title><content type='html'>&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;td class="tt1"&gt;[ Team LiB ]&lt;/td&gt;&lt;td valign="top" class="tt1" align="right"&gt;&lt;br /&gt;	&lt;br /&gt;	&lt;br /&gt;&lt;/td&gt;&lt;/table&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td valign="top"&gt;&lt;H3 class="docSection1Title"&gt; Summary&lt;/H3&gt;&lt;br /&gt;&lt;P class="docText"&gt;In this chapter we have discussed one of the top tuning areas in DB2, Sorts. Sorts are used to return data either to online forms or applications in an ordered manner. Sometimes using a sort is the best method, but often sorts cause the biggest application performance problems. DB2 can use indexes to eliminate sorts if the columns being sorted are defined in the index in the appropriate order. DB2 v8 gives us a new DB CFG parameter, &lt;TT&gt;SHEAPTHRES_SHR&lt;/TT&gt;, with which to control the amount of shared memory available for shared sorts. This gives us the ability to control shared sorts at the database level instead of at the instance level.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Database snapshots provide us with details on overall sort performance at the database level. Additional snapshots are available to provide us with additional information on sorts. Connection and statement event monitors are the primary means available to us for gathering data on sort consumption and aid us in tuning and eliminating sorts.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;The Design Advisor and Visual Explain are primary tools for us to use in tuning and eliminating sorts. Examples were provided where significant performance improvements were made, simply by using Design Advisor and knowledge of the application, to create or modify indexes to eliminate sorts.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Sort performance is probably a problem at your workplace. You can use the procedures and techniques outlined in this chapter to eliminate sorts and significantly enhance the performance of databases under your control.&lt;/P&gt;&lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;td&gt;&lt;/td&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;td class="tt1"&gt;[ Team LiB ]&lt;/td&gt;&lt;td valign="top" class="tt1" align="right"&gt;&lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;&lt;/td&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7284850559043997789-4366161824242204404?l=cs20001.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cs20001.blogspot.com/feeds/4366161824242204404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7284850559043997789&amp;postID=4366161824242204404' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/4366161824242204404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/4366161824242204404'/><link rel='alternate' type='text/html' href='http://cs20001.blogspot.com/2010/02/summary.html' title='Summary'/><author><name>rong889</name><uri>http://www.blogger.com/profile/06593146008221514057</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7284850559043997789.post-680573343270221408</id><published>2010-02-04T05:29:00.011-08:00</published><updated>2010-02-04T05:29:18.304-08:00</updated><title type='text'>Recipe 10.1. Using DBM Databases</title><content type='html'>&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;td align="right"&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;H3 id="title-IDASZSJ" class="docSection1Title"&gt;Recipe 10.1. Using DBM Databases&lt;/H3&gt;&lt;br /&gt;&lt;br /&gt;&lt;H4 id="title-IDAYZSJ" class="docSection2Title"&gt;10.1.1. Problem&lt;/H4&gt;&lt;br /&gt;&lt;p class="docText"&gt;You have &lt;br /&gt; &lt;br /&gt;data that can be easily represented as key/value pairs, want to store it safely, and have very fast lookups based on those keys.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;H4 id="title-IDAN0SJ" class="docSection2Title"&gt;10.1.2. Solution&lt;/h4&gt;&lt;br /&gt;&lt;p class="docText"&gt;Use the DBA abstraction layer to access a DBM-style database, as shown in Example 10-3.&lt;/p&gt;&lt;br /&gt;&lt;H5 id="title-IDA00SJ" class="docExampleTitle"&gt;Using a DBM database&lt;/H5&gt;&lt;p&gt;&lt;table cellspacing="0" width="90%" border="1" cellpadding="5"&gt;&lt;tr&gt;&lt;TD&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;?php&lt;br /&gt;$dbh = dba_open('fish.db','c','gdbm') or die($php_errormsg);&lt;br /&gt;&lt;br /&gt;// retrieve and change values&lt;br /&gt;if (dba_exists('flounder',$dbh)) {&lt;br /&gt;  $flounder_count = dba_fetch('flounder',$dbh);&lt;br /&gt;  $flounder_count++;&lt;br /&gt;  dba_replace('flounder',$flounder_count, $dbh);&lt;br /&gt;  print "Updated the flounder count.";&lt;br /&gt;} else {&lt;br /&gt;  dba_insert('flounder',1, $dbh);&lt;br /&gt;  print "Started the flounder count.";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// no more tilapia&lt;br /&gt;dba_delete('tilapia',$dbh);&lt;br /&gt;&lt;br /&gt;// what fish do we have?&lt;br /&gt;for ($key = dba_firstkey($dbh);  $key !== false; $key = dba_nextkey($dbh)) {&lt;br /&gt;   $value = dba_fetch($key, $dbh);&lt;br /&gt;   print "$key: $value\n";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;dba_close($dbh);&lt;br /&gt;?&amp;gt;&lt;/pre&gt;&lt;BR&gt;&lt;br /&gt;&lt;br /&gt;&lt;/TD&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;H4 id="title-IDAE1SJ" class="docSection2Title"&gt;10.1.3. Discussion&lt;/h4&gt;&lt;br /&gt;&lt;p class="docText"&gt;PHP can support a few different kinds of DBM backends:  &lt;br /&gt;GDBM, NDBM, &lt;br /&gt;DB2 &lt;br /&gt;, DB3, &lt;br /&gt;DBM, and  &lt;br /&gt;CDB. The DBA abstraction layer lets you use the same functions on any DBM backend. All these backends store key/value pairs. You can iterate through all the keys in a database, retrieve the value associated with a particular key, and find if a particular key exists. Both the keys and the values are strings.&lt;/p&gt;&lt;br /&gt;&lt;p class="docText"&gt;The program in Example 10-4 maintains a list of usernames and passwords in a DBM database. The username is the first command-line argument, and the password is the second argument. If the given username already exists in the database, the password is changed to the given password; otherwise, the user and password combination are added to the database.&lt;/p&gt;&lt;br /&gt;&lt;h5 id="title-IDAI2SJ" class="docExampleTitle"&gt;Tracking users and passwords with a DBM database&lt;/H5&gt;&lt;p&gt;&lt;table cellspacing="0" width="90%" border="1" cellpadding="5"&gt;&lt;tr&gt;&lt;TD&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;?php&lt;br /&gt;$user = $_SERVER['argv'][1];&lt;br /&gt;$password = $_SERVER['argv'][2];&lt;br /&gt;&lt;br /&gt;$data_file = '/tmp/users.db';&lt;br /&gt;&lt;br /&gt;$dbh = dba_open($data_file,'c','gdbm') or die("Can't open db $data_file");&lt;br /&gt;&lt;br /&gt;if (dba_exists($user,$dbh)) {&lt;br /&gt;    print "User $user exists. Changing password.";&lt;br /&gt;} else {&lt;br /&gt;    print "Adding user $user.";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;dba_replace($user,$password,$dbh) or die("Can't write to database $data_file");&lt;br /&gt;&lt;br /&gt;dba_close($dbh);&lt;br /&gt;?&amp;gt;&lt;/pre&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="docText"&gt;The &lt;i&gt;dba_open( )&lt;/i&gt;  &lt;br /&gt;function returns a handle to a DBM file (or &lt;tt&gt;false&lt;/tt&gt; on error). It takes three arguments. The first is the filename of the DBM file. The second argument is the mode for opening the file. A mode of &lt;tt&gt;r&lt;/tt&gt; opens an existing database for read-only access, and &lt;tt&gt;w&lt;/tt&gt; opens an existing database for read-write access. The &lt;tt&gt;c&lt;/tt&gt; mode opens a database for read-write access and creates the database if it doesn't already exist. Last, &lt;tt&gt;n&lt;/tt&gt; does the same thing as &lt;tt&gt;c&lt;/tt&gt;, but if the database already exists, &lt;tt&gt;n&lt;/tt&gt; empties it. The third argument to &lt;i&gt;dba_open( )&lt;/i&gt; is which DBM handler to use; this example uses &lt;tt&gt;'gdbm&lt;/tt&gt;'. To find what DBM handlers are compiled into your PHP installation, look at the "DBA" section of the output from &lt;i&gt;phpinfo( )&lt;/i&gt;. The "Supported handlers" line gives you your choices.&lt;/p&gt;&lt;br /&gt;&lt;p class="docText"&gt;To find if a key has been set in a DBM database, use &lt;br /&gt;&lt;i&gt;dba_exists( )&lt;/i&gt;. It takes two arguments: a string key and a DBM filehandle. It looks for the key in the DBM file and returns &lt;tt&gt;true&lt;/tt&gt; if it finds the key (or &lt;tt&gt;false&lt;/tt&gt; if it doesn't). The &lt;i&gt;dba_replace( ) &lt;br /&gt;&lt;/i&gt; function takes three arguments: a string key, a string value, and a DBM filehandle. It puts the key/value pair into the DBM file. If an entry already exists with the given key, it overwrites that entry with the new value.&lt;/p&gt;&lt;br /&gt;&lt;p class="docText"&gt;To close a database, call &lt;I&gt;dba_close( ) &lt;br /&gt;&lt;/i&gt;. A DBM file opened with &lt;I&gt;dba_open( )&lt;/i&gt; is automatically closed at the end of a request, but you need to call &lt;i&gt;dba_close( )&lt;/I&gt; explicitly to close persistent connections created with  &lt;br /&gt;&lt;I&gt;dba_open( )&lt;/I&gt;.&lt;/P&gt;&lt;br /&gt;&lt;p class="docText"&gt;You can use &lt;i&gt;dba_firstkey( )&lt;/I&gt;  &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt;and &lt;i&gt;dba_nextkey( )&lt;/i&gt; to iterate through all the keys in a DBM file and &lt;I&gt;dba_fetch( )&lt;/I&gt; to retrieve the values associated with each key. The program in Example 10-5 calculates the total length of all passwords in a DBM file.&lt;/p&gt;&lt;br /&gt;&lt;h5 id="title-IDAT5SJ" class="docExampleTitle"&gt;Calculating password length with DBM&lt;/H5&gt;&lt;P&gt;&lt;table cellspacing="0" width="90%" border="1" cellpadding="5"&gt;&lt;TR&gt;&lt;td&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;?php&lt;br /&gt;$data_file = '/tmp/users.db';&lt;br /&gt;$total_length = 0;&lt;br /&gt;if (! ($dbh = dba_open($data_file,'r','gdbm'))) {&lt;br /&gt;    die("Can't open database $data_file");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$k = dba_firstkey($dbh);&lt;br /&gt;while ($k) {&lt;br /&gt;    $total_length += strlen(dba_fetch($k,$dbh));&lt;br /&gt;    $k = dba_nextkey($dbh);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;print "Total length of all passwords is $total_length characters.";&lt;br /&gt;&lt;br /&gt;dba_close($dbh);&lt;/pre&gt;&lt;BR&gt;&lt;br /&gt;&lt;br /&gt;&lt;/TD&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="docText"&gt;The &lt;i&gt;dba_firstkey( )&lt;/i&gt; function initializes &lt;tt&gt;$k&lt;/tt&gt; to the first key in the DBM file. Each time through the &lt;tt&gt;while&lt;/tt&gt; loop, &lt;I&gt;dba_fetch( )&lt;/i&gt; retrieves the value associated with key &lt;tt&gt;$k&lt;/tt&gt; and &lt;tt&gt;$total_length&lt;/tt&gt; is incremented by the length of the value (calculated with &lt;i&gt;strlen( )&lt;/I&gt;). With &lt;i&gt;dba_nextkey( )&lt;/i&gt;, &lt;tt&gt;$k&lt;/tt&gt; is set to the next key in the file.&lt;/p&gt;&lt;br /&gt;&lt;p class="docText"&gt;One way to store complex data in a DBM database is with &lt;i&gt;serialize( )&lt;/i&gt;. Example 10-6 stores structured user information in a DBM database by serializing the structure before storing it and unserializing when retrieving it.&lt;/p&gt;&lt;br /&gt;&lt;h5 id="title-IDA3ATJ" class="docExampleTitle"&gt;Storing structured data in a DBM database&lt;/h5&gt;&lt;p&gt;&lt;table cellspacing="0" width="90%" border="1" cellpadding="5"&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;?php&lt;br /&gt;$dbh = dba_open('users.db','c','gdbm') or die($php_errormsg);&lt;br /&gt;&lt;br /&gt;// read in and unserialize the data&lt;br /&gt;if ($exists = dba_exists($_POST['username'], $dbh)) {&lt;br /&gt;    $serialized_data = dba_fetch($_POST['username'], $dbh) or die($php_errormsg);&lt;br /&gt;    $data = unserialize($serialized_data);&lt;br /&gt;} else {&lt;br /&gt;    $data = array();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// update values&lt;br /&gt;if ($_POST['new_password']) {&lt;br /&gt;    $data['password'] = $_POST['new_password'];&lt;br /&gt;}&lt;br /&gt;$data['last_access'] = time();&lt;br /&gt;&lt;br /&gt;// write data back to file&lt;br /&gt;if ($exists) {&lt;br /&gt;    dba_replace($_POST['username'],serialize($data), $dbh);&lt;br /&gt;} else {&lt;br /&gt;    dba_insert($_POST['username'],serialize($data), $dbh);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;dba_close($dbh);&lt;br /&gt;?&amp;gt;&lt;/pre&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="docText"&gt;While Example 10-6 can store multiple users' data in the same file, you can't search for, for example, a user's last access time, without looping through each key in the file. If you need to do those kinds of searches, put your data in an SQL database.&lt;/p&gt;&lt;br /&gt;&lt;p class="docText"&gt;Each DBM handler has different behavior in some areas. For example, GDBM provides internal locking. If one process has opened a GDBM file in read-write mode, other calls to &lt;i&gt;dba_open( )&lt;/I&gt; to open the same file in read-write mode will fail. For other DBM handlers, add an &lt;tt&gt;l&lt;/tt&gt; to the mode you pass to &lt;i&gt;dba_open( )&lt;/I&gt; to lock the database with a separate &lt;span class="docEmphasis"&gt;.lck&lt;/span&gt; file &lt;br /&gt;or a &lt;tt&gt;d&lt;/tt&gt; to lock the database file itself. Two DBA functions are also database-specific: &lt;i&gt;dba_optimize( )&lt;/i&gt; and &lt;I&gt;dba_sync( )&lt;/I&gt;. The &lt;I&gt;dba_optimize( )&lt;/I&gt; function calls a handler-specific DBM file-optimization function. Currently, this is implemented only for GDBM, for which its &lt;i&gt;gdbm_reorganize( )&lt;/I&gt; function is called. The &lt;i&gt;dba_sync( )&lt;/i&gt; function calls a handler-specific DBM file synchronizing function. For DB2 and DB3, their &lt;I&gt;sync( )&lt;/I&gt; function is called. For GDBM, its &lt;i&gt;gdbm_sync( )&lt;/i&gt; function is called. Nothing happens for other DBM handlers.&lt;/P&gt;&lt;br /&gt;&lt;p class="docText"&gt;Using a DBM database is a step up from a plain text file but it lacks most features of an SQL database. Your data structure is limited to key/value pairs, and locking robustness varies greatly depending on the DBM handler. Still, DBM handlers can be a good choice for heavily accessed read-only data.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;H4 id="title-IDASCTJ" class="docSection2Title"&gt;10.1.4. See Also&lt;/h4&gt;&lt;br /&gt;&lt;p class="docText"&gt;Recipe 5.7 discusses serializing data; documentation on the DBA functions at http://www.php.net/dba; for more information on the DB2 and DB3 DBM handlers, see http://www.sleepycat.com/products/bdb.html (note that these handlers are not generally free for commercial use); for GDBM, check out http://www.gnu.org/directory/gdbm.html or http://www.mit.edu:8001/afs/athena.mit.edu/project/gnu/doc/html/gdbm_toc.html &lt;br /&gt;&lt;/a&gt; &lt;br /&gt;.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/table&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;td align="right"&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7284850559043997789-680573343270221408?l=cs20001.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cs20001.blogspot.com/feeds/680573343270221408/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7284850559043997789&amp;postID=680573343270221408' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/680573343270221408'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/680573343270221408'/><link rel='alternate' type='text/html' href='http://cs20001.blogspot.com/2010/02/recipe-101-using-dbm-databases.html' title='Recipe 10.1. Using DBM Databases'/><author><name>rong889</name><uri>http://www.blogger.com/profile/06593146008221514057</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7284850559043997789.post-8687228290163565564</id><published>2010-02-04T05:29:00.009-08:00</published><updated>2010-02-04T05:29:13.183-08:00</updated><title type='text'>Audio Effects on Sampled Audio</title><content type='html'>&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;td align="right"&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;H3 class="docSection1Title" id="461691-812"&gt;Audio Effects on Sampled Audio&lt;/H3&gt;&lt;br /&gt;&lt;p class="docText"&gt;There are three approaches for affecting sampled audio:&lt;/P&gt;&lt;br /&gt;&lt;dl class="docList"&gt;&lt;br&gt;&lt;p&gt;&lt;/p&gt;&lt;dt&gt;&lt;span class="docPubcolor"&gt;&lt;span class="docEmphasis"&gt;Precalculation&lt;/span&gt;&lt;/span&gt;&lt;/dt&gt;&lt;/p&gt;&lt;br /&gt;&lt;dd&gt;&lt;p class="docList"&gt;Using this approach, you create the audio effect at development time and play the resulting sound clip at execution time.&lt;/p&gt;&lt;/dd&gt;&lt;BR&gt;&lt;p&gt;&lt;/p&gt;&lt;dt&gt;&lt;span class="docPubcolor"&gt;&lt;span class="docEmphasis"&gt;Byte array manipulation&lt;/span&gt;&lt;/span&gt;&lt;/dt&gt;&lt;/P&gt;&lt;br /&gt;&lt;dd&gt;&lt;p class="docList"&gt;Here, you store the sound in a byte array at runtime, permitting it to be modified using array-based operations.&lt;/P&gt;&lt;/dd&gt;&lt;br&gt;&lt;P&gt;&lt;/P&gt;&lt;dt&gt;&lt;span class="docPubcolor"&gt;&lt;span class="docEmphasis"&gt;Mixer controls&lt;/span&gt;&lt;/span&gt;&lt;/dt&gt;&lt;/P&gt;&lt;br /&gt;&lt;dd&gt;&lt;p class="docList"&gt;A mixer control, such as gain or panning, affects the sound signal passing through the mixer's audio line.&lt;/P&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;br /&gt;&lt;br /&gt;&lt;H4 class="docSection2Title"&gt;Precalculation&lt;/h4&gt;&lt;br /&gt;&lt;p class="docText"&gt;Manipulating audio inside Java can be time-consuming and complicated. If a sound effect is going to be used regularly (e.g., a fading scream, an echoing explosion), then it will probably be better to create it when the game is being developed and save the finished audio to a file for playing at runtime. This moves the overheads associated with sound effect generation out of the application. I've found WavePad useful for various editing, format conversion, and effects tasks (http://nch.com.au/wavepad/). Its supported effects include amplification, reverberation, echoing, noise reduction, fading, and sample rate conversion. It offers recording and CD track ripping. It's small (320 KB), free, and has a decent manual.&lt;/P&gt;&lt;br /&gt;&lt;p class="docText"&gt;Many tools are out there: Do a search for "audio editor" at Google or visit a software site such as tucows (http://www.tucows.com/search).&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4 class="docSection2Title"&gt;Byte Array Manipulation&lt;/H4&gt;&lt;br /&gt;&lt;p class="docText"&gt;The most versatile manipulation approach in Java (but potentially tricky to get right) is to load the audio file as a byte array. Audio effects then become a matter of changing byte values, rearranging blocks of data, or perhaps adding new data. Once completed, the resulting array can be passed through a &lt;tt&gt;SourceDataLine&lt;/tt&gt; into the mixer. The &lt;span class="docEmphasis"&gt;EchoSamplesPlayer.java&lt;/span&gt; application that follows shows how this can be done.&lt;/P&gt;&lt;br /&gt;&lt;p&gt;&lt;table border="0" bgcolor="black" cellspacing="0" cellpadding="1" width="90%" align="center"&gt;&lt;tr&gt;&lt;td&gt;&lt;table bgcolor="white" width="100%" border="0" cellspacing="0" cellpadding="6"&gt;&lt;tr&gt;&lt;TD width="60" valign="top"&gt;&lt;/td&gt;&lt;TD valign="top"&gt;&lt;p class="docText"&gt;A variant of this approach is to employ streaming. Instead of reading in the entire file as a large byte array, the audio file can be incrementally read, changed, and sent to the mixer. However, this coding style is restricted to effects that only have to examine the sound fragment currently in memory. For example, amplification of the array's contents doesn't require a consideration of the other parts of the sound.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/TD&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/p&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 class="docSection3Title"&gt;Making a sound clip echo&lt;/h5&gt;&lt;br /&gt;&lt;p class="docText"&gt;&lt;span class="docEmphasis"&gt;EchoSamplesPlayer.java&lt;/span&gt; completely loads a sound clip into a byte array via an &lt;tt&gt;AudioInputStream&lt;/tt&gt;. Then an echoing effect is applied by creating a new byte array and adding five copies of the original sound to it; each copy is softer than the one before it. The resulting array is passed in small chunks to the &lt;tt&gt;SourceDataLine&lt;/tt&gt; and to the mixer.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;table border="0" bgcolor="black" cellspacing="0" cellpadding="1" width="90%" align="center"&gt;&lt;tr&gt;&lt;td&gt;&lt;table bgcolor="white" width="100%" border="0" cellspacing="0" cellpadding="6"&gt;&lt;tr&gt;&lt;td width="60" valign="top"&gt;&lt;/td&gt;&lt;td valign="top"&gt;&lt;p class="docText"&gt;&lt;tt&gt;EchoSamplesPlayer&lt;/tt&gt; is an extended version of the &lt;tt&gt;BufferedPlayer&lt;/tt&gt; application described in Chapter 7. The main addition is a &lt;tt&gt;getSamples( )&lt;/tt&gt; method: This method applies the effect implemented in &lt;tt&gt;echoSamples( )&lt;/tt&gt;. An &lt;tt&gt;isRequiredFormat( )&lt;/tt&gt; method exists for checking the input is suitable for modification. The program is stored in &lt;span class="docEmphasis"&gt;SoundExamps/SoundPlayer/&lt;/span&gt;.&lt;/p&gt;&lt;/td&gt;&lt;/TR&gt;&lt;/table&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/table&gt;&lt;/p&gt;&lt;br&gt;&lt;br /&gt;&lt;p class="docText"&gt;To simplify the implementation, the echo effect is only applied to 8-bit PCM signed or unsigned audio. The choice of PCM means that the amplitude information is stored unchanged in the byte and isn't compressed as in the ULAW or ALAW formats. The 8-bit requirement means a single byte is used per sample, so I don't have to deal with big- or little-endian issues. PCM unsigned data stores values between &lt;tt&gt;0&lt;/tt&gt; and &lt;tt&gt;28 - 1&lt;/tt&gt; (&lt;tt&gt;255&lt;/tt&gt;), and the signed range is &lt;tt&gt;-27&lt;/tt&gt; to &lt;tt&gt;27 - 1&lt;/tt&gt; (&lt;tt&gt;-128&lt;/tt&gt; to &lt;tt&gt;127&lt;/tt&gt;). This becomes a concern when I cast a byte into a short prior to changing it.&lt;/p&gt;&lt;br /&gt;&lt;p class="docText"&gt;The &lt;tt&gt;main( )&lt;/tt&gt; method in &lt;tt&gt;EchoSamplesPlayer&lt;/tt&gt; is similar to the one in &lt;tt&gt;BufferedPlayer&lt;/tt&gt;:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    public static void main(String[] args)&lt;br /&gt;    { if (args.length != 1) {&lt;br /&gt;        System.out.println("Usage: java EchoSamplesPlayer &amp;lt;clip&amp;gt;");&lt;br /&gt;        System.exit(0);&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      createInput("Sounds/" + args[0]);&lt;br /&gt;&lt;br /&gt;      if (!&lt;span class="docEmphStrong"&gt;isRequiredFormat( )&lt;/span&gt;) {    // not in SamplesPlayer&lt;br /&gt;        System.out.println("Format unsuitable for echoing");&lt;br /&gt;        System.exit(0);&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      createOutput( );&lt;br /&gt;&lt;br /&gt;      int numBytes=(int)(stream.getFrameLength( )*format.getFrameSize( ));&lt;br /&gt;      System.out.println("Size in bytes: " + numBytes);&lt;br /&gt;&lt;br /&gt;      byte[] samples = &lt;span class="docEmphStrong"&gt;getSamples&lt;/span&gt;(numBytes);&lt;br /&gt;      &lt;span class="docEmphStrong"&gt;play(samples);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;      System.exit(0);   // necessary in J2SE 1.4.2 and earlier&lt;br /&gt;    }&lt;/pre&gt;&lt;BR&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;table border="0" bgcolor="black" cellspacing="0" cellpadding="1" width="90%" align="center"&gt;&lt;TR&gt;&lt;TD&gt;&lt;table bgcolor="white" width="100%" border="0" cellspacing="0" cellpadding="6"&gt;&lt;tr&gt;&lt;TD width="60" valign="top"&gt;&lt;/TD&gt;&lt;TD valign="top"&gt;&lt;p class="docText"&gt;The &lt;tt&gt;createInput( )&lt;/tt&gt; and &lt;tt&gt;createOutput( )&lt;/tt&gt; methods are unchanged from &lt;tt&gt;BufferedPlayer&lt;/tt&gt;.&lt;/P&gt;&lt;/td&gt;&lt;/TR&gt;&lt;/table&gt;&lt;/TD&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/P&gt;&lt;BR&gt;&lt;br /&gt;&lt;p class="docText"&gt;&lt;tt&gt;isRequiredFormat( )&lt;/tt&gt; tests the &lt;tt&gt;AudioFormat&lt;/tt&gt; object that was created in &lt;tt&gt;createInput( )&lt;/tt&gt;:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    private static boolean isRequiredFormat( )&lt;br /&gt;    // Only 8-bit PCM signed or unsigned audio can be echoed&lt;br /&gt;    {&lt;br /&gt;      if (((format.getEncoding( )==AudioFormat.Encoding.PCM_UNSIGNED) ||&lt;br /&gt;           (format.getEncoding( ) == AudioFormat.Encoding.PCM_SIGNED))&amp;amp;&amp;amp;&lt;br /&gt;           (format.getSampleSizeInBits( ) == 8))&lt;br /&gt;        return true;&lt;br /&gt;      else&lt;br /&gt;        return false;&lt;br /&gt;    }&lt;/pre&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="docText"&gt;&lt;tt&gt;AudioFormat&lt;/tt&gt; has a selection of &lt;tt&gt;get( )&lt;/tt&gt; methods for examining different aspects of the audio data. For example, &lt;tt&gt;AudioFormat.getChannels( )&lt;/tt&gt; returns the number of channels used (&lt;tt&gt;1&lt;/tt&gt; for mono, &lt;tt&gt;2&lt;/tt&gt; for stereo). The echoing effect doesn't need this information; all the frames, independent of the number of channels, will be amplified. Typically, channel information is required if an effect will differentiate between the stereo outputs, as when a sound is panned between speakers.&lt;/p&gt;&lt;br /&gt;&lt;p class="docText"&gt;&lt;tt&gt;getSamples( )&lt;/tt&gt; adds the echoes after it has extracted the complete &lt;tt&gt;samples[]&lt;/tt&gt; array from the &lt;tt&gt;AudioInputStream&lt;/tt&gt;:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    private static byte[] getSamples(int numBytes)&lt;br /&gt;    {&lt;br /&gt;       // read the entire stream into samples[]&lt;br /&gt;       byte[] samples = new byte[numBytes];&lt;br /&gt;       DataInputStream dis = new DataInputStream(stream);&lt;br /&gt;       try {&lt;br /&gt;         dis.readFully(samples);&lt;br /&gt;       }&lt;br /&gt;       catch (IOException e)&lt;br /&gt;       { System.out.println( e.getMessage( ));&lt;br /&gt;         System.exit(0);&lt;br /&gt;       }&lt;br /&gt;       return &lt;span class="docEmphStrong"&gt;echoSamples&lt;/span&gt;(samples, numBytes);&lt;br /&gt;    }&lt;/pre&gt;&lt;BR&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="docText"&gt;&lt;tt&gt;echoSamples( )&lt;/tt&gt; returns a modified byte array, which becomes the result of &lt;tt&gt;getSamples( )&lt;/tt&gt;.&lt;/p&gt;&lt;br /&gt;&lt;P&gt;&lt;table border="0" bgcolor="black" cellspacing="0" cellpadding="1" width="90%" align="center"&gt;&lt;tr&gt;&lt;td&gt;&lt;table bgcolor="white" width="100%" border="0" cellspacing="0" cellpadding="6"&gt;&lt;tr&gt;&lt;TD width="60" valign="top"&gt;&lt;/td&gt;&lt;td valign="top"&gt;&lt;p class="docText"&gt;Different audio effects could replace the call to &lt;tt&gt;echoSamples( )&lt;/tt&gt; at this point in the code.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/p&gt;&lt;br&gt;&lt;br /&gt;&lt;p class="docText"&gt;&lt;tt&gt;echoSamples( )&lt;/tt&gt; creates a new byte array, &lt;tt&gt;newSamples( )&lt;/tt&gt;, big enough to hold the original sound and &lt;tt&gt;ECHO_NUMBER&lt;/tt&gt; (4) copies. The volume of each one is reduced (decayed) (which is set to by &lt;tt&gt;DECAY&lt;/tt&gt; (0.5) over its predecessor:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    private static byte[] echoSamples(byte[] samples, int numBytes)&lt;br /&gt;    {&lt;br /&gt;      int numTimes = ECHO_NUMBER + 1;&lt;br /&gt;      double currDecay = 1.0;&lt;br /&gt;      short sample, newSample;&lt;br /&gt;      byte[] newSamples = new byte[numBytes*numTimes];&lt;br /&gt;&lt;br /&gt;      for (int j=0; j &amp;lt; numTimes; j++) {&lt;br /&gt;        for (int i=0; i &amp;lt; numBytes; i++)  // copy the sound's bytes&lt;br /&gt;          newSamples[i + (numBytes*j)] = &lt;span class="docEmphStrong"&gt;echoSample&lt;/span&gt;(samples[i], currDecay);&lt;br /&gt;        currDecay *= DECAY;&lt;br /&gt;      }&lt;br /&gt;      return newSamples;&lt;br /&gt;    }&lt;/pre&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="docText"&gt;The nested &lt;tt&gt;for&lt;/tt&gt; loop makes the required copies one byte at a time. &lt;tt&gt;echoSample( )&lt;/tt&gt; utilizes a byte in the original data to create an "echoed" byte for &lt;tt&gt;newSamples[]&lt;/tt&gt;. The amount of echoing is determined by the &lt;tt&gt;currDecay&lt;/tt&gt; double, which shrinks for each successive copy of the original sound.&lt;/p&gt;&lt;br /&gt;&lt;p class="docText"&gt;&lt;tt&gt;echoSample( )&lt;/tt&gt; does different tasks depending on if the input data are unsigned or signed PCM. In both cases, the supplied byte is translated into a short so it can be manipulated easily; then, the result is converted back to a byte:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    private static byte echoSample(byte sampleByte, double currDecay)&lt;br /&gt;    {&lt;br /&gt;      short sample, newSample;&lt;br /&gt;      if (format.getEncoding( ) == AudioFormat.Encoding.&lt;span class="docEmphStrong"&gt;PCM_UNSIGNED&lt;/span&gt;) {&lt;br /&gt;        &lt;span class="docEmphStrong"&gt;sample = (short)(sampleByte &amp;amp; 0xff);&lt;/span&gt;  // unsigned 8 bit -&amp;gt; short&lt;br /&gt;        newSample = (short)(sample * currDecay);&lt;br /&gt;        return (byte) newSample;&lt;br /&gt;      }&lt;br /&gt;      else if (format.getEncoding( )==AudioFormat.Encoding.&lt;span class="docEmphStrong"&gt;PCM_SIGNED&lt;/span&gt;){&lt;br /&gt;        &lt;span class="docEmphStrong"&gt;sample = (short)sampleByte;&lt;/span&gt;   // signed 8 bit -&amp;gt; short&lt;br /&gt;        newSample = (short)(sample * currDecay);&lt;br /&gt;        return (byte) newSample;&lt;br /&gt;      }&lt;br /&gt;      else&lt;br /&gt;        return sampleByte;    //no change; this branch should be unused&lt;br /&gt;    }&lt;/pre&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="docText"&gt;This &lt;tt&gt;byte&lt;/tt&gt;-to-&lt;tt&gt;short&lt;/tt&gt; conversion must be done carefully. An unsigned byte needs masking as it's converted since Java stores shorts in signed form. A &lt;tt&gt;short&lt;/tt&gt; is two bytes long, so the masking ensures that the bits in the high-order &lt;tt&gt;byte&lt;/tt&gt; are all set to &lt;tt&gt;0&lt;/tt&gt;s. Without the mask, the conversion would add in &lt;tt&gt;1&lt;/tt&gt;s when it saw a &lt;tt&gt;byte&lt;/tt&gt; value above &lt;tt&gt;127&lt;/tt&gt;.&lt;/p&gt;&lt;br /&gt;&lt;P&gt;&lt;table border="0" bgcolor="black" cellspacing="0" cellpadding="1" width="90%" align="center"&gt;&lt;TR&gt;&lt;TD&gt;&lt;table bgcolor="white" width="100%" border="0" cellspacing="0" cellpadding="6"&gt;&lt;tr&gt;&lt;td width="60" valign="top"&gt;&lt;/td&gt;&lt;td valign="top"&gt;&lt;p class="docText"&gt;No masking is required for the signed byte to signed short conversion since the translation is correct by default.&lt;/P&gt;&lt;/td&gt;&lt;/TR&gt;&lt;/table&gt;&lt;/TD&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/P&gt;&lt;BR&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;H5 class="docSection3Title"&gt;Playing&lt;/H5&gt;&lt;br /&gt;&lt;p class="docText"&gt;&lt;tt&gt;play( )&lt;/tt&gt; is similar to the one in &lt;span class="docEmphasis"&gt;BufferedPlayer.java&lt;/span&gt; in Chapter 7. The difference is that the byte array must be passed through an input stream before it can be sent to the &lt;tt&gt;SourceDataLine&lt;/tt&gt;:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    private static void play(byte[] samples)&lt;br /&gt;    {&lt;br /&gt;      // byte array --&amp;gt; stream&lt;br /&gt;      &lt;span class="docEmphStrong"&gt;InputStream source = new ByteArrayInputStream(samples);&lt;/span&gt;&lt;br /&gt;      int numRead = 0;&lt;br /&gt;      byte[] buf = new byte[line.getBufferSize( )];&lt;br /&gt;&lt;br /&gt;      line.start( );&lt;br /&gt;      // read and play chunks of the audio&lt;br /&gt;      try {&lt;br /&gt;        while ((numRead = &lt;span class="docEmphStrong"&gt;source&lt;/span&gt;.read(buf, 0, buf.length)) &amp;gt;= 0) {&lt;br /&gt;          int offset = 0;&lt;br /&gt;          while (offset &amp;lt; numRead)&lt;br /&gt;            offset += line.write(buf, offset, numRead-offset);&lt;br /&gt;        }&lt;br /&gt;      }&lt;br /&gt;      catch (IOException e)&lt;br /&gt;      {  System.out.println( e.getMessage( )); }&lt;br /&gt;&lt;br /&gt;      // wait until all data is played, then close the line&lt;br /&gt;      line.drain( );&lt;br /&gt;      line.stop( );&lt;br /&gt;      line.close( );&lt;br /&gt;    }  // end of play( )&lt;/pre&gt;&lt;BR&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;H4 class="docSection2Title"&gt;Utilizing Mixer Controls&lt;/h4&gt;&lt;br /&gt;&lt;p class="docText"&gt;The mixer diagram in Figure 9-1 includes a grayish box labeled "Controls." Controls, such as gain and panning, affect the sound signal passing through an audio line. They can be accessed through &lt;tt&gt;Clip&lt;/tt&gt; or &lt;tt&gt;SourceDataLine&lt;/tt&gt; via a &lt;tt&gt;getControls( )&lt;/tt&gt; method that returns an array of available &lt;tt&gt;Control&lt;/tt&gt; objects. Each object, suitably subclassed, allows its associated audio control to be manipulated.&lt;/P&gt;&lt;br /&gt;&lt;P&gt;&lt;/P&gt;&lt;center&gt;&lt;br /&gt;&lt;h5 class="docFigureTitle"&gt;Figure 9-1. Audio I/O to/from the mixer&lt;/h5&gt;&lt;br /&gt;&lt;/center&gt;&lt;/p&gt;&lt;br&gt;&lt;br /&gt;&lt;p class="docText"&gt;The bad news is that the default mixer in J2SE 5.0 offers fewer controls than were present in J2SE 1.4.2 since controls tend to have an adverse effect on speed even when they're not being used. However, if a control is present, then it's much easier to apply than the byte array technique.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 class="docSection3Title"&gt;Adjusting a clip's volume and pan values&lt;/H5&gt;&lt;br /&gt;&lt;p class="docText"&gt;&lt;tt&gt;PlaceClip&lt;/tt&gt; plays a clip, allowing its volume and pan settings to be adjusted via command-line parameters. It's called with the following format:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    java PlaceClip &amp;lt;clip file&amp;gt; [ &amp;lt;volume value&amp;gt; [&amp;lt;pan value&amp;gt;] ]&lt;/pre&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="docText"&gt;The volume and pan values are optional; if they are both left out, then the clip will play normally.&lt;/p&gt;&lt;br /&gt;&lt;p class="docText"&gt;The volume setting should be between &lt;tt&gt;0.0f&lt;/tt&gt; (the quietest) and &lt;tt&gt;1.0f&lt;/tt&gt; (the loudest); &lt;tt&gt;-1.0f&lt;/tt&gt; means that the volume is left unchanged. The pan value should be between &lt;tt&gt;-1.0f&lt;/tt&gt; and &lt;tt&gt;1.0f&lt;/tt&gt;; &lt;tt&gt;-1.0f&lt;/tt&gt; causes all the sound to be set to the left speaker, &lt;tt&gt;1.0f&lt;/tt&gt; focuses only on the right speaker, and values in between will send the sound to both speakers with varying weights, as in this example:&lt;/P&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    java PlaceClip dog.wav 0.8f -1.0f&lt;/pre&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="docText"&gt;This will make the left speaker bark loudly. This mixing of volume and speaker placement is a rudimentary way of placing sounds at different locations in a game.&lt;/p&gt;&lt;br /&gt;&lt;p class="docText"&gt;&lt;tt&gt;PlaceClip&lt;/tt&gt; is an extended version of &lt;tt&gt;PlayClip&lt;/tt&gt;, which was described in Chapter 7. The changes in &lt;tt&gt;PlaceClip&lt;/tt&gt; are in the extra methods for reading the volume and pan settings from the command line and in the &lt;tt&gt;setVolume( )&lt;/tt&gt; and &lt;tt&gt;setPan( )&lt;/tt&gt; methods for adjusting the clip controls. The program is stored in &lt;span class="docEmphasis"&gt;SoundExamps/SoundPlayer/&lt;/span&gt;.&lt;tt&gt;PlaceClip&lt;/tt&gt;'s &lt;tt&gt;main( )&lt;/tt&gt; method is similar to the one in &lt;span class="docEmphasis"&gt;PlayClip.java&lt;/span&gt;:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    // globals&lt;br /&gt;    private float volume, pan;   // settings from the command line&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    public PlaceClip(String[] args)&lt;br /&gt;    {&lt;br /&gt;      df = new DecimalFormat("0.#");  // 1 dp&lt;br /&gt;&lt;br /&gt;    &lt;span class="docEmphStrong"&gt;getSettings&lt;/span&gt;(args);   // get the volume and pan settings&lt;br /&gt;                           // from the command line&lt;br /&gt;      loadClip(SOUND_DIR + args[0]);&lt;br /&gt;&lt;br /&gt;      // clip control methods&lt;br /&gt;      &lt;span class="docEmphStrong"&gt;showControls( );&lt;br /&gt;      setVolume(volume);&lt;br /&gt;      setPan(pan);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;      play( );&lt;br /&gt;      try {&lt;br /&gt;        Thread.sleep(600000);   // 10 mins in ms&lt;br /&gt;      }&lt;br /&gt;      catch(InterruptedException e)&lt;br /&gt;      { System.out.println("Sleep Interrupted"); }&lt;br /&gt;    }&lt;/pre&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="docText"&gt;&lt;tt&gt;loadClip( )&lt;/tt&gt; and &lt;tt&gt;play( )&lt;/tt&gt; are almost unchanged from &lt;tt&gt;PlayClip&lt;/tt&gt;. (&lt;tt&gt;loadClip( )&lt;/tt&gt; uses a globally defined &lt;tt&gt;AudioFormat&lt;/tt&gt; variable and has some extra &lt;tt&gt;println( )&lt;/tt&gt;'s.) &lt;tt&gt;loadClip( )&lt;/tt&gt; includes a call to &lt;tt&gt;checkDuration( )&lt;/tt&gt;, which issues a warning if the clip is one second or less in length. In that case, the clip won't be heard in J2SE 5.0 due to a Java Sound bug.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 class="docSection3Title"&gt;What controls are available?&lt;/h5&gt;&lt;br /&gt;&lt;p class="docText"&gt;&lt;tt&gt;showControls( )&lt;/tt&gt; displays all the controls available for the clip, which will vary depending on the clip's audio format and the mixer:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    private void showControls( )&lt;br /&gt;    { if (clip != null) {&lt;br /&gt;        Control cntls[] = clip.&lt;span class="docEmphStrong"&gt;getControls&lt;/span&gt;( );&lt;br /&gt;        for(int i=0; i&amp;lt;cntls.length; i++)&lt;br /&gt;          System.out.println( i + ".  " + cntls[i].toString( ) );&lt;br /&gt;      }&lt;br /&gt;    }&lt;/pre&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;table border="0" bgcolor="black" cellspacing="0" cellpadding="1" width="90%" align="center"&gt;&lt;tr&gt;&lt;td&gt;&lt;table bgcolor="white" width="100%" border="0" cellspacing="0" cellpadding="6"&gt;&lt;tr&gt;&lt;td width="60" valign="top"&gt;&lt;/td&gt;&lt;TD valign="top"&gt;&lt;p class="docText"&gt;&lt;tt&gt;getControls( )&lt;/tt&gt; returns information once the clip the class represents has been opened.&lt;/P&gt;&lt;/TD&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/p&gt;&lt;BR&gt;&lt;br /&gt;&lt;p class="docText"&gt;For the &lt;span class="docEmphasis"&gt;dog.wav&lt;/span&gt; example, executed using the J2SE 1.4.2 default mixer, &lt;tt&gt;showControls( )&lt;/tt&gt;'s output is given in Example 9-1.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;H5 class="docExampleTitle"&gt;Example 9-1. showControls( )'s output&lt;/H5&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;0.  Master Gain with current calue: 0.0 dB (range: -80.0 - 13.9794)&lt;br /&gt;1.  Mute Control with current value: Not Mute&lt;br /&gt;2.  Pan with current value: 0.0 (range: -1.0 - 1.0)&lt;br /&gt;3.  Sample Rate with current value: 22000.0 FPS (range: 0.0 - 48000.0)&lt;br /&gt;&lt;/pre&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="docText"&gt;In this case, four controls are available: gain (volume), mute, panning, and sample rate.&lt;/P&gt;&lt;br /&gt;&lt;p class="docText"&gt;Reverberation and balance controls may be available for some types of clips and mixers. In J2SE 5.0, panning, sample rate, and reverberation are no longer supported, and the balance control is only available for audio files using stereo.&lt;/P&gt;&lt;br /&gt;&lt;p class="docText"&gt;In real-world audio gadgets, a pan control distributes &lt;span class="docEmphasis"&gt;mono input&lt;/span&gt; (input on a single channel) between stereo output lines (e.g., the lines going to the speakers). So, the same signal is sent to both output lines. A balance control does a similar job but for &lt;span class="docEmphasis"&gt;stereo input&lt;/span&gt;, sending two channels of input to two output lines.&lt;/P&gt;&lt;br /&gt;&lt;p class="docText"&gt;In J2SE 1.4.2 and before, the pan and balance controls could be used with mono or stereo input, i.e., there was no distinction between them. Output lines were always opened in stereo mode. The default J2SE 1.4.2 mixer is the Java Sound Audio Engine.&lt;/P&gt;&lt;br /&gt;&lt;p class="docText"&gt;The default mixer in J2SE 5.0 is the Direct Audio Device, with resulting changes to the controls. If the mixer receives mono input it will open a mono output line and not a stereo one. This means there's no pan control since there's no way to map mono to stereo. There is a balance control, but that's for mapping stereo input to stereo output.&lt;/p&gt;&lt;br /&gt;&lt;p class="docText"&gt;In J2SE 5.0, the example will report that panning is unavailable since &lt;span class="docEmphasis"&gt;dog.wav&lt;/span&gt; was recorded in mono. The simplest solution is to convert it to stereo using WavePad (http://nch.com.au/wavepad/) or similar software. The balance controls will then be available, and &lt;tt&gt;setPan( )&lt;/tt&gt; can carry out panning by adjusting the balance.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;H5 class="docSection3Title"&gt;Java audio controls&lt;/h5&gt;&lt;br /&gt;&lt;p class="docText"&gt;The various controls are represented by subclasses of the &lt;tt&gt;Control&lt;/tt&gt; class: &lt;tt&gt;BooleanControl&lt;/tt&gt;, &lt;tt&gt;FloatControl&lt;/tt&gt;, &lt;tt&gt;EnumControl&lt;/tt&gt;, and &lt;tt&gt;CompoundControl&lt;/tt&gt;.&lt;/P&gt;&lt;br /&gt;&lt;p class="docText"&gt;&lt;tt&gt;BooleanControl&lt;/tt&gt; is used to adjust binary settings, such as mute on/off. &lt;tt&gt;FloatControl&lt;/tt&gt; is employed for controls that range over floating point values, such as volume, panning, and balance. &lt;tt&gt;EnumControl&lt;/tt&gt; permits a choice between several settings, as in reverberation. &lt;tt&gt;CompoundControl&lt;/tt&gt; groups controls.&lt;/P&gt;&lt;br /&gt;&lt;p&gt;&lt;table border="0" bgcolor="black" cellspacing="0" cellpadding="1" width="90%" align="center"&gt;&lt;tr&gt;&lt;td&gt;&lt;table bgcolor="white" width="100%" border="0" cellspacing="0" cellpadding="6"&gt;&lt;tr&gt;&lt;TD width="60" valign="top"&gt;&lt;/td&gt;&lt;TD valign="top"&gt;&lt;p class="docText"&gt;All these controls will function only if the clip is open.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/TD&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/p&gt;&lt;br&gt;&lt;br /&gt;&lt;p class="docText"&gt;As an example, here's a code fragment that turns mute on and off with a &lt;tt&gt;BooleanControl&lt;/tt&gt;:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    BooleanControl muteControl =&lt;br /&gt;         (BooleanControl) clip.&lt;span class="docEmphStrong"&gt;getControl&lt;/span&gt;( BooleanControl.Type.MUTE );&lt;br /&gt;    muteControl.&lt;span class="docEmphStrong"&gt;setValue&lt;/span&gt;(true);     // mute on; sound is switched off&lt;br /&gt;         : // later on&lt;br /&gt;    muteControl.setValue(false);    // mute off; sound is audible again&lt;/pre&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="docText"&gt;Here's another that plays a clip at 1.5 times its normal speed via a &lt;tt&gt;FloatControl&lt;/tt&gt;:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    FloatControl rateControl =&lt;br /&gt;         (FloatControl) clip.&lt;span class="docEmphStrong"&gt;getControl&lt;/span&gt;( FloatControl.Type.SAMPLE_RATE );&lt;br /&gt;    rateControl.&lt;span class="docEmphStrong"&gt;setValue&lt;/span&gt;( &lt;span class="docEmphStrong"&gt;1.5f&lt;/span&gt; * format.getSampleRate( ) );&lt;br /&gt;            // format is the AudioFormat object for the audio file&lt;/pre&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 class="docSection3Title"&gt;Setting the volume in PlaceClip&lt;/h5&gt;&lt;br /&gt;&lt;p class="docText"&gt;&lt;tt&gt;PlaceClip&lt;/tt&gt; offers a volume parameter, ranging from &lt;tt&gt;0.0f&lt;/tt&gt; (off) to &lt;tt&gt;1.0f&lt;/tt&gt; (on). Additionally, no change to the volume is represented internally by the &lt;tt&gt;NO_VOL_CHANGE&lt;/tt&gt; constant (the float &lt;tt&gt;-1.0f&lt;/tt&gt;).&lt;/p&gt;&lt;br /&gt;&lt;p class="docText"&gt;Unfortunately, the mixer's gain controls use the logarithmic decibel scale (related to the square of the distance from the sound source). Rather than grappling with a realistic mapping from my linear scale (&lt;tt&gt;0&lt;/tt&gt;-&lt;tt&gt;1&lt;/tt&gt;) to the decibel range, I use a linear equation to calculate the new gain:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    gain = ((range_max - range_min) * input_volume) + range_min&lt;/pre&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="docText"&gt;&lt;tt&gt;range_min&lt;/tt&gt; and &lt;tt&gt;range_max&lt;/tt&gt; are the minimum and maximum possible gain values; &lt;tt&gt;input_volume&lt;/tt&gt; is the float obtained from the command line.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;table border="0" bgcolor="black" cellspacing="0" cellpadding="1" width="90%" align="center"&gt;&lt;tr&gt;&lt;TD&gt;&lt;table bgcolor="white" width="100%" border="0" cellspacing="0" cellpadding="6"&gt;&lt;TR&gt;&lt;TD width="60" valign="top"&gt;&lt;/td&gt;&lt;td valign="top"&gt;&lt;p class="docText"&gt;The drawback to this approach is that the logarithmic gain scale is being treated like a linear one. In practice, this means that the sound becomes inaudible when the supplied volume setting is &lt;tt&gt;0.5f&lt;/tt&gt; or less. On balance, this is a small price to pay for greatly simplified code.&lt;/p&gt;&lt;/td&gt;&lt;/TR&gt;&lt;/table&gt;&lt;/td&gt;&lt;/TR&gt;&lt;/table&gt;&lt;/P&gt;&lt;br&gt;&lt;br /&gt;&lt;p class="docText"&gt;&lt;tt&gt;setVolume( )&lt;/tt&gt; uses &lt;tt&gt;isControlSupported( )&lt;/tt&gt; to check for the volume control's presence before attempting to access/change its setting:&lt;/P&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    private void setVolume(float volume)&lt;br /&gt;    {&lt;br /&gt;      if ((clip != null) &amp;amp;&amp;amp; (volume != NO_VOL_CHANGE)) {&lt;br /&gt;        if (clip.&lt;span class="docEmphStrong"&gt;isControlSupported&lt;/span&gt;(FloatControl.Type.MASTER_GAIN)) {&lt;br /&gt;          FloatControl gainControl = (FloatControl)&lt;br /&gt;                clip.&lt;span class="docEmphStrong"&gt;getControl&lt;/span&gt;(FloatControl.Type.MASTER_GAIN);&lt;br /&gt;&lt;br /&gt;          float range = gainControl.getMaximum( ) - gainControl.getMinimum( );&lt;br /&gt;          float gain = (range * volume) + gainControl.getMinimum( );&lt;br /&gt;          System.out.println("Volume: " + volume + "; New gain: " + gain);&lt;br /&gt;          gainControl.&lt;span class="docEmphStrong"&gt;setValue&lt;/span&gt;(gain);&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;          System.out.println("No Volume controls available");&lt;br /&gt;      }&lt;br /&gt;    }&lt;/pre&gt;&lt;BR&gt;&lt;br /&gt;&lt;br /&gt;&lt;P&gt;&lt;table border="0" bgcolor="black" cellspacing="0" cellpadding="1" width="90%" align="center"&gt;&lt;TR&gt;&lt;td&gt;&lt;table bgcolor="white" width="100%" border="0" cellspacing="0" cellpadding="6"&gt;&lt;TR&gt;&lt;TD width="60" valign="top"&gt;&lt;/td&gt;&lt;TD valign="top"&gt;&lt;p class="docText"&gt;&lt;tt&gt;FloatControl&lt;/tt&gt; has several potentially useful methods, like &lt;tt&gt;shift( )&lt;/tt&gt;, which is meant to change the control value gradually over a specified time period and returns without waiting for the shift to finish. Unfortunately, this particular method has never been fully implemented and currently modifies the control value in one step without any incremental changes in between.&lt;/P&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/P&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;H5 class="docSection3Title"&gt;Panning between the speakers in PlaceClip&lt;/h5&gt;&lt;br /&gt;&lt;p class="docText"&gt;&lt;tt&gt;setPan( )&lt;/tt&gt; is supplied with a pan value between &lt;tt&gt;-1.0f&lt;/tt&gt; and &lt;tt&gt;1.0f&lt;/tt&gt;which will position the output somewhere between the left and right speakersor with &lt;tt&gt;NO_PAN_CHANGE&lt;/tt&gt; (&lt;tt&gt;0.0f&lt;/tt&gt;). The method pans first, looks for the balance control if panning is unavailable, and finally gives up if both are unsupported:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    private void setPan(float pan)&lt;br /&gt;    {&lt;br /&gt;      if ((clip == null) || (pan == NO_PAN_CHANGE))&lt;br /&gt;        return;   // do nothing&lt;br /&gt;&lt;br /&gt;      if (clip.isControlSupported(&lt;span class="docEmphStrong"&gt;FloatControl.Type.PAN&lt;/span&gt;)) {&lt;br /&gt;        FloatControl panControl =&lt;br /&gt;           (FloatControl) clip.getControl(FloatControl.Type.PAN);&lt;br /&gt;        panControl.setValue(pan);&lt;br /&gt;      }&lt;br /&gt;      else if (clip.isControlSupported(&lt;span class="docEmphStrong"&gt;FloatControl.Type.BALANCE&lt;/span&gt;)) {&lt;br /&gt;        FloatControl balControl =&lt;br /&gt;           (FloatControl) clip.getControl(FloatControl.Type.BALANCE);&lt;br /&gt;        balControl.setValue(pan);&lt;br /&gt;      }&lt;br /&gt;      else {&lt;br /&gt;        System.out.println("No Pan or Balance controls available");&lt;br /&gt;        if (format.getChannels( ) == 1)   // mono input&lt;br /&gt;          System.out.println("Your audio file is mono;&lt;br /&gt;                                  try converting it to stereo");&lt;br /&gt;      }&lt;br /&gt;    }&lt;/pre&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;UL&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;td align="right"&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7284850559043997789-8687228290163565564?l=cs20001.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cs20001.blogspot.com/feeds/8687228290163565564/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7284850559043997789&amp;postID=8687228290163565564' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/8687228290163565564'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/8687228290163565564'/><link rel='alternate' type='text/html' href='http://cs20001.blogspot.com/2010/02/audio-effects-on-sampled-audio.html' title='Audio Effects on Sampled Audio'/><author><name>rong889</name><uri>http://www.blogger.com/profile/06593146008221514057</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7284850559043997789.post-6611248734168829754</id><published>2010-02-04T05:29:00.007-08:00</published><updated>2010-02-04T05:29:05.984-08:00</updated><title type='text'>Section 6.3.  Buffered Streams</title><content type='html'>&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;td align="right"&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;TR&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;H3 id="title-IDADOZ1D" class="docSection1Title"&gt;6.3. Buffered Streams&lt;/h3&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;p class="docText"&gt;Buffered input streams read more data than they initially need into a buffer (an internal array of bytes). When one of the stream's &lt;tt&gt;read( )&lt;/tt&gt; methods is invoked, data is removed from the buffer rather than from the underlying stream. When the buffer runs out of data, the buffered stream refills its buffer from the underlying stream. Likewise, buffered output streams store data in an internal byte array until the buffer is full or the stream is flushed; then the data is written out to the underlying output stream in one swoop. In situations where it's almost as fast to read or write several hundred bytes from the underlying stream as it is to read or write a single byte, a buffered stream can provide a significant performance boost.&lt;/P&gt;&lt;br /&gt;&lt;p class="docText"&gt;There are two &lt;tt&gt;BufferedInputStream&lt;/tt&gt; constructors and two &lt;tt&gt;BufferedOutputStream&lt;/tt&gt; constructors:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public BufferedInputStream(InputStream in)&lt;br /&gt;public BufferedInputStream(InputStream in, int size)&lt;br /&gt;public BufferedOutputStream(OutputStream out)&lt;br /&gt;public BufferedOutputStream(OutputStream out, int size)&lt;br /&gt;&lt;/pre&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="docText"&gt;The first argument is the underlying stream from which data will be read or to which data will be written. The &lt;tt&gt;size&lt;/tt&gt; argument is the number of bytes in the buffer. If a size isn't specified, a 2048-byte buffer is used. The best size for the buffer depends on the platform and is generally related to the block size of the disk (at least for file streams). Less than 512 bytes is probably too small and more than 8,192 bytes is probably too large. Ideally, you want an integral multiple of the block size of the disk. However, you might want to use smaller buffer sizes for unreliable network connections. For example:&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;URL u = new URL("http://java.sun.com");&lt;br /&gt;BufferedInputStream bis = new BufferedInputStream(u.openStream( ), 256);&lt;br /&gt;&lt;/pre&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="docText"&gt;Example 6-4 copies files named on the command line to &lt;tt&gt;System.out&lt;/tt&gt; with buffered reads and writes.&lt;/P&gt;&lt;br /&gt;&lt;H5 id="title-IDAQPZ1D" class="docExampleTitle"&gt;Example 6-4. A BufferedStreamCopier&lt;/H5&gt;&lt;p&gt;&lt;table cellspacing="0" width="90%" border="1" cellpadding="5"&gt;&lt;TR&gt;&lt;td&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;package com.elharo.io;&lt;br /&gt;import java.io.*;&lt;br /&gt;public class BufferedStreamCopier {&lt;br /&gt;  public static void main(String[] args) {&lt;br /&gt;    try {&lt;br /&gt;      copy(System.in, System.out);&lt;br /&gt;    }&lt;br /&gt;    catch (IOException ex) {&lt;br /&gt;      System.err.println(ex);&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public static void copy(InputStream in, OutputStream out)&lt;br /&gt;   throws IOException {&lt;br /&gt;    BufferedInputStream &lt;br /&gt; bin = new BufferedInputStream(in);&lt;br /&gt;    BufferedOutputStream bout = new BufferedOutputStream(out);&lt;br /&gt;    while (true) {&lt;br /&gt;      int datum = bin.read( );&lt;br /&gt;      if (datum == -1) break;&lt;br /&gt;      bout.write(datum);&lt;br /&gt;    }&lt;br /&gt;    bout.flush( );&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/P&gt;&lt;br /&gt;&lt;p class="docText"&gt;This &lt;tt&gt;copy( )&lt;/tt&gt; method copies byte by byte, which is normally not very efficient. However, almost all the copies take place in memory, because the input stream and the output stream are buffered. Therefore, this is reasonably quick.&lt;/P&gt;&lt;br /&gt;&lt;p class="docText"&gt;The output stream is deliberately flushed. The data reaches its eventual destination in the underlying stream &lt;tt&gt;out&lt;/tt&gt; only when the stream is flushed or the buffer fills up. Therefore, it's important to call &lt;tt&gt;flush( )&lt;/tt&gt; explicitly before the method returns.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4 id="title-IDAOQZ1D" class="docSection2Title"&gt;6.3.1. BufferedInputStream Details&lt;/h4&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;p class="docText"&gt;&lt;tt&gt;BufferedInputStream&lt;/tt&gt; only overrides and inherits methods from &lt;tt&gt;InputStream&lt;/tt&gt;. It does not declare any new methods of its own. Marking and resetting are supported.&lt;/p&gt;&lt;br /&gt;&lt;p class="docText"&gt;In Java 1.2 and later, the two multibyte &lt;tt&gt;read( )&lt;/tt&gt; methods try to fill the specified array or subarray completely by reading repeatedly from the underlying input stream. They return only when the requested number of bytes have been read, the end of stream is reached, or the underlying stream would block. Most other input streams attempt only one read from the underlying stream or data source before returning.&lt;/P&gt;&lt;br /&gt;&lt;p class="docText"&gt;The buffer and the current state of the buffer are stored in protected fields. The buffer itself is a byte array called &lt;tt&gt;buf&lt;/tt&gt;; the number of bytes in the buffer is an &lt;tt&gt;int&lt;/tt&gt; named &lt;tt&gt;count&lt;/tt&gt;; the index of the next byte that will be returned by &lt;tt&gt;read( )&lt;/tt&gt; is an &lt;tt&gt;int&lt;/tt&gt; called &lt;tt&gt;pos&lt;/tt&gt;; the mark, if any, is an &lt;tt&gt;int&lt;/tt&gt; called &lt;tt&gt;markpos&lt;/tt&gt;; the read-ahead limit before the mark is invalidated is an &lt;tt&gt;int&lt;/tt&gt; called &lt;tt&gt;marklimit&lt;/tt&gt;. Subclasses of &lt;tt&gt;BufferedInputStream&lt;/tt&gt; can directly access all these fields, which can be important for performance.&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;protected byte[] buf&lt;br /&gt;protected int    count&lt;br /&gt;protected int    pos&lt;br /&gt;protected int    markpos&lt;br /&gt;protected int    marklimit&lt;br /&gt;&lt;/pre&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4 id="title-IDA5RZ1D" class="docSection2Title"&gt;6.3.2. BufferedOutputStream Details&lt;/H4&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;p class="docText"&gt;&lt;tt&gt;BufferedOutputStream&lt;/tt&gt; stores the buffered data in a protected byte array named &lt;tt&gt;buf&lt;/tt&gt; and the index of the next place in the array where a byte will be stored in an &lt;tt&gt;int&lt;/tt&gt; field named &lt;tt&gt;pos&lt;/tt&gt;. &lt;tt&gt;BufferedOutputStream&lt;/tt&gt; does not expose the number of bytes in the buffer.&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;protected byte buf[]&lt;br /&gt;protected int  pos&lt;br /&gt;&lt;/pre&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="docText"&gt;Otherwise, &lt;tt&gt;BufferedOutputStream&lt;/tt&gt; has the same &lt;tt&gt;write( )&lt;/tt&gt;, &lt;tt&gt;flush( )&lt;/tt&gt;, and &lt;tt&gt;close( )&lt;/tt&gt; methods every &lt;tt&gt;OutputStream&lt;/tt&gt; has. These methods are invoked exactly as they would be for any output stream. The only difference is that writes place data in the buffer rather than directly on the underlying output stream. &lt;tt&gt;BufferedOutputStream&lt;/tt&gt; does not declare any new methods.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/table&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;td align="right"&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7284850559043997789-6611248734168829754?l=cs20001.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cs20001.blogspot.com/feeds/6611248734168829754/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7284850559043997789&amp;postID=6611248734168829754' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/6611248734168829754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/6611248734168829754'/><link rel='alternate' type='text/html' href='http://cs20001.blogspot.com/2010/02/section-63-buffered-streams.html' title='Section 6.3.  Buffered Streams'/><author><name>rong889</name><uri>http://www.blogger.com/profile/06593146008221514057</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7284850559043997789.post-3611413142913467979</id><published>2010-02-04T05:29:00.005-08:00</published><updated>2010-02-04T05:29:03.320-08:00</updated><title type='text'>The range_error Class</title><content type='html'>&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;font size=5&gt;Class Name&lt;/font&gt;            range_error&lt;br /&gt;&lt;br /&gt;&lt;font size=5&gt;Header File&lt;/font&gt;           &amp;lt;stdexcept&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;font size=5&gt;Classification&lt;/font&gt;      Exception&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Class Relationship Diagram&lt;br&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;Class Description&lt;br&gt;&lt;br /&gt;&lt;h1&gt;Member Classes&lt;/h1&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;None&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;Methods&lt;/h1&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;range_error(const string &amp;What_Arg)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Example&lt;/h2&gt;&lt;br&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;h3&gt;Class Description&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;The range_error class  is derived from the  runtime_error class.&lt;br /&gt;The range_error class represents exceptions  that are  occur because&lt;br /&gt;some piece of the software component that causes the exception is attempting&lt;br /&gt;to work with a value that is either to large or to small to represent in&lt;br /&gt;the current environment.  The value is a legitimate value but beyond the&lt;br /&gt;representation capabilities of the current machine.  This is in contrast&lt;br /&gt;to the out_of_range exception which represents values that are not legitimate&lt;br /&gt;for operation they are involved in.  This class represents&lt;br /&gt;a node class and  can therefore be used as a base class for user defined classes.  &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;Method            range_error()&lt;br /&gt;&lt;br /&gt;Access            Public&lt;br /&gt;&lt;br /&gt;Classification    Constructor&lt;br /&gt;&lt;br /&gt;Syntax            range_error(const string &amp;What_Arg)      &lt;br /&gt;&lt;br /&gt;Parameters        The What_Arg parameter should contain a description of the kind of exception&lt;br /&gt;                  that has occurred.&lt;br /&gt;&lt;br /&gt;Return            None&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Description&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;The range_error() method constructs an object of type range_error.  The What_Arg parameter&lt;br /&gt;can be used to set a description of the kind of error that this exception represents. &lt;br /&gt;A set possible solutions is sometimes supplied with the exception description in addition&lt;br /&gt;to the type of error.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;h2&gt;The Class Relationship Diagram of range_error&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    1   &lt;br /&gt;    2   #include &amp;lt;stdexcept&amp;gt;&lt;br /&gt;    3   &lt;br /&gt;    4   &lt;br /&gt;    5   void main(void)&lt;br /&gt;    6   {&lt;br /&gt;    7   &lt;br /&gt;    8   &lt;br /&gt;    9      try{&lt;br /&gt;   10   &lt;br /&gt;   11            exception X;&lt;br /&gt;   12            throw(X);&lt;br /&gt;   13      }&lt;br /&gt;   14      catch(const exception &amp;X)&lt;br /&gt;   15      {&lt;br /&gt;   16          cout &amp;lt;&amp;lt; X.what() &amp;lt;&amp;lt; endl;&lt;br /&gt;   17   &lt;br /&gt;   18      }&lt;br /&gt;   19   &lt;br /&gt;   20      try&lt;br /&gt;   21      {      &lt;br /&gt;   22          range_error RangeError("Value To Large For Display");&lt;br /&gt;   23          throw(RangeError);&lt;br /&gt;   24      }&lt;br /&gt;   25      catch(const exception &amp;X)&lt;br /&gt;   26      {&lt;br /&gt;   27          cout &amp;lt;&amp;lt; X.what() &amp;lt;&amp;lt; endl;&lt;br /&gt;   28      }     &lt;br /&gt;   29      &lt;br /&gt;   30   &lt;br /&gt;   31   &lt;br /&gt;   32   }&lt;br /&gt;   33   &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7284850559043997789-3611413142913467979?l=cs20001.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cs20001.blogspot.com/feeds/3611413142913467979/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7284850559043997789&amp;postID=3611413142913467979' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/3611413142913467979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/3611413142913467979'/><link rel='alternate' type='text/html' href='http://cs20001.blogspot.com/2010/02/rangeerror-class.html' title='The range_error Class'/><author><name>rong889</name><uri>http://www.blogger.com/profile/06593146008221514057</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7284850559043997789.post-8416944690621001447</id><published>2010-02-04T05:29:00.003-08:00</published><updated>2010-02-04T05:29:01.422-08:00</updated><title type='text'>Create Event Monitor Options</title><content type='html'>&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;td class="tt1"&gt;[ Team LiB ]&lt;/td&gt;&lt;td valign="top" class="tt1" align="right"&gt;&lt;br /&gt;	&lt;br /&gt;	&lt;br /&gt;&lt;/td&gt;&lt;/table&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td valign="top"&gt;&lt;H3 class="docSection1Title"&gt; Create Event Monitor Options&lt;/H3&gt;&lt;br /&gt;&lt;P class="docText"&gt;Options can be specified on the &lt;TT&gt;CREATE EVENT MONITOR&lt;/TT&gt; statement to control the amount of information collected, to determine how the event monitor stops and starts, to specify the location and size of output files or pipes, types and size of buffers, and scope of the event monitor (local or global).&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;We have already discussed the various types of event monitors that can be created. We will now focus on major event monitor options and associated details.&lt;/P&gt;&lt;br /&gt;&lt;H4 class="docSection2Title"&gt; &lt;TT&gt;WHERE &lt;/TT&gt;&lt;span class="docEmphasis"&gt;&lt;TT&gt;event condition&lt;/TT&gt;&lt;/span&gt;&lt;/H4&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;TT&gt;WHERE event condition&lt;/TT&gt; is used to specify one of three possible event conditions as follows:&lt;/P&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;p class="docText"&gt;&lt;TT&gt;APPL_ID&lt;/TT&gt;� &lt;br /&gt;Specifies that the application ID of each connection should be compared with the &lt;span class="docEmphasis"&gt;comparison-string&lt;/span&gt; in order to determine if the connection should generate &lt;TT&gt;CONNECTION&lt;/TT&gt;, &lt;TT&gt;STATEMENT&lt;/TT&gt;, or &lt;TT&gt;TRANSACTION&lt;/TT&gt; events, if specified.&lt;/p&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;This option can also be used for specific &lt;TT&gt;AUTH_IDs&lt;/TT&gt; or &lt;TT&gt;APPL_NAMES&lt;/TT&gt;. The &lt;span class="docEmphasis"&gt;comparison-string&lt;/span&gt; is a character string that is compared with the &lt;TT&gt;APPL_ID&lt;/TT&gt;, &lt;TT&gt;AUTH_ID&lt;/TT&gt;, or &lt;TT&gt;APPL_NAME&lt;/TT&gt; of each application that connects to the database. If the specific event condition is met, event data is captured.&lt;/P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;br /&gt;&lt;H4 class="docSection2Title"&gt; &lt;TT&gt;WRITE TO&lt;/TT&gt;&lt;/H4&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;TT&gt;WRITE TO&lt;/TT&gt; identifies the target output mechanism that will hold the event monitor data. An event monitor can write to a table, pipe, or file. I will briefly describe how DB2 event monitors write to files and pipes, and then go into much more detail using DB2 event monitors that write to the new event monitor &lt;TT&gt;WRITE TO TABLE&lt;/TT&gt; capability in DB2 v8. When writing event monitors to a &lt;TT&gt;PIPE&lt;/TT&gt;, the event monitor writes the data to the pipe in a single stream, as if it were a single, infinitely long file. When writing data to a pipe, an event monitor does not perform blocked writes. This is important because if there is no room in the pipe buffer, the event monitor will discard the data. The monitoring application using the pipe must read the data without delay to ensure no loss of data.&lt;/P&gt;&lt;br /&gt;&lt;div class="docNote"&gt;&lt;p class="docNoteTitle"&gt;NOTE&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docText"&gt;It is uncommon for DBAs to use pipes for event monitors. This is because an application is required to read the data from a pipe; and the application must be started in advance of writing data to a pipe. However, it is common for ISV tools to use pipes, as they provide an application as part of the tool to read the pipe and process the data.&lt;/P&gt;&lt;/div&gt;&lt;br&gt;&lt;br /&gt;&lt;P class="docText"&gt;Using a pipe is very efficient and incurs the lowest amount of overhead on the database. However, as indicated, an application is required to read and process the data.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;When writing event monitor data to a file (or set of files), the event data streams to files, which follow the following naming convention:&lt;/P&gt;&lt;br /&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="docList"&gt;&lt;span class="docEmphasis"&gt;00000000.evt, 00000001.evt, 00000002.evt&lt;/span&gt; &amp;#8230; &lt;span class="docEmphasis"&gt;nnnnnnn.evt&lt;/span&gt;&lt;/P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;br /&gt;&lt;P class="docText"&gt;unless limited by the &lt;TT&gt;MAXFILES&lt;/TT&gt; option.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Even though multiple files may be used, the data is treated as one logical file.&lt;/P&gt;&lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;td&gt;&lt;/td&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;td class="tt1"&gt;[ Team LiB ]&lt;/td&gt;&lt;td valign="top" class="tt1" align="right"&gt;&lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;&lt;/td&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7284850559043997789-8416944690621001447?l=cs20001.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cs20001.blogspot.com/feeds/8416944690621001447/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7284850559043997789&amp;postID=8416944690621001447' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/8416944690621001447'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/8416944690621001447'/><link rel='alternate' type='text/html' href='http://cs20001.blogspot.com/2010/02/create-event-monitor-options.html' title='Create Event Monitor Options'/><author><name>rong889</name><uri>http://www.blogger.com/profile/06593146008221514057</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7284850559043997789.post-977502824124319814</id><published>2010-02-04T05:29:00.001-08:00</published><updated>2010-02-04T05:29:00.370-08:00</updated><title type='text'>MPP Configuration Variables</title><content type='html'>&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;td class="tt1"&gt;[ Team LiB ]&lt;/td&gt;&lt;td valign="top" class="tt1" align="right"&gt;&lt;br /&gt;	&lt;br /&gt;	&lt;br /&gt;&lt;/td&gt;&lt;/table&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td valign="top"&gt;&lt;H3 class="docSection1Title"&gt; MPP Configuration Variables&lt;/H3&gt;&lt;br /&gt;&lt;P&gt;&lt;TABLE CELLSPACING="0" FRAME="hsides" RULES="rows" CELLPADDING="4" WIDTH="100%"&gt;&lt;COLGROUP align="left" span="3"&gt;&lt;THEAD&gt;&lt;TR&gt;&lt;TH class="docTableHeader" align="center" valign="top"&gt;&lt;P class="docText"&gt;&lt;span class="docEmphStrong"&gt;Variable name&lt;/span&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH class="docTableHeader" align="center" valign="top"&gt;&lt;P class="docText"&gt;&lt;span class="docEmphStrong"&gt;Operating system&lt;/span&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH class="docTableHeader" align="center" valign="top"&gt;&lt;P class="docText"&gt;&lt;span class="docEmphStrong"&gt;Values&lt;/span&gt;&lt;/P&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;DB2ATLD_PWFILE&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;DB2 UDB ESE on AIX, Solaris, and Windows NT&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Default = &lt;TT&gt;null&lt;/TT&gt;&lt;/P&gt;&lt;br /&gt;&lt;p class="docText"&gt;&lt;span class="docEmphRoman"&gt;Value&lt;/span&gt;: &lt;br /&gt;a file path expression&lt;/p&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top" colspan="3"&gt;&lt;P class="docText"&gt;Specifies a path to a file that contains a password used during AutoLoader authentication. If not set, AutoLoader either extracts the password from its configuration file or prompts you interactively. Using this variable addresses password security concerns and allows the separation of AutoLeader configuration information from authentication information.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;This registry variable is no longer needed, but is retained for backward compatibility.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;DB2CHGPWD_ESE&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;DB2 UDB ESE on AIX and Windows NT&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Default = &lt;TT&gt;null&lt;/TT&gt;&lt;/P&gt;&lt;br /&gt;&lt;p class="docText"&gt;&lt;span class="docEmphRoman"&gt;Values&lt;/span&gt;: &lt;br /&gt;&lt;TT&gt;YES&lt;/TT&gt; or &lt;TT&gt;NO&lt;/TT&gt;&lt;/p&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top" colspan="3"&gt;&lt;P class="docText"&gt;Specifies whether you allow other users to change passwords on AIX or Windows NT ESE systems. You must ensure that the passwords for all partitions or nodes are maintained centrally using either a Windows NT domain controller on Windows NT, or NIS on AIX. If not maintained centrally, passwords may not be consistent across all partitions or nodes. This could result in a password being changed only at the database partition to which the user connects to make the change. In order to modify this global registry variable, you must be at the root directory and on the DAS instance.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;This variable is required only if you use the old &lt;TT&gt;db2atld&lt;/TT&gt; utility instead of the new &lt;TT&gt;LOAD&lt;/TT&gt; utility.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;DB2_FORCE_FCM_BP&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;AIX&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Default = &lt;TT&gt;NO&lt;/TT&gt;&lt;/P&gt;&lt;br /&gt;&lt;p class="docText"&gt;&lt;span class="docEmphRoman"&gt;Values&lt;/span&gt;: &lt;br /&gt;&lt;TT&gt;YES&lt;/TT&gt; or &lt;TT&gt;NO&lt;/TT&gt;&lt;/p&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top" colspan="3"&gt;&lt;P class="docText"&gt;This registry variable is applicable to DB2 UDB ESE for AIX with multiple logical partitions. When &lt;TT&gt;DB2START&lt;/TT&gt; is issued, DB2 allocates the FCM buffers either from the database global memory or from a separate shared memory segment, if there is not enough global memory available. These buffers are used by all FCM daemons for that instance on the same physical machine. The kind of memory allocated is largely dependent on the number of FCM buffers to be created, as specified by the &lt;TT&gt;fcm_num_buffers&lt;/TT&gt; database manger configuration parameter.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;If the &lt;TT&gt;DB2_FORCE_FCM_BP&lt;/TT&gt; variable is set to Yes, the FCM buffers are always created in a separate memory segment so that communication between FCM daemons of different logical partitions on the same physical node occur through shared memory. Otherwise, FCM daemons on the same node communicate through UNIX sockets. Communicating through shared memory is faster, but there is one fewer shared memory segment available for other uses, particularly for database bufferpools. Enabling the &lt;TT&gt;DB2_FORCE_FCM_BP&lt;/TT&gt; registry variable thus reduces the maximum size of database bufferpools.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;DB2_NUM_FAILOVER_NODES&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;All&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;p class="docText"&gt;&lt;span class="docEmphRoman"&gt;Default&lt;/span&gt;: &lt;br /&gt;&lt;TT&gt;2&lt;/TT&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="docText"&gt;&lt;span class="docEmphRoman"&gt;Values&lt;/span&gt;: &lt;br /&gt;&lt;TT&gt;0&lt;/TT&gt; to the number of logical nodes&lt;/p&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top" colspan="3"&gt;&lt;P class="docText"&gt;Specifies the number of nodes that can be used as failover nodes in a high availability environment. With high availability, if a node fails, then the node can be restarted as a second logical node on a different host. The number used with this variable determines how much memory is reserved for FCM resources for failover nodes.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;For example, host A has two logical nodes: &lt;TT&gt;1&lt;/TT&gt; and &lt;TT&gt;2&lt;/TT&gt;; and host B has two logical nodes: &lt;TT&gt;3&lt;/TT&gt; and &lt;TT&gt;4&lt;/TT&gt;. Assume &lt;TT&gt;DB2_NUM_FAILOVER_NODES&lt;/TT&gt; is set to 2. During &lt;TT&gt;DB2START&lt;/TT&gt;, both host A and B will reserve enough memory for FCM so that up to four logical nodes could be managed. Then if one host fails, the logical nodes for the failing host could be restarted on the other host.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;DB2_PARTITIONEDLOAD_DEFAULT&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;All supported ESE platforms&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;p class="docText"&gt;&lt;span class="docEmphRoman"&gt;Default&lt;/span&gt;: &lt;br /&gt;&lt;TT&gt;YES&lt;/TT&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="docText"&gt;&lt;span class="docEmphRoman"&gt;Range of values&lt;/span&gt;: &lt;br /&gt;&lt;TT&gt;YES/NO&lt;/TT&gt;&lt;/p&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top" colspan="3"&gt;&lt;P class="docText"&gt;The &lt;TT&gt;DB2_PARTITIONEDLOAD_DEFAULT&lt;/TT&gt; registry variable lets users change the default behavior of the Load utility in an ESE environment when no ESE-specific Load options are specified. The default value is &lt;TT&gt;YES&lt;/TT&gt;, which specifies that in an ESE environment if you do not specify ESE-specific Load options, loading is attempted on all partitions on which the target table is defined.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;When the value is &lt;TT&gt;NO&lt;/TT&gt;, loading is attempted only on the partition to which the Load utility is currently connected.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;DB2PORTRANGE&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Windows NT&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;p class="docText"&gt;&lt;span class="docEmphRoman"&gt;Values&lt;/span&gt;: &lt;br /&gt;&lt;TT&gt;nnnn:nnnn&lt;/TT&gt;&lt;/p&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top" colspan="3"&gt;&lt;P class="docText"&gt;This value is set to the TCP/IP port range used by FCM so that any additional partitions created on another machine will also have the same port range.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/COLGROUP&gt;&lt;/TABLE&gt;&lt;/P&gt;&lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;td&gt;&lt;/td&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;td class="tt1"&gt;[ Team LiB ]&lt;/td&gt;&lt;td valign="top" class="tt1" align="right"&gt;&lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;&lt;/td&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7284850559043997789-977502824124319814?l=cs20001.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cs20001.blogspot.com/feeds/977502824124319814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7284850559043997789&amp;postID=977502824124319814' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/977502824124319814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/977502824124319814'/><link rel='alternate' type='text/html' href='http://cs20001.blogspot.com/2010/02/mpp-configuration-variables.html' title='MPP Configuration Variables'/><author><name>rong889</name><uri>http://www.blogger.com/profile/06593146008221514057</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7284850559043997789.post-7514668941426283436</id><published>2010-02-04T05:28:00.017-08:00</published><updated>2010-02-04T05:28:56.257-08:00</updated><title type='text'>Using and Modifying the Project</title><content type='html'>&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;td align="right"&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="chapter"&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="section"&gt;&lt;br /&gt;&lt;h2 class="first-section-title"&gt;&lt;br /&gt;Using and Modifying the Project&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="para"&gt;This section explains how to modify the hFinder project for other applications. You see how to modify hFinder in the following ways:&lt;/p&gt;&lt;br /&gt;&lt;ul class="itemizedlist"&gt;&lt;br /&gt;&lt;li class="first-listitem"&gt;&lt;br /&gt;&lt;p class="first-para"&gt;Implement Windows Details view&lt;/p&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li class="listitem"&gt;&lt;br /&gt;&lt;p class="first-para"&gt;Modify hFinder so that it resembles a Save As dialog&lt;/p&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li class="listitem"&gt;&lt;br /&gt;&lt;p class="first-para"&gt;Create a directory picker dialog from the tree view&lt;/p&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p class="para"&gt;As mentioned earlier in this chapter, one of the goals of the hFinder application is to make it reusable for various other aspects of a content management system, and flexible enough to support multiple methods of viewing a directory's contents. The first way you'll modify hFinder is to see what an implementation of Windows Details view looks like.&lt;/p&gt;&lt;br /&gt;&lt;div class="section"&gt;&lt;br /&gt;&lt;h3 class="sect3-title"&gt;&lt;br /&gt;Windows Details View&lt;/h3&gt;&lt;br /&gt;&lt;p class="first-para"&gt;This section describes how to implement a new view in the hFinder application, a true-to-Windows Details view. Windows Details view is essentially nothing more than data organized in columns in a table. You can see this in Figure 9-12, which is a screenshot of Windows Details view.&lt;/p&gt;&lt;br /&gt;&lt;div class="figure"&gt;&lt;br /&gt;&lt;span class="figuremediaobject"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br style="line-height: 1"&gt;&lt;br /&gt;&lt;span class="figure-title"&gt;&lt;span class="figure-titlelabel"&gt;Figure 9-12&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="para"&gt;As you can see from Figure 9-12 there isn't much to do to implement a Windows-style Details view. It's merely a restructuring of the data into tabular form, and the inclusion of some additional information about a file. To implement the Windows Details view, follow these steps:&lt;/p&gt;&lt;br /&gt;&lt;ol class="orderedlist"&gt;&lt;br /&gt;&lt;li class="first-listitem"&gt;&lt;br /&gt;&lt;p class="first-para"&gt;Make the following modifications to &lt;span class="fixed"&gt;&lt;span class="inlinemediaobject"&gt;&amp;nbsp;hFinder.html&lt;/span&gt;&lt;/span&gt;:&lt;/p&gt;&lt;br /&gt;&lt;div class="informalexample"&gt;&lt;br /&gt;&lt;pre class="literallayout"&gt;&lt;br /&gt;                        &amp;lt;/li&amp;gt;&lt;br /&gt;                    &amp;lt;/ul&amp;gt;&lt;br /&gt;                &amp;lt;/li&amp;gt;&lt;br /&gt;            &amp;lt;/ul&amp;gt;&lt;br /&gt;        &amp;lt;/div&amp;gt;&lt;br /&gt;        &amp;lt;div id='hfinder-files'&amp;gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;            &amp;lt;table class='file-wdetails'&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                &amp;lt;colgroup&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;col style='width: 16px;' /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;col /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;col style='width: 10%;' /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;col style='width: 20%;' /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;col style='width: 20%;' /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                &amp;lt;/colgroup&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                &amp;lt;thead&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;th&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;th&amp;gt;Name&amp;lt;/th&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;th&amp;gt;Size&amp;lt;/th&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;th&amp;gt;Type&amp;lt;/th&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;th&amp;gt;Last Modified&amp;lt;/th&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                &amp;lt;/thead&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                &amp;lt;tbody&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;tr id='dir-3645' class='file-directory' title='account'&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                         &amp;lt;img src='images/16x16/MacOSXAqua_012.png' alt='folder' /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-name'&amp;gt;account&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-size'&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-type'&amp;gt;Directory&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-last-modified'&amp;gt;11/26/2005 4:28 PM&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;tr id='dir-31' class='file-directory' title='cp'&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                         &amp;lt;img src='images/16x16/MacOSXAqua_012.png' alt='folder' /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-name'&amp;gt;cp&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-size'&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-type'&amp;gt;Directory&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-last-modified'&amp;gt;11/26/2005 4:30 PM&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;tr id='dir-3785' class='file-directory' title='daemons'&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                         &amp;lt;img src='images/16x16/MacOSXAqua_012.png' alt='folder' /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-name'&amp;gt;daemons&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-size'&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-type'&amp;gt;Directory&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-last-modified'&amp;gt;11/26/2005 4:33 PM&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;tr id='dir-3677' class='file-directory' title='file'&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                         &amp;lt;img src='images/16x16/MacOSXAqua_012.png' alt='folder' /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-name'&amp;gt;file&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-size'&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-type'&amp;gt;Directory&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-last-modified'&amp;gt;11/26/2005 4:34 PM&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;tr id='dir-26' class='file-directory' title='forum'&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                         &amp;lt;img src='images/16x16/MacOSXAqua_012.png' alt='folder' /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-name'&amp;gt;forum&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-size'&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-type'&amp;gt;Directory&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-last-modified'&amp;gt;11/26/2005 4:35 PM&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;tr id='dir-3651' class='file-directory' title='home'&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                         &amp;lt;img src='images/16x16/MacOSXAqua_012.png' alt='folder' /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-name'&amp;gt;home&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-size'&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-type'&amp;gt;Directory&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-last-modified'&amp;gt;11/26/2005 4:37 PM&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;tr id='dir-3681' class='file-directory' title='images'&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                         &amp;lt;img src='images/16x16/MacOSXAqua_012.png' alt='folder' /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-name'&amp;gt;images&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-size'&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-type'&amp;gt;Directory&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-last-modified'&amp;gt;11/26/2005 4:38 PM&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;tr id='dir-3690' class='file-directory' title='js'&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                         &amp;lt;img src='images/16x16/MacOSXAqua_012.png' alt='folder' /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-name'&amp;gt;js&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-size'&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-type'&amp;gt;Directory&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-last-modified'&amp;gt;11/26/2005 4:39 PM&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;tr id='dir-30' class='file-directory' title='listener'&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                         &amp;lt;img src='images/16x16/MacOSXAqua_012.png' alt='folder' /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-name'&amp;gt;listener&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-size'&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-type'&amp;gt;Directory&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-last-modified'&amp;gt;11/26/2005 4:40 PM&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;tr id='dir-29' class='file-directory' title='logout'&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                         &amp;lt;img src='images/16x16/MacOSXAqua_012.png' alt='folder' /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-name'&amp;gt;logout&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-size'&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-type'&amp;gt;Directory&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-last-modified'&amp;gt;11/26/2005 4:41 PM&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;tr id='dir-3682' class='file-directory' title='media'&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                         &amp;lt;img src='images/16x16/MacOSXAqua_012.png' alt='folder' /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-name'&amp;gt;media&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-size'&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-type'&amp;gt;Directory&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-last-modified'&amp;gt;11/26/2005 4:42 PM&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;tr id='dir-3667' class='file-directory' title='network'&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                         &amp;lt;img src='images/16x16/MacOSXAqua_012.png' alt='folder' /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-name'&amp;gt;network&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-size'&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-type'&amp;gt;Directory&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-last-modified'&amp;gt;11/26/2005 4:44 PM&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;tr id='dir-3735' class='file-directory' title='products'&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                         &amp;lt;img src='images/16x16/MacOSXAqua_012.png' alt='folder' /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-name'&amp;gt;products&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-size'&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-type'&amp;gt;Directory&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-last-modified'&amp;gt;11/26/2005 4:45 PM&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;tr id='dir-28' class='file-directory' title='register'&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                         &amp;lt;img src='images/16x16/MacOSXAqua_012.png' alt='folder' /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-name'&amp;gt;register&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-size'&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-type'&amp;gt;Directory&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-last-modified'&amp;gt;11/26/2005 4:46 PM&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;tr id='dir-3784' class='file-directory' title='search'&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                         &amp;lt;img src='images/16x16/MacOSXAqua_012.png' alt='search' /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-name'&amp;gt;search&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-size'&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-type'&amp;gt;Directory&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-last-modified'&amp;gt;11/26/2005 4:47 PM&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;tr id='reg-112' class='file-registry-doc'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        title='File Not Found'&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                            &amp;lt;img src='images/16x16/21.png' alt='text/html' /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-name' id='freg-112'&amp;gt;404.html&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-size'&amp;gt;900 Bytes&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-type'&amp;gt;text/html&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-last-modified'&amp;gt;11/26/2005 4:49 PM&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;tr id='reg-1' class='file-registry-doc' title='Welcome'&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                            &amp;lt;img src='images/16x16/21.png' alt='text/html' /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-name'&amp;gt;index.html&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-size'&amp;gt;10 KB&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-type'&amp;gt;text/html&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td class='file-last-modified'&amp;gt;11/26/2005 4:50 PM&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                &amp;lt;/tbody&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;           &amp;lt;/table&amp;gt;&lt;/span&gt;&lt;br /&gt;        &amp;lt;/div&amp;gt;&lt;br /&gt;        &amp;lt;div id='hfinder-contextmenu'&amp;gt;&lt;br /&gt;            &amp;lt;ul&amp;gt;&lt;br /&gt;                &amp;lt;li id='context-open' class='sep'&amp;gt;&lt;br /&gt;                    &amp;lt;span style='font-weight: bold;'&amp;gt;Open&amp;lt;/span&amp;gt;&lt;br /&gt;                &amp;lt;/li&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li class="listitem"&gt;&lt;br /&gt;&lt;p class="first-para"&gt;Save the modifications you made in a new file called &lt;span class="fixed"&gt;&lt;span class="inlinemediaobject"&gt;&amp;nbsp;hFinder.wDetails.html&lt;/span&gt;&lt;/span&gt;.&lt;/p&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li class="listitem"&gt;&lt;br /&gt;&lt;p class="first-para"&gt;Make the following modifications to &lt;span class="fixed"&gt;&lt;span class="inlinemediaobject"&gt;&amp;nbsp;views.css&lt;/span&gt;&lt;/span&gt;:&lt;/p&gt;&lt;br /&gt;&lt;div class="informalexample"&gt;&lt;br /&gt;&lt;pre class="literallayout"&gt;&lt;br /&gt;div.file-highlight-on,&lt;br /&gt;div.file-details.file-highlight-on {&lt;br /&gt;    background: url('images/stripes_darker.png');&lt;br /&gt;    padding: 4px;&lt;br /&gt;}&lt;br /&gt;div.file-highlight-off,&lt;br /&gt;div.file-details.file-highlight-off {&lt;br /&gt;    background: transparent;&lt;br /&gt;    padding: 4px;&lt;br /&gt;    border: none;&lt;br /&gt;}&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;table.file-wdetails {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    font: 12px sans-serif;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    width: 100%;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;table.file-wdetails th {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    text-align: left;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li class="listitem"&gt;&lt;br /&gt;&lt;p class="first-para"&gt;Save &lt;span class="fixed"&gt;&lt;span class="inlinemediaobject"&gt;&amp;nbsp;views.css&lt;/span&gt;&lt;/span&gt;.&lt;/p&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;p class="para"&gt;The modifications you made result in the output you see in Figure 9-13.&lt;/p&gt;&lt;br /&gt;&lt;div class="figure"&gt;&lt;br /&gt;&lt;span class="figuremediaobject"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br style="line-height: 1"&gt;&lt;br /&gt;&lt;span class="figure-title"&gt;&lt;span class="figure-titlelabel"&gt;Figure 9-13&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="para"&gt;The CSS modifications you made were very simple: specify the font, make the &lt;span class="fixed"&gt;&amp;lt;table&amp;gt;&lt;/span&gt; housing the file details take up all of the space available to it, and align the &lt;span class="fixed"&gt;&amp;lt;th&amp;gt;&lt;/span&gt; fields to the left.&lt;/p&gt;&lt;br /&gt;&lt;p class="last-para"&gt;The next section discusses how to modify hFinder to make a Save As dialog.&lt;/p&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="section"&gt;&lt;br /&gt;&lt;h3 class="sect3-title"&gt;&lt;br /&gt;Save As Dialog&lt;/h3&gt;&lt;br /&gt;&lt;p class="first-para"&gt;To make a Save As dialog, the modifications are also relatively simple. To see how it's done, follow these steps:&lt;/p&gt;&lt;br /&gt;&lt;ol class="orderedlist"&gt;&lt;br /&gt;&lt;li class="first-listitem"&gt;&lt;br /&gt;&lt;p class="first-para"&gt;Using the &lt;span class="fixed"&gt;&lt;span class="inlinemediaobject"&gt;&amp;nbsp;hFinder.list.html&lt;/span&gt;&lt;/span&gt; file on the source CD-ROM, make the following modifications:&lt;/p&gt;&lt;br /&gt;&lt;div class="informalexample"&gt;&lt;br /&gt;&lt;pre class="literallayout"&gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"&lt;br /&gt;"http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-transitional.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'&amp;gt;&lt;br /&gt;    &amp;lt;head&amp;gt;&lt;br /&gt;        &amp;lt;meta http-equiv='content-type' content='text/html; charset=utf-8' /&amp;gt;&lt;br /&gt;        &amp;lt;meta http-equiv='content-language' content='en-us' /&amp;gt;&lt;br /&gt;        &amp;lt;title&amp;gt;hFinder File Management Application&amp;lt;/title&amp;gt;&lt;br /&gt;&lt;br /&gt;            &amp;lt;!-- compliance patch for microsoft browsers --&amp;gt;&lt;br /&gt;            &amp;lt;!--[if lt IE 7]&amp;gt;&lt;br /&gt;                &amp;lt;link rel='stylesheet'&lt;br /&gt;                      type='text/css'&lt;br /&gt;                      href='styles/hFinder.ie.css' /&amp;gt;&lt;br /&gt;                &amp;lt;link rel='stylesheet'&lt;br /&gt;                      type='text/css'&lt;br /&gt;                      href='styles/tree.ie.css' /&amp;gt;&lt;br /&gt;                &amp;lt;script type='text/javascript'&lt;br /&gt;                        src='scripts/cssQuery/cssQuery-p.js'&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;                &amp;lt;script type='text/javascript'&lt;br /&gt;                        src='scripts/png.js'&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;                &amp;lt;script src="/ie7/ie7-standard-p.js" type="text/javascript"&amp;gt;&lt;br /&gt;                &amp;lt;/script&amp;gt;&lt;br /&gt;            &amp;lt;![endif]--&amp;gt;&lt;br /&gt;            &amp;lt;link rel='stylesheet' type='text/css' href='styles/hFinder.css' /&amp;gt;&lt;br /&gt;          &amp;lt;/head&amp;gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    &amp;lt;body id='hfinder-dialog'&amp;gt;&lt;/span&gt;&lt;br /&gt;        &amp;lt;div id='hfinder-toolbar'&amp;gt;&lt;br /&gt;            &amp;lt;table style='width: 100%; border-collapse: collapse;'&amp;gt;&lt;br /&gt;                &amp;lt;tbody&amp;gt;&lt;br /&gt;                    &amp;lt;tr&amp;gt;&lt;br /&gt;                        &amp;lt;td style='width: 35px;'&amp;gt;&lt;br /&gt;                            &amp;lt;img src='images/back.png'&lt;br /&gt;                                 alt='Back'&lt;br /&gt;                                 title='Back'&lt;br /&gt;                                 class='hfinder-toolbar-control'&lt;br /&gt;                                 id='hfinder-back' /&amp;gt;&lt;br /&gt;                        &amp;lt;/td&amp;gt;&lt;br /&gt;                        &amp;lt;td style='width: 35px;'&amp;gt;&lt;br /&gt;                            &amp;lt;img src='images/forward.png'&lt;br /&gt;                                 alt='Forward'&lt;br /&gt;                                 title='Forward'&lt;br /&gt;                                 class='hfinder-toolbar-control'&lt;br /&gt;                                 id='hfinder-forward' /&amp;gt;&lt;br /&gt;                        &amp;lt;/td&amp;gt;&lt;br /&gt;                        &amp;lt;td style='width: 35px;'&amp;gt;&lt;br /&gt;                            &amp;lt;img src='images/refresh.png'&lt;br /&gt;                                 alt='Refresh'&lt;br /&gt;                                 title='Refresh'&lt;br /&gt;                                 class='hfinder-toolbar-control'&lt;br /&gt;                                 id='hfinder-refresh' /&amp;gt;&lt;br /&gt;                        &amp;lt;/td&amp;gt;&lt;br /&gt;                        &amp;lt;td style='width: 35px;'&amp;gt;&lt;br /&gt;                            &amp;lt;img src='images/home.png'&lt;br /&gt;                                 alt='Home'&lt;br /&gt;                                 title='Home'&lt;br /&gt;                                 class='hfinder-toolbar-control'&lt;br /&gt;                                 id='hfinder-home' /&amp;gt;&lt;br /&gt;                        &amp;lt;/td&amp;gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                           &amp;lt;div id='file-location'&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                               &amp;lt;div id='file-location-inner'&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                                   &amp;lt;img src='images/drop-arrow.png'&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                                        id='file-location-arrow'&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                                        alt='arrow' /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                                  &amp;lt;ul&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                                      &amp;lt;li title='/'&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                                          &amp;lt;span&amp;gt;Hard drive&amp;lt;/span&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                                      &amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                                      &amp;lt;!--&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                                          You may want to test what happens&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                                          when multiple directories are included&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                                          to do so, remove the comments around&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                                          the following &amp;lt;li&amp;gt; element&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                                      &amp;lt;li title='/account'&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                                          &amp;lt;span&amp;gt;account&amp;lt;/span&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                                      &amp;lt;/li&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                                      --&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                                  &amp;lt;/ul&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                               &amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                           &amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                       &amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                       &amp;lt;td style='width: 35px;'&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                           &amp;lt;img src='images/views.png'&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                                alt='Change Views'&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                                title='Change Views'&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                                class='hfinder-toolbar-control'&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                                id='hfinder-location-change-views' /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                       &amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;                       &amp;lt;td style='width: 35px;'&amp;gt;&lt;br /&gt;                           &amp;lt;img src='images/directory.png'&lt;br /&gt;                                alt='New Directory'&lt;br /&gt;                                title='New Directory'&lt;br /&gt;                                class='hfinder-toolbar-control'&lt;br /&gt;                                id='hfinder-new-directory' /&amp;gt;&lt;br /&gt;                       &amp;lt;/td&amp;gt;&lt;br /&gt;                       &amp;lt;td style='width: 35px;'&amp;gt;&lt;br /&gt;                           &amp;lt;img src='images/file.png'&lt;br /&gt;                                alt='New File'&lt;br /&gt;                                title='New File'&lt;br /&gt;                                class='hfinder-toolbar-control'&lt;br /&gt;                                id='hfinder-new-file' /&amp;gt;&lt;br /&gt;                       &amp;lt;/td&amp;gt;&lt;br /&gt;                   &amp;lt;/tr&amp;gt;&lt;br /&gt;               &amp;lt;/tbody&amp;gt;&lt;br /&gt;           &amp;lt;/table&amp;gt;&lt;br /&gt;       &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;div id='hfinder-files'&amp;gt;&lt;br /&gt;           &amp;lt;div id='dir-3645'&lt;br /&gt;                class='file-list file-directory'&lt;br /&gt;                title='account'&amp;gt;&lt;br /&gt;               &amp;lt;div&amp;gt;&lt;br /&gt;                   &amp;lt;div class='file-icon-wrapper'&amp;gt;&lt;br /&gt;                       &amp;lt;img src='images/16x16/MacOSXAqua_012.png'&lt;br /&gt;                            class='file-list-img'&lt;br /&gt;                            alt='folder' /&amp;gt;&lt;br /&gt;                   &amp;lt;/div&amp;gt;&lt;br /&gt;                   &amp;lt;div class='file-list-caption file-caption-wrapper'&amp;gt;&lt;br /&gt;                       &amp;lt;span class='file-name'&amp;gt;account&amp;lt;/span&amp;gt;&lt;br /&gt;                   &amp;lt;/div&amp;gt;&lt;br /&gt;&lt;br /&gt;           &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;div id='dir-31'&lt;br /&gt;            class='file-list file-directory'&lt;br /&gt;            title='cp'&amp;gt;&lt;br /&gt;           &amp;lt;div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-icon-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;img src='images/16x16/MacOSXAqua_012.png'&lt;br /&gt;                        class='file-list-img'&lt;br /&gt;                        alt='folder' /&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-list-caption file-caption-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;span class='file-name'&amp;gt;cp&amp;lt;/span&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;           &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;div id='dir-3785'&lt;br /&gt;            class='file-list file-directory'&lt;br /&gt;            title='daemons'&amp;gt;&lt;br /&gt;           &amp;lt;div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-icon-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;img src='images/16x16/MacOSXAqua_012.png'&lt;br /&gt;                        class='file-list-img'&lt;br /&gt;                        alt='folder' /&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-list-caption file-caption-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;span class='file-name'&amp;gt;daemons&amp;lt;/span&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;           &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;div id='dir-3677'&lt;br /&gt;            class='file-list file-directory'&lt;br /&gt;            title='file'&amp;gt;&lt;br /&gt;           &amp;lt;div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-icon-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;img src='images/16x16/MacOSXAqua_012.png'&lt;br /&gt;                        class='file-list-img'&lt;br /&gt;                        alt='folder' /&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-list-caption file-caption-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;span class='file-name'&amp;gt;file&amp;lt;/span&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;           &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;div id='dir-26'&lt;br /&gt;            class='file-list file-directory'&lt;br /&gt;            title='forum'&amp;gt;&lt;br /&gt;           &amp;lt;div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-icon-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;img src='images/16x16/MacOSXAqua_012.png'&lt;br /&gt;                        class='file-list-img'&lt;br /&gt;                        alt='folder' /&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-list-caption file-caption-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;span class='file-name'&amp;gt;forum&amp;lt;/span&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;&lt;br /&gt;           &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;div id='dir-3651'&lt;br /&gt;            class='file-list file-directory'&lt;br /&gt;            title='home'&amp;gt;&lt;br /&gt;           &amp;lt;div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-icon-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;img src='images/16x16/MacOSXAqua_012.png'&lt;br /&gt;                        class='file-list-img'&lt;br /&gt;                        alt='folder' /&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-list-caption file-caption-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;span class='file-name'&amp;gt;home&amp;lt;/span&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;           &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;div id='dir-3681'&lt;br /&gt;            class='file-list file-directory'&lt;br /&gt;            title='images'&amp;gt;&lt;br /&gt;           &amp;lt;div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-icon-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;img src='images/16x16/MacOSXAqua_012.png'&lt;br /&gt;                        class='file-list-img'&lt;br /&gt;                        alt='folder' /&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-list-caption file-caption-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;span class='file-name'&amp;gt;images&amp;lt;/span&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;           &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;div id='dir-3690'&lt;br /&gt;            class='file-list file-directory'&lt;br /&gt;            title='js'&amp;gt;&lt;br /&gt;           &amp;lt;div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-icon-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;img src='images/16x16/MacOSXAqua_012.png'&lt;br /&gt;                        class='file-list-img'&lt;br /&gt;                        alt='folder' /&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-list-caption file-caption-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;span class='file-name'&amp;gt;js&amp;lt;/span&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;           &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;div id='dir-30'&lt;br /&gt;            class='file-list file-directory'&lt;br /&gt;            title='listener'&amp;gt;&lt;br /&gt;           &amp;lt;div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-icon-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;img src='images/16x16/MacOSXAqua_012.png'&lt;br /&gt;                        class='file-list-img'&lt;br /&gt;                        alt='folder' /&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-list-caption file-caption-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;span class='file-name'&amp;gt;listener&amp;lt;/span&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;&lt;br /&gt;           &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;div id='dir-29'&lt;br /&gt;            class='file-list file-directory'&lt;br /&gt;            title='logout'&amp;gt;&lt;br /&gt;           &amp;lt;div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-icon-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;img src='images/16x16/MacOSXAqua_012.png'&lt;br /&gt;                        class='file-list-img'&lt;br /&gt;                        alt='folder' /&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-list-caption file-caption-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;span class='file-name'&amp;gt;logout&amp;lt;/span&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;           &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;div id='dir-3682'&lt;br /&gt;            class='file-list file-directory'&lt;br /&gt;            title='media'&amp;gt;&lt;br /&gt;           &amp;lt;div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-icon-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;img src='images/16x16/MacOSXAqua_012.png'&lt;br /&gt;                        class='file-list-img'&lt;br /&gt;                        alt='folder' /&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-list-caption file-caption-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;span class='file-name'&amp;gt;media&amp;lt;/span&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;           &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;div id='dir-3667'&lt;br /&gt;            class='file-list file-directory'&lt;br /&gt;            title='network'&amp;gt;&lt;br /&gt;           &amp;lt;div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-icon-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;img src='images/16x16/MacOSXAqua_012.png'&lt;br /&gt;                        class='file-list-img'&lt;br /&gt;                        alt='folder' /&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-list-caption file-caption-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;span class='file-name'&amp;gt;network&amp;lt;/span&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;           &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;div id='dir-3735'&lt;br /&gt;            class='file-list file-directory'&lt;br /&gt;            title='products'&amp;gt;&lt;br /&gt;           &amp;lt;div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-icon-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;img src='images/16x16/MacOSXAqua_012.png'&lt;br /&gt;                        class='file-list-img'&lt;br /&gt;                        alt='folder' /&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-list-caption file-caption-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;span class='file-name'&amp;gt;products&amp;lt;/span&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;&lt;br /&gt;           &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;div id='dir-28'&lt;br /&gt;            class='file-list file-directory'&lt;br /&gt;            title='register'&amp;gt;&lt;br /&gt;           &amp;lt;div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-icon-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;img src='images/16x16/MacOSXAqua_012.png'&lt;br /&gt;                        class='file-list-img'&lt;br /&gt;                        alt='folder' /&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-list-caption file-caption-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;span class='file-name'&amp;gt;register&amp;lt;/span&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;           &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;div id='dir-3784'&lt;br /&gt;            class='file-list file-directory'&lt;br /&gt;            title='search'&amp;gt;&lt;br /&gt;           &amp;lt;div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-icon-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;img src='images/16x16/MacOSXAqua_012.png'&lt;br /&gt;                        class='file-list-img'&lt;br /&gt;                        alt='search' /&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-list-caption file-caption-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;span class='file-name'&amp;gt;search&amp;lt;/span&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;           &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;div id='reg-112'&lt;br /&gt;            class='file-list file-registry-doc'&lt;br /&gt;            title='File Not Found'&amp;gt;&lt;br /&gt;           &amp;lt;div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-icon-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;img src='images/16x16/21.png'&lt;br /&gt;                        title='text/html'&lt;br /&gt;                        alt='text/html'&lt;br /&gt;                        class='file-list-img' /&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-list-caption file-caption-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;span class='file-name' id='freg-112'&amp;gt;404.html&amp;lt;/span&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;           &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;div id='reg-1'&lt;br /&gt;            class='file-list file-registry-doc'&lt;br /&gt;            title='Welcome'&amp;gt;&lt;br /&gt;           &amp;lt;div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-icon-wrapper'&amp;gt;&lt;br /&gt;                   &amp;lt;img src='images/16x16/21.png'&lt;br /&gt;                        alt='text/html'&lt;br /&gt;                        title='text/html'&lt;br /&gt;                        class='file-list-img' /&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;               &amp;lt;div class='file-list-caption file-caption-wrapper'&amp;gt;&lt;br /&gt;&lt;br /&gt;                       &amp;lt;span class='file-name' id='freg-1'&amp;gt;index.html&amp;lt;/span&amp;gt;&lt;br /&gt;                   &amp;lt;/div&amp;gt;&lt;br /&gt;               &amp;lt;/div&amp;gt;&lt;br /&gt;           &amp;lt;/div&amp;gt;&lt;br /&gt;       &amp;lt;/div&amp;gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;       &amp;lt;div id='hfinder-dialog-controls'&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;           &amp;lt;form action='javascript:void(0);' method='post'&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;               &amp;lt;table&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                   &amp;lt;colgroup&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                       &amp;lt;col /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                       &amp;lt;col style='width: 5%;' /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                       &amp;lt;col style='width: 5%;' /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                   &amp;lt;/colgroup&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                   &amp;lt;tbody&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                       &amp;lt;tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                           &amp;lt;td&amp;gt;&amp;lt;input type='text'&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                                      name='fname' value='' id='file-name' /&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                           &amp;lt;td&amp;gt;&amp;lt;input type='submit'&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                                      name='save' value='Save' /&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                           &amp;lt;td&amp;gt;&amp;lt;input type='submit'&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                                      name='cancel' value='Cancel' /&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                       &amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                   &amp;lt;/tbody&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;               &amp;lt;/table&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;           &amp;lt;/form&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;       &amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;       &amp;lt;div id='hfinder-contextmenu'&amp;gt;&lt;br /&gt;           &amp;lt;ul&amp;gt;&lt;br /&gt;               &amp;lt;li id='context-open' class='sep'&amp;gt;&lt;br /&gt;                   &amp;lt;span style='font-weight: bold;'&amp;gt;Open&amp;lt;/span&amp;gt;&lt;br /&gt;               &amp;lt;/li&amp;gt;&lt;br /&gt;               &amp;lt;li id='context-control-panel'&amp;gt;&lt;br /&gt;                   &amp;lt;span&amp;gt;Control Panel&amp;lt;/span&amp;gt;&lt;br /&gt;               &amp;lt;/li&amp;gt;&lt;br /&gt;               &amp;lt;li id='context-title-description' class='sep'&amp;gt;&lt;br /&gt;                   &amp;lt;span&amp;gt;Modify Title and Description&amp;lt;/span&amp;gt;&lt;br /&gt;               &amp;lt;/li&amp;gt;&lt;br /&gt;               &amp;lt;li id='context-delete'&amp;gt;&lt;br /&gt;                   &amp;lt;span&amp;gt;Delete&amp;lt;/span&amp;gt;&lt;br /&gt;               &amp;lt;/li&amp;gt;&lt;br /&gt;               &amp;lt;li id='context-rename' class='sep'&amp;gt;&lt;br /&gt;                   &amp;lt;span&amp;gt;Rename&amp;lt;/span&amp;gt;&lt;br /&gt;               &amp;lt;/li&amp;gt;&lt;br /&gt;               &amp;lt;li id='context-properties'&amp;gt;&lt;br /&gt;                   &amp;lt;span&amp;gt;Properties&amp;lt;/span&amp;gt;&lt;br /&gt;               &amp;lt;/li&amp;gt;&lt;br /&gt;               &amp;lt;li id='context-permissions'&amp;gt;&lt;br /&gt;                   &amp;lt;span&amp;gt;Permissions&amp;lt;/span&amp;gt;&lt;br /&gt;               &amp;lt;/li&amp;gt;&lt;br /&gt;           &amp;lt;/ul&amp;gt;&lt;br /&gt;       &amp;lt;/div&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li class="listitem"&gt;&lt;br /&gt;&lt;p class="first-para"&gt;Save the preceding modifications as &lt;span class="fixed"&gt;&lt;span class="inlinemediaobject"&gt;&amp;nbsp;hFinder.saveas.html&lt;/span&gt;&lt;/span&gt;.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li class="listitem"&gt;&lt;br /&gt;&lt;p class="first-para"&gt;Make the following modifications to &lt;span class="fixed"&gt;&lt;span class="inlinemediaobject"&gt;&amp;nbsp;hFinder.css&lt;/span&gt;&lt;/span&gt;:&lt;/p&gt;&lt;br /&gt;&lt;div class="informalexample"&gt;&lt;br /&gt;&lt;pre class="literallayout"&gt;&lt;br /&gt;div#hfinder-tree {&lt;br /&gt;    position: absolute;&lt;br /&gt;    top: 0;&lt;br /&gt;    bottom: 0;&lt;br /&gt;    left: 0;&lt;br /&gt;    margin: 73px 0 10px 10px;&lt;br /&gt;    width: 190px;&lt;br /&gt;    background: white;&lt;br /&gt;    overflow: auto;&lt;br /&gt;    border: 1px solid rgb(128, 128, 128);&lt;br /&gt;    z-index: 1;&lt;br /&gt;}&lt;br /&gt;div#hfinder-files {&lt;br /&gt;    margin: 73px 10px 10px 210px;&lt;br /&gt;    position: absolute;&lt;br /&gt;    top: 0;&lt;br /&gt;    bottom: 0;&lt;br /&gt;    left: 0;&lt;br /&gt;    right: 0;&lt;br /&gt;    border: 1px solid rgb(128, 128, 128);&lt;br /&gt;    background: white url('../images/stripes.png');&lt;br /&gt;    z-index: 1;&lt;br /&gt;    overflow: auto;&lt;br /&gt;}&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;body#hfinder-dialog div#hfinder-toolbar {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    margin: 10px 10px 0 10px;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;body#hfinder-dialog div#hfinder-files {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    margin: 53px 10px 53px 10px;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;div#hfinder-dialog-controls {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    position: absolute;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    bottom: 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    left: 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    right: 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    margin: 0 7px 0 7px;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;div#hfinder-dialog-controls input#file-name {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    background: white url('../images/stripes.png');&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    width: 98%;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;div#hfinder-dialog-controls table {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    width: 100%;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;div#file-location {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    height: 30px;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    position: relative;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    z-index: 2;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;div#file-location-inner {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    background: white url('../images/stripes.png');&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    height: 30px;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    overflow: hidden;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    border: 1px solid rgb(128, 128, 128);&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    font: 12px sans-serif;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    position: absolute;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    top: 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    left: 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    right: 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;div#file-location ul {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    list-style: none;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    margin: 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    padding: 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    position: absolute;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    bottom: 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    left: 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;div#file-location ul li {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    height: 30px;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    white-space: nowrap;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    overflow: hidden;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    background: url('../images/24x24/MacOSXAqua_012.png') no-repeat 10px center;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    padding-left: 40px;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;div#file-location ul li span {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    line-height: 30px;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    vertical-align: middle;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;div#file-location ul li:first-child {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    background: url('../images/24x24/MacOSXAqua_037.png') no-repeat 10px center;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;img#file-location-arrow {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    position: absolute;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    top: 5px;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    right: 5px;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li class="listitem"&gt;&lt;br /&gt;&lt;p class="first-para"&gt;Save &lt;span class="fixed"&gt;&lt;span class="inlinemediaobject"&gt;&amp;nbsp;hFinder.css&lt;/span&gt;&lt;/span&gt;.&lt;/p&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;p class="para"&gt;The result of the modifications is shown in Figure 9-14.&lt;/p&gt;&lt;br /&gt;&lt;div class="figure"&gt;&lt;br /&gt;&lt;span class="figuremediaobject"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br style="line-height: 1"&gt;&lt;br /&gt;&lt;span class="figure-title"&gt;&lt;span class="figure-titlelabel"&gt;Figure 9-14&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class="para"&gt;This series of modifications was quite a bit more complicated than implementing Windows-style Details view. In the Save As dialog you've removed the menus and the tree view, where the file location input was. A &lt;span class="fixed"&gt;&amp;lt;div&amp;gt;&lt;/span&gt; and &lt;span class="fixed"&gt;&amp;lt;ul&amp;gt;&lt;/span&gt; were added, which are intended to be the drop-down menu functionality that you find in a Save As dialog. This can be seen in Figure 9-15.&lt;/p&gt;&lt;br /&gt;&lt;div class="figure"&gt;&lt;br /&gt;&lt;span class="figuremediaobject"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br style="line-height: 1"&gt;&lt;br /&gt;&lt;span class="figure-title"&gt;&lt;span class="figure-titlelabel"&gt;Figure 9-15&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="para"&gt;&lt;br /&gt;Figure 9-16 shows the same dialog with the drop-down dialog closed.&lt;/p&gt;&lt;br /&gt;&lt;div class="figure"&gt;&lt;br /&gt;&lt;span class="figuremediaobject"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br style="line-height: 1"&gt;&lt;br /&gt;&lt;span class="figure-title"&gt;&lt;span class="figure-titlelabel"&gt;Figure 9-16&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class="para"&gt;The drop-down navigation in hFinder is more simplified than that used by Windows. Because for this application there are not multiple drives to display, the drop-down navigation in hFinder is intended to show only the file path to the directory the user is currently viewing, and provide an easy method to jump to the other directories in that hierarchy.&lt;/p&gt;&lt;br /&gt;&lt;p class="para"&gt;When the user is browsing the file system, this box can be populated with the current file path. To the right of the drop-down navigation, a new icon for changing file views is added, and the Go icon was removed. Beneath the &lt;span class="fixed"&gt;&amp;lt;div&amp;gt;&lt;/span&gt; element containing files and directories is a new form, which would be used to enter the new file name for the file you're saving.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="para"&gt;In &lt;span class="fixed"&gt;&lt;span class="inlinemediaobject"&gt;&amp;nbsp;hFinder.css&lt;/span&gt;&lt;/span&gt;, you made some modifications to accommodate the Save As dialog. The first rule you applied takes advantage of the id name you applied to the &lt;span class="fixed"&gt;&amp;lt;body&amp;gt;&lt;/span&gt; element. The addition of the id name to the &lt;span class="fixed"&gt;&amp;lt;body&amp;gt;&lt;/span&gt; element allows you to override other style sheet rules via the cascade. In that first rule, you override the margin applied to the &lt;span class="fixed"&gt;&amp;lt;div&amp;gt;&lt;/span&gt; with an &lt;span class="fixed"&gt;hfinder-toolbar&lt;/span&gt; id name; its margin is reduced in response to removing the top menus File, View, Admin, and Help:&lt;/p&gt;&lt;br /&gt;&lt;div class="informalexample"&gt;&lt;br /&gt;&lt;pre class="literallayout"&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;body#hfinder-dialog div#hfinder-toolbar {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    margin: 10px 10px 0 10px;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class="para"&gt;As was the case in the previous rule, the margin for the &lt;span class="fixed"&gt;&amp;lt;div&amp;gt;&lt;/span&gt; with an &lt;span class="fixed"&gt;hfinder-files&lt;/span&gt; id name also needed a margin adjustment to facilitate the removal of the tree view and the menus from the top. The bottom margin also needed to be larger to make room for the new form at the bottom of the document:&lt;/p&gt;&lt;br /&gt;&lt;div class="informalexample"&gt;&lt;br /&gt;&lt;pre class="literallayout"&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;body#hfinder-dialog div#hfinder-files {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    margin: 53px 10px 53px 10px;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class="para"&gt;Because the &lt;span class="fixed"&gt;&amp;lt;div&amp;gt;&lt;/span&gt; containing the files and directories is positioned absolutely, any element inserted after it must be positioned absolutely as well. The &lt;span class="fixed"&gt;&amp;lt;div&amp;gt;&lt;/span&gt; housing the form at the bottom of the hFinder document (which provides controls for a user to enter a new file name to save a document) is positioned absolutely to the bottom of the viewport, and stretched from the left to the right border of the viewport. Then left and right margins are adjusted to line up the form with the &lt;span class="fixed"&gt;&amp;lt;div&amp;gt;&lt;/span&gt; housing directories and files above it:&lt;/p&gt;&lt;br /&gt;&lt;div class="informalexample"&gt;&lt;br /&gt;&lt;pre class="literallayout"&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;div#hfinder-dialog-controls {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    position: absolute;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    bottom: 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    left: 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    right: 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    margin: 0 7px 0 7px;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class="para"&gt;The &lt;span class="fixed"&gt;&amp;lt;input /&amp;gt;&lt;/span&gt; element for new file names is given a width of 98% and a pinstripe background:&lt;/p&gt;&lt;br /&gt;&lt;div class="informalexample"&gt;&lt;br /&gt;&lt;pre class="literallayout"&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;div#hfinder-dialog-controls input#file-name {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    background: white url('../images/stripes.png');&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    width: 98%;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class="para"&gt;The &lt;span class="fixed"&gt;&amp;lt;table&amp;gt;&lt;/span&gt; housing the &lt;span class="fixed"&gt;&amp;lt;input /&amp;gt;&lt;/span&gt; for a new file name and the Save and Cancel buttons is then given a width of 100%:&lt;/p&gt;&lt;br /&gt;&lt;div class="informalexample"&gt;&lt;br /&gt;&lt;pre class="literallayout"&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;div#hfinder-dialog-controls table {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    width: 100%;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class="para"&gt;The &lt;span class="fixed"&gt;&amp;lt;div&amp;gt;&lt;/span&gt; at the top of the document that houses the new drop-down navigation control is next to be styled. It receives an explicit height of 30 pixels; a relative position so that descendant elements positioned absolutely will position relative to it, and a position along the z-axis:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="informalexample"&gt;&lt;br /&gt;&lt;pre class="literallayout"&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;div#file-location {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    height: 30px;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    position: relative;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    z-index: 2;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class="para"&gt;The following rule is for the &lt;span class="fixed"&gt;&amp;lt;div&amp;gt;&lt;/span&gt; nested within the "file-location" &lt;span class="fixed"&gt;&amp;lt;div&amp;gt;&lt;/span&gt; element. It has a &lt;span class="fixed"&gt;file-location-inner&lt;/span&gt; id name. A nested &lt;span class="fixed"&gt;&amp;lt;div&amp;gt;&lt;/span&gt; is required for purposes of layering. Because a &lt;span class="fixed"&gt;position: relative;&lt;/span&gt; declaration has no effect when applied to a &lt;span class="fixed"&gt;&amp;lt;td&amp;gt;&lt;/span&gt; element, a nested &lt;span class="fixed"&gt;&amp;lt;div&amp;gt;&lt;/span&gt; element allows you to circumvent the need to apply &lt;span class="fixed"&gt;position: relative;&lt;/span&gt; to the &lt;span class="fixed"&gt;&amp;lt;td&amp;gt;&lt;/span&gt; element. Now armed with an element to position relative to, the nested &lt;span class="fixed"&gt;file-location-inner &amp;lt;div&amp;gt;&lt;/span&gt; element is positioned absolutely, relative to its parent. It receives a pinstripe background and a height of 30 pixels. The &lt;span class="fixed"&gt;overflow: hidden;&lt;/span&gt; declaration prevents descendant content that is larger than the boundaries of the &lt;span class="fixed"&gt;file-location-inner &amp;lt;div&amp;gt;&lt;/span&gt; element from being seen, and plays a large role in developing a drop-down menu that displays only the last directory in the current file path. More on that when you get to the next rule. A 12-pixel, generic sans-serif font is specified. Finally, the &lt;span class="fixed"&gt;&amp;lt;div&amp;gt;&lt;/span&gt; is stretched for the entire width of the element it is positioned relative to, its parent. Stretching the element lets it resize with the width of the window:&lt;/p&gt;&lt;br /&gt;&lt;div class="informalexample"&gt;&lt;br /&gt;&lt;pre class="literallayout"&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;div#file-location-inner {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    background: white url('../images/stripes.png');&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    height: 30px;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    overflow: hidden;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    border: 1px solid rgb(128, 128, 128);&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    font: 12px sans-serif;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    position: absolute;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    top: 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    left: 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    right: 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class="para"&gt;Within the drop-down navigation &lt;span class="fixed"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;, the current file path is housed in a &lt;span class="fixed"&gt;&amp;lt;ul&amp;gt;&lt;/span&gt; element, which would be changed by a JavaScript to reflect the file path for whatever directory the user is currently viewing. As would be the case in a Windows Save As dialog, only the very last directory in the path is visible when the drop-down navigation is inactive. To make this work with CSS, the parent &lt;span class="fixed"&gt;file-location-inner &amp;lt;div&amp;gt;&lt;/span&gt; element is given an explicit height of 30 pixels, and the &lt;span class="fixed"&gt;overflow: hidden;&lt;/span&gt; declaration. When those properties are applied with those of the &lt;span class="fixed"&gt;&amp;lt;ul&amp;gt;&lt;/span&gt; element and its children, the result is a drop-down navigation system in which only the last directory in the file path is visible. Ancestor directories in the current file path that exist in the markup are invisible to the user until the user accesses the drop-down navigation, which would be done by attaching a JavaScript &lt;span class="fixed"&gt;onclick&lt;/span&gt; event to the &lt;span class="fixed"&gt;file-location-inner &amp;lt;div&amp;gt;&lt;/span&gt;. On clicking the &lt;span class="fixed"&gt;file-location-inner &amp;lt;div&amp;gt;&lt;/span&gt;, the &lt;span class="fixed"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;'s height is adjusted so that all of the directories in the path are visible, thereby giving the user a method to easily navigate to directories in the current file path:&lt;/p&gt;&lt;br /&gt;&lt;div class="informalexample"&gt;&lt;br /&gt;&lt;pre class="literallayout"&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;div#file-location ul {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    list-style: none;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    margin: 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    padding: 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    position: absolute;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    bottom: 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    left: 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class="para"&gt;To hide the ancestor directories that exist in the markup but must be invisible until the drop-down navigation is accessed, the &lt;span class="fixed"&gt;&amp;lt;ul&amp;gt;&lt;/span&gt; element is positioned absolutely to the left and bottom of the &lt;span class="fixed"&gt;file-location-inner &amp;lt;div&amp;gt;&lt;/span&gt;. Then its children &lt;span class="fixed"&gt;&amp;lt;li&amp;gt;&lt;/span&gt; elements are each given a height of 30 pixels, and some properties to ensure that height is always honored. Though most browsers honor an explicit height, Explorer does not always honor an explicit height if an element has more content than the height allows. The height is forced to be honored by the &lt;span class="fixed"&gt;white-space: nowrap;&lt;/span&gt; and &lt;span class="fixed"&gt;overflow: hidden;&lt;/span&gt; declarations. Now if a directory's name is too long to fit, it will be clipped at the width of the &lt;span class="fixed"&gt;&amp;lt;li&amp;gt;&lt;/span&gt; element. Then each directory needs an icon; &lt;span class="fixed"&gt;&lt;span class="inlinemediaobject"&gt;&amp;nbsp;MacOSXAqua_012.png&lt;/span&gt;&lt;/span&gt; is the folder icon. It is positioned 10 pixels offset from the left of the &lt;span class="fixed"&gt;&amp;lt;li&amp;gt;&lt;/span&gt; element and centered vertically. The &lt;span class="fixed"&gt;padding-left: 40px;&lt;/span&gt; declaration prevents the text of the directory name from overlapping the icon. One essential element of a Save As dialog drop-down navigation is not accomplished with the CSS as it is written here, and that is indenting the directories in the path to show their relationship with one another. This is another aspect of the application that must be done with the JavaScript. In the completed application, the offset of the background image and the &lt;span class="fixed"&gt;padding-left&lt;/span&gt; property would be adjusted in the JavaScript to indent each descendant directory a little further to the right:&lt;/p&gt;&lt;br /&gt;&lt;div class="informalexample"&gt;&lt;br /&gt;&lt;pre class="literallayout"&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;div#file-location ul li {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    height: 30px;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    white-space: nowrap;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    overflow: hidden;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    background: url('../images/24x24/MacOSXAqua_012.png') no-repeat 10px center;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    padding-left: 40px;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class="para"&gt;Next the text of the directory name must be adjusted so that it is centered vertically just as the icon was in the preceding rule. The text is centered vertically by adjusting the line-height of the &lt;span class="fixed"&gt;&amp;lt;span&amp;gt;&lt;/span&gt; element to 30 pixels (same height as the parent &lt;span class="fixed"&gt;&amp;lt;li&amp;gt;&lt;/span&gt; element), and then applying the &lt;span class="fixed"&gt;vertical-align: middle;&lt;/span&gt; declaration. A nested &lt;span class="fixed"&gt;&amp;lt;span&amp;gt;&lt;/span&gt; element is required here because the &lt;span class="fixed"&gt;vertical-align&lt;/span&gt; property only applies to inline or &lt;span class="fixed"&gt;&amp;lt;tr&amp;gt;, &amp;lt;th&amp;gt;&lt;/span&gt;, or &lt;span class="fixed"&gt;&amp;lt;td&amp;gt;&lt;/span&gt; elements. Because the purpose of the &lt;span class="fixed"&gt;vertical-align&lt;/span&gt; property is to align text vertically relative to a line's baseline (as applied to inline elements), the line-height must be first adjusted to match the height of the parent &lt;span class="fixed"&gt;&amp;lt;li&amp;gt;&lt;/span&gt; element for the &lt;span class="fixed"&gt;vertical-align&lt;/span&gt; property to provide the desired results:&lt;/p&gt;&lt;br /&gt;&lt;div class="informalexample"&gt;&lt;br /&gt;&lt;pre class="literallayout"&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;div#file-location ul li span {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    line-height: 30px;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    vertical-align: middle;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class="para"&gt;The topmost directory is always the first in the list. This directory is special because it is the root directory. It receives a different icon than the other directories, and this is done via the &lt;span class="fixed"&gt;:first-child&lt;/span&gt; pseudo-class. The image, &lt;span class="fixed"&gt;&lt;span class="inlinemediaobject"&gt;&amp;nbsp;MacOSXAqua_037.png&lt;/span&gt;&lt;/span&gt;, is a Mac hard drive icon:&lt;/p&gt;&lt;br /&gt;&lt;div class="informalexample"&gt;&lt;br /&gt;&lt;pre class="literallayout"&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;div#file-location ul li:first-child {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    background: url('../images/24x24/MacOSXAqua_037.png') no-repeat 10px center;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class="para"&gt;The last rule positions the arrow for the drop-down navigation. It places the arrow 5 pixels from the top and right of the &lt;span class="fixed"&gt;file-location &amp;lt;div&amp;gt;&lt;/span&gt; element:&lt;/p&gt;&lt;br /&gt;&lt;div class="informalexample"&gt;&lt;br /&gt;&lt;pre class="literallayout"&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;img#file-location-arrow {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    position: absolute;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    top: 5px;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    right: 5px;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class="last-para"&gt;The last alternative implementation of hFinder is how to make a Choose a Directory dialog.&lt;/p&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="section"&gt;&lt;br /&gt;&lt;h3 class="sect3-title"&gt;&lt;br /&gt;Choose a Directory Dialog&lt;/h3&gt;&lt;br /&gt;&lt;p class="first-para"&gt;As you've seen throughout this project, hFinder is a complex application that can serve many different functions relating to file management. In fact, I could have spent the entire book on just hFinder alone. Although hFinder is by no means a complete application, you see what's required to handle the presentational aspects of such an application, and what's required to alter such an application to fit different purposes.&lt;/p&gt;&lt;br /&gt;&lt;p class="para"&gt;In the final alternative implementation of hFinder, you see what goes into creating a Choose a Directory dialog. This time you use the tree view, not the directory view. A Choose a Directory dialog, also known as a Browse for Folder dialog, looks like the one in Figure 9-17, which happens to be from the Windows version of iTunes.&lt;/p&gt;&lt;br /&gt;&lt;div class="figure"&gt;&lt;br /&gt;&lt;span class="figuremediaobject"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br style="line-height: 1"&gt;&lt;br /&gt;&lt;span class="figure-title"&gt;&lt;span class="figure-titlelabel"&gt;Figure 9-17&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class="para"&gt;To make a Choose a Directory dialog, follow these steps:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol class="orderedlist"&gt;&lt;br /&gt;&lt;li class="first-listitem"&gt;&lt;br /&gt;&lt;p class="first-para"&gt;Make the following alterations to &lt;span class="fixed"&gt;&lt;span class="inlinemediaobject"&gt;&amp;nbsp;hFinder.html&lt;/span&gt;&lt;/span&gt;:&lt;/p&gt;&lt;br /&gt;&lt;div class="informalexample"&gt;&lt;br /&gt;&lt;pre class="literallayout"&gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"&lt;br /&gt;"http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-transitional.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;      id='hfinder-directory-dialog'&amp;gt;&lt;/span&gt;&lt;br /&gt;    &amp;lt;head&amp;gt;&lt;br /&gt;        &amp;lt;meta http-equiv='content-type' content='text/html; charset=utf-8' /&amp;gt;&lt;br /&gt;        &amp;lt;meta http-equiv='content-language' content='en-us' /&amp;gt;&lt;br /&gt;        &amp;lt;title&amp;gt;hFinder File Management Application&amp;lt;/title&amp;gt;&lt;br /&gt;        &amp;lt;link rel='stylesheet' type='text/css' href='styles/hFinder.css' /&amp;gt;&lt;br /&gt;    &amp;lt;/head&amp;gt;&lt;br /&gt;    &amp;lt;body&amp;gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;        &amp;lt;h4&amp;gt;Choose a Directory...&amp;lt;/h4&amp;gt;&lt;/span&gt;&lt;br /&gt;        &amp;lt;div id='hfinder-tree'&amp;gt;&lt;br /&gt;            &amp;lt;ul class='file-tree'&amp;gt;&lt;br /&gt;                &amp;lt;li&amp;gt;&lt;br /&gt;                    &amp;lt;div class='file-tree-directory file-tree-root'&lt;br /&gt;                         id='tree-dir-1'&amp;gt;&lt;br /&gt;                        &amp;lt;span&amp;gt;Hard drive&amp;lt;/span&amp;gt;&lt;br /&gt;                    &amp;lt;/div&amp;gt;&lt;br /&gt;                    &amp;lt;ul id='directory-1' class='file-tree-dir-list'&amp;gt;&lt;br /&gt;                        &amp;lt;li&amp;gt;&lt;br /&gt;                            &amp;lt;div class='file-tree-directory'&lt;br /&gt;                                 id='tree-dir-3645'&amp;gt;&lt;br /&gt;                                &amp;lt;span&amp;gt;account&amp;lt;/span&amp;gt;&lt;br /&gt;                            &amp;lt;/div&amp;gt;&lt;br /&gt;                            &amp;lt;img src='images/right.png'&lt;br /&gt;                                 class='file-has-children'&lt;br /&gt;                                 id='tree-3645'&lt;br /&gt;                                 alt='+'&lt;br /&gt;                                 title='Click to expand.' /&amp;gt;&lt;br /&gt;                        &amp;lt;/li&amp;gt;&lt;br /&gt;                        &amp;lt;li&amp;gt;&lt;br /&gt;                            &amp;lt;div class='file-tree-directory'&lt;br /&gt;                                 id='tree-dir-31'&amp;gt;&lt;br /&gt;                                &amp;lt;span&amp;gt;cp&amp;lt;/span&amp;gt;&lt;br /&gt;                            &amp;lt;/div&amp;gt;&lt;br /&gt;                        &amp;lt;/li&amp;gt;&lt;br /&gt;                        &amp;lt;li&amp;gt;&lt;br /&gt;                            &amp;lt;div class='file-tree-directory'&lt;br /&gt;                                 id='tree-dir-3785'&amp;gt;&lt;br /&gt;                                &amp;lt;span&amp;gt;daemon&amp;lt;/span&amp;gt;&lt;br /&gt;                            &amp;lt;/div&amp;gt;&lt;br /&gt;                        &amp;lt;/li&amp;gt;&lt;br /&gt;                        &amp;lt;li&amp;gt;&lt;br /&gt;                            &amp;lt;div class='file-tree-directory'&lt;br /&gt;                                 id='tree-dir-3677'&amp;gt;&lt;br /&gt;                                &amp;lt;span&amp;gt;file&amp;lt;/span&amp;gt;&lt;br /&gt;                            &amp;lt;/div&amp;gt;&lt;br /&gt;                       &amp;lt;/li&amp;gt;&lt;br /&gt;                       &amp;lt;li&amp;gt;&lt;br /&gt;                            &amp;lt;div class='file-tree-directory'&lt;br /&gt;                                 id='tree-dir-26'&amp;gt;&lt;br /&gt;                                &amp;lt;span&amp;gt;forum&amp;lt;/span&amp;gt;&lt;br /&gt;                            &amp;lt;/div&amp;gt;&lt;br /&gt;&lt;br /&gt;                       &amp;lt;/li&amp;gt;&lt;br /&gt;                       &amp;lt;li&amp;gt;&lt;br /&gt;                           &amp;lt;div class='file-tree-directory'&lt;br /&gt;                                id='tree-dir-3651'&amp;gt;&lt;br /&gt;                               &amp;lt;span&amp;gt;home&amp;lt;/span&amp;gt;&lt;br /&gt;                           &amp;lt;/div&amp;gt;&lt;br /&gt;                           &amp;lt;img src='images/right.png'&lt;br /&gt;                                class='file-has-children'&lt;br /&gt;                                id='tree-3651'&lt;br /&gt;                                alt='+'&lt;br /&gt;                                title='Click to expand.' /&amp;gt;&lt;br /&gt;                       &amp;lt;/li&amp;gt;&lt;br /&gt;                       &amp;lt;li&amp;gt;&lt;br /&gt;                           &amp;lt;div class='file-tree-directory'&lt;br /&gt;                                id='tree-dir-3681'&amp;gt;&lt;br /&gt;                               &amp;lt;span&amp;gt;images&amp;lt;/span&amp;gt;&lt;br /&gt;                           &amp;lt;/div&amp;gt;&lt;br /&gt;                           &amp;lt;img src='images/right.png'&lt;br /&gt;                                class='file-has-children'&lt;br /&gt;                                id='tree-3681'&lt;br /&gt;                                alt='+'&lt;br /&gt;                                title='Click to expand.' /&amp;gt;&lt;br /&gt;                       &amp;lt;/li&amp;gt;&lt;br /&gt;                       &amp;lt;li&amp;gt;&lt;br /&gt;                           &amp;lt;div class='file-tree-directory'&lt;br /&gt;                                id='tree-dir-3690'&amp;gt;&lt;br /&gt;                               &amp;lt;span&amp;gt;js&amp;lt;/span&amp;gt;&lt;br /&gt;                           &amp;lt;/div&amp;gt;&lt;br /&gt;                           &amp;lt;img src='images/right.png'&lt;br /&gt;                                class='file-has-children'&lt;br /&gt;                                id='tree-3690'&lt;br /&gt;                                alt='+'&lt;br /&gt;                                title='Click to expand.' /&amp;gt;&lt;br /&gt;                       &amp;lt;/li&amp;gt;&lt;br /&gt;                       &amp;lt;li&amp;gt;&lt;br /&gt;                           &amp;lt;div class='file-tree-directory'&lt;br /&gt;                                id='tree-dir-30'&amp;gt;&lt;br /&gt;                               &amp;lt;span&amp;gt;listener&amp;lt;/span&amp;gt;&lt;br /&gt;                           &amp;lt;/div&amp;gt;&lt;br /&gt;                       &amp;lt;/li&amp;gt;&lt;br /&gt;                       &amp;lt;li&amp;gt;&lt;br /&gt;                           &amp;lt;div class='file-tree-directory'&lt;br /&gt;                                id='tree-dir-29'&amp;gt;&lt;br /&gt;                               &amp;lt;span&amp;gt;logout&amp;lt;/span&amp;gt;&lt;br /&gt;                            &amp;lt;/div&amp;gt;&lt;br /&gt;                       &amp;lt;/li&amp;gt;&lt;br /&gt;                       &amp;lt;li&amp;gt;&lt;br /&gt;                            &amp;lt;div class='file-tree-directory'&lt;br /&gt;                                 id='tree-dir-3682'&amp;gt;&lt;br /&gt;                                &amp;lt;span&amp;gt;media&amp;lt;/span&amp;gt;&lt;br /&gt;                            &amp;lt;/div&amp;gt;&lt;br /&gt;                            &amp;lt;img src='images/right.png'&lt;br /&gt;                                 class='file-has-children'&lt;br /&gt;                                 id='tree-3682'&lt;br /&gt;                                 alt='+'&lt;br /&gt;                                 title='Click to expand.' /&amp;gt;&lt;br /&gt;&lt;br /&gt;                       &amp;lt;/li&amp;gt;&lt;br /&gt;                       &amp;lt;li&amp;gt;&lt;br /&gt;                           &amp;lt;div class='file-tree-directory'&lt;br /&gt;                                id='tree-dir-3667'&amp;gt;&lt;br /&gt;                               &amp;lt;span&amp;gt;network&amp;lt;/span&amp;gt;&lt;br /&gt;                           &amp;lt;/div&amp;gt;&lt;br /&gt;                       &amp;lt;/li&amp;gt;&lt;br /&gt;                       &amp;lt;li&amp;gt;&lt;br /&gt;                           &amp;lt;div class='file-tree-directory'&lt;br /&gt;                                id='tree-dir-3735'&amp;gt;&lt;br /&gt;                               &amp;lt;span&amp;gt;products&amp;lt;/span&amp;gt;&lt;br /&gt;                           &amp;lt;/div&amp;gt;&lt;br /&gt;                           &amp;lt;img src='images/right.png'&lt;br /&gt;                                class='file-has-children'&lt;br /&gt;                                id='tree-3735'&lt;br /&gt;                                alt='+'&lt;br /&gt;                                title='Click to expand.' /&amp;gt;&lt;br /&gt;                       &amp;lt;/li&amp;gt;&lt;br /&gt;                       &amp;lt;li&amp;gt;&lt;br /&gt;                           &amp;lt;div class='file-tree-directory'&lt;br /&gt;                                id='tree-dir-28'&amp;gt;&lt;br /&gt;                               &amp;lt;span&amp;gt;register&amp;lt;/span&amp;gt;&lt;br /&gt;                           &amp;lt;/div&amp;gt;&lt;br /&gt;                       &amp;lt;/li&amp;gt;&lt;br /&gt;                       &amp;lt;li&amp;gt;&lt;br /&gt;                           &amp;lt;div class='file-tree-directory'&lt;br /&gt;                                id='tree-dir-3784'&amp;gt;&lt;br /&gt;                               &amp;lt;span&amp;gt;search&amp;lt;/span&amp;gt;&lt;br /&gt;                           &amp;lt;/div&amp;gt;&lt;br /&gt;                       &amp;lt;/li&amp;gt;&lt;br /&gt;                   &amp;lt;/ul&amp;gt;&lt;br /&gt;               &amp;lt;/li&amp;gt;&lt;br /&gt;           &amp;lt;/ul&amp;gt;&lt;br /&gt;        &amp;lt;/div&amp;gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;        &amp;lt;div id='hfinder-dialog-controls'&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;            &amp;lt;form action='javascript:void(0);' method='post'&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                &amp;lt;table&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;colgroup&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;col /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;col style='width: 5%;' /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;col style='width: 5%;' /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;/colgroup&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;tbody&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                            &amp;lt;td&amp;gt;&amp;lt;input type='submit'&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                                       name='new_directory'&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                                       value='New Directory' /&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                            &amp;lt;td&amp;gt;&amp;lt;input type='submit' name='ok' value='Ok' /&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                            &amp;lt;td&amp;gt;&amp;lt;input type='submit'&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                                       name='cancel' value='Cancel' /&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                        &amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                    &amp;lt;/tbody&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;                &amp;lt;/table&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;            &amp;lt;/form&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;        &amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;    &amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li class="listitem"&gt;&lt;br /&gt;&lt;p class="first-para"&gt;Save the altered file as &lt;span class="fixed"&gt;&lt;span class="inlinemediaobject"&gt;&amp;nbsp;hFinder.chooseDirectory.html&lt;/span&gt;&lt;/span&gt;.&lt;/p&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li class="listitem"&gt;&lt;br /&gt;&lt;p class="first-para"&gt;Using the version of &lt;span class="fixed"&gt;&lt;span class="inlinemediaobject"&gt;&amp;nbsp;hFinder.css&lt;/span&gt;&lt;/span&gt; you created to make a Save As dialog in the previous section, make the following modifications:&lt;/p&gt;&lt;br /&gt;&lt;div class="informalexample"&gt;&lt;br /&gt;&lt;pre class="literallayout"&gt;&lt;br /&gt;@import 'menus.css';&lt;br /&gt;@import 'views.css';&lt;br /&gt;@import 'tree.css';&lt;br /&gt;@import 'popup.css';&lt;br /&gt;&lt;br /&gt;body,&lt;br /&gt;html {&lt;br /&gt;    width: 100%;&lt;br /&gt;    height: 100%;&lt;br /&gt;    min-width: 500px;&lt;br /&gt;    min-height: 300px;&lt;br /&gt;}&lt;br /&gt;body {&lt;br /&gt;    padding: 0;&lt;br /&gt;    margin: 0;&lt;br /&gt;    background: url('../images/brushed_metal.png');&lt;br /&gt;    -moz-user-select: none;&lt;br /&gt;}&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;html#hfinder-directory-dialog,&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;html#hfinder-directory-dialog body {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    min-width: 200px;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;div#hfinder-toolbar {&lt;br /&gt;    position: absolute;&lt;br /&gt;    top: 0;&lt;br /&gt;    left: 0;&lt;br /&gt;    right: 0;&lt;br /&gt;    margin: 28px 10px 0 10px;&lt;br /&gt;}&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;html#hfinder-directory-dialog h4 {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    font: normal 12px sans-serif;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    position: absolute;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    margin: 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    top: 15px;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    left: 10px;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;html#hfinder-directory-dialog div#hfinder-tree {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    margin: 43px 10px 53px 10px;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    right: 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    width: auto;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;div#hfinder-tree {&lt;br /&gt;    position: absolute;&lt;br /&gt;    top: 0;&lt;br /&gt;    bottom: 0;&lt;br /&gt;    left: 0;&lt;br /&gt;    margin: 73px 0 10px 10px;&lt;br /&gt;    width: 190px;&lt;br /&gt;    background: white;&lt;br /&gt;&lt;br /&gt;    overflow: auto;&lt;br /&gt;    border: 1px solid rgb(128, 128, 128);&lt;br /&gt;    z-index: 1;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li class="listitem"&gt;&lt;br /&gt;&lt;p class="first-para"&gt;Save &lt;span class="fixed"&gt;&lt;span class="inlinemediaobject"&gt;&amp;nbsp;hFinder.css&lt;/span&gt;&lt;/span&gt;.&lt;/p&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;p class="para"&gt;The result of the modifications is shown in Figure 9-18.&lt;/p&gt;&lt;br /&gt;&lt;div class="figure"&gt;&lt;br /&gt;&lt;span class="figuremediaobject"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br style="line-height: 1"&gt;&lt;br /&gt;&lt;span class="figure-title"&gt;&lt;span class="figure-titlelabel"&gt;Figure 9-18&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class="para"&gt;The modifications required to create a Choose a Directory dialog are few. In &lt;span class="fixed"&gt;&lt;span class="inlinemediaobject"&gt;&amp;nbsp;hFinder.html&lt;/span&gt;&lt;/span&gt;, you removed the menus, toolbar, popups, and directory view window, then added a button for the creation of a new directory, and OK and Cancel buttons. These controls are housed in a &lt;span class="fixed"&gt;&amp;lt;div&amp;gt;&lt;/span&gt; named &lt;span class="fixed"&gt;hfinder-dialog-controls&lt;/span&gt;, which was the same name used for the &lt;span class="fixed"&gt;&amp;lt;div&amp;gt;&lt;/span&gt; element housing controls in the Save As dialog of the last section. The relevant CSS you applied for the Save As dialog for the &lt;span class="fixed"&gt;hfinder-dialog-controls &amp;lt;div&amp;gt;&lt;/span&gt; is reused for the Choose a Directory dialog.&lt;/p&gt;&lt;br /&gt;&lt;p class="para"&gt;The CSS you applied to create the Choose a Directory dialog was only a few lines, and most of it was used to override, via the cascade, the default rules used for the original hFinder application. To facilitate this you added an id name to the &lt;span class="fixed"&gt;&amp;lt;html&amp;gt;&lt;/span&gt; element, &lt;span class="fixed"&gt;hfinder-directory-dialog&lt;/span&gt;. The first rule you added in &lt;span class="fixed"&gt;&lt;span class="inlinemediaobject"&gt;&amp;nbsp;hFinder.css&lt;/span&gt;&lt;/span&gt; overrides the default minimum width. The default minimum width was too large for a Choose a Directory dialog, which need not be very wide to be usable:&lt;/p&gt;&lt;br /&gt;&lt;div class="informalexample"&gt;&lt;br /&gt;&lt;pre class="literallayout"&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;html#hfinder-directory-dialog,&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;html#hfinder-directory-dialog body {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    min-width: 200px;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class="para"&gt;Then, in the markup you added a new &lt;span class="fixed"&gt;&amp;lt;h4&amp;gt;&lt;/span&gt; element with the text "Choose a Directory&lt;span class="unicode"&gt;&amp;hellip;&lt;/span&gt;". This element is styled in &lt;span class="fixed"&gt;&lt;span class="inlinemediaobject"&gt;&amp;nbsp;hFinder.css&lt;/span&gt;&lt;/span&gt; with the following rule:&lt;/p&gt;&lt;br /&gt;&lt;div class="informalexample"&gt;&lt;br /&gt;&lt;pre class="literallayout"&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;html#hfinder-directory-dialog h4 {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    font: normal 12px sans-serif;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    position: absolute;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    margin: 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    top: 15px;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    left: 10px;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class="para"&gt;The &lt;span class="fixed"&gt;&amp;lt;h4&amp;gt;&lt;/span&gt; element's font is set to remove the bold face, with the &lt;span class="fixed"&gt;normal&lt;/span&gt; keyword, and then set to 12-pixel, generic sans-serif. The default margin is removed, and then the element is positioned absolutely 15 pixels from the top and 10 pixels from the left of the viewport.&lt;/p&gt;&lt;br /&gt;&lt;p class="para"&gt;The last rule added to &lt;span class="fixed"&gt;&lt;span class="inlinemediaobject"&gt;&amp;nbsp;hFinder.css&lt;/span&gt;&lt;/span&gt; overrides the margin and width for the &lt;span class="fixed"&gt;hfinder-tree &amp;lt;div&amp;gt;&lt;/span&gt; and sets the right offset property to zero so that the &lt;span class="fixed"&gt;hfinder-tree &amp;lt;div&amp;gt;&lt;/span&gt; is stretched for the whole width of the window:&lt;/p&gt;&lt;br /&gt;&lt;div class="informalexample"&gt;&lt;br /&gt;&lt;pre class="literallayout"&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;html#hfinder-directory-dialog div#hfinder-tree {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    margin: 43px 10px 53px 10px;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    right: 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;    width: auto;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color:d9d9d9"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class="last-para"&gt;With the presentation of the hFinder set in place, it can now go on to become a much more complex application with the help of JavaScript, and a server-side language such as PHP, Java, Perl, and so on.&lt;/p&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;td align="right"&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7284850559043997789-7514668941426283436?l=cs20001.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cs20001.blogspot.com/feeds/7514668941426283436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7284850559043997789&amp;postID=7514668941426283436' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/7514668941426283436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/7514668941426283436'/><link rel='alternate' type='text/html' href='http://cs20001.blogspot.com/2010/02/using-and-modifying-project.html' title='Using and Modifying the Project'/><author><name>rong889</name><uri>http://www.blogger.com/profile/06593146008221514057</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7284850559043997789.post-7014429414447734613</id><published>2010-02-04T05:28:00.015-08:00</published><updated>2010-02-04T05:28:47.697-08:00</updated><title type='text'>12.5 Conclusion</title><content type='html'>&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#e6e6e6"&gt;&lt;br /&gt;&lt;tr style="background-image: url(images/tile_back.gif);"&gt;&lt;br /&gt;&lt;td align="left" width="30%"&gt;&lt;br /&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;br /&gt;&lt;td align="center" width="40%"&gt;&lt;br /&gt;&amp;nbsp;&amp;lt;&amp;nbsp;Day Day Up&amp;nbsp;&amp;gt;&amp;nbsp;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td align="right" width="30%"&gt;&lt;br /&gt;&lt;div STYLE="MARGIN-RIGHT: 0.15in"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;hr size="1"&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;div class="chapter"&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="section"&gt;&lt;br /&gt;&lt;h2 class="first-section-title"&gt;&lt;br /&gt;12.5 Conclusion&lt;/h2&gt;&lt;br /&gt;&lt;p class="first-para"&gt;In this chapter we looked at some of the critical administrative functions that database administrators perform in their day-to-day work schedule. Backing up a database protects against potential loss or corruption of the data due to various reasons that may or may not be within human control. To provide this solution, we looked at the various types of backup options in Oracle and focused on RMAN. RMAN provides a comprehensive solution leading towards a 24 hours a day, 7 days a week operation, where no downtime is required for backing up the data. RMAN provides this functionality through the various backup strategies such as full, cumulative, and incremental backups. Incremental backups allow the opportunity for frequent backups, because Oracle only backs up data blocks that have changed since the previous backup.&lt;/p&gt;&lt;br /&gt;&lt;p class="para"&gt;We discussed the fact that while developing a compressive backup and recovery strategy is important, it is equally important to schedule testing of the backup and recovery strategy to ensure that the changes in business conditions and economic conditions have not invalidated this strategy.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="para"&gt;Backups are taken to help recover the database from failures. Under this subject we discussed the various kinds of failures in a stand-alone Oracle configuration and the additional kinds of failures in a RAC configuration, for example the GCS failures. During these failure scenarios we also discussed how the data is recovered under these circumstances.&lt;/p&gt;&lt;br /&gt;&lt;p class="para"&gt;Recovery is not always done from backups and not always done by Oracle. There are certain features available in Oracle where a database administrator could perform operations by going back into the past and retrieving database activities. Tools such as flashback queries and LogMiner provide this opportunity.&lt;/p&gt;&lt;br /&gt;&lt;p class="last-para"&gt;In Chapter 15, we will start discussions on performance tuning of a RAC configuration. However, before we dive into this subject, let us discuss the various tools that would help make the performance tuning activity easy. The next chapter will discuss the tools and utilities used in performance tuning.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br&gt;&lt;hr size="1"&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#e6e6e6"&gt;&lt;br /&gt;&lt;tr style="background-image: url(images/tile_back.gif);"&gt;&lt;br /&gt;&lt;td align="left" width="30%"&gt;&lt;br /&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;br /&gt;&lt;td align="center" width="40%"&gt;&lt;br /&gt;&amp;nbsp;&amp;lt;&amp;nbsp;Day Day Up&amp;nbsp;&amp;gt;&amp;nbsp;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td align="right" width="30%"&gt;&lt;br /&gt;&lt;div STYLE="MARGIN-RIGHT: 0.15in"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7284850559043997789-7014429414447734613?l=cs20001.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cs20001.blogspot.com/feeds/7014429414447734613/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7284850559043997789&amp;postID=7014429414447734613' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/7014429414447734613'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/7014429414447734613'/><link rel='alternate' type='text/html' href='http://cs20001.blogspot.com/2010/02/125-conclusion.html' title='12.5 Conclusion'/><author><name>rong889</name><uri>http://www.blogger.com/profile/06593146008221514057</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7284850559043997789.post-5819766035015178050</id><published>2010-02-04T05:28:00.013-08:00</published><updated>2010-02-04T05:28:46.745-08:00</updated><title type='text'>Program 110: Short Time III</title><content type='html'>&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;td&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;br /&gt;&lt;td valign="top" class="v2" align="right"&gt;&lt;div STYLE="MARGIN-RIGHT: 0.15in"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="chapter"&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="section"&gt;&lt;br /&gt;&lt;h2 class="first-section-title"&gt;&lt;span class="section-titlelabel"&gt;Program 110: &lt;/span&gt;Short Time III&lt;/h2&gt;&lt;p class="first-para"&gt;Program 109 has been fixed. Now the delay is closer to what we expect. Not exactly what we expect, but close. What's happening now?&lt;/p&gt;&lt;br /&gt;&lt;div class="informalexample"&gt;&lt;br /&gt;&lt;pre class="literallayout"&gt;&lt;br /&gt;  1 /***********************************************&lt;br /&gt;  2  * bit_delay -- Delay one bit time for         *&lt;br /&gt;  3  *      serial output,                         *&lt;br /&gt;  4  *                                             *&lt;br /&gt;  5  * Note: This function is highly system        *&lt;br /&gt;  6  *      dependent.  If you change the          *&lt;br /&gt;  7  *      processor or clock it will go bad.     *&lt;br /&gt;  8  ***********************************************/&lt;br /&gt;  9 void bit_delay(void)&lt;br /&gt; 10 {&lt;br /&gt; 11     int i;      // Loop counter&lt;br /&gt; 12     volatile int result;// Result of the multiply&lt;br /&gt; 13&lt;br /&gt; 14     // Factors for multiplication&lt;br /&gt; 15     int factorl = 12;&lt;br /&gt; 16     int factor2 = 34;&lt;br /&gt; 17&lt;br /&gt; 18     // We know that 1863 multiplies&lt;br /&gt; 19     // delay the proper amount&lt;br /&gt; 20     for (i = 0; i &amp;lt; 1863; ++i)&lt;br /&gt; 21     {&lt;br /&gt; 22         result = factor1 * factor2;&lt;br /&gt; 23     }&lt;br /&gt; 24 }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class="para"&gt;(Next Hint 95. Answer 39.)&lt;/p&gt;&lt;br /&gt;&lt;div class="sidebar" style="background-color:"&gt;&lt;br /&gt;&lt;table class="BlueLine" border="0" cellspacing="0" cellpadding="0" width="100%"&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td bgcolor="000080" class="bluecell"&gt;&lt;font size="2" face="Arial" color="010100"&gt;&lt;b&gt;&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;p class="centered-para"&gt;1 is equal to 2 for sufficiently large values of 1.&lt;/p&gt;&lt;br /&gt;&lt;table class="BlueLine" border="0" cellspacing="0" cellpadding="0" width="100%"&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td bgcolor="000080" class="bluecell"&gt;&lt;font size="2" face="Arial" color="010100"&gt;&lt;b&gt;&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;table class="BlankSpace" border="0" cellspacing="0" cellpadding="0" width="100%"&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td height="16"&gt;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;td&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;br /&gt;&lt;td valign="top" class="v2" align="right"&gt;&lt;div STYLE="MARGIN-RIGHT: 0.15in"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7284850559043997789-5819766035015178050?l=cs20001.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cs20001.blogspot.com/feeds/5819766035015178050/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7284850559043997789&amp;postID=5819766035015178050' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/5819766035015178050'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/5819766035015178050'/><link rel='alternate' type='text/html' href='http://cs20001.blogspot.com/2010/02/program-110-short-time-iii.html' title='Program 110: Short Time III'/><author><name>rong889</name><uri>http://www.blogger.com/profile/06593146008221514057</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7284850559043997789.post-3162272887728439203</id><published>2010-02-04T05:28:00.011-08:00</published><updated>2010-02-04T05:28:44.843-08:00</updated><title type='text'>2.7 Disk configuration</title><content type='html'>&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#e6e6e6"&gt;&lt;br /&gt;&lt;tr style="background-image: url(images/tile_back.gif);"&gt;&lt;br /&gt;&lt;td align="left" width="30%"&gt;&lt;br /&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;br /&gt;&lt;td align="center" width="40%"&gt;&lt;br /&gt;&amp;nbsp;&amp;lt;&amp;nbsp;Day Day Up&amp;nbsp;&amp;gt;&amp;nbsp;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td align="right" width="30%"&gt;&lt;br /&gt;&lt;div STYLE="MARGIN-RIGHT: 0.15in"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;hr size="1"&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;div class="chapter"&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="section"&gt;&lt;br /&gt;&lt;h2 class="first-section-title"&gt;&lt;br /&gt;2.7 Disk configuration&lt;/h2&gt;&lt;br /&gt;&lt;p class="first-para"&gt;&lt;br /&gt;We looked at the benefits of clustered systems and clustered interconnects in the previous sections. What good are those without the storage systems? Under the hardware configuration, we have seen through evolution of the various technologies like SMP, MPP, etc.; similarly, under the storage tier also we have some details and choices of configurations that should be discussed, like the SAN, NAS, or the traditional direct access architectures. Prior to discussing these configurations, let us look at the basic disk configurations. A disk by itself, like any other equipment, is prone to failures and can have performance issues, especially when many users are accessing one disk. There could be a large amount of I/O contention/ backlogging of user requests, which in turn would create a replicated effect on performance of the system. So the option is to combine multiple disks so that the files could be spread across the disks.&lt;/p&gt;&lt;br /&gt;&lt;p class="para"&gt;Having multiple disks would not directly solve the issues with I/O contention. It does improve I/O compared to a single disk configuration; however, the contention could still exist and performance issues on the system with a large number of users would remain significantly high.&lt;/p&gt;&lt;br /&gt;&lt;p class="para"&gt;The next alternative would be to combine these disks and stripe them across all the disks, creating volumes and files that could reside in each volume or stripe. What this means is that multiple users accessing these files could potentially be accessing the files at different locations, thus accessing different disks and reducing performance bottlenecks. In general, striping offers a performance gain by spreading out the I/Os across many channels and devices. This reduces contention and enables throughput beyond the capacity of a single channel or device. The performance gain depends on the database layout, workload, and access patterns. Performance gains should be compared to the costs associated with setting up, managing, and maintaining (extending and reducing) striped volumes.&lt;/p&gt;&lt;br /&gt;&lt;p class="para"&gt;While striping helps provide distribution of I/O, spreading it across multiple spindles, how about availability? When one disk fails, then data for that stripe probably will not be available. As we discussed in Section 2.4.3 (High Availability), redundancy should be provided at every tier, which includes the storage subsystem. The technology that provides redundancy at the disk level is called&lt;i class="emphasis"&gt; mirroring&lt;/i&gt;, where every time information is recorded onto one disk it is immediately copied over to another disk. Mirroring functionality could be done either via a software process or through hardware configuration.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="para"&gt;An ideal solution would be a combination of both, i.e., a disk configuration that has both options of striping and mirroring because proper storage configuration is vital to the performance of the data tier. The industry has various configuration options available today, and each configuration is used for a specific type of implementation. While most of the scenarios work properly, some of them are better for specific implementation categories over the others. Let us look at some details in this area of disk configuration and elaborate on some of the options available in this tier.&lt;/p&gt;&lt;br /&gt;&lt;div class="section"&gt;&lt;br /&gt;&lt;h3 class="sect3-title"&gt;&lt;br /&gt;2.7.1 RAID&lt;/h3&gt;&lt;br /&gt;&lt;p class="first-para"&gt;RAID is the technology for expanding the capacity of the I/O system and providing the capability for data redundancy. RAID stands for&lt;i class="emphasis"&gt; redundant array of inexpensive disks.&lt;/i&gt; It is the use of two or more physical disks to create one logical disk, where the physical disks operate in tandem to provide greater size and more bandwidth. RAID provides scalability and high availability in the context of I/O and system performance.&lt;/p&gt;&lt;br /&gt;&lt;p class="para"&gt;RAID implementations can be made at the hardware level or at the software level. Software-based RAID implementations have considerable overhead and consume resources, including CPU and memory. Hardware RAID implementations are more popular than software RAID implemen tations because they have less resource overhead.&lt;/p&gt;&lt;br /&gt;&lt;div class="section"&gt;&lt;br /&gt;&lt;h4 class="sect4-title"&gt;RAID 0&lt;/h4&gt;&lt;br /&gt;&lt;p class="first-para"&gt;RAID 0 provides striping&lt;i class="emphasis"&gt;,&lt;/i&gt; where a single data partition is physically spread across all the disks in the stripe bank, effectively giving that partition the aggregate performance of all the component disks combined. The unit of granularity for spreading the data across the drives is called the stripe size or chunk size. Typical settings for the stripe size are 32 KB, 64 KB, and 128 KB.&lt;/p&gt;&lt;br /&gt;&lt;p class="para"&gt;The following are benefits that striping provides:&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;ol class="orderedlist"&gt;&lt;br /&gt;&lt;li class="first-listitem"&gt;&lt;br /&gt;&lt;p class="first-para"&gt;&lt;br /&gt;&lt;i class="emphasis"&gt;Load balancing:&lt;/i&gt; In a database environment some files are always busier than other files; therefore, I/O load on the system needs to be balanced. In a non-striped environment this causes a hot spot on the disk and results in poor response times. The exposure to hot spots is significantly reduced using a striped disk array, because each file is very thinly spread across all the disks in the stripe bank. The result of this spreading of files is random load balancing. This is very effective in a high-volume, high-transactional, very large online transaction processing system (OLTP).&lt;/p&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li class="listitem"&gt;&lt;br /&gt;&lt;p class="first-para"&gt;&lt;br /&gt;&lt;i class="emphasis"&gt;Concurrency:&lt;/i&gt; In a random access environment the overall concurrency of each file is increased. For example, if a file exists on a single disk, only one read or write can be executed against that file at any one time. The reason for this is physical, because the disk drive has only one set of read/write heads. By striping (RAID 0 configuration), many reads and writes can be active at any one time, up to the number of disks in the stripe set.&lt;/p&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;p class="para"&gt;The effects of striping in both sequential and random access environments make it very attractive from a performance standpoint. However, the downside of this is that RAID 0 configuration has no built in redundancy and is highly exposed to failure. If a single disk in a stripe set fails, the whole stripe set is effectively disabled.&lt;/p&gt;&lt;br /&gt;&lt;p class="para"&gt;In the scenario shown in Figure 2.17 where there are eight disks all striped across in&lt;i class="emphasis"&gt; d&lt;/i&gt; different stripes or partitions, the MTBF for each disk is now divided by eight, and the amount of data that is not available is eight times that of a single disk.&lt;/p&gt;&lt;br /&gt;&lt;div class="figure"&gt;&lt;br /&gt;&lt;span class="figuremediaobject"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br style="line-height: 1"&gt;&lt;br /&gt;&lt;span class="figure-title"&gt;&lt;span class="figure-titlelabel"&gt;Figure 2.17: &lt;/span&gt;RAID 0.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="section"&gt;&lt;br /&gt;&lt;h4 class="sect4-title"&gt;RAID 1&lt;/h4&gt;&lt;br /&gt;&lt;p class="first-para"&gt;RAID 1 is known as mirroring and is where all the writes issued to a given disk are duplicated to another disk. This provides for disk availability; if there is a failure of the first disk, the second disk or mirror can take over without any data loss.&lt;/p&gt;&lt;br /&gt;&lt;p class="para"&gt;The write operation to both disks happens in parallel. When the write is ready to be issued, it is set up and sent to DISK A. Without waiting for that write process to complete (as in a sequential write), the write to DISK B is initiated. However, when the host wants to read from the disk (in a mirrored configuration) it takes advantage of the two disks. Depending on the implementation, the host will elect to round-robin (100% gain in read capacity) all read requests to alternate disks in the mirrored set or to send the request to the drive that has its head closest to the required track.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="para"&gt;The biggest advantage in mirrored configuration (RAID 1) is the benefit when one disk or one side of the mirror fails, causing the system to start using exclusively the other side of the mirror for all read/write requests. As a result of this failure the read capability is reduced by 50%. Once replacing or repairing the failed component restores the failed side of the mirror, bringing a disk back online will involve physically copying the surviving mirrored disk onto the replaced peer. This process is called &lt;i class="emphasis"&gt;resilvering.&lt;/i&gt; These mirrored disks can be placed independent of each other or can be placed in a disk array.&lt;/p&gt;&lt;br /&gt;&lt;p class="last-para"&gt;In an Oracle environment, RAID 1 is good for both online and archived redo logs. Writing to these files is performed in a sequential fashion. The write head of the disk is located near the last write operation giving performance enhancements. However, more than one RAID 1 volume is required to allow continuous read and write operations to the redo logs and to allow archive logs to read the previous redo logs. This allows for optimal performance, and it is also required to eliminate contention between LGWR and ARCH background processes.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="section"&gt;&lt;br /&gt;&lt;h4 class="sect4-title"&gt;RAID 0 + 1&lt;/h4&gt;&lt;br /&gt;&lt;p class="first-para"&gt;RAID 0 + 1 (or RAID 01) is a combination of levels 0 and 1. RAID 0 + 1 does exactly what its name implies, that is, stripes and mirrors disks; for example, it stripes first, then mirrors what was just striped. RAID 0 + 1 provides good write and read performance and redundancy without the overhead of parity calculations. Parity is a term for error checking. Parity algorithms contain error correction code (ECC) capabilities, which calculate parity for a given stripe or chunk of data within a RAID volume.&lt;/p&gt;&lt;br /&gt;&lt;p class="para"&gt;The advantages of both RAID level 0 and RAID level 1 apply in this situation and are illustrated in Figure 2.18, which shows a four-way striped mirrored volume with eight disks (A&amp;ndash;H). A given stripe of data (Data 01) in a file is split/striped across disks A&amp;ndash;D with the stripe first and then mirrored across disks E&amp;ndash;H. The drawback in this RAID configuration/scenario is that when one of the pieces, for example, Data 01 on Disk A, becomes unavailable due to a disk failure on Disk A, the entire mirror member becomes unavailable. The entire mirror member is lost, which reduces the I/O capacity during reads on the volume by 50%.&lt;/p&gt;&lt;br /&gt;&lt;div class="figure"&gt;&lt;br /&gt;&lt;span class="figuremediaobject"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br style="line-height: 1"&gt;&lt;br /&gt;&lt;span class="figure-title"&gt;&lt;span class="figure-titlelabel"&gt;Figure 2.18: &lt;/span&gt;RAID 01.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="section"&gt;&lt;br /&gt;&lt;h4 class="sect4-title"&gt;RAID 1 + 0&lt;/h4&gt;&lt;br /&gt;&lt;p class="first-para"&gt;&lt;br /&gt;RAID 1 + 0 (or RAID 10) is also a combination of the RAID levels 0 and 1 discussed in the previous sections. This combination is also true for RAID 0 + 1. However, in RAID 10 the disks are mirrored and then striped; for example, mirror first, then stripe what was mirrored. All the advantages that apply to the previous RAID configuration apply to this RAID configuration. However, the organization of mirrored sets is different from the previous configuration.&lt;/p&gt;&lt;br /&gt;&lt;p class="para"&gt;In Figure 2.19, Data 01 is mirrored on the adjoining disks (A and B) and Data 02 is mirrored on the subsequent two disks (C and D), etc. This configuration also contains eight mirrored and striped disks.&lt;/p&gt;&lt;br /&gt;&lt;div class="figure"&gt;&lt;br /&gt;&lt;span class="figuremediaobject"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br style="line-height: 1"&gt;&lt;br /&gt;&lt;span class="figure-title"&gt;&lt;span class="figure-titlelabel"&gt;Figure 2.19: &lt;/span&gt;RAID 10.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class="last-para"&gt;The advantage in the RAID 10 configuration over the RAID 01 configuration is, if there is a loss of one disk in a mirrored member, the entire member of the mirrored volume does not become unavailable. This configuration is better suited for high availability. The I/O capacity that results from the failure of a mirror member does not reduce its I/O capacity by 50%. RAID 10 configurations must be the preferred implementation choice for an OLTP implementation.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="section"&gt;&lt;br /&gt;&lt;h4 class="sect4-title"&gt;RAID 5&lt;/h4&gt;&lt;br /&gt;&lt;p class="first-para"&gt;Under RAID 5, parity calculations provide data redundancy, and the parity is stored with the data. This means that the parity is distributed across the number of drives configured in the volume.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="para"&gt;&lt;br /&gt;Figure 2.20 illustrates the physical placement of stripes (Data 01 through Data 04) with their corresponding parities distributed across the five disks in the volume. This is a four-way, striped RAID 5 volume where data and parity are distributed.&lt;/p&gt;&lt;br /&gt;&lt;div class="figure"&gt;&lt;br /&gt;&lt;span class="figuremediaobject"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br style="line-height: 1"&gt;&lt;br /&gt;&lt;span class="figure-title"&gt;&lt;span class="figure-titlelabel"&gt;Figure 2.20: &lt;/span&gt;RAID 5.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class="para"&gt;RAID 5 is unsuitable for OLTP because of extremely poor performance of small writes at high concurrency levels. This is because the continuous processes of reading a stripe, calculating the new parity, and writing the stripe back to the disk (with new parity) will make writing significantly slower.&lt;/p&gt;&lt;br /&gt;&lt;p class="para"&gt;In an Oracle environment, rollback segments and redo logs are accessed sequentially (usually for writes) and are not suitable candidates for being placed on a RAID 5 device. Also, data files belonging to temporary tablespaces are not suitable for placement on a RAID 5 device. Another reason the redo logs should not be placed on RAID 5 devices is related to the type of caching (if any) being done by the RAID system. Given the critical nature of the contents of the redo logs, catastrophic loss of data could ensue if the contents of the cache are not written to the disk, for example, because of a power failure, when Oracle was notified that they had been written. This is particularly true of write-back caching, where the write is assumed to have been written to the disk when it has only been written to the cache. Write-through caching, where the write is assumed to have completed when it has reached the disk, is much safer but still not recommended for redo logs for the reason mentioned earlier.&lt;/p&gt;&lt;br /&gt;&lt;p class="last-para"&gt;RAID 5 configurations should be preferred where the read patterns are random and are not very bulky in nature. This is because the spindles in a RAID 5 volume work in an independent fashion. For example, all the disks in a given volume can potentially service multiple I/O requests from different disk locations. RAID 5 should be considered for data warehouse (DW), data mining (DM), and operational data store (ODS) applications where data refreshes occur in the off-hours.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="section"&gt;&lt;br /&gt;&lt;h3 class="sect3-title"&gt;&lt;br /&gt;2.7.2 Stripe and mirror everything&lt;/h3&gt;&lt;br /&gt;&lt;p class="first-para"&gt;The ''stripe and mirror everything'' concept for disk configuration is more commonly known as SAME. This model is based on two key proposals, (1) stripe all files across all disks using a 1 megabyte stripe width, and (2) mirror data for high availability.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="section"&gt;&lt;br /&gt;&lt;h3 class="sect3-title"&gt;&lt;br /&gt;2.8 Storage system architectures&lt;/h3&gt;&lt;br /&gt;&lt;ol class="orderedlist"&gt;&lt;br /&gt;&lt;li class="first-listitem"&gt;&lt;br /&gt;&lt;p class="first-para"&gt;Striping all files across all disks ensures that full bandwidth of all the disks is available for any operation. This equalizes load across disk drives and eliminates hot spots. The recommendation of using a stripe size of 1 megabyte is based on transfer rates and throughputs of modern disks. If the stripe size is very small, more time is spent positioning the disk head on the data, than in the actual transfer of data. Based on internal studies, we have determined that a size of 1 megabyte achieves reasonably good throughput, while anything smaller does not provide adequate throughput.&lt;/p&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li class="listitem"&gt;&lt;br /&gt;&lt;p class="first-para"&gt;Mirroring data at the storage subsystem level is the best way to avoid data loss. The only way to lose data in a mirrored environment is to lose multiple disks simultaneously. Given that current disk drives are highly reliable, simultaneous multiple disk failure is a very low probability event.&lt;/p&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;p class="last-para"&gt;The primary benefit of the SAME model is that it makes storage configuration very easy and suitable for all workloads. It works equally well for OLTP, data warehouse, and batch workloads. It eliminates I/O hot spots and maximizes bandwidth. Finally, the SAME model is not tied to any storage management solution in the market today and can be implemented with the technology available today.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br&gt;&lt;hr size="1"&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#e6e6e6"&gt;&lt;br /&gt;&lt;tr style="background-image: url(images/tile_back.gif);"&gt;&lt;br /&gt;&lt;td align="left" width="30%"&gt;&lt;br /&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;br /&gt;&lt;td align="center" width="40%"&gt;&lt;br /&gt;&amp;nbsp;&amp;lt;&amp;nbsp;Day Day Up&amp;nbsp;&amp;gt;&amp;nbsp;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td align="right" width="30%"&gt;&lt;br /&gt;&lt;div STYLE="MARGIN-RIGHT: 0.15in"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7284850559043997789-3162272887728439203?l=cs20001.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cs20001.blogspot.com/feeds/3162272887728439203/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7284850559043997789&amp;postID=3162272887728439203' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/3162272887728439203'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/3162272887728439203'/><link rel='alternate' type='text/html' href='http://cs20001.blogspot.com/2010/02/27-disk-configuration.html' title='2.7 Disk configuration'/><author><name>rong889</name><uri>http://www.blogger.com/profile/06593146008221514057</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7284850559043997789.post-3767535415089082218</id><published>2010-02-04T05:28:00.009-08:00</published><updated>2010-02-04T05:28:42.138-08:00</updated><title type='text'>Introduction</title><content type='html'>&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;/div&gt;&lt;/td&gt;&lt;br /&gt;&lt;td align="right"&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;div class="preface"&gt;&lt;br /&gt;&lt;br /&gt;&lt;h1 class="preface-title"&gt;Introduction&lt;/h1&gt;&lt;p class="first-para"&gt;&lt;br /&gt;Oracle9&lt;i class="emphasis"&gt;i&lt;/i&gt; is the major relational database management system (RDBMS) for developing and running a wide variety of applications, starting from creating and maintaining simple databases in client/server environments to conducting e-business on the Web. PL/SQL is the primary procedural component of Oracle9&lt;i class="emphasis"&gt;i&lt;/i&gt;'s server-side programming and is regarded as the primary language for developing applications on the database and middle tiers using Oracle9&lt;i class="emphasis"&gt;i&lt;/i&gt;. PL/SQL in Releases 1 and 2 of Oracle9&lt;i class="emphasis"&gt;i&lt;/i&gt; has incorporated new features that take programmers to a higher level of coding, especially with its true object-relational capabilities. Also, Oracle9&lt;i class="emphasis"&gt;i&lt;/i&gt; provides for support of Java in the database, and PL/SQL 9&lt;i class="emphasis"&gt;i&lt;/i&gt; provides this capability by means of Java stored procedures and their new functionality in 9&lt;i class="emphasis"&gt;i&lt;/i&gt;, to build highly scalable applications.&lt;/p&gt;&lt;br /&gt;&lt;div class="section"&gt;&lt;br /&gt;&lt;h2 class="sect2-title"&gt;&lt;br /&gt;What This Book Covers&lt;/h2&gt;&lt;br /&gt;&lt;p class="first-para"&gt;This book covers the techniques of using PL/SQL in Oracle9&lt;i class="emphasis"&gt;i&lt;/i&gt; Releases 1 and 2 for server-side applications. It covers PL/SQL 9&lt;i class="emphasis"&gt;i&lt;/i&gt; in exhaustive detail and provides the methodology for implementing robust applications of exceptional quality. This book will assist programmers in implementing techniques that are effective for real-world and code-centric Oracle applications. This saves time and effort on the part of the PL/SQL developer in addition to increasing his or her level to that of an advanced developer. Also, PL/SQL is widely used by many organizations, and the combination of Oracle9&lt;i class="emphasis"&gt;i&lt;/i&gt; and PL/SQL provides a robust and effective environment for development of mission-critical applications. This book is a source for development of such applications by companies incorporating these technologies as well as those organizations migrating from earlier versions.&lt;/p&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;/div&gt;&lt;/td&gt;&lt;br /&gt;&lt;td align="right"&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7284850559043997789-3767535415089082218?l=cs20001.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cs20001.blogspot.com/feeds/3767535415089082218/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7284850559043997789&amp;postID=3767535415089082218' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/3767535415089082218'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/3767535415089082218'/><link rel='alternate' type='text/html' href='http://cs20001.blogspot.com/2010/02/introduction_04.html' title='Introduction'/><author><name>rong889</name><uri>http://www.blogger.com/profile/06593146008221514057</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7284850559043997789.post-5693091268001011867</id><published>2010-02-04T05:28:00.007-08:00</published><updated>2010-02-04T05:28:38.868-08:00</updated><title type='text'>SYSCAT.TYPEMAPPINGS</title><content type='html'>&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;td class="tt1"&gt;[ Team LiB ]&lt;/td&gt;&lt;td valign="top" class="tt1" align="right"&gt;&lt;br /&gt;	&lt;br /&gt;	&lt;br /&gt;&lt;/td&gt;&lt;/table&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td valign="top"&gt;&lt;H3 class="docSection1Title"&gt; SYSCAT.TYPEMAPPINGS&lt;/H3&gt;&lt;br /&gt;&lt;P class="docText"&gt;Each row contains a user-defined mapping of a remote built-in data type to a local built-in data type.&lt;/P&gt;&lt;br /&gt;&lt;P&gt;&lt;TABLE CELLSPACING="0" FRAME="hsides" RULES="all" CELLPADDING="4" WIDTH="100%"&gt;&lt;COLGROUP align="left" span="4"&gt;&lt;THEAD&gt;&lt;TR&gt;&lt;TH class="docTableHeader" align="center" valign="top"&gt;&lt;P class="docText"&gt;&lt;span class="docEmphStrong"&gt;Column Name&lt;/span&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH class="docTableHeader" align="center" valign="top"&gt;&lt;P class="docText"&gt;&lt;span class="docEmphStrong"&gt;Data Type&lt;/span&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH class="docTableHeader" align="center" valign="top"&gt;&lt;P class="docText"&gt;&lt;span class="docEmphStrong"&gt;Nullable&lt;/span&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH class="docTableHeader" align="center" valign="top"&gt;&lt;P class="docText"&gt;&lt;span class="docEmphStrong"&gt;Description&lt;/span&gt;&lt;/P&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;TYPE_MAPPING&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;VARCHAR(18)&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Name of the type mapping (may be system-generated).&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;TYPESCHEMA&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;VARCHAR(128)&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" align="center" valign="top"&gt;&lt;P class="docText"&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Schema name of the type. Null for system built-in types.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;TYPENAME&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;VARCHAR(18)&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Name of the local type in a data type mapping.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;TYPEID&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;SMALLINT&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Type identifier.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;SOURCETYPEID&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;SMALLINT&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Source type identifier.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;DEFINER&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;VARCHAR(128)&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Authorization ID under which this type mapping was created.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;LENGTH&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;INTEGER&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" align="center" valign="top"&gt;&lt;P class="docText"&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Maximum length or precision of the data type. If null, the system determines the best length/precision.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;SCALE&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;SMALLINT&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" align="center" valign="top"&gt;&lt;P class="docText"&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Scale for &lt;TT&gt;DECIMAL&lt;/TT&gt; fields. If null, the system determines the best scale attribute.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;BIT_DATA&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;CHAR(1)&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" align="center" valign="top"&gt;&lt;P class="docText"&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;Y&lt;/TT&gt; = Type is for bit data&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;TT&gt;N&lt;/TT&gt; = Type is not for bit data&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;TT&gt;NULL&lt;/TT&gt; = This is not a character data type or that the system determines the bit data attribute&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;WRAPNAME&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;VARCHAR(128)&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" align="center" valign="top"&gt;&lt;P class="docText"&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Mapping applies to this data access protocol.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;SERVERNAME&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;VARCHAR(128)&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" align="center" valign="top"&gt;&lt;P class="docText"&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Name of the data source.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;SERVERTYPE&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;VARCHAR(30)&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" align="center" valign="top"&gt;&lt;P class="docText"&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Mapping applies to this type of data source.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;SERVERVERSION&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;VARCHAR(18)&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" align="center" valign="top"&gt;&lt;P class="docText"&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Mapping applies to this version of &lt;TT&gt;SERVERTYPE&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;REMOTE_TYPESCHEMA&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;VARCHAR(128)&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" align="center" valign="top"&gt;&lt;P class="docText"&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Schema name of the remote type.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;REMOTE_TYPENAME&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;VARCHAR(128)&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Name of the data type as defined on the data source(s).&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;REMOTE_META_TYPE&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;CHAR(1)&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" align="center" valign="top"&gt;&lt;P class="docText"&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;S&lt;/TT&gt; = Remote type is a system built-in type&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;TT&gt;T&lt;/TT&gt; = Remote type is a distinct type&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;REMOTE_LOWER_LEN&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;INTEGER&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" align="center" valign="top"&gt;&lt;P class="docText"&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Lower bound of the length/precision of the remote decimal type. For character data types, this field indicates the number of characters.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;REMOTE_UPPER_LEN&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;INTEGER&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" align="center" valign="top"&gt;&lt;P class="docText"&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Upper bound of the length/precision of the remote decimal type. For character data types, this field indicates the number of characters.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;REMOTE_LOWER_SCALE&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;SMALLINT&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" align="center" valign="top"&gt;&lt;P class="docText"&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Lower bound of the scale of the remote type.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;REMOTE_UPPER_SCALE&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;SMALLINT&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" align="center" valign="top"&gt;&lt;P class="docText"&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Upper bound of the scale of the remote type.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;REMOTE_S_OPR_P&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;CHAR(2)&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" align="center" valign="top"&gt;&lt;P class="docText"&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Relationship between remote scale and remote precision. Basic comparison operators can be used. A null indicated that no specific relationship is required.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;REMOTE_BIT_DATA&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;CHAR(1)&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" align="center" valign="top"&gt;&lt;P class="docText"&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;Y&lt;/TT&gt; = Type is for bit data&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;TT&gt;N&lt;/TT&gt; = Type is not for bit data&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;TT&gt;NULL&lt;/TT&gt; = This is not a character data type or the system determines the bit data attribute&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;USER_DEFINED&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;CHAR(1)&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Definition supplied by user.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;CREATE_TIME&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;TIMESTAMP&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Time when this mapping was created.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;REMARKS&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;VARCHAR(254)&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" align="center" valign="top"&gt;&lt;P class="docText"&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;User-supplied comments, or null.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/COLGROUP&gt;&lt;/TABLE&gt;&lt;/P&gt;&lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;td&gt;&lt;/td&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;td class="tt1"&gt;[ Team LiB ]&lt;/td&gt;&lt;td valign="top" class="tt1" align="right"&gt;&lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;&lt;/td&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7284850559043997789-5693091268001011867?l=cs20001.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cs20001.blogspot.com/feeds/5693091268001011867/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7284850559043997789&amp;postID=5693091268001011867' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/5693091268001011867'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/5693091268001011867'/><link rel='alternate' type='text/html' href='http://cs20001.blogspot.com/2010/02/syscattypemappings.html' title='SYSCAT.TYPEMAPPINGS'/><author><name>rong889</name><uri>http://www.blogger.com/profile/06593146008221514057</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7284850559043997789.post-6426602592287589010</id><published>2010-02-04T05:28:00.005-08:00</published><updated>2010-02-04T05:28:36.974-08:00</updated><title type='text'>11.2 Create Windows NT/2000 Groups</title><content type='html'>&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;td class="tt1"&gt;[ Team LiB ]&lt;/td&gt;&lt;td valign="top" class="tt1" align="right"&gt;&lt;br /&gt;	&lt;br /&gt;	&lt;br /&gt;&lt;/td&gt;&lt;/table&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td valign="top"&gt;&lt;H3 class="docSection1Title"&gt;11.2 Create Windows NT/2000 Groups&lt;/H3&gt;&lt;br /&gt;&lt;P class="docText"&gt;Windows 2000 recognizes individual users as well as functional groups. You can, for instance, set up a group called Marketing or Sales, and then add new users to the computer. In addition, each user can be added to any of the groups that you've created. Therefore, you might have a marketing manager who belongs to both the Marketing and Management groups.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;One advantage of using groups is that SQL Server automatically recognizes the registered Windows users. SQL Server is tightly integrated with Windows security, and you are able to use this integration as you set up SQL Server security. This means, for instance, that you can provide the marketing group with access to tables and stored procedures that are related to marketing data, yet deny the salespeople access to those same tables and procedures. The marketing manager mentioned earlier in this chapter is able to work with marketing and management data (such as employee human resources data).&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Because you are treating multiple users as a single group, the administrative effort is considerably less than if you had gone to the trouble of providing access to each individual user. As you'll soon see, treating users as members of groups greatly simplifies the security administration task.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Handling individual users is a real hassle. In large installations with hundreds of users, you spend inordinate amounts of time managing SQL Server security on a user-by-user basis. Instead, you'd like to use Windows groups to add groups of users to the database.&lt;/P&gt;&lt;br /&gt;&lt;H4 class="docSection2Title"&gt; Technique&lt;/H4&gt;&lt;br /&gt;&lt;P class="docText"&gt;Use the Administrative Tools in the Control Panel to create groups and add the users you've created to those groups.&lt;/P&gt;&lt;br /&gt;&lt;H4 class="docSection2Title"&gt; Steps&lt;/H4&gt;&lt;br /&gt;&lt;P class="docText"&gt;Most often, users are arranged into logical groupings. For instance, all the people in the marketing department are likely to belong to a group named Marketing. Similarly, managers probably belong to a Management group. In this section, you'll learn how to specify the groups on your computer and add the user accounts you've created to those groups.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Later, as users log in to SQL Server, they'll be able to log in as themselves or as a group. Although this might sound a bit strange, to SQL Server, an individual user is the same as a group of users. All that SQL Server sees is an identifier ("TonyS" or "Marketing"), and it matches that identity with a Windows network login.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold"&gt;&lt;OL class="docList" START="1"&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal" value="1"&gt;&lt;P class="docText"&gt;Choose Start, Settings, Control Panel to open the Control Panel.&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;LI&gt;&lt;span style="font-weight:normal" value="2"&gt;&lt;P class="docText"&gt;Double-click on the Administrative Tools applet to access the Windows 2000 administration options.&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;LI&gt;&lt;span style="font-weight:normal" value="3"&gt;&lt;P class="docText"&gt;Select the security settings by double-clicking on the Computer Management option and opening the dialog box you see in Figure 11.5.&lt;/P&gt;&lt;br /&gt;&lt;CENTER&gt;&lt;H5 class="docFigureTitle"&gt;Figure 11.5. Each Windows group usually contains a number of individual users.&lt;/H5&gt;&lt;p class="docText"&gt;&lt;/p&gt;&lt;br /&gt;&lt;/CENTER&gt;&lt;/span&gt;&lt;/LI&gt;&lt;LI&gt;&lt;span style="font-weight:normal" value="4"&gt;&lt;P class="docText"&gt;Use the + next to Local Users and Groups to reveal the Users and Groups icons. Right-click on the Groups icon and select New Group from the shortcut menu that appears. (Alternatively, use the New Group menu item under the Action menu). You'll see the New Group dialog box as shown in Figure 11.6. Provide a name for the new group, such as Shift Supervisors, in the Group Name text box at the top of the New Group dialog box.&lt;/P&gt;&lt;br /&gt;&lt;CENTER&gt;&lt;H5 class="docFigureTitle"&gt;Figure 11.6. Fill in the Group name and Description text boxes. You'll add users to this Windows group in a minute.&lt;/H5&gt;&lt;p class="docText"&gt;&lt;/p&gt;&lt;br /&gt;&lt;/CENTER&gt;&lt;/span&gt;&lt;/LI&gt;&lt;LI&gt;&lt;span style="font-weight:normal" value="6"&gt;&lt;P class="docList"&gt;Provide a verbose description for the group in the Description text box.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Near the bottom left of the New Group dialog box, you'll see two buttons labeled Add and Check Names (see Figure 11.7). Click on the Add button to open the list of all users who are registered on this computer.&lt;/P&gt;&lt;br /&gt;&lt;CENTER&gt;&lt;H5 class="docFigureTitle"&gt;Figure 11.7. This list shows all the users within the local Windows domain. The red X indicates disabled Windows accounts.&lt;/H5&gt;&lt;p class="docText"&gt;&lt;/p&gt;&lt;br /&gt;&lt;/CENTER&gt;&lt;/span&gt;&lt;/LI&gt;&lt;LI&gt;&lt;span style="font-weight:normal" value="7"&gt;&lt;P class="docList"&gt;The top half of the Select Users or Groups dialog box contains an alphabetically sorted list of all the users in the local domain. Use the scrollbar if necessary to locate the user you want to add to the group. Select the user and use the Add button (or double-click on the user) to add the user to the group. As users are added to the group, their names appear in the lower half of the Select Users or Groups dialog box. When you have completed the selection process, click the OK button.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;You'll be returned to the New Group dialog box. You should see the users you've added to the group displayed in the list at the middle of the dialog box.&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;LI&gt;&lt;span style="font-weight:normal" value="8"&gt;&lt;P class="docText"&gt;When you're finished adding groups to the computer, click the Close button to dismiss the New Group dialog box.&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/span&gt;&lt;br /&gt;&lt;H4 class="docSection2Title"&gt; Comments&lt;/H4&gt;&lt;br /&gt;&lt;P class="docText"&gt;Normally, as a database developer, you won't be creating Windows 2000 groups. However, in many small environments, developers are required to take on more than a single role. Also, you might find it useful to create a group login just for the applications you write.&lt;/P&gt;&lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;td&gt;&lt;/td&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;td class="tt1"&gt;[ Team LiB ]&lt;/td&gt;&lt;td valign="top" class="tt1" align="right"&gt;&lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;&lt;/td&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7284850559043997789-6426602592287589010?l=cs20001.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cs20001.blogspot.com/feeds/6426602592287589010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7284850559043997789&amp;postID=6426602592287589010' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/6426602592287589010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/6426602592287589010'/><link rel='alternate' type='text/html' href='http://cs20001.blogspot.com/2010/02/112-create-windows-nt2000-groups.html' title='11.2 Create Windows NT/2000 Groups'/><author><name>rong889</name><uri>http://www.blogger.com/profile/06593146008221514057</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7284850559043997789.post-5901319483364735924</id><published>2010-02-04T05:28:00.003-08:00</published><updated>2010-02-04T05:28:34.708-08:00</updated><title type='text'>Day 2</title><content type='html'>&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;td class="tt1"&gt;[ Team LiB ]&lt;/td&gt;&lt;td valign="top" class="tt1" align="right"&gt;&lt;br /&gt;	&lt;br /&gt;	&lt;br /&gt;&lt;/td&gt;&lt;/table&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;H3 class="docSection1Title"&gt; Day 2&lt;/H3&gt;&lt;br /&gt;&lt;P&gt;&lt;TABLE BORDER="0" cellspacing="16" cellpadding="0"&gt;&lt;TR valign="top"&gt;&lt;TD align="right" class="docText"&gt;&lt;B&gt;1:&lt;br /&gt;                              &lt;/B&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P class="docText"&gt;What's the advantage of using a view?&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR valign="top"&gt;&lt;TD align="right" class="docText"&gt;&lt;B&gt;A1:&lt;br /&gt;                        &lt;/B&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P class="docText"&gt;By using views, you can set up different presentations of the same data. Each view is derived from the actual table data, but each user will see a subset of the data. The main benefit to using views is that they allow you to control the access your users have to restricted data.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR valign="top"&gt;&lt;TD align="right" class="docText"&gt;&lt;B&gt;2:&lt;br /&gt;                              &lt;/B&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P class="docText"&gt;Give some reasons why you would want to define a primary key for a table.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR valign="top"&gt;&lt;TD align="right" class="docText"&gt;&lt;B&gt;A2:&lt;br /&gt;                        &lt;/B&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P class="docText"&gt;Defining a primary key on a table allows you to guarantee that each row in the table is unique. Defining a primary key can improve performance as well, because table access is quicker if each row is uniquely identified. If you're using an ODBC application to update your data, you need to have a primary key defined for the table. An index created automatically for the primary key helps DB2 find an efficient path to the data.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR valign="top"&gt;&lt;TD align="right" class="docText"&gt;&lt;B&gt;3:&lt;br /&gt;                              &lt;/B&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P class="docText"&gt;What is the difference between unique keys and primary keys?&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR valign="top"&gt;&lt;TD align="right" class="docText"&gt;&lt;B&gt;A3:&lt;br /&gt;                        &lt;/B&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P class="docText"&gt;Unique keys are optional; no two of its values are the same or null. This constraint is enforced by the database manager when data is inserted or updated. A table can have multiple unique keys. Unique keys are defined when the table is created or altered.&lt;/P&gt;&lt;P class="docText"&gt;A primary key is a special kind of unique key that uniquely identifies a row of a table. The columns of a primary key can't contain null values. A table can have only one primary key.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR valign="top"&gt;&lt;TD align="right" class="docText"&gt;&lt;B&gt;4:&lt;br /&gt;                              &lt;/B&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P class="docText"&gt;What's an instance? What's the advantage of using an instance?&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR valign="top"&gt;&lt;TD align="right" class="docText"&gt;&lt;B&gt;A4:&lt;br /&gt;                        &lt;/B&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P class="docText"&gt;An instance is a logical database manager environment. Having an instance allows you to catalog databases and set specific configuration parameters to the environment. For example, you can set up a test environment and a production environment by creating two instances. You can change the catalog information and the configuration parameters in the test instance without affecting the data in the production instance. Using instances can also help you protect access to sensitive information, because each instance has a separate assignment of authorized users.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR valign="top"&gt;&lt;TD align="right" class="docText"&gt;&lt;B&gt;5:&lt;br /&gt;                              &lt;/B&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P class="docText"&gt;What's the difference between static and dynamic SQL?&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR valign="top"&gt;&lt;TD align="right" class="docText"&gt;&lt;B&gt;A5:&lt;br /&gt;                        &lt;/B&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P class="docText"&gt;When you write a SQL statement for an application program and know the entire statement, including the SQL statement type (&lt;TT&gt;UPDATE&lt;/TT&gt;, &lt;TT&gt;INSERT&lt;/TT&gt;, and so on) and the table and column names that the statement acts on, you're using static SQL. Static SQL is a SQL statement that's fully written in an application program before the program is compiled. Dynamic SQL is a statement that the application builds and executes at runtime. Generally dynamic SQL is used in an interactive program where the user is prompted for key parts of the SQL statement.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;td&gt;&lt;/td&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;td class="tt1"&gt;[ Team LiB ]&lt;/td&gt;&lt;td valign="top" class="tt1" align="right"&gt;&lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;&lt;/td&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7284850559043997789-5901319483364735924?l=cs20001.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cs20001.blogspot.com/feeds/5901319483364735924/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7284850559043997789&amp;postID=5901319483364735924' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/5901319483364735924'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/5901319483364735924'/><link rel='alternate' type='text/html' href='http://cs20001.blogspot.com/2010/02/day-2.html' title='Day 2'/><author><name>rong889</name><uri>http://www.blogger.com/profile/06593146008221514057</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7284850559043997789.post-6981283986983394410</id><published>2010-02-04T05:28:00.001-08:00</published><updated>2010-02-04T05:28:32.717-08:00</updated><title type='text'>6.1 Retrieve Unique Records Using Only a Select Query</title><content type='html'>&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;td class="tt1"&gt;[ Team LiB ]&lt;/td&gt;&lt;td valign="top" class="tt1" align="right"&gt;&lt;br /&gt;	&lt;br /&gt;	&lt;br /&gt;&lt;/td&gt;&lt;/table&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td valign="top"&gt;&lt;H3 class="docSection1Title"&gt;6.1 Retrieve Unique Records Using Only a Select Query&lt;/H3&gt;&lt;br /&gt;&lt;P class="docText"&gt;I need to figure out which customers have invoices. The problem is that when I join the Customers with the Orders tables, I get the customers listed for each order. I only want each customer listed once. How do I return only those customers who have orders, but only once?&lt;/P&gt;&lt;br /&gt;&lt;H4 class="docSection2Title"&gt; Technique&lt;/H4&gt;&lt;br /&gt;&lt;P class="docText"&gt;For this How-To, you will be using the &lt;TT&gt;DISTINCT&lt;/TT&gt; clause on a SQL &lt;TT&gt;SELECT&lt;/TT&gt; statement to limit the data to unique values. When you include the &lt;TT&gt;DISTINCT&lt;/TT&gt; clause, SQL Server uses the columns that are returned to determine how to limit the data.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;For the opposite affect, you can include the &lt;TT&gt;ALL&lt;/TT&gt; clause, although it is not necessary because this is the default. You will create two &lt;TT&gt;SELECT&lt;/TT&gt; statements for this task. The first one is for all records:&lt;/P&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;SELECT Customers.CompanyName FROM Customers INNER JOIN Orders ON Customers .CustomerID = &lt;br /&gt;Orders.CustomerID&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;P class="docText"&gt;To limit the records, use the &lt;TT&gt;DISTINCT&lt;/TT&gt; clause:&lt;/P&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;SELECT DISTINCT Customers.CompanyName&lt;br /&gt;FROM Customers&lt;br /&gt;INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;H4 class="docSection2Title"&gt; Steps&lt;/H4&gt;&lt;br /&gt;&lt;P class="docText"&gt;Open and run the Visual Basic .NET�Chapter 6 solution. From the main form, click on the button with the caption How-To 6.1. When the form loads, you will see two option buttons, Show All and Distinct, with Show All selected. The &lt;TT&gt;SELECT&lt;/TT&gt; statement showing an inner join between customers and order is displayed in a Label control. You will also see a DataGrid control filled with multiple entries of customers displayed (see Figure 6.1).&lt;/P&gt;&lt;br /&gt;&lt;CENTER&gt;&lt;H5 class="docFigureTitle"&gt;Figure 6.1. A common problem with inner joins is retrieving multiple records when you want to see just one per occurrence.&lt;/H5&gt;&lt;p class="docText"&gt;&lt;/p&gt;&lt;br /&gt;&lt;/CENTER&gt;&lt;br /&gt;&lt;P class="docText"&gt;If you click on the option button labeled Use Distinct, then the DataGrid control will be refreshed, but only one customer per set of orders will be displayed.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold"&gt;&lt;OL class="docList" START="1"&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal" value="1"&gt;&lt;P class="docText"&gt;Create a Windows Form. Then place the controls listed in Table 6.1 with the following properties set, as displayed in Figures 6.1 and 6.2.&lt;/P&gt;&lt;br /&gt;&lt;CENTER&gt;&lt;H5 class="docFigureTitle"&gt;Figure 6.2. Using the &lt;TT&gt;DISTINCT&lt;/TT&gt; clause gives you control over displaying unique records.&lt;/H5&gt;&lt;p class="docText"&gt;&lt;/p&gt;&lt;br /&gt;&lt;/CENTER&gt;&lt;br /&gt;&lt;P&gt;&lt;TABLE BORDER="1" CELLSPACING="0" CELLPADDING="1" WIDTH="90%"&gt;&lt;br /&gt;&lt;CAPTION&gt;&lt;h5 class="docTableTitle"&gt;Table 6.1. Control Property Settings for How-To 6.1&lt;/h5&gt;&lt;/CAPTION&gt;&lt;COLGROUP span="3"&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TH class="docTableHeader" align="left" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;Object&lt;/P&gt;&lt;br /&gt;&lt;/TH&gt;&lt;br /&gt;&lt;TH class="docTableHeader" align="left" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;Property&lt;/P&gt;&lt;br /&gt;&lt;/TH&gt;&lt;br /&gt;&lt;TH class="docTableHeader" align="left" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;Setting&lt;/P&gt;&lt;br /&gt;&lt;/TH&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;TT&gt;RadioButton&lt;/TT&gt;&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;TT&gt;Name&lt;/TT&gt;&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;TT&gt;rbShowAll&lt;/TT&gt;&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&amp;nbsp;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;TT&gt;Checked&lt;/TT&gt;&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;TT&gt;True&lt;/TT&gt;&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;TT&gt;RadioButton&lt;/TT&gt;&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;TT&gt;Name&lt;/TT&gt;&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;TT&gt;rbDistinct&lt;/TT&gt;&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;TT&gt;Label&lt;/TT&gt;&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;TT&gt;Text&lt;/TT&gt;&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;TT&gt;SQL Statement&lt;/TT&gt;&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;TT&gt;Label&lt;/TT&gt;&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;TT&gt;Name&lt;/TT&gt;&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;TT&gt;lblSQLString&lt;/TT&gt;&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;TT&gt;Label&lt;/TT&gt;&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;TT&gt;Text&lt;/TT&gt;&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;TT&gt;Results&lt;/TT&gt;&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;TT&gt;DataGrid&lt;/TT&gt;&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;TT&gt;Name&lt;/TT&gt;&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;TT&gt;dgResults&lt;/TT&gt;&lt;/P&gt;&lt;br /&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;/COLGROUP&gt;&lt;br /&gt;&lt;/TABLE&gt;&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;LI&gt;&lt;span style="font-weight:normal" value="2"&gt;&lt;P class="docList"&gt;As with some of the other chapters' projects, you need to build a support routine to create the Connection string. Called &lt;TT&gt;BuildCnnStr&lt;/TT&gt;, the function can been seen in Listing 6.1. This function takes a server and database name passed to it and creates a connection string.&lt;/P&gt;&lt;br /&gt;&lt;H5 class="docExampleTitle"&gt;Listing 6.1 &lt;TT&gt;modGeneralRoutines.vb&lt;/TT&gt;: Creating a Connection String&lt;/H5&gt;&lt;br /&gt;&lt;PRE&gt;&lt;br /&gt;Function BuildCnnStr(ByVal strServer As String, _&lt;br /&gt;          ByVal strDatabase As String) As String&lt;br /&gt;&lt;br /&gt;        Dim strTemp As String&lt;br /&gt;        strTemp = "Provider=SQLOleDB; Data Source=" &amp;amp; strServer &amp;amp; ";"&lt;br /&gt;        strTemp &amp;amp;= "Initial Catalog=" &amp;amp; strDatabase &amp;amp; ";"&lt;br /&gt;        strTemp &amp;amp;= "Integrated Security=SSPI"&lt;br /&gt;&lt;br /&gt;        Return strTemp&lt;br /&gt;    End Function&lt;br /&gt;&lt;/PRE&gt;&lt;br /&gt;&lt;P class="docText"&gt;Although you could create a routine that would pass back a &lt;TT&gt;Connection&lt;/TT&gt; object, a more versatile method would be to pass back a string. The reason for this is that for some objects, you are asked only for a &lt;TT&gt;Connection&lt;/TT&gt; object, but other objects want just a string.&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;LI&gt;&lt;span style="font-weight:normal" value="3"&gt;&lt;P class="docText"&gt;Add the code in Listing 6.2 to the Load event of the form. (Double-click on the form to bring up the code.)&lt;/P&gt;&lt;br /&gt;&lt;H5 class="docExampleTitle"&gt;Listing 6.2 &lt;TT&gt;frmHowTo6_1.vb&lt;/TT&gt;: Loading the Form&lt;/H5&gt;&lt;br /&gt;&lt;PRE&gt;&lt;br /&gt;Private Sub frmHowTo6_1_Load(ByVal sender As System.Object,&lt;br /&gt;                    ByVal e As System.EventArgs) Handles MyBase.Load&lt;br /&gt;&lt;br /&gt;        GenerateData(Me.rbDistinct.Checked)&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;&lt;/PRE&gt;&lt;/span&gt;&lt;/LI&gt;&lt;LI&gt;&lt;span style="font-weight:normal" value="4"&gt;&lt;P class="docText"&gt;Add the code in Listing 6.3 to the class module of the page, creating the GenerateData routine. This routine creates the necessary SQL &lt;TT&gt;SELECT&lt;/TT&gt; statement based on whether &lt;TT&gt;blnUseDistinct&lt;/TT&gt; is &lt;TT&gt;true&lt;/TT&gt; or &lt;TT&gt;false&lt;/TT&gt;. If you look back at Listing 6.2, you will see that this is the value of option button rbDistinct. After the SQL string is created, it is assigned to &lt;TT&gt;lblSQLString&lt;/TT&gt; to display the string, and then it is used in a data adapter to fill a dataset. Last, the SQL string is assigned as the data source for the data grid &lt;TT&gt;dgResults&lt;/TT&gt;.&lt;/P&gt;&lt;br /&gt;&lt;H5 class="docExampleTitle"&gt;Listing 6.3 &lt;TT&gt;frmHowTo6_1.vb&lt;/TT&gt;: Building the SQL String for Retrieving the Data&lt;/H5&gt;&lt;br /&gt;&lt;PRE&gt;&lt;br /&gt;Sub GenerateData(ByVal blnUseDistinct As Boolean)&lt;br /&gt;&lt;br /&gt;        '-- Build the SQL String&lt;br /&gt;        Dim strSQL As String&lt;br /&gt;&lt;br /&gt;        strSQL = "SELECT "&lt;br /&gt;&lt;br /&gt;        If blnUseDistinct Then&lt;br /&gt;            strSQL += "DISTINCT "&lt;br /&gt;        End If&lt;br /&gt;&lt;br /&gt;        strSQL += "Customers.CompanyName FROM Customers "&lt;br /&gt;        strSQL += "INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID"&lt;br /&gt;&lt;br /&gt;        '-- Store the SQL String&lt;br /&gt;        Me.lblSQLString.Text = strSQL&lt;br /&gt;&lt;br /&gt;        '-- Use the SQL String to build the data adapter and fill the data table.&lt;br /&gt;        Dim odaResults As New OleDb.OleDbDataAdapter(Me.lblSQLString.Text, _&lt;br /&gt;                                  BuildCnnStr("(local)", "Northwind"))&lt;br /&gt;        Dim dtResults As New DataTable()&lt;br /&gt;&lt;br /&gt;        odaResults.Fill(dtResults)&lt;br /&gt;&lt;br /&gt;        '-- Assign the data table to the data grid's DataSource property&lt;br /&gt;        Me.dgResults.DataSource = dtResults&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;&lt;/PRE&gt;&lt;/span&gt;&lt;/LI&gt;&lt;LI&gt;&lt;span style="font-weight:normal" value="5"&gt;&lt;P class="docText"&gt;Add the code in Listing 5.4 to the &lt;TT&gt;CheckChanged&lt;/TT&gt; event of the rbDistinct Radio Button control.&lt;/P&gt;&lt;br /&gt;&lt;H5 class="docExampleTitle"&gt;Listing 6.4 &lt;TT&gt;frmHowTo6_1.vb&lt;/TT&gt;: Regenerating the Data Based on the Radio Button That Is Checked&lt;/H5&gt;&lt;br /&gt;&lt;PRE&gt;&lt;br /&gt;Private Sub rbDistinct_CheckedChanged(ByVal sender As System.Object, _&lt;br /&gt;                ByVal e As System.EventArgs) Handles rbDistinct.CheckedChanged&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        GenerateData(Me.rbDistinct.Checked)&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;&lt;/PRE&gt;&lt;br /&gt;&lt;div class="docNote"&gt;&lt;p class="docNoteTitle"&gt;Tip&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;table width="90%" border="0" cellspacing="0" cellpadding="1"&gt;&lt;tr&gt;&lt;br /&gt;&lt;td width="60" valign="top"&gt;&lt;/td&gt;&lt;br /&gt;&lt;td valign="top"&gt;&lt;P class="docText"&gt;You might have noticed that besides the loading of the form, I only call the &lt;TT&gt;GenerateData&lt;/TT&gt; routine when the rbDistinct option button is changed, and not when the rbShowAll option button is changed. Because only two buttons are available, you only have to program one of the control's events. If you put it on both, you will have the routine called twice, which is not a good thing in this case.&lt;/P&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/p&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/span&gt;&lt;br /&gt;&lt;H4 class="docSection2Title"&gt; Comments&lt;/H4&gt;&lt;br /&gt;&lt;P class="docText"&gt;It is hard to believe that just one word can affect the data that a SQL statement returns. For the most part, you will want to see all of the records that a &lt;TT&gt;SELECT&lt;/TT&gt; statement returns, but it is nice to have the &lt;TT&gt;DISTINCT&lt;/TT&gt; clause when you need to limit the data.&lt;/P&gt;&lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;td&gt;&lt;/td&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;td class="tt1"&gt;[ Team LiB ]&lt;/td&gt;&lt;td valign="top" class="tt1" align="right"&gt;&lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;&lt;/td&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7284850559043997789-6981283986983394410?l=cs20001.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cs20001.blogspot.com/feeds/6981283986983394410/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7284850559043997789&amp;postID=6981283986983394410' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/6981283986983394410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/6981283986983394410'/><link rel='alternate' type='text/html' href='http://cs20001.blogspot.com/2010/02/61-retrieve-unique-records-using-only.html' title='6.1 Retrieve Unique Records Using Only a Select Query'/><author><name>rong889</name><uri>http://www.blogger.com/profile/06593146008221514057</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7284850559043997789.post-2018144406593553864</id><published>2010-02-04T05:27:00.023-08:00</published><updated>2010-02-04T05:27:46.720-08:00</updated><title type='text'>Recipe 3.13. Generating a High-Precision Time</title><content type='html'>&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;td align="right"&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;H3 id="title-IDA2S4JL" class="docSection1Title"&gt;Recipe 3.13. Generating a High-Precision Time&lt;/H3&gt;&lt;br /&gt;&lt;br /&gt;&lt;H4 id="title-IDACT4JL" class="docSection2Title"&gt;3.13.1. Problem&lt;/H4&gt;&lt;br /&gt;&lt;p class="docText"&gt;You need &lt;br /&gt; &lt;br /&gt;to measure time with finer than one-second resolution'for example, to generate a unique ID or benchmark a function call.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;H4 id="title-IDAVT4JL" class="docSection2Title"&gt;3.13.2. Solution&lt;/h4&gt;&lt;br /&gt;&lt;p class="docText"&gt;Use &lt;br /&gt;&lt;tt&gt;microtime(true)&lt;/tt&gt; to get the current time in seconds and microseconds. Example 3-37 uses &lt;tt&gt;microtime(true)&lt;/tt&gt; to time how long it takes to do 1,000 regular expression matches.&lt;/p&gt;&lt;br /&gt;&lt;H5 id="title-IDAKU4JL" class="docExampleTitle"&gt;Timing with microtime( )&lt;/H5&gt;&lt;p&gt;&lt;table cellspacing="0" width="90%" border="1" cellpadding="5"&gt;&lt;tr&gt;&lt;TD&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;?php&lt;br /&gt;$start = microtime(true);&lt;br /&gt;for ($i = 0; $i &amp;lt; 1000; $i++) {&lt;br /&gt;    preg_match('/age=\d+/',$_SERVER['QUERY_STRING']);&lt;br /&gt;}&lt;br /&gt;$end = microtime(true);&lt;br /&gt;$elapsed = $end - $start;&lt;/pre&gt;&lt;BR&gt;&lt;br /&gt;&lt;br /&gt;&lt;/TD&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;H4 id="title-IDAUU4JL" class="docSection2Title"&gt;3.13.3. Discussion&lt;/h4&gt;&lt;br /&gt;&lt;p class="docText"&gt;Support for the optional argument &lt;i&gt;microtime( )&lt;/i&gt; was added in PHP 5.0.0. Without that argument, with an argument that doesn't evaluate to &lt;tt&gt;true&lt;/tt&gt;, or in an earlier version of PHP, &lt;I&gt;microtime( )&lt;/i&gt; returns a string that contains the microseconds part of elapsed time since the epoch, a space, and seconds since the epoch. For example, a return value of &lt;tt&gt;0.41644100 1026683258&lt;/tt&gt; means that 1026683258.41644100 seconds have elapsed since the epoch.&lt;/p&gt;&lt;br /&gt;&lt;p class="docText"&gt;Time including microseconds is useful for generating unique IDs. When combined with the current process ID, it guarantees a unique ID, as long as a process doesn't generate more than one ID per microsecond. Example 3-38 uses &lt;I&gt;microtime( )&lt;/i&gt; (with its string return format) to generate just such an ID.&lt;/p&gt;&lt;br /&gt;&lt;h5 id="title-IDAOV4JL" class="docExampleTitle"&gt;Generating an ID with microtime( )&lt;/h5&gt;&lt;p&gt;&lt;table cellspacing="0" width="90%" border="1" cellpadding="5"&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;?php&lt;br /&gt;[list($microseconds,$seconds) = explode(' ',microtime());&lt;br /&gt;$id = $seconds.$microseconds.getmypid();&lt;br /&gt;?&amp;gt;&lt;/pre&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="docText"&gt;Note that the method in Example 3-38 is not as foolproof on multithreaded systems, where there is a non-zero (but very tiny) chance that two threads of the same process could call &lt;i&gt;microtime( )&lt;/i&gt; during the same microsecond.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4 id="title-IDACW4JL" class="docSection2Title"&gt;3.13.4. See Also&lt;/h4&gt;&lt;br /&gt;&lt;p class="docText"&gt;Documentation on &lt;i&gt;microtime( )&lt;/I&gt; at http://www.php.net/microtime. The &lt;i&gt;uniqid( )&lt;/I&gt; function is good for generating unique IDs.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/table&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;td align="right"&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7284850559043997789-2018144406593553864?l=cs20001.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cs20001.blogspot.com/feeds/2018144406593553864/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7284850559043997789&amp;postID=2018144406593553864' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/2018144406593553864'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/2018144406593553864'/><link rel='alternate' type='text/html' href='http://cs20001.blogspot.com/2010/02/recipe-313-generating-high-precision.html' title='Recipe 3.13. Generating a High-Precision Time'/><author><name>rong889</name><uri>http://www.blogger.com/profile/06593146008221514057</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7284850559043997789.post-5742812552674159002</id><published>2010-02-04T05:27:00.021-08:00</published><updated>2010-02-04T05:27:44.025-08:00</updated><title type='text'>1.6 Managed Resource Responsibilities</title><content type='html'>&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#CCCCCC"&gt;&lt;br /&gt;&lt;td class="tt1"&gt;Ru-Brd&lt;/td&gt;&lt;br /&gt;&lt;td valign="top" class="v2" align="right"&gt;&lt;br /&gt;	&lt;br /&gt;	&lt;br /&gt;&lt;/td&gt;&lt;/table&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td valign="top"&gt;&lt;H3 class="docSection1Title"&gt;1.6 Managed Resource Responsibilities&lt;/H3&gt;&lt;br /&gt;&lt;P class="docText"&gt;In order for management systems to manage software resources, they must have information (i.e., management data) about the resources they're managing, along with the ability to control or update those resources via management operations. This information and operations are provided by management instrumentation from inside and outside the resource itself. This section will explain management data, management operations, and management instrumentation.&lt;/P&gt;&lt;br /&gt;&lt;H4 class="docSection2Title"&gt;1.6.1 Management Data&lt;/H4&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;span class="docEmphasis"&gt;Management data&lt;/span&gt; is the information about a software resource that a management system uses. The management system must be able to determine the identity of the resource, how it has been defined to run, and what statistics are available to monitor it. The management data that management systems need access to generally falls into four categories:&lt;/P&gt;&lt;br /&gt;&lt;span style="font-weight:bold"&gt;&lt;OL class="docList" TYPE="1"&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;p class="docText"&gt;&lt;span class="docEmphStrong"&gt;Identification data&lt;/span&gt;. &lt;br /&gt;&lt;span class="docEmphasis"&gt;Identification data&lt;/span&gt; uniquely identifies the resource to be managed. This data must include the name of the resource and an identifier that allows a specific instance of the resource to be distinguished from other instances of the same type. Other data that is usually included is resource type, vendor, version, serial number, location, contact, installation date, last updated date, and address. This data is used by management systems with discovery, inventory, topology, and configuration components. If the management system cannot find this data for the resource, the resource must be manually defined to the discovery, inventory, topology, and configuration management systems.&lt;/p&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;p class="docText"&gt;&lt;span class="docEmphStrong"&gt;Configuration data&lt;/span&gt;. &lt;br /&gt;&lt;span class="docEmphasis"&gt;Configuration data&lt;/span&gt; may include the complete configuration of the resource or a subset thereof. Read access alone is valuable for problem determination and dynamic management policy. It gives the management system real-time management guidance about data for which thresholds should be established, logs and components that should be managed, and so on. If the configuration data can be set by the management system, an update to this data may cause the resource to dynamically update and behave in accordance with the new configuration values.&lt;/p&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;p class="docText"&gt;&lt;span class="docEmphStrong"&gt;Statistical data&lt;/span&gt;. &lt;br /&gt;&lt;span class="docEmphasis"&gt;Statistical data&lt;/span&gt; is numerical data that generally represents the current state of the resource. Most management systems use resource statistics as the data to be monitored to determine resource health. Depending on the quality and quantity of statistical data available from the resource, management systems may also be able to use this data for load and resource balancing, tuning, trend analysis, capacity forecasting, billing, and understanding application usage. Service-level agreements and the systems that report and enforce them use statistical data to define the expectations, thresholds, and responses for the service-level agreements for an application.&lt;/p&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;p class="docText"&gt;&lt;span class="docEmphStrong"&gt;Status data&lt;/span&gt;. &lt;br /&gt;&lt;span class="docEmphasis"&gt;Status data&lt;/span&gt; is information about the resource that indicates its health and current operational state. Typically status data is reported by enumerated values, like &lt;TT&gt;Active&lt;/TT&gt;, &lt;TT&gt;Degraded&lt;/TT&gt;, &lt;TT&gt;Stopped&lt;/TT&gt;, &lt;TT&gt;DependencyDown&lt;/TT&gt;, &lt;TT&gt;Down&lt;/TT&gt;, or &lt;TT&gt;Failed&lt;/TT&gt;. A resource may have status substates indicating the health and state of its components.&lt;/p&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;/OL&gt;&lt;/span&gt;&lt;br /&gt;&lt;P class="docText"&gt;Some of this information (e.g., configuration data) can be obtained from logs and files. Some of this information must be obtained directly from the managed resource.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;H4 class="docSection2Title"&gt;1.6.2 Management Operations&lt;/H4&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;span class="docEmphasis"&gt;Management operations&lt;/span&gt; are used to control, locally or remotely, all components of a managed resource. Operations can be categorized as lifecycle control (start, stop, restart, refresh, and so on), query, configure, and custom. Some of these operations (e.g., start and stop) are provided by the platform that is hosting the managed resource. Some must be provided directly by the managed resource as commands or APIs. The management system will invoke these APIs and commands from scripts, programs, remote connections, command prompts, and agents in response to events, schedules, and user requests.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;It is interesting to note that although user-driven interfaces like administration applications can be used to drive management operations, it is difficult for management systems to use them. Software resources should supply a user interface and command or APIs for the management operations.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;H4 class="docSection2Title"&gt;1.6.3 Management Instrumentation&lt;/H4&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;span class="docEmphasis"&gt;Management instrumentation&lt;/span&gt; is the way a resource provides its management data and operations to the management system. Resources provide two types of management instrumentation: external and internal.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Management disciplines need different kinds of instrumentation, depending on whether they need to interact directly with the executing resource. For example, the distribute discipline typically needs only external instrumentation, and operations are difficult to support without internal instrumentation. Most disciplines use a combination of both types of instrumentation, as illustrated by Figure 1.8.&lt;/P&gt;&lt;br /&gt;&lt;CENTER&gt;&lt;H5 class="docFigureTitle"&gt;Figure 1.8. Internal and External Instrumentation&lt;/H5&gt;&lt;p class="docText"&gt;&lt;/p&gt;&lt;br /&gt;&lt;/CENTER&gt;&lt;br /&gt;&lt;P class="docText"&gt;JMX provides the infrastructure for Java resource developers to expose this management information. It also provides the APIs for management systems to gain access to the information and invoke the operations.&lt;/P&gt;&lt;br /&gt;&lt;H5 class="docSection3Title"&gt;1.6.3.1 External Instrumentation&lt;/H5&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;span class="docEmphasis"&gt;External instrumentation&lt;/span&gt; is management enablement that is defined and executed outside the resource itself. The external instrumentation consists of definitions describing the resource. The instrumentation is used to customize the management system so that it can effectively manage the resource. These definitions specify the directories, files, libraries, executables, installation processes, configurations, events, APIs, and policies that are required knowledge to manage the resource. The external instrumentation of the resource includes special files, programs, or utilities that may be necessary for the management system to access the data for or control the resource. The management disciplines of distribute, install, configure, monitor, and operate can be supported by this type of instrumentation.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Tivoli uses its Application Management Specification (AMS)&lt;SUP&gt;[44]&lt;/SUP&gt; files as its external instrumentation. AMS files are generically defined as a software resource's management "definition file." Some management system vendors provide tools to facilitate the creation of a resource's management definition files. For SNMP, the MIB file represents this type of instrumentation. For CIM/WBEM, the instrumentation is defined as a schema in a MOF (Managed Object Format) file.&lt;SUP&gt;[45]&lt;/SUP&gt;&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;H5 class="docSection3Title"&gt;1.6.3.2 Internal Instrumentation&lt;/H5&gt;&lt;br /&gt;&lt;P class="docText"&gt;&lt;span class="docEmphasis"&gt;Internal instrumentation&lt;/span&gt; is management enablement that is developed and executed directly as part of the resource by the vendor or developer. It consists of code specifically engineered to meet a management system's requirements. Basic instrumentation includes the provision of a command tool or a management agent that can invoke or perform the operations and that can obtain the application status and statistics. The monitor and control management disciplines may require this type of instrumentation. Extensive internal instrumentation may be required for communication with a single management system.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;Monitoring and operating an executing application requires that the application support instrumentation for several different types of management data and functions. For example, an SNMP subagent must be developed for each application that supports a defined SNMP MIB. Likewise, with WBEM, a CIM provider may need to be developed to support the management schema for an application. There is currently no standard instrumentation data or API approach for applications to adhere to or take advantage of. This may not be true in the future, however, because a management model defining the data for managing executing applications is currently being developed in the DMTF.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;In reality, a combination of external and internal instrumentation methodologies, as illustrated in Figure 1.8, is optimal. There are at least three good arguments for this:&lt;/P&gt;&lt;br /&gt;&lt;span style="font-weight:bold"&gt;&lt;OL class="docList" TYPE="1"&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;External instrumentation is rarely sufficient in and of itself. Generally the resource will need to expose some specific metrics, operations, and events. You then have internal instrumentation.&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;Internal instrumentation is rarely sufficient in and of itself. There are frequently management tasks to perform within a system to keep it healthy for the application to continue to function. Data space management by the rotation or clipping of logs, the compression of backup data, and the deletion of obsolete logs and data is an example of the second case for external instrumentation.&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;LI&gt;&lt;span style="font-weight:normal"&gt;&lt;P class="docList"&gt;You will need to advertise the internal instrumentation's capabilities in external instrumentation used by the management system. Defining an SNMP MIB is an example. You are advertising your management data to an SNMP manager.&lt;/P&gt;&lt;/span&gt;&lt;/LI&gt;&lt;br /&gt;&lt;/OL&gt;&lt;/span&gt;&lt;br /&gt;&lt;P class="docText"&gt;A single common application management API simplifies and minimizes the internal instrumentation required. This is the essence of the requirement for a common management system application-level API, as defined by the JMX API set and as described in this book.&lt;/P&gt;&lt;br /&gt;&lt;P class="docText"&gt;JMX is designed to satisfy the requirements of managing the executing application from the resource developer's point of view, as well as the management vendor's point of view. JMX is an internal instrumentation API. It is used to expose and and provide access to the execution-time management information that is necessary for an application to be manageable by an arbitrary management system. Tools can be used to generate the external instrumentation for a specific management system from the information available through the JMX APIs.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;td&gt;&lt;/td&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#CCCCCC"&gt;&lt;br /&gt;&lt;td class="tt1"&gt;Ru-Brd&lt;/td&gt;&lt;br /&gt;&lt;td valign="top" class="v2" align="right"&gt;&lt;br /&gt;          &lt;br /&gt;          &lt;br /&gt;&lt;/td&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7284850559043997789-5742812552674159002?l=cs20001.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cs20001.blogspot.com/feeds/5742812552674159002/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7284850559043997789&amp;postID=5742812552674159002' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/5742812552674159002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/5742812552674159002'/><link rel='alternate' type='text/html' href='http://cs20001.blogspot.com/2010/02/16-managed-resource-responsibilities.html' title='1.6 Managed Resource Responsibilities'/><author><name>rong889</name><uri>http://www.blogger.com/profile/06593146008221514057</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7284850559043997789.post-8918313566984087139</id><published>2010-02-04T05:27:00.019-08:00</published><updated>2010-02-04T05:27:40.786-08:00</updated><title type='text'>Section 5.23.  Take myPod for another test drive</title><content type='html'>&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;td align="right"&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;H3 id="title-IDAW0QWL" class="docSection1Title"&gt;5.23. Take myPod for another test drive&lt;/H3&gt;&lt;br /&gt;&lt;p class="docText"&gt;Ahhh... much better. Visitors can see all the available pictures at a glance. They can also tell which photos go with each city more easily. Now we need to find a way to link from each thumbnail to the corresponding large image.&lt;/p&gt;&lt;br /&gt;&lt;p class="docText"&gt;Wait a sec, don't you think you're pulling a fast one? The images used to be on top of each other; now they're side by side.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4 id="title-IDAA1QWL" class="docSection2Title"&gt;5.23.1. Right; but remember the &amp;lt;img&amp;gt; element is an inline element.&lt;/h4&gt;&lt;br /&gt;&lt;p class="docText"&gt;In other words, we didn't "pull anything." Because &lt;span class="docEmphStrong"&gt;&amp;lt;img&amp;gt;&lt;/span&gt; is an inline element, it doesn't cause linebreaks to be inserted before and after the element is displayed. So, if there are several images together in your &lt;span class="docEmphStrong"&gt;HTML&lt;/span&gt;, the browser will fit them side by side if the browser window is wide enough.&lt;/P&gt;&lt;br /&gt;&lt;p class="docText"&gt;The reason the larger photos weren't side by side is because the browser didn't have room to display them next to each other. Instead, it displayed them on top of each other. A browser always displays vertical space before and after a block element, and if you look back at the screenshots, you'll see the images are right on top of each other with no space in between. That's another sign &lt;span class="docEmphStrong"&gt;&amp;lt;img&amp;gt;&lt;/span&gt; is an inline element.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/table&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;td align="right"&gt;&lt;div STYLE="MARGIN-LEFT: 0.15in;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7284850559043997789-8918313566984087139?l=cs20001.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cs20001.blogspot.com/feeds/8918313566984087139/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7284850559043997789&amp;postID=8918313566984087139' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/8918313566984087139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/8918313566984087139'/><link rel='alternate' type='text/html' href='http://cs20001.blogspot.com/2010/02/section-523-take-mypod-for-another-test.html' title='Section 5.23.  Take myPod for another test drive'/><author><name>rong889</name><uri>http://www.blogger.com/profile/06593146008221514057</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7284850559043997789.post-7670425149508942491</id><published>2010-02-04T05:27:00.017-08:00</published><updated>2010-02-04T05:27:39.544-08:00</updated><title type='text'>Section 3.3.  Self Joins</title><content type='html'>&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td valign="top" class="v2" align="right"&gt;&amp;nbsp;&lt;br /&gt;          &lt;br /&gt;&amp;nbsp;    &lt;br /&gt;          &lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;br /&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;br /&gt;&lt;H3 class="docSection1Title"&gt;3.3 Self Joins&lt;/H3&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docText"&gt;There are situations &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;in which one row of a table is related&lt;br /&gt;&lt;br /&gt;to another row of the same table. The EMPLOYEE table is a good&lt;br /&gt;&lt;br /&gt;example. The manager of one employee is also an employee. The rows&lt;br /&gt;&lt;br /&gt;for both are in the same EMPLOYEE table. This relationship is&lt;br /&gt;&lt;br /&gt;indicated in the MANAGER_EMP_ID column:&lt;br /&gt;&lt;br /&gt;&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;CREATE TABLE EMPLOYEE (&lt;br /&gt;&lt;br /&gt;EMP_ID          NUMBER (4) NOT NULL PRIMARY KEY,&lt;br /&gt;&lt;br /&gt;FNAME           VARCHAR2 (15), &lt;br /&gt;&lt;br /&gt;LNAME           VARCHAR2 (15), &lt;br /&gt;&lt;br /&gt;DEPT_ID         NUMBER (2),&lt;br /&gt;&lt;br /&gt;MANAGER_EMP_ID  NUMBER (4) REFERENCES EMPLOYEE(EMP_ID),&lt;br /&gt;&lt;br /&gt;SALARY          NUMBER (7,2),&lt;br /&gt;&lt;br /&gt;HIRE_DATE       DATE, &lt;br /&gt;&lt;br /&gt;JOB_ID          NUMBER (3));&lt;/PRE&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docText"&gt;To get information about an employee and his manager, you have to&lt;br /&gt;&lt;br /&gt;join the EMPLOYEE table with itself. This is achieved by specifying&lt;br /&gt;&lt;br /&gt;the EMPLOYEE table twice in the FROM clause and using two different&lt;br /&gt;&lt;br /&gt;table &lt;br /&gt;&lt;br /&gt;aliases,&lt;br /&gt;&lt;br /&gt;thereby treating EMPLOYEE as if it were two separate tables. The&lt;br /&gt;&lt;br /&gt;following example lists the name of each employee and his manager:&lt;br /&gt;&lt;br /&gt;&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;&lt;B&gt;SELECT E.NAME EMPLOYEE, M.NAME MANAGER&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;B&gt;FROM EMPLOYEE E, EMPLOYEE M&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;B&gt;WHERE E.MANAGER_EMP_ID = M.EMP_ID;&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;EMPLOYEE   MANAGER&lt;br /&gt;&lt;br /&gt;---------- ----------&lt;br /&gt;&lt;br /&gt;SMITH      FORD&lt;br /&gt;&lt;br /&gt;ALLEN      BLAKE&lt;br /&gt;&lt;br /&gt;WARD       BLAKE&lt;br /&gt;&lt;br /&gt;JONES      KING&lt;br /&gt;&lt;br /&gt;MARTIN     BLAKE&lt;br /&gt;&lt;br /&gt;BLAKE      KING&lt;br /&gt;&lt;br /&gt;CLARK      KING&lt;br /&gt;&lt;br /&gt;SCOTT      JONES&lt;br /&gt;&lt;br /&gt;TURNER     BLAKE&lt;br /&gt;&lt;br /&gt;ADAMS      SCOTT&lt;br /&gt;&lt;br /&gt;JAMES      BLAKE&lt;br /&gt;&lt;br /&gt;FORD       JONES&lt;br /&gt;&lt;br /&gt;MILLER     CLARK&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;13 rows selected.&lt;/PRE&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docText"&gt;Notice the use of the EMPLOYEE table twice in the FROM clause with&lt;br /&gt;&lt;br /&gt;two different aliases. Also notice the join condition that reads as:&lt;br /&gt;&lt;br /&gt;"Where the employee's&lt;br /&gt;&lt;br /&gt;MANAGER_EMP_ID is the same as his manager's&lt;br /&gt;&lt;br /&gt;EMP_ID."&lt;br /&gt;&lt;br /&gt;&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;H4 class="docSection2Title"&gt;3.3.1 Self Outer Joins&lt;/H4&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docText"&gt;Even though &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;the EMPLOYEE&lt;br /&gt;&lt;br /&gt;table has 14 rows, the previous query returned only 13 rows. This is&lt;br /&gt;&lt;br /&gt;because there is an employee without a MANAGER_EMP_ID. Oracle&lt;br /&gt;&lt;br /&gt;excludes this row from the result set while performing the self inner&lt;br /&gt;&lt;br /&gt;join. To include the employee(s) without a MANAGER_EMP_ID, you need&lt;br /&gt;&lt;br /&gt;an outer join:&lt;br /&gt;&lt;br /&gt;&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;&lt;B&gt;SELECT E.LNAME EMPLOYEE, M.LNAME MANAGER&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;B&gt;FROM EMPLOYEE E, EMPLOYEE M&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;B&gt;WHERE E.MANAGER_EMP_ID = M.EMP_ID (+);&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;EMPLOYEE   MANAGER&lt;br /&gt;&lt;br /&gt;---------- ----------&lt;br /&gt;&lt;br /&gt;SMITH      FORD&lt;br /&gt;&lt;br /&gt;ALLEN      BLAKE&lt;br /&gt;&lt;br /&gt;WARD       BLAKE&lt;br /&gt;&lt;br /&gt;JONES      KING&lt;br /&gt;&lt;br /&gt;MARTIN     BLAKE&lt;br /&gt;&lt;br /&gt;BLAKE      KING&lt;br /&gt;&lt;br /&gt;CLARK      KING&lt;br /&gt;&lt;br /&gt;SCOTT      JONES&lt;br /&gt;&lt;br /&gt;KING&lt;br /&gt;&lt;br /&gt;TURNER     BLAKE&lt;br /&gt;&lt;br /&gt;ADAMS      SCOTT&lt;br /&gt;&lt;br /&gt;JAMES      BLAKE&lt;br /&gt;&lt;br /&gt;FORD       JONES&lt;br /&gt;&lt;br /&gt;MILLER     CLARK&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;14 rows selected.&lt;/PRE&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docText"&gt;Be careful when placing the (+) operator&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; in a join&lt;br /&gt;&lt;br /&gt;condition. If you put the (+) on the wrong side, you will get an&lt;br /&gt;&lt;br /&gt;absurd result set that makes no sense. In this case, the EMPLOYEE&lt;br /&gt;&lt;br /&gt;table we need to make optional is the one from which we are drawing&lt;br /&gt;&lt;br /&gt;manager names.&lt;br /&gt;&lt;br /&gt;&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;H4 class="docSection2Title"&gt;3.3.2 Self Non-Equi-Joins&lt;/H4&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docText"&gt;The previous  &lt;br /&gt;&lt;br /&gt;  example showed self-equi-joins.&lt;br /&gt;&lt;br /&gt;However, there are situations when you need to perform&lt;br /&gt;&lt;br /&gt;self-non-equi-joins. We will illustrate this by an example.&lt;br /&gt;&lt;br /&gt;Let's assume that you are in charge of organizing&lt;br /&gt;&lt;br /&gt;interdepartmental basket ball competition within your company. It is&lt;br /&gt;&lt;br /&gt;your responsibility to draw the teams and schedule the competition.&lt;br /&gt;&lt;br /&gt;You query the DEPARTMENT table and get the following result:&lt;br /&gt;&lt;br /&gt;&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;&lt;B&gt;SELECT NAME FROM DEPARTMENT;&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;NAME&lt;br /&gt;&lt;br /&gt;--------------&lt;br /&gt;&lt;br /&gt;ACCOUNTING&lt;br /&gt;&lt;br /&gt;RESEARCH&lt;br /&gt;&lt;br /&gt;SALES&lt;br /&gt;&lt;br /&gt;OPERATIONS&lt;/PRE&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docText"&gt;You find that there are four departments, and to make a fair&lt;br /&gt;&lt;br /&gt;competition, you decide that each department plays against the other&lt;br /&gt;&lt;br /&gt;three departments once, and at the end the department with the&lt;br /&gt;&lt;br /&gt;maximum wins is declared the winner. You have been to an Oracle SQL&lt;br /&gt;&lt;br /&gt;training class recently, and decide to apply the concept of self&lt;br /&gt;&lt;br /&gt;join. You execute the following query:&lt;br /&gt;&lt;br /&gt;&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;&lt;B&gt;SELECT D1.NAME TEAM1, D2.NAME TEAM2&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;B&gt;FROM DEPARTMENT D1, DEPARTMENT D2;&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;TEAM1          TEAM2&lt;br /&gt;&lt;br /&gt;-------------- --------------&lt;br /&gt;&lt;br /&gt;ACCOUNTING     ACCOUNTING&lt;br /&gt;&lt;br /&gt;RESEARCH       ACCOUNTING&lt;br /&gt;&lt;br /&gt;SALES          ACCOUNTING&lt;br /&gt;&lt;br /&gt;OPERATIONS     ACCOUNTING&lt;br /&gt;&lt;br /&gt;ACCOUNTING     RESEARCH&lt;br /&gt;&lt;br /&gt;RESEARCH       RESEARCH&lt;br /&gt;&lt;br /&gt;SALES          RESEARCH&lt;br /&gt;&lt;br /&gt;OPERATIONS     RESEARCH&lt;br /&gt;&lt;br /&gt;ACCOUNTING     SALES&lt;br /&gt;&lt;br /&gt;RESEARCH       SALES&lt;br /&gt;&lt;br /&gt;SALES          SALES&lt;br /&gt;&lt;br /&gt;OPERATIONS     SALES&lt;br /&gt;&lt;br /&gt;ACCOUNTING     OPERATIONS&lt;br /&gt;&lt;br /&gt;RESEARCH       OPERATIONS&lt;br /&gt;&lt;br /&gt;SALES          OPERATIONS&lt;br /&gt;&lt;br /&gt;OPERATIONS     OPERATIONS&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;16 rows selected.&lt;/PRE&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docText"&gt;Disappointing results. From your knowledge of high school&lt;br /&gt;&lt;br /&gt;mathematics, you know that four teams each playing once with the&lt;br /&gt;&lt;br /&gt;other three makes six combinations. However, your SQL query returned&lt;br /&gt;&lt;br /&gt;16 rows. Now you realize that since you didn't&lt;br /&gt;&lt;br /&gt;specify any join condition, you got a Cartesian product from your&lt;br /&gt;&lt;br /&gt;query. You put in a join condition, and your query and results now&lt;br /&gt;&lt;br /&gt;look as follows:&lt;br /&gt;&lt;br /&gt;&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;&lt;B&gt;SELECT D1.NAME TEAM1, D2.NAME TEAM2&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;B&gt;FROM DEPARTMENT D1, DEPARTMENT D2&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;B&gt;WHERE D1.DEPT_ID = D2.DEPT_ID;&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;TEAM1          TEAM2&lt;br /&gt;&lt;br /&gt;-------------- --------------&lt;br /&gt;&lt;br /&gt;ACCOUNTING     ACCOUNTING&lt;br /&gt;&lt;br /&gt;RESEARCH       RESEARCH&lt;br /&gt;&lt;br /&gt;SALES          SALES&lt;br /&gt;&lt;br /&gt;OPERATIONS     OPERATIONS&lt;/PRE&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docText"&gt;Oops! The equi-join returned a very unwanted result. A team&lt;br /&gt;&lt;br /&gt;can't play against itself. You realize your mistake,&lt;br /&gt;&lt;br /&gt;and this sparks the idea that you can use non-equi-joins in this&lt;br /&gt;&lt;br /&gt;situation. You rewrite the query as a non-equi-join. You&lt;br /&gt;&lt;br /&gt;don't want a team to play against itself, and&lt;br /&gt;&lt;br /&gt;therefore replace the "=" operator&lt;br /&gt;&lt;br /&gt;in the join condition with "!=".&lt;br /&gt;&lt;br /&gt;Let's look at the results:&lt;br /&gt;&lt;br /&gt;&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;&lt;B&gt;SELECT D1.NAME TEAM1, D2.NAME TEAM2&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;B&gt;FROM DEPARTMENT D1, DEPARTMENT D2&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;B&gt;WHERE D1.DEPT_ID != D2.DEPT_ID;&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;TEAM1          TEAM2&lt;br /&gt;&lt;br /&gt;-------------- --------------&lt;br /&gt;&lt;br /&gt;RESEARCH       ACCOUNTING&lt;br /&gt;&lt;br /&gt;SALES          ACCOUNTING&lt;br /&gt;&lt;br /&gt;OPERATIONS     ACCOUNTING&lt;br /&gt;&lt;br /&gt;ACCOUNTING     RESEARCH&lt;br /&gt;&lt;br /&gt;SALES          RESEARCH&lt;br /&gt;&lt;br /&gt;OPERATIONS     RESEARCH&lt;br /&gt;&lt;br /&gt;ACCOUNTING     SALES&lt;br /&gt;&lt;br /&gt;RESEARCH       SALES&lt;br /&gt;&lt;br /&gt;OPERATIONS     SALES&lt;br /&gt;&lt;br /&gt;ACCOUNTING     OPERATIONS&lt;br /&gt;&lt;br /&gt;RESEARCH       OPERATIONS&lt;br /&gt;&lt;br /&gt;SALES          OPERATIONS&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;12 rows selected.&lt;/PRE&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docText"&gt;Still not done. In this result set, you have permutations such as&lt;br /&gt;&lt;br /&gt;(RESEARCH, ACCOUNTING) and (ACCOUNTING, RESEARCH), and so on.&lt;br /&gt;&lt;br /&gt;Therefore, each team plays against the others twice. You need to&lt;br /&gt;&lt;br /&gt;remove these permutations, which you rightly consider to be&lt;br /&gt;&lt;br /&gt;duplicates. You think about using DISTINCT. DISTINCT will not help here,&lt;br /&gt;&lt;br /&gt;because the row (RESEARCH, ACCOUNTING) is different from the row&lt;br /&gt;&lt;br /&gt;(ACCOUNTING, RESEARCH) from the viewpoint of DISTINCT; but not from&lt;br /&gt;&lt;br /&gt;the viewpoint of your requirement. After some thought, you want to&lt;br /&gt;&lt;br /&gt;try out an inequality operator other than&lt;br /&gt;&lt;br /&gt;"!=". You decide to go with the&lt;br /&gt;&lt;br /&gt;less-than (&amp;lt;) operator. Here are the results you get:&lt;br /&gt;&lt;br /&gt;&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;&lt;B&gt;SELECT D1.NAME TEAM1, D2.NAME TEAM2&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;B&gt;FROM DEPARTMENT D1, DEPARTMENT D2&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;B&gt;WHERE D1.DEPT_ID &amp;lt; D2.DEPT_ID;&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;TEAM1          TEAM2&lt;br /&gt;&lt;br /&gt;-------------- --------------&lt;br /&gt;&lt;br /&gt;ACCOUNTING     RESEARCH&lt;br /&gt;&lt;br /&gt;ACCOUNTING     SALES&lt;br /&gt;&lt;br /&gt;RESEARCH       SALES&lt;br /&gt;&lt;br /&gt;ACCOUNTING     OPERATIONS&lt;br /&gt;&lt;br /&gt;RESEARCH       OPERATIONS&lt;br /&gt;&lt;br /&gt;SALES          OPERATIONS&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6 rows selected.&lt;/PRE&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docText"&gt;That's it! Now you have six combinations: each team&lt;br /&gt;&lt;br /&gt;plays against the other three just once. Let's&lt;br /&gt;&lt;br /&gt;examine why this version of the query works. Conceptually, when&lt;br /&gt;&lt;br /&gt;Oracle executes this query, a Cartesian product is first formed with&lt;br /&gt;&lt;br /&gt;16 rows. Then the less-than (&amp;lt;) operator  &lt;br /&gt;&lt;br /&gt;in the join condition restricts&lt;br /&gt;&lt;br /&gt;the result set to those rows in which the DEPT_ID of Team 1 is less&lt;br /&gt;&lt;br /&gt;than the DEPT_ID of Team 2. The less-than (&amp;lt;) operator eliminates&lt;br /&gt;&lt;br /&gt;the duplicates, because for any given permutation of two departments&lt;br /&gt;&lt;br /&gt;this condition is satisfied for only one. Using greater-than (&amp;gt;)&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;instead of less-than (&amp;lt;) will&lt;br /&gt;&lt;br /&gt;also give you the required result, but the TEAM1 and TEAM2 values&lt;br /&gt;&lt;br /&gt;will be reversed:&lt;br /&gt;&lt;br /&gt;&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;&lt;B&gt;SELECT D1.NAME TEAM1, D2.NAME TEAM2&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;B&gt;FROM DEPARTMENT D1, DEPARTMENT D2&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;B&gt;WHERE D1.DEPT_ID &amp;gt; D2.DEPT_ID;&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;TEAM1          TEAM2&lt;br /&gt;&lt;br /&gt;-------------- --------------&lt;br /&gt;&lt;br /&gt;RESEARCH       ACCOUNTING&lt;br /&gt;&lt;br /&gt;SALES          ACCOUNTING&lt;br /&gt;&lt;br /&gt;OPERATIONS     ACCOUNTING&lt;br /&gt;&lt;br /&gt;SALES          RESEARCH&lt;br /&gt;&lt;br /&gt;OPERATIONS     RESEARCH&lt;br /&gt;&lt;br /&gt;OPERATIONS     SALES&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6 rows selected.&lt;/PRE&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docText"&gt;Don't be disheartened by the painful process you had&lt;br /&gt;&lt;br /&gt;to go through to get this result. Sometimes you have to go through an&lt;br /&gt;&lt;br /&gt;agonizing experience to get simple results such as these.&lt;br /&gt;&lt;br /&gt;That's life. Now that you have the team combinations&lt;br /&gt;&lt;br /&gt;right, go a bit further and assign a date for each match. Use&lt;br /&gt;&lt;br /&gt;"tomorrow" as the starting date:&lt;br /&gt;&lt;br /&gt;&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;PRE&gt;&lt;B&gt;SELECT D1.NAME TEAM1, D2.NAME TEAM2, SYSDATE + ROWNUM MATCH_DATE&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;B&gt;FROM DEPARTMENT D1, DEPARTMENT D2&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;B&gt;WHERE D1.DEPT_ID &amp;lt; D2.DEPT_ID;&lt;/B&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;TEAM1          TEAM2          MATCH_DATE&lt;br /&gt;&lt;br /&gt;-------------- -------------- ---------&lt;br /&gt;&lt;br /&gt;ACCOUNTING     RESEARCH       30-APR-01&lt;br /&gt;&lt;br /&gt;ACCOUNTING     SALES          01-MAY-01&lt;br /&gt;&lt;br /&gt;RESEARCH       SALES          02-MAY-01&lt;br /&gt;&lt;br /&gt;ACCOUNTING     OPERATIONS     03-MAY-01&lt;br /&gt;&lt;br /&gt;RESEARCH       OPERATIONS     04-MAY-01&lt;br /&gt;&lt;br /&gt;SALES          OPERATIONS     05-MAY-01&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6 rows selected.&lt;/PRE&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;P class="docText"&gt;Now publish these results on the corporate intranet along with the&lt;br /&gt;&lt;br /&gt;rules and regulations for the competition, and you are     done.&lt;br /&gt;&lt;br /&gt;&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;td valign="top" class="v2" align="right"&gt;&amp;nbsp;&lt;br /&gt;          &lt;br /&gt;&amp;nbsp;    &lt;br /&gt;          &lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7284850559043997789-7670425149508942491?l=cs20001.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cs20001.blogspot.com/feeds/7670425149508942491/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7284850559043997789&amp;postID=7670425149508942491' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/7670425149508942491'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/7670425149508942491'/><link rel='alternate' type='text/html' href='http://cs20001.blogspot.com/2010/02/section-33-self-joins.html' title='Section 3.3.  Self Joins'/><author><name>rong889</name><uri>http://www.blogger.com/profile/06593146008221514057</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7284850559043997789.post-1366799541256416887</id><published>2010-02-04T05:27:00.015-08:00</published><updated>2010-02-04T05:27:36.493-08:00</updated><title type='text'>front_insert_iterator</title><content type='html'>&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;font size=5&gt;Class Name&lt;/font&gt;            front_insert_iterator&lt;br /&gt;&lt;br /&gt;&lt;font size=5&gt;Header File&lt;/font&gt;          &amp;lt;iterator&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;font size=5&gt;Classification&lt;/font&gt;      abstract data type&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Class Relationship Diagram&lt;br&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;Class Description&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;Member Classes&lt;/h1&gt;&lt;br /&gt;Container&amp; container&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;Methods&lt;/h1&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;explicit front_insert_iterator(Container&amp; x);&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h1&gt;Operators&lt;/h1&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;front_insert_iterator&amp;lt;Container&amp;gt;&amp; operator=&lt;br /&gt;(const typename Container::value_type value);&lt;br /&gt;&lt;br /&gt;front_insert_iterator&amp;lt;Container&amp;gt;&amp; operator*();&lt;br /&gt;&lt;br /&gt;front_insert_iterator&amp;lt;Container&amp;gt;&amp; operator++();&lt;br /&gt;&lt;br /&gt;front_insert_iterator&amp;lt;Container&amp;gt;&amp; operator++(int);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Class Description&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;The front_insert_iterator inserts elements at the front of a container by&lt;br /&gt;using the container's push_front() method to perform the insertion.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;h3&gt;Container&amp; container&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;The container in which elements will be inserted.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;Method             front_insert_iterator()&lt;br /&gt;&lt;br /&gt;Access             Public&lt;br /&gt;&lt;br /&gt;Classification     Constructor&lt;br /&gt;&lt;br /&gt;Syntax             explicit front_insert_iterator(Container&amp; x);&lt;br /&gt;&lt;br /&gt;Paramters          &lt;em&gt;x&lt;/em&gt; is the reference to the container in which elements&lt;br /&gt;                   will be inserted.&lt;br /&gt;&lt;br /&gt;Returns            None&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Description&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;The constructor constructs a front_insert_iterator object and initializes &lt;br /&gt;Container&amp; container with a &lt;em&gt;x&lt;/em&gt;.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;Method             operator*()&lt;br /&gt;&lt;br /&gt;Access             Public&lt;br /&gt;&lt;br /&gt;Classification     Accessor&lt;br /&gt;&lt;br /&gt;Syntax             front_insert_iterator&amp;lt;Container&amp;gt;&amp; operator*();&lt;br /&gt;&lt;br /&gt;Parameters         None&lt;br /&gt;&lt;br /&gt;Returns            This operator returns a pointer to the invoking object.&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Description&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;The dereference operator returns *this.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;Method             operator++()&lt;br /&gt;&lt;br /&gt;Access             Public&lt;br /&gt;&lt;br /&gt;Classification     Accessor&lt;br /&gt;&lt;br /&gt;Syntax             front_insert_iterator&amp;lt;Container&amp;gt;&amp; operator++();&lt;br /&gt;&lt;br /&gt;Parameters         None&lt;br /&gt;&lt;br /&gt;Returns            This operator returns a pointer to the invoking object.&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Description&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;This incrementation operator returns *this.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;Method             operator++()&lt;br /&gt;&lt;br /&gt;Access             Public&lt;br /&gt;&lt;br /&gt;Classification     Accessor&lt;br /&gt;&lt;br /&gt;Syntax             front_insert_iterator&amp;lt;Container&amp;gt; operator++(int x);&lt;br /&gt;&lt;br /&gt;Parameters         &lt;em&gt;x&lt;/em&gt; has no bearing on this function.&lt;br /&gt;&lt;br /&gt;Returns            This operator returns a pointer to the invoking object.&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Description&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;This incrementation operator returns *this.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;Method             operator=()&lt;br /&gt;&lt;br /&gt;Access             Public&lt;br /&gt;&lt;br /&gt;Classification     Modifier&lt;br /&gt;&lt;br /&gt;Syntax             front_insert_iterator&amp;lt;Container&amp;gt;&amp;&lt;br /&gt;                   operator=(const typename Container::value_type&amp; value);&lt;br /&gt;&lt;br /&gt;Parameters         &lt;em&gt;value&lt;/em&gt; is the reference to the type value_type that&lt;br /&gt;                   is inserted into the container.&lt;br /&gt;&lt;br /&gt;Returns            This operator returns a pointer to the invoking object.&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Description&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;The assignment operator is converted to an insertion operation using &lt;br /&gt;container.push_front(value). The operator returns *this.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;The Class Relationship Diagram for front_insert_iterator&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7284850559043997789-1366799541256416887?l=cs20001.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cs20001.blogspot.com/feeds/1366799541256416887/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7284850559043997789&amp;postID=1366799541256416887' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/1366799541256416887'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7284850559043997789/posts/default/1366799541256416887'/><link rel='alternate' type='text/html' href='http://cs20001.blogspot.com/2010/02/frontinsertiterator.html' title='front_insert_iterator'/><author><name>rong889</name><uri>http://www.blogger.com/profile/06593146008221514057</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7284850559043997789.post-3864195425083950160</id><published>2010-02-04T05:27:00.013-08:00</published><updated>2010-02-04T05:27:34.793-08:00</updated><title type='text'>2.2 What SNMP Can Help You Do</title><content type='html'>&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;br /&gt;&lt;td class="tt1"&gt;[ Team LiB ]&lt;/td&gt;&lt;td valign="top" class="tt1" align="right"&gt;&lt;br /&gt;	&lt;br /&gt;	&lt;br /&gt;&lt;/td&gt;&lt;/table&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;H3 class="docSection1Title"&gt;2.2 What SNMP Can Help You Do&lt;/H3&gt;&lt;br /&gt;&lt;P class="docText"&gt;Protocol design aside, the practical power of SNMP lies in device information available to be retrieved and changed. Fortunately there is a great deal of device configuration available via SNMP. This section looks at some of the standard variables available on networked devices.&lt;/P&gt;&lt;br /&gt;&lt;br /&gt;&lt;H4 class="docSection2Title"&gt;2.2.1 The System Group&lt;/H4&gt;&lt;br /&gt;&lt;P class="docText"&gt;The &lt;TT&gt;system&lt;/TT&gt; group is a direct child of &lt;TT&gt;mib-2&lt;/TT&gt; that contains variables related to general information about the device. RFC 1213 defines seven simple variables in this group, listed in Figure 2.4. The # column in this table designates the part of the object identifier appended to &lt;TT&gt;mib-2&lt;/TT&gt; for the given variable. The RW column indicates whether the variable can be set with an SNMP &lt;TT&gt;set-request&lt;/TT&gt;.&lt;/P&gt;&lt;br /&gt;&lt;P&gt;&lt;TABLE CELLSPACING="0" BORDER="1" RULES="groups" CELLPADDING="5" WIDTH="100%"&gt;&lt;CAPTION&gt;&lt;h5 class="docTableTitle"&gt;Figure 2.4. Variables in the &lt;TT&gt;System&lt;/TT&gt; Group.&lt;/h5&gt;&lt;/CAPTION&gt;&lt;COLGROUP align="left" span="4"&gt;&lt;THEAD&gt;&lt;TR&gt;&lt;TH class="docTableHeader" valign="top"&gt;&lt;P class="docText"&gt;Variable&lt;/P&gt;&lt;/TH&gt;&lt;TH class="docTableHeader" valign="top"&gt;&lt;P class="docText"&gt;#&lt;/P&gt;&lt;/TH&gt;&lt;TH class="docTableHeader" valign="top"&gt;&lt;P class="docText"&gt;RW&lt;/P&gt;&lt;/TH&gt;&lt;TH class="docTableHeader" valign="top"&gt;&lt;P class="docText"&gt;Function&lt;/P&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;sysDescr&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Text description of the device, including OS&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;sysObjectID&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;An SNMP object identifier for this device&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;sysUpTime&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Device up time, in hundredths of a second&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;sysContact&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;4&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Contact information for the device admin&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;&lt;TT&gt;sysName&lt;/TT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;5&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;TD class="docTableCell" valign="top"&gt;&lt;P class="docText"&gt;
