Archive for the ‘Uncategorized’ Category

Three Dot Oh

Monday, August 30th, 2010

If you haven’t heard already, Rails 3.0.0 was released earlier today! Congratulations to all who have worked on this release since December 2008. Thank you.

With this “final” release of 3.0.0 finally out the door, I’ve seen a great uptake of it and I’m excited to see what people do with it. Whilst it almost seems mandatory to participate in the circlejerk, I am going to take leave from it this time and delve into something else very much related.

Even though Rails 3 is out and we should all really upgrade our applications right now, there’s going to be some people, like myself, who are still going to be developing Rails 2.x applications. I know, right? The guy writing a book on Rails 3 has a day job developing a Rails 2 application.

C’est la vie.

So does my friend Lucas Willett and his team at Ennova and not forgetting the fabulous @jasoncodes. Tonight we were discussing, as we do, things relating to Rails. The (one-sided) conversation goes like this:

Lucas: sup
Lucas: freaking bastard heroku
Lucas: we’re using [declarative_authorization] 0.5 which has only one gem dep of rails 2.1.0 and greater
Lucas: so heroku decides OH SHIT
Lucas: YOU NEED AREL AND ACTIVE SUPPORT AND EVERYTHING EVER
Lucas: VERSION 3 OF EVERYTHING

Lucas is an energetic kind of guy. I can imagine him typing that at no less than 546wpm, frowning intently the entire time.

The problem it turns out is this glorious file. Do you see any problem with it? No?

Not even with this?

s.add_dependency(‘rails’, ‘>= 2.1.0′)

Yeah, that’s right. Greater-than-or-equal to 2.1.0. Do you know what got released today? Three Dot Oh. BOOM.

That’s the problem. That little dependency line’s going to want to install the latest and greatest version of Rails, which just so happens to be 3.0.0. Oops. But Lucas is still running a 2.3.x application.

So how do we fix this? I’m not entirely sure myself. One of the options (coincidentally the only one I can think of right now) would be to tell Lucas to use Bundler for his 2.x application like all good boys & girls should be doing. Bundler would solve this problem by only loading the gems that Lucas wants. Take this (contrived) Gemfile as an example:

  gem 'rails', '2.3.8'
  gem 'declarative_authorization'

Bundler will only load the 2.3.8 Rails gem, regardless of what Lucas has installed. He could have every single version of Rails installed. 2.3.8 is king. When Lucas (or any code throughout his application) does something like:

  require 'active_support'

RubyGems won’t through a hissy fit similar to this:

Gem::LoadError: can’t activate activesupport (= 3.0.0, runtime) for ["railties-3.0.0"], already activated activesupport-2.3.8 for []

Bundler’s got that covered.

I hear you cry! You say: “But (Sir/Lord/King/Dickhead) Ryan, I thought Bundler only worked with Rails 3!!one” (for one of the exclamation points, you actually say “exclamation (point!)”). This is simply not true.

There are lovely instructions on how to use Bundler with Rails 2.3. I would suggest that you (along with Mr Willett) read these to save yourself some potential headaches.

Why? Because right now if you do gem install declarative_authorization and you don’t have Rails 3 installed, you’ll get it installed:

Successfully installed declarative_authorization-0.5
Successfully installed activesupport-3.0.0
Successfully installed activemodel-3.0.0
Successfully installed rack-mount-0.6.12
Successfully installed tzinfo-0.3.23
Successfully installed erubis-2.6.6
Successfully installed actionpack-3.0.0
Successfully installed arel-1.0.1
Successfully installed activerecord-3.0.0
Successfully installed activeresource-3.0.0
Successfully installed actionmailer-3.0.0
Successfully installed thor-0.14.0
Successfully installed railties-3.0.0

[dhh voice]WHOOPS![/dhh voice]

So yes, the short end of this story is: use Bundler. Please? Yehuda’s put a lot of effort into it and I’m pretty confident it’s going to save you (and Lucas!) a lot of heartache in the future (of which Bundler is a big part).

