RSS

Monthly Archives: December 2006

Ruby on Rails: How to load session objects into console

This posting has MOVED!

Please follow the following link:

How to load session objects into console

Advertisements
 
5 Comments

Posted by on December 6, 2006 in Ruby on Rails, Technology

 

>Ruby on Rails: How to load session objects into console

>

This took a little bit of poking around, so I decided to post it here.

Basically I was tracking down a bug, which resulted in a corrupt object (cart) in the web session. So I thought, it would be nice to play with this object in the console to see what’s up… But how do I get it in there?

There may be a more elegant way to do this but here is how I got it to load:

  1. Look in tmp/sessions and find the most recent file (ls -alrt on UNIX). Let’s say the file is called ‘tmp/sessions/ruby_sess.8eb9614a7e4e1e3b’
  2. Open console and type:
    >> session = Marshal.load(File.open('tmp/sessions/ruby_sess.8eb9614a7e4e1e3b'))
    => {"hash"=>{:cart=...
    >> cart = session["hash"][:cart]
    ....
    

    In this case I was trying to access a cart object in the session, which was placed in the session with:session[:cart] = Cart.new

That’s it!

 
3 Comments

Posted by on December 6, 2006 in Ruby on Rails, Technology

 

Wanted: 11.3Tb flash drive to move house to a new location

Isn’t it just great that these days you do not need a truck to move stuff? As long as the stuff you are moving is digital.

I was thinking that in a pretty near future each house may include a giant mass storage that holds everything we own which can be digitized. Such are the books, photos, personal documents, bills, music, etc. All of those things are already available in a digital form, but what about furniture, kitchen counters, decorations, paintings, or the super-heavy piano for god’s sake?

What if… the house of the future is a completely configurable and intelligent hardware device that can reconfigure itself to it’s owner’s liking and create those items entirely from it’s own supply of materials? What if the paintings can be built into walls and show digitized image, books are digital single-page fold-out with downloadable content, furniture can be created from built-in modules…

Then – instead of moving your stuff you just have to download your existing house to the new house – and vola! It looks the same! Wouldn’t that make moving easier?

Well, until the house is so intelligent that it can reconstruct itself to fit my personal furniture and layout needs, the digital move is limited to less extravagant things, such as music, documents, books and media. But that’s already lots of really important stuff!

Which is why I think that the house of today should come with a built-in storage, that’s remotely backed up and fully redundant. A built-in file server, just like a built-in washing machine. That’s because just like everyone needs to wash dishes, everyone in this day and age also needs to backup their crap, and there’s lots of crap to backup.

Go! – the digital movers revolution, just don’t forget you can’t microwave your hard drive.

 
Leave a comment

Posted by on December 4, 2006 in Technology

 

More sound bites: “Anything You Want”

Just wanted to quickly post a new track composed in October for the Halloween party. It’s called “Anything You Want” and is punchy as it’s groovy. Please star the odeo podcast if you like it!

[odeo=http://odeo.com/audio/3554443/view]

 
Leave a comment

Posted by on December 4, 2006 in Sound Bites

 

>Wanted: 11.3Tb flash drive to move house to a new location

>Isn’t it just great that these days you do not need a truck to move stuff? As long as the stuff you are moving is digital.

I was thinking that in a pretty near future each house may include a giant mass storage that holds everything we own which can be digitized. Such are the books, photos, personal documents, bills, music, etc. All of those things are already available in a digital form, but what about furniture, kitchen counters, decorations, paintings, or the super-heavy piano for god’s sake?

What if… the house of the future is a completely configurable and intelligent hardware device that can reconfigure itself to it’s owner’s liking and create those items entirely from it’s own supply of materials? What if the paintings can be built into walls and show digitized image, books are digital single-page fold-out with downloadable content, furniture can be created from built-in modules…

Then – instead of moving your stuff you just have to download your existing house to the new house – and vola! It looks the same! Wouldn’t that make moving easier?

Well, until the house is so intelligent that it can reconstruct itself to fit my personal furniture and layout needs, the digital move is limited to less extravagant things, such as music, documents, books and media. But that’s already lots of really important stuff!

Which is why I think that the house of today should come with a built-in storage, that’s remotely backed up and fully redundant. A built-in file server, just like a built-in washing machine. That’s because just like everyone needs to wash dishes, everyone in this day and age also needs to backup their crap, and there’s lots of crap to backup.

Go! – the digital movers revolution, just don’t forget you can’t microwave your hard drive.

 
Leave a comment

Posted by on December 4, 2006 in Uncategorized