Archive

Archive for the ‘General’ Category

On Spriting and Website Build Processes

June 3rd, 2009

Ryan, my mentor from when I was at MoCo, wrote an excellent article on spriting a few days ago. Man, I miss all the good conversations…that’s what I get for not subscribing to the webdev feed. That’s all changed now.

I have an interesting history with spriting. For both of my internships (Mozilla and Yahoo), one of my first projects was to sprite sites (AMO & Yahoo! Real Estate, respectively). AMO is still using my work (for now), and YRE long ago gave up on rounded corners, and have few icons now, so spriting is more or less useless for them now.

I guess that qualifies me to weigh in a bit. I’m not going to talk about the memory usage or anything on the client-side past delivery for two reasons. First: size in RAM has a tiny impact on page-loads compared to downloading for most users. Second: I’m horrible unqualified to talk about how web browsers load and store images in ram. Not my field.

There are some issues (many fixable) with spriting:

  • In both instances of spriting I got an email a few months after I left the company asking me where my source sprite file was located. Once it was due to me not putting the file in the right place, but the fact still remains that a source sprite file is one more thing to lose, and losing it is pretty annoying.
  • Not everyone knows how to compress images properly. If you do it wrong, you’ll end up with a huge PNG file that is worse than a bunch of small files.
  • Spriting removes any connection between CSS styles and the images they are associated with. If I want to know what a class with a background image looks like, I have to either find a reference to it on the site, or figure out where the hell -123px -72px is. It’s more or less obfuscating your CSS.
  • repeat-x or repeat-y images need to span the whole width/height of the sprite…they should have their own sprite files (if you have enough of them)
  • Like Ryan said, images that are supposed to be near the left of an element (i.e. they need an arbitrary amount of space to the right of them) should be at the right side of the sprite. This makes an internationalized site that supports right-to-left text (an insanely difficult thing to achieve, and something which many MoCo sites do impressively well) much more difficult. It’s very frustrating to discover halfway through that your sprites show up wrong in RTL. Not many sites need to worry about this, but it’s annoying if you do.

With that being said, spriting can be useful when done properly. A very good example is how Yahoo Mail sprites. They group similarly-size things in a file. They have an icon file, a rounded corners file, etc. This makes things easier to manage, but still suffers from some of the above issues.

I don’t know how Yahoo’s build process works, but to make sprites worth it I would propose some kind of CSS build step. Ideally all the developer would have to do is specify which images are displayed which ways (whether there needs to be whitespace to the left, right, top, or bottom), and the system will build the sprite and generate a complied CSS file that is minimized and concatenated.

AMO’s build process got halfway there. It was originally a shell script written by yours truly, converted to python by FWenzel. The shell script is described here (the python script is essentially the same). It concatenates a bunch of files, compresses them with YUI Compressor, and creates a PHP file with the current revision numbers (to append to the URL for long expires headers). Pretty standard web build system.

I’d really love to see a system that also parses out background*: rows with comments at the end (identifying what type of spriting should be done), places them, replaces the URL, and adds a background-position. That, combined with AMO’s build process, would allow an algorithm to determine what’s best for download times vs. memory usage.

The best part: an automated system would easily allow bucket tests on load times based on different sprite files. Now wouldn’t that be useful?

Why YouTube Can’t Cost $1.65M a Day

May 29th, 2009

I know I’m a little late on the bandwagon, but I’m sick of seeing articles claiming Google is losing so much money from YouTube. They’re based on estimates that I find a little absurd.

Let’s take just one example - http://www.internetevolution.com/author.asp?section_id=715&doc_id=175123&:

Disclaimer: I’m going to use low-ball estimates to guess where Google stands. I am by no means a professional when it comes to estimating this, or even educated in such things, but I feel like Google has so many tricks up their sleeves that I have only slightly less credibility than Credit Suisse or Bear Stearns. I repeat: I am making up numbers

Bandwidth

Maybe I’m not understanding something here, but from what I know a mutually beneficial peering agreement doesn’t require paying for anything other than labor or hardware. ISPs don’t want to provide users with fast internet without having it bounce around too many places, as does Google. Assuming Google has a datacenter close enough to every major ISP to just peer to them (not unreasonable), their only potential non-labor cost is communication between their datacenters. But wait! Hasn’t Google been buying up dark fiber left and right? That means their costs are adding additional capacity and redundancy, plus network maintenance (hardware and labor). Like I said, I’m not a hardware guy, but knowing people who owned datacenters, this is how I understood it. Please call me stupid if I’m wrong, but I’m going to cut this down to $10,000 (~$3.5M/year).

