Archive for July, 2007

Simpsonize Me

Me, SimpsonizedI spent last weekend down in Auburn, for the Auburn Knights Reunion, and since I had some time to kill on Saturday afternoon, I thought about going to see The Simpsons Movie. Luckily, I decided not to, since Denise now tells me that she wants to see it too. This is even though she gets on to me for watching the show. I knew she was a closet fan. This morning someone pointed out the new “Simpsonize Me” web site (a sort of joint promotional thing between the movie and Burger King). It’s a lot of fun: just provide a digital photo of yourself, and get a (tweakable) “Simpsonized” version of yourself.

Update: D’oh! Forgot the link. The web site is here.

Busted

Not me. But somebody. From ars technica, via Shelley Powers:

[Harry Potter and the Deathly Hallows] actually leaked out through the tubes last week as some enterprising soul took photographs of every single page of the book and made them available through BitTorrent…

The EFF took a peek of its own at the leaked photos and did some cursory detective work. They found that the EXIF metadata attached to the photos contains the serial number of the camera used to take the pictures, along with all the other technical details about the settings used to make the image. That unique serial could be the leaker’s undoing if Scholastic can find a way to link it up with an individual, and the EFF suggests that (perhaps) they can.

If the camera (a Canon Rebel) was registered with the company when first purchased, then Canon potentially has the information that Scholastic needs to make a bust. If this goes to court, expect Scholastic to go after such information.

Chained Builds in CruiseControl.rb (Update)

Last Thursday I wrote about the kind of chained builds functionality that I want from CruiseControl.rb. I think I’ve got it hacked in, at least to the “good enough” stage.

The first big change was to change the @trigger instance variable for the Project class from a single trigger to an array of triggers. I modified its name to @triggers to reflect this change. So in the initialize method for the Project class, instead of saying:

@trigger = ChangeInSourceControlTrigger.new
We now say this:
@triggers = [ChangeInSourceControlTrigger.new]
Next, I modified the buildifnecessary method to collect information from all of the triggers about which revisions need to be built.
revisions = []
@triggers.each { |trigger| revisions += trigger.getrevisionstobuild(self) }
revisions = revisions.uniq.sort
if revisions.empty?
  ...
I also made a change to the triggeredby method for the Project class so that it accepts multiple triggers, and so that it always adds triggers to the existing set (instead of replacing them). Here’s what my modified version of triggeredby looks like.
def triggeredby(*things)
  things.each do |thing|
    if thing.is_a?(String) || thing.is_a?(Symbol)
      @triggers << SuccessfulBuildTrigger.new(thing)
    else
      @triggers << thing
  end
end
This allows me to declare dependencies in my cruise_config.rb file like so:
project.triggered_by 'projectA', 'projectB', 'projectC'
I had to modify the logic get_revisions_to_build method for the SuccessfulBuildTrigger class a little bit, so that it wouldn’t return any build numbers from triggering projects that were older than the latest build of the “triggered” project. Here’s what that block looks like now.
if last_successful_build.nil? || project.find_build(last_successful_build.label)
  []
elsif project.last_build && project.last_build.label.to_i >= last_successful_build.label.to_i
  []
