Hiring good people is really simple
It really is. There's no magic involved.
Again and again I come across articles from people complaining about the current interview practices. They complain it doesn't give you enough depth into the candidate's ability, personality etc. That it measures the wrong qualities. Or that it just doesn't work and bad people keep coming through the pipeline.
Well, instead of complaining how about you change it? I'm talking about hiring software engineers here so the first rule you should keep in mind is that you need to get them to write code.
A Tale Of Concurrency: Partitioning Data Between Processes
So I had just finished writing this feature. I was confident it’d work - after all I had a good level of tests around it. It sounded like yet another successful deployment.
One week in and something starts breaking. It was hard to track down but at the end I realised it was caused by having concurrent processes running in parallel.
That’s what happened in a recent production release at our current client. It was a very interesting problem to track down and solve and I’ll do my best to explain and walk you through it here.
A Few Useful Git Commands
I’ve been working fulltime with Git for a while now and I’ve noticed a pattern of commands that emerge every so often, but not often enough that would make me remember them.
That’s why I decided to post them here so I know where to look in the future. And of course they can turn out to be useful to someone else too.
So without further ado, here they are:
#undo last commit
git reset HEAD^
#show files in a given commit
git show --pretty="format:" --name-only rev_number
#remove untracked files and directories
git clean -f -d
#track remote branch
git branch --track branch_name origin/master
# given you created a new local branch 'branch_name'
# pushes 'branch_name' to 'origin/branch_name', creating the remote branch for you
git push origin branch_name
#delete remote branch
git push origin :remote_branch_name
I’ll keep this list up to date and add more useful stuff as need arises. Enjoy.
Goodbye Wordpress, Hello nanoc!
I just finished migrating my blog from wordpress to nanoc
using a customized version of nanoc3_blog
and it feels nice.
I grew tired of keeping up with Wordpress' updates and this migration also means that I can finally get rid of php on
my vps.
However, do let me know if there is anything weird around here. The whole customization done on nanoc3_blog was related to the wordpress migration.
I wanted to make sure all url's stayed the same so as to avoid broken links into the blog. Feel free to browse the
repository and see if the changes can be helpful to you.
It also includes a modified version of a wordpress import script that was responsible for keeping the links correct, among other things.
one year of thoughtworks a retrospective
It seems like it was yesterday that I wrote about my next big challenge: Moving to Australia to join ThoughtWorks. Since then a year has passed and I thought I'd share a little bit about what it's been like so far.
The first thing you notice when joining ThoughtWorks is that you're surrounded by smart, opinionated people. It was once common for me to be the one fighting for automated testing, TDD, Ruby and overall finding new and better ways of doing what we do - but imagine how different it is to join a team that takes that for granted. This gives you a very high standard within the team that frees your mind to try and achieve bigger things. It's a great feeling.
ThoughtWorks' culture is inspiring. We're a small and very active community - there's always something going on in our offices after hours: Tech nights, local groups' meetups, training, people randomly hacking on stuff and even band rehearsals! The point is that you can get involved in several ways and the best part is that ThoughtWorks supports all that: be it providing pizzas and beers, flying us to international conferences, buying books and whatnot in order to help us do our best! I could go on but you get the point.
In return, we get to work on hard stuff. Not only technically challenging but personally challenging as well. As consultants we can be thought of as agents of change: When we go to a client, we're not only concerned with building the coolest projects with the best tools out there - of course that's a big part of what we do - but we're expected to change the way they think, work and do business.
Since I joined I worked with 2 clients - and 2 different projects - that varied wildly between them. That is in part what makes working at ThoughtWorks so interesting to me. You get to change domains, technologies and teams more often than not, which nurtures a stimulating environment.
The first project for instance was a standard Java web app where we had the usual players such as Spring, Hibernate, Freemarker, etc...
My current project, on the other hand, is very much like a start-up: We have a EC2 box that plays our CI role, all code is hosted on Github, we're using Ruby on Rails and deploying the whole thing to Heroku + RDS.
To top it off I also had the chance to make a real difference in the Queensland Flood Relief Appeal in 2010, when we built a donation app to help the flood victims - that was definitely the highlight of the year, and something I'm particularly proud of.
What next? I'm eager to find out what my second year here has to offer. Bring it on!
look ma no hands tweeting with your voice
This is just another one of those boring weekends where I felt the need to hack on something.
If you follow Google Chrome's blog you're probably aware of this little nifty feature they started to implement in their latest builds: HTML5 voice recognition.
And that's when it struck me: "Hey, what if I use that and tweet with my voice instead of typing?"
The result of this hacking session is LoudParrot, a sample Rails app that shows how to do just that. You will need a fairly recent build of Google Chrome -beta - which you can download here.
You can get the source on GitHub.
simplejquery daterange picker
As in many web apps out there, this week I needed a date range picker. I shopped around and while I did find a couple of good options they were (a) too clunky and (b) didn't prevent you from selecting invalid ranges. The latter being the one I was really interested in.
So I coded up something simple that worked and looked nice and decided to share around. It's the jquery-daterange-picker. Its only dependencies are jQuery and jQueryUI's datepicker.
Got get it, fork it, contribute to it or check out some examples.
rottingnames for iphone available for free
Following the staggering success of the online version of RottingNames - where by success I mean the handful of metal heads constantly using the app :) - I released the iPhone version for free . You can now generate crazy and fun names anywhere! Go get it!
I've been meaning to post this for a while but I was waiting to have some free time and add a few new features to the app, which I just realised won't happen any time soon given the priorities I have at the moment. But by all means feel free to drop a line if you're dying about a missing feature.
Now go have fun ;)
ide review rubymine
Since I started working with Ruby about 4 years ago, I've used quite a few text editors and ide's: RadRails, gedit + plugins, TextMate and Vim.
TextMate is the one I've used the most and it's been ok for a long time. Until you realize you need half a dozen bundles to make it really useful for ruby development. Obviously the same goes for Vim and gedit.
Oh, and forget about refactoring. In these tools refactoring equals regex global replace. So if you need it, well, forget it.
That's when I decided to give RubyMine a fair go. I've been using it heavily for a while now and I must say I love it!
What pissed me off about RadRails when I first tried it was the speed. It was too slow, something people take for granted when running java based IDE's.
However this is not true for RubyMine. You DO take a hit on startup, nothing major, but once it's done, it's a breeze.
I've compiled a list of my favorite productivity shortcuts and features. Hope it'll be useful to someone else.
Productivity Shortcuts
Navigation
Ctrl + Tab - File Switcher
Cmd + Shift + T - Switching between implementation and test works perfectly. Even in a pure ruby project
Cmd + Shift + F12 - Expand/restore editor
Alt + Shift + N - Go to model/view/controller
Alt + F1 - Show current file in other views such as the project tree (scroll to file)
Cmd + Shift + N - Open file
Cmd + Alt + Shift + N - Open symbol - across files
Alt + F7 - Find usages - when on a method, variable, etc…
Running/Debugging
Ctrl + Shift + F10 - Run current [test] file. When inside a test method, run that single method.
Ctrl + Shift + F9 - Same as above, but in debug mode.
Shift + F10/Shift + F9 - Run/Debug last action executed
Alt + R - Run rake task
Refactoring
Cmd + Alt + N - Inline variable/ method
Cmd + Alt + M - Extract method
Shift + F6 - Rename
F5 - Copy current file as...
Editing
Cmd + Y - Delete line
Cmd + D - Duplicate Line/Selection
Alt + Mouse - Column selection
Cmd + Shift + (Up Arrow|Down Arrow) - Moves de line or selected block of code up or down
Features
Code completion - It's fairly accurate and pretty fast. They've done some good yak shaving around this area.
Debugger - The debugging interface is an absolute beauty. Saved me a lot of time where I'd have used puts statements or googled to re-learn how to use ruby-debug instead. Definitely worth checking out.
The bad stuff
It is not free - unless you are a committer to an open-source project. But it's not expensive either.
It is a bit slower - but not that much. The performance hit is insignificant compared to the added value.
Regex file open, TextMate style - What can I say? I do miss this.
Wrap highlighted text - In TextMate, if you highlight a word and press ", [, {, ( or # it surrounds the word with the respective combination of quotes, brackets, etc... Another missed feature
Wrapping up
It's probably soon to say it but so far RubyMine has been my missing Ruby IDE. And I'm very happy with it. :)
clouds against the floods presentation available
Last Tuesday I gave a short presentation on the whole Clouds Against the Floods thing at the Ruby on Rails Oceania User Group here in Sydney.
Those guys are awesome and they recorded the talk - thanks guys!
If you'd like to download the slides, they're available on Slideshare.
Enjoy! ;)