Revenue Share

This one’s just BS…they’re counting “making less money” as an expense. Sure, it’s less money, but that’s a little misrepresenting, no? Plus, I assume the estimating companies already took this into account. $0

Content Acquisition

Google isn’t dump…I doubt they’re putting themselves in the red solely on content costs. Media companies also get a huge amount of exposure from being on YouTube that they can’t get anywhere else (Excluding TV shows and Hulu, but YouTube mostly deals in music videos anyway). So let’s cut this in half and say $360,000 (~$131/year, a lot of clams, and generous in my opinion!).

Hardware

“Given market estimates of about $2 per gigabyte”. Really? Google is famous for using off-the-shelf hardware. I can buy a 1TB HDD for $100, and I’m not buying a million of them. I’m not saying this quote isn’t accurate when you account for electricity, cooling, redundancy, etc, but Google is far above the average for all of these, so I feel like using a market estimate is unfair. I’m gonna cut this in half, so $18,000 (~$6.5M/year).

New Results

Let’s calculate Google’s break-even point for YouTube:

Bandwidth $10,000
Content Acquisition $360,000
Revenue Share $0
Hardware $18,000
Subtotal $388,000
Administrative Costs 38.4%
Math! x*(1-.384)-388000=0
Break-even Revenue x=$629,870

Now I’m not saying that Google is definitely making money off of YouTube, but $630K/day is less than Credit Suisse estimates Google’s daily revenue at, so it’s entirely possible they’re in the black.

SC08 Student Competition

March 3rd, 2009

http://sc08.supercomputing.org/html/CarnegieMellomExcels.html (Mellom?)

I was invited to compete in the SC08 student competition last November (yes, I’m behind on my blogging, I know). It was a fun couple of days: it’s amazing how much companies spend on convincing other companies to buy things from them. Some highlights:

  • Microsoft dressed up all of their booth reps in AstroTurf (they had a golf theme)
  • One of my teammates won a Wii raffle
  • There was more computing power than I’d ever seen
  • Winning the competition after 8 hours locked in a conference room coding

I’d like to give two incredibly huge thank yous:

First to the Pittsburgh Supercomputing Center for sponsoring the trip. They were really great, letting us do more or less what we wanted, and paying for everything. Thanks for putting up with us Laura!

The second to nVidia for their last minute donation of a prize. My entire team got Tesla C1060 GPGPUs. These things are insanely powerful: we got to program on them for part of the competition. Talk about generous: we had already won and it came up in some post-victory chats with nVidia reps that we got to program with their CUDA architecture (surprisingly easy), so they figured they’d let us keep coding on them. Now all I need is a kilowatt PSU and a mobo with 2 PCIe slots. Either that, or the card pays for my upcoming trip to San Juan ;).

,

Mockups Made Easy

March 2nd, 2009

Recently I’ve been working on a project that involves a lot of data visualization, with a lot of non-technical stakeholders. I needed a way to both play around with the ideas in my head and convey these ideas to non-technical colleagues.

I’m not a fan of HTML prototyping, since I find it takes too long and results in too much detail work, and Photoshop seems like overkill. Luckily, I follow Hacker News religiously, which had a few links to the Balsamiq blog over the last few months. So I gave Balsamiq a try, and boy was I impressed!

Balsamiq is, in its simplest form, a drag-and-drop board with a bunch of UI elements. But the incredibly simplicity of it really works, as it gets you down to the basic components of a page. My only gripe is that this does get frustrating for customized uses. For example, I wanted to show certain types of charts, but instead had to settle with doing funky things with their “progress bars”, which only matched the shape of my desired elements. I’d really like to have the ability to add my own UI elements. Also, pulling images from the web reloads them constantly instead of just downloading the image locally.

All in all, one of the few applications that I would be willing to actually pay for. Also, a great demo of what can be done with Adobe Air, and actually makes me want to poke around with Flash for the first time in years…this is an entirely new niche for Flash.

Full disclosure: Balsamiq gives away licenses to bloggers, so I didn’t actually pay for it, but I was on the verge of pulling out my credit card when I saw that exception.

, ,

Job Hunt Post Mortem

February 3rd, 2009

I’ve been meaning to write about this for a while, but I never really got around to it until just now. I wanted to share some experiences from my big job hunt.  It was definitely a fun experience: during last November alone I was on over 20 different airplanes.  I had at least preliminary interviews with over a dozen companies, and ended up with a really tough decision between two amazing options.  But more on that later. There are many different types of companies that I ran into in my interview process, and here are just a few experiences from them.  Note that whatever I say about these companies, I have the utmost of respect for them all.  They all treated me very well, and I had a great time interviewing with them (and I’m not just saying that on the off chance that they read this).

