Minnebar Podcast: Agile Design

Posted by Nick Sieger Tue, 23 May 2006 02:44:00 GMT

In this podcast from minnebar 1, Ben Edwards presents on the topic of agile design. Using memes from the Agile Manifesto and 37 signals among others, Ben does a great job fostering a discussion.

Download the podcast here, or put my feed in iTunes or another podcatcher to have the podcast downloaded for you.

Posted in  | Tags ,  | no comments | no trackbacks

Haikus for thought

Posted by Nick Sieger Thu, 18 May 2006 02:48:00 GMT

Open source Java.
Who could possibly fork it
What? Not IBM!

Open source Java
Rather be hacking Ruby
Too late to matter

Open source Java
Need dynamic languages
Use JRuby now

Tags , ,  | no comments | no trackbacks

JRuby on Rails and ActiveRecord on JDBC

Posted by Nick Sieger Mon, 15 May 2006 03:12:00 GMT

Tom and Charlie have just experienced what can only be described as a watershed moment in the grand scheme of dynamic languages on the JVM. The Rails experience may soon be visiting a Java application server near you! Even though JRuby will be in perpetual catch-up mode with C Ruby, Tom and Charlie and the rest of the JRuby contributors have shown incredible perseverance in tracking the Ruby language despite the lack of any formal specification. Maybe Rails will never be mainstream, but the possibilities just got a whole lot more interesting. I agree with Obie that this could be a game-changer.

Now, a few comments about the ActiveRecord JDBC adapter. This code can still be considered alpha quality at best. It’s awesome that Tom and Charlie will be able to demo a top-to-bottom, working Rails app on JRuby, but don’t jump to conclusions yet that this will be anything like a write-once, deploy-to-any-database kind of experience. But you didn’t think it would, did you? We all learned that about Java a long time ago, right?

You can check out the code here. At the moment, I’ve only tried it with MySQL. Most of the problems with it come from the lossy mapping from ActiveRecord’s abstraction of the database to JDBC’s. (Although I suspect as more JDBC drivers are tried that there will eventually be compatibility issues with different implementations of the JDBC spec.)

Probably the thorniest issue is the one of type conversion. ActiveRecord has a fairly simple notion of types: :string, :text, :integer, :float, :datetime etc. Compare this to JDBC’s. What a mess! Right now there are arrays of procs for each AR type that try to guess the best JDBC type to use. This will certainly need improvement to become a more robust solution.

Probably the most promising approach may be to create a patch that refactors much of the AR adapters’ type conversion methods into separate modules that could be included into instances of the JDBC adapter depending on the underlying database. Then the JDBC types wouldn’t be needed at all – the existing AR database metadata could be reused. Presumably this would require some petitioning of the Rails core team to accept the changes even though the changes don’t buy AR itself any additional flexibility.

If you have a chance to try out the code or can think of any additional tricks that would help the ActiveRecord JDBC implementation along, let me know!

Tags , , ,  | no comments | no trackbacks

Minnebar Podcast: Web 2.0 in the Real World

Posted by Nick Sieger Fri, 12 May 2006 03:25:00 GMT

In this podcast from minnebar 1, Jamie Thingelstad, CTO of marketwatch.com, describes a real-world, scalable application of asynchronous javascript that uses an event-driven model rather than polling.

I enjoyed the session and think it’s worth a listen – there are some interesting approaches discussed, including a back-off strategy that helps give the server a chance to tell its javascript clients to not hit it so hard when it’s under duress.

Download the podcast here, or put my feed in iTunes or another podcatcher to have the podcast downloaded for you. I should be posting more minnebar podcasts in the coming days.

Posted in  | Tags ,  | no comments | no trackbacks

Let's keep the minnebar high

Posted by Nick Sieger Mon, 08 May 2006 03:17:00 GMT

It’s going to take me a while to recover from minnēbar. I met some great people, got motivated by some new noble ideas, and generally had a blast. A thousand kudos to Ben as well as the sponsors for making the event a smashing success.

