Test driving JRuby 1.6

Posted by – April 7, 2011

I’ve been hacking away at ruby on rails for some time now, but I’ve never stopped to try out JRuby. That’s probably because I initially fell in love with rails after an eight-year stint in the java insane asylum. However, with the release of JRuby 1.6, I decided it was finally time to forgive Java, and see how hard it’d be to run our fairly mature ruby (1.9.2) on rails codebase with JRuby.

I already used RVM, so I used that to install JRuby 1.6:

$ rvm install jruby-1.6.0

Two minutes later, JRuby was installed. Easy enough. Let’s use it:

$ rvm jruby
$ which ruby

OK, we’re in business. I’m still not sure how different JRuby is, so let’s see what gems I have to start with:

$ gem list

*** LOCAL GEMS ***

bouncy-castle-java (1.5.0145.2)
jruby-launcher (1.0.7 java)
jruby-openssl (0.7.3)
rake (0.8.7)
sources (0.0.1)

Let’s get bunder installed:

$ sudo gem install bundler

And now, before I switch to my project and try a bundle install, let’s just see if I can easily install the rails gem:

$ sudo gem install rails
Successfully installed rails-3.0.6
23 gems installed

Easy! Alright, enough of this tip-toeing around, let’s see what happens when I switch to my project and try a bundle install:

$ bundle install
Fetching git://github.com/nhowell/subdomain-fu.git
Fetching git://github.com/flori/json.git
Fetching git://github.com/adamrubin/acts-as-taggable-on.git
Fetching source index for http://rubygems.org/
Using rake (0.8.7) 
Using abstract (1.0.0) 
Using activesupport (3.0.6) 
Using builder (2.1.2) 
Installing mysql2 (0.2.6) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

Ugh. An error with the mysql gem. Is this the beginning of the end? Well, maybe not. A few minutes of googling and I discovered that JRuby needs a different gem for mysql. And there’s an easy way to conditionalize my Gemfile:

if defined?(JRUBY_VERSION)
  gem 'jdbc-mysql'
    gem 'activerecord-jdbc-adapter', :require => false
    gem 'rmagick4j'
    gem 'mysql2'
    gem 'rmagick'

(I ran into the similar problem with rmagick)

After making that change and running bundle install again, there were no issues reported. Hrm. This is too easy. Let’s see what happens when I try to start the server:

$ rails s
JRuby limited openssl loaded. http://jruby.org/openssl
gem install jruby-openssl for full support.
=> Booting WEBrick
=> Rails 3.0.6 application starting in development on
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2011-04-07 20:39:37] INFO  WEBrick 1.3.1
[2011-04-07 20:39:37] INFO  ruby 1.8.7 (2011-03-15) 
[2011-04-07 20:39:37] INFO  WEBrick::HTTPServer#start: pid=50128 port=3000

The server started up fine. I opened the browser and did a smoke test of the app and couldn’t find a single problem. HOLY CRAP that was easy! JRuby is an option. I’ll sleep a little better tonight knowing that.

The cost of not listening

Posted by – April 1, 2010

I quit smoking a couple years back with the aid of nicotine lozenges. I had tried countless different ways to quit, but for me, the lozenges (and the right attitude) were what finally worked. Yet, as the proverbial joke goes, I became addicted to the damn lozenges. I was able to transition from the 4mg to the 2mg (the lowest dosage), but struggled mightily to stop using them all together.

I tried mint flavored candy, but it wouldn’t last as long, wasn’t the same shape, and didn’t have the same minty taste. I tried chewing on gum, straws, fingernails, etc. I tried going cold turkey. At one point, I got down to one lozenge per day, but that one lozenge was a huge security blanket.

After doing this for *too long to admit*, I googled a bit and found others in the same situation. And as I read their stories, I realized that there might be an untapped market. I found the website of the company which produced the lozenges and wrote them a nice email. I explained how grateful I was for their product, but that I was having a difficult time weaning myself off it. I asked if they had ever considered a 1mg option, or even a 0mg option with the same flavor, texture, size, etc. I suggested that if they could sell the 0mg option for a cheaper price, they might have an opportunity to create a long(er) lasting relationship with their customer base.

Now, I didn’t know the first thing about the inner-workings of their business, or what it takes to produce those lozenges, but I figured it was worth a shot. Who knows, maybe I would lead them to a gold mine of untapped revenue. I figured, worst case scenario, I’d get a response saying “We’ve explored that option, but it wasn’t feasible.”

After a few days, I received their response. I’ve edited it to protect their identity:

Dear Mr. Rubin,

We have received your e-mail message regarding our product.

Thank you for notifying us of your experience with a XYZ product. While we expect that the majority of people will be able to use XYZ with no problems, we realize that individual reactions are always possible.

Since you encountered a problem while using XYZ, we recommend that you contact your doctor or other healthcare professional.

So that we can collect additional information about your experience, please call one of our Representatives at 1-888-888-8888 weekdays between 9:00 am and 4:30 pm Eastern Time. To help us expedite this process, we ask that you also have the product in hand at the time of your call. There is important coding information that will enable us to thoroughly investigate your complaint.

