Whattech Blog

February 5, 2010

I’m sorry if I broke your Rubygems, rails_action_args 0.1.4 released

Filed under: Uncategorized — Collin @ 6:48 pm

Tonight, a cautionary tale of woe.

I was using an older release of  gem bundler to do local development for a port of merb-action-args to Rails3. All was good.

Or so I thought. Bundler made its own bin dir in the project (The newway is bundler exec <comand>).

And jeweler makes a default .document file that includes “bin/*”

So I distributed a gem which overwrote autotest, convert_to_should_syntax, erubis, multigem, multiruby, multiruby_setup, parse_tree_abc, parse_tree_audit, parse_tree_deps, parse_tree_show, r2r_show, rackup, rake, ruby_parse, unit_diff, and zentest.

Oh my. I am sorry. I have pushed a patched gem which does not include any executables. rails_action_args 0.1.4.

To learn more about how action arguments are awesome: http://github.com/collin/rails_action_args

Follow me on twitter: http://twitter.com/collin

October 22, 2009

Someone just took one of my last.fm groups

Filed under: Uncategorized — Quinn @ 5:34 pm

So when I was a lot younger, back when last.fm just started, I created a group for the band “The Faint”. Apparently last.fm only allows one “root” group per band. Anyway, I have since stopped listening to the faint and stopped using the site, and completely forgot I did any of this. I decided today that I would give last.fm a try and discovered some messages similar to:

Can you please give me ownership of the Faint group? You don’t seem to be active or care about it anymore.

As it turns out, one of the enquirers actually managed to appeal to last.fm somehow and gain control of the group. Rather than being bothered by this, I think its a great policy for last.fm to have. I’ve always found “stale” groups and user accounts annoying, and its great to see last.fm taking a proactive approach to this.

October 14, 2009

Migrations Based on Git Hashes not Timestamps

Filed under: Uncategorized — Quinn @ 2:13 pm

Ok, this isn’t a complete thing, this is more of an idea thing. Here’s the backstory: I use datamapper. At first, this caused me to dismiss AR migrations as silly and needless, possibly because datamapper didn’t have them, and also probably because I had trouble with their quirks in the past. Also it seemed like a dumb place to store the schema.  I’ll get to the point. I think my problem boils down to two points:

  1. Migrations aren’t general enough (targeted towards db schema changes)
  2. they aren’t tied to my workflow in any way. (easy to miss them / forget to run them)

Sometimes, when updating from one commit to the next, one has to run an arbitrary command or script. If your migrations were just generic tasks (and default to being unidirectional) it seems that life could become a lot easier. You could even theoretically tie it to the ‘post-recieve’ hook in git for optimal awesome.

To summarize: I want something that solves the problem of “between commit x and commit y you need to do arbitrary task z”.

October 1, 2009

The Friends’ Jukebox-Music-Player

Filed under: Uncategorized — Collin @ 7:19 pm

Last week the jukebox in the corner of the bar sparked a conversation about the business of digital jukes. TouchTunes, the brand on our box, boasts ”38,000 restaurants, bars, retailers, and other businesses throughout the US and Canada.”

38,000 units installed. I’m curious about how they’re exploiting that position. I had a few immediate questions about my situation that night.

  • Why I’m not choosing and paying for songs with my phone?
  • Why I’m not paying to vote on the current song?
  • Why don’t my selections go into my FourSquare, Twitter, and Facebook feeds?
  • Why can’t I pay to play the latest single my band recorded in the basement? (bartender gets a kill-switch)

In search of some answers I researched the “competition” and ran some crap calculations to see what I was up against.

I found TouchTunes only slightly behind the curve. The jukebox down the street has a URL on their social network: http://www.mytouchtunes.com/.

Good stuff on MyTouchTunes:

  • shared play lists
  • latest MyTouchTunes selection list
  • bar-specific trends

Bad stuff about MyTouchTunes

  • don’t see any FourSquare, Twitter, Facebook, MySpace integration
  • don’t see what non-members selected
  • should be able to buy the current song from iPhone right now
  • no real-time stream of selections
  • can’t listen at home to my favorite bar (can’t even pay to do that)

MyTouchTunes, a very exciting product, plays second fiddle to the jukebox itself. MyTouchTunes underutilizes its presence in nearly 40,000 venues.

I through together an off the shelf hardware package to “kill” TouchTunes.

  • $160: MSI Wind Nettop 100 Desktop PC
  • $40: Credit Card Swipe
  • $50: USB 3G Modem
  • $200: iPod Touch
  • $60/mo: 2yr 3G Data Contract

The bolted-down iPod Touch acts as an on-site aide to train customers on how to use the system. With the credit card swipe it facilitates non-iPhone customers. Sign with your finger please.

Seems too pricey to disrupt the incumbent. A bit of hacking could help that out. Remove the nettop and 3G Modem. Then upgrade the Touch to an iPhone. The subscription is still there, but it spreads out over 24 months.

My skepticism is kicking in. Time to make up some numbers.

I assumed a bar with one bartender will have a hard time serving more than three drinks per minute at peak load. I guess they might hit that level for one hour three nights of the week. Beyond that I’ll give this made-up bar %20 efficiency the rest of their hours on those three days and %10 for the remainder of the week.

Peak load @ %100 for one hour is 180 drinks served. Three hours of peak make 540. 27 hours at %20 make 972 drinks and 40 hours at %10 make 720 drinks served for a total of 2232 drinks sold in a week. That comes to 116,064 drinks in a year. At five dollars each drink my bar has $580,320 revenue from the liquor license.

For context, if my bar had monthly expenses of $20,000 and only made a %50 margin on those drinks I’d better start considering adding a kitchen and a dinner menu.

Next I wanted to look at revenue on the jukebox. Let’s say I have my customers love their music and hate their quarters. I charge 50 cents a selection and they play 50 songs a night all year long!

The jukebox made $9,125.

Not shabby. But I feel those numbers are optimistic.

If I wanted to take on the big boys, I’d need a product that sold drinks. Not music.

August 26, 2009

The Magic Sauce for Ruby LDAP and Open Directory

Filed under: Uncategorized — Quinn @ 11:21 am

After hitting my head on my desk for a couple of hours, I finally figured out what it takes to authenticate with os x’s Open Directory (ldap). First, open up “Server Admin” from within “Workgroup Manager” go to “Open Directory” in the sidebar, click on the “LDAP” tab, and grab the “Search base” text. You will now have the necessary info for the DN to authenticate with:

dn = "uid=#{username-goes-here},cn=users,#{search-base-goes-here}"

what was really tripping me up was the  ”,cn=users,” bit. Hope this saves someone some headache.

August 24, 2009

Would You Care for a Morsurl

Filed under: Uncategorized — Quinn @ 3:41 pm

Morsurl.com

Morsurl is an exciting new service Milo and I created over the weekend for  the rails rumble: http://r09.railsrumble.com/teams/whattech. Morsurl is a website that lets you give someone a link to a page with part of it highlighted for their viewing pleasure! It’s oodles of fun, you should start using it right away. The magic sauce is hpricot plus some javascript based on selectorgadget.

July 17, 2009

Rack Proxy Pass, Powering This Blog

Filed under: Uncategorized — Collin @ 2:05 am

It was time. Time for a blog engine that would require less effort to maintain.

And so we’ve installed WordPress.

But we wanted to retain our application template from our staticmatic driven website.

At some point, while feeling quite daring, it was decided to hook up the wordpress app into a bit of Rack Middleware.

And thusly, Rack::ProxyPass was born.

At the heart of it, lies Rack::Request#forward_to.

(more…)

July 16, 2009

Using Moneta Backed by Tokyo Cabinet in Merb

Filed under: Uncategorized — Collin @ 5:44 am

We’re working on a project involving Twitter here at WhatTech,
who isn’t these days?,

and we’ve become frustruated with the slow write-speed of mysql.

So it’s time to look for another solution. Right now i’m looking at Moneta
to provide an interface, and probably go with Tokyo Cabinet as the storage
engine.

Mmmhhh. Yummy Benchmarks

Who knows, maybe my benchmarks are crap. My computer is a crap little
Toshiba Satellite running Ubuntu 8.10. Slow disk, bloated install.

But damn Clarence, that was almost six minutes for DM/MySql vs 0.5 seconds for Moneta
backed by Tokyo Cabinet. I’m curious to see if TC holds up as the numbers get bigger.

I’m already impressed, but I’m going to see how long it takes to write
500K key/value pairs. Then how long it takes to read 200K pairs.
Should be fun.

(more…)

Our Fancy New WordPress Powered Blog

Filed under: Uncategorized — Collin @ 5:33 am

We’ve gone and replaced our blog with WordPress. There’s a new design in town.

Brought to you by our friend Gregory Gallagher.

Powered by WordPress