Posts

Showing posts from June, 2006

Incredible what a few lines of Ruby code will do

Ruby, with great libraries like ActiveRecord and Ferret let you solve problems with just a few lines of code. I had 4 database tables that I wanted to index all fields of each row, and enable a plain text search that would quickly point me back to the table name and row index. The indexing takes about 20 lines of code and took less than 10 minutes to get working: class CreateIndex def initialize @index = Ferret::Index::Index.new(:path => './search_index') ActiveRecord::Base.establish_connection( :adapter => 'postgresql', :host => 'localhost', :username => 'postgres', :database => 'test_database') process_class(Item) process_class(Plan) process_class(Procedure) process_class(Visit) @index.close end def process_class the_class the_class.find_all.each {|obj| doc1 = Document.new doc1 << Field.new("text", obj.attributes.values.join(' '),

30 minute lesson on the Middle East

I saw this video linked from Reddit this morning It is a 30 minute 'mosaic' of news broadcasts from Palestine, Israel, Iraq, Iran (all soccer coverage), Jordan, and Tunisia. Personally, I take all news broadcasts (especially in my own country :-) with lots of skepticism (everyone pushes their own agenda), but still seeing this 'mosaic' helped me to get more of a feeling for the Middle East. One warning: I suggest that you skip over the first 2 minutes of the broadcast - sad and bloody footage of a family killed on a Gaza beach. Here is the Google Video blurb on this video: The Peabody Award-winning Mosaic features selections from daily TV news programs produced by national broadcasters throughout the Middle East, translated when necessary into English. Link TV is an independent national network providing Americans a global perspective on world issues and cultures, now available in one out of four US homes. PS. am I the only one who finds it strange that a show on Comed

New version 350 of PLT Scheme

Here is the download page New features include an easy option for generating standalone applications that have all dependencies bundled in and a just in time compiler. Cool stuff. I prefer Common Lisp for application development, but Scheme is a great language and PLT Scheme is one of the best free development kits - includes lots of useful libraries, web application and web services support, etc.

A good free Ruby book/tutorial

For the last couple of years, Ruby has been my favorite programming language (I still often use Common Lisp for performance reasons and Java when it is requested). I just saw a link to a neat little free PDF web book on Ruby that looks good for recommending to people who want to learn the basics of Ruby in an hour or two. The guy who wrote this has also written a plugin to VisualStudio 2005 for Ruby development.

So, how are they making money on this?

I just spent some time uploading more travel pictures to my Flickr collection and uploaded to Google Video several short videos clips that I took in Africa and India several years ago: Samburu dancers, Kenya Africa Samburu school children singing, Kenya Africa Elephants, Kenya Africa (30 seconds before a male elephant charged us) Crocodiles being fed chickens, Samburu Lodge bar, Kenya Africa Dancers in Kochin India While I appreciate the free services, where is the profit? I do understand the value in collecting information on people, but I wonder if some web services like Google Video and Flickr will always be loss-leaders.

More work combining Ruby and Common Lisp

I am doing a lot of coding using both Lisp and Ruby for my current project. I am finding interop between the languages to be especially easy because of the dynamic nature of both languages. When I use REST style calls I can dynamically create classes and instances just from the XML so changing classes in one language does not break code in the other.

A simpler, more directed Microsoft under Ray Ozzie

Ozzie has been fairly public about his simpler approach to software development: simpler product with clear goals and on-time delivery to market. I think that this is just what Microsoft needs. Another thing that Microsoft needs to do is to go on a subscription based business model for Windows and Office. I have written about this several times in the last two years: higher software complexity caused by adding features that most of us probably do not want. I use Windows (in addition to OS X and Linux) in my work, and the thing that I want is stability and security. If Microsoft received a small yearly license for Windows use and a larger license fee for Office use then they could just concentrate on quality and simplicity of use - not adding features to (try to) force software upgrades. Everyone wins.

Meta object protocol in Lisp and Ruby

One thing that I like about Common Lisp and Ruby is the ability to examine class definitions, etc. at runtime. I have several model classes in a Common Lisp application and I want to implement a web services API for my application that in some cases returns model objects to the requester. I wrote a very short utility function today that takes any class instance looks up all of the slot names, and then gets the slot values. I output to an XML stream. I don't have to manually change any code to marshall any of my classes to XML if I change the model class definitions.

Comparing Google's Picasa Web to Flickr

I find the Picasa photo organizer to be almost perfect, except for not having a Mac version. I set up a gallery of my travel pictures on Picasa Web a few days ago. The first thing that struck me was how easy it is to export folders to the web portal. You get 250 megabytes of storage for free, and can purchase much more for $10/year. I uploaded my pictures in medium resolution (roughly 1024x778) so I only used about 1/5 of my free storage. I have had a Flickr photo site for a long time and I plan on keeping both sites, at least for now. (I link to both Picasa Web and Flickr on my main web site). I think that the web interface for managing photos is better for Flickr, but Picasa Web is also very easy to use and was only publicly released this week - I am sure that it will get even better. I requested a Picasa Web invitation early in the morning the day it was released and I received an invitation within a day. I don't know what the waiting time is now. Google may want only a relati

Different doument types, different work flows

I keep everything that I do in a subversion repository. Even though subversion can diff binary files like Word documents or OpenOffice.org ZIP file enclosures for documents, I still like as many of my design artifacts to be plain text as possible. Now, I do keep lots of binary files in repositories, especially when working on book projects, but I do have a strong preference for text files. I also like my design artifacts to look good , even if I am the only person who sees them. Two highly recommended tools are AbiWord and OmniGraffle because their default file formats are plain XML text files. I admit that disk space and network bandwidth are close to free now but I still like to keep a project directory small. By using design tools that have small file footprints, most projects (source files, build scripts, tests, and design artifacts) are small and tidy.

Saving time with Ruby and ActiveRecord

I am working on a project that has many disparate data sources, and before I can do the interesting AI part everything needs to be normalized into our object models. Usually, this would be a mountain of work, but I am finding that using Ruby scripts with the ActiveRecord library is saving lots of time. I am basically taking advantage of both the dynamic nature of Ruby and the dynamic ORM functionality of ActiveRecord to cut the amount of required code (compared to say Java) by a large amount. Ruby on Rails has a deserved reputation for saving time on web application development, but you should really consider ActiveRecord a separate part of Rails that can be used standalone.

Yes, the world is probably a safer place

I think that compared to the cold war era the world is now probably a much safer place. Think about this: as much as the Bush administration for political reasons wants Americans to be scared (easier to control) of terrorist threats, compare the possible danger of terrorist attacks with a cold war-style nuclear war that would probably kill most of us. Sure, the world is a dangerous place, but I think that the situation is improving even with obvious recent setbacks due to the clumsy policies of the Bush administration. On a similar topic: have you actually read the text of what Mark Malloch Brown, the British Deputy UN Secretary-General said? Not much at all, and in my opinion definitely not an attack on the American people that John Bolton (US envoy to the UN) has been claiming. Bolton is a neoconservative who has been critical of the UN for years. I also have issues with the UN, but I believe that it is still a good investment - dollars paid for some peaceful results. I think the que

A sad day for the U.S.

Another nail in our economic coffin: U.S. loses again in competitiveness against the rest of the world. Largely along party lines, House Republicans shafted the people of our country, to the benefit of a very few corporations that are probably no longer even American companies - most large corporations have by now registered off shore to limit taxes and liabilities. The "net neutrality bill" would have helped the U.S. stay competitive with the rest of the world, but I guess that the soft money contributions ("bribes") of corporations wanting to limit the utility of the Internet to American entrepreneurs and businesses for some short term gains paid off. When a large corporation bribes ("soft money campaign contributions") members of Congress, I wonder what their rate of return on "investment" is. What ever happened to doing what is best for our country? In my opinion, this is corruption, plain and simple.

Wow! Google Spreadsheet web app: very cool!

I have not spent too much time with the new spreadsheet web app but I did load a medium size Excel file, and everything went well. The real thing here is shared editing with built in chat for collaboration. I live in a remote area, so things like video conferencing, Skype conference calls, and now shared editing and viewing of spreadsheets all help reduce the business and technical costs of working remotely.

I am on Microsoft's side on this one

OK, the sky is not falling - I'm allowed to side with Microsoft occasionally: why should Adobe be allowed to prohibit Microsoft from adding PDF output to Office when Apple and OpenOffice.org can use an open format (PDF)? I was so angry with Microsoft last year over their position on open document standards like Open Document Format that I sold my Microsoft stock (yeah, like that hurt them). I still dislike what I think is Microsoft's business model: keep adding features that few people want, force upgrades, mess people up with incompatible file formats, etc. I have said this before: Microsoft should operate on a subsciption model: charge users $25 per year for Windows and perhaps $75 per year for Office. They could play nice with file format standards. They could stop adding features and just produce stable products.