
Monday, December 18, 2006
The Eclectic Ruby Group

Saturday, November 25, 2006
Google Maps on Rails

Here are some of the links I found particularly useful while building this.
- Google Maps API
- Rails Docs
- Selenium on Rails (Test that javascript too!)
- Selenium IDE (Save time writing those selenium tests)
- Firebug (Direct access to a javascript console and the DOM in firefox)
- Rails on Apache2 and fcgi (Setting up rails and Fcgi is like getting a molasses enema, it takes a long time and frankly it is just gross.)
Thursday, November 16, 2006
Mike Culver, Amazon Web Services, and Mechanical Turk.

Sunday, October 29, 2006
Ubuntu's Edgy Eft Breakage

- ATI 3D acceleration broken
- VMware broken
- Problems with wine over VNC
I had to waste a couple hours troubleshooting this stuff, which I don't like to do, but I got it all (mostly) figured out. These problems look like they would only affect a tiny minority of users, but I tripped over them and thought perhaps this would be useful to someone else.
Thursday, October 12, 2006
Random bumps along the smooth ruby way
I think this bitter old grouch, venting about ruby, gets alot right. Be sure to read past the headings of his five complaints. He actually has some legitimate gripes.
Do I have gripes about Ruby? At this point I don't know enough about Ruby to be sure that any gripes I have are legit. I found the above link while trying to figure out why REXML was so slow. I thought I was doing something wrong. Turns out you if you are trying to read in a large XML file with REXML, you are just doomed. JAXP is several orders of magnitude faster, although I couldn't find any benchmarks to back this claim. REXML works fundamentally differently from JAXP. REXML uses regexes to parse while I think JAXP parses at a lower level. That being said, REXML is sooo much easier to use than JAXP, so if your file size is small, it isn't so bad. I wonder if using jRuby to access JAXP would be an interim solution to this for ruby programmers.
Another gripe I have is with Rails fixtures. I find that making multiple tests dependent on a set of fixtures will make your tests brittle. If someone writes a new test and adds to the fixtures to support it, often you find tests will break because of it. If you are vigilant about it you can probably always write a test that won't break when someone adds
Do I have gripes about Ruby? At this point I don't know enough about Ruby to be sure that any gripes I have are legit. I found the above link while trying to figure out why REXML was so slow. I thought I was doing something wrong. Turns out you if you are trying to read in a large XML file with REXML, you are just doomed. JAXP is several orders of magnitude faster, although I couldn't find any benchmarks to back this claim. REXML works fundamentally differently from JAXP. REXML uses regexes to parse while I think JAXP parses at a lower level. That being said, REXML is sooo much easier to use than JAXP, so if your file size is small, it isn't so bad. I wonder if using jRuby to access JAXP would be an interim solution to this for ruby programmers.
Another gripe I have is with Rails fixtures. I find that making multiple tests dependent on a set of fixtures will make your tests brittle. If someone writes a new test and adds to the fixtures to support it, often you find tests will break because of it. If you are vigilant about it you can probably always write a test that won't break when someone adds
Monday, October 2, 2006
Beware the IDEs of Ruby.

Sunday, September 24, 2006
Continuous integration for Ruby

What I like about Cerberus is that it is very simple to use. To install it you just do 'gem install cerberus'. Once installed you run the command 'cerberus add' followed by the repository URL, the name of the app, and a list of people who should get the emails. Finally you can run 'cerberus buildall' and Cerberus will run some rake tasks to build and test your project. It is very simple! Since cerberus isn't a persistent server it relies on cron for the automation, but for me that is just fine. There are some yml configuration files, but they are very minimal. You should have no problems figuring it out. I would have liked some more documentation because I bet there are some features not covered in the README, but overall I can't complain. I had continuous integration up and running in minutes. If you are looking for CI in Ruby, you should give Cerberus a shot. I think the ease of use will win it many fans in the future.
Wednesday, September 20, 2006
Subversion build labels in CruiseControl

