Archive for November, 2005

Specs for a new laptop

Saturday, November 26th, 2005

My 3.5 years old Inspiron 8100 Dell laptop is at the end of its road.

I’ve been very unlucky with this laptop. 3 dead hard disks, the keyboard had to be changed once, the motherboard twice. Now both batteries are almost dead (but that’s normal), one PCMCIA slot isn’t working, one USB slot is dead, I had to disable the track point device for good some weeks ago, and now the RAM just died, messing up my file system. Talk about luck…

I guess I’d better by a new one than try to fix that one.

So here are my requirements for a laptop:
- screen 1280 x 1024 should be sufficient. I have 1600×1200 on the current one (15″) and it’s too small. I don’t need to see DVDs on it
- hard disk: I don’t care. I expect to change it to a 7200 rpm anyway. I already have 2 big 2-5″ spare 5400 rpm disks to use.
- memory 1×1G extensible to 2G. Hei compaq: No I don’t want to buy a 2×512 M. Get some clue.
- processor: something that doesn’t kill my batteries too much. Probably a Pentium M. I’d rather invest in a fast disk than a faster processor. My job is about compilation and it’s very IO bound.
- batteries: long lasting. Possible to use 2
- USB2.0 x2, firewire
- DVD burner would be nice, but I can live without it
- Integrated WiFi (Intel if possible, as they’re the one playing nice with Linux)
- warranty: on one side, I’d rather have more than 1 year. On another one, paying 3 years for a non top of the line laptop, especially given my experience with how warranty works. I’d rather keep my money for a replacement laptop if needed.
- if possible, no Operating System. I already have paid my Microsoft tax 3 times for nothing.
- delivery: not in a hurry

Price around 10000 NOK for the stuff. Up to 15000 considering the fluff.

So where am I to find such a gem? Is Dell the only one to let people chose the inside of the beasts?

Browser sniffing, the bad way

Friday, November 25th, 2005

Browser sniffing is a common technique tyåically used to ensure people accessing your web site will receive the content the most appropriate for their browser. Sometimes it is used willingly to make your site unaccessible. Badly implemented browser sniffing can also lead unaccessibility. No matter how good your back-end is, if your users can’t access the front-end, you won’t get to see any of their money. Except if they are motivated, like me.

I will take today the example of KLM, an otherwise famous company, whose JS code prevents me from accessing their site. I am highly suspicious that this code was deployed today (now yesterday), because I had no problem this morning. I sent them a mail and they told me to call their office. If they had the same price on the web and by phone, I wouldn’t mind. But they don’t.

So what’s the issue? Basically I am redirected to a page that says:

unsupported browser? Right...

I open my javascript console to see a flury of error messages, including one that points me to this piece of JS code:

      function checkBrowser() {
              var browser = 'unknown';
              browser = getBrowser();
              if ((browser == 'WIN_IE6') || (browser == 'WIN_IE55')
                    || (browser == 'WIN_IE50') || (browser == 'WIN_MOZ')
                    || (browser == 'WIN_FF') || (browser == 'MAC_SAF')
                    || (browser == 'MAC_FF') || (browser == 'MAC_MOZ')) {
                      //browser ok, so to 'normal' site
                      return;
              }
              else {
                      //wrong browser, so to 'browsersupport' page
                      document.location.href = '/travel/klm_splash/browsersupport.html';
              }
      }

Yes. Right. I use Firefox 1.5rc3 on Linux (I also sometimes use IE through wine). So is my browser unsupported? Or is it my Operating System?

And what about Opera? I wonder what the users of the cool Nokia 770 Linux tablet will say… Or people browsing the web site from their non Windows based mobile phones…

So as I don’t want to spend time finding new plane tickets elsewhere, I will make it so that I can access their web site.

easy simple solution: the User Agent.

Install an extension to alter your browser User Agent.
I used this:

UA Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051121 Firefox/1.5

And hop! The drawback is that the site doesn’t even know I had issues.

using greasemonkey

GreaseMonkey is a known powerfull extension that allows you to dynamically modify a site thanks to JavaScript. Much more interesting than changing the User Agent right?

Unfortunately I don’t think it is possible to modify the loaded javascript using GreaseMonkey. What one could do instead if enable the user agent dynamically on this site. I didn’t delve into how to achieve that because my laptop just died…

opera and user.js

Opera comes with a pretty powerfull functionality: user.js. It’s even more powerfull than GreaseMonkey.

In particular I could redefine the checkBrowser() function to do nothing:

// ==UserScript==
// @name klm.com - Bypass browser check
// @author Jerome Lacoste
// @namespace http://www.coffeebreaks.org/opera/
// @version 1.0
// @description  Bypasses the browser check on klm.com and
//                allows access to the site.
// ==/UserScript==

/*
 * This script is granted to the Public Domain.
 */
if (window.location.hostname == 'www.klm.com' ){
	window.opera.defineMagicFunction(
          'checkBrowser',
            function (oRealFunction,oThis) {}
           );
}

Unfortunately Opera is broken for other reasons on klm.com, and I wasn’t able to test this script. But you get the idea.

messages

Users, when web developers screw up, do not despair. Your imagination (and a good toolbox) may come to the rescue.

KLM, I hope you are happy. Not only did I identify an issue on your site, gave at least one alternative for working around it, and bought a plane ticket. :) Still, I would strongly recommend you to set up a better testing procedure before deploying your web application…

Java and the long tail of web applications

Tuesday, November 15th, 2005

Marco Pas of LogicaCMG accounts on a talk held by Bruce Tate in front of a Java meeting group from the Netherlands.

