Jake Scruggs

writes ruby/wears crazy shirts

The number of software luminaries who sing the praises of “Structure and Interpretation of Computer Programs” (referred to as SICP) is such a long list that you might think only a crazy person would take issue with it. However, to ignore SICP’s problems and continue to blindly recommend it seems just as crazy.

SICP was the textbook for MIT’s introductory programming class and was a bit of a departure from other into to computer science textbooks at the time.  Wikipedia sums it up nicely:  “Before SICP, the introductory courses were almost always filled with learning the details of some programming language, while SICP focuses on finding general patterns from specific problems and building software tools that embody each pattern.”  Which sounds awesome, but does essentially say that abstract principles will be introduced before the nuts and bolts of a language.  If you think about that for a minute, you may see where the problems will be.

When I was training to be a teacher I took a bunch of education courses.  I got good grades but when I got into the classroom to actually teach I flailed around just trying to keep the class under control and mostly forgot to apply the principles I had learned.  The knowledge was in my head, but it floated, disconnected, from anything in particular.  When I learned these ideas I had no teaching experience, and so, nowhere to place these abstract principles.

SICP’s first chapter explains the basic form of Scheme (a Lisp), some basic operators (+, -, *, /, etc), defining/calling a function, different ways a compiler might evaluate code, and conditionals over the course of a few short pages.  That’s a bit much to swallow all at once, especially the comparative evaluation stuff but that should be easily sorted out with some examples. Right?  Well, that’s not really SICP’s thing. SICP will give you a few trivial examples and then toss you right into the deep end. Then first 2 problems for the reader are pretty easy, but it’s the 3rd that will let you know what yer in for: “Define a procedure that takes three numbers as arguments and returns the sum of the squares of the two larger numbers.” Which seems pretty easy until you realize there are no variables.  You’ll need to figure out an algorithm that can take 3 numbers and, without any intermediate state storage, return the 2 biggest numbers in such a way that you can sum their squares.  I’ll be real honest here, after about 30 min of trying to do this (I have zero functional background so I’m a complete novice here) I gave up and tracked down the answer online.  Of course the answer was simple and concise and made me feel like a chump.  Which is fine, but not really what I was expecting in the first chapter, let alone the 3rd problem of the entire book.

But that’s what SICP is all about -- challenging problems. The rest of the chapter introduces Newton’s method for square/cube roots and lexical scoping just for fun. Chapter 2 is recursion vs iteration in terms of execution speed, resource usage, and transforming from one to the other.  Logarithmic, linear, and exponential growth are dealt with in a few paragraphs and then we’re off to Exponentiation, Greatest Common Divisors, Primality, and implementing Fermat's Little Theorem for probabilistic prime determination. My favorite question from chapter 2 asks the reader to formulate an inductive proof that Fib(n) is the closet integer to ((golden ratio)^n)/5.

Which brings me to another criticism of SICP:  It assumes a familiarity with math that most people just don’t have. A first year MIT student would probably be swimming in math classes so the book assumes that knowledge on the readers part.  Abstract programming principles can be very difficult to find examples for so I’m sympathetic to the plight of the authors, but when you just go straight at math you’re explaining an abstract thing with another abstract thing.

There’s a certain sort of person who gets excited by complicated abstract but internally consistent logic with no real connection to the concrete.  In my experience as a physics teacher, these students do exist but are very rare. Most people need a bit of connection to something tangible in order to have the ideas connect in their brain.

What then is my point about SICP?  Simply that its explanations are overly terse and its problems are large steps past what little is explained.  In light of those things I have recommendations for those who attempt to work through it.

  • If you intend to do every problem, realize that this will take a LONG time and involve a bunch of research.
  • Set a time-box for how long you’re going to spend on a problem before you go look up the answer.  If you’ve spent enough time trying to solve a problem you will still value the answer enough to remember it. 30 min is a good number.  Increase or decrease as your sanity allows.
  • If you feel like something hasn’t been explained:  You’re probably right.  After you find the answer, a close re-reading will reveal a cryptic sentence that you now realize was trying to tell you something. This will infuriate you and is perfectly normal.
  • Work through the book with a group.  This will hopefully allow you to commiserate about how lost you are and get some help.  If there’s someone in there that loves this book and thinks everything is explained perfectly, ignore them.  If they subtly imply that you’re stupid for not getting it:  Leave the group.  You don’t need that static in your life.
  • Do not feel bad about not knowing all this math stuff:  Remember that this book was written for students who would be surrounded by math at the time they read it.
  • Consider learning Lisp before starting this book.  The really important concepts in the book come easier if you’re not also learning Lisp at the same time

