Microsoft AdCenter’s 316-page Terms of Service
Biz: , , ,
1 comment

I signed up for Microsoft AdCenter, and got an interesting presentation of terms and condititions:

Microsofter AdCenter's TOS

The terms and conditions are exactly 2,840 words long. At 9 words each, that’s 316 pages. There’s no way to resize the TOS div and, yes, the whole form is abnormally wide.

Between the above problems and the problems in the rest of the signup, I have to guess they failed to test in Firefox. I can see why Microsoft might not want to, but 30% of surfers use Firefox, and it’s a far higher percentage higher for the web professionals who are going to be using this service.

It does get worse: when I go to sign in I type my username and password, click “Sign In”, and am presented with the sign in form with my username and no password or errors. It just silently fails to log me in. I’m not too optimistic about their support, they can’t even keep the url to it from breaking across two lines in the “Welcome to AdCenter” mail.

Making Valid XHTML Easier
Code: , ,

I’m working on a Rails site in my Copious Free Time and I wanted to share a little way that Ruby made my life easier. I’m making my pages valid XHTML 1.0 Transitional because it makes life easier to find bugs and it just feels good to know I’m meeting the spec.

The W3C Validator complained that I didn’t have the rows and cols attributes on my <textarea> tags. My code for them looked like:

<%= text_area_tag :message, params[:message] %>

And I don’t want to add the :size option because I use CSS to style all of them, it’d be confusing to see an unused size there. So I extended the text_area_tag method in my app/helpers/application_helper.rb to fill in a default:

module ApplicationHelper
  def text_area_tag(name, content=nil, options={})
    super(name, content, { :size => "40x10" }.update(options))

And it was that easy to start having valid tags. I’ll be posting more Rails snippets and tips as I work on my project, and I’ll definitely announce here when it’s ready for wide release.

