Archive for the ‘AudioBeta’ Category

Meaningful Debugging Output

Monday, May 8th, 2006

It always pleases me in an odd way when I get way more output than I had expected (usually through lack of thinking). Like this:

Debugging Ouput

Why I Like Darcs

Sunday, April 30th, 2006

I came into revision control from a rather unusual path these days: RCS. We use RCS at work to manage FrameMaker and DocBook content with hard locking, and it still works remarkably well. At the early days of AudioBeta, now GiraffeGiraffe, we were using CVS for code, but the codebase was pretty small and I convinced Daniel and Altay to try out darcs (skipping SVN altogether). We’ve been using it since November or December now.

In the intervening months, I’ve been extremely happy with darcs, especially the:

  • ease of setup (darcs intialze && darcs add *)
  • ability to commit patches without being on the internet
  • stability (I only broke it once, and I think it was my fault)
  • portability (works on our Unix, Linux, Mac, and Windows boxen)

Here’s what I don’t like about Subversion (perhaps because I don’t know enough), especially since I’m more used to darcs:

  • Way too hard to start a repo, I don’t think I can even do it at work without being a sudoer. I want to be able to put even the smallest stuff into revision control trivially.
  • I want to be able to commit patches internally without forcing them down others throats. Because darcs is decentralized by design, I can commit patches (darcs record) without sending them to anyone else. When I’m ready to share, I can submit a whole bundle of patches to our de-facto central repository for sharing with others (darcs push [another repository])
  • Why can’t I review the commits and decide whether I want them? darcs allows me to view a diff while I’m pulling patches (essentially svn up and then accept or decline patches as I see fit.

This last point, the one on reviewing patches, has allowed me to do impromptu code reviews on everyone’s patches (when I pull them), which has helped me learn the rest of the application much better than any other method (more on this later, someday).

Just to be complete, darcs bummers:

  • Really slow and inefficient at moving patches over SSH
  • Takes a long time to commit big files (don’t use darcs if you’re writing in a really verbose language or can’t otherwise break up your code into nice chunks)

More on darcs here: http://abridgegame.org/darcs/

Merry Regex

Saturday, December 24th, 2005

For whatever reason (actually I have a very good idea what the reason is, and it’s that in vim I can easily adapt a regex by watching highlighting), I write regexes in vim much more easily than in Ruby or Perl. vim‘s regexes are powerful, but annoying because of how many characters you have to escape /? /) /( /+, etc. My good feeling from today:

Before:
Before Regular Expression

After:
After Regular Expression

:-)

Moving Offices

Friday, December 23rd, 2005

We moved offices today, away from our two month stint in Inman Square to a place by my office, here. The new place is probably a mixed bag for us… We really liked the location, windows, and size of the old place, but didn’t really enjoy the noise of the traffic. The new place won’t have traffic, but since it’s an old porn studio, it’s got a very open floor plan. This comes into play when we realized we’d be sharing it with another startup, who are probably quite a bit louder than we are. That said, beggars can be choosers.

The new place:YC

The floorplan:YC Floorplan

FreeBSD Success

Friday, December 23rd, 2005

So, I did finally manage to get FreeBSD installed last weekend. There were a few factors stabbing me in the back (and making me slag FreeBSD more than it deserved). Specifically, I’ve decided, after about 15 tries, that:

  • I think the machine got thrown out because one or both of the IDE ports got funked up
  • I think the Developer’s (no X) install of FreeBSD 6 was too big for my small hard drives

So, I ended up getting it to work by installing it on my 4Gb SCSI from the FTP (remember, no IDE at all, so no CD drive…). The machine’s been up for 5 days now, so it’s been a bit of a success. Daniel says he’ll find me some more SCSI drives so that we can get the reasonable drive space.

Final notes:

  • My only bitch with FreeBSD was that it couldn’t figure out how to DHCP to my router, so I had to do the stupid manual network config and then wait for what seemed like a long time for it to accept the valid manual specs I’d given it
  • The FreeBSD minimal install is very minimal. I was amazed at how many things I would have expected on any ol’ Linux box are actually unnecesary
  • When pressed, I don’t actually need that much more than the minimal install, vim, bash, wget, and mzscheme. That’s nice to know

Now for the box to blow up…

Building the Imperfect PC

Saturday, December 17th, 2005

O’Reilly has a book called Building the Perfect PC. I have built many PCs in the last 6 or 7 years, starting with the machine that I built for myself to take to college. Yet, I have never built the perfect PC. In fact, almost every PC I’ve built then has used a significant number of parts from that first PC despite their growing age and lack of reliability.