My last commit to MetricFu was March 2...  of 2011. 


Since I am throwing in the towel and handing over leadership (perhaps to you), I thought I should explain why I've been such a terrible maintainer and why I'm walking away.


  • 1). MetricFu is a mess.  At some point, with all the submissions coming in, the architecture and testing got away from me.  Now it's pretty depressing to see crap code quality in an app that is supposed to be about good code quality.  I can not overstate how embarrassing and frustrating this is – mostly because it's my fault (I let in things I shouldn't have. Stupid feature blindness).
  • 2). In 2008, when I created MetricFu, I was fascinated by metrics and now I'm not because I don't need the tools to see the problems anymore.  Metrics made me better but now I'm leaving them behind:  Selfish.
  • 3). I'm not a consultant at the moment so the exploratory nature of MetricFu isn't very useful to me.  I know where the bad parts of town are in my app.
  • 4). I think metrics can be a great teaching tool, but you can learn all the wrong things if you're not careful. You can reduce Flog scores without making the app better (Simple: arbitrarily divide up every large method) . Same with code coverage. Even code duplication detection can lead to bad code.  DRY-ing things up in a bad way can often be much more harmful then leaving them moist (perhaps you removed some duplication by creating a crazy amount of indirection – a common problem).
  • 5). Ultimately, creating software is a craft.  It's not pure science and it's not pure art, it's a combination of both.  MetricFu leans a too little hard toward numbers and that implies a precision we just don't have. How to get from bad code to good is a very delicate dance between content, form, and business requirements.
  • 6). Integrating over a dozen meta-code gems is a god damn pain.  The gems that make up metric_fu use code to analyze code (intense meta Ruby) and so they sometimes conflict.  Also since MetricFu mostly uses regexes to parse the (command line or html) output, every change in one of MetricFu's underlying gems means that MetricFu needs a version bump. 
  • 7). The last year has been, personally, very busy and difficult for me.
For these reasons I'm going to be stepping aside as metric_fu maintainer – I'll still be around to answer questions and such but I probably won't be contributing much code.  If I've somehow disappointed or frustrated you because of last year's neglect then I apologize. Seriously.  I'm sorry.

Want to lead MetricFu? Make your case in the metric_fu google group:

We've been having some Oracle deadlock issues that have been hard to reproduce locally. After a lot of investigation and solving of important problems that happened not to be THE problem we figured out that while we've been pretty good creating integrity constraints in the database we have not been very good about making sure that every foreign key has a corresponding index. And that can lead to problems.

So we had a situation were our documents table had a foreign key on the accounts table that was not indexed. So updating an account row lead to a whole table lock on documents (instead of just a row lock which would have happened if there was an index) and that was very bad when we had two separate processes where one was doing a bunch of accounts stuff and the other was doing a lot of documents stuff. Deadlocks for everyone!

The sad thing is that if we had just drank the Rails cool-aid about having no integrity constraints in the db we would have been fine but we got into trouble by only implementing constraints and not the indexes they work much better with.

So we found this cool bit of SQL that helped us find all the foreign keys missing an index here: http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:4530093713805#26568859366976

And that help us solve the deadlock problem. But what about the future? If only there was a way to run this check periodically and automatically... Time for a test!

As an additional bonus, the failing output of the test tells you how to write the index you need. Big thanks to Dave Bortz for tracking down this problem -- I just swooped in and wrote the test. And took credit in this here blog.

Aug 28, 2010

Ruby Kaigi 2010 Day 3

Last day of Ruby Kaigi! Sad to see it go, it's been a great conference. As per usual Tweets are in bulleted italics and the rest is after the fact commentary.

First I've got to show you the commemorative fans they were handing out:

It's the creators of Ruby and PHP