I hope to see a lot more of you out there using Rails 3 (like Gemcutter is). Until then, I’ll be quietly sobbing at my desk working on this now ancient relic of a Rails 2 application. Enjoy.

IRL Help

Tuesday, August 17th, 2010

I’m generally viewed as a Helpful Person, mostly online. But I am also generally helpful in the “real world” too. I do weekly shopping trips for the GetUp office, I get coffee and I debug “computer says no” issues. Generally a helpful kind of guy.

Today I was walking home and I stopped in at my local shopping center to get ingredients for my dinner, Yet Another Bachelor Meal: Tuna Patties Edition. I decided after getting these ingredients that I didn’t want to walk along Parramatta Road where all the car fumes are, but instead elected to take the “back route” which is about the same distance, but much quieter and less fumy.

About 500m away from the shops, I’m walking along one of the backstreets and I see this… shape… moving side to side. I didn’t know what it was. As I approach it, there’s just enough light from the streetlight on the other side of the road that I can see it’s this old lady trying to push one of the shopping trolleys from Coles.

As I near her, she must have heard me and asked if I could help her move her trolley. It sounded like she asked if I could move it to the bus stop. Being the generally helpful kind of guy that I am, I did that since the bus stop was about 50m up the road. I thought she was going to get on a bus and take her stuff home.

She looked about 70 and shuffled very slowly, using the fences and walls along the way as support. She was probably walking less than a kilometre per hour. When I moved the trolley it must’ve weighed as much as her! This thing was deceptively heavy and I was thankful that it was only to the bus stop! When I got the bus stop I looked back at her, waved & shouted a goodbye and then carried on my way.

Not 3 steps later, dogs start barking behind me. Thinking it was just the usual racket, I keep carrying on.

Then the old lady shouts for help.

Fuck. My first thought was that she was being attacked and by the dim streetlights it certainly looked like it. She was bent over in an almost “stop biting my legs” kind of fashion and the dog was “strafing” around her and barking.

Adrenalin instantly kicks in. I go into Hulk Mode and run up to the dog and shout as loud as I can:

“Get off!” “Go away!” “BAD DOG”

The dog stops harassing the old lady and sets it sights on me. I can see it clearly now. It looks almost like a kelpie, but I couldn’t pick the exact breed. It starts barking at me and I bark back.

“BAD DOG” “SHOO” “GO!”

The old lady’s behind the dog, I’m at the front. I tell her to come past the dog but stay wide. It’s about at this point something ridiculous happens.

A guy in his mid-20s, rides past on a bike. No earphones in (this is important). I shout at him “YO! You! Need your help here!” He just keeps on riding. I want to find this guy and this dog again, and put them in a room together to let him know what it feels like.

For me, I was fucking terrified. I was bitten by a Terrier when I was 10 on my ring finger of my left hand. I have the scars to prove it. The dog was let off the leash and rushed up to me and grabbed my hand. Instinctively, I try pulling away whilst the dog still has a grip. I stand up and this little terrier is dangling from my finger. I don’t remember what happened next, but I know that there was a lot of blood. I didn’t want that to happen again.

So this old lady manages to get next to the dog all the while I’m screaming at it “SHOO!”, “BAD DOG!”. The lady gets past and we both turn our backs. I see the dog come running up beside me, still barking. This is where I thought it was going to have my leg for dinner. I turn around in Extreme Hulk Mode and shout “LEAVE NOW!”. That seems to be the magic words as the dog puts its tail between its legs and decides that tonight is not the night to fuck with the angry guy who can shout louder than it can bark.

The dog’s still barking as we walk off and then one “ruff” later, it stops. Peace and quiet. Some old lady two doors down is out the front of her house and me still being in Jack Bauer on Steroids Mode, say “Call the RSPCA!” like it was a matter of Utmost National Security. She replies and says she’s called the rangers many times and they won’t do anything until the dog bites somebody. Apparently the dog just roams out the front of the house, harrassing people as it walks past. I think this is strange because I’ve been down this road once or twice and never had it come to me before. I bid Elderly Lady #2 goodnight.