I spent some time last week learning about setting up CruiseControl. My motivation was to figure out how to make the subversion revision number part of our build number. Example: say we are on build number 101, cruise kicks off and does a checkout. The code gets updated to revision 1001. That means the build number becomes 101.1001. This mapping from build to revision is useful. Say you had delivered build 85 to the customer, and there is a bug. In order to look at the code in production you need to update your working copy to the production build. If you don't have the revision in the build number you have to go rummaging through logs to find which revision build 85 is, or you can checkout the branch that cruise creates for each build, but for large codebases, that is time consuming. With the build-revision style label you can quickly update to that revision.
Making this happen should be easy, right? Just write a build labelIncrementer plugin that gets the SVN revision. The catch is that in cruise control build numbers are calculated ahead of time. I had made an unfortunate assumption that the build label was calculated at build time and so I wrote an entire plugin to calculate the label I wanted. Then I realized it would never work. Of course this behaviour is documented, but I wasn't bright enough to read that ahead of time. Here is the code to my SVN LabelIncrementer. You can use it but you might be disappointed when your revision numbers in the label are from a previous build. Or you can just skip ahead and read how I ended up satisfying my requirement without writing a plugin.
Monday, September 11, 2006
The ultimate blog post

"Blog" itself is short for "weblog," which is short for "we blog because we weren't very popular in high school and we're trying to gain respect and admiration without actually having to be around people."Along with a really creative short explanation for the origins of the blog, this article has satirized the style of blogging on many of the most popular weblogs. In the realm of blogs, where hubris and grammatical errors are numbers 2 and 1 respectively on the list of things you always see, this was a refreshing read.
Sunday, September 10, 2006
Linux taking over the desktop?
Will tux make his Superbowl debut?
I saw this quote on slashdot.

I saw this quote on slashdot.
A Harvard Study which uses formal economic modelling to determine "Will OSS ever displace traditional software from its market leadership position?" came to a (not so?) surprising result. Linux is likely to remain second best as long as Microsoft has a first mover advantage.Did anyone at Harvard consider the fact that Linux isn't trying to compete with Microsoft? When was the last time you walked down the street and glanced up to see the word "Linux" on a billboard in letters 20 feet tall? The last time you saw Tux the penguin in a Super-Bowl halftime commercial? Never, because the people who create Linux aren't trying to sell you anything. I predict that Linux will continue to quietly out-do Windows for years to come, and I'm looking forward to never spending any money on it. Hooray for free software!
Thursday, September 7, 2006
Tile Toy is for real!
Tiletoy, for real this time
A while back I wrote an entry on Tiletoy, an open project for building some mini networking toys with a sort of retro-chic look. The site had claimed that they were going to release everything under some form of open license so that people could build their own Tiletoys, but the date for releasing that came and went without any news. Today I googled for Tiletoy and look what popped up! Totally awesome! Too bad the site is a flash site. Annoying. I don't see what they need flash for. Anyway, this is great news, and even after reading their discouraging checklist I am undaunted. (I can't link to specific pages of their site because their site is flash trash and does some lame url rewriting, so I reproduce it here)

The Lawrence Connection

Talking with Adrian was fun because he used to live in Lawrence, Kansas, and so did I. In fact, the Django framework was developed there. Talking with Marcel was also interesting, and the conversation veered strangely to Lawrence. He seemed to know alot about the town, the university there, and the fact that Django was developed there. I suppose there is no real connection between him and Lawrence, but I'm interested to see who will pop up for the next Chirb meeting. It is turning out to be a real Lawrence party.
Sunday, August 20, 2006
Unit tests are a newbie's best friend.

