You are viewing mhat

mhat [entries|archive|friends|userinfo]
mhat

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

rails migrations [Feb. 16th, 2011|11:04 pm]

I might be late coming to the game on this one. Tonight I was looking at ActiveRecord::Migration and company to add a after-migration hook. If a column is added to or removed from a table, I want one or two additional things to happen. 

  1. If it exists, I want to update the Londiste replication Trigger. 
  2. Jury is out, but I may want to have expire the Model associated with the Table's record_cache.

Digging around I found two methods of interest in ActiveRecord::Migrator, run and migrate. The former is called when you do rake db:migrate:up VERSION=xyz while the latter is called when you do rake db:migrate. Great, that seems reasonable until you look more closely at the code. migrate does roughly what you expect, the key part is that before performing the migration it wraps the migration in a transaction, yay! run on the otherhand, does not wrap the migration in a transaction. 

The primary goal with (1) is to be able to remove a race condition between the time a DDL change is commited and when we update that Londiste Trigger. For a high traffic table, it's likely that some writes will come during the window where the DDL and Trigger are out of sync, corrupting the replica. 

As long as we do rake db:migrate, all is good. Sometimes, migrations are complicated. We might want to migrate up to a version, run some repairs, then continue the migration, repeat as needed. Boo.

 

Posted via email from mhat's posterous

link

AppleTV 2.0 [Oct. 11th, 2010|12:09 am]
September 30th my shiny new Apple TV 2.0 arrived.

In our apartment, on the shelf just below what can become an inadvertent alter to Apple consumer electronics, we have three boxes. In each box a collection of A/V cables, remotes, adapters, accessories and paraphernalia. None of these boxes contains an HDMI cable. I've never owned an HDMI cable. I have only a single DVI to HDMI cable that fills one of the three HDMI ports on the back of our foolishly large HDTV.

The AppleTV has HDMI and Optical.

Several days later and a trip through the freak show that is Best Buy's HDMI aisle later. As an aside, Monster is still at it. Apparently I can buy a four foot long gold plated HDMI cable with $100. Or I can buy a no-name generic cable for $24. Or I can buy a no-name generic cable on Amazon for $6. I paid $24 because I didn't want to wait another moment to bask in the glory that Steve and the AppleTV were going to bring into our humble living room.

Power. Check.

HDMI. Check.

AppleTV: Working -- Painlessly. If you've setup a Tivo, a XBOX, a PS3, a Wii, ... just about any consumer electronics not made by Scientific America, you know exactly what to expect. You have a remote, there's an onscreen keyboard, and you're off. Type in some tedious shit and there you go. If you have an iPad or an iPhone you can mate them with the AppleTV to vastly improve the on screen experience. Or, you survive with the ubiquitous generic Apple remote: it's the same one you use with their Laptops. It works fine.

Netflix - It works, like magic. It's better than on my Laptop.

AirTunes - Stream music from iTunes on my Laptop to the AppleTV and into my stereo. It worked, like magic, for about 90 seconds. Then it the audio got choppy. Then it stopped. It could be that my absurdly fast top of the line Macbook Pro with can't stream MP3s and run the screensaver at the same time.

iTunes TV - It worked the first day. Tonight I tried to watch Lie to Me and it's yet to get past Loading. Maybe I should reboot. That said, I'm excited to see that they have two BBC stations. Even though it failed tonight I can't help but think that I'm better off than with Comcast or Time Warner Cable.

Home Sharing - It works, like magic, if we're going by 1st edition D&D rules: Today, for the first time, I was able to share Music and Photos from my laptop to the AppleTV. It didn't work at all for the first week and it hasn't worked since this afternoon. Can I get a new set of dice please?

Flickr - It works, provided the photos you want to show are public.

MoblieMe - No clue, I pay for MobileMe so I can find my phone.

YouTube - Works as expected.

Podcasts - Works as expected.

I was disappointed this evening when I tried to watch Lie To Me via iTunes. 

I've been disappointed trying to play music from my Laptop to the AppleTV. 

I've been disappointed trying to play music on the AppleTV from my Laptop. 

Then again it was $99, it plays Netflix really really well and that's why I bought it. 

I give it a: B-

Posted via email from mhat's posterous

link

grace in the face of adversity [Aug. 31st, 2010|11:22 am]

On Saturday our dear friends Rose and Or were wed. It was 5:03pm when we arrived, slightly late but we could see the bride, groom, and best folk queued on the path about to make their entrances. We were just in time, we ran as far ahead of the precession as we could, as far as the wedding coordinators would allow. Down a smooth winding path, stopping at the apex just before the opening where the ceremony was to be held. 