Elderly Lady #1 tells me that actually she doesn’t want the Super Heavy Maxi Trolley left at the bus stop, but she wants to take it to her house which is about 500m down the road. That’s cool. I’m still hopped up on Adrenalin and feeling like I could battle Chuck Norris and Bruce Lee simultaneously and it’d be an OK fight.

We walk at her steady shuffling pace for the whole time and she tells me that 9 years ago she was in a car accident, twisted her spine and damaged her hips. The legs feel fine in the morning but when she gets tired they lock up, like they’d done tonight. She seemed like she was in a lot of pain, but she was handling it well. She said that the doctors do nothing and that they don’t treat it with surgery, but rather give her pills. I guess that’s a cheaper alternative, but is it really the best? I am not one to say.

She keeps saying things like “thank you so much for helping me” and “I would have been stuck back there with that dog if it wasn’t for you” and I humbly accept these thanks. We talk about the dog some more and she asks what I do for a job now. I say that I’m a programmer, but I really love animals. She suggests that I should have been a vet. I would love to be one, but I can’t stand the heartbreak of losing an animal. When the family budgie died — the one we had since I was 3? — it broke my heart. Then in April at Railscamp I got the news that the family dog, Rex, was put down. He was suffering from arthritis and was blind. He was a stupid dog, but was great to have around. Veterinary isn’t for me.

As we cross the road she points a little way up the street and says “that’s home”. I’m thankful. Super Heavy Maxi Trolley is making me use muscles I haven’t used in probably too long. We speak some more, this time about the guy who rode past on his bike. She says that when she was younger, people always helped each other out. Now it’s all “me, me, me”. She thanks me again.

We come across a very friendly black cat which I use as a distraction from pushing the trolley which I temporarily leave against a wall. I stretch my arms in the guise of stroking the cat as it winds its way between my legs. The cat leaves to go rub itself on some parked cars and roll in the gutter. Cats are awesome.

We run out of high wall about 150m from her house and the lady grabs on to the trolley as we near our destination. “The one with the light here” she points in a narrow doorway to two units. “Number 2!” she says, almost sounding relieved. The cat’s stuck with us and proceeds to scratch at the door, and I thought it must have lived there.

The lady tries to get to her handbag to get the keys. The handbag is not-so-strategically placed under the heaviest bag of the bunch and when she goes to lift it I stop her and do it myself. I’ve seen people really hurt themselves by doing simple things like this, and I don’t want her to come to harm. She finds the keys and unlocks the door and the cat just saunters up the stairs. The lady tells me that the cat doesn’t live there. Hm. Then how do you get the cat out?

I lift her bags out of the trolley which we leave just outside her door and then I take the bags upstairs to the front door of her unit. I come back downstairs where she’s waiting and she says “I have to pay you, you have been so good to me for no reason.” I say “No, it’s OK” but she insists on giving me a scrunched up $10 note from her purse. She wouldn’t take no for an answer.

So the cat. I think myself a bit of an animal person and I wasn’t quite sure how we’d get it out, but apparently crouching out the front, clicking my fingers and saying “here kitty kitty” like they do in the movies… that actually worked. The cat came up and stroked itself against my arm and then rolled itself in the gutter.

I asked the lady if she could get up the stairs and she said yes and bid me goodnight. I walked off feeling like Rambo and wrote a tweet very similar in style to this XKCD comic.

I think at this point in time the Adrenalin has worn off. Yesterday I felt like crap. I felt alive tonight.

If you see someone in need, please don’t be like that jackass on the bike and keep going. Stop. Help where you can. Surely we’re all better off if we all help each other rather than being pathetic self-serving bastards? We are all human. We should show compassion to all those around us. As the note right above the handle on my bedroom door says: “Be awesome always.”

TL;DR: I helped an old lady with her really heavy shopping trolley. A dog heckled her and I vocally bitchslapped it into submission (all the while feeling like Jack Bauer talking down a terrorist). Then an awesome black cat came up and was really friendly. I may have used up my Adrenalin allowance for the entire year.

Moving Out: For Reals

Monday, August 9th, 2010

I promise I’ll get back to the technical side of things soon. If you’re reading this in desperation for more technical goodness I hear there may be a book that will sate your appetite.