require 'book'
class BookTest < Test::Unit::TestCase
def test_book_creation_works
war_and_peace = Book.new("title" => "War and Peace")
war_and_peace.save
mystery_book = Book.find_first "title = 'War and Peace'"
assert war_and_peace.title == mystery_book.title
end
def test_unit_tests_are_independent
mystery_book = Book.find_first "title = 'War and Peace'"
assert mystery_book == nil
end
def test_book_requires_a_title
bitter_ejb = Book.new
assert !bitter_ejb.save
end
end
It is too bad that a tool this useful and simple isn't something recommended to beginners early on. I am picturing programming 101 being test driven from now on. Perhaps it is time to retire "Hello, World!" in favor of an assertion. assertEquals("Hello, World!", atom.greeting()); A new programmer's first task will be a green bar, not a println.
Monday, August 14, 2006
Return to Javaland
Sequels are usually a bad idea.

A few months back I was reading a blog entry by Darren Hobbs entitled, A bad citizen in Javaland. It is a really creative description of a day in the life of an object. This particular object is a bad citizen because it violates some basic rules about good object oriented code. For example, when the object climbs on top of a car like it is a motorcycle it is trying to cast an abstract object to the wrong concrete type. When the object reaches under the hood, grabs the engine and reaches into the engine to grab the starter. The object is violating encapsulation and not using the given interface, in this case the ignition switch, to start the car.
Thinking about good objects vs. bad, it strikes me that to a certain extent an object can only be as good as the classes it depends on. Just like adding one good citizen to a maximum security prison does not a utopia make, one beautiful and well tested class will not make a large codebase much better (although you have to start somewhere). As I considered relationships and dependencies I went back to Darren's excellent description of Javaland, and I couldn't help but try my hand at writing a sequel. Here goes. Sorry Darren.

A few months back I was reading a blog entry by Darren Hobbs entitled, A bad citizen in Javaland. It is a really creative description of a day in the life of an object. This particular object is a bad citizen because it violates some basic rules about good object oriented code. For example, when the object climbs on top of a car like it is a motorcycle it is trying to cast an abstract object to the wrong concrete type. When the object reaches under the hood, grabs the engine and reaches into the engine to grab the starter. The object is violating encapsulation and not using the given interface, in this case the ignition switch, to start the car.
Thinking about good objects vs. bad, it strikes me that to a certain extent an object can only be as good as the classes it depends on. Just like adding one good citizen to a maximum security prison does not a utopia make, one beautiful and well tested class will not make a large codebase much better (although you have to start somewhere). As I considered relationships and dependencies I went back to Darren's excellent description of Javaland, and I couldn't help but try my hand at writing a sequel. Here goes. Sorry Darren.
Wednesday, August 9, 2006
Buildix: Garage Band Agile Development
Buildix: the geek equivalent of having the wall of sound in your garage.

You say you can write a bitchin hello world application? Your operating system has recently come down with a kernel? You don't know what IDE stands for, but your computer has just developed one of those too? Hello there Mr. or Mrs. Rock$tar! It sounds like you are ready to tackle your first software project. But wait. Don't be like so many other clueless hacks out there. If you are going to do this, do it right. Have some pride. Distinguish yourself. "How?" you ask. Simple, make your first software project an Agile software project. C'mon... Everyone's doing it. And besides there is a new way to get started, and it is easier than power chords on a Fender Squire. So gas up the van, gather up your band, cinch up those leather pants, and prepare to make rock, er, software history.
I just downloaded Buildix which is a Debian based distro specifically for running agile projects. You can go from zero to a finished CruiseControl build in under five minutes! Not only is it an easy install, but Buildix is also a live CD which is nice for doubting thomases who want to try before they buy. Don't sweat the download either. It is pretty light, weighing in at just over 350 megs. All of this is great news for aspiring Agile Rock$tars everywhere. Even if you are faking it, at least you look good doing it. So go check out the Wikipedia page on Buildix I just created. Download the ISO, and turn the volume up to eleven. Rock on!

