Wednesday, 28 April, 2010. 08:37:55 AM
AIX does not have a mktemp command because it's not POSIX. The GNU coreutils package
includes source for mktemp, which is why it exists on Linux systems. On AIX, the lmktemp
command exists in /usr/sbin and that can be used as a replacement.
/n
Tuesday, 27 April, 2010. 02:42:10 PM
Back in NYC for the next 10 weeks or so.
/n
Friday, 23 April, 2010. 12:37:59 PM
Here's my story of extreme laziness:
A project a few years ago involved the migration of 800,000 lines of shell script from Solaris to AIX. Shell script migration isn't that difficult. It involves locating certain commands which have different syntax or semantics on the target platform and making the changes needed to allow the script to run. To give you an idea of how big 800,000 lines of shell script is, imagine that all this code is printed on regular office paper, with 1 inch margins. The stack of paper that I had to look through would be about 14,815 pages. On regular office copy paper, that's a stack 4 feet, 8 inches high!
As you can imagine, the problem here is not fixing the problems in the scripts. That's actually very easy. The problem is how to find every single error in a stack of paper weighing almost 150 pounds.
The project was estimated to require about 480 hours of work, in which the migration engineer (that would be me) would have to sift through this giant stack of paper. Actually, nobody would ever print all this code onto actual paper. That would be wasteful. The code is on the computer, and it can be examined there. But if you think that just because it's on the computer that somehow makes the job of eyeballing 800,000 lines of tiny text on a glowing screen easier, that would be wrong. It's grueling. Mindless, boring, horrible work.
But, I'm a programmer. I'm lazy. There was no way in hell I was going to sit there looking through that stack of paper without clawing my eyes out or getting bedsores from sitting in the office chair. My first idea was to write a little program (using regular expressions) to look for a list of all the categories of problems that could possibly exist. This worked extremely well. A little too well, in fact. I found every possible error in the stack of programs, plus about fifty times as many locations where there was no error at all. But that was about as close as I could get with that approach.
I was stuck with an even worse problem. I had a huge list of all the possible errors in my code, plus fifty times as many things which looked like errors, but actually were fine. And I had no way to distinguish between the two except to go through the entire list by hand, looking up the proper script file, locating the correct line number in the script file, and then visually examining the source code to make a decision. I had used laziness to paint myself into a corner, or so it seemed.
The decision I had to make was a simple one: is this possible bug going to require any further remediation? Yes or No. But to get to that simple yes or no involved a lot of very cumbersome typing.
So I automated the whole process. I figured that the first operation I needed to do would be to actually look up the possible bug in the source code. That function was mapped to the left mouse button. Then once I'd seen the source code and made my decision, I needed to mark the possible bug as a yes or a no for further action. I mapped the yes and the no to the middle and the right mouse buttons. That was it.
With just a little bit of Python and a whole lot of laziness, I managed to reduce the actual time required to work through the entire list and complete the script migration to 32 hours. From 16 weeks down to less than a week. And for most of that all I had to do was move three fingers on my mouse.
/n
Friday, 23 April, 2010. 11:05:17 AM
The program on my TI-74 calculator was lost yesterday during a battery change. I wrote the program about 24 years ago as a freshman at MSU, and it was held in memory every since.
/n
Thursday, 22 April, 2010. 10:14:59 AM
My TI-74 calculator batteries were replaced this morning. During the replacement, a capacitor preserves the state of the memory and programs. This time, the capacitor did not work correctly, and the program was lost. I wrote that program 24 years ago when I was a freshman at MSU.
/n