I’ve been thinking for the past couple of days of all the different possible combinations of what could happen. It effectively boils down to three options:

  1. Marcelo and Larissa get the place they applied for and we all move out together. Rent will be cheap but there are 3 other people I’d be sharing a house with: Marcelo, Larissa and Adrianna (the reason I’m moving out in the first place). They like parties, I don’t.
  2. Marcelo and Larissa don’t get the place they applied for, and then we’re stuck in the sticky situation of me calling back my rental buddies saying things like “You know how I said I didn’t need that place? I actually do need it.” then them saying something like “It’s been taken” and me pulling a GIGANTIC SADFACE.
  3. I move out to Narwee with one of the rental buddies I found on easyroommate.com.au, Tim.

The third option to me sounds like the best and most sensible right now. In hindsight, I don’t know why this solution wasn’t obvious from the beginning. If I move out of this place and Marcelo and Larissa don’t get the place they applied for then it frees up the room for Adrianna to move into. I get to move to a new neighbourhood with a person with similar interests and perhaps meet some new people. I also free Tim of a roommate who’s a bit of a “daddy’s girl”. A definite win-win-win.

I’ll be out of here in probably two weeks, catching the train into work which is awesome since being on the train will give me more time to do writing / other things.

Exciting times!

Moving Out: The Reckoning

Saturday, August 7th, 2010

 I wrote a post last weekend saying that my housemates were asking me to move out so that their cousin could move in. Since then, I’ve looked at about 6 different places throughout the week like:

  • A place in Surry Hills on the 7th floor of an apartment building
  • Tiny little room in a terrace in Surry Hills
  • A largeish room in Five Dock, but way way waaay away from public transport
  • A medium-sized room in Narwee, with a really awesome guy
  • A tiny room in Summer Hill

I got all these contacts through the sites Gumtree.com.au and Easyroommate.com.au, and it’s a really easy process. Just getting to the places take a while.

I met quite the broad spectrum of people and was keen on moving to Narwee since that was the most affordable and the guy was a linux sysadmin (this is the part where you berate me for not stepping outside my comfort zone, and where I counter-claim that comfort zones exist for reasons you just wouldn’t understand).

Then as I was going between places today my current housemates text me with a whole slew of pictures showing an awesome 3 bedroom house that we can all move into basically around the corner from where we’re at right now. First bedroom’s for them, second for their cousin and third for me, so it all works out well. And with 3 different “groups” paying the rent, it’s going to be way cheaper than any of the other places. So I think I’ll be sticking with these guys since they’re only thinking of having it for the short term (until December) anyway. It’s great that I get to stay with Marcelo and Larissa, I really enjoy their company.

Of course by me now staying with them, I now have to phone up the people who I’ve “interviewed” with over this past week and tell them all “thanks but no thanks”. That’s a “tomorrow job”, for certain. Totally buggered tonight.

It’d be nice having a little bit of certainty for my future, but I should know by this stage (after moving interstate twice in two years) that certainty is only a word, and would never be more than that. Nothing is certain, everything changes, and you just have to deal with it. This is just another one of those things. Next year I may even be in another country. I’m cool with that. Parents may not be, however.

So I’m here until December at least, and then after that I guess I’ll go all mercenary and sell my soul / body to the highest bidder / most awesome looking place. Who knows? Nothing is certain. Everything changes.

Moving out

Sunday, August 1st, 2010

At the beginning of the week my housemates and I chat and the conversation was basically thus:

Housemates: “Ryan we love you (as a housemate) and we found this awesome 3 bedroom place in Ultimo, wanna come with us? It’s big!”
Me: “OMG YSPLZ” (I work in Surry Hills)

I went through the week thinking I was doing well with my housemates.

I come back this afternoon from a shopping trip and the conversation goes like this:

Housemates: “Ryan, our cousin is being kicked out because he had an argument with her housemate and we’re thinking of letting her move in here.”
Me: “That’s OK, we have the spare bed.” Me: “…” (but in my head there was this)
Me: “Ok, I will see what I can do.” (but in my head this)

