My cheap cell phone has a "STO" (STORE) button for saving numbers.
But when you delete a number, you get a message that says,
"TO DELETE PRESS STO"
Sad thing is, the phone has better buttons that could have been used: CLR (CLEAR) or END.
So I was wondering one might test for that...do I need to compile perl with debugging enabled?
This is a different issue than detecting code that is never reached or isn't reached in the normal functioning of the CGI. The subroutine is simply never called anywhere.
So I need to get a list of all the subroutines and then somehow look at byte-code-execution tree whatnot and see there's no entry point. [here the author waves hands frantically]. I have no idea what I'm talking about
Now Drinking: Diet Coke
Our $org is embarking on the first attempt at sharing code within $depts. There's no business demand for it (but hey, we're non-profit), but we suspect that we're all reinventing the wheel. Smaller $depts within the $org will benefit too - they'll start building their apps with stronger code and it will lessen the likelihood of seeing freaky CGI code in production.
It's all volunteer work, but with benefits to the current tasks at hand.
Our first guess is that we need some sort of "CPAN" in place for our modules. Each $dept will submit a single module at first. We'll see if anyone uses it, how generic it can be ($org::$dept or just $org::), etc. Then we'll announce it among the $staff and see what more should be done for it to be useful.
Tech: 1GHz Titanium Powerbook on order
Home: 3 mice trapped and released (I was in good mood). 3 mice trapped and snapped (I got fed up).
The other half of our department runs a large video encoding facility with 4 bays of parrallel production fanning out to 3 encoding systems per bay.
The operators have been complaining that encoding would break suddenly at seemingly randow times. But days would go by with no problems, then some days would be full of problems -- all the while the systems haven't been touched (not upgraded, rebooted, tweaked).
Then today the chief operator, standing next to a digital video tape deck, wondering why his luck had been so bad today, reached over to restart the tape, felt a small static electricity spark an noticed his video output monitor go blank for a second.
We've got static electricity problems! Pervasive problems. By dragging our shoes across the carpet and touching equipment we can bring down the firewire network or insert seconds of blank frames into the video stream.
Much of our equiment's power plugs are two-prong - no grounding. Sure, the computers and monitors are all three-prong, but all these firewire repeaters and tape decks aren't.
I'm also concerned that our room's power circuits may not be properly grounded. It's a newly renovated space in an old building. Maybe someone cut corners....
Luckily, the director of the group is an ex-telephone guy, who used to design telephone switching systems. He specified in the renovation that we have separate grounding terminals around the walls, just in case.
So I think with a bunch of anti-static mats, and maybe some wrist-connectors, we should be safe.
Clearly we saw after the first code review that the database code should be pulled out into its own module.
The code is pretty simple: open/close the connection, do a few trivial SELECTs, build some HTML tables.
We don't have a standard on dealing with errors, so a module could help there...
I looked at the various DBIx modules and wondering if I should bother.
Maybe the real issue is that we need a application-centric database module. Our application consists of around 7 CGIs. Maybe pulling all the database code out of there into an MYORG::DEPT::APP::DB module is fine and iternally the module has raw DBI code.
Musing whilst I wait for Trick or Treaters.
The Linksys WAP worked like a charm. Since I already had the Linksys 4-port router, the wireless one replaced it. The 9600 and the Powerbook is happy. FreeBSD doesn't seem to want to update its DNS settings via DHCP. Will investigate.
So it seems that the first generation Apple Airports like mine overheat and cook their power conditioning circuitry.
So early last week I started noticing that my connection kept dropping. By Friday it was up for 5 seconds, restarting for 15, up for another 5 and so on. And now I've got red LEDs instead of amber and green.
Now I'm forced to use my only directly networked computer, a Mac 9600 running 8.6.
I am used to carrying my laptop around the house, noodling in front of the tv, the kitchen or the dining room. Alas, the desk I have the 9600 on is barely big enough to hold the monitor and a SCSI drive, so I can't easily use its network cable for the laptop.
Linksys is in my future.
As we ended this week's code review session, the facilitator remarked that next week's code (two large CGIs of 2600 and 3900 lines each) would be difficult to get through. I replied that they are actually about a third of the real size because they consist of so much repeated code and HTML.
I got to thinking there must be some way I could find all the repeated code before I start reviewing it and so I wrote a script which gives output like:
Line 309 repeated on line(s) 610, 752, 841, 891, 1100, 1484, 1502, 1546, 1567
Line 310 repeated on line(s) 611, 753, 842, 892, 1101, 1485, 1503, 1547, 1568
Line 311 repeated on line(s) 612, 754, 843, 893, 1102, 1486, 1548, 1569
Line 312 repeated on line(s) 613, 755, 844, 894, 1103, 1487, 1504, 1549, 1570
Line 313 repeated on line(s) 614, 759, 848, 898, 1104, 1488, 1508, 1553, 1574
Line 314 repeated on line(s) 615, 760, 849, 899, 1105, 1489, 1509, 1554, 1575
Line 315 repeated on line(s) 616, 1510, 1555
Line 316 repeated on line(s) 617, 762, 851, 901, 1491, 1511, 1556, 1577
Line 317 repeated on line(s) 618, 763, 852, 902, 1108, 1492, 1512, 1557, 1578
Line 318 repeated on line(s) 619, 764, 853, 903, 1109, 1493, 1513, 1558, 1579
The above is an example of a block of 10 lines of code repeated 8 times, with a minor variation.
So with a report like this, I can take a printout of code (w/line numbers), a highlighter pen and block out the large repeated code blocks.
Naturally, my script detects things like "$i = 0;" or "=cut", but such code is usually not found in large blocks of lines, so it doesn't stand out.
Now I'm thinking how to take this forward - perhaps process the original file and insert footnotes or glyphs like [snip] in place of the repeated code.