All of this additional information is valuable and enables us to continue to monitor and evaluate the safety of our products.

So that we may better assist you, please refer to the case number below when you call. We appreciate your bringing this matter to our attention and look forward to hearing from you again soon. If we may be of further assistance, please call us weekdays at 1-888-888-8888.


Jane Doe
[company name]

Uh, what? I understand the need to for a large corporation to protect themselves from any legal issues — this was a nicotine product after all, but my email was not a complaint, nor a cry for help. I was merely a loyal customer presenting a potential business opportunity. There MUST have been a better way of acknowledging the positive intent of my email, without supporting the extended usage of their product. But to completely ignore my message and reply with a canned response? C’mon, I don’t care what size company you have, those days are over. Not only did they alienate a customer, but they may have missed out on a million dollar idea.

Or maybe they were trying to alienate me and it was a brilliant strategy to get me to stop using their product. If so, it worked.

Regardless, I was frustrated enough, that I decided to give them a taste of their own medicine:

Thank you for efficiently selecting a canned response. Reading emails and responding appropriately is not a cost-effective way to run a company. I applaud your agility and shall follow suit.

> scanning your message…
> picking canned response…

Dear customer communications,

Thank you for passing along your contact information. Unfortunately, we are not hiring at this time.

To apply for positions in the future, please use the following reference code: NA1MB1LA

Adam Rubin

Are we having fun yet?

Posted by – March 29, 2010

In 1998, I took a position with a budding start-up named JuniorNet. It was the height of the dotcom boom and a new generation of entrepreneurs were attempting to change the business landscape forever. While at JuniorNet, we raised — and subsequently blew — more than $80 million. It was the quintessential dotcom story, which came to an abrupt end as the bubble burst. And yet, no matter how ridiculous those times were, they yielded some valuable lessons for today’s entrepreneurs.

Like many start-ups during those days, JuniorNet put a ton of effort into making the office fun. Plus, it was an online service for children, so all of the decor was meant to bring out the child in everyone. There were Nerf guns, medicine balls, slinkys, action figures, RC cars, and play sets in every room. The walls were brightly painted and the desks had fun little designs on them. There were video game consoles, projection screens, comfortable couches, fully stocked Coke and Snapple vending machines (free, of course), and enough bagels to feed an army.
And, for when we wanted to act like adults, there was a fully stocked bar, appropriately called the “nav bar.” We had everything — and did everything –that would make old-timers in large, traditional corporations roll their eyes.

The result of pepping up the office, and focusing so heavily on the culture and morale of the company was that people showed up to work happy every day. We worked late into the night (often sleeping in the office), showed up on weekends, and rarely used our allotted vacation time. Whatever time was “wasted” playing video games or goofing off paled in comparison to the extra hours the company got from its employees.

Was it excessive? Yes, of course. But that wasn’t why the company failed. We didn’t blow $80 million on making the office fun; we blew it on a terrible marketing plan, a worthless acquisition, an insane amount of legal costs, and the same idiotic things that other dotcoms were doing back then. We paid LaVar Burton a ton of money to be our spokesperson. Yes, the guy from Star Trek: The Next Generation and Reading Rainbow. In addition to the spokesperson salary, we paid for him and his family to fly first class to various events, yet I think he said a total of three sentences about the company at said events.

If only we had thought to get William Shatner instead.

In the years since JuniorNet went under, I’ve had the good fortune to work for a handful of start-ups; some successful, some not. I’ve worked with some brilliant people on causes that I believed in, but I’ve never been a part of the same culture that JuniorNet had. Unsurprisingly, I’ve never seen the same work ethic and camaraderie either. One start-up in particular took the exact opposite approach of JuniorNet. The office was cold and industrial-feeling. Consuming alcohol was forbidden. Kibitzing with a co-worker about non-work-related topics was frowned upon. There were virtually no company outings, except for a few times when we left the office only to talk about work the entire time we were out. Company parties were as fun as funerals.

As a result of this culture, there was constant bickering between employees, everyone was starved for vacation time, and the entire place would empty out at 5PM on the dot.

The lesson here is simple: By their very nature, startups are a grind. There’s a lot of work, and too few people to do it. You’re likely to suffer a lot of failure before finding the right path. Those failures eat away at morale and confidence, which, if not treated, can lead to the team imploding. Frowning upon your staff for blowing off steam between 9-5 not only tells them that work shouldn’t be fun, but it also insinuates that work should only happen between 9-5. Start-ups need to blur those lines. Instead of guilting people into working long hours, make them jealous for missing out on all of the fun.

Buy a ping-pong table, or invent a silly game. Ask someone to bring in an old video game console, or buy one for cheap on eBay. On Mondays, make the rounds and talk to everyone about their weekend. Hire a masseuse, manicurist, florist, yoga instructor, clown, etc. to come by the office for an afternoon. Give the company a surprise three-day weekend. Encourage the men to grow moustaches. Organize a potluck for Talk Like A Pirate Day. Bring donuts in on a random morning. Give $10 giftcards to iTunes at random times. Have a movie night in the office.