It's Matz and... Someone else (sorry if it's obvious - I don't know). And of course they are programing in the bath.
  • BigDecimal: You can handle numbers as large as can fit into memory as opposed to the IEEE double #rubykaigi
  • BigMath is the Math module for BigDecimal #rubykaigi
  • Lots of different rounding modes in BigDecimal #rubykaigi
  • BigDecimal.mode is global per process - not thread safe #rubykaigi
  • So BigDecimal is Fiber unsafe #rubykaigi
  • .@mrkn implemented a solution storing mode in thread local #rubykaigi
Oh good. Wait, is that in 1.9.2 or trunk. I'd have to be in 1.9.2 right? To the Google! ... Yep, seems like it made it in: http://redmine.ruby-lang.org/issues/show/3285
  • You can now change modes in a block (added to trunk yesterday) #rubykaigi
  • Effective digits/ Significant digits determines which digits to keep and which to round off #rubykaigi
  • BigDecimals don't know their own effective digits #rubykaigi
But I think the point of talking about sig figs was that it's coming soonish in Ruby. 1.9.3?
  • It is dangerous to mix floats and BigDecimals #rubykaigi
  • BigDecimals can't convert from rational, integer, or float. just strings #rubykaigi
  • And you can't do BigDecimal(BigDecimal) !! #rubykaigi
That is one crappy interface. Taking in only strings is frustrating and weird. How did this happen?
  • Now a preview of the future of BigDecimal #rubykaigi
  • No library for irrational numbers in Ruby #rubykaigi
  • Perhaps we can represent irrational numbers as algorithms and on convert when needed. #rubykaigi
  • BigDecimals don't have real significant digits implemented right now. #rubykaigi
  • The issue of BigDecimal not being able to handle anything other than a string as input will be fixed as it is a bug #rubykaigi
The irrational numbers thing sounds pretty cool. Since I mostly sling around strings for my day job I don't know that I'll ever use it. But purely for Ruby pride I like to see ruby challenge Python's rising dominance in the sciences and maths.
  • I really don't like the lack of travel time between session. You should have at least 5 minutes to change sessions. #rubykaigi
Look, this has been a great conference and any slights I've tended to overlook because they've really done a heroic job of keeping the admission price down but that lack of a passing period is just... Well I don't see why they did it. Just having the time as a buffer in case talks run over is reason alone. Moreover, no passing period traps people in sessions that they'd rather not be in and restricts choice.
  • Apparently there is a lot of chatter in IRC by ruby commiters that NArray should be added to strd lib. #rubykaigi
  • NArray is 28x faster and uses 8x less characters in 1.9.2 #rubykaigi
  • NArray is faster than what? Array, I assume, but I may not be following the translation correctly. #rubykaigi
Translation is volunteer and best-effort so it adds some challenge to attending sessions in a foreign language. So if I make any mistakes in this here blog, that's what I'm blaming it on.
  • Pwrake is parallel distributed Rake - being developed here in Tsukuba. #rubykaigi
Just a little tidbit dropped at the end of the NArray presentation -- sounds pretty cool. Masahiro Tanaka is using it drive his workflow in his scientific research.
  • yarv2llvm tries to speed up Ruby by implementing type inference (yarv is the vm for 1.9x) #rubykaigi
  • There are times in Ruby when type can not be inferred and in those cases yarv2llvm is often slower than Ruby 1.9x #rubykaigi
  • Fixnum overflow to BigNum is one of the hardest problems to solve #rubykaigi
  • Btw, I think the title of this talk: "How Did Yarv2llvm Fail" is wonderful. Way to keep everything above board. #rubykaigi
Great talk and very honest. The type inference thing looks promising but there are a couple of tough hurdles to clear. Maybe some day. Until then there's always Mirah.
  • Ruby AOT complier is "mostly compatible" with Ruby 1.9 #rubykaigi
  • AOT == "Ahead of time"
  • Ruby AOT compiler is passing 7847 of 7850 Ruby Spec tests as of now. #rubykaigi
  • On average Ruby AOT compiler is 3.5x faster than 1.9 for common benchmarks #rubykaigi
