Sunday, November 27, 2005

I am going to be offline for a few weeks

Later this week, I will be in the Caribbean (mostly diving) - so no blogging for a while. Carol and I are going with two other couples - all dear friends. I will post a few pictures when I get back. I have two very exciting projects starting up, so it is a little difficult to break away right now for a vacation - but the work will be here when I get back and I am looking forward to it.

Wednesday, November 23, 2005

Best paper on Ruby on Rails

Rick Bradley wrote Evaluation: moving from Java to Ruby on Rails for the CenterNet rewrite as an internal company strategy document - a great read! I have only been using Ruby on Rails for relatively small (low traffic) projects so I was most interested in Rick's take on RoR for enterprise class systems.

This guy gets it right: Java language extensions hurt the platform

I don't usually just write blog entries linking to other people's writing, but Ed Burnette gets it totally right: adding new language features to the Java language hurts the Java platform. Look, there are two huge advantages to the Java platform:
  • The JVM is supported on many platforms
  • The wealth of Java libraries, tools, and applications
As Ed points out so well, language extensions hurt efforts to get JVMs universally available on all platforms. Writing Java code that only targets version 1.5 language features prevents it from running on GNU gcj/CLASSPATH and on operating systems that do not have a reliable 1.5 JVM. Except for a few projects for my own use only, I make a point of setting IntelliJ to target version 1.4.x JVMs. I obviously like to run 1.5 JVMs to pick up the runtime improvements, but for serious work, I still target the 1.4.x language.

Saturday, November 19, 2005

Cornucopia complex, Ruby on Rails vs. Java and Lisp

"Cornucopia Complex" is an old joke of mine: fear of too many good things :-)

I claim to be program language agnostic (best tool for the job, etc.) but that is not strictly true because given sufficient libraries of pre-built code, I would just about always choose to program in Lisp. The point here is that existing infrastructure software continually drives me to one language or another. Java usually wins big here with tools like Tomcat, Lucene (including that fantastic Nutch project - I have been using Nutch in the last week - great stuff!), Hibernate, etc.

But Java does not win hands down: Ruby on Rails gets more compelling the more I use it. Seriously, compare using one of the Java AJAX frameworks with the simplicity of in RoR just including the prototype Javascript library in a RHTML template, and using link_to_remote, form_remote_tag, etc. On the Ruby side, a controller class action simply returns HTML with full access to form values using params[], etc. The first time I saw this in Curt Hibb's "Ajax on Rails" tutorial I couldn't believe how simple AJAX could be. Amazing what a single clean architectural framework will do for you.

The real deal would be to easy integration between Java for infrastructure code and RoR for web application user interfaces, and there are certainly easy ways to do this with plain old sockets, XML-RPC, SOAP (uh, a little too heavyweight for me usually), REST, shared database access, etc.

A few years ago, I got enthusiastic about Python and was initially excited by the prospect of natively compiling libraries like Lucene using the GNU gcj compiler, CLASSPATH, etc. and linking with Python (I used this for a while on OS X, but the shared library for natively compiled Lucene and all required libraries was huge). Same could be done for Ruby. However, that just seems wrong to me - I would rather have a Java JVM process and a Ruby (or Python, or Common Lisp) process and use socket, RPC, etc. Socket I/O on the same server is efficient to the point of just about being free anyway. Platform selection seems to be getting easier: if I need a major piece of Java infrastructure software (like Lucene), then I would choose Java. For most other web applications, I would choose RoR. If I had lots of time, I might choose Lisp and build up my own platform - but I think that this would be cost effective in few projects.

Friday, November 18, 2005

Updated version of my "Practical AI Programming in Java" free web book

A download link is on the Open Content page on my main web site.

I re-worked the chapter on Hidden Markov Models, added a chapter based on Paul Graham's 'Plan for SPAM' ideas (with his permission), and converted the manuscript to Open Document Format (using OO2 version 2).

As always, please email me if you see any typos or other errors.

I just added PDF and RTF export to KBdocs.com

I have been writing the KBdocs.com online word processor for my own use, but it is also freely available to anyone who wants to create a login account for themselves.

I found the old export as a HTML fragment file to be fairly useful for exporting from the web site to a local word processor, but RTF is a little more convenient. While I was adding RTF export functionality I decided to also implement PDF file generation.

Thursday, November 17, 2005

MIT's $100 laptop

I have been following this story for a long time, so it feels good to see pictures of a mock-up unit in the news today. The unit will only be made available to schools and NGOs, but I have a few suggestions:
  • Have a program where people can purchase 10 units for donation to schools in poor countries (or their own country for that matter). Kids getting the units could optionally get a picture of the donor's family so they know who gave them the computer. Donors would receive one machine for themselves for 'geek value'.
  • Computer geeks could purchase a unit for software development testing, or whatever, for double the price, plus shipping so one extra student would also get a computer.
Universal improvement in education will help make the world a better place, for sure.

Wednesday, November 16, 2005

Tomcat, Ruby on Rails, and Araneida