But, let’s not stop there. We made some initial contact, hit it off well, vibed off of the energy in the venue. I’d be disappointed to say the least if I didn’t hear from anyone for another six months until the next event gets planned and scheduled.

So, can we make a concerted effort to keep in touch? May I suggest a monthly (or so) geek dinner, drinks or something similarly informal (e.g., the Friday night get together? I wasn’t there) where we can keep some momentum going and build our relationships? Find out where our own strengths are and how we complement each other?

If there’s one thing coming out of Saturday’s event where I hope we have a shared vision, it’s for increasing the amount of innovation in the technology sector in the Twin Cities. This group of people has the talent to make that real.

On a side note, I recorded four sessions of audio from Saturday, and at first listen they appeared to come out pretty well. I hope to post them in the coming days.

Another side note: the “ē” in minnēbar is represented in HTML as unicode entity ē. Don’t let your minnēbar posts suffer encoding issues on the highway!

Posted in  | Tags  | 1 comment | no trackbacks

Hackers who are fathers and _why

Posted by Nick Sieger Fri, 05 May 2006 14:24:00 GMT

Spotted on ruby-talk today was this anecdote on a Ruby hacker/father and son, and I just had to share here.

I trotted my 11 year old son over to the Poignant Guide and he laughed like crazy at the Cartoon Foxes and did a little programming, but soon got bored. Wait a minute Alex, let’s try one more thing, Dwe.. Array. Wow, how do I make my R kill big time (He knows all about cheats). I showed him the character’s values and he promptly put in a hugh number for the Rabbit’s strength. He was delighted to see the larger and larger negative life values appear whenever he attacked. Dad, is this how all my Gameboy programs work? Yes, son. Hey, dad I want to do 6dof animation too, can you teach me? Yes son, here’s a few books for you – Computer Graphics, Foley et al and Physics for Game Developers, Bourg. Not sure he’ll read them right away, but the whole episode saved me another $49.95 Game Cube cartridge.

Posted in  | no comments | no trackbacks

Virtual Ruby?

Posted by Nick Sieger Tue, 02 May 2006 18:56:00 GMT

I had a chance to dabble around with Python a tiny bit today, building the XSV XML schema validator. Got it working fairly easily on my MacBook Pro after a minor detour. Later, I needed to build another copy on a shared linux dev box where I didn’t have root access. Now how does this work in Python? Fortunately, the answer was close at hand: a virtual python instance. Nice! You can create a replica of the main python install, and add your personal site-packages there. The only thing that gets copied is the python executable plus a bunch of symlinks to the main libraries and packages. After that point all you need to do is put your virtual python executable ahead of the main executable on your PATH.

If I were to install local packages/gems with Ruby, I’d probably either build my own Ruby or maintain a local packages directory and constantly customize RUBYLIB. Seems like a suboptimal solution. Has anyone attempted a virtual-ruby.rb that does the same as virtual-python.py?

Posted in  | 3 comments | no trackbacks

Jazz and Creativity

Posted by Nick Sieger Sat, 29 Apr 2006 03:43:00 GMT

Short bio moment: I am a jazz musician. I have not been actively playing in recent years as my dual life as information economy worker and father have dominated, but the essence of jazz as a form of communication, interaction, problem solving, patterns, repetition, and creativity have remained in the core of who I am. Whenever I’m having a down-cycle in my life, it always seems like it’s because I’ve gotten away from listening to jazz.

So, with that as background, imagine you’re me and go read Garr Reynold’s recent post on Jazz and the art of connecting. Even if you’re not a jazz lover, many of the quotes there resonate so well with any aspect of a creative profession. My favorite (and Garr’s):

“Anyone can make the simple complicated. Creativity is making the complicated simple.” – Charles Mingus

Now, 37 signals may appear to have the recent trademark on “embracing constraints” and its relation to creativity, but it sounds like Charles beat them to the punch! Time to go dig around in some jazz biographies again!