Cool, let's all move to Ruby AOT!
  • It doesn't fair quite so well in the real world Ex: Rails. Slightly slower than 1.9 #rubykaigi
  • Something about cache misses makes it slower #rubykaigi
  • The Ruby AOT compiler team wants to reduce the generated code size to increase speed. #rubykaigi
  • Rails can be compiled in 77 min and size of compiled code is 92MB with Ruby AOT #rubykaigi
Oh. Never mind. Plus, compiling. Boo. Hiss.
  • This memory profiler's gui looks amazing! #rubykaigi
  • Seriously, this is the sexiest profiler ever #rubykaigi
  • Can attach to running Ruby programs from another machine #rubykaigi
  • Designed to have as small as possible impact and be easy to use #rubykaigi
I gotta tell ya the audience was chomping at the bit to get a hold of this profiler. You can run it in production for christ's sake! And the GUI is to die for.
  • Not available yet!?! #rubykaigi
  • Needs to get patch accepted into ruby core - maybe in 1.9.3. RATS! #rubykaigi
Very cruel of Tetsu Soh not to mention this up front. I'm sure it was an oversight but everyone was crazy disappointed. Still this was one of the best talks of the conf. Tetsu Soh is one to watch.
  • Dear Ruby Core please, please, please, please, please, please, please, please accept Tetsu Soh memory profiler patch #rubykaigi
Indeed. I'm famous (on the internet (in one corner)) so you should listen to me.
  • Lots of requests to publish Tetsu Soh's memory profiler on Github. I agree! #rubykaigi
  • Automatic sliding doors in Japan trigger much latter than Americans would expect leading to a lot of stopping and hand waving
I'm not the only one who noticed this so I'm not crazy.
  • More awesome techno in the #rubykaigi main hall. I want, nay, need the playlist.
Please post it on the 'Goodies' section of the Ruby Kaigi site. Or tweet about it. Something.
  • Shay Friedman has spent the first five minutes of his talk apologizing for being associated with Microsoft. Stop. #rubykaigi
There was this weird hostile vibe coming from Shay. I felt like he hated us for liking Apple products. The weird thing is that there are a lot fewer Apple computers here than at a normal Ruby Conf. Maybe he thought we were all Microsoft haters and so he might as well fire first. Seemed like a mistake.
  • Just saw a nice hello world creating windows and dialog boxes in IronRuby #rubykaigi
  • IronRuby currently passes 85% of Ruby Spec. #rubykaigi
  • IronRuby 1.0 is 1.8.6 compatible. 1.1 (coming soon) will be 1.9.2 compatible. #rubykaigi
  • Windows Presentation Foundation's view templates are written in xaml which is like html. #rubykaigi
Another markup language because we needed more. I feel like the IronRuby team really needs a win. They've been the slowest progressing Ruby VM for a long time now.
  • <script language="ruby"> Whaa? Gestalt hides a hidden bit of Silverlight in the page so you can replace Javascript with Ruby. #rubykaigi
Pretty neat trick that. Of course it means making your site dependent on silverlight. No worse than depending on Flash I guess.
  • IronRuby.Rack is Rack implementation on ASP. Currently in beta. #rubykaigi
It's all coming along, I'd just like to see something working at this point in its life.
  • If key is symbol then only one instance - less object creation. Which is why everyone uses symbols. Or because everyone else does #rubykaigi
So did you know why everyone uses symbols? Or did you just do it because that's the convention. Yeah, me too but then I learned. I'm not going to say how long ago that was.
  • Presenter's computer went down and it's taking forever to reboot. Stupid Mac. #rubykaigi
That's one of those rough moments where you really feel bad for the presentor. But he handled it like a champ -- continuing the presentation while he waited for his machine to boot back up. Well done. I wish I got more out of the talk but it was one of those inspirational talks that are hard to translate. The Japanese speaking audience seemed to love it.
  • Please use the overburdened network to download the english version of the slides. Umm... What? #rubykaigi
Huh. Why did that seem like a good idea. Since when does asking a room full of people to download something all at once ever work. And yet, it seems it happens once a conference. Repeat after me: Never ever depend on the network at a conference.

Funny story time. All through the conference I spent a lot of time staring at the IRC screens on either side of the stage where the translations happen. But since it's just IRC, anyone can join the room. There was this one guy who posted A LOT and everyone of the posts seemed to be either:

