Check out ACM Queue.
|
I've recently been introduced to ACM Queue. They do a monthly magazine of informative articles for engineers. Thanks to David J. Brown of Sun (who is also on the Editorial Advisory Board) for putting me onto this very useful resource. |
Topics covered include
- Developer Tools
- Hardware
- Security
- Linux/OS
- Data Management
- Web Services
After a month or to, the articles that appeared in the magazine are also made available on their web site. If you are interested in applying for a free subscription, look here
( Jun 30 2004, 03:03:13 PM PDT ) [Listen] Permalink
John Lions - A Commentary on the UNIX Operating System
|
This is another of those tales of great fun moments at Sun which wasn't really a part of my job and I get to drop some famous names. See if you can spot them. For those who don't know, John Lions is famous for (amongst other things), a booklet called "A Commentary on the UNIX Operating System" (also known as the "orange book") which he published in 1977 as part of an operating systems course at the University of New South Wales where he was a lecturer. |
Again (as if I need to remind you), UNIX was written by Ken Thompson and Dennis Ritchie over 35 years ago. This was a commentary on UNIX Version 6.
It has become one of the most photo-copied bootleg documents ever. Most students seriously studying UNIX have either seen or own an nth-generation photocopy, though they might not admit it.
When I joined Sun Australia (the Sun distributor) in 1984, they was a guy (I'll just call him Dave) who worked for the Lionel Singer group (the parent company). He's been a student of John Lions at U.NSW, and he had a copy of the orange book. I got a photocopy direct from an original.
I still have it. The annotations and commentary by John are wonderful.
It has that infamous section of code in slp.c (context-switching code) with the comment:
/* * If the new process paused because it was swapped out, * set the stack level to the last call to savu(u_ssav). * This means that the return which is executed immediately after * the call to aretu actually returns from the last routine which * did the savu. * * You are not expected to understand this. */
And they're right, I don't.
Note that John's work was finally published professionally in 1997..
Skip forward to about 1990. I'm now working for Sun Microsystems Inc. in Sydney. Every Friday evening, I'd drive over to a software company called Softway, which was the gathering place for folks interested in UNIX. Bring a bottle of wine. Have a great time. John Lions was usually there. Some of the people working at Softway had been his students at one time or another. I got to know him very well.
This was also the time when Ken Thompson was taking a sabbatical from Bell Labs, and was hanging out down under. Ken became a Softway Friday night regular and I got to know him well too.
Now Sun (like all sales-driven companies) had its own way of entertaining it's customers . In Sydney, we had a box at the Sydney Cricket Ground. When it wasn't cricket, the SCG hosted Australian football games. So I suggested wouldn't it be great if we could invite John and Ken along to one of these games. Val Mickan, the Sun Microsystems Australia managing director thought it was indeed a great idea and so we have Val, myself and Bruce Baker one of the Sydney office sales folks entertaining John, Ken and Piers Lauder (one of the creators of ACSnet - the Australian Computer Science Network). Great fun, good food and entertainment.
After the game, I got to chaffeur John, Ken and Piers back to the University of Sydney. Four of us crammed into my beaten up old Nissan Exa.. A really tight fit.
Even at that time, John was a bit of an absent minded professor. A few years later, we realised that this was due to Alzheimers. John was seriously ill for several years and sadly died in December 1998. There are numerous tributes to him on the net. Here's an example.
[Technorati Tag: Computer History]
( Jun 30 2004, 12:11:14 PM PDT ) [Listen] Permalink Comments [1]
Reading, Writing and Code
On Monday, I wrote a blog entry about Understanding large code bases and gave a pointer to a useful book called Code Reading by Diomidis Spinellis.
Diomidis kindly left a comment pointing to one of his papers entitled Reading, Writing and Code. I sat down last night and read it. It makes a lot of good points and I have some more commentary on the subject.
I whole heartedly agree that code readibility to me is having a good style. As I mentioned in a blog on Coding Styles last week, you need to adopt a consistent style. Plenty of white space too. I use two blank lines between each method in a source file. When you have to do things like inner classes or anonymous methods, use blank lines and consistent formatting and indentation to show where they are.
I have a couple more thoughts on why you don't always see comments in code.
Too many small open source projects start with a simple program that does a single task (and probably does it well, so that the program becomes popular). Then "bells and whistles" are added incrementally in an ad-hoc fashion, probably not even by the original author (who has moved on to something new that interests them). The original design structure (if any existed) is warped out of shape by these new additions, because each new author didn't know the original authors intentions on how the program was designed (how many open source projects have you seen with a functional specification?).
Most maintaining work (which includes adding in new features and enhancements as well as bug fixing) is not done by the original author. These maintainers are quite often coming in cold (which is why the some of the techniques described in the Code Reading book are very useful) and don't fully understand the code they are working with. They are often under time constraints (perhaps they are contractors being paid per bug fix) to get the problem solved. Rather than leave extra comments helping others to understand what is going on, they just add in the new undocumented code. It fixes the problem, the customer is happy, but no thought is given to making it easier for the next person who reads this code.
I've even seen contractors keep extensive notes themselves in notebooks or their own files, which they don't share with others. Their misguided belief is that this is a kind of job security. That they are the only people who know how to fix problems in this code (especially when it's proprietary code) and if new problems arise, they will be called back to work on them. Because of this mercenary attitude, it can lead to a poor reputation for contractors where in fact thare are just a few offenders and not a generalised demise.
I noticed that the Reading, Writing and Code paper specifically mentioned John Lions and Ken Thompson by name so as I have my own John and Ken story, I'll blog about that, this afternoon.
( Jun 30 2004, 07:20:48 AM PDT ) [Listen] Permalink
Making image thumbnails
|
|
Yesterday Dan Lacher and I showed Mary how you can setup a small thumbnail image to point to a larger image. This might be of interest to others blogging on blogs.sun.com. |
See this recent blog entry of mine as an example of how this looks. If you click on the image in this blog entry, it displays the larger version.
So first of all you need to create the small version from the large one. Gimp which is a part of JDS can help you here. Note that I'm using an earlier version of gimp (v1.2) running on Solaris, so the commands might be slightly different. If so, perhaps somebody can comment on what the differences are...
Start up gimp and click on File->Open to load your large image (let's call it "image-large.jpg") into the graphical editor. Then, in the window where the image is being displayed, right click to bring up a menu, and select Image->Scale Image...
This will display a "Scale Image" popup and show you the original width and height values (in pixels). Keep the X/Y ratio set to 1:1 and enter the new width value you want. This will automatically adjust the new height value correctly. Then click on the OK button. This will scale the image.
Save the newly resized image by right clicking again and choosing File->Save As. Make sure you pick a new name (let's call it "image-small.jpg").
Now upload both images into the resources area of your blog by logging in, selecting Settings then Files and use the Browse... and Submit buttons to enter in the two new files.
Inside your Mozilla browser, if you right click on each of those two new images in the list of your files below, you can select "Copy Link Location" to find the URL of where each of those files reside.
Let's call them:
http://blogs.sun.com/roller/resources/username/image-large.jpg
http://blogs.sun.com/roller/resources/username/image-small.jpg
Now finally, inside your blog entry, you can set up the small image to link to the larger one with (split over two lines to make it easier to read):
<a href="http://blogs.sun.com/roller/resources/username/image-large.jpg">
<img src="http://blogs.sun.com/roller/resources/username/image-small.jpg" /></a>
Note that if you don't want to scale the original image, there is another way of doing this where you let the browser scale the thumbnail for you, but typically the thumbnail image won't be on so nice to look at and your web page will take longer to load. This is with something like:
<a href="http://blogs.sun.com/roller/resources/username/image-large.jpg">
<img src="http://blogs.sun.com/roller/resources/username/image-large.jpg"
width="150" height="84" /></a>
( Jun 29 2004, 04:07:59 PM PDT ) [Listen] Permalink Comments [1]
More from American Science Surplus
|
Our June American Science Surplus order arrived last night. Here's what we ordered: |
- Black plastic bowls, just right for snacks by the pool without fear of what might happen if the bowl gets dropped.
- A large balloon. Luckily I now have an electric pump that works of the lighter socket in my car, so I'm not in fear of having a collapsed lung when this is finally inflated.
- 6 Diamond Sleeves. These work with a Dremel-like device. I bought them because I'm thinking of learning about stained glass and doing a project and I needed something to smooth the edges of the glass if I made an inexact cut.
- A combined whistle/compass. What every five year old boy needs.
- USB light. Just attach it to a USB plug on your computer. Perfect for when you previously had to type in the dark.
- Scientific American Amateur Science CDROM. This has the potential to start off a variety of science fair type experiemts. They even have a lot of good suggestions for younger budding scientists.
The Kaleidoscope from last months order was a great success. If you are looking for interesting things to put in the kaleidescope to view, try bugs from the garden. Live ones are best, though a tad unnerving to watch.
Sign up for a catalog here. I'll guarantee that they have something in there that would be useful or fun for you.
( Jun 29 2004, 01:53:23 PM PDT ) [Listen] Permalink
Six ports for the price of one!
|
Unfortunately I'm not in Norway for GUADEC this week. I'm not in San Francisco for JavaOne. So it's greetings from the Sun campus in East Palo Alto (sorry, Menlo Park), and time to blog about a project I did in years gone by "on the side" (i.e. not my RealJob(TM) at the time) that was a great deal of fun. |
This was about the mid 80's. I was working for Sun Australia at the time. This was the Sun distributor in Australia (one of the companies owned by Lionel Singer) and before Sun Microsystems Inc. opened up offices down under. SMI had just released the Sun 3/50 which was a nice machine but limited. It only had two serial ports on the back. It was thought that there was a market for a machine with more ports.
So the FJ Port Expander was invented. A company called Datatran Systems designed the hardware. The firmware was written by Charles Kosina and I wrote the Unix system software (primarily designed for Sun's but capable of working on any BSD Unix system). In fact if you look at the picture of the FJ, you'll notice that it was designed to fit at the back of the Sun 3/50 between the base unit and the screen. It fitted there perfectly.
Here's how it worked. You connected a serial cable from one of the two serial ports on the back of the 3/50 to the host port on the FJ. You could then attach upto five serial devices to ports on the back of the FJ. There was also one parallel printer port available.
Astute readers will notice that what's happening here is that the serial port (typically running at 9600 or 19,200 baud in those days) was being shared by all those devices. There was a packet protocol going between the FJ and the software running on the Sun, which allowed you to read/write from/to the various devices from multiple applications running on the host computer through pseudo ttys.
Why was it called FJ? Well that was because the Sun 3/160 CPU board was code named "Carrera", after the Porsche Carrera. In Australia, the most famous car is the FJ Holden. Not quite as sexy as the Porsche, but famous in Oz never the less. So we called it that. Actually I got to call it that, and the name stuck. First and only time I've named a product (as opposed to a single piece of software).
I don't think we sold many of these beasts. I unfortunately moved onto another project so I didn't get a chance to do revisions or bug fixing. I did get to give a paper at an Australian Unix Users Group conference on it though. Alan Kay was at the same conference giving one of his tour-de-force presentations. Truly amazing to watch. Great times.
( Jun 29 2004, 07:41:05 AM PDT ) [Listen] Permalink Comments [3]
Understanding large source code bases
|
The reformatting of the code of the fairly large new Java project that I've inherited (so I can read it better - see here for more details) is about half way done. As I've been reformatting it, I've been looking at the code but that only goes so far towards understanding. I'm now starting to think about how I can best get to grips with this new Java code in the shortest possible timeframe. |
There have been two useful tools for helping with this for other projects that I've worked on. They are:
- Code Reading an Addison Wesley book by Diomidis Spinellis. The link to the web site has lots of useful information including an extensive bibliography
- Code Spelunking an article in the September 2003 ACM Queue magazine by George V. Neville-Neil.
( Jun 28 2004, 11:30:15 AM PDT ) [Listen] Permalink Comments [1]
Top 100 RSS Feeds.
|
In a recent blog entry, I asked how you found great RSS feeds. I realise that this is a matter of personal choice. Everybody is going to have different favorites, but there must still be some feeds that provide an invaluable service (The New York Times ones come to mind). To me, this seems like an ideal future Google Labs project - the ability to search for potential RSS feeds from all of the web pages they've searched over. Now blogstreet.com sort of gives you that, but the RSS URL needs to have been registered with the site first. There are numerous other sites like that. |
For now, I just used a normal Google search to try to find sites where top RSS feeds had been listed. The best I could do (with a short search) was Top 100 Most-Subscribed-To RSS Feeds. I've taken a few of those feeds and subscribed to them in my newly opened Bloglines account.
Hope this information is useful to others to just starting out.
( Jun 28 2004, 08:29:30 AM PDT ) [Listen] Permalink Comments [1]
Well it's not coffee but...
Ugh! I've just spilt a half a bag of New York Style Cinnamon Raisin Bagel Crisps over, not one, but two keyboards and a mouse pad. These are the crunchy broken up pieces, not the round toasty slices that you start with.
It's cleaned up fairly well, but everythings got that day-at-the-beach grittyness feel to it at the moment.
Only time will tell if I've done any serious damage.
( Jun 28 2004, 06:28:03 AM PDT ) [Listen] Permalink
Perl 6 Periodic Table of Operators.
Had to share this one.
Over the weekend, I've been looking around for new RSS feeds to subscribe to. I discovered this one. It's chock full of interesting tidbits.
Like this pointer to the Perl 6 Periodic table of operators by Mark Lentczner. There is a PDF file there and also a poster available from cafepress
( Jun 27 2004, 07:00:10 PM PDT ) [Listen] Permalink
Chess for kids
|
Our son, who is five started going to Chess Club during his last few months in Kindergarten. His idea of chess at the moment is to try to capture more pieces than his opponent as fast as he can. No concept of strategy yet. No trying to think a few moves ahead and work towards a checkmate. Okay. Fair enough. I can understand this. What has been hard up to now though is finding a computer chess program that I can "dumb down" so that it's not continually thrashing him. Then I remembered that I had ChessMaster 5500. This is a few years old now, but it has the ability to easily set how long the computer "thinks" for. I set this down to one second, and it made lots of silly mistakes. Good. He can beat it at this level which will increase his confidence and then he can slowly increase the computer's skill level by giving it more time to make its move. |
I noticed that the ChessMaster series is now up to its 10th Edition with a free 8 hour download available to try. We don't need all the new fancy features but it's good to note that it's still a very popular program.
But what are other good resources for chess for young kids? I've been told that LEGO Chess is excellent. We should probably try that out. I also found a few useful links at Chess Central but even there it looks like they are aimed at the slightly older children that can read and write (8+). Maybe we are trying to do this too early...
Any recommendations for very young kids?
( Jun 27 2004, 05:39:41 PM PDT ) [Listen] Permalink Comments [3]
Sharing the JVM
Recently, at the practice sessions for the speakers who will be talking at JavaOne this year, I got to hear an intriguing talk by Grzegorz Czajkowski. He and Mike Jordan, with by giving a presentation entitled Sharing the Virtual Machine
As we are now trying to run Java in smaller and smaller devices and startup time is critical, the work that is being done here is very promising. If you are going to the sessions at JavaOne, I encourage you to check this one out.
One the same subject, I saw a new release of Jolt JVM Daemon has just been announced on FreshMeat. Jolt is a wrapper program that allows multiple invocations of the java, javac, javadoc, and jar tools to reuse the same JVM, thereby substantially improving the startup times of those tools.
( Jun 27 2004, 06:20:40 AM PDT ) [Listen] Permalink
Puppy update - no dog yet.
|
See an earlier entry for more details on yesterday's installment of our puppy hunt. Today we went out to two shelters. First there was Pets in Need in Redwood City, where we'd previously had success getting one of our cats 8 years ago. They had a poor selection of dogs today; only one coming anywhere close to what we wanted. It was a chiwawa mix with a serious underbite. Looked like it was growling continuously. When we visited with it, it was very shy, almost to the point of being frightened. This was not a match for an active young boy. |
Our second stop was the Animal Services & Placement Center in Palo Alto. They only had three dogs. None of them anywhere near what we wanted. Duncan was disappointed, but he's now understanding that this might take a little while and I think he's okay with that.
Probably my wife will go out with him next week to a couple of the shelters in Santa Clara county that are a little further afield, and see if they have any ideal candidates.
( Jun 26 2004, 06:48:07 PM PDT ) [Listen] Permalink Comments [1]
Snood - don't go there!
|
Every now and then, I get interested in a computer game to the point of addiction. The previous one was Pit Droids. The current one is Snood. As it says on their website, "forget life... play snood!" and it's very apt. I've spent many an hour playing this game on my old Windows 98 PC at home. It'll also run on Macs, Pocket PC, Game Boy Advance and Palm Pilots. I tried the latter and it's a tad too small for my aging eyes. This is the only shareware game that I felt was good enough, that I was happy to pay the money to get the full version. The full version includes many more game levels and puzzles. You get free updates. There is also an editor for creating your own puzzles and levels. There is a Snood store for getting t-shirts, hats, mugs etc. The author is Dave Dobson and he should be very impressed with his creation which has had millions of downloads. The parent company, Word of Mouth Games has a few other games to choice from, but for me, the demo versions have not had the addictive powers of Snood. If you want to keep your life, don't go to their website. But if you want spend many an hour on a fun additive game, this one takes a lot of beating. You've been warned. |
( Jun 26 2004, 02:06:44 PM PDT ) [Listen] Permalink Comments [1]
Google Hacks
|
We all know how good a search engine Google is but I wonder how many people realize that there are lots of special hacks that can be done to help you refine your search. Tara Calishain and Rael Dornfest have an O'Reilly book entitled Google Hacks that goes into 100 of these in a lot more detail. |
There are a couple I use all the time.
- :site
When I wrote the recent blog entry about a website that helps you select which kind of dog to get, I remembered that it was somewhere under www.ivillage.com but not the exact URL. No problem. I just entered:site:www.ivillage.com what dog breedas a search into Google, and it came back with the URL as its top hit. - :daterange
Recently at work, I wanted to find a Tcl/Tk plugin for my browser. Trouble was a search oftcl browser pluginwas finding a lot of old cruft from circa 1998 which didn't seem to be applicable any more. I then remembered Google hack #11 - daterange: for date range searching. But you need to have the dates in Julian format. Well that's easy. I can google for:julian date converterand the top hit points me at a nice online converter for this. I generated a couple of Julian dates so I could search over the last 2-1/2 years and then went searching with:tcl plugin browser daterange:2452276-2453168The top hit now points me at: http://www.tcl.tk/software/plugin/ where there is a link to download a plugin for Mozilla.
The Google Hacks book website contains a list of the hacks in the book. It also allows you to download a ZIP file of the examples. There are also several complete sample hacks online. O'Reilly has set up a site where you can add comments about each of the hacks.
There are other sites that have documented Google hacks. Here's a good one.
( Jun 26 2004, 07:20:05 AM PDT ) [Listen] Permalink



