You say you can write a bitchin hello world application? Your operating system has recently come down with a kernel? You don't know what IDE stands for, but your computer has just developed one of those too? Hello there Mr. or Mrs. Rock$tar! It sounds like you are ready to tackle your first software project. But wait. Don't be like so many other clueless hacks out there. If you are going to do this, do it right. Have some pride. Distinguish yourself. "How?" you ask. Simple, make your first software project an Agile software project. C'mon... Everyone's doing it. And besides there is a new way to get started, and it is easier than power chords on a Fender Squire. So gas up the van, gather up your band, cinch up those leather pants, and prepare to make rock, er, software history.
I just downloaded Buildix which is a Debian based distro specifically for running agile projects. You can go from zero to a finished CruiseControl build in under five minutes! Not only is it an easy install, but Buildix is also a live CD which is nice for doubting thomases who want to try before they buy. Don't sweat the download either. It is pretty light, weighing in at just over 350 megs. All of this is great news for aspiring Agile Rock$tars everywhere. Even if you are faking it, at least you look good doing it. So go check out the Wikipedia page on Buildix I just created. Download the ISO, and turn the volume up to eleven. Rock on!
Monday, June 26, 2006
Usefull linux commands
Here is some command line judo I don't want to forget
- How to delete a specific file recursively. This is particularly useful for getting rid of things like .svn folders.
find . -name .svn -exec rm -rf {} \;
- How to connect to your mysql db as root 'mysql -uroot mysql'
- This sql will set root's password to abc 'UPDATE user SET password=PASSWORD("abc") WHERE user="root";'
Saturday, June 3, 2006
Linux Lotus Notes
It's bad enough to have to use Lotus Notes, at least spare me from Windows.
Ubuntu/Kubuntu "Dapper Drake" has been released and I'm running it on my work laptop. One program I could live without but can't work without is Lotus Notes. Fortunately Notes runs under Wine, and I've been using it that way for about 4 months. All was well until yesterday when I upgraded from the Breezy Badger to the Dapper Drake. The new version of wine included broke Notes.

Wednesday, May 17, 2006
Bobby Fischer was a good old boy
How Richard Pyle invented the game of chess-a-hol

Chess is a game, or a record label, and I think it is a type of pie, but mostly it is a game. Depending on who you believe it is between 1400 and 2200 years old, and the rules have been in continuous change throughout that time. One particularly alcoholic variation I recently discovered is called Chess-a-hol. I got the rules from The Campbell Report.
Chess-a-hol - (These rules were described on the local country station here in Southern California.) To play, all standard chess rules apply with the following additions and exceptions.

Chess is a game, or a record label, and I think it is a type of pie, but mostly it is a game. Depending on who you believe it is between 1400 and 2200 years old, and the rules have been in continuous change throughout that time. One particularly alcoholic variation I recently discovered is called Chess-a-hol. I got the rules from The Campbell Report.
Chess-a-hol - (These rules were described on the local country station here in Southern California.) To play, all standard chess rules apply with the following additions and exceptions.
- If you're going to move, and you must move, you have to drink a shot of beer to start your move.
- If you touch a piece and choose not to move it, you have to drink a beer before you can move another piece.
- If you touch your opponent's piece without taking it, or when you can't take it (without announcing adjusting), you have to drink it's contents (bartender will refill it so game can continue).
- When a piece is captured, owner of lost piece must drink its contents.
- When either side castles, a "Royal Toast" must be done by everyone (including spectators). A "Royal Toast" is a 6 oz. glass with 2 ounces Triple-sec, 2 ounces Grenadine, 1 oz Vodka, 1 oz Rum.
- When checkmate occurs, the winner drinks the contents of the checkmated King; the loser drinks the contents of all pieces left on board.
Friday, April 14, 2006
BAAAD MOFO
How Baaad Is Yours?

