Tuesday, June 27, 2006

IBM Java Rocks....

Perhaps I'm biased (ok I am) but today IBM announced performance leadership SPECjbb2005 scores on new power efficient hardware using the most excellent Java 5 VM based on J9 .... sweet ...

[update] Results now on spec web site.

Saturday, June 24, 2006

Awww shucks...

It's nice to read, but now my hats don't fit, my huge expanded head bumps the door frames and my ego is bigger than ever... even so ... thanks for the kind words Ted...

Friday, June 23, 2006

Not for secret agents...



I saw this pen and one of the features in addition to a "Cushion Grip" was "Visible Ink". Usually this kind of thing is reserved for listing features that no one else (aka a competitive advantage) has but all of my pens seem to have "visible ink" so that can't be it. Perhaps the "BiC Exact-Tip Roller" has a sister line of Invisible Ink pens for secret agents and spies.All very curious except what they really mean is that you can see how much ink remains in the pen. Funny, the ubiquitous clear BiC pen has had “visible ink” for years and they never even thought to label it that way. Must be new marketing school graduates working at BiC these days...

This technique reminds me of the trendy labels, companies add to food products which take advantage of consumers fear installed by the latest medical report ... so for the record, this blog entry contains 0 % transfat, 0 calories, no caffeine and is written using visible fonts. All the other blogs make you fat, blind and may even keep you awake at night. As an additional bonus, reading my blog with a glass of red wine will lower your cholesterol and make you happy.

You're welcome.

Friday, June 16, 2006

VEE'06

I was asked to be on a panel at VEE'06 on Virtualization which something I like to do once in a while. First, it's just nice to be asked and second it can be fun and interesting when you get to meet smart people with similar interests. The is often the upside of being able to drink beer afterwards with some of the smartest people on the planet so it's all good.

The guidance from the moderator on the details of the topic of the panel was purposely thin and no definition of virtualization was given which suprisingly worked out really well as the panel was well represented by people who do or have done various language virtual machines (me, Dave Tartidi, Christopher Vick) and those who work on hardware virtual machines (like Xen (Leendert van Doorn) and VMWare (Pratap Subrahmanyam)).

So even though it seems like we're a widely different group, in fact turns out we're all in the "level of indirection" business which is a way of saying we're inserting ourselves in between the user code and the hardware or between user and the operating system for some perceived benefit (safety, isolation, security or ego).

One issue mentioned by a member of the audience was the increasing number of levels of indirection inserted with virtual execution of the operating systems, device drives and additional language VMs on top. The panel was sympathetic however clearly felt indirections were worth it... you know should be ok cause we know what were doing :). Personally, my view is that many of the language virtual machine functions (garbage collection or JIT) will migrate into the operating system and allow for more performance and the reduction of levels of indirection. You can see this clearly in what microsoft is doing, perhaps the CLR is not "part of the OS" or maybe it is but the direction is clear, the OS will eventually be all managed code and the benefit will be increased security and reliability.

My favourite comment however came from David Tarditi who said the opportinity here in the virtualization community is to try and solve problems by changing the problem. So, instead of assuming you have a processor which can do only the same old same old, you invent a new processor, architecture, or compute model which simplies your problem and you simulate with a virtualized environment. Finally, a researcher who thinks researchers should be doing "crazy" research instead of tacking in another 2% on the latest spec benchmarks. I agree, the sky is the limit, all you have to do is reach ...



Monday, June 12, 2006

Just asking for it...

I know better that to replace a perfectly working Linux install with a different version of Linux for no reason other than I felt like it.

So, tonight I took my server, copied a few megabytes of random crap off of it and installed Ubuntu 6.06 LTS . No fear ... cause if I can't get back to a working system then I deserve what I get. In my view, even with the reliability of Linux, eventually even my lighty loaded server will need rebuild, or reinstall with a new version ... so why wait ?

With my freshly burned CD in hand, I didn't even flinch (much) when I inserted the CD and pressed reboot. The install screen offered me some strange options like "Install to the hard disk" vs "Install a LAMP server" ... hmm, doesn't the lamp server get installed on the hard disk ? Oh, well. I decided to go for the LAMP server install as I needed an apache server and php. After selecting some defaults, it just installed in 10 minutes and presented me with a login prompt. The "LAMP" install is a console install so everything is old school TTY.

Next I added SSH and Samba using some apt-get install action. I also had to set up the static IP (default is DHCP) and I also added my virtual sites and restored my html files and voila, I'm back in business. No fuss, no muss. Kind of disappointed ... no tales of woe or sad stories requiring heroics, new hardware or reinstalls or anything...

New Linux installed, no problems... nothing to see here, move along.

Saturday, June 03, 2006

Java int math blows...

A recent post by Google software developer Josh Bloch explains how a bug in the jdk went undetected for 9 years even after the perfectly good code was copied from John Bentley programming pearls.

mid = (low + high) / 2;

which for large values of low/high (as in huge collections) it would overflow and fail. Since we finally have huge machines and huges indexes, this gives Java math an opportunity to fail all over the place.

Turns out the Smalltalk binary search in my image has nearly identical code (gee, makes you think, did some Java programmer derive their class libraries from Smalltalk ? but I digress)... but I'll have you know that the Smalltalk version does not have the bug. It's simple, Smalltalk math works. Java math blows.

Lucy wanted some 'splaining ... so ...

