Archives for Mar 2005

how do you keep an idiot in suspense?

thumbnail preview

“the 37s are probably getting a real kick out of watching us try to figure this out.”—Dan Boland

0 comments | posted 31 Mar 07:08

The New West

Rarely does something new come out and totally blow me away. The New West by Jimmy Palmiotti and Phil Noto did just that. I picked it up purely on a wim, trying to be some hip, indie comic book reader. It’s a detective story set in LA, which is more info than I had going in.

Grant Morrison’s ambitions Seven Soldiers project is actually pretty good. I know very little about these characters (apparently they’re revamps of old/existing DC characters?), but I’ve been enjoying all the various issues that have come out so far.

Finally, the latest Daredevil arc, Decalogue, started on Wednesday with #71. It’s about Daredevil’s massive cleanup of Hell’s Kitchen, told in themed stories relating to the ten commandments.

0 comments | posted 27 Mar 20:32

tail utility for windows

When doing any kind of log watching, the unix tail command is very helpful. Other than the Windows 2003 Resource Kit, or using simple homemade ones (I wrote a basic ruby tail command in about 10-15 lines), there aren’t many options for windows users.

I found a decent GUI tail app. No installation required. Just copy tail.exe to your path, and you can type ‘tail’ from the Run prompt or the command line.

Update: Sanjay posted a link to another one: Tail for Win32. Thanks, this looks even better.

0 comments | posted 22 Mar 21:01

DOM-Scripted Lists, revisited

Gazingus.org updated their original DHTML List example with DOM-Scripted Lists, Revisited. I did notice a slight bug on the final example showing the use of an image instead of a plus: the plus is visible to the left. It’s far enough out that most people won’t see it, but it’s there.

0 comments | posted 22 Mar 08:29

Absolute Watchmen

Watchmen is being reprinted as a hardcover. I picked up Absolute Planetary recently, and loved the larger hardback format.

Announced at today’s “Beyond the DC Universe” panel at WizardWorld LA was the next addition to DC’s very successful “Absolute” line this fall: Absolute Watchmen. The new edition of the classic Alan Moore and Dave Gibbons story is currently being adapted to the larger, “Absolute” format and recolored by original colorist John Higgins. The edition is being produced with the blessing of Alan Moore.

Sin City’s been doing great, but why were the trades rereleased in these smaller, digest versions? It’s cool that the actual comic can serve as the “movie adaptation,” rather then getting some crappy movie adaptation loosly based on the actual comic series.

0 comments | posted 22 Mar 07:42

Rails v0.11 released

Rails v0.11 has been released. Wonderful Ajax support in the form of helper functions, pagination support, non-VHOST setups, and more.

I’ll write up more on the Ajax stuff once I’ve had a chance to play with it. The way I’m using Ajax in my current app differs greatly, so I’ll see how this all works out.

The fact that one can install multiple Rails apps under a single virtual host is a very nice addition. If this works as advertised, I think my only other wish is IIS support. However, this isn’t really a Rails issue, more an issue of the lack of a decent FastCGI filter for IIS. I found one, but it hasn’t been updated since 2002. Perhaps all the non-Windows developers loathe IIS and all the Windows developers have moved beyond CGI (ASP.Net for instance) and aren’t willing to drop back into the fun! fun! fun! world of C++ ISAPI filters.

0 comments | posted 22 Mar 07:29

ruby on rails worst practice