Last night I made a sandwich. No, it wasn't a sandwich. That would be like calling A 7 million ton cruise ship with 15 restaurants, 18 swimming pools, 4 beauty salons, 8 butcher shops, 2 locksmiths, a tantric sex school, and a homeless shelter a dinghy. This was like a dagwood but better. I cut open a nice sourdough roll and spread on some Dijon, then put a layer of arugula. I topped that with some hot, cripsy, greasy bacon. Then I got out an avocado and smooshed it on there. Finally, for good measure I threw in some anchovies, salt, and freshly ground pepper. That makes it a Bacon, Avocado, Anchovy, Arugula, Dijon sandwich. In the same genus as a BLT, but a different species, we call it a BAAAD sandwich for short. I highly recommend them if you, like me, don't have enough salt and fat in your diet (can you ever have enough?). There are other things you can do to make yours more or less BAAAD. Adding artichoke hearts or Asparagus for example would make it BAAAADer, and Adding Ahi tuna steak would make it go from BAAAD to worse.
Ok. I think I've abused this sorry excuse for a sandwich joke enough. I was serious about the sandwich though, it is good. Try it. Maybe some lemon juice would be good too? I don't know. Buon Apetito.
Sorry about the picture, I'm not trying to pay homage to japaneese woodblock prints by cutting off the subject in the foreground, it's just that I broke the viewfinder on my camera and composing shots is hard.
Last night I made a sandwich. No, it wasn't a sandwich. That would be like calling A 7 million ton cruise ship with 15 restaurants, 18 swimming pools, 4 beauty salons, 8 butcher shops, 2 locksmiths, a tantric sex school, and a homeless shelter a dinghy. This was like a dagwood but better. I cut open a nice sourdough roll and spread on some Dijon, then put a layer of arugula. I topped that with some hot, cripsy, greasy bacon. Then I got out an avocado and smooshed it on there. Finally, for good measure I threw in some anchovies, salt, and freshly ground pepper. That makes it a Bacon, Avocado, Anchovy, Arugula, Dijon sandwich. In the same genus as a BLT, but a different species, we call it a BAAAD sandwich for short. I highly recommend them if you, like me, don't have enough salt and fat in your diet (can you ever have enough?). There are other things you can do to make yours more or less BAAAD. Adding artichoke hearts or Asparagus for example would make it BAAAADer, and Adding Ahi tuna steak would make it go from BAAAD to worse.
Ok. I think I've abused this sorry excuse for a sandwich joke enough. I was serious about the sandwich though, it is good. Try it. Maybe some lemon juice would be good too? I don't know. Buon Apetito.
Sorry about the picture, I'm not trying to pay homage to japaneese woodblock prints by cutting off the subject in the foreground, it's just that I broke the viewfinder on my camera and composing shots is hard.
Wednesday, April 5, 2006
ACK, acronyms.
TATO (The Acronyms are Taking Over)

So I was in the forum when I came across the acronym POI. She said it meant person of interest. I had never heard that one. I thought it meant point of interest. With that in mind I went to an acronym dictionary to find evidence that she had just made up this acronym. Ah HA! I was right! POI stands for point of interest, but scrolling down the list of possible meanings I found out that she was right. It also means person of interest. That is a bit confusing, but brace yourself because the dictionary lists 29 other meanings for POI. Here are my favorites.

So I was in the forum when I came across the acronym POI. She said it meant person of interest. I had never heard that one. I thought it meant point of interest. With that in mind I went to an acronym dictionary to find evidence that she had just made up this acronym. Ah HA! I was right! POI stands for point of interest, but scrolling down the list of possible meanings I found out that she was right. It also means person of interest. That is a bit confusing, but brace yourself because the dictionary lists 29 other meanings for POI. Here are my favorites.
- Point(s) Of Interest
- Poor Obfuscation Implementation
- Penguin on Ice
- Proof of Identity
- Products Of Inertia
- Probability Of Intercept
- Position of Interest
- Polygons Of Interest
- Point of Impact
- period of interest
Wednesday, March 8, 2006
Rudyard, I'm in India!!
A big literary hug for Rudyard Kipling.

Rudyard Kipling was a British author and poet born in India. He is best known for The Jungle Book (1894) and Kim (1901). I read Kim about 6 years ago. It was my first encounter with Kipling, and I never forgot it. The story takes place here in India, and is as much about the location as it is about the adventures of young Kim. That was also my introduction to India, and it set my expectations for this trip. Just for the record, basing your expectations of a country on an account that is over 100 years old is silly. Years later I read some of Kipling's short stories. My favorite of these is Without Benefit of Clergy, an amazingly sad story of a British officer stationed in India who has a child with an Indian woman.