So I find myself in quite the fun situation again of having to look for a new place. I’ve re-opened my ad on easyroomate and hopefully I’ll get as many bites as I did last time. I’ve also been applying for some places and I got a pretty alright hit rate from that last time too. We’ll see how things go this time.

So in 4 weeks time, I’ll be out of this place and in my new one. I’ll be sad to leave Marcelo and Larissa, but I suppose I do have to get out and explore some more.

Some may view this as a dickish move, but I don’t. I understand where they’re coming from. I hope them all the best and I have no bad feelings towards them.

I just hope I don’t end up like this.

Helpdesk

Tuesday, July 27th, 2010

I am your helpdesk.

That’s right. Me. The Ruby programmer who works by day and writes by night and helps you out in between (and sometimes in dreams).

You come to me with your computer troubles and most of the time you leave without them. I usually am quite happy to help you, but I must confess my motivations are entirely selfish. I help you to help me.

If you’ve got a problem and you don’t know how to fix it then you approach me (or in the case of my day job, one of the tech team). This is because I’m perceived to “know about computers” even though I specialise in Ruby and web development. Sometimes it’s not even computers. Sometimes your router was connecting to the internet and “now it just doesn’t, I did nothing I swear!”.

So you’ve got a problem. Ok. What’s the end goal? Are you trying to open a file? Connect to the internet? Build a death ray? Good. We’ve got that sorted. Ok, what could possibly be wrong? Is the file corrupt? Are the cables connected properly? Did you forget to turn it on?

I’ll go through the steps I know that should work because I’ve done this before. Why have I done it before? Because I’ve been there. Because I’ve seen someone else do it. Because I just have an uncanny knack for Figuring Shit Out. Somewhere along the line, something isn’t quite right. We’ll work through it and at the end of it I’ll explain what the problem was and you’ll nod your head in agreement and wait patiently for me to finish explaining things and then I’ll go away feeling like I’ve helped somebody.

Later on down the line when I encounter this issue, I’ll know how to fix it. Because I’ve been there before. By helping you, I help me.

So when the little prissy web developers tell stories of being approached by their computer-illiterate co-workers and being asked for help… they tell the story in such a fashion:

But I’m a web developer, not helpdesk! Just because I know *something* about computers doesn’t mean I know everything! Why are they coming to me?

Well listen up, softie. They’re coming to you because they respect your opinion. They think you have the brains required to solve this little issue and it shouldn’t be below you to help them out.

Do it. Contribute back to the world in that little fashion by showing them that the USB cable doesn’t go into the network plug (uh huh, I’ve seen it and check for it now) and that it actually goes in this smaller rectangular socket. And don’t do it condescendingly. Take them through the steps they need to know in order to fix it so that they can do it in the future and perhaps show somebody else.

Perhaps you’ll learn something in the process.

I’m Wanted

Saturday, July 24th, 2010

Within 24 hours of announcing I left Mocra, I received many, many job offers and it astounded me. It astounded me that I was so wanted by people from around the world.

They came from near and far and I ended up picking a 3 month contract with GetUp in Sydney. I loved what I did at Mocra, but I love what I do at GetUp more. Both Mocra and GetUp are superb and really, really passionate about what they do.

I started on 22nd February and I’m still working there. What was originally a “3 month contract” has now turned into an 8-month contract, with the possibility of being extended even further than that. I’ve taught the team Ruby on Rails the best way I know how (inspired by Dr. Nic & my experiences at Mocra) and we’re rockin’. Still. I get up (no pun intended) in the morning and go “I have to go to work” not “[groan] I have to go to work.” At least, most days.

Then in April, shortly after I return from Scotland, I get contacted by Manning Publications who ask me to be a co-author for no book other than Rails 3 in Action. That morning I bounced off the walls. Overjoyed is an understatement. Think teen girl at Justin Bieber concert and you’re getting about a tenth of the way there. I love writing and I love teaching.

So I took that job up too, along with the GetUp job. It’s been a while since I’ve juggled two jobs (since my Coles/PHP freelancing days) but I’m handling it surprisingly well and I think it’s mostly in part to the awesome teams I work with for both of them.

