Initial add of defaria.com
[clearscm.git] / defaria.com / blogs / Status / archives / week_2006_01_08.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
4 <head>
5    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6    <meta name="generator" content="Movable Type 5.2.3" />
7
8    <link rel="stylesheet" href="http://defaria.com/blogs/Status/styles-site.css" type="text/css" />
9    <link rel="alternate" type="application/atom+xml" title="Atom" href="http://defaria.com/blogs/Status/atom.xml" />
10    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://defaria.com/blogs/Status/index.xml"$>" />
11
12    <title>Status for Andrew DeFaria: January  8, 2006 - January 14, 2006 Archives</title>
13
14    <link rel="start" href="http://defaria.com/blogs/Status/" title="Home" />
15    <link rel="prev" href="http://defaria.com/blogs/Status/archives/week_2006_01_01.html" title="January  1, 2006 - January  7, 2006" />
16    <link rel="next" href="http://defaria.com/blogs/Status/archives/week_2006_01_15.html" title="January 15, 2006 - January 21, 2006" />
17 </head>
18 <body class="layout-one-column">
19    <div id="container">
20       <div id="container-inner" class="pkg">
21
22          <div id="banner">
23             <div id="banner-inner" class="pkg">
24                <h1 id="banner-header"><a href="http://defaria.com/blogs/Status/" accesskey="1">Status for Andrew DeFaria</a></h1>
25                <h2 id="banner-description">Searchable status reports and work log</h2>
26             </div>
27          </div>
28
29          <div id="pagebody">
30             <div id="pagebody-inner" class="pkg">
31                <div id="alpha">
32                   <div id="alpha-inner" class="pkg">
33                      
34                      <p class="content-nav">
35                         <a href="http://defaria.com/blogs/Status/archives/week_2006_01_01.html">&laquo; January  1, 2006 - January  7, 2006</a> |
36                         <a href="http://defaria.com/blogs/Status/">Main</a>
37                         | <a href="http://defaria.com/blogs/Status/archives/week_2006_01_15.html">January 15, 2006 - January 21, 2006 &raquo;</a>
38                      </p>
39                      
40                      
41                      
42
43                      <h2 class="date-header">January 13, 2006</h2>
44                      <a id="a000516"></a>
45                      <div class="entry" id="entry-516">
46                         <h3 class="entry-header">Perl test</h3>
47                         <div class="entry-content">
48                            <div class="entry-body">
49                               <ul>
50   <li>Ray wanted an easy/medium/hard Perl test</li>
51 </ul>
52                               
53                               <h2>Perl Test</h2>
54
55 <h3>Easy</h3>
56 <ol>
57   <li>What does Perl stand for?</li>
58
59 <p><font color="red">Practical Extraction and Reporting Language</font></p>
60
61   <li>What basic datatypes does Perl support?</li>
62
63 <p><font color="red">Scalar, Array, Hash, Typeglob</font></p>
64
65   <li>What does the following do:</li>
66
67 <div class="code"><pre>
68 my @output = &lt;STDIN&gt;;
69
70 foreach (@output) {
71   print "$_\n" if /\d+/;
72 }
73 </pre></div>
74
75 <p><font color="red">Echoes lines that have numbers in them)</font></p>
76
77 </ol>
78
79 <h3>Medium</h3>
80
81 <ol>
82   <li>What is <tt>use strict</tt> and why is it important to use?</li>
83
84 <p><font color="red">Strict requires that variable references are scoped - e.g. my $var)</font></p>
85
86   <li>What does the following code do:</li>
87
88 <div class="code"><pre>
89 sub d {
90   my %p = @_;
91
92   print "\np:\n";
93
94   foreach (sort (keys (%p))) {
95     if (/password/) {
96       print "$_: &lt;password&gt;\n";
97     } else {
98       print "$_: ${p {$_}}\n";
99     } # if
100   } # foreach
101 } # d
102 </pre></div>
103
104 <p><font color="red">Displays the contents of the passed in hash %p substituting "&lt;password&gt;" if the hash happens to have a key of password</font></p>
105
106   <li>What do you do to enable Perl to find user written modules?</li>
107
108 <p><font color="red">You need to modify the @INC array to include the path to your modules)</font></p>
109 </ol>
110
111 <h3>Hard</h3>
112
113 <ol>
114   <li>What is the difference between <tt>require</tt> and <tt>use</tt>?</li>
115  
116 <p><font color="red">See <a href="/blogs/Status/archives/000492.html">this article</a> for the answer</font></p>
117
118   <li>What is a better way to do the following and why:</li>
119
120 <div class="code"><pre>
121 undef $/;
122 </pre></div>
123
124 <p><font color="red">See <a href="/blogs/Status/archives/000492.html">this article</a>) for the answer</font></p>
125
126   <li>What does the following print out when executed:</li>
127
128 <div class="code"><pre>
129 sub foo {
130   my ($x, $y) = @_;
131
132   my @z = `$x 2&gt;&amp;1`; chomp @z;
133   my $s = $?;
134
135   if ($s ne 0) {
136     if (defined $y) {
137       print "$_\n" foreach (@z);
138     }
139   }
140
141   return ($y, @z);
142 } # foo
143
144 my @a;
145 my $c="ls /temp";
146 my $d;
147
148 ($d, @a) = foo $c;
149 print "Worked!\n" if !$d;
150 </pre></div>
151
152 <p><font color="red">(It will output:</p>
153
154 <div class="code"><pre>
155 Worked!
156 </pre></div>
157
158 <p>Yet nothing really worked at all! Key issues are:</p>
159
160 <ul>
161     <li>Passing parameters to subroutines. Two parameters are passed in</li>
162
163     <li>Parameter return: Two parameters are returned</li>
164
165     <li>Evaluation of parameters: $y in foo is not passed in thus the print... foreach doesn't execute></li>
166
167     <li>Evaluation of true/false: foo returns $y which is errno,
168 which is not 0 thus not true but the !$d evaluates to true and the
169 print "Worked!\n" gets executed.</li>
170 </font></ul>
171 </ol>
172
173                               
174                               <p class="entry-footer">
175                                  <span class="post-footers">Posted by  at 11:59 AM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000516.html">Permalink</a>
176                                  
177                                  
178                               </p>
179                            </div>
180                         </div>
181                      </div>
182                      
183                      
184
185                      <h2 class="date-header">January 12, 2006</h2>
186                      <a id="a000517"></a>
187                      <div class="entry" id="entry-517">
188                         <h3 class="entry-header">Clearcase Merging/CQ Time Stamp problem/CQ Help problem</h3>
189                         <div class="entry-content">
190                            <div class="entry-body">
191                               <ul>
192   <li>Consulted with Ann Wisotzky regarding Clearcase Merging</li>
193
194   <li>Investigated email time stamp problem with PQA</li>
195
196   <li>Worked with Rational regarding Clearquest: Help problem</li>
197 </ul>
198                               
199                               <p class="entry-footer">
200                                  <span class="post-footers">Posted by  at 10:25 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000517.html">Permalink</a>
201                                  
202                                  
203                               </p>
204                            </div>
205                         </div>
206                      </div>
207                      
208                      
209
210                      <h2 class="date-header">January 11, 2006</h2>
211                      <a id="a000515"></a>
212                      <div class="entry" id="entry-515">
213                         <h3 class="entry-header">Stglocs/replicating perftest</h3>
214                         <div class="entry-content">
215                            <div class="entry-body">
216                               <ul>
217   <li>Investigated stglocs</li>
218
219   <li>Replicated /vobs/perftest and set up log_activity, stats and pulse for all of:</li>
220     <ul>
221       <li>ccase-rmna-3</li>
222
223       <li>ccase-sj1-1</li>
224
225       <li>ccase-sj1-2</li>
226
227       <li>ccase-irva-2</li>
228     </ul>
229 </ul>
230                               
231                               <p>Chris, if you can spare a Windows machine to host the views (meaning to run the view_server processes on) then I believe the following stgloc would be your best answer:</p>
232
233 <div class="code"><pre>
234 $ your_filer=&lt;your_filer&gt;
235 $ your_share=&lt;your_share&gt;
236 $ your_windows_view_server=&lt;your_windows_view_server&gt;
237 $ p=\\\\$your_filer\\$your_share\\viewstore
238 $ cleartool mkstgloc -view -force -host $your_windows_view_server \
239 &gt; -hpath $p -gpath $p viewstore $p
240 </pre></div>
241
242 <p>This would create a "stgloc" which can be used in mkview:</p>
243
244 <div class="code"><pre>
245 $ cleartool mkview -tag &lt;tag&gt; -stgloc viewstore (or -auto)
246 </pre></div>
247
248 <p>Users can also select this stgloc in the Clearcase Explorer GUI. Views will be placed on $your_filer and served by $your_windows_view_server (meaning view_server processes will run there and that that machine should have a static IP).</p>
249
250 <p>Views can be cross tagged into the Linux region with:</p>
251
252 <div class="code"><pre>
253 $ cleartool mktag -view -tag defaria2 -host 10.136.65.5 -hpath \\\\fs-rmna-01\\ccstgloc-cabu\\viewstore\\BROADCOM\\adefaria\\defaria2.vws -gpath /projects/ccstgloc-cabu/viewstore/BROADCOM/adefaria/defaria2.vws
254 /projects/ccstgloc-cabu/viewstore/BROADCOM/adefaria/defaria2.vws
255 cleartool: Warning: Storage pathname "/projects/ccstgloc-cabu/viewstore/BROADCOM/adefaria/defaria2.vws"
256 may not reside on host "10.136.65.5".
257 </pre></div>
258
259 <p><b>Notes:</b></p>
260
261 <ul>
262   <li>I specified host as an IP address because the test "server" I was using was using DHCP (IOW nslookup pcrmna-ccrmt02 doesn't work from Unix)</li>
263
264   <li>Backslashes are doubled because bash collapses them</li>
265
266   <li>The host path (-hpath) must be a valid path <b>from the host's point of view</b>. The host (pcrmna-ccrmt02 in this case) is a Windows box thus a UNC style path is used for -hpath.</li>
267
268   <li>The global path (-gpath) must be a valid path <b>from the client's point of view</b>. Since we are cross tagging to Linux the path is a Unix style path (in the automount map) of /projects/ccstgloc-cabu/viewstore... You're directory under /projects would be different.</li>
269
270   <li>View creation and serving on Windows machines is Windows domain aware. What they do is create a directory for the domain (e.g. BROADCOM) then a directory for the user (e.g. adefaria) then the view directory is created (defaria2) with an  appended .vws. This is Windows specific behavior, hence you see and additional
271 .../BROADCOM/adefaria/defaria2.vws.</li>
272
273   <li>You need not use the name or directory "viewstore". This is just an example. I've seen others user the directory name of say vws. Also the stgloc need not be named viewstore - you might use bt-filer-views or whatever.</li>
274 </ul>
275
276 <p>Now you can similarly create a Unix oriented stgloc if you want:</p>
277
278 <div class="code"><pre>
279 $ your_share=&lt;your_share&gt;
280 $ your_linux_view_server=&lt;your_linux_view_server&gt;
281 $ p=/projects/$your_share/viewstore
282 $ cleartool <span>mkstgloc</span> -view -force -host $your_linux_view_server \
283 &gt; -hpath $p -gpath $p viewstore $p
284 </pre></div>
285
286 <p>And then your users can cross tag them into the Windows region using the Region Synchronize tool (Note: It will fail initially as it cannot determine what the UNC path needs to be so the users will have to specify that) or by the command line:</p>
287
288 <div class="code"><pre>
289 $ your_filer=&lt;your_filer&gt;
290 $ your_share=&lt;your_share&gt;
291 $ your_linux_view_server=&lt;your_windows_linux_server&gt;
292 $ p=\\\\$your_filer\\$your_share\\viewstore
293 $ cleartool mktag -view -tag adefaria_linux -host $your_linux_view_server \
294 &gt; -hpath /projects/$your_share/viewstore/adefaria_linux.vws \
295 &gt; -gpath $p\\adefaria_linux.vws $p\\adefaria_linux.vws
296 </pre></div>
297
298 <p>The advantages here are:</p>
299 <ul>
300   <li>Your Linux server bears the brunt of serving views since the view_server processes run there</li>
301 </ul>
302
303 <p>The disadvantages are:</p>
304
305 <ul>
306   <li>Users can't create views using this stgloc from Windows</li>
307
308   <li>Users must cross tag views to their Windows region</li>
309
310   <li>Windows users don't like the command line.</li>
311 </ul>
312
313                               
314                               <p class="entry-footer">
315                                  <span class="post-footers">Posted by  at  3:01 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000515.html">Permalink</a>
316                                  
317                                  
318                               </p>
319                            </div>
320                         </div>
321                      </div>
322                      
323                      
324
325                      <h2 class="date-header">January 10, 2006</h2>
326                      <a id="a000514"></a>
327                      <div class="entry" id="entry-514">
328                         <h3 class="entry-header">Getting log_activity/stats and pulse to work</h3>
329                         <div class="entry-content">
330                            <div class="entry-body">
331                               <ul>
332   <li>Re-wrote most Clearcase modules to utilize Clearcase::cleartool and for Clearcase.pm to work out where cleartool resides</li>
333
334   <li>Changed Mail.pm to only attempt to use MIME:Entity and others if html is requested</li>
335
336   <lI>Got pulse working for /vobs/preftest. If the vob is not present it simply logs that and exists</li>
337 </ul>
338                               
339                               <p class="entry-footer">
340                                  <span class="post-footers">Posted by  at  5:42 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000514.html">Permalink</a>
341                                  
342                                  
343                               </p>
344                            </div>
345                         </div>
346                      </div>
347                      
348                      
349
350                      <h2 class="date-header">January  9, 2006</h2>
351                      <a id="a000513"></a>
352                      <div class="entry" id="entry-513">
353                         <h3 class="entry-header">Mail.pm/pulse</h3>
354                         <div class="entry-content">
355                            <div class="entry-body">
356                               <ul>
357   <li>Worked on Mail.pm</li>
358
359   <li>Incorporated Mail.pm into Logger</li>
360
361   <li>Created Element.pm</li>
362
363   <li>Added code to pulse to mkelem and rmelem</li>
364 </li>
365                               
366                               <p class="entry-footer">
367                                  <span class="post-footers">Posted by  at  5:41 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000513.html">Permalink</a>
368                                  
369                                  
370                               </p>
371                            </div>
372                         </div>
373                      </div>
374                      
375                   </div>
376                </div>
377             </div>
378          </div>
379       </div>
380    </div>
381 </body>
382 </html>