We stop, we're told we can enter behind the wedding precession once they pass.

Music is queued: Superman! Groom's entrance. 

To our Right Or comes flawing down the path. Head slightly down, arm up: Superman! 

 

Invariably, at every wedding, something does not go according to plan. How the family, friends and couple respond to the adversity is remarkably telling. 

 

Or, in full superman sprint, as he reaches the apex, slips. He falls. He tumbles. He breaks his front teeth. After a lifetime of careful oral hygiene: thirty plus years with out cavities, on their wedding day. 

He's stunned. I'm stunned. Those closest to where he fell run up to help him. He's on his feet. Disorientated, acutely aware that his mouth is suddenly and dramatically different. He collects himself. Arms back in the air and completes his entrance. 

Rose, at the appointed time makes her way down the path. More slowly, she warmly berates us for our late arrival "Shame! Shame!", as she passes. She doesn't know yet, she won't until she gets to the stage. It becomes unavoidable at that point. Your soon to be husbands front teeth: that's something you notice. 

 

Here's the question, in that situation how do you think you would fare? As the groom, do you think you could pull yourself together, dazed, sore and without a portion of your front teeth. As the bride, meeting your husband at the alter no longer as he was. Could you, individually and with your partner, with your friends gathered, with amazing grace, roll with it? To laugh at the situation and still enjoy the day to the fullest? 

They did and it was inspiring. 

 

 

 

Posted via email from mhat's posterous

link

vertigo and motivation [Aug. 25th, 2010|01:06 am]

I sat down on the cold metal stairs waiting for the vertigo to pass. I had already worked my way down twelve flights of short but tightly spiraling stairs. I didn't feel good but my options were stairs or standing in the sun waiting for the elevator. 

Hours earlier we were stacking pitchers of Pliny the Elder with a potential new hire. 8.0 ABV. 

I decide, still on the stairs, this is the worst hangover I've ever had. At any other point in my life I'd have gone home, gotten in bed and tried again tomorrow. 

Yammer's something special. I can't explain what it is exactly but each time I wanted to give up, to go back to bed, I thought about Yammer. We're doing so much more right now than most people outside of Yammer can imagine. We have hard deadlines approaching. Our team is amazing and these amazing people are going to be blocked on my parts if I'm not there Getting Things Done

Nobody would have given me shit for staying at home.

Walking to the office on the hottest day of the year hurt. Coming in to our chef's preparing Lunch before my stomach was ready for solid food hurt. That first hour leaning over my laptop staring at my laptop like an old man hurt. 

None of it mattered though, the hurt passed with the hours, and I Got Things Done

Do you love your work, your projects, your team enough to put the worst hangover of your life aside? I do.

Also, We're hiring ... http://bit.ly/bqlWsR

 

Posted via email from mhat's posterous

link

I'm sorry. [Jul. 26th, 2010|02:34 am]
Linked-In decided to spam many of you. My bad for not reading closely.
I didn't realize they (a) imported my address book at some point years ago and
(b) were giving me a list of people to invite in a paginated view.
Meaning I only saw the first 8. Dozens were hidden behind the fold.

I'm sorry.

Posted via email from mhat's posterous

link

a perspective on misplaced socks [Apr. 18th, 2010|01:22 am]
I flipped the lights on upstairs. Our laundry basket is nearly full. Yellow specs of cedar standout against purple carpet. I see that she's once again deposited yesterdays clothing in the alley between her side of the bed and the wall. Any other night I'd be annoyed. Our laundry basket is no more than four feet away. Moving her cloths to the basket I'd wonder why it's so hard. It's all of four feet id say to myself, between annoyed and amused.

 

Tonight I saw it differently, my perspective shifting slightly. As I reached for her socks I realized it wasn't simply a chore, or a responsibility forced on me but a small reminder that I have a partner, that I'm not alone. Our house isn't about Me, or Her but Us. That I have her socks to pickup in the first place is amazing. And while I'll always be a little annoyed when I have to pickup her socks, it's one of those first class problems. The best kind.

Posted via email from mhat's posterous

link

GlassyLite(tm) [Apr. 5th, 2010|10:41 pm]
link

Untitled [Feb. 7th, 2010|02:39 pm]
I've had a wonderfully domestic afternoon. A sunny cool day, windows open, fresh expresso and a clean apartment.

Posted via email from mhat's posterous

link

ten years ago [Dec. 31st, 2009|10:17 pm]

