Recent Events

May 31st, 2007

A lot has happened since I last posted, probably because I hate blogging, but I figure if you got here, you should be kept up to date. I have put in my official end date of June 15th at Amazon and will be moving to sunny California to work at Palantir starting July 2nd. Lots to do with moving and finding a place to live and all that stuff.

Also, I got some Lasik last Friday. I have 20/20, but there are crazy halos around anything that is bright. Hopefully it clears up with healing, because it sucks. Pictures of my bruised eye to follow.

Yisong is back in Seattle which should be awesome. He is my number 1 guy.

I have finally dug through some of my pictures and have put up the whistler trip in February.
Whistler MountainPeople on trip

I will look into actually getting hosting for my site because it has been hella slow and I will be moving soon.

Also, I am late to the party, but icanhascheezburger rocks.
I'm in ur windoze

HD Snobbery

December 19th, 2006

I recently picked up a sweet, sweet TV and it is the p-hat, phat bzomb. It is the newest generation of DLP and looks amazing. I also picked up an xbox360 to go with it and now I love HD content. Unless the content is really awesome (House, Heroes, Scrubs, South Park), I desire to only watch HD. I also picked up an HD-DVD attachment for the 360 so I can see my movies and TV shows on HD-DVD in the full 1920×1080 resolution that my TV displays natively.

Amazon is running a pretty cool deal and HD-DVD and Blu-ray players. If you buy a player, then you get 10% off all High Def Disks for the next year. Which combined with my 10% employee discount and 3% back on my amazon credit card and amazon Prime, comes out to a pretty sweet deal. 23% off DVD’s and free 2 day shipping, Hell yeah!

At this point I pretty much have to get digital cable for sports and other good stuff of the sort. Maybe I’ll have the SuperBowl in HD. I love HD!

50

Snow Time

November 14th, 2006

So there is finally snow on the mountains. I have been waiting since Feb/March for this. It is been raining every single day lately, which has been miserable, but it has finally paid off. Crystal is opening on Thursday and right now it has 35 inches of snow at the base. Oh yes, and it is expected to snow more by the time Dennis, I and company head out on Saturday. It will probably be crowded, but there is enough mountain for all.

Also in recent events, Dave Goodell is now married. I was busy being in the wedding as a groomsman, so I didn’t take any pictures, but here are some pictures that Ben Bernard took with a camera that is pretty much identical to mine. I took a slice of them and put them up in my gallery as well because Ben was nice enough to share.

Here is my board. I think I have the 156cm version, it is a little long for my short self, but it was a rocking good deal and it is so soft and park oriented anyway, I don’t notice the size. See you on the slopes!
My Atomic Hatchet Snowboard

Photos on S3

October 13th, 2006

You can now see the large version of images without waiting for my slow, slow cable modem async upload. In fact, all the image loads should be blazing fast as soon as I get them all uploaded. At the rate it has been going, it will take 3 days to upload everything to S3. My script is just about though my china pictures now.

And it is so easy to use. I work at Amazon and have had pretty much constant exposure to S3, but it still surprised me how easy it was to use. I used rSh3ell to get started. I just created a bucket named ‘carrino_albums’, then started uploading things to that bucket with acl ‘public-read’.

Here is the script I used to upload my files. Its pretty hacky. I just reads from a file called input and writes the file with that key to S3 as public-read. Some exception handling is thrown in there. I intend on creating a much better script along the lines of s3sync, which behaves like rsync. S3 makes this easy, becasue it automatically stores the upload date and the md5sum in the metadata, and you can retreive that with a HEAD HTTP call. You can also do a list call on the bucket, which will get you the metadata of all the keys in that bucket.

If I upload a file named china_day2/dsc_2572.sized.jpg to bucket carrino_albums, you can find it here. It’s that easy!

#!/usr/bin/env ruby
require 'S3'

AWS_ACCESS_KEY_ID = 'public key'
AWS_SECRET_ACCESS_KEY = 'private key'
USE_SSL = false
@conn = S3::AWSAuthConnection.new(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, USE_SSL)
@bucket = 'carrino_albums'