I later found out that 888888 means clapping and wwwww means laughter. OK but stop cluttering up the screen that I'm trying to read translations off of. Then I found out who sora_h was: He's 14 and his name is Shota Fukumori. He got up and gave an entertaining lightning talk. Turns out he's a Ruby commiter so he's got that on me.

Young programmer

And, all of a sudden, it was time for the final keynote by Chad Fowler. He gave a talk about how to live a remarkable life and it was good stuff.
  • The two things that are necessary to live a remarkable life are: To have intention and a system of realizing that intention #rubykaigi
  • Living intentionally means being mindful of your actions. It's easy to coast through life. #rubykaigi
  • "My co-workers laughed at me when I learned Ruby" - Chad Fowler #rubykaigi
  • "You don't want to be in a situation where you are competing on price" - Chad Fowler #rubykaigi
  • Programming Cobol is like working in a hospice. There's a market for that. - Chad Fowler #rubykaigi
  • "Always be the worst musician in whatever band you're in" Pat Matheney #rubykaigi
  • "If you're playing things that sound good then you're not practicing" lesson from music that applies to programming #rubykaigi
  • "I needed a project that was useless" - Chad Fowler #rubykaigi
  • "Was today better than yesterday?" All you have to do is get a little better every day #rubykaigi
  • "Passion is a resource that you have to conserve" - Chad Fowler #rubykaigi
Lots of gems in there.
  • RubyKaigi 2011 will be in July and in Tokyo. #rubykaigi
There was something about the theme being "The Last Ruby Kaigi" but I think it was sort of a joke making fun of some guy who posted a rant about how the Ruby Kaigis need to end. I didn't have enough background to get it.

Oh, I forgot to talk about the guy hawking "The Last Google Wave Book Ever Published." It seems he had been working on a Google Wave book and it was printed on the same day Google announced the end of wave. His response? To shamelessly promote the book at Ruby Kaigi in a lightning talk, at some sort of hallway session (with 30 people gathered around), and pretty much everywhere else. And I actually saw some people carrying the book around. Did they buy it? Who knows -- his positive personality was so powerful I wouldn't be surprised if they did.

The Last Google Wave book ever published

Ruby Kaigi was an excellent time. I thought it might be crazy intimidating but everyone was super nice and there were enough english speakers so that I could always get my ideas across. Go if you have the chance.

Also, check out my every growing set of Ruby Kaigi photos at Flickr:

Holy crap am I tired. It's been a long awesome day. It started out with some excitement:

  • Just found out I have an hour time slot when all I prepared was 30 minutes. Ok, time to write some more. #rubykaigi
  • Panic! Maybe I'll talk about metric_fu a bit. #rubykaigi
I must have looked at that schedule 20 times and never realized that I had an hour slot. Everyone else had 30 minutes so I thought I did too.
  • Attendees of "The Importance and Implementation of Speedy Tests" will also get "Metrics Based Refactoring" at no additional cost! #rubykaigi
I did something I almost never do: Look at crisis as an opportunity (crisi-tunity). I had to write "Metrics Based Refactoring" anyway for Windy City Rails so why not write it now. In less than 4 hours. While watching my friends present at a conference. Looking over those sentences now I can't believe I didn't freak out.
  • Ted Han used publicly available data to settle reviewing bais accusations against "The Edge" of hating the PS3 #rubykaigi
  • Turns out there was no bais. Math to the rescue! #rubykaigi
  • bais? bias? baise? no idea.
You are probably not surprised to find out that I can't spell. Even Eito Katagiri, who did a wonderful job translating my slides, found a bunch of spelling errors and English is not his first language.
  • I just pulled out a table in the main hall and the table police where all over me. My mistake. Sorry. #rubykaigi
There were announcements everywhere about not doing this and yet I did. In my defense: I'm an idiot.
  • They're giving out an award to the person who committed most to Ruby 1.9.2: Yusuke Endoh #rubykaigi
A very nice gesture. Lots of class here at Ruby Kaigi.

Time for Matz's keynote!

  • Matz is talking about Ruby 2.0... again. #rubykaigi