Ten years ago I was 21 working at FundsXpress.com where I was a founding programmer. Our product was a turn-key online banking system for small to medium banks that wanted to offer online services to their customers but didn't the development resources of the bigger banks. It was 1999 about to be 2000 and everyone was all too concerned with Y2K. Just what was going to happen? Zombie Apocalypse? The end of the world as we know it? As it turns out, no, not so much. In fact the only problem I remember was that my bank's (Liberty Bank SSB, now Prosperity Bank, I don't use them anymore) VISA Check Card didn't work when I tried to buy a bottle of scotch and a colorful array of champagne on my way to a NYE party.

The fact that I was going to a NYE party was a point of contention with the then CTO of FundsXpress one Jonathan Harbor. Overall I don't remember much about Jonathan beyond a these points: 1. He believed a servers name should be inclusive of all services that server would run. On the surface this isn't so bad: oracle-db-001, etc. In practice it tended to be more like prod-ora-10g-patch-5-db-backup-002. Naturally as systems evolved over time the hostname changed. 2. If one were to put much weight into the stories told over pints late into the night, one would be under the impression that our CTO was formerly a very successful back-ops political assassin. 3. When it came to weapons, guns, it turned out that he had almost all of his facts wrong in very painful ways. Suggesting that he was not in fact the inspiration for Sam Fisher, Solid Snake or Tom Grisham as he would have had us believe. 4. He and the VP of Development Joyce Konigsburg waged an all out war. The losers were development, operations and our share holders. 5. Finally, Harbor believed that for Y2K we needed the entire senior engineering team, customer service, and a selection of other employees to man the office. You know, just incase Y2K was a big deal.

I wasn't there. What would be the point? If the world financial and monetary systems melted under the weight of a few bits, what were we going to do? We provided an online banking service. The most we could have realistically done is taken the site down, replacing our happy holidays logo with something more suggestive of the times. Perhaps an obvious quote from our early days and living example of why you never write this-shouldn't-happen error messages: This shouldn't happen, the aliens have landed, bend over and kiss your ass goodbye. Incidentally that message didn't go over well. I learned in my time at FundsXpress that bankers have a penchant sense of propriety when it comes to public image. Privately they're all about steak, liquor and porn. I'll never again question the efficacy tits and the back-room to the sales process. 

I probably would have gone, ignoring the futility of the event and my obvious disdain for two executives who would no doubt be at the Y2K event, had it not been deemed a dry event. As FundsXpress grew to ~300 people our collective our social fabric became largely based on an appreciation of scotch, tequila, expensive but horrific smelling cigars and the curious discovery of discarded undergarments late in the evening. Booze and Gossip. During our growth we came to acknowledged certain truths: HR provided free cab ride home vouchers to all employees, replenished as often as you needed. To maximize cliché, work hard play hard, was an unofficial motto. Our employees were important and having them turn up as the example du jour for Mothers Against Drunk Driving just wouldn't do. No doubt, given our conservative and overly paternal HR department a metric to gauge play hard had consequences. FundsXpress would host a NYE part and come midnight there would be a toast with sparkling water and apple cider. Some of us were asked to be in, while others were ordered. Liquor was forbidden.

Instead I was paying for an 18y bottle of Macallen and few bottles of forgettable pink champagne in cash because my VISA Check Card couldn't be bothered. It would work just fine Jan 1st 2000, but not Dec 31st 1999. Then off to my Matt and Amy's NYE bash. The champagne was pink because we were supposed to bring colored champagne. It was a small party, I vaguely recall ten or twelve of us and a good fourteen bottles of champagne. Not to mention beer, wine and course that 18yr bottle of Mccallen. We toasted when the hour came. Bottle after bottle the champagne was downed. A few folks left early, those of us that stayed were dedicated to finishing all of the champagne. This isn't the sort of bold contest you begin of sound mind or body nor does it end with such either. There were fireworks, the kind that launch fiery projectiles into the air and into near by trees. Those were best operated by only the most intoxicated.

That night close-captioning gave birth to one of my Austin friends longest running in-jokes: roman nun earls and their tendency to write bad checks.

Tonight is very different. 

Tonight @abright and I are having a quiet night at home. Champagne soon, but not in the excess of days past. I miss my Austin friends. Those that went to the FundsXpress party out of obligation or solidarity, those that were at that 1999 NYE Party of Matt & Amy's and those that I'd meet later.

Happy New Year Austin, San Francisco, Los Angeles, Cambridge and Somerville.

Posted via email from mhat's posterous

link

holiday places [Dec. 26th, 2009|11:01 am]

Posted via email from mhat's posterous

link

navigation
[ viewing | most recent entries ]
[ go | earlier ]