MicroPlace monk
It’s Halloween and the theme is “wear something blue on your head”.

Thank you Aaron for the inspiration.
It’s Halloween and the theme is “wear something blue on your head”.

Thank you Aaron for the inspiration.
One of the very first interview questions I was asked, right after college was:
- Write a function, C or Pascal or whatever language you like, for counting set bits in a an integer.
I’m no fricken genius and thought this was pretty much a softball question. I was asked another simple technical question and eventually I wound up working there for 2 years.
I did think the interview was way too easy, and when I’d grow up and get to interview people, I would start with an easy question like that, but then go from there.
Well, big mistake. Apparently this is a very difficult question for a lot of people. Some of those people are very smart and I want to have them on my team, they can’t see things that small, that’s all. So I had to come up with other starting questions.
Eventually I moved on to “reverse a string”, or “explain hashtables”, or even “code a linked list”.
Recently I interviewed a fellow with some impressive experience. I didn’t want to offend him and start by counting bits so I asked him to code a linked list and write a function for detecting circular linked lists. “In fact” - I said - “don’t even code it, just tell me how you would approach the problem”.
After staring at the white board for 5 minutes, and refusing my help, he finally said “well, there’s no solution to this problem”
I lawled inside of course, and suggested a couple of solutions. His response was “well sure, if you do it that way”.
No, he didn’t make it.
So anyway, some very smart people can’t count bits, others can’t but don’t know what linked lists are. Others can do but their code makes me want to cook (spaghetti, get it?), so what the hell am I supposed to ask as the first question, to at least get us off the ground.
I finally decided on a new approach. I write a bunch of starting questions on the board, and ask them to pick whatever they like best.
If you’re going to interview with me, here are my questions (be ready to pair program with me on the coding questions)
- count 1s in a int. Use this function to figure out if the number is power of two.
- tell me about hash tables. Why they’re needed, how to use them, how to write your own.
- explain linked lists, and write a function for detecting circularity.
- reverse a string
- write an extremely simple calculator class (add/sub/mul/div) but do it test first.
- tell me about your experience with agile (xp, scrum, whatever)
- tell me about object oriented programming. what it is, why I need it, how it works, etc.
- write a function that traverses a tree (breadth first or depth first) and prints the node values
That’s it. Most programmers should be able to pick one and get started. Well, should but don’t. Most programmers I’ve interviewed get stuck at this point.
I’m also considering asking them to come prepared with some source code they think is well written. Not even their code (though that would be better). Just code they read once and found awesome.
I haven’t tried this approach yet though. I do think there’s value there, if you believe that good designers/programmers have taste.
”To eat Hershey, for me, is like eating sand,” said Jan Goddaert, the corporate marketing director for Cote d’Or. ”but to Americans, it’s good chocolate”.
Here we are, almost a quarter century later and nothing has changed. Well, that’s not true actually. Philip Morris owns Cote d’Or (through Kraft) and edible sand is finally coming to Europe!
But to be honest (for once), someone must be doing something right because Cote d’Or still rocks the hell out of that piece of crap they have the guts to call chocolate at Hershey’s. Go here for more.
I needed some way of bootstrapping the app with initial data. The quick and dirty trick we had was to have the ActiveRecord commands in some text file, then copy/paste them in the rails console and voila, a database with stuff in it.
Having to manually copy a bunch of ruby code in the console and then run it there was kind of boring and error prone though. However, since we only have to do it once (or so we thought), it was acceptable.
As it turned out we had to do it more than once, so it got old very quickly. And not only it was boring and error prone, the rails console (I think) was dropping characters left and right while pasting our ruby instructions.
So now it was boring, error prone and destructive.
We needed to automate this. We already had the code in some text file, so how hard could it be to simply rename the file something.rb and run it?
Ruby has no idea what ActiveRecord is for example, so the script needs to know that. Simply adding
require File.expand_path(File.dirname(__FILE__) + "/config/environment")
at the top of the file does it. Yay! (the script is at the project root)
Great, now I can run any rails code in my script, like bootstrap the database, and it will just work.
Well, almost. By default rails will use the “development” environment. I’m bootstrapping things in production, not development.
Super easy, before loading the project environment, I need to tell rails that I really want to be in production mode. Add this line before the line that loads the environment.
ENV['RAILS_ENV'] = ‘production’
That’s it, two lines of code and your command line script will be updating the database!
we’re really really close to going full blown live…I can smell it (smells great).

(stole this picture from here)
Carnegie Mellon Professor Randy Pausch, who is dying from pancreatic cancer, gave his last lecture at the university Sept. 18…
and what a wonderful lecture that was.
I wish I could say that I’ve been so busy with work and other important stuff, that I didn’t even have the time to write a couple of lines. I wish I could say even though people who don’t even have the time to write a couple of lines are pretty sad.
The fact is that I’m just lazy and was also wondering who the hell I’m writing this for anyway? As it turns out, *I* like to read what I was doing or thinking 6 months. And so it seems I’m really writing this for me. So Julio in the future, hi there, hope you’ve grown up a little and hope those drums that I don’t have but you must are keeping you happy.
Alright, what the hell happened in the past 2 months?
- We launched our fine website! It’s still in internal beta, and it’s working like a charm. Thanks to XP, a fine group of developers and a great product manager who understands “stories”, the whole thing worked like a charm. I probably should blog about how we did it, since this was the best xp/agile project I’ve been involved with. I also know myself quite well, and the chances of me writing about are rather slim. So here’s the short version of how it was done: smart product manager, short iterations (1 week) with real content at the end of each one, team in the same room, test-first or at least “test before you check-in”, smart folks (some superstars even), lots of test coverage (95-100% depending on the day), mutual respect and last but not least: a decent language and framework. Ruby and Ruby on Rails were a big part of the success. That’s it, easy, anyone could have done it.
Here’s a conversation Fabienne and I had the other day:
Fabienne - “You guys have launched!? I haven’t seen you work past 6 o’clock or on weekends for months!”
Me - Yep, that’s the power of XP baby.
Fabienne - But, but, you’ve been doing XP for years!
Me - Nah, that was “XP-but”. I’ll blog about it…or not.
So anyway, we’re live (even if only to a small subset of the world) and should go live to everyone in less than a month.
This is us (the whole company) celebrating:

- What else happened? Oh yeah, I was given (for free!) a level 65 rogue in world of warcraft, on some PvP server that was not “my usual pvp server”. I couldn’t resist pwning noobs with a rogue, so I played him “a little”, brought him to level 70, transferred him to the proper pvp server, and now I’m camped on top of the roof in Southshore (alliance town) stealth and waiting for noobs to pwn.

- Fabienne and Morgane went to Belgium for a week. Morgane fractured her skull over there, could not fly until the bones were all properly glued together so they stayed 3 weeks. It was all very upsetting. Even the rogue miss me, as I didn’t play him at all then. My buddy Scott practically had me live at his place the whole time, and I’m grateful to him and his family. They made it almost easy. Morgane is fine now and now she can see through walls and bend spoons with her mind.
- Morgane went back to school and she’s doing great. She took some tough classes and so far she seems to be doing fine (I never thought that seeing through walls could help, but apparently that is the case)
- I gave up exercising but didn’t like to see what the scale was telling me day after day. That if you don’t exercise, you gain weight. So I don’t go on the scale anymore. Fixed.
That’s all, Julio in the future. See you then.