This topic is a staple of Matz's speaking career. I think the first time I saw him talk, years ago, he was talking about Ruby 2.0. Someday...

  • "Right now ruby is just good enough" - Matz #rubykaigi
  • Matz hates local variable propagation (the lack thereof) but no one else seems to care so he's abandoning it. #rubykaigi
  • Ruby's private is not private: it can be accessed from subclasses and overridden by accident #rubykaigi
  • Monkey patching modifies the class globally. #rubykaigi
  • Classbox is the solution to global monkey patching #rubykaigi
Lots of talk about the mysterious 'classbox.' What is it? Well here's a paper on the subject:

And some pertinent lines from the abstract:
...Unfortunately existing approaches suffer from various limitations. Either class extensions have a global impact, with possibly negative effects for unexpected clients, or they have a purely local impact, with neg- ative results for collaborating clients. Furthermore, conflicting class extensions are either disallowed, or resolved by linearization, with consequent negative effects. To solve these problems we present classboxes, a module system for object-oriented lan- guages that provides for method addition and replacement. Moreover, the changes made by a classbox are only visible to that classbox (or classboxes that import it), a feature we call local rebinding. To validate the model we have implemented it in the Squeak Smalltalk environment, and performed benchmarks.
Now for more Ruby 2.0 preview:
  • 5/2 => 2 should be 2.5 or 5/2 (rational) #rubykaigi
  • Inheritance in ruby is more for connivence than for other merits #rubykaigi
  • Matz is thinking about moving mix-ins to a traits like solution which would have conflict detection (unintentional overrides) #rubykaigi
  • You could declare the 'mix' and specify how to deal with conflicting methods. #rubykaigi
  • mix Foo, [:*] would copy all constants from the mix, or you can specify which ones you want and rename them #rubykaigi
  • mix raises error on method/constant name conflict or removing #rubykaigi
  • From Matz's slides "Ruby 2.0, just started, small step from 1.9, should be done soon" #rubykaigi
  • Ruby 2.0: Traits, Classbox, Keyword arguments, a few other nifty features #rubykaigi
  • There some fierce discussion going on in IRC about the proposed changes in Ruby 2.0 #rubykaigi
The debate on 'mixes' got pretty hot and heavy. Keep in mind that all this IRC chatter is displayed behind Matz while he was giving his keynote because the translations are done in IRC. So you'd be reading a translation of what he said right along with people discussing it.
  • My presentation on "Speedy Tests" and "Metrics Based Refactoring" starts at 13:30 (10 min) in room 200 #rubykaigi
  • The 'slides' from my presentation on "Speedy Tests" http://is.gd/eHNTN #rubykaigi
I think the talk went very well. Especially considering that I wrote the second half fairly fast.
  • I just disparaged integration tests in favor of unit tests. Next up is @p_elliott talking about how he only does integration #rubykaigi
  • .@p_elliott does a lot of things to make his integration test fly. I would like to see one of their suites. I could learn a lot. #rubykaigi
So I asked Paul how long their suites take and he said that they develop on 8 core machines and use Specjour to utilize 4 more cores so they tend to run between 5-8 minutes. Pretty damn fast for full stack integration testing.
  • Hey, someone else made the 30 minutes vs. 60 minutes mistake. I feel better now. #rubykaigi
Except he found out at the end of his presentation when he asked: "How much time do I have left?" and go the response: "25 minutes." Yipes. Luckily there were a lot of questions.
  • .@nusco did a really good job explaining the basics of Ruby metaprograming
  • RT @sudhindraRao Whatever works in #java does not work in #ruby. Even huge classes are maintainable. @rubykaigi
  • .@nusco's favorite metaprogramming trick is method_missing. I thought he was kidding but he was not. #rubykaigi
When he said method_missing I grabbed the microphone back and responded: "Really?" I couldn't help myself. I tend to avoid method_missing. There's usually a way to do what you want with other programming tricks.
  • Modules are extremely decoupled and can be tested in isolation so they are very flexible @nusco #rubykaigi
Good point.

  • Lightning Talks! I'm excited! #rubykaigi
Talking very fast does not lend itself to translation. But still they were very cool. Even better there was a lady in a kimono who would 'gong' you if you ran out of time.

The gong lady stikes

That is awesome.

After the lightning talks a few of us went back to the hotel to drop our things of before the party and we ran smack into this huge festival that happens once a year in Tsukuba. Here are some pics:

Festival 11

