Showing posts from 2010

Oracle Foreign Key without Index Test

We've been having some Oracle deadlock issues that have been hard to reproduce locally. After a lot of investigation and solving of important problems that happened not to be THE problem we figured out that while we've been pretty good creating integrity constraints in the database we have not been very good about making sure that every foreign key has a corresponding index. And that can lead to problems. So we had a situation were our documents table had a foreign key on the accounts table that was not indexed. So updating an account row lead to a whole table lock on documents (instead of just a row lock which would have happened if there was an index) and that was very bad when we had two separate processes where one was doing a bunch of accounts stuff and the other was doing a lot of documents stuff. Deadlocks for everyone! The sad thing is that if we had just drank the Rails cool-aid about having no integrity constraints in the db we would have been fine but we got int

Ruby Kaigi 2010 Day 3

Last day of Ruby Kaigi! Sad to see it go, it's been a great conference. As per usual Tweets are in bulleted italics and the rest is after the fact commentary. First I've got to show you the commemorative fans they were handing out: It's Matz and... Someone else (sorry if it's obvious - I don't know). And of course they are programing in the bath. BigDecimal: You can handle numbers as large as can fit into memory as opposed to the IEEE double #rubykaigi BigMath is the Math module for BigDecimal #rubykaigi Lots of different rounding modes in BigDecimal #rubykaigi BigDecimal.mode is global per process - not thread safe #rubykaigi So BigDecimal is Fiber unsafe #rubykaigi Bummer. .@mrkn implemented a solution storing mode in thread local #rubykaigi Oh good. Wait, is that in 1.9.2 or trunk. I'd have to be in 1.9.2 right? To the Google! ... Yep, seems like it made it in: You can now change modes in a block (added to

Ruby Kaigi 2010 Day 2

Holy crap am I tired. It's been a long awesome day. It started out with some excitement: Just found out I have an hour time slot when all I prepared was 30 minutes. Ok, time to write some more. #rubykaigi Panic! Maybe I'll talk about metric_fu a bit. #rubykaigi I must have looked at that schedule 20 times and never realized that I had an hour slot. Everyone else had 30 minutes so I thought I did too. Attendees of "The Importance and Implementation of Speedy Tests" will also get "Metrics Based Refactoring" at no additional cost! #rubykaigi I did something I almost never do: Look at crisis as an opportunity (crisi-tunity). I had to write "Metrics Based Refactoring" anyway for Windy City Rails so why not write it now. In less than 4 hours. While watching my friends present at a conference. Looking over those sentences now I can't believe I didn't freak out. Ted Han used publicly available data to settle reviewing bais accusations agains

Ruby Kaigi 2010 Day 1

Here I am in Japan at RubyKaigi 2010. Wow. Generally I tweet a lot about the conf live and then publish those tweets here (in italics) and provide slightly more commentary. So lets get it on. So my flight leaves at noon for #rubykaigi, takes 13 hours, and arrives at 3pm tomorrow... Wait -- that can't be right. #looksitupagain Before today's trip to Japan the furthest from the U.S.A. I've ever been is: Canada. #howisthatpossible In cab. It has begun. Someone once said "If you've never missed a flight you're spending too much time in airports" #atgate2hoursearly Yep - can you feel the panic in those first couple of tweets? I was totally freaked out. The actual trip turned out to be easy. I met up with Chad Fowler, Yehuda, and Woody at the airport and we took a bus straight to Tsukuba. I went to an exotic foreign land and the first thing I did was take a bus through 100 minutes of strip malls. But I was in Japan. And Yehuda held forth on 'snowmen

Using Git Inside a Git Hook

Using Git Inside a Git Hook can cause problems. In my previous post: " Signal 13 Problems with Git Hooks " I describe how we are trying to automatically merge certain types of branches into a branch that is designed to hold them all. Anyway, that means we want to run some git commands inside of the git hook. We change dirs into another directory where we have a clone of the repo and start telling git to merge some stuff and we get a bunch of remote: fatal: Not a git repository: '.' But if we run the exact same commands as the git user everything works fine. Huh. Eventually we got our linux guru over and he noticed that the environment under which the git user runs is totally different when inside a hook. Gitolite does a bunch of things to the env, but the one that was screwing us up was the setting of the GIT_DIR. After we figured that out, the solution was as easy as: ENV.delete 'GIT_DIR' in our ruby script that is triggered by the 'post-recei

Signal 13 Problems with Git Hooks

Ran into a gotcha in Git today when trying to write a post push hook. We want our designer to have a fast turn around time with clients so we're writing some hooks to merge all of the 'theme' branches he works with to get merged into a special preview branch which is then deployed to the preview site. And all this should happen after he does a 'git push.' Seems like a 'post-receive' hook is just what we want. Except that every time we tried to create one we got these errors on a push: error: git-shell died of signal 13 fatal: The remote end hung up unexpectedly error: error in sideband demultiplexer If the 'post-receive' file even existed in git_dir/hooks/ on the git repo box, we got this error. We checked permissions, gitolite docs, git docs, google, etc and no help. We finally realized that Git was piping in some information to our 'post-receive' file and since we were not consuming it, that was causing the explosion. So, I prese

Ruby Midwest 2010 Saturday

So day 2 begins. I got to bed early-ish as I am old so I'm fresh as a daisy and ready for more Ruby. As per my established practice, Tweets are in italics. Keynote by Yehuda Katz (@wycats) is up next at #RubyMidwest I'm wondering why you can't give a technical keynote? Everyone says so. #RubyMidwest Why is that, exactly? It's a technical conference. And a single track one at that. So I say tech it up, baby. Things that seem really easy are actually huge blockers to new users @wycats #RubyMidwest .@wycats started Rails dev on windows - me too. #RubyMidwest "What the F** is that thing with raw_host on it?" Ex of a small thing that is a blocker to a noob @wycats #RubyMidwest Yeah, I had a few of those. I had no idea how to do public static final in Ruby. When I figured it out it lead to one of my early blog posts: Public Static Final for Ruby RT: @RubyMidwest Big thanks to @mbleigh and @intridea for hosting the OMGWTFBBQ dinner/lightening talks/hack

Ruby Midwest 2010 Friday

So people often ask me why I tweet so much at conferences (113 tweets today, for example). Well, usually I'm furiously typing notes into TextMate so I can blog about it later. Now, in the post twitter world, I type those thoughts into twitter and harvest them later for my wrap-up posts. That way people can follow a conf's progress live or wait for the recap. So Tweets will be in italics and everything else is bonus commentary. Generally the first day of the conference went amazingly well. Hard to believe this is their first year. Wifi was plentiful, food was decent, and the space was nice. Oh and the talks were good too. At @RubyMidwest waiting for the fun to begin So I think the official hash tag for @RubyMidwest is #rbmw or at least that's what the welcome tag said. Although #RubyMidwest is popular So there was a lot of confusion about the official Ruby Midwest Twitter hashtag. The badges said one thing, the welcome screen said another, and everyone else chose a th

The Road to Ruby Midwest

Crazy day: It was the day before Ruby Midwest so I gave my 'Speedy Tests' talk to my workmates at Backstop Solutions during lunch today and they had the nerve to find some things wrong with it -- so I'll be doing some re-tooling before Saturday. Then I was all set to leave 2 hours early for the airport when my manager wants to talk about me helping QA understand our process, new features, and maybe get some automated tests running. Hell to the yeah. So I'm all over this opportunity but our conversation makes me leave the office a bit late to catch my flight. No problem, I build in a lot of buffer. Then the Blue line (Chicago's subway) was down. Uh oh. Some surly dude said there was a free shuttle to somewhere else but I couldn't find it so I took a cab. Crazy traffic puts me at the airport with 30 min until my flight. Panic! But the security lines are longish so I panic while inching forward in a zig-zag line. Then I sprint to terminal C (which is t

Rails Conf 2010 Day 3

A few days late on this because I've been sick all weekend. There just has to be a way to do climate control in conference centers in such a way as to not destroy the planet and, more importantly, Jake's health. I seriously wore black jeans and 2 shirts on hot summer days and yet I was shivering and caught a cold. But let's get to last day of Rails Conf 2010 and my exciting adventures therein. (tweets are in italics ) Woke to "Relax" by Frankie Goes to Hollywood. Which is good 'cause my heart was pounding. Settled it with some bacon. #railsconf Yep, I could feel cold coming but I was in denial. I ran into Neal Ford at breakfast and we chit chatted about this and that and then he mentioned that he had read my blog post from yesterday. First thought: I published that sucker at 1am this morning and he's read it already? Second thought: Oh shit, what did I say about his keynote -- I think I called him a jerk at some point. But my brain was foggy a

Rails Conf 2010 Day 2

Only 40 tweets today (re and otherwise). I must be slowing down in my old age. Tweets are in italics . Today's morning music was "Bulletproof" by Pop Will Eat Itself. Cram that in your head @ryanbriones Ryan was complaining yesterday that he had the theme from flash stuck in his head all day because of me. That sounds awesome! I had a Daft Punk song stuck in my head all day today and I was a better person for it. Trying to work on my Lightning Talk. Lightning talks are usually the best part of any conf so it better be good. 4:25 today #railsconf Lightning talk is finished. Title: "ActiveMQ and ActiveMessaging: I've Experienced the Pain So You Don't Have To" #railsconf Yeah, I got up, worked out, ate eggs wrapped in cheese and bacon, showered and then realized I had gotten up an hour early by mistake. Opportunity! So I worked on the lightning talk. To be honest, I was kinda pissed at myself for the boneheaded alarm mishandling but if it doesn&