Job Fairs / Standing Out

The only place I looked for a job was Carnegie Mellon’s job fair.  It’s a really amazing experience: over 200 companies show up, most in the technology realm.  Thousands of students run around in suits trying to convince companies that they’re special: different than all of the other students running around in suits.  I had the opportunity to help a big company I was interning at a few years ago with manning their booth.  I collected resumes for a few hours, and honestly it was incredibly boring.  Most students slipped me their one page resume, gave me the same spiel about the courses they’re taking and the random programming job they did, ask me what I do, and wandered off.  Very few people stood out.  The ones who left a lasting impression on me had one or more of the following traits:

  • A really interesting story to tell about a problem they solved. I mean like get-a-rocket-into-space interesting.  No, not how you figured out how to multiply matrices on CUDA architecture, I want to hear something even a fifth-grader would say “awesome!” in response to
  • A unique background. I was more interested in a freshman who had been consulting for 3 years than a senior who had done the same.  Or even just a freshman who had the guts to show up at a job fair after only being in school for a month.  That’s exactly what I did, and I got tons of raised eyebrows and kudos (and an internship).
  • Personality! One guy was so incredibly energetic and excited to meet me that I couldn’t forget him.  Note that I really don’t recommend trying this unless you have the charisma to back it up, because faking that is incredibly difficult to get away with.  For a more toned down example: I ran into a company this last job fair that I really wasn’t looking to talk to (we had one of those you-made-eye-contact-now-you-have-to-talk-to-me moments).  We started talking and they admitted that this was their first job fair, as they used to not target recent grads so heavily.  My response was “Job fairs suck, don’t they?” and launched into my stories from working one.  The discussion had nothing to do with getting a job, but the friendly banter ensured they wouldn’t forget me.  My recruiter instantly remembered me by first name when I called her a month later.

Other advice for job fairs:

  • Learn to love people. One of my greatest assets at job fairs is that I genuinely love meeting new people.  Each booth I stop by is not only a chance to hear about a potentially interesting product (and get free swag), but also to meet someone and find out what they do.  It’s great practice for real life too: if you make an ass of yourself to a recruiter, odds are you’ll never see them again, whereas doing the same for a coworker or classmate would have longer-lasting implications.
  • Talk to as many people as possible. I’d much rather talk to 10 companies I’ve never heard of than wait an hour on line to talk to someone from Google (they require everyone to apply online anyway).  I had literally never heard of the company I ended up accepting an offer from.  Also, you can always decline interviews later on, but this is your best shot to initiate contact with these companies.
  • Relax. No one likes talking to someone who’s nervous.  It’s awkward, and shaking a sweaty hand is gross.  I would say for those who are always nervous that they should take a shot or have a beer (just one!) before hitting the job fair, but I’ve never tried this personally and can’t be held liable for the consequences.
Bad Interviewers

I had my fair share of botched interviews, but about halfway into my job hunt I realized that it wasn’t always my fault.  Sure, sometimes you walk into the room and instantly become stupid, and sometimes you’re just in the wrong place at the wrong time, either literally (I slept through an interview once) or figuratively (I once commented that I hate SML, only to immediately hear from my interviewer that “SML is my favorite language”). But other times the interviewers themselves suck, and there’s nothing you can do about it.  I’ve had awkward interviewers who didn’t seem to get how the process was supposed to work: they gave no feedback.  This wouldn’t be a problem for easy questions that everyone should be expected to answer, but some of their questions were the type that people aren’t supposed to know the answer to.  The goal is to start a discussion and evaluate process, eventually working your way to an answer.  I was told in a phone interview to “think about it and email me”, which is usually code for “I want to stop wasting my time with this call”.  I’m not going to eliminate the possibility that I just suck, but everyone I spoke to about the problem agreed that I couldn’t be expected to solve it without prodding.  Some people just don’t know how to run interviews, it’s the luck of the draw.

How much I cared in my classes

GPAs

I’ve never cared much about my GPA.  I would rather have an interesting consulting project than focus more on my grades hands down.  My mentality is that if a company values a high GPA over actual experience, I have no desire to work for them.  It turned out this was the right call, since only two companies that I was interested in asked for my GPA.  One still asked me for an interview, and the other only asked on their web form they made everyone fill out.  The other 20+ companies I handed resumes to didn’t even mention grades.