I was helping lagcisco (on #rubyonrails) get started on my ComicLog project, and he discovered my user authentication stuff wasn’t working. I started moving code around, and happened to make a nice boolean method for the valid property of my User model.


def valid?
  return self.valid > 0
end

Everything was fine, but now my validations were not working. I tweaked my validation statements for about an hour when it hit me, I was overriding the valid? method! I’ll probably end up renaming that method to registered?

I still don’t know why the authentication was failing. I added an authenticate call in my unit test so I should be able to catch it if it pops up again.

0 comments | posted 22 Mar 06:46

Ta-da list clone

Apparently the java and ruby on rails camps have been going at it like rival high schools. Ta-Da List is the latest from 37signals, boasting about its lightweight codebase (600 lines or so) and quick development time.

Geert Bevin implemented Bla Bla List in Rife, a java web framework in about 900 lines of code (including XML configurations).

David fires back with a couple comparisons of similar code. Obviously they’re two samples that make java look gross and verbose, and ruby short and sweet.

This has me wondering: why exactly is Ta-Da List 600 lines of code? From this example it looks like it should be at least half the size of Bla Bla list. I’m guessing that there’s some extensive unit testing involved. In my comic book database project, the unit testing code outnumbers the application code by a ratio of 1.2 to 1.

0 comments | posted 21 Mar 09:03

internet privacy vs publicity

It seems everyone has their own idea of what Web 1.0 means and what Web 2.0 means, but Josh Petersen from Robot Co-op has a different idea:

“If internet 1.0 was mostly about making the internet work for business, internet 2.0 seems to me to be more about making it work for people – and part of that shift means some tectonic changes in the relationships between individuals and the corporations that earn their custom.”

But remember, there are still some relics of the ancient Web 1.0 ready to harvest your user data. Of course Google falls in to this camp with Gmail, but they are keeping that localized to one service and they make it abundantly clear.

0 comments | posted 16 Mar 19:12

Autolinks and greasemonkey

Looks like Mark Pilgrim has come out of retirement with some google enhancing GreaseMonkey scripts. I think the whole idea behind GreaseMonkey is that users are in control of their content. If I recall, it was originally used to fix usability issues in websites, very similar to user stylesheets.

Recently, I did install and give the new toolbar a test drive. It wasn’t long before it was uninstalled, but I noticed one thing: I never clicked those autolinks. The Autolink button provides a dropdown of the autolinked elements which I found more handy than digging through the page for it.

Why not skip the whole autolinking business, route around the whole controversy, and just provide a nice list of found addresses, ISBNs, Phone Numbers, etc?

0 comments | posted 14 Mar 11:34

rails best practices part two

There’s a discussion on the ROR list about optimizing database access. David posted some ideas for a per-request cache of Active Record (AR) objects.

I actually thought about implementing something like that by overriding the find() calls in my AR objects, but I went ahead and implemented this method. It worked great.

0 comments | posted 08 Mar 10:25

feedburner

I’ve been using FeedBurner to splice my main feed with my del.icio.us links, but lately it’s been down. That’s why you don’t see anything on the homepage anymore.

Plus, I know I prefer split feeds to spliced feeds, so I imagine most other people do.

Some changes to this blog are definitely coming…

0 comments | posted 08 Mar 10:17

Rolling With Rails part 2

Curt Hibbs published the second part of his Rolling With Rails article on OnLamp.com.

I love this quote from the Slashdot thread:

It’s a collection of Java Best Practices rewritten in a ‘cool’ geeky language. Nothing new….

Quite true. For example, Java Best Practice #1 is to avoid using long, detailed XML files for configuration, and instead use the programming languge itself, which is dynamically loaded and interpreted when needed.

Another Java Best Practice is to let the framework write the tedious boilerplate code for you. For example, in Struts, you just run % struts myAppName and you’re halfway done writing your Web application.

Here’s one more Java Best Practice: Avoid expensive, complex application server software, and do rapid development using the Web server that is built into the standard library. Then deploy to the Web server of choice with no code changes or quirky vendor-specific API hacks.

0 comments | posted 04 Mar 08:24

Rails Best Practices

I’ve been knee deep in rails for about five weeks or so. I’ve found it to be a rather powerful framework. However, it’s simplicity makes it very easy to write inefficient database code.

In ASP.Net for example, if I want to load a list of issues, with their related comic books and publishers, I perform a single JOIN query and fill some objects.

In Rails, the code for setting up related objects is vastly simplified. However, there’s really no way to load multiple objects in a single query. So, the simple way is to do something like this:

In the controller:
@issues = Issue.find_all
In the view:

<% @issues.each do issue %>
<p><%=issue.comic.name%> #<%=issue.number%></p>
<% end %>

This would give a list of issues with their comic title next to it. The problem is, issue.comic is asking the DB for the data each time, even if that comic has already been loaded. This executes n + 1 queries.

Scott suggested creating a small lookup hash:


<% 
comics = Comic.find_all.inject({}) do |hsh, c|
  hsh.merge({c.id=>c})
end
@issues.each do issue %>
<p><%=comics[issue.comic_id]%> #<%=issue.number%></p>
<% end %>

This executes only 2 queries, so you’re not pounding the database everytime the page is recached.

Any thoughts?

0 comments | posted 03 Mar 10:17

invincible coming to the big screen

Paramount has bought the film rights to ‘Invincible,’ the teen superhero Image Comics series by writer Robert Kirkman, who’s been all over the comics biz lately with “The Walking Dead” and plenty of work for Marvel, including “Marvel Team Up.” Kirkman will write the screenplay — his first — and the pic will be produced by “Constantine’s” Lorenzo Di Bonaventura and Circle of Confusion partner David Alpert.

Awesome. Invincible is one of my favorite comics out right now. It’s good, clean superhero fun. I’m hoping they cover the big twist at the end of the first year without spoiling it in the trailers.

0 comments | posted 02 Mar 12:29