Sunday, September 30, 2007

Plain text and other simple document types

I limit work to about half time so it is especially important for me to make my work processes as efficient as possible (I also spend about 10 hours a week researching and playing with new technology, but that is generally an unpaid for pleasure, driven by my own interests, not my customers').

Almost everything I deal with is plain text: Ruby, Lisp, Java code, detailed work log notes, design notes, etc. For information that I need to record just for myself, I get no benefit from styled text formatting. For other people I work with or want to communicate with, Latex does the job of generating great looking documents.

The Pier content management and Wiki system looks very interesting to me because it supports Latex output. That said, I am finding Google Docs to be a good alternative to Latex for very small documents. Anything to save time. Pier is open source and deployment using Squeak looks simple. (I have written here before about easy deployment of Squeak web applications.)

Wednesday, September 26, 2007

I am loving Amazon's new MP3 musc store

I am finding very low prices on some music when buying entire albums. A few caveats:
  • For Mac users: buy music using Safari and not Firefox or Camino
  • Downloading is a one shot deal: Amazon encourages you to immediately make an archival copy of purchased music
The album down loader is nicely integrated with iTunes - I hope that Apple does not try to break this convenient integration.

In addition to saving money, this is a huge time saver for me: when I buy music from the iTunes store I always make an archival copy by burning an audio CD, then using Tunes to rip to MP3s, then add the MP3s to my permanent backups - this was a time consuming process.

Tuesday, September 25, 2007

"Why would you use Ruby when you could use Smalltalk???"

Patrick Logan poses the reasonable question "Why would you use Ruby when you could use Smalltalk???" Looking at things from a development rather than a deployment perspective, I would have a difficult time arguing with Patrick. Squeak provides a good open source platform, many libraries and third party projects, easy headless deployment of Seaside web applications, etc. Commercial Cincom VisualWorks adds the ability to create small executables, great web services libraries, good support for commercial licensing, etc.

Ruby on the other hand also has a lot going for it: many instant install gem libraries, easy installation of Ruby itself, Rails is a nice web app framework, and the best of all: Ruby is already installed on most servers (and is easy to install otherwise) and deployment of Ruby applications and utility scripts is simple. Also JRuby is a very interesting technology for those of us who need to work in "Java land".

One other big win, Ruby-wise, for me is that (like Python) is such a readable and concise language: meaningful algorithms/programs are often just one or two pages of code - great for digesting other peoples code or when you need to look at old work.

Monday, September 24, 2007

Iranian President Mahmoud Ahmadinejad is not crazy, but his speech irritated me today

The problem that I have with Iran is not that I view them as a threat to my country (USA) or the Middle East: it is that Iran is the second most despised government in the world (behind #1 Israel, and slightly ahead of #3 North Korea in just about every international opinion poll).

I would expect a more conciliatory approach from a leader of a widely despised government (internal human rights, suppression of free speech, an economy that is so bad that their educated population leaves in great numbers, etc.) I don't think that any rational person really views Iran as a real security threat (although Iran is a convenient political issue in my country), but I have real problems with their internal (to Iran) behavior. Re: nuclear power technology in Iran: as long as they continue to be a member in the IAEA and allow inspections, that is good enough for me, but I understand the arguments of other people who don't feel comfortable with this. Unfortunately, incompetent foreign policy by the Bush administration has certainly given Iran more influence in their part of the world, but that is something that we now have to learn to live with - no taking back mistaken actions and policies, and "doubling down" on the bad bet of attacking Iraq, by attacking Iran, would be a horrible mistake (a long shot neoconservative wager that is a true nightmare scenario for the whole world).

I would like to make a more general point:

The world has become a much safer place over the last several decades, based on fewer civilian deaths and a decreasing general level of violence in the world. Also, compared to the constant threat of nuclear annihilation during the cold war, things are definitely looking good right now: something we should be grateful for.

One reason the world has been progressing into a safer place is globalization and interlocking economies. If it were up to me, looking out for the welfare on my own country (USA) but also caring about all people on this planet, I would have more trade, talk, student exchange programs, tourism, etc. with all countries in the world (OK, I don't really don't want to go on a vacation to North Korea, but you get the general idea). The better the flow of ideas, dialog, tourism, and education abroad programs, the better off the world is, and for that reason I would like to commend Columbia University for inviting Ahmadinejad to speak and answer questions today. Ahmadinejad did not make a good impression on me, but I was still glad to hear him. You can bet money that some politicians will try to make political mileage out of this, but they will be acting out of self interest, not for the general good.

Sunday, September 23, 2007

Interesting article on graph/lattice theory leads me to a good looking library

After reading Mark Chu-Carroll's extremely interesting article on using lattices for representing information, I started a hunt for good graph representation and analysis libraries. I looked for Lisp, Ruby, and Java libraries, and found a great looking library written in Ruby (gratr). One caveat: I spent 30 minutes enjoying reading through the library source code, but otherwise I have just experimented with the tests and examples. Thanks to Shawn Patrick Garbett, Luke Kanies and Horst Duchene.

I often find interesting/useful software this way: I get excited reading a good technical paper or blog, and then go and look for relevant software tools.

Saturday, September 22, 2007

Glassfish v2: Update Center and port 4848 Web Admin are cool, but...

Although I have been paid to work on both the Enhydra Enterprise Java application server and on the JBoss based Jaffa framework, I must admit that Tomcat has always been my favorite platform: lean, and add just what I need.

As a result of my 'build up just what I need' preferences, I just got around to experimenting with Glassfish. The Update Center is great, and as more instant install frameworks and applications become available, this will be a time saver. The web admin tool is refined - no complaints there.

I do have one complaint about the 200 MB resident memory footprint. A lot of what I do involves deploying to low cost servers, often semi-managed VPS systems. Smaller memory use is cheaper, but for most large server deployments, an extra 100 MB makes no difference.

I thought that it was very cool that one of the available instant install components is JRuby with the most excellent Goldspike. I have written before in this blog about the ease of running Rails web apps with Goldspike and JBoss. With Glassfish and the Update Center, it is even easier. Cool stuff.

Programming languages: advantages of both specialization and being a generalist

In the 1970s, I very much enjoyed working through Jean Sammet's classic book "PROGRAMMING LANGUAGES: History and Fundamentals". For one thing, it was my first real exposure to Lisp, and it was fun learning many new languages at once. At one point I had over a dozen programming languages on my resume (due to needing to use some one-off languages for military hardware, and several different assembler languages).

Generalization is good because the more experience with different languages, libraries, frameworks, and development styles that you have, then the easier it is to choose a good technology to solve new problems. I would argue that broad experience is at least a little better than narrow but deep experience.

Unfortunately there is another side to this issue: whenever I see really great design and code, it almost always seems to be written by someone who deeply specializes in one, or perhaps two, programming languages.

In the last few years, due to customer requirements, I have had to work in Java, Common Lisp, Ruby, and Python (and a little work with Prolog, and even less fortunately in C++). I am now in my mid-50s, and semi-retired (I try to limit myself to working no more than 25 hours per week). I would like to specialize in just one or two languages and not have the overhead of staying current with a half dozen programming languages.

The language that I enjoy the most is Ruby, and with the maturation of JRuby, it is great to be able to use the same language for scripting and general software development (using Matz's C based Ruby) and when I need to use existing Java libraries and frameworks (JRuby). While I really enjoy Lisp and Smalltalk (never professionally), my hope is that as JRuby continues to get faster and integration with the Java platform improves that the combination of (C or J)Ruby and Java will cover everything that I need for my work. BTW, the comment about future work on a "compiler that allows compiling a given Ruby class 1:1 to a Java class, producing a class you can construct, with specific signatures you can call from Java code" posted by Charles Nutter a few days ago to my JRuby blog article was very good news indeed.

Friday, September 21, 2007

Great combination: nginx, Mongrel, and Rails for secure HTTPS

I had to set up a customer's Rails application to run using SSL+HTTPS this morning. Based on a few positive web blog articles I decided to try Igor Sysoev's nginx web server. If you first build and install OpenSSL and the Perl regular expression library, then build nginx with
you should be all set to use HTTPS. Clustering mongrel is also simple; I used this nginx.conf file from as an example and I was set up and running very quickly. Good stuff!

Thursday, September 20, 2007

JRuby and Jython: a one way street?

This is just personal experience: JRuby and Jython are great when you want to use existing Java libraries and utilities from inside Ruby and Python programs. (Warning: Jython does not implement all of Python: many of my Python programs that use list comprehensions, generators, etc. simply do not work yet.)

However, I am skeptical of the utility of doing the reverse: using modules of Ruby or Python code inside large Java applications. I would like to hear about examples of this that don't just use Ruby or Python as embedded scripting languages.

BTW, since I usually prefer using the native C versions of Ruby and Python, I set up my bash environment to create aliases for running the JRuby and Jython command line tools:
## for Jython and JRuby without messing up PATH and native Ruby and Python:     

alias jython=/Users/mark/bin/jython2.2/jython
alias jruby=/Users/mark/bin/jruby-1.0/bin/jruby
alias jirb=/Users/mark/bin/jruby-1.0/bin/jirb
alias jgem=/Users/mark/bin/jruby-1.0/bin/gem
export JRUBY_HOME=/Users/mark/bin/jruby-1.0
I also edit my jirb and JRuby gem shell scripts to explicitly set the path to jruby. Now I can easily run the JRuby and Jython for just those occasions when I want to use Java class libraries.

Tuesday, September 18, 2007

1. Shameful behavior: ruining our grandchildren's lives because of our generation's greed 2. a story about my Grandmother

This is shameful behavior: the Federal Reserve (privately owned, not part of the US government) dropping interest rates to bail out stock market investors who have made bad investments, Bush's running up the deficit to line the pockets of his cronies, and now the US Congress talking about bailing out stupid homeowners who have acquired bad mortgages and spend stupidly beyond their means. Selfish, stupid behavior that will ruin the lives of so many in future generations.

Past generations were made of better stuff. My Dad sent me an email today with a story that his Mother told him about the death of her father because he was trying to save the financial future of his family:
My Mother told me this story when I was a small child. This was very personal for her, and I remember the emotion in her voice as she related it.

My Mother was born in 1886 on a farm in Illinois. Several photographs have survived of this time. She, with her parents and two smaller brothers, lived in a large, attractive frame house. Photos show a horse-drawn plow working a corn field. I remind you that they would not have had automobiles, telephones, radio, or electricity and central heating in the home. A trip into town meant a ride in the one horse carriage.

During the growing season the work day for a farmer and (older) sons began at daybreak and ended at sunset. The wife and daughters canned food for the long winter months, sewed clothing, and prepared meals for the men. When winter storms came, families could be isolated for extended periods.

My story begins when my Mother was thirteen or fourteen years old (I do not remember the exact date.) It was a very harsh winter, with bitterly cold storms following in a seemingly endless procession. The roads were blocked with huge snow drifts. Without central heat, the family huddled near the cherry red kitchen stove, stoked with coal. Hot water bottles warmed the feet.

Isolated from the rest of the world, each day all anxiously hoped for an end of the storm. Grandfather would put on his warmest clothing and venture out to tend the livestock. It was essential that the cattle and horses be fed and protected from freezing. When Grandfather succumbed to the flu, the family faced a crisis. With a high temperature he became too weak to go out and the family could only pray that the storm end. It did not end, and faced with financial ruin with the loss of the livestock, Grandfather knew that he must go out.

My mother and her smaller brothers waited apprehensively while Grandmother helped her husband up and to dress as warmly as possible. He went out into the howling blizzard-- to return triumphantly. The livestock were saved!

Their relief was shattered when that night his flu turned into pneumonia and Grandfather died. With no one to tend them, the livestock also perished. It was then necessary, come spring, for Grandmother to sell the farm and to move into town.

My maternal grandmother married another farmer and they both lived long lives. My grandmother was in her 90’s when she died.
My father's mother ended up getting a Masters Degree (rare for a woman in the early 1900s), married a minister, lead a financially poor, but happy life, and raised two sons who ended up teaching at Harvard and Berkeley.

Yes, previous generations were made of "sterner stuff" than weak willed people who care more for owning a "McMansion" and a new car every year than leaving a decent world for their descendants.

The New York Times 'gets it'

Oh, the pleasures in life: The New York Times now allows free access to almost all of their material. I used to spend lots of time reading the NYT online, and now that they have re-opened up their material (opinions, etc.) they are back on my very short Bookmarks menu (I use to manage most bookmarks: here are my personal bookmarks).

The NYT has clearly made the decision to go for more readers, and hope that advertising revenue makes up for subscription fees. In a small way, I do the same thing: after writing 14 published books, I put almost all of my writing effort into material that I simply give away for free - not totally altruistic: I earn my living as a consultant and having more people visit my site probably helps my bottom line about as much as book royalties.

While I understand that people working for companies like SAP or Microsoft might have a different viewpoint than mine because of where they see their personal revenue stream coming from, I believe that business and commerce works better when we all build on each other's open source projects, Creative Commons material, etc.

Chris Petrilli's second brain

I always enjoy Petrilli's blog entries (both technical and political), and his discussion today on augmenting our brain's memory capacity with indexed and cross referenced programming manuals, PDF books, etc. seems right on.

I have been more frequently buying PDF books: not as nice to read, but in the future it is great to have indexed and online. Because I mostly use a MacBook with open connections to my customers' servers for most of my work, my MacBook is the home for my "second brain". I have experimented with doing my own indexing and document clustering (naive O(N^2), hierarchical, and k-means), using Spotlight, and using Google Desktop for the Mac. I have settled on using Spotlight, but using the text, HTML, and PDF's in my "second brain" for my own research programming for IR, etc.

Monday, September 17, 2007

Classic "slip of the tongue"

My wife and I were just watching CNN and the host was apparently interviewing a security expert who was giving what I thought was an amazingly one-sided take on the private military company Blackwater's recent bad publicity in Iraq. After sounding like an advertisement for how great Blackwater is she had a "slip of the tongue": when asked what some of the services Blackwater provides in Iraq she said "we protect ...". Notice the use of the word "we". It looks to me like CNN may have been interviewing a Blackwater employee without divulging that bit of information to viewers.

Monday, September 10, 2007

IBM's support for is important

Microsoft Office is one of the principle reasons why so many businesses feel like they are locked into using Microsoft Windows. While I support the rights of Microsoft as a business to try to lock people, companies, and governments into using their proprietary data formats, and thus their software, it is also the rights of people, companies, and governments to fight back for their own best interests.

Proprietary data formats are a losing proposition for users. The lack of assistive technologies for people with disabilities has been a sticking point for wider adoption of - IBM's donation of the time of 35 engineers to work on assistive technologies is a large contribution to both open source and the infrastructure that so many of us build our businesses on.