Archive for December, 2005

why people bother to interview here (Part 1)

Thursday, December 22nd, 2005

I have just gotten out of yet another interview with a “senior” Java candidate who doesn’t know threading at all. Please don’t claim you are a senior candidate unless you can answer this basic question.

If 4 threads are each entering each of the methods below at exactly the same time, how do they interact?


public class classy {
    public static synchronized f() { /* do nothing */ }
    public        synchronized g() { /* do nothing */ }
    public static              h() { /* do nothing */ }
    public                     i() { /* do nothing */ }
}

No, the answer is not going to be given. It is simply unbelievable how many candidates have failed this test miserably. Don’t be one of them!

This post is labeled Part 1 because there will be more rants in this area I am sure!

tomcat debugging (5.5.13)

Wednesday, December 7th, 2005

If you get the following error when starting Tomcat in debug mode:

FATAL ERROR in native method: No transports initialized
Transport dt_socket failed to initialize, rc = 509.

The solution is to copy dt_socket.dll from $JDK14ROOT/jre/bin to $JDK14ROOT/bin. This seems to be fixed in J2SE 5.

MySpace20Worm20Explanation

Tuesday, December 6th, 2005

MySpace20Worm20Explanation
Technical explanation of the MySpace worm
Also called the “Samy worm” or “JS.Spacehero worm”

living standards closer to average…

Friday, December 2nd, 2005

A friend of mine posted recently about how concerned he was about living standards in the US approaching that of a Pakastani bricklayer because we are not investing in education to stay a technological leader.

Guess what? The standards are already going to be forced down and we maybe lucky to have the bricklayer standard of living. This is what global climate change is going to do to the US and the world.

The Greenland ice cap is doomed:

The Greenland ice sheet is all but doomed to melt away to nothing, according to a new modelling study. If it does melt, global sea levels will rise by seven metres, flooding most of the world’s coastal regions.

All but one forecast that the threshold for runaway melting on Greenland will be exceeded, in some cases as early as 2035.

Stop and think about this … 7 metres (20 feet) . How many major cities are within 20 feet of sea level? Well, how about most? New York, Los Angeles, New Orleans (what remains of it), San Francisco, Sacramento, Silicon Valley, Seattle, Venice, London… the entire country of Bangladesh, the entire state of Florida.

The “good news” about London is that the outer boroughs will be safe. The article then talks about an even more disasterous rise in sea-level:

  1. A 7m rise in sea levels if either the Greenland or the West Antarctic Ice Sheet melted.
  2. A 13m rise, if both the Greenland and West Antarctic Ice Sheet melted.
  3. A remarkable 84m rise if the East Antarctic Ice Sheet also melted. Some experts believe there could be at least a one in 20 chance that the West Antarctic Ice Sheet could melt some time in the next 200 years.

With these kind of sea-level changes what does that do for arable land? Most farmland is on floodplains, much will be flooded. A rising sea-level also brings salt-water encroachment into fresh water. With much of the fresh water lakes and rivers polluted, with a rising population this begins to sound an awful like many of the scenarios described in Collapse: How Societies Choose to Fail or Succeed.

Water wars, massive movements of refugees, wars, ecological collapse, population crashes…

Of course the sad thing is that all of our technology produces heat. And heat is the thing we will want less of in the future. But increasingly we will need technology in order to survive. The human race looks to be in a death-spiral unless we wake up… soon.

Instead what are we spending our time and treasure on? Iraq and the Flying Spaghetti Monster. We are trillions in debt. What happens if every other country is pulling money out of the U.S. economy in an attempt to protect their own by building massive levees to hold back the flood waters? The U.S. will be lucky to avoid Third-World status. But the good news is that the U.S. will not be frozen like Europe.

But we are unlikely to have much leftover for the latest iPod Nano

why the democrats are around…

Friday, December 2nd, 2005

It has been 5 years of Bush. For a long time the Democrats have been playing prevent defense against the GOP as if the Democrats are somehow “ahead” on points. What they continually fail to realize is that they are not playing cricket or backgammon, with a nice set of rules. Politics is total war. In World War II, Joseph Goebbels delivered a speech after the German defeat at Stalingrad.

He talked about sacrifice.

The problem is freeing soldiers for the front, and freeing workers for the armaments industry. These are the primary goals, even at the cost of our standard of social life. This does not mean a permanent decline in our standard of living. It is only a means to reaching an end, that of total war.

He talked about single-mindedness