else
  [Revision.new[last_successful_build.label]
end
The last step was to add the spaceship operator to the Revision class, so that I can sort arrays of them.
def <=>(other)
  number.to_i <=> other.number.to_i
end
Note that the number attribute for the Revision class sometimes refer to an integer, and other times to a string. I suspect that this is a bug, but calling to_i on it does the trick for this purpose.

It took a bit of experimenting to get it right, but this seems to be working properly now. It took maybe a couple of hours to get it working, and the code was easy to read and understand.

Chained Builds in CruiseControl.rb

The good news is that there is some code in the trunk for CruiseControl.rb that addresses the need for chained builds. If you’re using that version, you can for example specify that a successful build of ProjectA should trigger a build of ProjectB.

# cruiseconfig.rb for ProjectB
Project.configure do |project|
  project.triggeredby 'ProjectA'
end
The bad news — which I didn’t realize until I had modified several (OK, all) of my cruise_config.rb files — is that:
  1. A project can only be triggered by one other project. If ProjectB depends on both ProjectA and ProjectC, too bad.
  2. Specifying that ProjectB depends on ProjectA disables the default build trigger, which checks for changes to ProjectB’s Subversion repository.
Looks like I’m going to need to look into the source code and see if there’s some way to hack in dependencies on multiple triggers. At a minimum, I’d want to be able to specify that a project depends on both a ChangeInSourceControlTrigger and one or more SuccessfulBuildTriggers.

How to Kill a Baby Lion

This may just be the most precious discussion ever held on the ruby-talk mailing list. It started out innocently enough:

Hey yall experienced coders and programmer dudes. I wanna make an MMORPG type game, but I have no programming experiance whatsoever.

He was advised to check out some great introductory programming books, like Chris Pine’s Learn to Program. When he responded with the classic cheapskate/lazyweb plea…

I sorta have no money to use on books and the like. I was hoping I could avoid buying anything by consulting the greater population of Ruby programmers.

… I knew that the discussion was going to have an unhappy ending. But I had no idea how entertaining the downward spiral would be. I don’t want to ruin it for you, but after being given pointers to free online learning resources, and being told repeatedly that he’d need to learn to walk before he could learn to run and learn at least the basics of computer programming, well — things got a little testy.

I will use my google skills now, TO FIND BETTER HELP. All of these tips were agravating, annoying, useless, telling me what I did wrong, telling me to do stupid stuff like that hellish Hello World crap, or all of the above. Not to mention, im going straight to dam C++. I have a better chance if I tackle the lion with my sword and shield rather than wait until the lion is hungry and attack it with the knoledge how to kill a baby lion. If you don’t get the anology, your not as smart as you think you are.

If you don’t have time to read it all, just stick to his posts. Great stuff.

Gizmodo Reviews the iPhone

From Brian Lam’s No BS iPhone Review, on Apple’s decision to partner with AT&T:

Signing up for the iPhone is like being tossed into a menage a trois with Angelina and Rosie O’Donnell. You want the beauty, you have to sleep with the beast.
His verdict on the iPhone, based on ten days of ownership, is that you should wait a bit until Apple fixes some of the software-related problems.

It Could Be Worse

As seen on MacRumors.com, in response to a complaint about the cost of an iPhone replacement battery:

“If you can’t afford the phone, don’t buy it. If you like your current phone better, do not buy the iPhone. Why are you making this so hard on yourself? It could be worse. You could be in Darfur. iPhones aren’t even available there.”

Reasons not to buy an iPhone… Yet.

As the initial reviews from real-life iPhone owners began to trickle in, I started keeping a list of some of the problems they were reporting. Not the meta-problems that I already knew about, such as the fact that AT&T is the only supported carrier, or the price tag, etc. — I’m more interested in the little quirks that might not be showstoppers, but which were non-obvious at first and which would make it frustrating to use. The good news is that many of these problems can be addressed in software updates. We’ll have to wait and see how soon those start landing.

Apologies in advance for not providing attributions for these reports — if you’re one of the people who pointed one of these problems, you know who you are.

System-Wide Problems

  • By design, there’s no visible file system for the iPhone. This has a lot of ramifications in terms of limitations on other features.
  • There’s no support for copy-and-paste between applications.
  • Landscape orientation for the onscreen keyboard is only available in Safari. For other applications (namely, Mail) it’s always in portrait orientation.
  • You can’t purchase music or videos from the iTunes store, directly from your iPhone. You must purchase them via the desktop application and then sync them to the iPhone.
  • The built-in Google Maps application doesn’t know where you are, even though one of the commercials suggested that. There’s no built-in GPS, so it can’t know where you are. You can, however, bookmark certain locations (such as your home or office) to use as starting points for directions.
  • You can’t sync via Bluetooth or Wi-Fi; you must use the standard USB cable.
  • No support for MMS messaging (only SMS).
  • No iChat application.
  • You can’t compose notes on the desktop and then sync them to iPhone; you must compose notes directly on the iPhone.
  • You can’t record video with the iPhone’s built-in camera; it’s only good for still photos.

Problems with Mail

  • There’s no Junk mail filter built-in to the Mail application. This is not a big deal for me as Gmail does a pretty thorough job of spam-filtering on the server side, but it is nevertheless a curious omission.
  • You can’t attach a picture to an e-mail message from within the Mail application; you must switch over to the Photo album, select a picture and click the “Send” (or is it “Share”?) button. This presumably also means that you can’t send multiple pictures in the same e-mail message.
  • There’s no way to reply to an e-mail without quoting some part of that message. You can’t, for example, select the relevant part of the original message and then click “Reply” like you can in the desktop Mail.app.

Problems with Safari

  • The browser doesn’t yet support Flash, so web sites that rely heavily on that technology (such as Homestar Runner) won’t work.
  • Safari doesn’t cache pages that you’ve recently visited. If you navigate away from a page and then click the “Back” button, Safari reloads that page.
  • You can’t download arbitrary files from web sites and sync them to your desktop for later use.