Category Archives: software

Software development and product related posts

The Decline of the ThinkPad

As some of you know I started a new gig a couple of weeks ago at teebeedee. One perk was that we could pretty much choose any laptop we wanted. The other two guys had MacBook Pros and while I almost got one of those I decided to just stay on Windows and I had been really wanting to get away from Dells and go back to a ThinkPad. They have the best keyboards and have always been rock solid from a build aspect.

Well, I would have liked to have tried out their new T60p or Z61p but it was not to be. Why you ask? Well, it never arrived!! I originally wanted a T60p but there was a minimum 4 week wait to get one from Lenovo and the new ones hardly ever make it into the channel or they don’t have the configuration I want. CDW had them but they were $3300 before adding RAM, a docking station and extra battery. Through Lenovo’s site that same configuration was about $2800 for everything. It’s not my money but jeez, I can’t in good conscience do that. I decided to compromise and get the Z61p. It’s not quite as small but comes with a 1920×1200 15.4″ screen and 802.11n draft support. Also, it should ship within 5-10 working days. I got it ordered in early November.

I started my job and it hadn’t arrived yet. Lenovo backed up the ship date to December 7th. December 7th rolls around and on that date they move it to January 9th. January 9th! So you’re telling me, Lenovo, that you didn’t know you were going to delay it again before the 7th? That’s pretty pathetic in my book.

At this stage I needed a laptop, though. I went online and find that the HP nc8430 is getting good reviews and the price is definitely right. I tried configuring one through HP’s site but the ship date was a bit far out. I was reluctant at first to use one of their resellers because of the markup I saw on the ThinkPad’s resellers but it turns out there really wasn’t any markup or at least it didn’t seem like there was that much. So on Monday I should get my Core 2 Duo (2.16), with 2GB of RAM, 100 GB 7200 RPM drive, ATI X1600 w/256MB, Wireless, bluetooth, CD/DVD writer, docking station and extra battery after ordering it yesterday (Thursday!) from CDW for less than they want for the base T60p (sans extra RAM, battery and docking station). The stats are almost identical with the only exception being that the ThinkPad has the FireGL 5250 which is an ATI X1700 with crappy directX drivers. The X1700 and X1600 are nearly identical so that’s not a big deal there.

Sorry Lenovo, but if you can’t manage your supply chain better people are going to find other options and if the quality is pretty close or as good you can guess what they’re going to do. So maybe the ThinkPad is still as good as it was before Lenovo took over managing the brand but I don’t really know since I was never able to get one from them.

MySQL Has Gone Away

Don’t you love error messages like that? I got this error message today while trying to do a dump from one database to another that happened to have a lot of data in it:

ERROR 2006 (HY000) at line 44: MySQL server has gone away

Isn’t that special? Well, it turns out that my server wasn’t configured with a large enough memory setting for the variable max_allowed_packet in the [mysqld] section of the my.ini that is used to configure my MySQL server. I had set the max allowed packet size on the command line to be “4M” which is more than 1M which was set on the server so the connection would crap out during the transfer. In MySQL a packet is a single SQL statement sent to the client. The table in question has some large LOBs in it so that’s why I ran into the problem. In most cases the default value would work but of course, this isn’t most cases (see: link)

By resetting the max_allowed_packet variable to be 4M and restarting the server I was able to finish the transfer.

I Hate the Windows System Beep!

Have you ever heard the annoying system beep that Windows will sometimes make? You know, the one that can’t be turned down through the volume control? (At least it doesn’t get quieter through the volume control on my laptop and install of Windows XP SP2) One example of where the sound will be generated when I make a mistake in MySQL such as trying to insert a row into a table and I forget a required column. For some reason on my Latitude D620 it is extremely loud.

I did a Google search and here is a list of how to turn it off. Follow this link.

It takes 13 steps to actually disable the beep. 13!!!!! Nice job, Microsoft.

Seriously Crazy JavaScript

These guys over at CrazyEgg have a very cool service that you can use to get some visuals on which links have been clicked and how many times and so forth. The nice thing is that it does it by individual link as well, even if you have multiple ones that point to the same resulting item. The most visually impactive feature is the heatmap that shows you where people focus their mouse clicks on. The resulting graphic is pretty impressive. You can use this information to determine how well a site design works or for determining how well a new look might work with a select group of users. I’m going to have to plug this in to see what it shows for my site. I’ll post some screenshots later when I have a chance to put it in place.

Another Reason To Not Like Perforce

There was a recent posting about why someone didn’t like Perforce. I’ll add another one:

The client sucks. Being the fool that I am upgraded my client to 2006.1. Big Mistake! Huge! It crashes all the time. Sometimes it will be stable for a day and other times it will crash non-stop for about 5-6 times in a row. On top of that I continually get winsock errors such as WSANOTINITIALISED and sometimes I get WSAEPROVIDERFAILEDINIT. For the life of me I have no idea how one could WSANOTINITIALISED in an application that is already running and connected unless they made some boneheaded coding errors (in a previous work life I worked at a Windows 3.x TCP/IP stack shop so I know a little bit about the protocol and winsock errors). I mean, the app is already working and I get a not initialized error? My guess is that someone called WSACleanup too many times. I’m also going to take a stab in the dark and say that these two errors (the crash and the winsock errors) are related.

I also have to agree with the other poster that for the life of me I can’t find an easy way to detect what files I’ve added that are not part of source control already. That has to be the lamest non-feature I’ve ever seen. How hard would it be too have a command-line option to tell me what files aren’t managed?

Supposedly 2006.2 will have offline support. It’s only going to be 2007 in a few months and they’re just now getting it? I’m already pushing my company to drop Perforce and go with Subversion. For one, it’s free, and two it doesn’t have a crappy client and lack of offline editing support. They keep making these kinds of mistakes and it won’t take me much longer to convert everyone.

