Saturday, April 21, 2007

Deploying a Squeak + Seaside web application to a Linux server in 3 easy steps

I am sure that most developers who have tried DabbleDB have experimented with the web framework Seaside that DabbleDB is built with. I have worked through Seaside tutorials several times in the last couple of years and last month I wanted to deploy a tiny Seaside based experiment to one of my leased Linux servers. It took a short while to get it deployed because I didn't get it right the first time, so here are the simple steps that I eventually used:
  • Get your Seaside application running interactively in Squeak; make sure the WAKom service is running on a desired port number with:
    WAKom startOn: 9090
    and save image and quit Squeak. Do not stop WAKom before saving your image and quitting Squeak.
  • ZIP up your image and source changes:
    zip -9 -r seaside_running_image.zip Squeak3.9-final-7067.*
    copy to your Linux server, and unzip in your Linux Squeak directory.
  • Run Squeak in headless mode:
    nohup squeak -headless Squeak3.9-final-7067.image &
OK, maybe that was more than 3 steps. If you should ever need to do a scalable deployment Ramon Leon's directions look good but I have not tried them.

How much does web framework choice really matter?

Based on experience with consulting jobs developing web applications using several Java frameworks, Ruby on Rails, and Portable AllegroServe with WebActions (open source Common Lisp frameworks), I believe that choice of framework is less important than:
  • Programming language: choose a language that both fits the application domain and has good library support for your application
  • Data modeling: while I believe in interactive bottom up development, spending time up front getting object models 'right' makes development easier
  • Object persistence: there are lots of good choices (prevalence, object relational mapping for relational databases, distributed memory only, etc.) but choose a scheme that makes sense both for development and deployment
I think that these 3 issues are all more important than choosing a web UI framework.

I have been investing a fair amount of time learning Erlang this year and the ErlyWeb framework (that uses the high performance Yaws Erlang web server) looks very good for both interactive development and distributed deployment. For web applications that map well to Erlang, ErlyWeb allows Erlang to be the development language of choice, but again the important choice is programming language selection rather than web framework.

Tuesday, April 17, 2007

The Semantic Web, Parrots, and AI

Two different subjects today: I just added a blog entry on the semantic web on my AI blog and our pet parrot. One (possible) route to understanding how to do AI is to appreciate problem solving abilities in the natural world. Our young Meyers parrot is a good problem solver but it takes him a while. Earlier this morning, I was reading in bed and had fetched our parrot so he could run around like crazy on and under our bedspread - good for burning off energy. Our parrot wanted to get at some of my stuff on my night stand, but his way was blocked, except for a space between two water bottles which, try as he might he could not squeeze through and he could not move the water bottles. He spent about 2 minutes walking back and forth thinking about the sad situation he was confronted with when he suddenly lowered one wing, raised the other, moving his shoulders close together and then simply walked right through the "water bottle gap" :-)

Our small parrot must have some abstract world model of objects and his own body. Why and how he thought of raising one shoulder while lowering the other to compress the width of his shoulders is a mystery to me, but I believe that this was possibly an example of abstract thinking.

Monday, April 16, 2007

Landscape page layout orientation should be the new standard

Am I the only one tired of viewing vertical "portrait" formatted PDF files on a computer screen? Since it is fairly trivial to support generating either horizontal or vertical page orientation, there seems little excuse to not at least offer readers the choice. If you want to print a PDF, landscape is also OK.

I have purchased three "books on PDF" in the last few months: not a bad deal since this costs publishers a lot less than producing physical books, so they tend to be about half price. One of these purchased PDFs has a landscape (horizontal) layout: what an improvement for on-screen reading! I wish that all publishers would take a clue and that people who produce papers as PDFs would also provide landscape options. BTW, I still have a few vertical (portrait) PDFs on my web site, but I am working on re-publishing them in landscape mode: I have switched to a Latex+some custom code writing system that produces HTML, and either format for PDF, but it is taking a while to converting some of my older projects to Latex.

Saturday, April 14, 2007

Can't believe I missed this Unix utility: screen

I have been using Unix systems for over 20 years: I can't believe I missed the Unix screen utility for using multiple screens in a shell window. (I was browsing the web late last night on my new N800 web pad, and saw a post on Digg about screen - I tried it first thing this morning when I turned on my laptop.)

Here is a short introduction to its use
but all you really need to know to get started is to run the program, use control-a c to create new views, control-a a to send a control-a to a running program (useful for emacs :-) and use control-a n and control-a p to cycle through "next" and "previous screens.

Screen comes pre-installed on OS X and is an easy install on Linux if your distro does not already include it. If you love the command line, screen is definitely worth a few minutes of experimentation to see how you like it.

Friday, April 13, 2007

Review of Nokia N800 'web pad'

A N800 is a very small device that uses WiFi to access the web, including good support for Google GMail and instant messaging, and has a built in video camera.

Although it is a very nice device, I have two issues with it:
  • I thought that it came with video conferencing software (from what I just read, I need to wait a few months for additional software to be available).
  • The screen is very small - the resolution is a tasty 800x480, but the physical size is small. I find myself holding it about 14 inches from my eyes - probably too close to avoid eyestrain with long uninterrupted use.
I bought it for portability for reading both online technical material and fun stuff like Slashdot and reddit - without having to hold a laptop. After using it for about 1 hour I became very used to it. Also, did I mention that it runs Linux :-)

Monday, April 09, 2007

Google Data APIs

I have been experimenting with online data applications (for example, my DabbleDB FactBook RSS feed and experiments with Metaweb's freebase.com system).

I am adding Google's Data APIs to this cornucopia of structured data stores. If you are a Java developer, Google's GData APIs download is a good quick start.

GData and DabbleDB are great for organizing your own data online and then using that structured data in your own applications. Freebase.com offers a wealth of "other people's data", as does DBpedia: Wikipedia information culled as RDF data.

Tuesday, April 03, 2007

Interesting way to build rich client web applications: mjt

As I wrote a few weeks ago, someone working at Danny Hillis's start up Metaweb recently gave me an alpha invite to freebase so I have been experimenting with both their web services APIs and web application as I get some free time. Very cool stuff.

The freebase developers have released the mjt Javascript template library under a BSD-like license. This library enables you to write rich client applications based on web services that return JSON data. It takes more than a few moments to get used to the idea of client side templates but if you are used to server side tools like Java Server Pages (JSP), etc., the ideas are similar. I have done nothing with mjt (so far) except for reading the documentation and playing with the demos, but my first impression is that mjt would be very useful for developing web applications using back end services that are implemented in several languages/platforms that accept REST requests and return JSON.

I have been getting very comfortable with Javascript in the last year. I wrote an AJAX enabled web application for my customer yesterday and today using Common Lisp on the back end with client side implemented as Javascript, CSS, and HTML - a nice combination of REST web service calls to process AJAX calls and Lisp code to generate HTML as needed. If I was already fully up to speed on mjt, a reasonable alternative would have been to limit the back end Lisp code to just providing the REST web services and serving up static content. Anyway, mjt is well worth looking into.