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">
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 <meta name="generator" content="Movable Type 5.2.3" />
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"$>" />
12 <title>Status for Andrew DeFaria: September 9, 2007 - September 15, 2007 Archives</title>
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" />
18 <body class="layout-one-column">
20 <div id="container-inner" class="pkg">
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>
30 <div id="pagebody-inner" class="pkg">
32 <div id="alpha-inner" class="pkg">
34 <p class="content-nav">
35 <a href="http://defaria.com/blogs/Status/archives/week_2007_09_02.html">« 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 »</a>
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/">
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'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..."
53 dc:date="2007-09-14T12:51:03-06:00" />
58 <h2 class="date-header">September 14, 2007</h2>
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">
65 <li>Released ucmwb 1.2.3</li>
68 <h3>FindBin, Getopt::Long and Display.pm</h3>
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>
76 use lib "$FindBin::Bin/../lib";
81 display "ERROR: $msg\n" if defined $msg;
83 Usage: $FindBin::Script [-usage] [-verbose] [-debug] [-exec]
84 -from_view <view> -label <label_name>
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>
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
100 "usage" => sub { Usage "" },
101 "verbose" => sub { set_verbose },
102 "debug" => sub { set_debug },
103 "exec!" => \$execute,
104 "from_view=s" => \$from_view,
105 "branch=s" => \$branch,
106 "label=s" => \$label,
107 ) || Usage "Unknown parameter";
110 <p>Some notes about the above:</p>
113 <li>Usage is a subroutine (most people have one) that takes one parameter for an extra message to display first.</li>
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>
117 <li>The "exec!" is a negation. So -exec and -noexec apply and set $execute accordingly</li>
119 <li>All of "from_view", "branch" and "label" are simple name/value type parameters so -branch <branchname> sets $branch to <branchname>.</li>
122 <p>A word on Display.pm:</p>
124 <p>I find that often people do the following:</p>
127 <div class=code><pre>
128 print "In myspecial_subroutine: File = $file\n" if $debug;
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>
133 <p>My thought was to name the procedure debug and include the "\n" by default. People oughta quickly discern that:</p>
135 <div class=code><pre>
136 debug "In myspecial_subroutine: File = $file";
139 <p>probably only happens when debugging.</p>
141 <p>Additionally I support routines like verbose, debug, error, warning
142 (from Display.pm).</p>
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>
147 | <a href="http://defaria.com/blogs/Status/archives/000677.html#trackback">TrackBacks (0)</a>
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/">
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'ed to another user Addressed some issues about PC running CC in the RAN network..."
165 dc:date="2007-09-13T11:28:07-06:00" />
170 <h2 class="date-header">September 13, 2007</h2>
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">
177 <li>Fixed an issue with ucmwb running after su'ed to another user</li>
179 <li>Addressed some issues about PC running CC in the RAN network</li>
182 <h3>Stupid coding</h3>
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>
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>
188 <p>But along with that I noticed the following code:</p>
190 <div class=code><pre>
191 QSting homePath = QDir::homePath();
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;
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");
205 <p>OK so first ask yourself what do you see wrong here.....?</p>
209 <p>Here's my questions:</p>
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>
214 <li>Why then do this operation of obtaining homePath yet again to set settingsDirname?</li>
216 <li>If homePath were determined to be empty, aren't you ignoring what you set it to?</li>
219 <p>Naturally I fixed this to be:</p>
221 <div class=code><pre>
222 QSting homePath = QDir::homePath();
224 if (homePath.isEmpty()) {
225 // Note the following is a Unix'ism and non portable!
226 homePath = QString("/home/") + appUsername;
229 QString settingsFilename = homePath + QString("/.ucmwbrc");
230 QString settingsDirname = homePath + QString("/.ucmwb.d");
231 QString filterFilename = settingsDirname + QString("/filters");
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>
237 | <a href="http://defaria.com/blogs/Status/archives/000676.html#trackback">TrackBacks (0)</a>
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/">
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'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. Created baselines for the documentation visibility WORs..."
255 dc:date="2007-09-12T18:07:32-06:00" />
260 <h2 class="date-header">September 12, 2007</h2>
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">
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>
269 <li>Created baselines for the documentation visibility WORs</li>
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>
275 | <a href="http://defaria.com/blogs/Status/archives/000675.html#trackback">TrackBacks (0)</a>
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/">
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"
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-> build 2 and build 2 -> build 3 Resolved RoseRT issue Code reviewed Tom's changes to createView.pl..."
293 dc:date="2007-09-11T12:25:55-06:00" />
298 <h2 class="date-header">September 11, 2007</h2>
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">
305 <li>Performed merge for build 1-> build 2 and build 2 -> build 3</li>
307 <li>Resolved RoseRT issue</li>
309 <li>Code reviewed Tom's changes to createView.pl</li>
312 <h3>RANCQ00013181: MUOS document Project Views Are not Showing All Needed Documents</h3>
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>
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>
318 <p>File elements aren't merged - they are imported (i.e. copied from the from_view to the to_view)</p>
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>
322 <p>For build 1 there was a directory named:</p>
324 <div class=code><pre>
325 /vobs/gdrandocs/development/proj/ran/fdd/RNC_Initialization_Configuration
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>
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>
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>
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>
338 | <a href="http://defaria.com/blogs/Status/archives/000674.html#trackback">TrackBacks (0)</a>
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/">
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'm building it again, officially Rebuilding ucmwb with debug turned off Fixed problem with backspace not working in vim..."
356 dc:date="2007-09-10T14:44:10-06:00" />
361 <h2 class="date-header">September 10, 2007</h2>
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">
368 <li>Got the license key for Qt, 4.2.3 this time, so I'm building it again, officially</li>
370 <li>Rebuilding ucmwb with debug turned off</li>
372 <li>Fixed problem with backspace not working in vim</li>
376 <h3>Backspace and vim</h3>
378 <p>Annoyingly backspace continues to be a problem, especially with Sun. Here's the fix for vim (put in ~/.vimrc):</p>
380 <div class=code><pre>
385 <p><b>Note:</b> That's a Control-V [backspace] to produce ^h.</p>
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>
390 | <a href="http://defaria.com/blogs/Status/archives/000673.html#trackback">TrackBacks (0)</a>