.

Live From The Field

Enjoyin (suffering thru) a Dog Fish Head Immortal Ale - at least the food at Brouwer’s cafe is great

DirkPhoto051.jpg


Live From The Field

The lucifer roll at Koto on 281- it’s wrapped in crab. It turned out to be the only good thing at an otherwise crappy sushi place. Seriously crappy - meaning don’t go there or let anyone you know go there - it’s that bad!

DirkPhoto050.jpg


Fasterfox - Faster Deletion :)

Looks like there are tools out there besides Google Accelerator that are going to punish web designers who allow get links to have side effects in their web apps. Tips for how to handle this with Rails are < a href="http://www.loudthinking.com/arc/000529.ht">Here

Fasterfox - Frequently Asked Questions
“Prefetching” is the silent loading of links in the background before you click them. This speeds up browsing because in many cases, by the time you click a link it is already cached on your machine and there is zero load time needed.

By default, Firefox prefetches links which are explicitly marked by the web page designer to be prefetched. This is seldom done in practice, so you rarely benefit from it.

Fasterfox’s “Enhanced Prefetching” causes all of the links on the page to be eligible for prefetching, which leads to a very noticeable difference in snappiness while surfing the web.


Strings (2004)

Strings (2004)

If you thought this was going to be able String theory - you’d be wrong. If you thought it was going to be about marionettes - you’d be right - for a change.

What can I say - I saw an ad for this in the most recent mailer from my Sci-Fi book club. I checked netflix and they had it - so I felt compelled to check it out.

I have to admit the last thing I saw that had puppets in it was Thunderbirds - and that was a very long time ago - like 5th grade. Enough of my justification - and on to the review.

One of the most interesting things about the movie was that the characters acknowledged that they had strings attached. A lot of the nicer touches in the movie actually deal with the mythology surrounding their strings.

One of the most beautiful scenes involves the birth of a new baby. The commander of the guards carved his new child out of a fresh tree. By the time his wife is ready to give birth she is in prison. The birth is very poetic and beautiful to watch. Smaller gossamer strings unravel from the mother’s strings and have to be quickly joined to the wooden baby to bring him to life.

The film is a joy to watch just because it really is so beautiful. The story isn’t too bad. It has some elements of predicitability but there are a few suprises so I won’t hold it against them.

The acting is actually pretty amazing. You would think that since the puppets don’t get to have facial expressions it would end up being rather dull - but between the editing and the voice acting they are really able to pull it off.

Acutally, the editing is probably my only complaint. They do a lot of quick cuts - which sometimes does the right thing and amps up the excitment. Other times it just makes it difficult to figure out what is actually going on.

Warning - the film involves some violence and the king commits suicide in the first 5 minutes of the movie. There is no blood but depending on how you feel about that sort of thing be prepared if you watch it with kids.

Bottom Line: Let the kid in out to watch a movie that is like nothing else I’ve seen this year. Just cut it some slack - they’re puppets after all :)


tarzanrubberband

tarzanrubberband

Be warned - I have no idea what this means and I don’t want to know.


Do you lock you laptop?

Opening your lock with a tube of toilet paper
Turns out that tublar key locks are just a bad idea :)


Rake == DSL?

Using the Rake Build Language — it’s actually a good overview of Rake itself.

Also interesting to note is about halfway down - Fowler makes the following comment.

make is an external DSL using a custom syntax
ant (and nant) is an external DSL using an XML based syntax
rake is an internal DSL using Ruby.


Live From The Field

DirkPhoto049.jpg


Live From The Field

Vikram back in the house!

DirkPhoto048.jpg


Ooops that SQL is a little TOO clean!

I’ve been using the migration system in Ruby - and I recently added some of the Magic Field Names

class TimeStamp < ActiveRecord::Migration
def tables
[:my_table,:my_other_table,:my_other_other_table]
end
def self.up
#This change turns on optimstic locking for all of the important tables
for table in tables
add_column table, :created_at, :timestamp , :null => true, :default => “now()”
add_column table, :updated_at, :timestamp , :null => true, :default => “now()”
forbid_null table, :created_at, “now()”
forbid_null table, :updated_at,”now()”
end
end

def self.down
for table in tables
remove_column table , :created_at
remove_column table , :updated_at
end
end
def forbid_null(table,column, default = nil)
if !default.nil?
conditions = [" #{column} = ? ", default]
sql = ActiveRecord::Base.send(:sanitize_sql,conditions)
puts “UPDATE #{table} SET #{sql}”
execute “UPDATE #{table} SET #{sql}”
end
execute “ALTER TABLE #{table} ALTER #{column} SET NOT NULL;”
end

end

Ok I’ve hit a small problem with the above code. You see the Rails system is using sanitize_sql to make sure that nothing bad gets to the database. This causes a small problem with Postgres.

ALTER TABLE my_table ALTER COLUMN created_at SET DEFAULT now();

ALTER TABLE my_table ALTER COLUMN created_at SET DEFAULT 'now()';

Ok the first statement is what I meant - and the second statement is what get executed. Why does this matter you ask? Well you see the first one actually sets the coulmn to default to the function now(). Which means when you create something it will be set to the current date and time. The second one sets the default to the current value of now(). Which means all your created_at are going to be set to the same value unless you actually pass a value in (which doesn’t seem to be happening).

Anyone got a nice solution to this?


    You are currently browsing the Economy Size Geek weblog archives for December, 2005.
    Previous Entries »
    Categories
    Archives

    .