Keep Moving

Posted by Nick Sieger Fri, 16 Mar 2012 13:15:43 GMT

Rather than arouse speculation and keep you in unnecessary suspense,

I’m happy to announce that I’m joining the Living Social team on Monday! Besides the obvious reason of jumping at the chance to work with the caliber of team they’re building, I see this new opportunity as a chance to focus my attention. More about this below.

Of course that means I’m leaving Engine Yard. They have been a great company to work for, and continue to be. I’m extremely grateful that they have supported myself, Charlie, Tom, and the JRuby project for the past two and a half years. If you have a passion for developer tools, cloud computing, virtualization, and customer satisfaction, I would still recommend them unequivocally.

While being paid to work on open source is certainly a dream job for many, I’ve learned that I work better (and feel better about my work) when I have fewer immediate goals in front of me, and something to focus on. Open source is still great fun that I intend to enjoy when I have some time and inspiration to put something into it.

So what does this mean for my involvement with JRuby? Nothing at all, really. Of course, I won’t be working on JRuby full-time. I have already been soliciting new contributors for JRuby-Rack, Warbler, and AR-JDBC, and many of you have stepped up your involvement and contributions (thank you!). These projects will still keep moving, and I intend to still help out when I can. I still am very much personally invested in seeing JRuby win, and I think that JRuby continues to gain traction all over the place. And I still am involved and invested in making JRubyConf a top-notch experience this year in my hometown Minneapolis. (Please join us!)

So, [insert your change metaphor here]. Life goes on. Gotta keep moving!

Letter to My Congresspeople Regarding SOPA/PIPA

Posted by Nick Sieger Fri, 13 Jan 2012 21:00:24 GMT

Dear Sen. Klobuchar, Sen. Franken, and Rep. Ellison,

I am writing to express my deep concern about the pending SOPA/PIPA legislation. I have seen reports that Sen. Franken and Sen. Klobuchar are both in favor of this legislation. This troubles me.

I see the intense legal pressure applied by the movie and recording industries to Congress as evidence that they simply don’t understand how to run their businesses in an ever changing technological landscape. They should realize that they could increase revenues by embracing new channels of distribution instead of wasting time tracking lost revenues due to piracy or fraud.

Based on this view, I see SOPA/PIPA as yet another misguided government attempt to intervene, prop up, and rescue an industry that doesn’t know how to alter its own business models to align with the current economic and technological climate. This attempt comes at the expense of taxpayers and citizens who view freedom of speech and information as inherent, unalienable rights.

Frankly, I find the amount of money raised for Sen. Franken and Sen. Klobuchar to be a disgusting example of special interests buying legislation. As a constituent of the the state of Minnesota and its fifth congressional district, I urge Sen. Franken, Sen. Klobuchar, and Rep. Ellison to return all funds contributed for and against this legislation and to remove any support for this bill.

Regards,

Nick Sieger

Tags , ,

RSpec 2 Matcher Fun

Posted by Nick Sieger Thu, 20 Jan 2011 17:47:21 GMT

I was troubleshooting some JRuby code that transforms Java camelCase method names into Ruby snake_case form. We had a bunch of specs that did this, for example:

describe "Java instance method names" do
  it "should present javabean properties as attribute readers and writers" do
    methods = MethodNames.instance_methods

    methods.should include("getValue2")
    methods.should include("get_value2")
    methods.should include("value2")

    methods.should include("setValue2")
    methods.should include("set_value2")
    methods.should include("value2=")
  end
end

The problem comes when these specs fail. The default error message made by the #include matcher looks like:

Failures:

  1) Java instance method names should present javabean properties as attribute readers and writers
     Failure/Error: methods.should include("get_value2")
       expected [...full contents of array here...] to include "get_value2"
       Diff:
       @@ -1,2 +1,186 @@
       -get_value2
       +[...all entries, one per line here...]

