Tuesday, August 31, 2004

Sometimes I change my mind: Dave Pollard on free trade

Even though I bought, read, and appreciated Arundhati Roy's great little book "Power Politics", I have still been pro "free trade" - but I always qualify my opinion by saying "as long as human rights, environmental laws, etc. are upheld".

Dave Pollard's excellent paper on why free trade does not work has made me change my mind. Actually, unless you are a right wing conservative, changing one's mind is allowed and shows some evidence of a working brain. Radical conservatives (like the neocons in the Bush administration) will never admit that they are wrong - just as people on the far left lack this basic feature of intelligence. I never quite trust the political judgement of people who always vote democratic or republican for this reason - but I digress from what I really wanted to say:

Dave points out "why in a world of massive, hidden government subsidies it creates a hugely unfair playing field". This is the key thing here: the average American would be very surprised indeed if there was an accurate and transparent release of information for Congress giving away subsidies to corporations. This information is indeed hidden well from the public.

So, the problem is not with free trade itself, but the well hidden subsidies given to corporate sponsors of Congress. Other countries (especially in Europe) also do not play fair with subsidies.

Automatic add-on module installs with PLT Scheme, Squeak, etc.

John Wiseman mentioned today that PLT Scheme has an automatic software package install system. Squeak Smalltalk has the same thing in Squeak Map.

PLT Scheme is a very good (and free!) programming environment: a fairly nice UI for writing and debugging Scheme code with fast execution. Small runtime applications are possible with a little work using the underlying MzScheme native compiler and runtime. Cool stuff. PLT Scheme has modules for web servers, web services, XML processing, etc., etc. Usually I use LispWorks Common Lisp (a fairly expensive, but very well supported and very high quality product) for Lisp work, but the free PLT Scheme is fairly competitive. LispWorks allows the easy generation of small and extremely high performance standalone applications but lacks web services support. PLT Scheme has good web services support but is more of a hassle to make standalone applications.

I used to have to use Perl occasionally for work (yuck!). The only thing that I miss about Perl is the CPAN library and auto-installation facility. Now more reasonable programming languages have this facility also.

Sunday, August 29, 2004

Google file system, large scale architectures, Smalltalk Open Croquet

One core piece of infrastructure behind the Google search engine is the Google file system. If you have not already read this paper (PDF) then I suggest that you do so.

Starting with the requirement to be able to efficiently merge work queue data (e.g., spidered links) lead to the design of a file system that supported very inexpensive file append operations.

To me, Google represents at this time the best technology for mega-scale centralized processing. At the other end of the spectrum of large scale design is the Open Croquet project: a design for supporting very large scale peer to peer collaborative environments. The Open Croquet white papers give a great overview to this system. Open Croquet (due to be re-released within a month) combines a scalable immersive working environment with 3D virtual reality (VR) technologies. Open Croquet is vaguely similar to Sun's 3D Looking Glass desktop in appearance, but is really something very different.

Open Croquet covers two of my interests: large scale architecture and VR. (I was a principle in the SAIC VR Systems Division, and was the lead on a VR project for Disney when I worked at Angel Studios). I think that Alan Kay is correct: in computer science, we are just beginning. The real fun is yet to be experienced!

Saturday, August 28, 2004

Outsourcing (Slashdot), and why we will hopefully not have food shortages in the U.S.

Lot's of interesting talk over on Slashdot today about the ACM Queue article on outsourcing. I read this article about a week ago and although I am a defender, in general of outsourcing and globalization (with reasonable care paid to laws, the environment, etc.), I thought that the article was largely bullshit - read it for yourself to form your own opinions.

During a hike and breakfast the other day a new friend Bob (a pharmacist) was talking/worrying about the effects of both outsourcing and, separately, the insane economic agenda of the republicans (just for your information, Reagan got lucky: the economy grew during his watch because of drastically cheaper oil: I believe that the supply side people are idiots). He was more than a little concerned in the U.S. that we are heading for large scale social unrest and possible food shortages. I am a little bit more optimistic - sure, the economy is going to crash sometime (right after the elections, in a year, who knows?...), but I think that Americans are resilient and will adapt to a lower standard of living.

I was a little surprised that another friend of mine Mark (a real estate guy) during a hike this morning agreed about the possibility of social unrest, and food shortages. He pointed out that during just a few short months of gas shortages in the early 1980s, that people were going a little crazy, and that period was thankfully short - the situation is different now: there is global increase in demand (Asia, etc.) and future oil squeezes are not a probability but a certainty, and they will make the early 1980s look mild in comparison.

Still, I am optimistic: here in the U.S., we have so many material blessings, and what do people really need for happy lives? I would suggest that housing, food, family and friends does it. Assholes who drive around in SUVs with no passengers, etc. might have to switch to economy cars when oil supply needs to be diverted to food production, but who cares about these selfish people? I think that people with solid values will be fine.