The dotcom infancy may be over, but the change in business culture it brought is here to stay. Embrace it and you’ll have a team that will counter any bump in the road with the humility, energy, and passion needed to make your startup a success.

Team chemistry and decision making

Posted by – March 23, 2010

One of the best parts of working at a startup is the intense collaboration. When there are only a handful of employees it’s impossible not to be involved in every aspect of the business. It’s not uncommon to see a programmer writing marketing copy, an intern working on a fundraising deck, and the CEO buying the toilet paper.

When you’re in a cramped office space, there are no closed-door meetings. Everyone is a part of every discussion. This is great if you have good chemistry. Fueled by adrenaline (and pizza and beer), you build off one another’s thoughts and come up with creative approaches to bulldoze any obstacle in your way. Decisions come fast and furious with good chemistry. But when you have bad chemistry, problem solving becomes individualized; egos trump common sense, and obstacles multiply exponentially.

There are so many critical decisions to make in the first six months of a startup. Designing your brand, constructing your mission statement, defining your audience, picking a fundraising strategy, developing a marketing plan, choosing a technology platform, etc. And don’t forget about the small, yet plentiful, decisions. Do you send a Christmas card or holiday card? Should job applicants send an email to jobs@ or careers@? Should you bold the opt-out link in your e-newsletters? Do you give away pens or keychains? Should you get a foosball table, or will that scare away investors?

When you have a bad chemistry, these decisions take forever. One person thinks you should send a Christmas card. Another says no, just send a holiday card. Another suggests sending one card to Christians, and another one to everyone else. How about a red and green card that says “Happy holidays!” Or maybe you just do a New Years Eve card to avoid the conflict. After debating for a few days, everyone is worn down and you decided to do nothing. Now, I’ve never heard of startup that blamed their failure on a bad Christmas card, but I have heard of plenty who said they ran out of money before being able to execute on their plan.

The thing with startups is that it’s super easy to become opinionated when you’re dealing with unchartered territory. If someone thinks the logo should be red, not blue, they can point to all of the successful companies with a red logo. Those who like blue can do the same. It’s easy to google your opinion on virtually any topic and come up with supporting “facts”. Yet, for your startup, there are no facts. Nobody can dig up that data from ten years back, when a red logo was been tested and sales declined by 20%. You have no precedents; everything you do is a test. You can try to mimic other successful companies, and avoid mistakes of failures, but ultimately, you have to make hard decisions about your company – even if that means taking a shot in the dark.

When you make a bad decision — and you will make plenty of them — fail fast. Recognize when something isn’t working, figure out why, then change course appropriately. The costly failures occur when egos or ignorance prevent your startup from being responsive to what the market is telling you. And yes, chemistry plays a critical role here as well. Admitting a mistake is easy when you have good chemistry. You’re rewarded for fixing a problem. But when you have bad chemistry, it becomes your mistake. You were the bastard who won that epic logo argument, and now we have to redesign it (or worse, go on pretending that it’s fine). You fucked up and if you continue to fuck up, you will be banished from the island forever.

You know what happens when that type of blame game begins? Everyone becomes scared of making deicions, as it may cost them their job. They stop weighing in on the discussion, waiting for someone else to screw up so that they can call them out on it.

Game over, before it even began.

20 things I believe in as a technologist

Posted by – March 22, 2010

  1. Brooks’s law: Adding manpower to a late software project makes it later
  2. Parkinson’s law: Work expands so as to fill the time available for its completion.
  3. Hofstadter’s law: It always takes longer than you expect, even when you take Hofstadter’s Law into account.
  4. Clark’s law: Sufficiently advanced cluelessness is indistinguishable from malice.
  5. Lewin’s equation: B=ƒ(P,E). An individual’s behavior is a function of both their personality and their environment.
  6. Fast, good or cheap.  Pick two.
  7. “The bearing of a child takes nine months, no matter how many women are assigned.” – Frederick P. Brooks
  8. Flitting doesn’t work, nor does sitting tight
  9. Attention economics
  10. Don’t write a functional spec
  11. Start-up metrics for pirates
  12. The Zombie Function: micromanagers create zombies
  13. Death by risk aversion
  14. Fail fast, fail cheap (re: tactics, not the overall business).
  15. Beware of future creep
  16. To create change, you need to reach out to those who don’t already agree with you.
  17. The 18 mistakes that kill startups
  18. 85 operations rules to live by
  19. Things that get in the way of good software:
    • Competing interest (departmental)
    • Political infighting
    • Lack of audience clarity
    • Fuzzy strategy
    • No vision for success
  20. Aspects of good software
    • Functionality: does it do what I need?
    • Correctness: does it do it correctly, without a bunch of bugs?
    • Learnability: can I learn it quickly? Is the manual good?
    • Efficiency: does it let me do what I need without long workarounds?
    • Usability: is it user-friendly?
    • Intuitiveness: does it feel natural?
    • Flow/enhancement: does it keep me fully engaged where the world drops away?