Friday, March 24, 2006

Free software for economists

Now that I have a blog (zero comments still...), I thought it'd be nice to get a Googlepage. So I did, and to get things started, I compiled a list of free and open source software for economists, with links to the relevant Web pages, and comments on each package based on my own direct experience.

Actually, this list should be useful to anybody who has to deal with math on a daily basis; this includes, well, mathematicians, statisticians, physicists, etc. However, my sense is that these folks are way ahead of us economists when it comes to using powerful, featureful free software. And there's no reason why they should be having all the fun!

The current list is not meant to be exhaustive. If you know and use a package that is not listed, please let me know by dropping a comment here. In general, constructive criticism is much appreciated. Thanks!

Wednesday, March 22, 2006

Ruby noob

Caution: this is a computer-related posting, so skip it if you are not interested. It's a neat trick I learned a while ago, and it's served me well. I'm sure it can be improved in many ways, but at least it has helped me learn a bit of Ruby.

Problem: I usually keep my office PC and my Mac laptop synchronized using rsync. I do something like

rsync -e ssh -auvz <office>:<dir> <dir>

when the most recent changes are on the office PC, and

rsync -e ssh -auvz --exclude=".DS_Store" <dir> <office>:<dir>

when I finish working on the laptop and want to sync up everything ot my office PC. The additional "exclude" is necessary to avoid copying files created by the OSX Finder in practically every directory, and for which Linux obviously has no use.

Anyway, the other day I forgot this "exclude" thingy, and as a result my office PC was littered with .DS_Store files all over my working directories. How to get rid of them (short of hunting them down manually)?

I knew about Python's os.walk, but could something like that be done in Ruby, which for some reason I find more compatible with my way of thinking? YES! Here goes:

require 'find'
require 'FileUtils'

Find.find("top_level_working_directory") do |path|
FileUtils.rm(path, :verbose => true) if path[-9..-1]==".DS_Store"
end


This thing recurses through all subdirectories, starting with top_level_working_directory and passes each file to the block, which then performs the required deletion if the (full) path matches the loathed pattern.

I am sure there are other ways, including turning this into a one-liner (I still launched irb and did things by trial and error), but this Worked for Me (TM).

Welcome!

So I thought about it for a long time, and finally decided to take the plunge: I'll start my own blog. Wouldn't it be nice if I could quickly post a thought or two about my current job-related obsession? About my long-running love affair with computers and technology? About politics and current events... no, maybe not that.

There is, of course, the pretension that somebody will actually read this stuff. That would be great! I guess I should let Mom and Dad know about it... A famous Italian novelist used to joke about his "twentyfive readers". In my case, this would be a wild exaggeration; a couple of readers would be nice though... Bottom line: if you stumble upon this blog, feel free to peruse the Comments section.

Also, quite a few famous economists (more! and more!) have been writing successful blogs. Again, I don't dare hope to have even a fraction of their readership. After all, I may be an economist, but I'm certainly not famous, by any stretch of the imagination. I do hope though that, should an economist happen to drop by, he or she won't feel like this blog is the sort of thing that gives economics a bad name...

In short, I apologize in advance to any and all. I'll try to keep my posts short; I'd like to promise they will be frequent and entertaining, but I don't know yet whether I'll have the required energy and motivation. This is very much an experiment, so please be patient.

Thank you for tuning in, and see you soon!