If you have a language where a < b and (a+b)/2 is not greater or equal to a and less than b, then you're screwed by this kind of bug. The overflow is not caught and you are at the mercy of twos compliement math on ints. Boo hoo for you - you chose Java or C or many others... but if you chose Smalltalk ... smile and be happy - math works in Smalltalk. yes... I said works. It doesn't work in Java or C... (ok it works just not well).

Some sample code ...

package test;
public class BrokenMath {
public static void main(String[] args) {
testIntMath(1,100);
testIntMath(Integer.MAX_VALUE - 10, Integer.MAX_VALUE);
}

private static void testIntMath(int low, int high) {
int mid;
mid = (low+high)/2;

System.out.println ();
System.out.println ("Testing Low " + low + " high " + high);
System.out.println ("Is low < high ? " + (low < high));
System.out.println ("what is mid ? " + (mid));
System.out.println ("Is mid >= low ? " +(mid >= low));
System.out.println ("Is mid < high ? " +(mid < high));

if (!(mid >= low)) System.out.println ("Java int math blows");
if (!(mid < high)) System.out.println ("Java int math blows");
}
}

and you get something like this.

Testing Low 1 high 100
Is low < high ? true
what is mid ? 50
Is mid >= low ? true
Is mid < high ? true

Testing Low 2147483637 high 2147483647
Is low < high ? true
what is mid ? -6
Is mid >= low ? false
Is mid < high ? true
Java int math blows

in Smalltalk the equivalent ...

testLow: low high: high

| mid |
mid := (low + high) // 2.
Transcript cr.
Transcript cr; show: 'Testing Low ' , low printString , ' high ' , high printString.
Transcript cr; show: 'Is low < high ? ' , (low < high) printString.
Transcript cr; show: 'what is mid ? ' , mid printString.
Transcript cr; show: 'Is mid >= low ? ' ,(mid >= low) printString.
Transcript cr; show: 'Is mid < high ? ' ,(mid < high) printString.

(mid >= low) ifFalse: [ Transcript cr; show: 'Smalltalk int math blows'].
(mid < high) ifFalse: [ Transcript cr; show: 'Smalltalk int math blows']

"
self testLow: 1 high: 100.
self testLow: SmallInteger largest - 10 high: SmallInteger largest
"

Testing Low 1 high 100
Is low < high ? true
what is mid ? 50
Is mid >= low ? true
Is mid < high ? true

Testing Low 1073741813 high 1073741823
Is low < high ? true
what is mid ? 1073741818
Is mid >= low ? true
Is mid < high ? true

You see ! Smalltalk math works, Java math does not. Java blows at math.

And yeah, if you could catch the overflow (thank you C#) then you could detect this case but don't look for Java for help there either. It blows.


we're spoiled ...

It's easy to get spoiled when you're a software developer these days. Loads of RAM, fast processors, new machines, freshly installed operating systems and modern conveniences like plug and play hardware and wireless networks make it simple these days to futz around with stuff and it all *just works*. It wasn't always that way and if you were around for the bad old days say 8 or so years ago when windows 95 ruled the earth, then you'll know what I mean.

I took a refresher course just this weekend and realized how much better these things are now that in days of old (reminder to you youngins, we used to walk 5 miles to school and it was uphill both ways... and yes, we liked it and didn't complain once)...

My refresher turned out to be a try at rebuilding a windows 95 (ahem) server machine which was being used as a gateway, printer server and VPN client providing service to a bunch of office PCs. This was the most critical piece of equipment and there was no documentation, no anything... and it died. Drivers ? dream on ... config files or notes ... um no. It had three printers, one parallel (thank god) and two serial... Remember baud, parity, flow control ? Not quite as simple as plug-and-play networking, you either know the details or you cannot connect.

So, off we go and first things first... remember Wingate ? this must go. Replaced with a dirt cheap router/gateway which does everthing you need, stuff like DHCP, VPN routing, firewall with no fuss no muss. Removed all the wingate hacks from each client to make it normal and get back to connectivity. Now the printers... no idea what baud rate the old printers needed and no, getting a new printer is not possible as these were specialty printers and no replacements exist. So, we waste this special expensive paper trying to get a simple non garbled ticket to print ... all day my tale of woe lasted.

The fix in the end was we found a written post-it that said 4800 on it... Guessing that this was the baud rate and with some additional experiments it worked and printing was happy again.

I just don't know how small customers with 10 year old computers do it. No patches, so software and no way to fix simple problems due to lack of drivers, updates or anything and the faded history of time means all past configuration know how is gone.

The funny thing, is when we finally checked all the configurations, we noticed the server has a whopping 128M and the clients all on 64M and they worked *fine*... they even boot way faster than my new highend machine running Windows XP...

all I can say after this afternoons mess is we're spoiled...

Thursday, June 01, 2006

Saying it twice ...

In a recent blog entry Sun's CEO Jonathon Schwartz said, in reference to their recent layoff announcement (Sun cutting 5000 jobs).

"while continuing to reduce redundant or duplicative functions."

I'm not actually sure the statement itself is redundant or duplicative but it illustrates the need well. Way to go Jonathon !

Satan not welcome...

The recent brouhaha over the Web 2.0 trademark reminded me of my feelings towards the whole x.0 phenomenon. You know, the technique where you tack on 2.0 or 3.0 or hmm, all the way to "Web X"... to coin the next hot thing.

Anyhow, I've seen few decriptions of what Web 2.0 really means and one of my favourites is simple - James Snell's "chmod 777 "

I like it but gee, if it's a read-write web isn't it chmod 666 ? If it's a rw and execute it's 777.

I'm just saying...