technology


10
Jul 08

log_buddy and Windows

I recently started playing around with the log_buddy gem for Rails and because my development machine is on windows, the “d” method wasn’t playing nice with some paths.  it didn’t like paths that included the drive letter.

this is a sample of a line that would cause log_buddy to barf.  it just so happens to also be the line that causes the error.  :)

c:/ruby/lib/ruby/gems/1.8/gems/log_buddy-0.0.5/lib/log_buddy.rb:98:in `read_line'

the original line looked like this…

file, line_number = frame.split(/:/, 2)

the fix is to replace that line with

file, line_number = frame.reverse.split(/:/, 3)[1..2].map(&:reverse).reverse

yeah.  ugly, and maybe could be written better but it works for me.

now if only I could get log_buddy to output good inspections of objects I toss to it… like “current_user”.  I’m prolly using it wrong right now, but this isn’t helpful…

current_user = '#<User:0x47143d8>'

just saying.  :)

UPDATE: I monkeypatched log_buddy to fix this functionality. I created a “RAILS_ROOT/lib/log_buddy_extensions.rb” file with the following code.

class LogBuddy

  private

  # Return the calling line
  def self.read_line(frame)
    file, line_number = frame.reverse.split(/:/, 3)[1..2].map(&:reverse).reverse
    line_number = line_number.to_i
    lines = File.readlines(file)
    lines[line_number - 1]
  end

end

and I figured out that the “current_user” line above shouldn’t be …

d { current_user }

it should be

d { current_user.inspect }

that outputs what I want …

current_user.inspect = '#<User id: 1, login: "matte", email: "matte@localhost", crypted_password: "...", salt: "...", created_at: "2007-08-30 18:23:32", updated_at: "2008-07-08 18:57:45", remember_token: "...", remember_token_expires_at: "2008-07-22 18:57:45", name: "...", password_reset_code: nil, company_id: 2, active: true>'


13
May 08

XSendFile note

I coulda had a V8Note to everyone using Apache and the XSendFile module. If you’ve included the module and are getting 0-byte files, like I was today, make sure you have the following lines in your VirtualHost config

XSendFile on
XSendFileAllowAbove on

The website needs to know you want to use the module. Duh. :)


4
May 08

Gas Prices on Google Maps

Gas Prices on Google Maps

While researching our drive today I was looking around the new turn-by-turn street view added to Google directions. take a look at what the gas prices were the day these pics were taken. gah!

I uploaded this through flickr


19
Apr 08

Gravity assist

Gravity assist

Even while sleeping Desmond is so considerate and helps me keep my laptop
from floating away.

I uploaded this through flickr


24
Apr 07

I Took It!


9
Apr 07

HEY!!! That’s not nice.

While filling out an online form today, I was presented with what we in the web biz call a CAPTCHA image. It’s one of those graphics that has text you need to confirm. The text is either distorted, covered with lines, shapes, or colors, or even both. It is presented in such a way as to obscure the text enough so that a computer can’t automatically guess what it says. They’ve become quite popular and for good reason. They work. But what happens when they start fighting back, or at least letting you know how they feel about you.

I kid you not, this is what it asked me to confirm…

Continue reading →


27
Mar 07

and 15 cents in change

WOOT!! Just really excited about my first IPO ever!!!!! we priced at $11 a share and ended the day at $14.15 per share!

It’s been a long time in coming. I moved out here in ’98 and have lived through the lean times of the post-2000 bail-out of all things Internets. It’s nice to be on the upside of good times.

Thanx to all those that deserve but don’t get naming (sorry, for strict reasons of privacy). If you think you deserve thanx, then I give you those thanx and more. You know who you are. I’ve worked with the best and it shows. Many amazing people have stood alongside me and I have worked for many amazing talents during the downturn in the .com economy and we’ve come out of it all and stood tall. Thank you, thank you, thank you. I can’t begin to express my thanx.

[holding a glass of Veuve Clicquot in the air] here’s to the future everyone. Keep your feet on the ground and keep looking to the stars… or what ever Kasey Casem used to say. :)


22
Feb 07

WTF? A TV?

WTF?  A TV?

So I’m buying gas today and I hear someone talking nearby. There wasn’t a car next to me so it couldn’t have been someone on their phone. What was it? Shell has installed small LCD tvs in their stands now. WTF?

I thought the grocery store checkout lanes was bad enough. It’s starting to get ridiculous now. What’s next? Above the stripper poles? At the crosswalks? Jeez.

I uploaded this through flickr


15
Jan 07

Who needs the real iPhone

2007-01-15

heh. This software is called “iPhony”. it’s a glorified app launcher for the Treo.

I uploaded this through flickr


5
Dec 06

I wonder how Jasper and Daphne would react to this?

[insert evil grin here]. I sooooo wanna see. This is a new remote-controlled dragonfly that’s being made by the same people who brought you the Robosapien. Unfortunately it hasn’t been made available for sale yet. It has only just been approved by the FCC.

I’m betting that Daphne runs under the dining room table or under the couch. I bet Jasper looks at it frantically for a bit but then goes to sleep in his box.