Initial add of defaria.com
[clearscm.git] / defaria.com / blogs / Status / archives / week_2007_09_09.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: September  9, 2007 - September 15, 2007 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_2007_09_02.html" title="September  2, 2007 - September  8, 2007" />
16    <link rel="next" href="http://defaria.com/blogs/Status/archives/week_2007_09_16.html" title="September 16, 2007 - September 22, 2007" />
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_2007_09_02.html">&laquo; September  2, 2007 - September  8, 2007</a> |
36                         <a href="http://defaria.com/blogs/Status/">Main</a>
37                         | <a href="http://defaria.com/blogs/Status/archives/week_2007_09_16.html">September 16, 2007 - September 22, 2007 &raquo;</a>
38                      </p>
39                      
40                      
41                      <!--
42 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
43          xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
44          xmlns:dc="http://purl.org/dc/elements/1.1/">
45 <rdf:Description
46     rdf:about="http://defaria.com/blogs/Status/archives/week_2007_09_09.html#entry-000677"
47     trackback:ping="http://defaria.com/mt/mt-tb.cgi/64"
48     dc:title="ucmwb 1.2.3 release/Perl&apos;isms"
49     dc:identifier="http://defaria.com/blogs/Status/archives/week_2007_09_09.html#entry-000677"
50     dc:subject="General Dynamics"
51     dc:description=" Released ucmwb 1.2.3..."
52     dc:creator=""
53     dc:date="2007-09-14T12:51:03-06:00" />
54 </rdf:RDF>
55 -->
56
57
58                      <h2 class="date-header">September 14, 2007</h2>
59                      <a id="a000677"></a>
60                      <div class="entry" id="entry-677">
61                         <h3 class="entry-header">ucmwb 1.2.3 release/Perl'isms</h3>
62                         <div class="entry-content">
63                            <div class="entry-body">
64                               <ul>
65   <li>Released ucmwb 1.2.3</li>
66 </ul>
67                               
68                               <h3>FindBin, Getopt::Long and Display.pm</h3>
69
70 <p>Here's how I typically use <a
71  href="http://search.cpan.org/%7Enwclark/perl-5.8.8/lib/FindBin.pm">FindBin</a>:</p>
72
73 <div class=code><pre>
74 use FindBin;
75 ...
76 use lib "$FindBin::Bin/../lib";
77 ...
78 sub Usage ($) {
79   my ($msg) = @_;
80
81   display "ERROR: $msg\n" if defined $msg;
82   display &lt;&lt;END;
83 Usage: $FindBin::Script [-usage] [-verbose] [-debug] [-exec]
84                 -from_view &lt;view&gt; -label &lt;label_name&gt;
85 ...
86 END
87 </pre></div>
88
89 <p>Also I tend to use Getopt::Long. It is extremely flexible. Options can be specified in the GNU long method as in --debug or just -debug. Additionally you can abbreviate as in -d IFF there is no other option that starts with "d". Options can have parameters (-file myfile.txt or -file=myfile.txt), set boolean (-verbose can set say $verbose), automatic negation (-verbose or -noverbose), even call subroutines directly!k Here's an example.</p>
90
91 <div class=code><pre>
92 use GetOpt::Long;
93 ...
94 my $execute     = 0;
95 my $from_view;  # e.g. p6258c_RAN_FDD_Doc_Bld1_int
96 my $branch;     # e.g. ran_fdd_release_build2_integration
97 my $label;      # e.g. RAN_FDD_RELEASE_BUILD1
98
99 GetOptions (
100   "usage"       =&gt; sub { Usage "" },
101   "verbose"     =&gt; sub { set_verbose },
102   "debug"       =&gt; sub { set_debug },
103   "exec!"       =&gt; \$execute,
104   "from_view=s" =&gt; \$from_view,
105   "branch=s"    =&gt; \$branch,
106   "label=s"     =&gt; \$label,
107 ) || Usage "Unknown parameter";
108 </pre></div>
109
110 <p>Some notes about the above:</p>
111
112 <ul>
113   <li>Usage is a subroutine (most people have one) that takes one parameter for an extra message to display first.</li>
114
115   <li>Eat your own dog food! I use my <a href="http://clearscm.com/php/cvs_man.php?file=lib/Display.pm">Display</a> module which has display routines for verbose and debug, etc. It also has $verbose and $debug variables and exports the set_verbose and set_debug methods.</li>
116
117   <li>The "exec!" is a negation. So -exec and -noexec apply and set $execute accordingly</li>
118
119   <li>All of "from_view", "branch" and "label" are simple name/value type parameters so -branch &lt;branchname&gt; sets $branch to &lt;branchname&gt;.</li>
120 </ul>
121
122 <p>A word on Display.pm:</p>
123
124 <p>I find that often people do the following:</p>
125
126
127 <div class=code><pre>
128 print "In myspecial_subroutine: File = $file\n" if $debug;
129 </pre></div>
130
131 <p>for debugging. To me it's always been a hassle to have to remember to include the "\b" and the "if $debug", etc. Granted that's not a lot. But how can I make it better?</p>
132
133 <p>My thought was to name the procedure debug and include the "\n" by default. People oughta quickly discern that:</p>
134
135 <div class=code><pre>
136 debug "In myspecial_subroutine: File = $file";
137 </pre></div>
138
139 <p>probably only happens when debugging.</p>
140
141 <p>Additionally I support routines like verbose, debug, error, warning
142 (from Display.pm).</p>
143                               
144                               <p class="entry-footer">
145                                  <span class="post-footers">Posted by  at 12:51 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000677.html">Permalink</a>
146                                  
147                                  | <a href="http://defaria.com/blogs/Status/archives/000677.html#trackback">TrackBacks (0)</a>
148                               </p>
149                            </div>
150                         </div>
151                      </div>
152                      
153                      <!--
154 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
155          xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
156          xmlns:dc="http://purl.org/dc/elements/1.1/">
157 <rdf:Description
158     rdf:about="http://defaria.com/blogs/Status/archives/week_2007_09_09.html#entry-000676"
159     trackback:ping="http://defaria.com/mt/mt-tb.cgi/63"
160     dc:title="UCMWB su bug"
161     dc:identifier="http://defaria.com/blogs/Status/archives/week_2007_09_09.html#entry-000676"
162     dc:subject="General Dynamics"
163     dc:description=" Fixed an issue with ucmwb running after su&apos;ed to another user Addressed some issues about PC running CC in the RAN network..."
164     dc:creator=""
165     dc:date="2007-09-13T11:28:07-06:00" />
166 </rdf:RDF>
167 -->
168
169
170                      <h2 class="date-header">September 13, 2007</h2>
171                      <a id="a000676"></a>
172                      <div class="entry" id="entry-676">
173                         <h3 class="entry-header">UCMWB su bug</h3>
174                         <div class="entry-content">
175                            <div class="entry-body">
176                               <ul>
177   <li>Fixed an issue with ucmwb running after su'ed to another user</li>
178
179   <li>Addressed some issues about PC running CC in the RAN network</li>
180 </ul>
181                               
182                               <h3>Stupid coding</h3>
183
184 <p>It never ceases to amaze me what some programmers do that when I look at it seem to be just foolish things. Here's today's example:</p>
185
186 <p>In ucmwb a bug was discovered when a user first su's to some other user then runs ucmwb (in this case the user is su'ing to ccadm). The while the main window dutifully displays the list of WORs for the su'ed user, the view browser does not. Instead it displays the list of views for the original user. Turns out that there was specific code for Solaris to call cuserid instead of getenv("USER"). So Linux was working but Solaris failed. Why the difference?</p>
187
188 <p>But along with that I noticed the following code:</p>
189
190 <div class=code><pre>
191     QSting homePath = QDir::homePath();
192
193     if (homePath.isEmpty()) {
194       qDebug() << "homePath is empty!";
195       // Note the following is a Unix'ism and non portable!
196       homePath = QString("/home/") + appUsername;
197     }
198
199     qDebug() << "homePath = " << homePath;
200     QString settingsFilename = QDir::homePath() + QString("/.ucmwbrc");
201     QString settingsDirname  = QDir::homePath() + QString("/.ucmwb.d");
202     QString filterFilename   = settingsDirname + QString("/filters");
203 </pre></div>
204
205 <p>OK so first ask yourself what do you see wrong here.....?</p>
206
207 <p>Pencils down!</p>
208
209 <p>Here's my questions:</p>
210
211 <ol>
212   <li>Why go through the effort of getting the user's homePath, check to see if it's empty and then compose one with "/home" + appUsername only then to totally ignore all that work and get it again for settingsFilename?</li>
213
214   <li>Why then do this operation of obtaining homePath yet again to set settingsDirname?</li>
215
216   <li>If homePath were determined to be empty, aren't you ignoring what you set it to?</li>
217 </ol>
218
219 <p>Naturally I fixed this to be:</p>
220
221 <div class=code><pre>
222     QSting homePath = QDir::homePath();
223
224     if (homePath.isEmpty()) {
225       // Note the following is a Unix'ism and non portable!
226       homePath = QString("/home/") + appUsername;
227     }
228
229     QString settingsFilename = homePath + QString("/.ucmwbrc");
230     QString settingsDirname  = homePath + QString("/.ucmwb.d");
231     QString filterFilename   = settingsDirname + QString("/filters");
232 </pre></div>
233                               
234                               <p class="entry-footer">
235                                  <span class="post-footers">Posted by  at 11:28 AM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000676.html">Permalink</a>
236                                  
237                                  | <a href="http://defaria.com/blogs/Status/archives/000676.html#trackback">TrackBacks (0)</a>
238                               </p>
239                            </div>
240                         </div>
241                      </div>
242                      
243                      <!--
244 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
245          xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
246          xmlns:dc="http://purl.org/dc/elements/1.1/">
247 <rdf:Description
248     rdf:about="http://defaria.com/blogs/Status/archives/week_2007_09_09.html#entry-000675"
249     trackback:ping="http://defaria.com/mt/mt-tb.cgi/62"
250     dc:title="UCMWB/Document Visibility"
251     dc:identifier="http://defaria.com/blogs/Status/archives/week_2007_09_09.html#entry-000675"
252     dc:subject="General Dynamics"
253     dc:description=" Fixed a few problems with UCMWB&apos;s help facility. Previously help didn&apos;t work at all on Linux. Now it works and About identifies the proper version numbers and which architecture. Created baselines for the documentation visibility WORs..."
254     dc:creator=""
255     dc:date="2007-09-12T18:07:32-06:00" />
256 </rdf:RDF>
257 -->
258
259
260                      <h2 class="date-header">September 12, 2007</h2>
261                      <a id="a000675"></a>
262                      <div class="entry" id="entry-675">
263                         <h3 class="entry-header">UCMWB/Document Visibility</h3>
264                         <div class="entry-content">
265                            <div class="entry-body">
266                               <ul>
267   <li>Fixed a few problems with UCMWB's help facility. Previously help didn't work at all on Linux. Now it works and About identifies the proper version numbers and which architecture.</li>
268
269   <li>Created baselines for the documentation visibility WORs</li>
270 </ul>
271                               
272                               <p class="entry-footer">
273                                  <span class="post-footers">Posted by  at  6:07 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000675.html">Permalink</a>
274                                  
275                                  | <a href="http://defaria.com/blogs/Status/archives/000675.html#trackback">TrackBacks (0)</a>
276                               </p>
277                            </div>
278                         </div>
279                      </div>
280                      
281                      <!--
282 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
283          xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
284          xmlns:dc="http://purl.org/dc/elements/1.1/">
285 <rdf:Description
286     rdf:about="http://defaria.com/blogs/Status/archives/week_2007_09_09.html#entry-000674"
287     trackback:ping="http://defaria.com/mt/mt-tb.cgi/61"
288     dc:title="Import.pl"
289     dc:identifier="http://defaria.com/blogs/Status/archives/week_2007_09_09.html#entry-000674"
290     dc:subject="General Dynamics"
291     dc:description=" Performed merge for build 1-&gt; build 2 and build 2 -&gt; build 3 Resolved RoseRT issue Code reviewed Tom&apos;s changes to createView.pl..."
292     dc:creator=""
293     dc:date="2007-09-11T12:25:55-06:00" />
294 </rdf:RDF>
295 -->
296
297
298                      <h2 class="date-header">September 11, 2007</h2>
299                      <a id="a000674"></a>
300                      <div class="entry" id="entry-674">
301                         <h3 class="entry-header">Import.pl</h3>
302                         <div class="entry-content">
303                            <div class="entry-body">
304                               <ul>
305   <li>Performed merge for build 1-> build 2 and build 2 -> build 3</li>
306
307   <li>Resolved RoseRT issue</li>
308
309   <li>Code reviewed Tom's changes to createView.pl</li>
310 </ul>
311                               
312                               <h3>RANCQ00013181: MUOS document Project Views Are not Showing All Needed Documents</h3>
313
314 <p>Process was written to perform this importation. The process takes 3 parameters: a from_view, a branch and a label. The process is designed to run in the to_view context. It proceeds to search the from_view for elements that do not exist in the to_view and upon finding them it merges the parent directory and then the element in question is "imported".</p>
315
316 <p>Both a branch and a label is used because the merge procedure used on directory elements first tries to merge with the LATEST on the specified branch. If the branch does not exist (because the element was never branched) then the label is used to locate the source directory for the merge.</p>
317
318 <p>File elements aren't merged - they are imported (i.e. copied from the from_view to the to_view)</p>
319
320 <p>There are a few errors and/or warnings that can result in such a process that this script cannot hueristically determine the correct action to take. The problems arise from the renaming or removing of elements in the to_view. It is not possible for this script to determine what the user intended. An example will better explain this.</p>
321
322 <p>For build 1 there was a directory named:</p>
323
324 <div class=code><pre>
325 /vobs/gdrandocs/development/proj/ran/fdd/RNC_Initialization_Configuration
326 </pre></div>
327
328 <p>This was on the ran_fdd_doc_bld1_integration branch version 2 which was labled RAN_FDD_RELEASE_BUILD1. At version 17 RNC_Intitialization_Configuration was renamed to RBS_RNC_Intitialization_Configuration. By version 28 the RAN_FDD_RELEASE_BUILD2 label was applied.</p>
329
330 <p>Since this directory was renamed there is no way to guess what it was renamed to. Sure it's easy for a human to look at it and make a loose association based on the fact that most of the directory name is the same, this sort of AI is very difficult to program. The script marks these as an error. It's an error because somebody should verify if a directory was simply renamed or if it was removed (rmname'd). Also it's not known what to do at this point. Shall we assume that the newly named directory contains all it needs? Or does further merging/importing need to take place?</p>
331
332 <p>Additionally, since a directory is renamed, the elements contained in the directory went along with it. So in the script, the from_view keeps producing paths with RNC_Intitialization_Configuration in them not RBS_RNC_Intitialization_Configuration. Such elements then appear to have disappeared and the script issues a warning for these. At this point we really cannot tell if the file element was simply removed (where we would assume that the act was deliberate and that we should not be importing the element back in) or if it's a result of a directory renaming of the parent directory (or some parent of the parent) thus falling into the error described in the preceeding paragraph.</p>
333
334                               
335                               <p class="entry-footer">
336                                  <span class="post-footers">Posted by  at 12:25 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000674.html">Permalink</a>
337                                  
338                                  | <a href="http://defaria.com/blogs/Status/archives/000674.html#trackback">TrackBacks (0)</a>
339                               </p>
340                            </div>
341                         </div>
342                      </div>
343                      
344                      <!--
345 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
346          xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
347          xmlns:dc="http://purl.org/dc/elements/1.1/">
348 <rdf:Description
349     rdf:about="http://defaria.com/blogs/Status/archives/week_2007_09_09.html#entry-000673"
350     trackback:ping="http://defaria.com/mt/mt-tb.cgi/60"
351     dc:title="Building Qt/UCMWB officially"
352     dc:identifier="http://defaria.com/blogs/Status/archives/week_2007_09_09.html#entry-000673"
353     dc:subject="General Dynamics"
354     dc:description=" Got the license key for Qt, 4.2.3 this time, so I&apos;m building it again, officially Rebuilding ucmwb with debug turned off Fixed problem with backspace not working in vim..."
355     dc:creator=""
356     dc:date="2007-09-10T14:44:10-06:00" />
357 </rdf:RDF>
358 -->
359
360
361                      <h2 class="date-header">September 10, 2007</h2>
362                      <a id="a000673"></a>
363                      <div class="entry" id="entry-673">
364                         <h3 class="entry-header">Building Qt/UCMWB officially</h3>
365                         <div class="entry-content">
366                            <div class="entry-body">
367                               <ul>
368   <li>Got the license key for Qt, 4.2.3 this time, so I'm building it again, officially</li>
369
370   <li>Rebuilding ucmwb with debug turned off</li>
371
372   <li>Fixed problem with backspace not working in vim</li>
373 </ul>
374
375                               
376                               <h3>Backspace and vim</h3>
377
378 <p>Annoyingly backspace continues to be a problem, especially with Sun. Here's the fix for vim (put in ~/.vimrc):</p>
379
380 <div class=code><pre>
381 set t_kb=^h
382 fixdel
383 </pre></div>
384
385 <p><b>Note:</b> That's a Control-V [backspace] to produce ^h.</p>
386                               
387                               <p class="entry-footer">
388                                  <span class="post-footers">Posted by  at  2:44 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000673.html">Permalink</a>
389                                  
390                                  | <a href="http://defaria.com/blogs/Status/archives/000673.html#trackback">TrackBacks (0)</a>
391                               </p>
392                            </div>
393                         </div>
394                      </div>
395                      
396                   </div>
397                </div>
398             </div>
399          </div>
400       </div>
401    </div>
402 </body>
403 </html>