Shop It To Me: My First Day

There was a point today, sometime in-between the deluge of new-hire paperwork, getting to know a new office-space, having to configure a new Microsoft system because my Macbook Pro hasn't yet arrived, the multitude of new names, and a code overview for (just one) part (of many) of an intricate Rails system, when I thought: "this is exactly what I was looking for."

Today ranks as one of the best first days I've had since starting as a software engineer. I like the people I'll be working with, I like the company, I like the product, and I like the numerous challenges before me.

Although, I'll admit that I didn't sleep very well last night. It was mostly due to the heat in San Francisco but partially due to one nightmare I had about showing up unprepared. I don't exactly remember what happened in the dream; I either wore shorts or didn't have any pants on when walking into the office. One is certainly worse than the other, but considering the magnitude of change from my previous position, only one (fairly harmless) nightmare is doing pretty well for the night before a new job.

There was, however, a funny moment at lunch today. The question came up: "so how did someone from Yahoo! get a job at a rails shop?" (alluding to the fact that Yahoo! is primarily a PHP shop.) It reminded me of the time just over three years ago when I caught the Yahoo! shuttle bus back into San Francisco after a day of interviewing in Sunnyvale (which ultimately resulted in my first job at Yahoo!.)

On the shuttle, I started chit-chatting with the guy next to me. He asked if I had snagged the interview through a friend or relative and when I responded that I had landed it after an application through HotJobs, he jolted a bit and responded, rather surprised: "you must have some pretty special skills, then..."

Special enough, I guess...

Rails Bootcamp

I recently started a 6-week RoR bootcamp to fill in gaps as I promised myself I would do with a new framework (after building and maintaining a web app with Catalyst over two years.)

As you may know, Yahoo! is primarily a PHP shop, but there's a lot of Perl being used for infrastructure, especially for monitoring. Amongst so many talented Perl developers, I opted to use a framework in order to focus on bringing value at a higher level. With Catalyst (which was new for me,) I read up on the framework as best I could (web/IRC/lists) given the other (Yahoo!-specific) technologies I was learning at the time along with the other responsibilities (product management, project management) I was juggling.

While working with Catalyst, I was burned more than once by assumptions and conventions of the framework I had not had time to go in depth on (they say you use 20% of what you learn, but you never know which 20%, do you?) That whole experience reinforced the notion that you will never always know everything you need to know at exactly the moment you need to know it, even if you're an experienced web developer.

One just needs to be open to change and growth.

And a little extra homework...

My First Ruby Script

This last weekend I was finally able to sit down and pound out my first Ruby script. Now I can grab the 790 pics I have in my Gallery installation and thanks to the B-Tree, order them by the upload date.

(There must be a better way to do the regexs in Ruby but I think it's not too bad for a first stab.)

The next step is to make use of the Flickr API to upload all the pics and set info accordingly.

What to do about tags? In the next iteration, I think I'm going to put a "tags.txt" file in each Gallery album directory in order to ascribe at least a few tags to the photos as they're being uploaded.

Just for fun, here's a taste of the Gallery metadata files (photos.dat) that serve as the input for parsing. Good times.

a:17:{i:0;O:9:"AlbumItem":19:{s:5:"image";O:5:"Image":12:{s:4:"name";s:8:"100_0559";s:4:"type";s:3:"jpg"; s:5:"width";i:640;s:6:"height";i:480;s:11:"resizedName"; s:14:"100_0559.sized";s:7:"thumb_x";N;s:7:"thumb_y";N; s:11:"thumb_width";N;s:12:"thumb_height";N; s:9:"raw_width";i:1200;s:10:"raw_height";i:900; s:7:"version";

Beginning With Ruby

I didn't really want to pay $333/month to hone my Python chops so I decided to get my hands dirty with some Ruby instead (on a side note, I am currently looking to recruit Front-end Engineers and a Front-end Engineer manager if you know of any...)

I decided to formulate a different task for myself:

TASK: Given a set of albums in a 1.4.4-pl4 version of Gallery, write a script that uploads them to Flickr and sets properties accordingly so that they appear in the correct chronological order.

Background

I've been using Gallery for a long time to curate my photos, long before Flickr came on the scene. I'm a big believer in YDYS (Your Data is Yours) and didn't like uploading my photos to big servers in the ether so I hosted my own photos with Gallery.

Well, time marches on and when you manage your own photo gallery online then you have to manage the software that manages your photo gallery. I have to admit (and you can pretty much tell when it happened by the version number,) my gallery fell into disarray and I didn't tend to it as much as I should.

Now that I don't have quite as much time for outside projects as I once did, I thought "it's time to upgrade to a service like Flickr and let them manage the infrastructure while I take care of capturing and sharing memories."

DISCLAIMER: I get the Flickr Pro upgrade for free because of where I work. It's probably necessary to have the Pro account before you attempt the uploads using the techniques that I'm eventually going to use.

I'll have some time to get started this weekend, but here are some initial steps as to what I think I'll need to do to parse photo data out of the Gallery files.

=begin
- Create a B-Tree (we'll need it for date-tracking as we process each of the photos)
- Glob a list of photos.dat files recursively
- Foreach photos.dat file...
-       Open file
-       Slurp file (can do in Ruby?)
-       Parse syntax
-       Foreach photo
-               Find uploadDate
-               Do lookup in B-Tree on uploadDate and/then...
-               Stick Album Name and File Name in B-Tree for uploadDate
-       Close file
- Traverse the B-Tree and print out: "Album Name, File Name"
=end