Category Archives: Technology

Dell XPS lights addition: Touchpad light

I got the following addition on my Dell XPS LED code from David Pritchard.

The new version of the code has a “-touchpad” argument. Specify “-touchpad 1” to turn the XPS 2 touchpad light on, “-touchpad 0” to turn it off.

Here is the updated source code and executable. The executable should work without Cygwin now. (Note to self: Use “-mno-cygwin” gcc option to strip out the dependency)

Posted in Technology | Leave a comment

Dell XPS Vanity Lights Blink!

My newest computer is a Dell XPS thing. It’s a huge monster of a laptop (really a gaming laptop, good for the performance). It comes with external LED lights on the top, sides and bottom. These lights are normally only configurable though a custom program. Since I got the PC, I have been dying to find a way to control these LEDs from a script. Finally, today, I found out how.

A post on Notebookforums made med aware of the tool API Monitor, which allows me to see how a program is using the Win32-API. From there, it was easy to recreate a program to do the same. The hardest part was that I decided to try to use the Ruby Win32API interface to call the methods. It was hard to find out how to pass the arguments, and in the end, I ended up with a pure C solution.

The final solution is a command line program, which allows me to script it. I have encapsulated the modification of the LEDs in a simple function for easier reuse.

For any reader with an XPS who would like to replicate it, I have posted the C source code and Executable. These files are licensed under a Creative Commons Attribution2.5 License.


Creative Commons License

Update: The previous version of the xps_led_control.exe required cygwin installed on the client PC. I have compiled a new version that presumably should run without cygwin.dll. If you have the chance to test this out, I appreciate positive or negative feedback as to whether it works. Thanks.

Posted in Technology | 70 Comments

To autowire or not to autowire

Jason Zhicheng Li has written a blog article about Spring configuration. It is called the 12 Best Practices for Spring configuration. Best practice #1 was “don’t use autowiring*. That got me thinking:

I feel very ambivalent about autowiring. Initially, I thought it sounded like a great idea because it reduced clutter, but then people like Jason convinced me that it was not. The more I think about it, the more usure I am.

So, what are we afraid of when it comes to autowiring? Documenation is one thing, definately. In my experience, I don’t use the configuration much for documentation anyway. And we are used to automagic stuff happening anyway, so autowiring won’t be too different. Nothing stops us from explicit wiring in the cases where autowire would be too “undocumented”.

So what can go wrong? Either something gets shouldn’t be, or something doesn’t gets set which should. Autowire ensures nonambiguity, so if something gets set its always what should’ve been set.

As I can understand the issue, using autowire to, say, let all DAOs use the same DataSource seems much easier to manage than explicit wiring: If a class has setDataSource, it has the standard datasource. What could be easier?

I cannot see any realistic way where the first scenario would actually happen. If you have a setter on a bean, having it called can hardly be a surprise to you! Why else would you have it! If it wasn’t needed, it will not cause any harm, and if it was, it would be the right one.

Nor is there any great risk in a property being unset. If a property is critical, we already know how to deal with it: Dependency check or implementing InitializingBean.

So: We all have this fear of autowiring, but I have yet to understand a rational reason not to use it. (And yet, I don’t use autowiring either)

Can someone please explain WHY autowiring is bad without just waving their hands around? What bad things can happen if you autowire? Has anyone experienced any pains after autowiring?

This article has been posted as a comment to Jason’s blog

Posted in Links, Technology | Leave a comment


Any reader of my blog should not be surprised by the fact that I think software patents are pretty bogus. So y’all will forgive a little rant brought on by the examining the (pretty bogus) eolas patent.

Here is the introduction to the patent, taken from eolas “technology” page:

The Web Application Platform
Distributed hypermedia method for automatically invoking external application providing interaction and display of embedded objects within a hypermedia document

U.S. Patent 5,838,906, Filed in October, 1994, Issued November 17, 1998. Inventors: Michael D. Doyle, David C. Martin and Cheong Ang

First demonstrated publicly in 1993, this invention lifted the glass for the first time from the hypermedia browser, enabling Web browsers for the first time to act as platforms for fully-interactive embedded applications. The patent covers Web browsers that support such currently popular technologies as ActiveX components, Java applets, and Navigator plug-ins. Eolas’ advanced browser technology makes possible rich interactive online experiences for over 500 million Web users, worldwide.

Eolas is currently suing Microsoft for $521 million (whoa!) over this patent, claiming that ActiveX is a violation of the patent. Microsoft has tried a “prior art” defence, claiming that the functionality of the Viola browser was an example of the same idea. The court ruled the Viola “not teach nor fairly suggest that instant ‘906 invention, as claimed.” This may or may not be a fair assessment, but it is beside my point.