Posted in  | no comments | no trackbacks

Quote of the day

Posted by Nick Sieger Wed, 26 Apr 2006 18:39:00 GMT

Just stumbled upon this interview with Bill Joy from a couple years ago and it’s full of quotables. This one caught my eye:

What about the open source idea in general?

Open source is fine, but it doesn’t take a worldwide community to create a great operating system. Look at Ken Thompson creating Unix, Stephen Wolfram writing Mathematica in a summer, James Gosling in his office making Java. Now, there’s nothing wrong with letting other people help, but open source doesn’t assist the initial creative act. What we need now are great things. I don’t need to see the source code. I just want a system that works.

It’s a good reminder that just because something is “open source” that doesn’t make it a great idea. Brilliant ideas are created in the minds of a few – the wisdom of the crowds usually just ends up diluting a good idea.

Posted in  | no comments | no trackbacks

Tweaking IRB

Posted by Nick Sieger Sun, 23 Apr 2006 04:02:00 GMT

IRB (Interactive Ruby Shell) is one of those tools that a hacker learning Ruby hopefully discovers right away. It’s an extremely useful way to learn the language, verify hunches, test assumptions, and get immediate feedback. IRB promotes learning by doing, which is the best way of making something stick in your head. (You can even try an online version of irb without even installing Ruby!)

The first order of business when using IRB is to setup your preferences. If you haven’t done so already, create the file ~/.irbrc (%USERPROFILE%.irbrc on windows native ruby). .irbrc is just a regular ruby script where you can run arbitrary ruby code at the start of your IRB session. Add the following to .irbrc:

require 'irb/completion'
ARGV.concat [ "--readline", "--prompt-mode", "simple" ]

This sets up usage of readline in your session and turns on TAB completion, making IRB feel as comfortable as regular old bash. Now you can type Kernel::<TAB> and get a list of available methods! Good.

Next, the thing that you find yourself doing after using IRB for a while is cutting and pasting code from your console buffer over to your text editor. Don’t have Ruby’s reflection rules down yet? Not sure whether to use instance_eval or module_eval when working on that metaprogramming hack? Working inside Rails’ script/console and searching for the right ActiveRecord finder options? No matter how good your terminal program, you probably have to use the mouse to select text out of it to copy to your text editor, and hackers hate having to switch from the keyboard to the mouse when in the flow of programming.

So here’s a technique that will append commands entered in your IRB session to a file in your home directory (idea from ruby-talk:58931). Put the following in your .irbrc:

module Readline
  module History
    LOG = "#{ENV['HOME']}/.irb-history"

    def self.write_log(line)
      File.open(LOG, 'ab') {|f| f << "#{line}
"}
    end

    def self.start_session_log
      write_log("
# session start: #{Time.now}

")
      at_exit { write_log("
# session stop: #{Time.now}
") }
    end
  end

  alias :old_readline :readline
  def readline(*args)
    ln = old_readline(*args)
    begin
      History.write_log(ln)
    rescue
    end
    ln
  end
end

Readline::History.start_session_log

Now every line typed into IRB will immediately be saved into ~/.irb-history. Exercise left to the reader to bind a custom keystroke and macro to yank the last line out of that file and automatically paste into your text editor.

Long-time bash users know that the shell maintains a history of commands across sessions so that you can access commands you typed yesterday. Wouldn’t it be nice to do this in IRB as well? Wish granted:

require 'irb/ext/save-history'
IRB.conf[:SAVE_HISTORY] = 100
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history"

Happy ruby hacking! If you find any more handy IRB tips leave them at rubygarden, and let me know about them.

Footnote: I realize there is duplication and non-DRY happening here with two copies of your IRB history, but I came across these techniques at two different times, and the functions they serve seem different enough to potentially use them both. If you don’t like that, choose whichever is more appropriate for your needs.

(Hope this post serves your needs Dan.)

Posted in  | 2 comments | no trackbacks

Older posts: 1 ... 13 14 15 16