Category Archives: Software Development

Hackers & Painters

Paul Graham wrote a fascinating essay based on lectures at Harvard and Northeastern. Couple things that resonated with me:

Big companies want to decrease the standard deviation of design outcomes because they want to avoid disasters. But when you damp oscillations, you lose the high points as well as the low. This is not a problem for big companies, because they don’t win by making great products. Big companies win by sucking less than other big companies.” — working at a company that writes software for other companies (read: I work as a consultant), I see this tendency alot. We’ll have ideas that we think could really be something, but end up getting shot down becuase you can’t stray to far from the beaten path for fear of sucking.

… a concept known to nearly all makers: the day job. This phrase began with musicians, who perform at night. More generally, it means that you have one kind of work you do for money, and another for love.” — how true!

and … “It seems surprising to me that any employer would be reluctant to let hackers work on open-source projects. At Viaweb, we would have been reluctant to hire anyone who didn’t. When we interviewed programmers, the main thing we cared about was what kind of software they wrote in their spare time. You can’t do anything really well unless you love it, and if you love to hack you’ll inevitably be working on projects of your own.

[via Tim Oreilly]

Eclipse in Action

Manning formally released Eclipse in Action today. I glanced through it last night at Barnes & Noble, looks like a great book.

I learned about a feature called Java scrapbook pages, described in Chapter 2:

… by virtue of its incremental compiler, you can enter arbitrary Java code into a scrapbook page and execute it—it doesn’t need to be in a class or a method.

Scrapbook pages allow you to test code directly in Eclipse without having to create a class/project with a main() method and then run it from the command line. Pretty handy, reminds me of the demo I saw of Jython at JavaOne.

The Poetry of Programming

This article popped up in the JavaOne Today newspaper so ubiquitous at the conference. It’s a fascinating interview with Richard Gabriel, an engineer at Sun, who thinks that software engineering is less about engineering in the sense of building a bridge and well…

Writing software should be treated as a creative activity. Just think about it — the software that’s interesting to make is software that hasn’t been made before. Most other engineering disciplines are about building things that have been built before. People say, “Well, how come we can’t build software the way we build bridges?” The answer is that we’ve been building bridges for thousands of years, and while we can make incremental improvements to bridges, the fact is that every bridge is like some other bridge that’s been built. Someone says, “Oh, let’s build a bridge across this river. The river is this wide, it’s this deep, it’s got to carry this load. It’s for cars, pedestrians, or trains, so it will be kind of like this one or that one.” They can know the category of bridge they’re building, so they can zero in on the design pretty quickly. They don’t have to reinvent the wheel.

Another tidbit from the article was the mention of Paul Feyerabend, “… who argued that for knowledge to progress, people must violate some of their methodological principles.” What methodological principles have you violated today?

HTTP Spider & Lucene

Spent the majority of my day today refactoring the HTTP spider & Lucene indexing application I’ve been writing on and off for the last couple months as a learning exercise. One of the first things I did was modify the 3 modules to implement the Runnable interface rather than extending the Thread object. Big thanks for Joe for his detailed thoughts on the subject. Probably the biggest reason for doing so is that implementing the Runnable interface means that the classes (a class that handles retrieving web pages, a class that indexes the web pages using Lucene and a class that saves the resulting web pages to a database) could possibly extend some type of task/thread class that I’d want to implement in the future (again, a Joe suggestion).

After completing that, I explored the various ways in which one might interface with the software… the only way (right now) being via the command line with multiple arguments. Since remembering command line arguments can be tedious, I looked at the Properties class, whose methods give you the ability to load a text file with key/element pairs and then get() and set() properties within the file. Java.sun.com has an introduction to the System and Properties class.

Finally, I rewrote each module (mentioned above) so that while still running inside of a while(boolean) loop, they sleep for .5 seconds before iterating through the loop. Hopefully (and it appears this is true) this means that the CPU isn’t stressed out too much.

I uploaded the source here (it also requires the commons http client jar, the commons logging jar, and the lucene jar. If you’re a Java programmer, I’d love your feedback on the code, not from a feature standpoint but from a syntax and architectural standpoint (ie: I care less about whether or not you think you’d actually use this and more about what you think of the code.) How would you change it? What did I do wrong? What did I do right?

Eclipse SSH Plugin

If you use Eclipse, check out this SSH plugin from eclipse plugins: Eclipse SSH Console. Download, unzip, restart Eclipse and then go to Window –> Show View –> Other –> Eclipse SSH Console. One less window I have to have open now when developing.

Also very cool and somewhat related is the Eclipse Tail tool, described as: “… tail for eclipse (like the tail unix command). You can set keywords and your logs will be colorized under 5/6 levels : no matches, debug, info, warn, error, fatal; like in log4J.”

http traffic debugging

Joe commented that he uses ethereal as an aid in debugging networked applications, I’ve also used ieHTTPHeaders and I read about livehttpheaders for you mozilla users out there. ethereal is like drinking from a fire hose, you definitely need to setup filters for the data to become information. It looks almost exactly like Network Monitor, the big difference being that ethereal runs on about 23(!) different operating systems. ieHTTPHeaders and livehttpheaders is really only useful for http traffic, but are both much easier to get information out of quickly.

Server-Side Flash Detection Using BrowserHawk @ DEVNET

I wrote an article for Macromedia Devnet which was just published today! Check it out here: Server-Side Flash Detection Using BrowserHawk. If you’ve never used BrowserHawk before, it’ll be a good introduction. However, if you’ve used it with ColdFusion, you should definitely read it, I was able to use BrowserHawk 4J (the Java version) with CFMX rather than using the ASP bridge (which was and is required if you want to access the extended properties of BrowserHawk in versions of ColdFusion prior to MX).

I should thank Shena at my work for bringing it up as an option (she contacted Macromedia originally), thanks Shena!