Rudyard Kipling was a British author and poet born in India. He is best known for The Jungle Book (1894) and Kim (1901). I read Kim about 6 years ago. It was my first encounter with Kipling, and I never forgot it. The story takes place here in India, and is as much about the location as it is about the adventures of young Kim. That was also my introduction to India, and it set my expectations for this trip. Just for the record, basing your expectations of a country on an account that is over 100 years old is silly. Years later I read some of Kipling's short stories. My favorite of these is Without Benefit of Clergy, an amazingly sad story of a British officer stationed in India who has a child with an Indian woman.
Tuesday, February 28, 2006
The Thoughtworks Interview

The Death Star as a metaphor.
Today in TWU we were talking about the Thoughtworks interview process, and the trainer was soliciting ideas for good interview questions. During class I didn't come up with anything, but someone else came up with this, "In what way is the DEATH STAR a metaphor for software development?" The question was a recycled joke from earlier in the week, but it got a few laughs, and someone actually came up with a good answer,
Q: "In what way is the DEATH STAR a metaphor for software development?"
A: "They Deployed it before it was complete, and on the first production run it blew up."
Monday, February 6, 2006
Thoughtworks University
I've got a new job and i'm goin to India.

What happens when you mix agile development and gettin jiggy? You get Agiggly development. I don't know what the hell that means, but I am going to Thoughtworks University to learn all about Agile. Once I know that I'll be one step closer to Agiggly development. Will I write about it? I probably won't be able to think of anything funny enough so probably not. Buisness as usual here, but I will give you a link to the photo gallery documenting the trip.

What happens when you mix agile development and gettin jiggy? You get Agiggly development. I don't know what the hell that means, but I am going to Thoughtworks University to learn all about Agile. Once I know that I'll be one step closer to Agiggly development. Will I write about it? I probably won't be able to think of anything funny enough so probably not. Buisness as usual here, but I will give you a link to the photo gallery documenting the trip.
Monday, January 30, 2006
Automounting with KDE and Debian
Mount your media in one easy step.

Most people who install Linux probably don't have any problems with the KDE automounting functionality, but I don't install Linux like most people. I like to start out with a completely minimal install, then I can add just the packages I need one step at a time. This has 2 advantages: first is that your install takes up very little disk space giving you a very lean and mean system, second is that you become familiar with all the various packages installed on your system and have a better idea of what they do which comes in handy sometimes. The major drawback is that some things that "just work" on most linux installs don't want to work for me. It is usually just a question of dependencies and configuration though, and with a little research and digging you always get it working in the end.

Most people who install Linux probably don't have any problems with the KDE automounting functionality, but I don't install Linux like most people. I like to start out with a completely minimal install, then I can add just the packages I need one step at a time. This has 2 advantages: first is that your install takes up very little disk space giving you a very lean and mean system, second is that you become familiar with all the various packages installed on your system and have a better idea of what they do which comes in handy sometimes. The major drawback is that some things that "just work" on most linux installs don't want to work for me. It is usually just a question of dependencies and configuration though, and with a little research and digging you always get it working in the end.
Thursday, January 12, 2006
Lucene: Boosting, Multi-Field Searches, and Multi-Index Searches.
3 Completely Obvious Lucene Tricks

Look out below! Here comes another braindump, and it's all about Lucene. There are three tricks to using Lucene that I am going to illustrate here. I don't think they really qualify as tricks since there is nothing tricky about them, but if you are just getting started with Lucene it is nice to know they are there.

Look out below! Here comes another braindump, and it's all about Lucene. There are three tricks to using Lucene that I am going to illustrate here. I don't think they really qualify as tricks since there is nothing tricky about them, but if you are just getting started with Lucene it is nice to know they are there.
Subscribe to:
Posts (Atom)