Festival 4

Festival 6

The party was super nice. And they had a fantastic spread of wonderful foods and drinks.

Aug 27, 2010

Ruby Kaigi 2010 Day 1

Here I am in Japan at RubyKaigi 2010. Wow. Generally I tweet a lot about the conf live and then publish those tweets here (in italics) and provide slightly more commentary. So lets get it on.
  • So my flight leaves at noon for #rubykaigi, takes 13 hours, and arrives at 3pm tomorrow... Wait -- that can't be right. #looksitupagain
  • Before today's trip to Japan the furthest from the U.S.A. I've ever been is: Canada. #howisthatpossible
  • In cab. It has begun.
  • Someone once said "If you've never missed a flight you're spending too much time in airports" #atgate2hoursearly
Yep - can you feel the panic in those first couple of tweets? I was totally freaked out. The actual trip turned out to be easy. I met up with Chad Fowler, Yehuda, and Woody at the airport and we took a bus straight to Tsukuba. I went to an exotic foreign land and the first thing I did was take a bus through 100 minutes of strip malls. But I was in Japan. And Yehuda held forth on 'snowmen' and encodings for most of the way so that was interesting.

Yehuda Katz Holds Forth on the Bus

  • So it's 7:15 am in Chicago, meaning I've been up for over 24 hours. So that's like 36 old man hours.
  • My first meal in Japan was near 60 bucks. And I'm not even in Tokyo yet. I'm gonna need a bigger wallet.
  • Also, I almost got run over by not one, but two bicyclists using cell phones to text.
  • And 7-11's are everywhere.
So I survived the first day and even had an excellent dinner. It was a bit pricey but worth it. Many thanks to Makoto Inoue for helping organize this get together - it was exactly what I needed.

  • Donuts are cute in Japan: http://is.gd/eFXCR

Donuts are cute at Mr. Donut

Ate second breakfast/lunch at "Mr. Donut" which is really nice here in Japan. Of course you can get noodles.

  • Good news: #rubykaigi has a non-freezing temperature. I was worried it would be 91 outside and 50 inside. Which tends to make me sick
  • Some nice low-key techno playing in the #rubykaigi main convention hall.
  • RT @headius Ruby 1.8.8 will release this year and be the last 1.8 release. Some debate still about whether to backport 1.9.2 features. #rubykaigi
Ah, Charles got to got to the secret Ruby Core meeting so he's in the know. Actually I could have probably gone too but I wasn't sure if just anyone was allowed.

  • Btw, the advice I received to stay up as long as possible after my flight to Japan was good. Feeling no jet-lag.
  • I adjusted my Japanese rent-a-phone to display am/pm and now it reads "0:32pm" I guess they really like military time here
It's the little things that are the most endearing.

  • Getting an introduction to #rubykaigi in japanese with translations coming in IRC which is displayed on side screens. #lag

We get a lecture on proper use of wifi

  • Next up at #rubykaigi is a panel on Rails 3/ Ruby 1.9.2 (replacing canceled keynote)

First panel

  • Ah, the translations are back. Mostly. #rubykaigi
  • RT @headius I can't decide if it will be more or less exhausting to attend three days of conference sessions I can't understand :) #RubyKaigi
  • .@wycats is fearless - he's critiquing Ruby 1.9.2 while sitting 5 feet from matz on stage
So Leonard was doing the translation from Japanese to English and Matz was doing the translation from English to Japanese which lead the a moment where Matz had to translate Yehuda's (nice) criticism of Ruby 1.9.

  • One of things @tenderlove really likes about 1.9 is using encodings is painless. You have to think about it but it's easy. #rubykaigi
  • Secret to getting commit rights on Ruby or Rails? Submit patches with tests over a consistent period. #rubykaigi
  • .@tenderlove doesn't think that ActiveRecord got the same amount of love that ActiveSupport did in Rails 3. #rubykaigi
  • Specifically @tenderlove doesn't like ActiveRelation's integration in ActiveRecord in Rails 3. "It needs help" #rubykaigi
  • .@wycats' response: "There's always 3.1" #rubykaigi
  • .@tenderlove feels less able to bounce around the whole project when developing on Ruby as compared to Rails. #rubykaigi
  • .@wycats brought up something for Ruby core, saw a lot of discussion referencing his name but he could not participate. #rubykaigi