Anyone familiar with builders of imperfect PCs knows that they, by definition, keep huge piles of garbage, which they call “parts,” lying around the house. After years of friction with my wife caused by my collection of (worthless) “parts,” I began reducing that collection. She seemed pleased.

Yesterday, Daniel and I went to PG’s house to pick up a computer that had died. I offered to take it home to store it. This morning, I brought the computer inside. “I thought we were trying to reduce the number of computers?” was all she said above her distainful expression.

So, I was pretty stoked to finally be playing with some new parts, rather than my horrible collection of broken hand-me-downs. It even has a1Ghz processor, faster than anything I’ve ever used. And it might even have a working motherboard (something I have a problem with).

Well, I got more angry looks when I went down to Colin’s and re-possesed on of my old machines that I had given to him (see above reduction in “parts”). I spent the afternoon playing around with hardware, deciding that I liked my case better than Daniel’s, and generally getting to do everything in the most difficult way. Then I got to install FreeBSD.

Daniel likes FreeBSD for some reason, so it’s what we’re using for the servers at work. I’d sorta like to assume that the problems I’ve had aren’t it’s fault. It’s driving me to thoughts like this:

WHAT THE [HE]CK?! I’ve tried to install this worthless piece of software on every single drive I own and it still won’t work!

So, I dunno why it refuses to write to any of the drives I have (maybe the motherboard is indeed screwed). It’s getting pretty annoying, as I’ve now switched hard drives more than 7 times (not all ATA either, I tried my SCSI first…).

Hmm… so much for new parts.

Crossing the Chasm

Monday, December 12th, 2005

I just started reading Crossing the Chasm by Geoffrey A. Moore and am enjoying it quite a bit. The book was given to me by a colleague who thought it was a must read because of the startup. The basic premise is this: there’s a huge chasm that separates early adopters of technologies, who are prepared to make some concessions for the sake of new, cool things, and the early majority, who will use new things, but only if they’re practical. Moore posits that many high-tech companies fail because they never full grasp how to “cross the chasm” and reach the real majority, often mistaking their early sucesses as evidence of wide appeal. I can certainly think of a ton of emerging websites that haven’t crossed chasm…

Read more on Google Print or here: http://en.wikipedia.org/wiki/Crossing_the_Chasm

Why Does the Google Search API Suck?

Saturday, December 10th, 2005

First attempts

Ruby doesn’t have CPAN

I spent quite a bit of time Friday evening and this morning trying to get a simple Ruby script to pull search data from Google’s crappy search API. There is a standard library for SOAP/WSDL stuff for Ruby here. It is, like so many other potentially good Ruby libraries, almost totally undocumented.

I played around with that for a while and failed to get anything useful. After a little more searching, I found ruby-google on the RAA. It looked promising, specifically:

Ruby/Google offers a higher-level abstraction of Google’s SOAP-driven Web API. It allows you to programmatically query the Google search-engine from the comfort of your favourite programming language, as long as that’s Ruby.

The aim of the library is to make the details of the raw data structures returned by the Web API irrelevant, in the process making the API more accessible for everyday use.

After installing it on amartya, our development server, I tried using the thing. It barfed with some error. I then tried tweaking it for a bit but gave up because the thing hadn’t been updated since mid-2003.

More Annoyed

The rest of the evening and this morning progressed in the same way. Long story short: tried to get a Ruby version to work on 3 different machines (and OSes), gave up on Ruby.

Perl has CPAN

I switched to Perl and happily found CPAN modules that looked promising, specifically Net::Google .

Not if you haven’t got a good version or Perl

I then spent hours trying to install all of the dependencies for the CPAN meta-module on amartya before realizing that it was using 5.005_03!. After that, I gave up completely on amartya, tried on my Dreamhost machine, failed because I wasn’t root [yes, I know how to fix that but was too annoyed by this point], then failed on my iBook because I somehow screwed up the urllist to download from [yeah, I tried fixing that too].

Why Google?

Then I stopped and looked at Yahoo’s API. It worked out of the box (in Ruby). Here’s the basic code: (with WordPress escaping the double quotes for some reason)

require 'rexml/document'
require 'net/http'
APP_ID = "whatever_you_asked_Yahoo_for"
query = "a%20search%20string"
url ="http://api.search.yahoo.com/WebSearchService/V1/webSearch?appid=#{APP_ID}&query=#{query}"
  response = Net::HTTP.get_response(URI.parse(url))
data_xml = REXML::Document.new(response.body)
data_xml.elements.each("ResultSet/Result") {|r|
  puts r.elements["Title"].text,
  puts r.elements["Url"].text,
  puts r.elements["Summary"].text
}

I wish I would have tried Yahoo in the beginning.