Charles Engelke's Blog

May 6, 2009

Use Named Constants

Filed under: Uncategorized — Charles Engelke @ 12:53 pm
Tags: ,

This morning’s keynote speaker at RailsConf mentioned, in passing, working on some code without named constants.  When something needed to be changed you’d have to find the right instance of it and change it, and hope you changed it everywhere you needed to. It’s elementary that you should use named constants for just that reason.  But this story reminded me of an early programming experience I had with FORTRAN IV on a CDC 6400.

You see, when you write a 1 in your code, you’re kind of using a named constant.  That 1 is is the name of a value (that happens to be one, or 000000000000000000000000000000000000000000000000000000000001 in bits on the 6400).  We always expect that the value of the constant named 1 has to be one.  But in my freshman programming class, I managed to change the value of 1 in my source code to zero.  FORTRAN programmers will probably know how I did that.

This made for a wonderfully oddly behaved program.  The first time through a loop always worked, later ones always failed, and it didn’t matter what values I set before each run.  The story had a happy ending: I learned how to read core dumps and a bit more about machine language, and moved on to other programming languages that make it harder to change the values of literal constants.

May 5, 2009

Testing Your JavaScript

Filed under: Uncategorized — Charles Engelke @ 5:32 pm
Tags: ,

Test your JavaScript in a headless Java browser, as a normal Rake task.  I’m not going to put notes here (I was paying too much attention to write).  Instead, look for the presentation and the necessary plug-in at github.com/relevance/blue-ridge and thinkrelevance.com.  It looks very promising.

RailsConf Keynote

Filed under: Uncategorized — Charles Engelke @ 1:11 pm
Tags: ,

David Heinemeier Hansson is opening the conference, quite appropriately, and saying a lot of interesting things about the past and future of Rails.  The conference is going to post video of the keynote in a day or so, and I recommend watching it.  But what got me sitting up straight and listening more alertly was when he started talking about something else.  Requirements.

David says that programmers treat requirements as commandments from on high.  And that they shouldn’t do that.  The stakeholders aren’t are committed to the requirements as programmers think.  They know what they want, but they’d be just about as happy with a lot of other solutions, too.  And those other solutions might be a whole lot less expensive to provide.

His example concerns chocolate.  He’s got a sweet tooth.  Ask him for requirements to satisfy that sweet tooth, and he’ll specify top quality Belgian chocolates.  Meeting those requirements will take a lot of money and a lot of time.  Maybe that’s necessary.  But try offering a Twix bar right now for just a buck or so instead, and most of the time he’ll actually be happier with that.

The real key to programmer productivity is saying no to requirements as stated, and instead understanding what the stakeholders want to accomplish and opening negotiations with them on the best way to do that.  Requirements are a starting point to that.  They’re not handed down to us on stone tablets.

That means programmers have to be much more involved with stakeholders, and take more responsibility for the ultimate outcome of their efforts.  But they’re going to create a lot more value if they do that.

May 4, 2009

RailsConf 2009 Tutorial – Sinatra

Filed under: Uncategorized — Charles Engelke @ 7:31 pm

My second tutorial of the conference is called “A Hat Full of Tricks with Sinatra”.  Unlike the morning session on jRuby on Rails, I don’t have any specific plans on how I’d use what I learn here.  But the framework looks interesting to me, and I hope to get some good ideas from it even if I never use it for real.

We start by building the minimal “Hello, World” of Rack applications:

run lambda {|env|
[
200,
{‘Content-Length’ => “2”,
‘Content-Type’   => “text/html”},
[“hi”]
]
}

run lambda {|env|
[
200,
{‘Content-Length’ => “2”,
‘Content-Type’   => “text/html”},
[“hi”]
]
}

Put that in a file, like “config.ru” and run it with rackup, for example

rackup config.ru -p 3000

The “.ru” extension is for rackup.  You can call it “.rb”, but then you have to set more things up in the application because it’s actually running regular Ruby code, instead of being read and interpreted in a special context by rackup.

It’s starting out as a very hands-on tutorial, very basic.  But that’s what I want.  If it slowly builds from here, I’ll be happy.

Rack runs an application that is given an environment and emits a response.  The structure allows you to easily write “middleware”.  When Rack’s told to run an application, instead it calls your middleware which can do other things and eventually call your app.  This can be chained.  It’s a simple and powerful tool.

Okay, now getting into Sinatra.  Here’s the core of the application:

require ‘rubygems’
require ‘sinatra’

Huh?  Where’s the code?  That starts up the framework and gets it all working.  If you put those two lines in application and run it (with Ruby) it will start a web server on port 4567.  When you open that in a web browser, you’ll get a blurb for Sinatra and suggestions to proceed.

Want to handle a request to a particular path?  Here’s code that will respond to requests for the root URL and to /greet:

get ‘/’ do
“Welcome to my Sinatra server”
end
get ‘/greet’ do
“Hello!”
end

Nice and clean.  It can also respond to other HTTP verb requests in a similar way.

Now just create a subdirectory of your application directory called “views”, and put a file named “index.erb” in it containing HTML.  Change the code that responds to “/” to:

get “/” do
erb :index
end

Now when you run your application and get the root URL, the HTML in that index.erb file gets returned.  (ERB is “embedded Ruby” even though we didn’t bother to embed any in that HTML.

I’m really liking how this is set up.  Simple always appeals to me, but there’s a lot of power here without messing up that simplicity.

By the way, the sample Sinatra application I’m playing with works just fine under jRuby, too.

I do have one complaint about this tutorial.  It’s not well-structured or planned.  The speaker seems to think he can just open a terminal window and edit and run source code, and we’ll all have no trouble following.  But as soon as one thing is missed, the student has a hard time getting back in sync.  He needs to go slower, he needs to describe what he’s about to do and why, he needs to do it, then he needs to tell what he did and why.

He also needed to plan and rehearse every single example he was going to show.  Instead, he’s winging a lot of it.  The material is trivial to him, but when you’re teaching a class you’ve got to know ahead of time every single tiny glitch you’ll encounter and have to explain.

Another tutorial falls apart in the second half.

Diet Coke Must Die!

Filed under: Uncategorized — Charles Engelke @ 6:33 pm
Tags: ,

I’m here at RailsConf looking for a bit of cold, free, sweet caffeine at the break.  There are plenty of sodas, and they’re even the right brand – Coca-Cola.

But unless I want a lot of empty calories, my only choice is Diet Coke.  Which is drinkable, but only barely.  (Pepsi fans: don’t gloat.  No other brand of diet cola reaches even that level.)

This is a travesty because now Coke Zero exists.  Somehow they’ve managed to create a diet cola that really tastes like Coke (the only cola that has ever mattered)!  But you can almost never get it at a meeting or restaurant because they’ve got the old standby Diet Coke.  And Coca-Cola is fine with that because it helps in their goal to fill supermarket shelf space with several thousand different products all called Coke.

Coke Zero is a better choice than Diet Coke in every single circumstance.  Coca-Cola, you’ve got a responsibility to us – fix your advertising and branding and GET RID OF DIET COKE!  Let Coke Zero take off and fly!

And while you’re at it, get rid of Cherry Coke, Caffeine Free Coke with Lime and Splenda but without added Vitamins, and all those other stupid variations.  There are only two drinks worthy of the name “Coke” – Coca-Cola and Coke Zero.

RailsConf 2009 Tutorial – jRuby on Rails

Filed under: Uncategorized — Charles Engelke @ 12:06 pm
Tags: , ,

I’m starting this year’s RailsConf with a tutorial on jRuby on Rails.  I’ve fiddled with it a few times, and I have the distinct impression that it’s a more stable production platform than the regular Ruby interpreter.  But there are a few issues I’ve had.  I hope today’s tutorial will help me resolve them.

I’m not much of a note taker, so this (and other posts this week) will probably be pretty thin, with just reminders of core information tidbits I glean here.

The speaker is Nick Sieger of Sun Microsystems, and he’s put his slide desk online at his blog.  The link to the actual slides isn’t there (yet), so I won’t put it here, either.  It looks like he’ll probably soon put up a post with the link.

The talk is going to start from absolute zero.  Since I’ve actually installed and used jRuby (very casually) there will be some familiar stuff for me at first.

Download GlassFish, a Java application server we’ll be using.

Download jRuby, too (this is the latest production version as of today).

You’ll need the real JDK, too.

Install the JDK.  Add its bin subdirectory to your path, and set an environment variable named JAVA_HOME to the root of the JDK install.  Test it by running “java -version”.

Install jRuby by unpacking it anywhere you want.  Add its bin subdirectory to your path (he emphasizes adding it to the end of the path).  Test it by running “jruby -v”.  Run irb or other Ruby tools by prefixing them with “jruby -S”, as in “jruby -S irb”.

Run jRuby with the Java “server” VM with “jruby –server”.  That’s better overall performance, at the cost of slower startup.  You can pass a variety of Java arguments to the JVM with “jruby -J<argument>”.

Oh, you want jRuby at the end of the path so that its utilities don’t run when you want the regular Ruby ones.  So “rake” gives the regular Ruby rake, “jruby -S rake” gives the jRuby one.

jRuby has all the standard 1.8.6 Ruby things – the libraries, RubyGems, Rake, RSpec.  It’s also integrated with the Java libraries.  Go into jRuby’s irb, and type

java.lang.System.out.println “Verbose Hello”

It works!  Not that you’d want to do that, but I’m sure I’m going to want to use the Java cryptographic tools.

Install a bunch of needed gems (I had to be in a command shell with administrative privilege to do this in Windows 7):

jruby -S gem install rails mongrel jruby-openssl

Now, just create a Rails application with “jruby -S rails appname”.

Install ActiveRecord-JDBC or MySql or SQLite3 (or both):

jruby -S gem install activerecord-jdbcmysql-adapter
jruby -S gem install activerecord-jdbcsqlite3-adapter

Now fix your Rails application’s database.yml to point to the JDBC version of the appropriate database adapter.  For example, “adapter: jdbcsqlite3”.

Now here’s a trick I could have used (and will be using)!  Use embedded Ruby to have a single configuration file work for both jRuby and MRI.  Put this in database.yml:

<% jdbc = defined?(JRUBY_VERSION) ? ‘jdbc’ : ” %>
development:
adapter: <%= jdbc %>mysql

[I just noticed that WordPress is “fixing” my single and double quote marks, even in code.  It’s easier for me to tell you figure out that they’re really all straight quotes than to figure out how to get them in WordPress right now.]

And now create a Rails application in the regular ways.  Just remember to use “jruby” instead of “ruby”, and to prefix other commands (like rake) with “jruby -S”.

Found a bug (in jRuby? in Rails? hard to say, but probably either in Rake, or in a Rails Rake task): if your Rails application’s environment.rb specifies needed gems, you can usually install them with:

rake gems:install

But, if you use:

jruby -S rake gems:install

it says it works, but it doesn’t (“jruby -S gem list” doesn’t show them).  It appears that it installs these gems under MRI instead of under jRuby.  Of course, you can just manually install each needed gem with “jruby gem install”.  It’s just the Rake task that gets derailed.  Note that this happened under Rails 2.2.2, which is what our existing application under development is currently using.  I haven’t checked to see if it still happens in Rails 2.2.3 (the current version as of today).

You can speed up Mongrel under jRuby by removing the mutex it no longer needs.  You have to edit Mongrel’s source to do this.  Look for the block starting “@guard.synchronize” and comment it out.  You have to also set “config.threadsafe!” in your application’s appropriate environment file to have this help (or change it globally for Rails under jRuby by editing lib/initializer.rb there.

The speaker’s JRuby-Rack gem allows you to run any Rack-based application (like Rails) under any Java Servlet API server.  That sounds promising for production use.  I’ve got to learn a lot more about the Java server ecosystem to take advantage of it.

The talk is now really turning to ways an experienced Java shop can run Ruby on Rails well in their infrastructure.  There’s a lot of background I don’t have, so this can point me to the right place to start, but I can’t understand it well enough to use it as a result of this talk.

Lots of talk on Warbler – I don’t have the context to understand it now (or know why I should care).

Google App Engine with jRuby.  Now, this interests me.  There’s going to be hackfest on Wednesday night at CabooseConf (a side meeting to RailsConf) that I’m going to want to visit.  Of course, Java support on Google App Engine is very preliminary, and there are lots of restrictions.  But the speaker says that jRuby on Rails works!  Well, except for a few minor issues like no ActiveRecord.  Not real practical yet.  But very encouraging.  There’s a talk at 11:45 AM this Wednesday that goes into more details.

[Side note: I’ve been trying to get our current development application running here in different configurations, and found I couldn’t get it to run under MRI using MySql (jRuby with MySql, or either with SQLite3 worked fine).  This isn’t related to the talk, but I found the solution on Google.  If you’re running a 64 bit version of Windows, you either need to be running MySql 5.0.x instead of 5.1.x, or else get the libmysql.dll file from an older version of MySql and put it in your Ruby’s bin subdirectory.  I don’t want to forget that the next time I wipe and reinstall everything on my laptop, hence this note.  It would be really nice if the precompiled gem for MySql gets fixed to avoid this problem, but I’ve noticed that the Windows platform is often not given much attention in the Ruby and Rails communities, so I’m not holding my breath.]

The tutorial has hit a real lull for me.  The Java ecosystem is incredibly rich, and layered upon layers.  It’s very hard for an outsider like me to keep track of the 27 billion different kinds of tools out there, and we’ve been talking for about an hour about those.  From the perspective of a Ruby person wanting to leverage some of that Java stuff, well… yawn.

We’re wrapping up now.  There was a lot of value to me in the first half of the talk, but not in the second half.  And I don’t think it’s just me.  It seems like the speaker got really bogged down at this point.  Overall, worthwhile, but it could have been even better.

March 4, 2009

Update: Web Hosting with Google AppEngine

Filed under: Uncategorized — Charles Engelke @ 9:55 pm
Tags: ,

I’ve been getting some comments recently on last summer’s post on Google AppEngine for web hosting.  I guess I’m not the only one who wants to add some simple static web pages to my Google Apps hosted services.

Most commenters are reporting success with the method, but Peter G has a problem getting the pages to work right at the naked domain name.  That is, pages at http://www.example.com work fine, but the same pages at example.com don’t.  Why did it work for me, but not him?  I had no idea.

I had to set up a new domain for a friend anyway, so I paid close attention to how to set this up.  And found that I couldn’t make the naked domain name work, either.  A little clicking around found the problem:

I’d like to map my app to http://myurl.com (also known as a naked domain).

Due to recent changes, Google App Engine no longer supports mapping your app to a naked domain.

Well, that’s just great.  I don’t know what recent changes caused this, but you apparently can no longer make AppEngine serve pages for a naked domain name.

The documentation does describe one solution: URL forwarding.  For this to work you need your domain name service provider (which is probably your domain registrar) to return an HTTP redirect response to any requests at the naked domain.  Then any web request to example.com/some/page gets redirected to http://www.example.com/some/page, which AppEngine will serve up fine.

The new domain I was setting up was registered with eNom, so I used their DNS dashboard to add a record saying that requests to @ (the symbol for a naked domain) should generate a URL redirect to http://www.example.com, and it all just works.

Hope this is helps anyone having trouble with this.  There is one potential problem, though.  The solution depends on services from your domain registrar, not Google Apps, so you may be out of luck if your registrar doesn’t offer URL redirection.

March 1, 2009

Macon in the Snow

Filed under: Uncategorized — Charles Engelke @ 6:30 pm
Tags: ,

Macon, Georgia is in the middle of the state, well south of Atlanta, and it does not get much cold weather.  It certainly doesn’t get much snow.  But it did today:

Our Snow-Covered House

Our Snow-Covered House

Not everyone was pleased with it, though:

Our Snow-Covered Dog

Our Snow-Covered Dog

January 25, 2009

Trying out Windows 7

Filed under: Notes,Uncategorized — Charles Engelke @ 3:32 pm
Tags:

Last Tuesday I finally took the time to swap out hard drives on my laptop and install the new Windows 7 beta.  I was skeptical thanks to my Vista experiences (which I shared on this blog), but there was a lot of good buzz on this one.  I decided to go whole hog and install the 64 bit version to make it more challenging.

The buzz is right.  Windows 7 is much better than Vista was.  In fact, I’m having fewer problems with it in beta than I did with Vista after it had been out for a year.  It seems to be pretty much the same as Vista and the core, but Microsoft has paid a lot more attention to details this time, and it makes for a much better experience.

Windows 7 boots fast, and performs fast.  I don’t know if it would benchmark better than XP, but it in day to day use it’s been quicker for me than XP is.  The user interface changes are actual improvements, and enhance working with the PC.

The installation took well under half and hour, and went flawlessly.  Upon first boot, everything was working fine, but there were a couple of rough spots:

  • The eye candy (translucent title bars, et cetera) didn’t work
  • I couldn’t turn off the trackpad part of my ThinkPad TrackPoint
  • About four devices, including the fingerprint reader) showed problems in the device manager

Running Windows update solved most of the problems.  I downloaded a couple of drivers from Lenovo for the TrackPoint and fingerprint reader.  That fixed the TrackPoint, but not the fingerprint reader.  Then, about a day later, Windows popped up an alert telling me there was a problem with the fingerprint reader, and would I like to fix it?  I said yes, and it directed me to a site to download the right driver for it, and after that it worked fine.

So right now, everything is working, and working well.  The only operating system issue I’ve had has been the NVIDIA display driver locking up for a few seconds a couple of times.  Windows reports that it crashed and restarted, and after each restart, everything was fine.  I could actually live with that happening a few times a week if needed, but I’m sure NVIDIA will get it fixed long before general release of Windows 7.

Almost all the software I use installed and works fine, too.  No problems with:

Picasa 3 works fine, except that the screen saver doesn’t seem to actually trigger.  It says that it is set up to run, but Windows 7 doesn’t seem to know it exists.  Oracle web conferencing wouldn’t install automatically, but it did when I downloaded and ran the setup problem.  It seems to run okay now, though.

Windows actually suggested AVG as an antivirus solution, as well as Norton and Kaspersky.  Since I’ve been using AVG for a while, I first installed and used Kaspersky to make the test more challenging.  It worked, but it was often popping up alerts that an update was needed, and then when I manually ran an update, saying that it wasn’t needed.  It was too chatty and tried to do too many things (like being a network firewall, too), so I dumped it and went to AVG, which has been working well.  I guess.  I supposed I’d have to try to infect the PC with a virus to know for sure!

What didn’t work?  Just two programs: Google Chrome and Cisco VPN Client.  I really like Google Chrome, but the installer isn’t happy when it’s run.  I finally got it installed, but it won’t display any web pages.  There are suggestions online about ways to get it to run, but they involve telling it to operate in a less secure mode, so I’ll wait for an update from Google fixing the problem.

The lack of a VPN client is a much bigger problem for me.  I can’t really stay in Windows 7 without it (though I’ll use it for at least another week and live with the hassles that long).  Cisco apparently has no intent to ever support 64 bit windows clients.  Personally, I think Cisco does a lousy job supporting client systems, period, and would like to not use them.  NCP does have a compatible VPN client that runs under 64 bit Vista, but they warn it won’t work under Windows 7.  They have a Windows 7 version in beta, and I’ve requested a copy to test.  They’ve agreed, but I don’t have it yet.  I’m hopeful about it.

The way things have gone during my five day test (so far), I could see myself having this beta as my regular operating system while I wait for the real release.  If I can get a VPN client, and don’t run into major problems, I’ll probably do that.  Though I’m keeping my XP hard drive with me at all times, ready to swap back to it if I need to.

November 6, 2008

RubyConf ’08

Filed under: Uncategorized — Charles Engelke @ 10:45 am
Tags: , ,

I’m at RubyConf in Orlando through the weekend.  Today starts with a keynote by Matz, followed by three parallel tracks.  I’m going to try to switch from track to track between talks, not just a breaks, but I don’t know whether the timing will work.

Matz’s keynote is “Reasons Behind Ruby.”  His reason for Ruby is that it’s his masterpiece, and it lets him maximize freedom.  But what about for the rest of us?  Ruby’s imperfect: it’s slow, it’s complex, it’s inconsistent, it’s poorly implemented (in MRI), and so on.  So why do so many people love Ruby?

Ruby’s enjoyable, it makes programming fun again.  Again?  When did it stop being fun?

Geez – Matz learned programming with BASIC on some kind of programmable calculator.  (Actually, BASIC was my first programming, language, too.  But on an IBM 360.  Which was probably about as powerful as his calculator.  So how come I haven’t created a great programming language?)

Matz loved the control from programming, but BASIC was limiting.  His next language was LISP.  A little different.  He liked it, but didn’t really love it.  (And a lot of LISP people feel that everybody should love it.)  He wanted to be in charge of his programming language.

His analogy: BASIC at one side, LISP at the other… over the edge of a cliff.  He shows a big space between BASIC and the edge of the cliff, which is where he wants to be.

Ruby on Rails turns Ruby into a web DSL.  Ruby lets you create your own specialized languages, but stay within Ruby.  Rake is a DSL for building an application, RSpec is a DSL for testing.  LISP is good for building DSLs, but so is Ruby.

There are fewer than a million Ruby programmers now, but Gartner predicts more than four million by 2013.  That isn’t necessarily good, unless the Ruby community stays as open and positive as it has been.

Matz closes with thanks to all of us!

July 29, 2008

Cuil Facing Heat

Filed under: Uncategorized — Charles Engelke @ 12:15 pm
Tags: , ,

The new search engine Cuil made a big mistake: it didn’t think about how early adopters and influencers would react to it.

What’s the first thing everyone does with a new search engine?  Search for themselves, of course.  (I suppose not everyone is so ego-driven, but then those people probably don’t write articles or blog.)  So that’s what the influencers did (and so did I).  And the results Cuil returns for that tend to stink.

I have a pretty unusual last name that’s also my domain name, so when I search for engelke on Google I find links referring to me in the first page of results.  I’m at the second search result just now.  But when I search on Cuil I find no references to me on the first page (or second, or third, or… I gave up looking).  When I search for charles engelke (no quotes) on Google, seven of the ten links refer to me.  The same search on Cuil is more ego-reassuring than the first was: nine of the eleven links refer to me.

But Cuil also has a big “Explore by Category” box on that page that just seems bizarre: the categories are Irish Comedians, German Comedians, The Simpsons Characters, American Stand-up Comedians, Second-city Alumni, and American Comedians.  Not a single link on the results page refers to anyone related to any of those things, just to me and to a physicist (who, oddly enough, was at SUNY at Stony Brook the same time as me).

Finally, searching for “charles engelke” (with the quotes) on Google gives about the same result as without the quotes (eight of ten), on Cuil it looks like the quotes made no difference at all, except the weird “Explore by Category” box is gone.

I think that one reason for the big differences I’m seeing is that Cuil is giving much more weight to German language pages than Google seems to.  I don’t know if Google is short-changing German because my search language is English, or if Cuil is over-emphasizing it.  But pretty much all the results on Cuil (and the first one on Google) are for Anke Engelke, a German comic actress and talk show host.  And even though she doesn’t show up on the Cuil results page for charles engelke, I think she’s the reason for the “Explore by Category” box with all the different kinds of comedians listed.

July 21, 2008

Introduction to Django

Filed under: OSCON 2008,Uncategorized — Charles Engelke @ 7:47 pm
Tags: , ,

Well, this morning I learned about Rails and now I’m moving over to the Python world with and introduction to Django.  Maybe I’ll look at the Perl take on MVC web frameworks tomorrow by attending the Catalyst tutorial; I haven’t decided yet.  This tutorial is being given by Jacob Kaplan-Moss, and he’s put his presentation materials online.

I don’t know much Python, but I did create a reasonably large Google AppEngine project with it and learned as I went.  I ended up liking Python a lot, but there are big holes in my knowledge.  I’m glad I started with the simple AppEngine webapp framework instead of Django because I could see how the pieces fit together more easily.  But now I’m ready to move up.

Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design.

That’s Django’s “elevator pitch”.  Django came out of a small, family run newspaper in Lawrence, Kansas.  That’s pretty interesting for such an important web tool.

We start by actually creating a Django application that will eventually be something useful.  The finished example application is online at cheeserater.com.  It’s as easy to start as rails:

django-admin.py startproject cheeserater
cd cheeserater
manage.py runserver

And it starts a development web server on port 8000.

Models: this is one of the pillars of MVC, of course.  And we won’t be using SQL to define or manage them, also of course.  The speaker makes a great point that one of the (many) problems with SQL is that it’s not very compatible with version control.  Just doing an svn update on your working copy isn’t going to really update it.  It’s still a copy, but it’s probably not still “working”!

Since Django models are Python code, they’re managed like all your other code.  But the code can also manage fixing the database structure when the code changes, just like Rails migrations.  Django doesn’t have migrations, but you can do the same thing manually in it.

Unfortunately, the example application is pretty boring to me, and it uses unreleases Django features so I can’t play along with it.  The framework is powerful and straightforward, but just watching it isn’t as interesting as getting into yourself.

Now Jacob’s going into a rant about URL design.  It’s entertaining, and makes a good point: the URL should be designed from the user’s point of view, not the developer’s one.  So nothing like fetchpage.cgi?number=72.  Instead, it should be something like electioninfo.  Oddly enough (to me) newspapers are particularly bad at this.

Anyway, this means that Django doesn’t specify your URL structure for you, that’s your job.  I like that.  The Rails idea of one right way to do things often appeals to me, but not with the URL structure.  So with Django (and Google AppEngine) you give a list of regular expressions, and the first one that a URL matches is paired with a handler for the URL.

The rest of the tutorial covers the all the different pieces of the framework.  There’s a lot of detail, but conceptually there’s little new here for me.  And once again, I got a lot more out of the first half of the tutorial than the second.  I don’t seem to be able to absorb more than an hour (or maybe an hour and a half) of material unless I’m actively working with the material.  I can’t just watch.

June 2, 2008

Last Day at RailsConf

Filed under: RailsConf 2008,Uncategorized — Charles Engelke @ 1:46 am
Tags: ,

RailsConf is over now.  It ended on a strong, though short, day.  For me, it began with Obie Fernandez of HashRocket (and author of The Rails Way) showing us all the “worst rails code you’ve ever seen.”  I was worried that I wouldn’t follow the talk because I’m not yet as far along on some planned Rails projects as I had expected, but the examples were clear, he explained the issues simply, and showed the proper approaches.

Rick Bradley of OG Consulting talked about “waxing ballroom floors on the Titanic,” stories about the challenges of doing Rails work “in the enterprise.”  The best part for me?  The “Can’t Chart” that shows all the organizational impediments to actually achieving your goals.

Adam Keys of Five Runs gave a very personal talk about failures, and how he’s learned from them and changed as a result.  An interesting talk about the examples and maturation in general.

And my final session at the conference was Chris Selmer of Intridea, and Josh Owens of the Web 2.0 Show, telling us about Rails Rumble, a contest where teams of up to four people had 48 hours to build and deploy an application.  It sounded like a lot of fun, if you don’t need sleep.

The official conference closing was a keynote panel of the core Rails developers.  It was low key, but interesting to hear them all together.

June 1, 2008

Closing Out Day 2 at RailsConf

Filed under: RailsConf 2008,Uncategorized — Charles Engelke @ 1:50 pm
Tags: ,

After lunch, I attended a Lightning Talks session.  These are always interesting, and show the momentum Rails has.  Then I went to another vendor presentation, this time on CodeGear‘s 3rd Rail IDE.  And it was again a very worthwhile session.  RailsConf or O’Reilly (or both) has really figured out to give vendors a platform that adds values for the attendees, and I really appreciate that.

I am not a fan of IDEs, but the talk succeeded in selling me on 3rd Rail, at least to the point of giving it a serious try.  They gave away fully licensed copies to all attendees, so I won’t even have a time limit on my use.  3rd Rail is built on top of Eclipse, like so many IDEs today.  The last time I tried Eclipse it was just too slow for me to stand, but like any successful open source application, it just keeps getting better with time, so I’m hopeful.

My last session of the day was Metaprogramming and Ruby Internals for Rails Developers, given by Patrick Farley of Thoughtworks.  Unfortunately, the talk was a total train wreck, probably the worst I’ve ever seen.  Not because of the content or presentation of it, but because of technical problems.  A particular slide apparently crashed his PC—twice!—and he took at least 15 minutes getting going again on a colleague’s PC.  The subject was too complex to just talk about, so he didn’t really have any other option.  But from now on, I’m going to make sure that any presentation I give is on my PC, a USB key, and at least one colleague’s PC before I start.

The day closed with a keynote from Kent Beck of Three Rivers Institute.  He told stories about the major things he was a big part of (like Extreme Programming) and how each one took twenty years to really set in.  It was dry at first, but when he settled in he loosened up and was very entertaining as well as interesting.

Our group ended the day with a big mistake on our parts: we went to dinner downtown.  Oh, the dinner at Huber’s Restaurant was very nice, but what we didn’t know was that last night was the annual Starlight Parade, about two blocks from the restaurant.  The Max rail was completely packed, so we took a cab.  And when we got near the restaurant, took ten minutes to go a block.  We had a reservation for dinner, so we got out and walked on.  Good dinner and an interesting historic restaurant:

But then had a big problem getting back.  The trains were running very slow, and when they finally did arrive, they were too packed to get on.  (Actually, they had room in the middle of each car, but people standing near the doors blocked the way there, so no one could get on.)  There were special shuttle buses about a block from the Max stop, which went right to our hotel, and once we found that we were fine.

May 31, 2008

Saturday Morning at RailsConf

Filed under: RailsConf 2008,Uncategorized — Charles Engelke @ 4:26 pm
Tags: ,

The opening keynote was by Jeremy Kemper of 37Signals, who is a leader in developing Rails.  He talked about all the improvements in Rails 2.1, which he announced would be released later today.  If I were already a deep user of Rails, I would have found all the details fascinating and exciting, but I don’t have the context to appreciate all of it.

My first talk of the day is 23 Hacks, by Nathaniel Talbott of Terralien.  He says we need to hack, not just work on practical things.  “Musicians spend a lot of time playing music nobody else would want to listen to.”  To stretch themselves, to learn, for the joy of it.  The same applies to software development; there is value in “valueless” software.  He then demonstrated 13 hacks, and asked the audience to suggest 10 others to make 23.  An inspiring talk, ending with an exhortation to us to go hack something soon.

My second talk is Advanced Restful Rails by Ben Scofield of Viget Labs.  He started the talk by praising the value of constraints, referencing poetry and classical music.  Constraints free you to focus on the smaller set of unconstrained options, letting you be creative and productive.  He then covered the material well, but I didn’t learn much new because I’ve been reading so much on this topic already.

May 29, 2008

Today at Google IO

Filed under: Google IO 2008,Uncategorized — Charles Engelke @ 5:17 pm
Tags: , , ,

…is going better for me than yesterday.  Sessions are mostly running a bit short, so it’s not nearly as frantic running from room to room.  I even had time to eat a sandwich, and as a result had a nice chat with another attendee.  It turned out she grew up in Gainesville, where I lived and still work.  And she’s working on technology very relevant to what our applications need, and is going to send me some information on new functionality as soon as it’s announced.

That kind of ad hoc meeting is something I like about conferences, and Google IO’s ultra-tight schedule with no break for lunch gets in the way.  I hope they change it next year.

Keynote, Day 2

Filed under: Google IO 2008,Uncategorized — Charles Engelke @ 5:12 pm
Tags: , , ,

Today started with a talk by Marissa Mayer, Google VP of Search and User Experience.  It was again very well done, and she’s an engaging speaker.

We heard some interesting things about how Google designs their pages.  For instance, they added the copyright notice at the bottom of the page not for legal reasons, but because in early user tests people kept waiting after the page was displayed before they’d enter a query.  Why?  They were waiting for the “rest of it”; the page couldn’t be loaded, it was too sparse.  So the copyright notice was added “as punctuation” to signal folks that the page was loaded and ready.

They do a lot of A/B (or A/B/C…) testing, where different users get slightly different pages from Google, and Google gathers and analyzes data about user behavior as a result.  They often find that very tiny changes changes can have a big effect.  The amount of white space between the Google logo and the separator bar on a results page?  The small amount they use results in greater user satisfaction and more Google searches than larger gaps.  Text ads with yellow backgrounds instead of blue?  Measurably better results.

What I took away from this was that you should listen to, or observe, what your users do, not what they say.  Mayer referenced a Henry Ford quote I hadn’t heard before:

“If I had asked people what they wanted, they would have said faster horses.”

After Hours at Google IO

Filed under: Google IO 2008,Uncategorized — Charles Engelke @ 1:33 am
Tags: , , ,

This evening Google had a reception with lots of food and drink, and music by Flight of the Conchords.

State of Ajax

Filed under: Google IO 2008,Uncategorized — Charles Engelke @ 1:27 am
Tags: , , ,

Dion Almaer and Ben Galbraith of Ajaxian told us about Ajax tools and frameworks, and the direction they see Ajax going.  Their talk was really well done, and very interesting.  Google taped all the talks and said they will post them sometime, probably on code.google.com, so you’ll be able to see for yourselves.

Highlights I took down:

There are lots of Ajax frameworks and toolkits, which were created to do different kinds of things. But over time, the leaders all evolved to cover similar broad spectra of functionality. The four families that really matter now are Prototype, Dojo, jQuery, and GWT. (I wonder if including GWT is partly just an acknowledgment of the conference sponsor.)

Future directions are to make the browser as capable as your PC, and will eventually be strong competition for native GUI applications. Tools for that include Fluid (which I hadn’t heard of), Adobe Air, Mozilla Prism, and Google Gears.

Google IOKO

Filed under: Google IO 2008,Uncategorized — Charles Engelke @ 1:07 am
Tags: , , ,

Google’s logo for Google IO is the binary values of ASCII IO, with white circles for 1 and black circles for 0. Their slides do the same thing, but with large and small circles:

The t-shirts they’ve given us use the same coding to spell out Google IO. Except they spell Google KO instead:

Their own t-shirts say the same thing, but in black on white instead of white on black.

A mistake? Or a threat to potential competitors?

« Previous PageNext Page »

Blog at WordPress.com.