While I do most of my work using Tomcat (mostly JSPs, POJOs, a few custom tag libraries, and a few persistence strategies) I still devote a fair amount of time covering two other great server side platform options: Ruby on Rails and Common Lisp Araneida and cl-http web servers.

For server side Lisp, I think that I am going to start favoring Araneida over cl-http because Araneida (with LispWorks Professional) only uses about 20 megabytes of working set memory while cl-http uses much more memory. Most people might find Lisp a strange language choice, but not only have I written two Springer-Verlag Lisp books so my Lisp skills are fairly good, I find the ultra-high performance of natively compiled Lisp refreshing after both java (which also has great performance on the server side once HotSpot has had a good chance to work) and Ruby (which only has OK performance while executing built in methods that are compiled C code).

Because good Lisp programmers are difficult to find, I tend to stay away from Lisp for work performed for clients and just use it for my own business. This is required because I usually build systems and then hand them off to my customers to run and support and they are unlikely to have Lisp programmers on staff.

Another very good Lisp server package is the DrScheme/MzScheme web server that supports continuations (like Avi's Smalltalk Seaside project) and also seems to have low memory use and good runtime performance. The Common Lisp based UnCommon Web package also supports a modular/component style of web application development - it looks promising but so far I have only read papers and documentation on it. Continuation based web application development looks very interesting because the programmer does not have to work so hard maintaining navigational state, etc. and also allows a more component based development style.

Tuesday, November 15, 2005

Partnering and forming a Corporation

My wife and I are planning on forming a corporation around our KnowledgeBooks.com business ideas. Our business plan is simple (at least in concept): slowly build up a collection of knowledge-intensive web portals that provide free services with some income generation from advertisements. If appropriate business-wise, package web portals as commercial products for deployment inside customers' local area networks and provide consulting services for customization.

The great thing about this business plan is that except for our time, it is a low-cost business to startup and run. A difficult decision for us is whether or not we want to actively persue finding partners for our business. It would be great to have a graphics artist/web designer, a marketing person, someone with better hosting bandwidth, etc. Since our goal is more to create a growing sustainable business than to make a quick buck, sharing ownership in the corporation is not a problem. We are more concerned with finding people who share our goals and ideas.

Friday, November 11, 2005

Interesting artificial intelligence problem

I have been working on a very interesting AI problem today. (This is not for a customer, rather it is for my wife's and my CJsKitchen.com web portal so I can talk about it :-)

A bit of background before discussing the problem itself: users of our web portal are encouraged to maintain a simple database on our server of what ingredients that they have on hand in their kitchens. This data is stored per user in a database on my server and is easy to keep up to date. Users can search/view all recipes or just recipes that they have the ingredients on hand to make.

The AI problem is this: given (in a case based reasoning sense) a set of recipes, the ingredients the user has on hand, user preference for cooking style (American Comfort Food, Italian, Chinese, or Japanese) and how spicy they want the dish to be, the problem is this: create a good recipe using only the ingredients the user has in their kitchen. As a bonus, I offer advice, based on the requested cooking style, on spices to buy the next time the user is at the store.

For me, this is a "perfect" AI problem because my wife and I are ourselves the domain experts (we are excellent cooks and very creative in making up new recipes) and I am the "knowledge engineer" so the work is progressing fairly fast (but still a work in progress and incomplete).

Thursday, November 10, 2005

Possible privacy concerns, but I like Google's personal search

A few years ago when I was in California I spent a fun afternoon at the sci-fi writer and physicist David Brin's house - he had a Java related business idea that we were talking about. Anyway, he has an interesting take on privacy: reduced privacy is OK if everyone gets the same power of "surveillance" (hopefully, I am paraphrasing him OK on this). I thought about David's take on privacy when playing with Google's new beta (of course :-) personal search tonight: you login with your Google account and it remembers your search queries, what links you follow, etc. This is all searchable and convenient so I think that I am going to use it frequently in the future.

Since nothing you do on the internet is really private without taking some effort, I just accept that. Now, in practice, only software agents are likely to be monitoring what we do on the web, whether it is Google, Yahoo, or one of dozens (or more!) companies that make our business their business. US, UK, etc. governments have had the ability to track internet and telephone traffic for a long time, so why not private companies.

Back to privacy: it is easy to encrypt email, etc. and I do do that for some customers who request it. I also have one old (but with all security patches applied!) computer that I use for nothing but online banking. Sometimes privacy and security are important and sometimes they are not.

Another way I voluntarily give up privacy (again, for much convenience) is by using del.icio.us to organize all of my bookmarks which mostly have to do with research, my business, and self-study educational resources. At the end of the day, I don't feel like I give up any competitive advantage by sharing my bookmarks.

I am working (so far for only about 12 hours) on KBdocs.com - it is still in beta, with many features planned. Anyway, users of this system trust me to respect their privacy just the way that I expect Google, Yahoo, etc. to respect my privacy. At the end of the day, just deal with people and companies that you feel that you can trust.

Intel Macs running OS X, Linux, and Windows

This is big, at least to me. I use two laptops and two desktop PCs (and some leased hosted servers) for my business: 2 Macs and 2 dual boot Linux/Windows boxes. I don't like clutter in my home office, and the idea of one high end Intel Mac laptop (with an external monitor for desktop use) that is OS X/Linux/Windows capable sounds great to me.

I absolutely don't mind rebooting since I usually need to use one OS for a while, depending on what I am working on. As I have written before, the secret to no hassle switching computers and operating systems is a CVS server so you can sync up development assets easily on any computer (cvs or svn update is your friend :-)

Wednesday, November 09, 2005

Excellent: official Java support for system tray functionality

This is excellent! I use a very good 3rd party library to add system tray functionality to JFC Java applications when running under Windows and quietly fail when running on Linux. Sun's JDK 6.0 (Mustang) support covers Windows, KDE Linux, and Gnome Linux desktops in a portable way.

BTW, I do wish that Linux distribution creators and Sun could get together to have a JRE installed by default on Linux desktops, but I hold out little hope of this. GNU Java (Classpath, gcj, etc.) are coming along nicely but I find it much less facile to develop with than Sun's JDK.

A la cart media purchases will lead to higher quality in TV and movies

Apple's iTunes music store has changed the way I buy music: preview before I buy and only buy what I really like - a great combination where I spend more money on music than I used to but my satisfaction as a consumer is much greater than when I used to buy music CDs. I hope for the same kind of flexibility in purchasing video content: movies, short "Indie" movies, and selected TV shows. The improved quality will certainly be greatest for TV, which has the most room for improvement.

The current TV network system works against the success of smaller niche market programs that have small but loyal followings. We spend a lot of money on cable TV each month and I am not really a happy consumer. There is just too much stuff offered that my family has no interest in what so ever.

I don't mind paying for TV shows, movies, and "Indie" films that I really like, but I want control and selection. DRM that does not threaten the security of my computers is fine with me - I would be happy enough "re-paying" for future viewing of the same material and I really don't want the hassle of storing programs myself (my brother owns about 1200 DVDs and has a physical storage problem).

I think that there are a lot of consumers like myself who would be happy enough paying more money to producers of content that is what I want when I want it.

Sunday, November 06, 2005

What a difference a day makes

Yesterday afternoon, I was home in the mountains of Northern Arizona hiking to Indian ruins with 8 friends. This afternoon I arrived in California on business - I did get in a good walk on the beach today as soon as I arrived. Arizona rocks, California rocks less - but change and variety are good.

Friday, November 04, 2005

Latest Java Trails version 0.8 looks very cool

Congratulations to Chris Nelson! Trails is looking better and better. I had a chance to grab the new version released yesterday and went through the first few tutorials: 1 and 2.

I have little spare time right now, so I just quickly zoomed through the tutorials. When I get a few spare hours, I want to dig into the Trails code itself.

I like Ruby on Rails because of the ease of customizing the auto-generated scaffold code. I spent a little time looking at the generated Trails configuration files, etc. and I am not sure about customizing as far as changing global appearance, etc. but the second tutorial shows how to use Java 5 annotations to change generated form labels, data formats, etc. The second tutorial does show how to change page templates, which is probably what I want: a functional equivalent to global changes of style sheets.

Wednesday, November 02, 2005

Microsoft's Live.com

Since I used Microsoft's new beta portal on my Linux laptop running FireFox, I may not have had the "full experience" :-) That said, live.com looks well done: the client side Javascript is slick and the interface is simple and clean.

I was not so happy with the requirement to login with Passport (otherwise, all your customizations go away when your session ends). Anyway, I think that competition between Google, Yahoo, and Microsoft in the web application area is great. Because I mostly use Linux I use Google's and Yahoo's web applications but Microsoft has announced that they will support other platforms - I am at least trying to keep an open mind about using live.com in the future, depending on what useful functionality that they provide.

Tuesday, November 01, 2005

Poor product: Sony Network Walkman NW-E95: poor MP3 support

This is just my personal opinion: I wanted to get my wife a portable MP3 player for her birthday - she enjoys downloading free MP3s (mostly talks people give, etc.) from the internet. We went out and bought a Sony Network Walkman NW-E95 today only to discover that while it works beautifully for transferring music from an audio CD collection it seems to be (again this is just my opinion) purposefully crippled for playing arbitrary MP3 files. There is a lot of great free content on the internet in MP3 format and I think that Sony made a really bad decision to not support a wide variety of MP3 formats. I found a web blog where someone suggested taking MP3 files and using them to create audio CDs - then load these CDRs to the Sony Network Walkman NW-E95; this is more trouble than my wife wants to go to listen to audio lectures (she has little interest in listening to music on a portable player). BTW, we live in a very small town, so we have to drive 25 miles to get to an electronics store - so, returning this device will be an additional hassle. This is also why we did not go to the store, write down product names, and go home first to research the available players on the web.

I bought a Sony Portable Playstation several months ago - love that. Sony gets somethings right, at least.