Total war is the demand of the hour. We must put an end to the bourgeois attitude that we have also seen in this war: Wash my back, but don’t get me wet! The danger facing us is enormous. The efforts we take to meet it must be just as enormous. The time has come to remove the kid gloves and use our fists. We can no longer make only partial and careless use of [Germaniy's] potential. We must use our full resources, as quickly and thoroughly as it is organizationally and practically possible. Unnecessary concern is wholly out of place.

That has been the difference between the Democrats and the Republicans. The Democrats have been playing parcheesi and the Republicans have been playing for life-and-death.

And the Democrats wonder why they are failing again and again to win elections that should be in the bag. This latest bit of news demonstrates the Repulican determination:

Justice Department lawyers concluded that the landmark Texas congressional redistricting plan spearheaded by Rep. Tom DeLay (R) violated the Voting Rights Act. But senior officials overruled them and approved the plan.

Single-minded determination, sacrifice:

DeLay, the former House majority leader, is fighting state felony counts of money laundering and conspiracy — crimes he is charged with committing by unlawfully injecting corporate money into state elections. His campaign efforts were made in preparation for the new congressional map that was the focus of the Justice Department memo.

Now do the Democrats have to be as corrupt as Goebbels and the Republicans are today? No. But the Democrats need to be as determined and realize that their opponent does not even agree on the same rules as them. Think about Max Cleland (former D-GA Senator). He helped create the Department of Homeland Security. His reward? Bush helped defeat him in 2002.

hurricanes…

Friday, December 2nd, 2005

You know for all the people who don’t believe in global climate change, it’s o.k. it sure believes in you … 13 tropical storms, 13 hurricanes, and only 3 depressions that failed to live up to their potential.

It is a shame that it takes disasters of any sort to wake the human race to the problems facing the world. Maybe 2005 will do that before global climate change is truly too far gone.

Merry XMas … would you like a virus with your music?

Thursday, December 1st, 2005

(This is a copy of an email I sent to friends a while ago — so yes I know it its about a month old! — but considering that Sony and the RIAA still doesn’t get it!. It still seems appropriate! I especially love this press conference by the Texas Attorney General.)

There is a very nasty piece of software that Sony/BMG and others put out there on their music CDs. I realize that some of you may have heard this, but the anti-virus companies haven’t been doing their job when it comes to removing this software and this is a case of something purchased in the store being able to screw you. And it is a really nasty piece of software that it is impossible to remove.

This software installs a root-kit on Windows machines that causes the computer to slow down and can be used to take control of your computer. (Mac and Linux are not affected)

What makes this so nasty:


You buy a CD. You put the CD into your PC in order to enjoy your music. Sony grabs this opportunity to sneak into your house like a virus and set up camp, and it leaves the backdoor open so that Sony or any other enterprising intruder can follow and have the run of the place. If you try to kick Sony out, it trashes the place.

What it also does is tell Sony every time you play the CD. Because of this it is now known that over 600,000 computers have been infected.

Read more

Technical article that broke the news

Brief technical description

‘Fortunately’, there is a really quick way of finding out if a computer is infected. Create a file or directory that starts with ‘$sys$’, for example $sys$test. If it disappears, then congradulations! You are infected. You might wish to join the class-action lawsuit 1 or lawsuit 2.

An evolving, *but not complete!*, list of CDs that are infected is here, including help in how to spot a CD

But you are better off with avoiding any CD listed on amazon as being ‘copy-protected’ or ‘DRM’ protected. Better safe than sorry.

What can you do if you are not infected?

  1. Spread this email. This is not an urban myth!
  2. Ask your congressperson to support HR1201- the Digital Media Consumers’ Rights Act (VA-08 Rep. Boucher )
  3. Don’t buy copy-protected CDs
  4. Support the EFF

P.S. I don’t want any CDs for Xmas. LPs anyone?

Update: To disable autoplay, which is the windows ‘feature’ which helps these nasty DRM programs from doing their thing, see this Microsoft article

software monocytes…

Thursday, December 1st, 2005

A white blood cell which can ingest dead or damaged cells (through phagocytosis) and provide immunological defences against many infectious organisms.

There seems to be a crying need in many software organizations to have a (at least) few designated people whose job includes being software monocytes. That is to say they go around looking for code that is no longer being used or has been rendered obsolete by the passage of time.

Examples

  1. Dead Code
    For example, ‘obviously’ dead code like this should be cleaned up by the ‘monocyte’.

    if ( retrieveValue() == null ) {
         int x = 1;
    }
    

    and reduced to

    
    retrieveValue();
    

    But can the retrieveValue() call itself be eliminated?
    It might not be worth it to a regular developer to trace back down through all the method calls to see all of the original code is truly dead, but someone should. Expensive calls to the database could end up being eliminated.

  2. Obsolete Code
    In Java 1.4, Boolean Boolean.valueOf(boolean b) was introduced. That means all home-grown utility methods that did the same thing should be eliminated. (Of course with Java 5’s autoboxing any explicit method call is unnecessary)
  3. Commented out code
    How many times have you seen code that has been preserved for posterity

    
    // This code commented out because of a bug
    // with exporting as soon as this is fixed put this back.
    // t.exportData(true);
    // t = null;
    

    How long has this been preserved? Many times it turns out that it has been there for years… waiting for that developer to come back and uncomment it. In the mean time, successive developers have faithfully preserved this code, not quite certain of who put the comment in but unwilling to ignore the large “Do not erase”. Time for the monocyte to come through and erase it!

    (Side rant: that mystery developer should have attached the date and their initials to the ‘comment-out’ comment.)

To those who say everyone should be ‘monocytes’ and it shouldn’t be anything special: I would agree that that is ideal. However in larger code bases with lots of legacy code that may not be practical.

black box voting in Venezuela

Thursday, December 1st, 2005

I find this story a little fun. You would think they would trust computers more. Why wouldn’t they trust Diebold voting machines?

Considering how much Chavez has been ranting about the US’s policies and how the government is trying to overthrow him you would think that he should be the one complaining. After all how hard would it be for the CIA to rig the machines so that Chavez was voted out of office? Seems awfully similar to this little CIA operation