Archive for July, 2010

Protip

Never require the presence of a variable which isn’t used in your code.

I would think this would go without saying, but I just lost most of a day trying to figure out why a web service wasn’t working. One of the things I’d done was cleaned up some old code, including removing a hardcoded HTTP header value. The header it referenced wasn’t consumed anywhere in my code, and a quick smoke test indicated that, no matter what the value was set to, the client services behaved nicely. So I assumed (correctly, as it turns out) that the variable wasn’t used in locally or in any system in which we integrate, so I cut the reference out.

Rolled up the build, sent it off, moved on to other things.

QA failed the build, because one of the integration use cases was broken.

Turns out that unless that header is present, one of the methods in a client web service dies. It doesn’t matter what the value is, but it has to be there, or the web method chokes.

So, moral of the story: make sure that all your variables are really needed. Make sure they they mean something and cut out any variables which aren’t required. This is especially true with integration situations like those found in web methods.

Eclipse can’t find aapt.exe in Android SDK tools folder

So I’ve lost the original error message, but I ran into an issue setting up the Android SDK in Eclipse. The error message was something to the effect that Eclipse couldn’t find “aapt.exe” in the version-specific SDK tools folder.

I browsed to the folder specified and confirmed that the executable was there. I checked my path to the Android SDK and it was correct.

After futzing around for a little while I instructed Eclipse to clean all projects in the solution. As soon as I did that, my firewall (COMODO) popped up a warning that Eclipse was trying to access aapt.exe, which was an unknown executable. I selected “allow” and, after Eclipse cleaned and rebuilt the project, the errors went away.

So, if you run COMODO and you get funky errors from Eclipse about not finding SDK components, clean your solution. If that fails, check your firewall settings to make sure that those executables aren’t being blocked.

Intro to Android Hacking

The excellent Hack A Day is running a series of articles on programming for the Android OS. The first two sections (an intro to the series and a “Hello, World!” walk through) are up already, with more on the way. They are very easy to follow, and give you everything you need to get started with Android development.

It’s definitely shaping up to be a great resource.

Article 0 – Intro

Article 1 – Hello, World

Sugru for You!

Cross-posted from my non-code blog.

Hey, just wanted to post a quick follow up to my post on Sugru. Pete, in comments, points to the fact that it’s now on sale again. I will definitely be getting some. Hackers of all kinds and stripes should hie themselves to the Sugru site and do similarly.

Programmers, Flow, and Productivity

Giles Bowkett has a new video up over at his blog about programmers and flow. I first read Flow when I took a class on the Philosophy of Happiness. It’s interesting stuff and it basically reinforces the notion that people need some sort of challenge in order to be happy. (See also Viktor Frankl’s work on meaning.)

The video’s good, but it takes as given one thing that programmers all take for granted, but that many other people don’t understand: a 5-minute interruption costs us way more than 5-minutes worth of productivity. It’s not simply that talking to someone for 5-minutes is 5-minutes less that we’re working, it’s that (and Giles mentioned this in passing at one point), it completely wrecks our train of thought, our focus, our motivation, our strategy, and our tactic. They all get completely obliterated. Building these back up takes time; often hours of it.

One other thing that he might have done well to mention is the fact that many of our interruptions (or at least mine) are interruptions that I generate myself. I am habitually self-distracting, especially if the work that need to get done is boring.

The video is excellent, though, and highly recommended. It’s a much-watch for anyone who is a programmer, works with programmers, manages programmers, etc.

Return top

Magic Blue Smoke

House Rules:

1.) Carry out your own dead.
2.) No opium smoking in the elevators.
3.) In Competitions, during gunfire or while bombs are falling, players may take cover without penalty for ceasing play.
4.) A player whose stroke is affected by the simultaneous explosion of a bomb may play another ball from the same place.
4a.) Penalty one stroke.
5.) Pilsner should be in Roman type, and begin with a capital.
6.) Keep Calm and Kill It with Fire.
7.) Spammers will be fed to the Crabipede.