Posts

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 into

Ruby Kaigi 2010 Day 3

Image
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: http://redmine.ruby-lang.org/issues/show/3285 You can now change modes in a block (added to trunk

Ruby Kaigi 2010 Day 2

Image
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

Image
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-receive&

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 present to

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 and so

Rails Conf 2010 Day 2

Image
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't

Interview Coding Problems

One of the awesome things about the business we're in is that you can ask people to actually do the thing you're hiring them to do IN THE INTERVIEW! You can't really ask a banker to do some banking during an interview, but it's relatively easy to set up a computer with a coding problem and ask a potential hire to work through it. Having recently gone through a job search, I though I'd discuss my thoughts on coding problems as part of the interview process. The first time I ever wrote code for an interview was at ThoughtWorks . It was a 3 day at home coding problem. There were always 3 different questions and each could be knocked out in a few hours. The candidate could choose which one they wanted to solve and upon submission, the solution was looked at by at least 2 different developers. The great part about this is that we could filter out a lot of candidates before bringing them in to the intensive day long interview. The downside of a take home test is th

Upcoming Speaking Dates

I'll be giving an all new talk entitled "The Necessity and Implementation of Speedy Tests" at Ruby Kaigi in Japan! Ruby Kaigi is being held August 27-29th, 2010 in Tsukuba, Ibaraki, Japan. Very exciting! Want to see the above talk but can't make it to Japan? I'll be giving the same (ish) talk at Ruby Midwest in Kansas City, MO. Ruby Midwest will be held July 16-17, 2010. Stop on by and say hello -- I'll be the guy in the crazy shirt.

Why I Left Obtiva

Recently I ended my nearly 2 year relationship with Obtiva and why I left deserves a few words. The issues I had with Obtiva were mostly just issues I have with consulting: You only work at places messed up enough that they need to hire consultants You leave before you get to spend time with code you wrote so it's hard to learn long term lessons The most stable gigs that pay the bills for a consultancy tend to be the worst programming experiences (Large corporations with way more money than sense) You have to track every hour of your time Time off has to be negotiated with two companies instead of one Learning a whole new bunch of names. personalities, and organizational structures every 6 months Now don't get me wrong, consulting with ThoughtWorks and then Obtiva made me a much better programmer and was an amazing learning experience but I felt that, in order to grow as a programmer, I needed to work for a product company and learn the lessons that only living with a code bas

Are you Really Doing Agile Development?

So recently at work I was asked help to make the company more "Agile." Well I'm a developer first and process wonk second so I responded with my usual "How many of the 12 practices are you really following?" Which was met with a lot blank stares. Turns out the classic XP practices are not so easy to find on the internet anymore. It also turns out that the word "Agile" has been so successful that lots of people don't know that XP stands for Extreme Programming. Now I'll be the first to admit that "Extreme Programming" is a colossally stupid name, but what I like about XP and the original 12 practices is that they were controversial and easy to evaluate: Either you were doing them or you weren't. What I don't like about "Agile" is that it's so broad and defined in such a "hand wavy" way that pretty much everyone can fool themselves into thinking that they already are fully Agile. So to fix this and