Marco refers to the high learning curve the Java environment has and compares it to the various alternatives currently available using dynamic languages, including the latest hype, RoR.

I agree with him. The Java mountain scares away Junior programmers. I wouldn’t even start writing a web application without at least 10-15 libraries/tools outside of the JDK. You will probably end up with many libraries from Jakarta commons, a build tool, a logging framework, an ORM mapping, an IoC container, a templating mecanism, a scheduling library, some XML parsing tools, a etc… The more I use Java, the more I have things in my bag pack that I cannot go without.

Because of that, if I had to chose one word to describe Java, I would have to chose between choice and mess. It sometimes makes me feel a little bit sick, and I have seen various Junior Programmers get scared and come back to environment they could deal with more easily (LAMP, .Net, etc.).

Similarly, I feel like some tools, like maven2, try to solve the issues, but in some cases only address the symptoms, not the real cause of the sickness. I will come back to that later on.

Marco also quickly refers to AppFuse. AppFuse doesn’t help much to get started. It doesn’t reduce your choice in the numbers of frameworks you have to select: it just makes them easily available to you in a nice manner. It’s a nice way for you to see how all these tools can be used together. That’s all. You still have to make choices, and it doesn’t reduce much the fear one has when starting to use Java for web application development.

This market fragmentation comes directly from the way Sun manages the progress of the technology:

  • the API are sometimes unecessarily low level, even though some work is being done to make Java simpler to use.
  • It took almost 10 years for Java to get a usable Java client side programming GUI stack. I still wait for the success predicted years ago. I only use 3-4 applications on my desktop. Same for my friends. Apart from loophole that some of them use (thanks Vincent for the tip), all of them being related to Java development (IDEA, eclipse, etc..). None are mainstream.
    • The deal Sun stroke with Microsoft is not stranger to the issue. It was a huge commercial mistake for Sun and Microsoft showed once again how smart they are, negociating a win-win situation. Sun was happy to get their VM distributed on the client, but ended up with an unfinished deprecated VM on 90% of the desktops. You lose.
  • Adding a couple of Java applets for banking needs and that summarizes more or less my Java client needs. Even Sun uses flash to on http://java.com to advertise Java showcases. That’s disturbing:
    flash used on java.com
  • With the JCP, Sun lets people step up to address a particular area of work. Unfortunately, some areas have not been addressed at all. Come to my mind integration with Windows legacy applications (COM, DCOM), still lacking. Letting the market decide about integrating with your main competitor is not something you want. Repeat after me. step 1 - Embrace. Once again, learn from Microsoft (or Google). (Whether you want step 2 - Extend, step 3 - Extinguish is up to you….)
    • With regard to COM integration, do not discard the JaCOB project.
  • Hosting: Java comes with a performance price and required expertise level higher than for other platforms. It’s not important when you own your deployment server, but when you want an external hosting solution, it’s really hard to find professional offers under 50$ per year. I have found my needs for PHP and RoR (not related to them, just a happy customer).
  • JRE licensing issues do not help the above issues

All that makes that Java is not the best choice to address the market of the small web applications. And today I don’t feel that it is ready to address the long tail of web applications. That’s one of the reasons I’ve started looking into alternatives, including Ruby on Rails, which some people are quickly discarding as a niche player. That’s where they didn’t understand where the market is going: AppFuse and RoR don’t play in the same market. RoR delivers you a development environment. It gets you started very quickly, decide something for you and let you focus on your domain problem.

You won’t solve all your computing needs with it, but such as Django, it enables you to develop small apps very quickly, apps that you wouldn’t have written before because they were too expensive to write. RoR and the like are market enablers; they create new markets: they address the Long Tail of web applications. They may lack in integration capabilities, but I don’t care: many projects in this long tail don’t have huge integration needs anyway, and by the time integration will be needed, the infrastructure to support this integration will be there, or the small sites will be rewritten using technologies that enable this integration.

Of course new Java frameworks will soon appear to close that gap, most probably using dynamic languages (like Groovy). But until then, and for those who don’t want to get lost on their way to the top of the Java mountain, there are definitively alternatives to look into, alternatives that work today.

Those are exciting times. Last time I felt excited like that was after I started using IDEA and its refactoring tools.

updated: added reference to flash ‘applets’ on java.com.

Dell laptop drifiting mouse. Fixing it

Wednesday, November 9th, 2005

It’s not by habit to put non software information on this blog, but my personal blog got defaced by some malaysian ‘hackers’ and I believe this information can be useful to others.

In the past days my mouse pointer started drifting a lot, like if it was possessed! Sometimes is was going to the top right corner, sometimes to the bottom left. I had the problem before, but this time it wouldn’t go away, even after rebooting.

Even though I can and I do control most of my applications from the keyboard, there are a couple of things where a working mouse is indeed useful, browsing in particular.

I am apparently not the only one and Dell doesn’t do anything about it. They also have a tendency to moderate their forums too much as can be read as the last comment of that thread:

Users: I have locked this thread due to the length of it. If you wish to continue to discuss a topic in this thread, I suggest that create a new thread and link to the page with the post that you are responding to.

Yeahhh… right…

According to the users, it was a hardware problem and related to the mouse tracker (the little mouse button one finds in the middle of the keyboard), purple on 3 years old my Dell Inspiron 8100. I didn’t even try to disable it using software: I took my tool box and fixed it, hopefully for good. I wasn’t using the tracker anyway.

So:

  • unscrew your keyboard (K screws on the bottom of your laptop)
  • detach your keyboard
  • cut the white cable coming from the ‘clit’ as shown in the following picture

cut the cable away from the clit

If that saved your day, feel free to put a comment here, send me a mail, or some chocolate :)