An interesting Hibernate 3.2 annotation gotcha

Here I am working on a project and using Hibernate Annotations 3.2 CR1 and Hibernate 3.2 RC2 (because the annotations CR1 won’t work with CR4) and I ran into a little gotcha. I had just created a few persistent classes and marked them with @Entity and then I setup the annotation configuration in my Ant script and ran it. Nothing happened. That’s not entirely true. The script ran but it never showed that it was processing any classes. Whaaaat? So I try running it by manually creating the configuration and running the SchemaExport class myself. Still nothing. So I start debugging and I see my classes getting added to the AnnotationConfiguration instance but when it comes time to process them, they’re gone. Same instance of AnnotationConfiguration so I start tracing deeper. Then I find what I’m looking for. It only processes classes that are marked with the Entity annotation (MappedSuperclass also but that’s not important right now). The javax.persistence Entity annotation. I had accidentally selected the Hibernate Entity extension annotation when I did an organize imports in Eclipse. Doh!

So I start looking through the documentation and there it is on page 29 of the annotations manual,

@javax.persistence.Entity is still mandatory, @org.hibernate.annotations.Entity is not a replacement.

I will have to file this one away and remember it. While it is documented I think it might be a good idea to rename the Hibernate Entity annotation because as it is, you have to name it absolutely since you must have the EJB3 Entity annotation regardless. And we all know that developers always read the manual before they start coding with a new library. At a minimum I would put a check in to spit out a warning message if a class has an instance of the Hibernate Entity annotation but not the EJB3 Entity annotation. Maybe I’ll submit a patch this weekend since this was bugging me so much.

If you come across this kind of behavior, just double check you imported the right Entity annotation in your code.

TestNG 5 is out

TestNG 5.0 is out. I’ll be upgrading to this one pretty much right away. I like the new tags like @BeforeClass and @BeforeMethod (and their corresponeding after annotations) which are a little more suitable than the @Configuration attribute in the previous releases. I had experimented with JUnit 4 a little bit and definitely liked the simpler annotations easier.

Could someone please make these default reports look nicer??? Yes yes, I know I could do it…I’m just hoping someone else would beat me to it.

The other annoying thing in Eclipse is that when I run a test by right clicking on it and running a TestNG test it creates a bunch of reports in the project directory by default. That’s not great default behavior. Why even create them by default when executing from within the Eclipse environment?

Dell Laptops Suck

I’ve had this Dell D620 laptop for about 2 months now. It’s one of the Core Duo based laptops.

After two months my battery will not charge more than 79%. It says it’s full but then when I unplug the thing it immediately shows 80%.

If that’s not enough it will occasionally come out of suspend mode on its own. Normally it happens when I’m on BART and I put the laptop into suspend mode. Then, when I take it out of the bag a couple of hours later it’s running again and hot. And this particular issue is not limited to my 620. It happened on my previous D600 and D610. This never happened on my previous Thinkpads.

BTW, Whoever thought widescreens were a good idea for regular work? That’s the only way to get a Latitude now I think. For coding I would much rather have the older profile. Sure, for watching a movie it’s great but I would rather have a better screen for coding. The wide screen does nothing for me in that regard. I wish my company would go back to Thinkpads.

What Happened to SpringIDE.org?

When I try going to http://springide.org I get “Hier entsteht eine neue Internetpräsenz” which translates via Google to “Here a new Internet operational readiness level develops”. I’m not 100% what that’s supposed to mean. Any ideas? I think it means the site is under construction. Maybe they’re changing hosting providers. I’m not sure. Anyways, I don’t see anything on the main Spring site, either, so it’s kind of confusing.

Update: Looks like they’ll be back up in a little while. They’re having hardware issues. The update site is still available. Just check out the site and it will direct you.

What a Crappy Blog Entry

Trying to stay in Tinou’s theme of crappy things I thought I’d talk about his entry, “Spring, what a crappy framework”. The main thing here is that the example points to bad design more than it does why Spring is a crappy framework (it’s not but even if it was). I could easily make that a good design as well and Spring has nothing to do with either approach. I have yet to see how Spring encourages bad design. Rather, it encourages it I believe. Tinou pointed this out as well with respect to encouraging the use of interface driven design. Maybe people are just trying to impose Spring where it’s not supposed to be used within his organization. Pushing a tool where it doesn’t belong is bad no matter how or where it happens. I don’t know, though. Some complain it encourages over complicated configuration. Maybe it’s better to have complicated configurations than it is to have that complication moved into code which tends to be complicated enough as it is.

Now, the configuration. Let’s face it, complex applications are going to have complex configurations. Over time you can simplify them or move towards a configuration through convention approach that Rails has been championed for but it’s always going to start out a little more verbose than it might need to be. In Spring 2.0 it moves forward with the use of XML Schema. Combining that with its support for “components” and you will start to see configurations get less complicated. It will also depend on how you manage your configuration files as well. I know that most people don’t think about this because when I ask people in interviews how they manage complex configurations I get blank stares. Almost every time. I generally tend to break my configurations in to multiple files based on functionality silos. Yes, there are a lot of files but if you know you need to find something about the query factory and/or library then you go to applicationContext.queries.xml and there it is (see, more convention!). Complexity is going to go somewhere and as long as you are consistent and follow your own conventions then its maneagable. I also use Spring BeanDoc to view my Spring configuration and how everything ties together. In addition you can also use the Eclipse Spring IDE (note — the site seems to be down right now) plug-in to help better manage your configuration.

Sometimes you just need to figure out where your problem really lies. It’s not always the tool. Tools can all be misused and most of the time the problem lies between your ears more than in your computer.