(This snippet owes thanks to ‘leethal’ in #rubyonrails on for straightening out how I was trying to override the method.)

Dual-Head on the 13″ Macbook
Code: , , , , , ,

Since Ubuntu Edgy came out last week I decided to spend some more time tinkering with getting dual-head display working, and this time it took.

Feast your eyes on the 1280×1824 goodness:

dual-head macbook screenshot

The division between monitors is that little gap just under the huge code window.

I keep what I’m working on up on the top monitor — a nice big vim code window (usually :split into multiple windows) and a browser for viewing the output. Down on the bottom is IRC, SIMud, mail, and any docs I need.

My desktop theme is deliberately very plain and subdued. I figure any time I notice how pretty my desktop is I’m being distracted from what I’m doing, so I have no animations, transparency, or other bits of frippery.

If you’re curious, here’s my xorg.conf. Of course, now that I’ve got it working I’m tempted to get a nice 23″ display (the 13″ Macbook can run an external display at up to 1900×1200).

Tidy Stylesheets in Rails
Code: , , , ,
No comments

It’s very easy for a site’s CSS to grow a single giant, brittle stylesheet. It becomes impossible to change anything because of bizarre interactions between elements, unexpected interactions, and simply because it’s just too big for anyone to understand. Much of programming is managing complexity, and I’ll share a nice technique in that vein.

I like to break down stylesheets so there’s a site-wide stylesheet with global stylings like fonts, the site’s template, and common elements. This is the file that metastasizes on you.

My solution is to break down stylesheets by controller and action, and Rails makes this quite easy:

# app/views/layout/application.rb
<%= stylesheet_link_tag *(['global'] + @stylesheets) %>
# app/controllers/application.rb
class ApplicationController < ActionController::Base
  before_filter :add_stylesheets
  def initialize
    @stylesheets = []
  def add_stylesheets
    ["#{controller_name}/_controller", "#{controller_name}/#{action_name}"].each do |stylesheet|
      @stylesheets << stylesheet if File.exists? "#{Dir.pwd}/stylesheets/#{stylesheet}.css"

This code automatically loads stylesheets for the controller and the action if they exist. The subdivision allows you to make them as compact and specific as possible. If a partial needs its own code, write at the top:

<% @styleshets << "controller/_partial_name" %>

Nice and tidy.

Freshwater Live and TechCoffee
Biz: , , ,

Last night I went to the invite-only Freshwater Live, a meeting for entrepreneurs of all experience levels put on by Freshwater Venture. FV is a neat blog that profiles Chicago tech companies and is run by consummate nice-guy Keith Schacht and Eric Antonow (who is probably also a nice guy but I don’t know him).

Around 150 people showed up, and I was the easily the most underdressed in jeans, a t-shirt, and a hoodie. Oops. So I wrote “obviously a developer” on my nametag and nobody cared except the photographers, who I suspect liked the visual of the scruffy hacker-type chatting with guys in business suits because I noticed them taking my picture at least four times and, Keith, if a ton of your pictures are me being scruffy I’m sorry.

It was easy to visually divide the crowd — every under 35 was starting their first or second business and everyone over was either on their eighth or in finance. So I gave the Cambrian House elevator pitch about two dozen times and boy does a crowd full of entrepreneurs love the promise of CH. I also met 5 folks who’d already heard of us, three of whom had accounts on the site and submitted ideas.

After an hour of open mingling Keith and Eric presented the family tree of Chicago tech startups. The founders of three establishd local companies gave a little “if we were starting now” presentation with comments from a board of three random finance guys and Jason Fried. Then three young startups GrubHub, Inkling, and third startup doing training whose name I forgot and can’t find anywhere gave 62-second presentations to compete for a briefcase full of cash. GrubHub won handily to end the presentation and folks fraternized for a few hours longer (I wandered out at 10 PM).

All-in-all, a fun evening and a lot of neat startups. I especially enjoyed meeting the editor of the excellent Gapers Block and the CEO of Collectica, which seems like a clever idea.


This morning I hopped up bright-eyed at 6 AM to go to TechCoffee and hacked on a personal Rails project I hope to post about in the next week or two. This was the first time I’ve gone to one of these and it was a good time. A half-dozen folks also showed up to code, though I spent a bunch of time chatting with Jason Huggins about a neat Selenium project he absolutely needs to work on and if you’re reading this, Jason, then ha, I’m pulling ahead and I’ll launch my project first and win our bet so there.

So, yeah, I don’t often drink coffee but it seemed like a good idea at 7 AM. Very wired still.

344 Books Must Go
Life: ,

Over the last couple years I’ve been reducing the amount of stuff I own*, and now it’s time for most of the books to go. I’m giving away 344 books, three-quarters of my book collection, free to any family, friend, or acquaintance for the asking. Really. If we’ve met or traded mail before now and we got along decently, I’ll give you free books for the asking, just click that link to see the books I’ve tagged “giveaway”.

* I know it’s odd, but I just don’t like lots of things around to keep track of. I don’t feel like a happy consumer to be surrounded by posessions, it’s just more and more stuff to keep track of.

Just mail me to say what books you’d like. If you’re in Chicago this could be an excellent excuse to drop by for dinner, or if we just know each other from a local user group I’ll bring ’em there for you. If you’re outside of Chicago and not dropping in anytime soon, send your current mailing address and I’ll ship them to you.

Blue Bookshelf
Five years ago I donated about 200 books I didn’t really care for to my to my then-local library. I got the idea for this giveaway when I realized that I only reread a few of my books on any regular basis. As soon as it occurred to me that I might be able to fit them all on my little blue bookshelf, I had to try. I’d have made it if I could give up my dream that someday I’ll write a comic, so I have another shelf with 50 or so books I’ve promised myself are “reference”.

One last note: I received some of the books I’m giving away as gifts. If you see a book you gave me on the list it’s not there because I don’t like you/it or didn’t appreciate the gift, it’s only that I want to reduce how much I own and I deliberately picked a difficult constraint.

2007-05-10: All of the books have been given away.

Clean Up Your Mess
Code: , , , , , ,

Too many sysadmins is a bad thing, especially if one of them doesn’t care about keeping the servers up.

The development box at work wasn’t letting me check anything into subversion — commits were just sitting there, not even timing out. In fact, so were updates. Something was seriously wrong.

I talked about it with a coworker and went to look at the box. Afew a few minutes of poking around, the problem became clear: someone installed a backup program that was trying to do some kind of fake-filesystem and wedged the box. Any process that tried to read from disk froze and couldn’t even be kill -9‘d.

And thanks to this odd little behavior, I could see three reboot processes frozen, presumably trying to read the shutdown scripts. So the person that wedged the box knew they wedged it but they just left it that way.

I got the coworker in the office to pull the plug on the box and it came up OK, but I edited /etc/init.d/arkeia to spit out the following note instead of try to start the backup program:

Dear whoever the hell decided to install arkeia:

You left the dev box wedged overnight, wasting at least an hour of two coders time to figure out what you did and fix it. And we know that you know you broke it, we could see that you tried to reboot and then LEFT IT FOR SOMEONE ELSE TO DEAL WITH rather than actually fix it.

Don’t be a jerk! Clean up after yourself!

Please talk to Jim and Harkins and explain why you left the box broken before you try playing with arkeia and wedge the box again.

ChiPy at Google
Code: , , , , , , ,

I had a great time last night at the ChiPy meeting last night that was held at Google’s Chicago office. I suspect a lot of people turned up just to see the venue: usually ChiPy gets 15-20 people but we got 51 last night.

So to talk about the office: it’s a nice, if very deliberate space. It’s nice to see that someone thought about all the little decorative touches (like lava lamps) and useful touches (like an acoustic shell above where the projector displayed), but it didn’t feel very lived-in yet. Maybe it was just that having to sign an NDA to enter the office for a public meeting was an unpleasant surprise.

First up, Brian Ray gave a presentation on operator overloading in Python. He covered what operators are available, how Python picks which operand’s code is called, how assignment operators like += and -= are handled, and tips on good style.

Next, Brian Fitzpatrick and Ben Collins-Sussman talked about how they’ve been working on Google Code, specifically the free Project Hosting for open source software. The highlight (and clearly Fitz’s favorite part of the project) was how they used Google’s BigTable as their svn repository.

Last, Jason Huggins demo’d Selenium, the browser-based website testing framework he developed. He had a nice demo showing how Selenium can be integrated into a continuous integration system so that browser tests are run on multiple OSs on every checkin, with screen-capture movies of the test process automatically checked into a repository.

All-in-all, this was a very fun meeting with lots of conversation that didn’t break up until security wanted to close up at 23:00 (5h after the meeting started). I had fun meeting and chatting with at least a half-dozen new folks. Mostly I yammered on and on about how Cambrian House works, but I swear it’s because folks kept asking and not because I’m turning myself into a mobile billboard.

Also, Jonathan Wolter talked me into coming out to San Francisco with him and a few others to attend Yahoo’s Hack Day in two weeks. Looks to be a good time.

Triple-boot Filesystem Layout
Code: , ,

I’ve got a MacBook on the way that I plan to triple-boot and I’m trying to figure out how to lay out the filesystems. I plan on using Linux primarily as I’m a developer. XP has a lousy command line environment* and OS X has a lousy GUI, but I’d like to keep them around for browser testing.

* Yes, I’ve used Cygwin. It’s good, but awkward.

Linux OS X Windows XP
FAT 32 rw rw rw
EXT3 rw rw? rw?
HFS+ rw rw rw?
NTFS rw r rw

The ? indicates that support is added by a random freeware utility rather than built into the OS, so who knows how well it’ll work. Yeah, XP and OS X both suck for filesystem support.

The general plan looks like OS X and XP will have ~10G partitions with their native HFS+ and NTFS. Linux will get a ~10G ext3 root partition and the rest of the disk space will go to a large ext3 partition for /home. I’ll spend my time in Linux, booting to XP and OS X mostly just to test, so their ext3 support needs to not suck or I’ll have to create a FAT 32 scratch partition just to pass files around (and scratch any hope of using my svn repos).

Just to add another wrinkle, I plan on using TrueCrypt to encrypt all my private data so I’m not 100% screwed if I lose my laptop, just like 15% screwed. TrueCrypt runs on Linux and XP and can encrypt entire filesystem partitions or virtual disks (which exist as files on existing partitions). So while I’d like to have a big ext3-formatted TrueCrypt-protected /home partition, that’d leave out OS X.

Anyone have a better plan? Anyone else with a triple-boot setup care to share lessons learned?

Bar Camp Chicago
Biz: ,

I just got home from Bar Camp Chicago and it was awesome. Two days of geeky topics.

On Saturday I:

  • Met two dozen geeks, so less than half the people there.
  • Attended a presentation on mobile devices, specifically the GP2X. I like mobile devices, but find web coding way more interesting than the nebulous topic of pervasive computing.
  • Insulted the unendingly rude Ron May.
  • Attended “How to Burn Your Business to the Ground” by a guy from Intentionally. Very slick presentation on failure and how entrepreners can minimize the likelihood.
  • Shook the hand of surprise guest Jimbo Wales, Wikipedia founder. When he walked in there was a lot of “Is that who I think it is?” and he later gave an impromptu talk on translating Wikipedia‘s success to politics with the Campaigns Wikia. I may go to the local meetup in two weeks.
  • Started a hypercard-like educational programming system for the web with Michael, Ian, Andy, Rachel, and bystanders. I’ll give it a post of its own tomorrow morning when the sf project is up.
  • Heard about a plan to build a hacker lab/living space to connect like-minded folks.

…and then I came home and crashed. It was an incredible day, constantly busy and engaging. There were at least 60 people there and between all the folks and the July heat, the air conditioning couldn’t even keep up.

On Sunday I:

  • Met another dozen geeks.
  • Attended Jason Rexilius’s talk on globally distributed web clusters but wandered away because I saw most of the content when he gave the talk to ChiPHPug (great talk, though).
  • Attended Jason Jacobsohn’s introduction to the Chicagoland Entrepreneurial Center, which helps startups and seems cool but has a Flash applet instead of a website.
  • Attended Jonathan Wolter‘s discussion on using blogs in non-bloggy ways, sort of as a web development springboard. He gave a nice little example-heavy introduction and then threw the door open to a great discussion.
  • talked more with Andy and Ian about the Hypercard-like app.

I may only have had two meals in two days, but it was a great time. Where TechCocktail was a noisy sardine can with lots of business guys, Bar Camp was almost all geeks and never too busy or empty. I only saw one tie, but that guy was also wearing a RailsConf badge so maybe he just had a paraphelia for neckwear.

To express the right note of enthusiasm, let me just say: A+++++ EXCELLENT, BIG THANKS – WILL ATTEND AGAIN.

Fatal error: Call to undefined function twentyseventeen_get_svg() in /home/malaprop/ on line 45