def write_file(file_name)
    begin
        bytes = nil
        key = file_name  # NOTE: this is specific to our situation
        File.open(file_name, "rb") {|f| bytes = f.read }
        headers = {
              'x-amz-acl' => "public-read",
              'Content-Length' =>  FileTest.size(file_name).to_s
        }
        response = @conn.put(@bucket, key, bytes, headers).http_response.message
        if response == 'OK'
            puts "#{file_name} SUCCESSFULLY uploaded"
        else
            puts "#{file_name} FAILED to be uploaded"
        end
    rescue Interrupt => e
        puts "Caught Interrupt, bailing out"
        exit 1
    rescue Exception => e
        puts "#{file_name} FAILED to be uploaded and caused an exception. #{e.class.name}: #{e.to_s}"
    end
end

STDOUT.sync = true
File.readlines("input").each { |line|
    line.chomp!
    write_file(line)
}

Da Bears

October 2nd, 2006

What happened to my bears? They somehow, after all these years, manage to have a healthy QB who can get the job done. For as long as I can remember, when the bears were behind, they would run and screen pass to “3 and out” every drive. We might pick up another 3 or 6 points on field goals, but definately not through the air, an certainly not in the endzone.

Rex Grossman

We are now the only NFC team that is still undefeated. We are now +6 in turnovers (up +2 from last game with 2 interceptions by Ricky Manning). We’ve only given up 29 points in 4 games, including a shutout of favre in green bay. But we all knew that the Bears were Defensive machines. The surprise is the Offence. I think it is too soon to think that Rex will be a franchise QB, but it sure sounds nice.

Also, to top the day out, we won our final regular season kickball game to put us at a whopping 3-2-1. That last game was a nail biter. At the bottom of the last inning we were up 6-5 with 2 on and 2 away with the go-ahead runner at 2nd. I was pitching and had a pretty solid day. It was a bunt and I was able to hop on it and make the out by tagging the runner on the way to first.

Boo ya.

My Cat has the Power of Flight

September 28th, 2006

Check out these pictures and see for yourself. Oh yeah, and she is wearing a really cute ladybug costume, too.
Kittay as a LadybugKittay StandingBackflipTwistingFlyingLanding is the hard part

KickBall

September 25th, 2006

Our team is currently 2-2-1 with a ton of runs on our wins. After our big win next week, we should have pretty good standings going into the playoffs.

Dave KickingOopsDugoutJoe throws to firstNick can flySilas pitching

Weird Al is Back

September 25th, 2006

George Washington

August 16th, 2006

He was one of the coolest dudes around. Don’t take my word for it, see for yourself.

Really the point of this post is to test if I can embed youtube in my blog, which I can, so you will be getting a lot of random crap from now on.

Powerset in Ruby

August 11th, 2006

Now for a real post in a very cool language that is on the rise. Currently my favorite language to write, Ruby.

Simple PowerSet implementation, pretty straight-forward.

class Array
  def powerSet!
    return [[]] if empty?()
    f = shift()
    rec = powerSet!
    return rec + rec.collect {|i| [f] + i }
  end

  def powerSet
    return clone().powerSet!
  end
end

Note, I added this directly to the Array class. In ruby, classes are left open, so you can add to them later. It is a very dynamic language, and there are hooks for just about everything, so you could have some behavior run when a method is added to your class. Now that Array has a new method, you can just call

[1,2,3].powerSet

Now let’s write it using inject, because inject is awesome. (inject is known as reduce in python, and they are removing it from the next version. It’s a shame they are removing it, but it makes sense because python doesn’t sweet sweet blocks like ruby.)

array = [1,2,3]
array.inject([[]]) { |acc, you|
  ret = []
  acc.each { |i|
    ret << i
    ret << i + [you]
 }
  ret
}

The best part about inject is that once you get your head around it, it is pretty clear and also that this expression can be smashed to 50 chars if that is what gets you going.

[1,2,3].inject([[]]){|c,y|r=[];c.each{|i|r<<i;r<<i+[y]};r}