That’s not a terrible message, but when your array contains over 100 entries (like an array of method names), it could be a lot better. In particular, I kept scanning the failure message’s big list, unable to clearly see why the methods I was expecting weren’t there.

What I wanted to see was how my changes to the regex which splits a Java camelCase name affected the conversion. So, what I needed was a report of which method names were the closest to the ones that were not in the list. Hey, sounds like a good reason to implement a custom matcher, and take a diversion into fuzzy string matching algorithms!

I settled on porting the pseudocode in Wikipedia for the Levenshtein distance, which calculates how close in content two strings are to each other. I looked around and there are existing Levenshtein ports for Ruby, but they use native code for performance. I don’t need performance because I’m only using the Levenshtein function when there is a failure. Of course, pure Ruby code is more portable too!.

The other change I made in the specs was to pass all strings in a single matcher rather than one name per expectation, so we can see all names that fail, not just the first.

So now, the new spec looks more like this:

describe "Java instance method names" do
  let(:members) { MethodNames.instance_methods }

  it "should present javabean properties as attribute readers and writers" do
    members.should have_strings("getValue2",
                                "get_value2",
                                "value2",
                                "setValue2",
                                "set_value2",
                                "value2=")
  end
end

The custom RSpec matcher #have_strings is declared like so:

RSpec::Matchers.define :have_strings do |*strings|
  match do |container|
    @included, @missing = [], []
    strings.flatten.each do |s|
      if container.include?(s)
        @included << s
      else
        @missing << s
      end
    end
    @missing.empty?
  end

  failure_message_for_should do |container|
    "expected array of #{container.length} elements to include #{@missing.inspect}.\n" +
      "#{closest_match_message(@missing, container)}"
  end

  failure_message_for_should_not do |container|
    "expected array of #{container.length} elements to not include #{@included.inspect}."
  end

  def closest_match_message(missing, container)
    missing.map do |m|
      groups = container.group_by {|x| levenshtein(m, x) }
      "  closest match for #{m.inspect}: #{groups[groups.keys.min].inspect}"
    end.join("\n")
  end
end

I omitted the #levenshtein function here for brevity. (You can view the full source for details.) Now our failing spec output looks like:

Failures:

  1) Java instance method names should present javabean properties as attribute readers and writers
     Failure/Error: members.should have_strings("getValue2",
       expected array of 185 elements to include ["get_my_value", "my_value", "set_my_value", "my_value="].
         closest match for "get_my_value": ["get_myvalue", "set_myvalue"]
         closest match for "my_value": ["myvalue"]
         closest match for "set_my_value": ["get_myvalue", "set_myvalue"]
         closest match for "my_value=": ["myvalue="]

Now the failure message is giving me exactly the information I need. Much better, don’t you think?

Tags ,

War on Perfect

Posted by Nick Sieger Mon, 22 Nov 2010 18:30:00 GMT

I intended to give this brief as a lightning talk at RubyConf 2010, but unfortunately did not get a chance. Though I kept the message simple, I think if you sympathize with being a perfectionist you can find some part of these points that rings true. I know I still have a ways to go in heeding my own advice, and not only in software but in my life as a whole.

Thanks to Hiro Asari for the Japanese translations and Jeremy Hinegardner for the Rubygems.org numbers.

War on Perfect

I want to start a war.

宣戦布告

A war on Perfection!

完璧主義への宣戦布告!

Perfect.

完璧

I hate this word.

この言葉が大嫌いです。

I want to eliminate it from our vocabulary.

私達の語彙から抹消したいのです。

What is Perfect?

そもそも完璧とは何でしょう。

Ask 10 people, get 10 answers.

訊けば十人十色の答えが返ってくるでしょう。

Different answers means disagreement.

答えが違うという事は、いずれ食い違いが起こるという事に他なりません。

Perfection cannot accept compromise.

完璧主義には妥協の余地がありません。

Without compromise, we cannot get along, or get anything done.

妥協無しには、仲良くやって行ったり 何かを成し遂げる事は出来ないでしょう。

(Just look at politics in the USA.)

アメリカの政治を見れば解りますね。

Perfect is lonely if you can’t agree or share with anyone else.

他人と合意や共有が出来ないので 完璧主義とは孤独でもあります。

We are human. No one wants to be alone.

僕らは人間。孤独は厭です。

Perfect is contagious

完璧主義は伝染し易い。

If you’re not embarrassed when you ship your first version you waited too long.

「初めのリリースで恥ずかしくないのはリリースを遅らせ過ぎた証。」

-- Matt Mullenweg マット・マレンウェグ

How many Ruby gems have never seen 1.0?

Rubyのgemで1.0に到達しないものは幾つありますか。

Any guesses?

けんとうはつきますか。

17864 Rubygems 86837 versions バージョン

13496 gems without a version that does not start with “0”. 75 Percent!

75%

I challenge you all to release 1.0 on your first push to Rubygems next time.

この次にRubygemsにプッシュする時はバージョンを1.0にしましょう。

Perfect is impossible

完璧は不可能

If you seek it, you will never quite attain it.

求めても得る事は難しい。

You will worry it’s not perfect enough, and it will escape your grasp.

あなたが完璧か心配しているうちに完璧は逃げて行ってしまう。

Perfect keeps you too focused on one thing.

完璧主義は視野を狭くする。

Your mind will cripple you.

そして足枷になる。

You won’t be able to finish it.

プロジェクトを完成出来ずに

You’ll feel helpless because nothing is ever good enough.

よくやったと思えずに、絶望感に襲われる。

Perfect ruins your productivity.

完璧主義では生産性が損なわれる。

You’ll feel like your work is never done.

いつまで経っても仕事が終わらないように思えるから。

Perfect is harmful to your health.

完璧主義は健康に悪い。

We work too hard to achieve perfection.

完璧を求め、働き過ぎる。

We set our personal standards too high.

水準が高過ぎる。

And rarely reach them.

しかも滅多に到達する事もない。

So we worry about not being good enough.

だから、「これで充分」と思えずに心労する。

This makes us ANXIOUS.

それで不安になる。

Anxiety can give you stress,

不安はストレスに繋がり

make you sick,

病気に繋がることもある。

or even kill you.

最悪の場合死ぬことすらある。

We can’t be happy if we’re anxious or unhealthy.

不安だったり不健康では幸せにはなれない。

We can’t be happy if we accept no compromises.

妥協無しには幸せにはなれない。

We can’t be happy if we’re alone.

独りぼっちでは幸せにはなれない。

We can’t be happy if we strive for perfection.

完璧主義では幸せにはなれない。

Matz knows this. He is WISE!

Matzはこのことを知っています。聡明なまっつ。

Ruby is not perfect.

Rubyは完璧ではない。

(Matz knows this too!)

これもMatzは知っています。

Matz made Ruby so we could be happy.

まっつは私達の幸せのためRubyを作りました。

Perfection keeps us from:

完璧主義では

making compromises,

妥協は許されない。

getting things done,

何かを成し遂げる事は出来ない。

enjoying each other’s company,

他人と同じ時間を過ごす喜びを見いだせない。

being happy.

幸せになれない。

And that’s why I hate it.

私が完璧主義を嫌う理由です。

So you can either try to be:

選択肢は二つ

Perfect [and be]

完璧である換わりに

Lonely

独りぼっちで

Unproductive

非生産的で

Unhealthy

不健康であるか

or you can be HAPPY.

或いは、幸せであるか。

I’ll choose to be happy. I hope you do too.

私は後者を選びます。あなたはどうですか。

ありがとうございました!

Tags , , , ,

New Orleans live music this weekend during RubyConf

Posted by Nick Sieger Thu, 11 Nov 2010 18:38:00 GMT

My boy Erik Jacobson from way back and also of Mama Digdown’s Brass Band is a New Orleans regular and knows the local scene well.

He graciously gave me the lowdown for this weekend. I’d like to make a few of these gigs; probably at least the Stooges at Hi Ho tonight, maybe Hot 8, Ellis and/or Cotton Mouth Kings tomorrow, and one of Shannon Powell or Wes Anderson on Saturday. Let me know if you’re interested by messaging me on Twitter.

Erik also mentioned that there might be a Second Line happening on Sunday afternoon that I might try to check out before I take off in the evening. Let me know too if you are up for that.

Ok, here’s Erik’s take:

Thursday

Shamarr Allen @ Irvin Mayfields Jazz Playhouse. 8:00pm.

He’s a fantastic young trumpet player and a friend of mine. This is the nice/upscale club that is in the hotel on Bourbon Street.

Kermit Ruffins @ Vaughn’s. 8:00pm.

You probably know, but Kermit is a trumpet player and is a quintessential New Orleans character. Vaughn’s is a great local dive bar that is in the Bywater neighborhood out by the Navy Yard. You’ll want to take a cab there. There is also free beans and rice at his shows.

Stooges Brass Band @ Hi Ho Lounge probably around 10:00pm.

I got a hold of Walter from the Stooges and he said they were playing tonight. They are a fantastic brass band and it’s a great local spot to catch them. Good friends of Mama Digdown’s.

Soul Rebels Brass Band @ Le Bon Temps Roulee @ 11:00pm

This is always a good hangout. There will be a ton of people there. The Soul Rebels are awesome and always play pretty late into the night.

If you felt like being adventurous, you could hit either Vaughn’s or the Playhouse from like 9-10, then take a cab to the Hi Ho for a set until around 11:30 and then finish with the Rebels. That is a lot of music, it’s just so hard to pick which ones to leave out.

Friday

Hot 8 Brass Band @ 12Bar. 7:00pm

HOT, HOT brass band. They are good friends who have been up north many times. This is a new club that is pretty close you your hotel.

Hot Club of New Orleans @ DBA. 6:00pm

This is a great Django style band. I went to college with the violin player Matt Rhoady. He also hails from Mpls and went to Henry High/ This club is over on Frenchman Street near Snug Harbor.

Kid Chocolate Brown @ Irvin Mayfields Jazz Playhouse. 8:00pm

Cool young trumpet player and singer. He also plays in Los Hombres Calientes from time to time.

Ellis Marsalis Quartet @ Snug Harbor 8:00pm

This is certainly worth going to and I am sure he’ll have a good band with him.

New Orleans Cotton Mouth Kings @ Spotted Cat. 10:00pm

This place is really close to Snug Harbor and would be fun to hit after Ellis. Great traditional band with young cats. Good people watching too. This is a cool scene here I think it’s free too!

Saturday

Soul Rebels @ DBA. 11:00pm

If you missed them on tonight, you can catch them here. This would be a good place to hear them.

Shannon Powell @ Irving Mayfields Jazz Playhouse. 8:00pm

He is so badass. You should really try to swing by if you can. He is the drummer that was on that Orchestra Hall gig I played this summer. Cool dude too. At 11:00pm there is also a brass band playing this club called the KinFolk Brass Band.

Wessell Andersen @ Snug Harbor. 8:00pm

I am sure you know him from Wynton records. He is amazing. It is a hard decision between him and Shannon Powell.

Tags ,  | 2 comments

activerecord-jdbc-adapter 1.0.0

Posted by Nick Sieger Thu, 14 Oct 2010 15:25:51 GMT

Just a quick note that activerecord-jdbc-adapter has finally hit 1.0.0. Install it today:

gem install activerecord-jdbc-adapter

Included are adapters for MySQL, PostgreSQL, SQLite3, Derby, HSQLDB, H2, and Microsoft SQL Server.

gem install activerecord-jdbcmysql-adapter
gem install activerecord-jdbcpostgresql-adapter
gem install activerecord-jdbcsqlite3-adapter
gem install activerecord-jdbcderby-adapter
gem install activerecord-jdbchsqldb-adapter
gem install activerecord-jdbch2-adapter
gem install activerecord-jdbcmssql-adapter

You can also use activerecord-jdbc-adapter with Oracle, DB2, Sybase, and Informix. Just ensure that the database JDBC driver jar files are mentioned in $CLASSPATH or require them directly in your script or application. Then, configure database.yml with adapter: set to one of oracle, db2, sybase, or informix.

This release promises superb compatibility with Rails 3. We now have the ActiveRecord test suite running in CI and the 1.0.0 release is 100% green when run on MySQL. (SQLite3 is right behind with just 13 failures, and we hope to fix those soon.)

As mentioned before, to get started with Rails 3, JRuby and activerecord-jdbc-adapter, simply run:

$ rails new app --database mysql --template http://jruby.org
   ...
   apply  http://jruby.org
   apply    http://jruby.org/templates/default.rb
    gsub      Gemfile
    gsub      config/database.yml
$ cd app && bundle install
...
Using activerecord-jdbc-adapter (1.0.0) 
...
Using jdbc-mysql (5.0.4) 
...
Using rails (3.0.0) 
Your bundle is complete! Use `bundle show [gemname]` ...

One new feature in 1.0.0 is the ability to define an extension adapter for your proprietary JDBC database without needing to hack the activerecord-jdbc-adapter source code. To get you started we extracted the activerecord-cachedb-adapter and put it on Github for you to use as a template.

The 1.0.0 release had over 200 commits poured into it and lots of great help from the community. Thanks to David Kellum, Dmitry Denisov, Dwayne Litzenberger, Gregor Schmidt, James Walker, John Duff, Joshua Suggs, Nicholas J Kreucher, Peter Donald, Geoff Longman, Uwe Kubosch, Youhei Kondou, Michael Pitman, Alex B, and Ryan Bell for their contributions to this release.

Enjoy!

Tags , , , ,  | 2 comments

Polyglot Doesn't Fix Your Messy Architecture

Posted by Nick Sieger Wed, 15 Sep 2010 20:12:00 GMT

My talk last week at JavaZone is now available. (I’ve put 1280x480- and 320x240 (iPod)-sized copies of the .mp4 files on S3 as well if you don’t have Silverlight.)

One of the problems we have as members of the JRuby team is to convince a Java-based audience that programming in a new language is worthwhile. As a result, we consider ourselves proponents of so-called “polyglot programming”. One of the opening points I made in my talk addressed arguments for and against polyglot programming.

I usually try to make a case along the lines of “learning a new language is good for you anyway”, which can come off sounding a little patronizing, like I’m reminding the audience that they should take their vitamins. While I do believe practicing multilingualism (or polyglotism) with computers is good for your programming career, I wouldn’t like to be admonished by the speaker if I was in the audience.

This time I took a different tack. I’m not sure if it’s a convincing (or even supporting) argument in favor of Ruby or polyglot, but true nonetheless.

First, I likened a software project to a physical workspace. When you use a new language in your project, you make a new space for stuff. Maybe like adding a bookshelf or some binders or a filing system.

Problem is, if your idea of organization is analogous to the cluttered desk below, adding a new language is just going to pile one more binder onto the mess.

I love clutter

On the contrary, if you have a well-organized project, adding a new language also doesn’t necessarily automatically make your project better, but it does give you capabilities that you didn’t have before.

Workbench

In the end, polyglot programming won’t fix the messy architecture and organization of your project. If you think adding Ruby to the project will make things better by itself, you probably shouldn’t be thinking about it in the first place. Ruby can be used as a tool to clean up the mess, but only if you actually clean up and remove it, and not just paper over it.

Tags  | 1 comment

JRuby at JavaZone 2010

Posted by Nick Sieger Mon, 30 Aug 2010 17:12:07 GMT

I’m pleased to be able to return to Oslo for JavaZone 2010. Whether you’re checking out JRuby for the first time or a veteran JRuby user, I’ll have something for you! And if I don’t, I encourage you to come badger me after the talk is finished.

JRuby: Now With More J!

Additionally, if you’re interested in meeting up for some JRuby discussion next week in Oslo, do drop me a note at the address in the upper right.

Tags ,  | 1 comment

Deploying, Monitoring and Troubleshooting Rails on JRuby

Posted by Nick Sieger Mon, 30 Aug 2010 17:06:52 GMT

I am pleased that my Engine Yard webinar on JRuby and deployment is available for general viewing. While the JRuby deployment story is still evolving and maturing, and the 60 minute time frame is too short to cover the issues in depth, I hope you’ll find the content at least gives you some ideas or directions to look.

As always, feel free to contact me with any questions!

Deploying, Monitoring and Troubleshooting Rails on the JVM with JRuby from Engine Yard on Vimeo.

Tags ,  | 1 comment

I was Paul Gonsalves

Posted by Nick Sieger Sat, 10 Apr 2010 16:40:00 GMT

I was Paul Gonsalves in the shower this morning. Most people sing in the shower, but when I get going I play air sax. For a fleeting moment I felt like I was blowing with the Ellington band at Newport in 1956. The way obscure things flow in and out of consciousness is a weird thing.

If you haven’t checked out the 1956 Ellington at Newport live recording of Diminuendo and Crescendo in Blue, you really should. I hadn’t heard the recording for years until my lovely wife put it on a great jazz mix playlist that we listened to on the road last weekend. The recording is completely infectious; my foot was tapping within a few moments of the start of the song. The Newport concert is infamous in Jazz lore -- Gonsalves blew 27 choruses and put the crowd into a frenzy. The great thing about the recording, even though it’s a little bit scratchy, is that you can hear and feel the energy of the crowd coming through. Although it’s probably a bit hyperbolic, some Jazz writers claim that Gonsalves single-handedly revived Ellington’s career that day.

Why was my mind in that state at that moment? I wish I knew. The mystery of heightened awareness that is flow is an elusive quality. At lunch at RubyNation yesterday a discussion arose of just how rare it is to attain that awareness. Glenn Vanderburg described how only a few times in his double-digit year career as a conference speaker has he felt like he has had that hyper-aware state, where he was receiving feedback from the crowd during a talk and able to adjust mid-stream and feel completely on. The difference of timing and how that affects an audience’s response is striking. The difference between being on and having a joke or a point fall flat is incredibly sensitive, as any performance artist will tell you. Just to think about it gives me a newfound respect for stand-up comedians, where timing is so crucial.

I myself haven’t quite felt that heightened state while delivering a conference talk, but I have felt it while playing jazz. Still, it has happened only once or twice in my life. If you’ve felt that flow, you know rare it is and how you absolutely cannot manufacture it at will. The feeling is such a high that I suspect it leaves artists, performers, and creative types feeling unfulfilled and half-desperately searching for it for the rest of their careers.

I’m not very well read in this area, but I’d like to learn more. Any suggestions for reading material?

I tend to stew on these things for a while but fail to put together a coherent, digestible conclusion, I thought I’d at least write something up, get it out there, and start a conversation. When have you felt that flow, and have you noticed how you get into it?

Other tangential thoughts swirling around in my head:

  • Is flow related to a search for perfection? Instead, should we coach ourselves to cope with life’s imperfections? Dave Thomas gave his “Ruby sucks” talk last night at RubyNation and eloquently made the point that Ruby is not perfect, and that’s what makes it great. I’ve struggled with not settling for less than perfect and it ends up usually being more detrimental to my production than anything else.
  • Why Americans Don’t Like Jazz. Have we lost an appreciation for things we can’t put to words?

Tags ,  | no comments

Older posts: 1 2 3 ... 17