Tuesday, August 24, 2004

What is up with people setting CLASSPATH?

I have seen a zillion complaints on Slashdot about hassles setting the CLASSPATH environment variable. Setting CLASSPATH is a bad thing to do, period. I have many Java utilities that I run (wsdltojava, zeus, etc.) and I always simply use startup scripts that set the classpath on the command line.

Just out of curiosity: if anyone can think of a good use of setting CLASSPATH, email me.

Slashdot: Why is Java un-cool?

I would have responded directly on Slashdot to this article, but I was already moderating there. Is Java a little un-cool? Sure. So what.

I love doing server side Java. Is Java my favorite language? No. That would probably be Common Lisp. The thing is, for most of the work that I do, Java has several advantages:
  • Great free platform support for web presentation, SOAP, XML-RPC, asynchronous messaging (JMS), etc.
  • There are many skilled Java programmers: when I build a system for a customer, I can feel confident that maintenance will not be a problem.
Common Lisp has advantages also (extremely fast compiled code, small runtime overhead, rich standard library, very terse language) for some types of development (I use Lisp for working on algorithms, natural language processing, and other problems where I am breaking new ground - Lisp is great for experimental programming).

Saturday, August 21, 2004

Tomcat as an application platform: enjoy the simplicity

As a Java developer, I mostly do what people directly pay me to do. Because of this, my comments here might be a bit biased: almost all of my work now involves writing either dynamic web applications or some type of infrastructure for web applications.

I find myself now really disliking writing thick client applications in Java (or Windows, X Windows, or Mac OS X for that matter). I started a long period of writing GUI client apps in 1982 when SAIC bought me a Xerox Lisp Machine - it was so easy to rapidly prototype GUI applications, that I found myself coding lots of demos. I also had to write Microsoft Windows, X Windows and Macintosh native GUI apps for many years.

Maybe I just enjoy doing whatever I am currently doing, but more than that, I just find writing web applications to simply be fun. Keeping code and data on the server just gets rid of all sorts of problems that take the fun out of development: handling updates, diagnosing bugs that are often related to a funny state on a PC, etc.

While there is a definite place for J2EE components like EJBs, JMS, etc., fortunately, for most of my work, I just deal with application specific POJO ("plain old Java objects") classes, simple persistence (e.g., Prevayler, Hibernate, etc.), JSP/struts, etc. In other words: the simple stuff that allows me to simply think about my current application, spending very little time worrying about infrastructure. Even SOA ("service oriented architectures") applications are straightforward with axis SOAP support, WSDL support, XML-RPC, etc.

And yes, Tomcat combined with a good web app development environment (I prefer IntelliJ 4, but Eclipse with MyEclipse is handy also) is good enough, and fairly much worry free.

PS. something obvious, but sometimes overlooked: when building applications on top of Tomcat, it is also easy to handle background processing: write a servlet that is loaded automatically by Tomcat (use a load-on-startup tag in your servlet definition in your web.xml), define your own init(ServletConfig config) method that after calling the super class init, starts up a work thread. I use this whenever I want to do background processing (periodic admin, web scraping, etc.) in a web application. Don't forget to increase Tomcat's heap storage using something like JAVA_OPTS=-Xmx300m in your catalina startup file.

Friday, August 20, 2004

Calling 'return' in a JSP, avoiding sendRedirect(...) problems

A not too uncommon runtime error occurs by trying to call response.sendRedirect(...) twice on a single JSP or calling response.sendRedirect(...) while writing any output to a servlet or JSP output stream.

A trick that I use to avoid this problem is to simply 'return' immediately after calling response.sendRedirect(...). This is required because the page is not redirected instantly - it occurs after all the output to the page is written.

Simple trick, but I never see this in other people's JSP code, so I thought that it was worth mentioning it.

Thursday, August 19, 2004

Using GMail to keep track of competition

I have been using GMail since last Spring when Peter Norvig invited me to try it as a beta tester. Since I use several computers in my consulting business, having a web based email system is convenient - no hassles syncing my email (my local ISP does not support IMAP).

Anyway, one surprising advantage of GMail is the advertisements that are targeted to the text in my emails. I frequently see advertisements for either competitors (of my customers mostly) or interesting information. I don't spend a lot of time checking out competition, but when their advertisements appear along side my email, it is worth a few minutes a day checking them out.

Wednesday, August 18, 2004

Archiving data (semantic web, business, etc.) in XML

The other night I needed some data that I had processed a few years ago - no problem; I have been archiving data in adhoc XML documents for years. I say adhoc because I usually don't use a DTD or Schema to define structure or to validate XML - instead, I write a program that collects and/or processes data and writes directly to well formed XML files - format determined by the application.