Warning: I am not advocating ignoring your classes.  Everyone has an average grade they would get if they put in their “I feel obligated to do at least this much” level of effort.  I was comfortable with what mine was, so I didn’t feel the need to do more.  Yours may not be in the same place: I recommend evaluating this carefully before making a decision on level of effort in classes.  Also, Carnegie Mellon has a reputation behind it that I’ve been told companies value more than GPAs.  If you go to a different school, your mileage may vary.

Wine-and-Dine Companies

These companies pull out all the stops for you, either to try and buy your love or just to give the impression that they’re doing really well.  One company flew me out twice, and both times sent a town car for me and put me in a $500/night hotel.  Then they took me out to really nice restaurants on interview day, including some really good (and I’m sure expensive) sake.  Granted, I think this particular company operated like this on a day-to-day basis, and all companies do it to an extent (one rented out an upscale lounge and had an invite-only event with an open bar for potential candidates), but my point is don’t let it affect you.  I let myself get sucked into the magic, and it clouded my ability to properly evaluate the company. It also made me more nervous during interviews.  Some companies provide lots of perks, some spend tons of money on little things, and some don’t.  While it’s important to evaluate these things when considering a company, be sure it’s weighted rationally.

Offer Negotiation

No, I’m not going to talk about salary negotiations, you’re on your own for that.  One thing that was important to me when deciding on an offer was my non-compete.  I’ve put a lot of time into building my relationships with my clients, and I don’t want to have to destroy that for a full-time job.  I also get bored easily, and like being able to work on projects without having to worry about whether or not I can open source them.  Also, if I get bored enough I could always tend bar on weekends, and I want to feel free to do that (surprisingly enough most of the non-competes I saw from outside of California barred me from doing that).  Having a paralegal for a mother means that I tend to assume the worst when it comes to legal stuff: I hear too many horror stories to think otherwise.  That’s why when I saw a non-compete that prevented me from doing any of the above items, I knew I couldn’t accept the offer as-is.  I was pretty upset, since that company was one of my top choices.

About a day after I saw the non-compete and knew it was a deal killer, I got a call from the CEO of the company (a really kind gesture that I didn’t expect) asking if I had any questions, so I mentioned this to him.  He told me that of course the company wasn’t looking to stop me from doing reasonable things, only not run to their competitors.  I mentioned that I had a family member who was in law, and he said that I was more than welcome to have her change it.  A little legal back-and-forth later and we had a new non-compete that everyone was happy with.

The moral of the story?  Negotiate!  If a company makes you an offer and you’re not happy with a part of it, whether it be paperwork, benefits, or plain old salary, say something.  Keep in mind that the company has decided they want you: at this point you’re both on the same level in the negotiation, since they need you as much as you need them (give or take).  The worst that could happen is they say “no”, in which case you’re no worse off than you were before.

My Story / Final Advice

So having learned all of this, I finally reached the end of my job hunt.  I had narrowed things down to two offers, and for the life of me I couldn’t decide between them. The salaries were comparable, both had great projects to work on, and both teams were awesome.  So I made a list. And I stayed up at night thinking. And I asked everyone I saw “Silicon Valley or Boston”, with mixes responses. In the end, it basically came down to two things. First, I had been in Silicon Valley for the last two summers: I knew it very well, and I considered that a bad thing. I wanted to try something different. I knew that I could always go to the valley and I would be comfortable there, but I worried that once I went there I would be too comfortable and settled to leave and regret it. At least if I went to Boston I would know enough about both places to decide which one I’d prefer. Second, Boston was closer to home. The though of being able to be home for Rosh Hashanah, something I haven’t done in 3 years, was comforting. There’s a lot to be said for being 4 hours away from family instead of 24.

So there you have it: in the end my decision came down to location, having nothing to do with the actual companies (with a touch of irony in that being in the valley drove me away from it, even though I loved, and still love, the area). It’s with that that I am thrilled to announce I will be joining TripAdvisor’s New Initiatives Team in May. My other option was Mozilla’s Webdev team, which I also would have been thrilled to join (having interned there, I can safely say that it is a wonderful place to work with an amazing group of people).

What final advice do I give? Try something new. I’ve never lived in Boston before, and while it’s scary to think of going to a new place when I could have had something I already know, I take comfort in knowing that I’m putting myself out there and trying different things. Challenge yourself to break out of whatever mold you’re in: challenge your assumptions and decisions every step of the way.

Also, if you’re looking for a job I’d highly recommend checking out TripAdvisor or Mozilla, they both have great people, and I feel privileged that they both felt highly enough of me to make me offers.

, , , , ,