Ah the perils of trying to develop across (real) languages.

  • Wait, Sarah's talk is going to be in Japanese? #rubykaigi
  • Oh, just the first part -- well done. #rubykaigi
She learned a lot of Japanese just for this presentation. Good for her.

  • Rails wrapping of Javascript is kind of a disaster - mostly because javascript is changing fast. #rubykaigi
Good point - I hadn't really thought about why wrapping SQL works so well while wrapping Javascript works out so poorly.
  • Step one to writing testable Javascript: Get it out of the view. #rubykaigi
  • Pivotal uses Jasmine to test their Javascript: Bdd/RSpec like syntax and no dom is required. Can run in browser or headless. #rubykaigi
  • There's no time between sessions to escape one and go to another. Good thing I don't mind appearing rude. #rubykaigi
Picture a lot of me saying "Excuse me" to people who don't understand english.

  • OH "Social games are just CMS with bad UI's" #rubykaigi
That's really funny.

  • MySql 5 only supports 3 bytes for UTF8. huh. #rubykaigi
  • A 'u' with an umlaut is two code points that represent one character. #rubykaigi
  • UTF8 and UTF16 are both encodings of unicode. #rubykaigi
  • In Ruby 1.8 and C a string is just an array of bytes. #rubykaigi
  • "Corruption is normal" - @wycats #rubykaigi
  • force_encoding is not the way. If you have to use it you probably have a deeper problem. #rubykaigi
  • Dear internet: Take all sweeping statements with a grain of salt.
Two sessions in a row on encodings. We all feel like we need to know more about encodings. And then we ignore that feeling until it bites us in the ass.

  • jugyo has a lot of Growl-themed ideas. #rubykaigi
  • Had an outbreak of super-sleepiness. Purchased a strange energy drink from an even stranger vending machine and I'm good. #rubykaigi
  • TermColor can do blink! Now that's progress. #rubykaigi
  • Cinatra is Sinatra for command line apps. #rubykaigi
  • "write code like writing blog entries" - jugyo #rubykaigi
Watching Jugyo talk is always entertaining - I loved his lightning talk at last years Ruby Conf.

  • .@tenderlove has changed into a crappy suit -- It's business time! #rubykaigi
  • And headgear? #rubykaigi

@tenderlove 1

That, my friends, is awesome. I can't compete in shear crazy and acknowledge my superior.

  • The number of languages (code) vs. the number of languages (speak) is completely off. #rubykaigi
  • "People are interpreters with forgiving parsers." - @tenderlove #rubykaigi
  • .@tenderlove enjoys programming the most at hack nights. Challenging and fun. #rubykaigi
  • PHP and Ruby living together: Webrick serving up WordPress. You are one weird dude @tenderlove #rubykaigi
Webrick serving up PHP WordPress. Think about that for a moment.

  • Making some last minute changes to my #rubykaigi presentation: "Speedy Tests" Come see it tomorrow at 13:30 in room 200
Hey, I just found out I have an hour time slot when I had thought I was going to present for 30 minutes. I guess the crowd is going to get some bonus metric_fu coverage. As I'm going to present in 4 hours I better go write some more content. Panic!

Oh yeah, go check out my Ruby Kaigi photo set on Flickr: http://www.flickr.com/photos/jakescruggs/sets/72157624815648014/

Using Git Inside a Git Hook can cause problems. In my previous post: "Signal 13 Problems with Git Hooks" I describe how we are trying to automatically merge certain types of branches into a branch that is designed to hold them all. Anyway, that means we want to run some git commands inside of the git hook. We change dirs into another directory where we have a clone of the repo and start telling git to merge some stuff and we get a bunch of

remote: fatal: Not a git repository: '.'
But if we run the exact same commands as the git user everything works fine. Huh. Eventually we got our linux guru over and he noticed that the environment under which the git user runs is totally different when inside a hook. Gitolite does a bunch of things to the env, but the one that was screwing us up was the setting of the GIT_DIR. After we figured that out, the solution was as easy as:

ENV.delete 'GIT_DIR'

in our ruby script that is triggered by the 'post-receive' hook. And now I must get back to the fun.