The important thing is that I can look at an old XML data file, see the format that I used, and in a minute or two have a little code that uses a SAX type parser to get out what I need. I have used XML files for:
  • Data scraped from the web matching board of directors members with companies (used for an experiment to detect interlocking board members)
  • Data form the CIA World Fact Book for countries
  • US State and city names
  • Categorization data from training on the 2 gigabyte Reuter's news story corpus
  • etc.
I used to keep data in a relational database - handy for adhoc queries, etc., but now I favor simply archiving interesting data in XML files.

I have thought about setting up a repository of free interesting data in XML - hopefully if I share with others then I will get some interesting stuff back in return. That is on my to-do list :-)

Monday, August 16, 2004

I am back from traveling to my niece's wedding

Carol and I were in San Diego for almost a week at my niece's wedding. My two young grandchildren and many other relatives also live in San Diego, so I had a great time seeing everyone.

Sunday, August 08, 2004

Some people 'really get it'

I just saw this short article by Paul Craig Roberts. This guy really understands the economy and world situation.

I see a lot of otherwise intelligent people with their "heads in the sand" - what is wrong with looking clearly at what is likely to happen in the near future? Is this negativism? Is this pessimism? I don't think so: a clear unemotional view of the world can only benefit you and your families.

3D graphics with Squeak Smalltalk and LispWorks Common Lisp

I have been very busy lately work-wise, but I have spent a few evenings lately getting back into 3D graphics (I used to do the game/character AI for Ninitendo video games and VR projects for Disney and SAIC - I am no 3D graphics specialists, but I have some practical knowledge).

Anyway, I was blown away by the general coolness of Alan Kay's Squeak/OpenCroquet demos (videos here) and started looking at the Balloon3D graphics in Squeak Smalltalk and the OpenGL support in LispWorks Common Lisp. Unfortunately, Squeak under Mac OS X does not seem to support native OpenGL, but the Squeak APIs (including Alice) are very nice. LispWorks supports native OPenGL so graphics look great with great performance, but there are no high level frameworks - just OpenGL.

I also took another look at the Java3D APIs but I would rather play in an interctive programming environment.

Friday, August 06, 2004

The End of Oil

Dave Pollard has an excellent article on the likelyhood that we will run out of oil sooner than most people think.

In reading this article, I thought about the Bush administration giving huge tax breaks for buying gas-guzzlers like Hummers. Definitely not in our country's best interests - but good for the oil industry, and that is what counts to the Bush administration: children, can we say cronyism?

As Dave points out, it would be so much better to start a strong conservation program now than to wait until civilization as we now know it is changed, much for the worse. In my opinion, people who waste energy are unpatriotic. Polititions who ignore this issue are unpatriotic. Some people just don't give a damn about the long term health of society.

Wednesday, August 04, 2004

Software patents: eventually giving the edge to the third world?

The best Congress that money can buy (the US Congress, that is) has been rewarding corporate sponsors with stronger IP and patent laws. Other countries like Australia are following along. I think that this is likely to cause severe long term problems for technology development in the US because smaller countries without strong IP laws will follow the path of open source to the benefit of students and developers.

I have a background in science (a degree in Physics), and appreciate the open sharing of knowledge. In today's techno-culture, increasingly, knowledge is encoded in software systems. I believe in both commercial and open source software - we need to encourage both.

I believe that this trend of stifling innovation will damage our long term economic strength, but I am not sure what to do about it except for writng the occasional letter to my Congress persons.

I saw on Slashdot this morning that the city of Munich is concerned that patent laws might cripple open source development - unfortunately, they are probably right.

Monday, August 02, 2004

ACM articles on haptics

Haptics is the use of force feedback in virtual reality (VR) systems. I effectively used haptics years ago when designing and building VR Indy race car simulators at SAIC. I thought about this at lunch time while reading through the latest ACM Communications magazine.

Since we had a complete physical model for the state of the car that a user was "driving", I could apply pressure back through the steering wheel when the model calculated that the wheel would be hard to turn.

Also, when I was in a 3 day Russell Racing class at Laguna Seca Raceway, I noticed that if the Formula Mazda car that I was driving would get a tire off the main pavement (onto the warning bumps along the track), I could feel this in the wheel of the real racing car. It was not too difficult to determine when a VR user was slightly off the road and to produce similar vibration in the steering wheel of the racing pod - an awesome effect!

Years later, I was the lead programmer on a VR demo system for Disney Quest. We had incredible real time graphics and a good motion platform, but in the demo we did not have haptic force feedback on the oars users would use to maneuver a "raft" down a river in a dinosaur rich environment (I did the AI control for the dinosaurs). This whole VR world was absolutely awesome but the lack of haptics took a lot away from the experience.

I am really busy work-wise, but later this year I am hoping to get some hacking time in on the Open Croquet project that uses Squeak Smalltalk and OpenGL to build and use 3D virtual colaborative workspaces.