But by the end of the year, there’s a huge chance that I’ll be done with both of them. I will have taught the GetUp team a lot of what I know about Ruby on Rails (and they’ll have taught me some too!) and I will have finished and published the book.

So then what? Well, that part’s up for debate.

On one hand, staying in Australia would be great because I have a lot of friends here and I’m generally well-known to get work if I need it. But you could apply that to the other hand too.

The other hand, I’m famous “online”. I even have a shirt that says it. I could probably get work anywhere in the world, and I’ve received a couple of offers from places like the US, Denmark, Scotland and London. But, these are all development-only jobs. I much prefer a decent mix of teaching and developing, or maybe even both at the same time. I feel by teaching new people that they will go out and teach more people. If I’m developing, I’m not widening the pool of available developers and not helping the community grow. This is something I really want to do.

What I’m looking for in a job isn’t full-time development. My ideal “job” is going around the world teaching people about proper Ruby on Rails development and about proper Agile development.

I want to be able to teach people. To watch them grow. For them to say ‘aha!’ when they finally get a concept. For them to teach me new things. For us to develop something really great.

For now, I am happy working at GetUp. If they want me to stay on longer then I’m very inclined to say yes. If they don’t, then it’s been fantastic.

My contract with GetUp runs out at the end of October. 3 months from now.

If you want me to help your team now’s the time to let me know.

GoGaRuCo

Friday, July 16th, 2010

After going to Scotland in March and attending the very awesome Scottish Ruby Conference I still feel like travelling. For quite a long time I’ve wanted to go to San Francisco and check out the Ruby scene there and I also have a couple of people who I’d love to catch up with in other parts of the country. So I’m going to be doing an “American tour”.

I’m thinking of flying in on the 15th September, staying for 2 weeks and leaving on the 29th or 30th. So far I’ve planned as far as attending GoGaRuCo (probably not speaking, unless they want me to) and perhaps spending a day or two in SF going to bug the EngineYard and GitHub guys.

After that? I’ve got invites to go visit people in Indiana, Ohio and Florida and so that’s what I’ll be doing. No specific dates yet, but there’s definitely a whole slew of people from the Ruby community who I’d love to meet.

Thanks to the people who have already offered accommodation! In my single overseas trip experience so far, this takes a lot of hassle out of doing it!

I’ll see you when I get there!

Rails 3 in Action: MEAP #1

Sunday, July 11th, 2010

Last night whilst I was sleeping (something I do regularly during the night), the first release of the new Rails 3 in Action book took place! You can will go out and grab yourself a copy now. Please?

It’s been a fun process writing the book so far. I’ve got a couple of very dedicated people helping me and it’s definitely the people who have made the process what it’s been. Currently I’m working on Chapter 7 which should be “finished” sometime this afternoon and then I’ll begin on Chapter 8 which I hope to have finished by next weekend.

If you have any questions, comments, suggestions, words of encouragement, professions of love or otherwise, you can write about them on the book’s forum and I’ll reply as soon as I can.

Thanks for supporting me so far!

uninitialized constant RSpec with Cucumber

Monday, July 5th, 2010

Today I upgraded the Cucumber gem on my system (still had 0.7.something) only for it to break!

uninitialized constant RSpec (NameError)
/Library/Ruby/Gems/1.8/gems/cucumber-0.8.3/bin/../lib/cucumber/rb_support/rb_language.rb:51:in `enable_rspec_expectations_if_available'

I saw this error last week on a workmate’s computer and both times it was fixed by removing the rspec-expectations gem which is a part of the RSpec 2 gem collection. I had these left over from when I was playing around with Rails 3 (now I’m using RVM). The latest version of Cucumber maintains compatibility between these two versions and does so by trying to require rspec/expecatations which will be available if the rspec-expectations gem is installed. So if you’re trying to use RSpec 1 and 2 and Cucumber at the same time, you may run into this issue. So far the best solution I’ve found is uninstalling rspec-expectations.

Just thought I’d let you know. It’s bitten us twice and may bite you.