The main problem with the patent should be appearant by just reading Eolas’ page about it: If their “technology” “enabling Web browsers … to act as platforms for fully-interactive embedded applications”, how can it be that no web browser obtained a license from Eolas? The plot thickens: It seems that they ALL invented it separately, without using the patent. Eolas on the other hand, sat on their patent seemingly without using it for anything at all.

IANAL, but an idea has to be non-obvious in order to be patentable under US patent law. As far as I can tell, there is a pretty simple test of non-obviousness: If several inventors use the same idea independently of the patent, it must have been pretty darn obvious. According to Eolas’ own testimony, ActiveX (which is a development of OLE, by the way) and applets are both covered by the patent, the same would hold for Flash, or course.

Now, I wasn’t very involved in these things in 1993, but, come on Eolas, that is a pretty bloody obvious idea! What’s next? A patent for comb-overs?

I don’t know about you, but I find this pretty illustrative of the silliness surrounding patents. I have seen a lot of bad software patents, and nary a good one. They proof of the patent system, as they say, is in the eatin’. Oh yeah, and isn’t it cute how Eolas is trying to make it seem like they invented this great thing for the world, and then nobody went on to use their idea about it, just reinvent it! Losers.

Posted in Technology | Leave a comment

Comment Spam

For a long time, I have been plagued by comment spam on my blog. To battle this problem, I have now installed a Movable Type plug-in that verifies that posters are not robots. This will hopefully improve the situation.

The plug-in is called scode. It displays a number in an image that the user needs to type to verify that he is not a robot. The plug-in was a bit of a pain to install: My version of the perl GD image creation library did not support PNG, so I had to use GIF, which took some time to find out. Also, scode required a fair amount of manual work to into the comment web-pages. But now it seems to be working. All is well.

Posted in Technology | 2 Comments

welcome spammers

welcome spammers Dear Spam Robot: I don’t have much time to read emails, and I especially don’t have much time to read unsolicited commercial emails. But I have decided to make an exception. If you would like to send me unsolicited commercial emails, then I agree to read them on the condition that you promise to pay me $500, and subject to the additional conditions mentioned below. You can accept this offer by sending unsolicited commercial email to me at In accepting this offer, you also agree (1) to be subject to the laws of California for the purpose of enforcing our contract, (2) to pay any costs, including attorney fees, incurred in enforcing our contract, (3) to pay your obligation under this agreement within 10 days of sending the email, by mailing a check to me at the address referenced in the Contact section of this site, and (4) to accept service and costs associated with any bill collector that I hire to help collect obligations owed me under this contract. Good luck with your business.


Posted in Links, Technology | Comments Off on welcome spammers

Finally C# gets to be usable!

The best thing to happen since the inceptions of C#: “anonymous methods” are .NET delegates cum closures. Finally we can write syntax like:

addButton.Click += new EventHandler(object sender, EventArgs e) {

list.Add(new ListItem());


Even better: Anonymous methods will be closures, so you can use variables from the scope. This is a much needed amendment. Why was it not there from the start? (whine, whine)

Posted in Technology | Leave a comment

Top 5 Reasons .NET is Better Than Java

  1. Attributes. Keeps getting better ‘n better. Check out Extensible C#, Clemens Vasters new demos, and the underutilized ContextBoundObject
  2. ADO.NET. The ADO.NET model for modeling and transporting data hits right on the spot.
  3. Better FFI. P/Invoke wins against JNI, hands down (too bad it is probably overused, though)
  4. Not EJBs! Getting rid of the defunct EJB model saves a lot of headaches.
  5. Better UI. For the user, that is, not the developer!
Posted in C#, English, Java, Technology | Comments Off on Top 5 Reasons .NET is Better Than Java

Top 5 Reasons Java is Better Than .NET

  1. Open Source Community. The number of excellent open-source tools for Java is staggering. Look at HSqlDb, BeanShell, Eclipse, Recoder, JGraph, Tomcat, JBoss, and many more. More importantly, the Java community has proven much more interested in doing it the open-source way.
  2. Eclipse. Already mentioned, but it deserves a point of its own. Eclipse is a better IDE than VS.NET!
  3. Checked Exceptions.
  4. Less Native Code & more code reliability. .NET still has some weird crashes. Despite much improvement, I have still experienced DLL-Hell light.
  5. More mature libraries.
Posted in C#, English, Java, Technology | Comments Off on Top 5 Reasons Java is Better Than .NET