Doorstop

2009-03-28

An Open Letter to Wil Gordon

Filed under: jobs, programming — Vineet @ 17:04

Hi Wil,

I’m sure you’ve noticed by now that reddit has found your Open Letter website and the peanut gallery is chattering away. Take their comments with a large grain of salt and skepticism, but I would encourage you to read through and try to pick out some constructive bits of criticism from all the noise.  I know reading personal criticisms and attacks can be difficult, and I also know that being unemployed can be emotionally taxing, even depressing. After graduating Cal EECS in 2000 I worked for a small startup for just under a year before it went out of business (like 90% of them did at that time), and I ended up being unemployed for a few months. It was hard. I got depressed.  I started to feel like there was something wrong with me. I also went through a lot of frustration — I knew I was a good software engineer, and that anybody would be able to see that if they’d just give me a chance, but I couldn’t get my foot in the door. I’m good in interviews, but I had to get a callback first. I spent a lot of time sending resumes to job ads and just hearing nothing in return.

I have a couple of specific pieces of advice for you after reading your letter and your resume. I hope I can phrase my recommendations constructively. I’ll start with the easy one:

First, on your resume: put the most interesting/valuable things first. I don’t know what AMPL is (even though there’s a good chance I may have used it in IEOR 162 or something). Put it last or leave it off. Sort everything by relevance, not alphabetically.

Second, I’d take down the letter. You may want to replace it with a sort of cover letter that presents your own strengths, not your perceived weaknesses in the hiring decisions of the companies you’ve applied to. Try to put yourself in the mindset of a prospective employer, and think about what they would want to see. This perspective can be hard without having been on the other side of the interview table. Speaking from experience, for a college grad, I expect to see, first and foremost, an eagerness to learn.

I know you just kicked ass at one of the top Universities in the world, you have a great education, and you feel good about yourself. And you should — you should be proud of what you’ve accomplished, but it doesn’t end there. I was arguably a better Computer Scientist on graduation day than I am now. But since then, I’ve become a much better software engineer. This is in part due to continuing to learn new technical skills, but mostly it’s due to the experience of working with lots of different people on lots of different types of projects, and being able to learn how to effectively work in different roles on a team.

You also need to position yourself according to your strengths. Are you trying to apply as a software engineer, or as a consultant to analyze and optimize their business? If the latter, what are your relevant qualifications and experience? What’s your track record? Stick to your strengths. You should try to get hired by a company that’s looking for a good software engineer, by showing them that you are a good software engineer. Don’t try to convince a company that you understand their business better than they do and can show them how to do it better. Even if it’s true (which, to put it bluntly, is doubtful given your level of experience), it comes off sounding very arrogant.

I hope this is still constructive, and that you can gain something from it.

Good luck, and Go Bears!

Vineet

2009-01-04

Faster than a speeding arrow

Filed under: haskell — Vineet @ 21:15

It turns out that although I’d already solved project euler problem 14, for some reason or another, I didn’t have the code stored in my git repository along with all the rest of them.

So I sat down to write some code:

collatz 1 = [1]
collatz n = n : collatz next
  where
    next | even n = n `div` 2
         | odd n  = 3 * n + 1

That was my first definition of the collatz sequence. I rewrote it using unfoldr:

collatz = unfoldr next
  where
    next 0 = Nothing
    next 1 = Just (1, 0)
    next n | even n = Just (n,  n `div` 2)
           | odd n  = Just (n, 3 * n + 1)

… which I liked a little bit better.

Then I went on to actually solving the problem: looking for the integer with the longest collatz sequence (in the range 1..1000000). Here’s a straightforward approach:

maximumBy (comparing $ length.collatz) [1..1000000]

It almost reads like English. But of course, it doesn’t actually Just Work. We get a stack overflow, since maximumBy uses a lazy foldl:

maximumBy		:: (a -> a -> Ordering) -> [a] -> a
maximumBy _ []		=  error "List.maximumBy: empty list"
maximumBy cmp xs	=  foldl1 max xs
			where
			   max x y = case cmp x y of
					GT -> x
					_  -> y

So I wrote this using the strict foldl1':

main = print $ foldl1' max $ map (length.collatz) [1..1000000]

… which runs without overflowing, but of course, it doesn’t actually return the number I’m looking for (it prints out the length of the longest sequence, not the integer that generated that sequence). But anyway, it shows the proof of concept: strict evaluation of the fold avoids the stack overflow. So I just need a strict maximumBy', which is just the same as maximumBy but uses foldl1' in place of foldl1.

So now I have a program that runs and produces the correct answer, but it takes about 90-100 seconds.

It turns out my original definiton of collatz (not using unfoldr)  brings this down to about 70 seconds. So okay, I use that instead.

Then just for kicks, I wrote this:

main = print . snd . maximum $ map ((length &&& head) . collatz) [1..1000000]

… and to my great surprise, it ran in 8 seconds! There’s clearly something going on here that I don’t understand yet, and it amounts to a 10x speed difference.

2007-07-01

bottom

Filed under: haskell — Vineet @ 03:53

This is totally childish.

Am I the only that thinks the ascii approximation _|_ for the up tack symbol ⊥, which represents the bottom type, looks a lot like the ascii approximation for the representation of an actual bottom (_|_) ?

I warned you.

2007-06-12

Sopranos Finale Misinformation (spoilers)

Filed under: Sopranos, TV — Vineet @ 05:06

There are many rumors circulating on various message boards today analyzing the last scene of the Sopranos, in vain attempts to piece together clues to figure out the “real” ending. After just re-watching it on my Tivo, there are a couple that can be put to rest:

1. Myth: When he’s sitting in the booth, Tony’s shirt is different when he enters the restaurant. Just not so. He takes off his jacket, but the shirt’s the same. You can see the same black collar when he pauses in the doorway.

2. Myth: The mysterious man that enters with AJ and sits at the counter is Nikki Leotardo. No, there’s no Nikki Leotardo in the credits. The credit for this man is “Paolo Colandrea, Man in Members Only Jacket.” Colandrea doesn’t have any credits in any previous Sopranos episode.

2007-05-08

First Impressions: Rootly

Filed under: Uncategorized — Vineet @ 15:58

James Thomas suggests Rootly as an alternative to Google News in his life without google. His recommendation makes it sound good, but we all know how important first impressions are. Here was mine:

Rootly First Impression (thumb)

Compare this to google news, where the first thing you see is … news! Can you find the news in the rootly screenshot? (Hint: did you check that thin little strip above the horizontal scroll bar?)

I’ll continue to give it a try, but I already get the feeling that I’m not a very important customer because my screen isn’t wide enough, or I’m not using their favorite browser, or something.

2007-02-05

Build it or License it

Filed under: Uncategorized — Vineet @ 08:24

Billy Newport complains that he can find code to do what he wants freely and easily on the Internet, but that he doesn’t want to have to go through the hassle of actually getting permission to incorporate it into an IBM product. He goes on to say that open source software doesn’t increase programmer productivity, because he can’t find code that he can use for his employer without any strings attached.

Open source code does increase programmer productivity within the open source community. If you go ahead and write the data structure code for IBM, then IBM owns it, and nobody but IBM reaps the rewards. Viral open source licenses give the open source community the same advantages. When I distribute code licensed under the GPL, the open source community reaps the rewards. It’s a feature, not a bug, that IBM can’t use this code without playing by the same rules. I, for one, would love to see IBM[*] gaining the rewards of participating in the open source community. This doesn’t mean taking what you want from the community without giving anything back (nor does it mean whining about what the community won’t give you for free).

If IBM wants the software, they can either build it or license it. Whining about it doesn’t change those options. The fact that the Internet provides an accessible software marketplace with plenty of code under a variety of licenses doesn’t change those options. You can either build it or license it. The references to Apache and GNU licenses in the original article are really just passive-aggressive FUD. If you find code you want, but you can’t agree to license terms with that code’s owners, then you either keep shopping for code you want to license or decide to build it yourself.

[*] I am aware that IBM does participate in the community. I’m responding specifically to Billy’s post, in which he assumes the role of a “commercial” entity himself, and says the GPL and LGPL are useless.

2007-01-03

Haskell Caching?

Filed under: haskell — Vineet @ 05:13

I started tinkering with Haskell a bit. In particular, I’m working through some of the Project Euler challenge problems. I’ve read some vague promises like “Haskell’s lazy evaluation gives you caching for free.” I’m still trying to figure out exactly what the scope of that is. For example, I’ve written some purely functional code:

factors n = factors' 2 n
  where
    factors' k n | k*k > n        = [1]
                 | n `mod` k == 0 = k : n `div` k : factors' (k+1) n
                 | otherwise      = factors' (k+1) n
d = sum . factors
pairs n = [x | x <- [1..n], d x /= n, d (d x) == n]

Same inputs gives the same outputs. (This is for problem 21, the amicable pairs.) But if I change this:

main = do
    print $ sum $ pairs 10000

to this:

main = do
    print $ pairs 10000
    print $ pairs 10000
    print $ sum $ pairs 10000

it takes 3 times as long to run, and it’s clear as I watch it print out each list as it computes it that it’s not caching these intermediate results anywhere, and is in fact recomputing them.

I have seen Haskell’s lazy computation of infinite streams and implicit caching associated there at work, and it’s cool. So maybe I need to take a different approach: say rather than defining d and pairs as functions here, I should instead be constructing them up as infinite lists instead.

OK, I tried it like this:

amicable =  filter (\n -> (d n /= n) &&  (d (d n) == n)) [1..]

main = do
	print $ takeWhile (<10000) amicable
	print $ takeWhile (<10000) amicable
	print $ sum $ takeWhile (<10000) amicable

And now it’s clearly not recomputing the amicable stream. So it’s caching, but I wouldn’t call it “for free”. Admittedly, adding in the cache was dead simple, but really it’s the equivalent of implementing memoization as in any language, so saying “Haskell ‘gives’ it to me” is a bit much.

Also, I’m just getting started with Haskell; I could just be doing something entirely wrong here. Maybe there is a way to have it cache function results in addition to this list memoization, or maybe it is caching but I need to tune my cache parameters to make it more useful.

2003-05-11

Sprint PCS Sucks

Filed under: Uncategorized — Vineet @ 04:23

For years, I was a content Sprint PCS customer. More than anything, I
liked my Motorola Startac. It’s a great phone with a great UI.
Unfortunately, the antenna design is bad, and it broke again. My old
phone is a few years old, so I thought I’d take a look at the newer
alternatives out there.

This was mistake number one. Today’s phones are so concerned with being
flashier than the rest that they’ve forgotten that they’re supposed to be
phones. If I wanted a game boy, I’d buy a game boy. I want a phone.

So I picked up a samsung phone (the N400, I think). Piece of crap! The
damned thing didn’t ring. It let you choose between two options of what
it would do with an incoming phone call. You could have it play “tones”
(music) or “ringers” (more music). Phones have been around a long time.
Have you ever been in anyone’s house where an incoming call turns the
stereo on? No, because people don’t want that. It’s stupid. So I
went back to the store and returned the piece of crap the same day, before
I ever activated it.

After this experience, I decided to stick with what I knew I could count
on. Motorola has continued making good phones, like the V60 and T720.
Unfortunately for Sprint, they don’t offer any new Motorola phones. So
off I went to the Verizon store. I’m now a very satisfied
Verizon customer.

The next step was to cancel my service with Sprint. Here’s where it gets
really bad. I called to cancel at around 11:30 pm local time (PDT). The
first guy I talked to said that because I’m such a “valued customer” my
account could only be closed by someone in the retention department.
Fine, transfer me there. So I wait. I wait. I wait 30 minutes on hold.
Then the same guy comes back on the line, informing me that the retention
department is closed. They just closed, at 2:00am central time. Midnight
my time. I waited on hold an extra 30 minutes (because I’m so valued),
and then they just closed and left me hanging. Bastards! So I have to
call back tomorrow.

First, I went to the Sprint PCS web site, found a link that said “email
us”, and composed a message indicating that I was pretty unhappy, and
that this was a really bad way to treat a “valued” customer.
Unfortunately, by “email”, they really mean “post a web form”. This form
posts to an URL that just hangs. My message could not be sent.

So next, I composed a real email message. I sent it to as many addresses
I could think of at sprint: support@sprintpcs.com, billing@sprintpcs.com,
claire@sprinpcs.com, webmaster@sprint.pcs.com, postmaster@sprintpcs.com,
ceo@sprintpcs.com. I gave them my story. I told them I’d called, been
placed on hold twice, then abandoned. I told them I tried to use their
stupid web form, which is broken. I also let them know I was originally
canceling because of my bad handset experience, but this bad service far
eclipsed any handset issues.

A few addresses bounced. Most said no such address. That’s fine; I had
made them up, and expected a few bounces. ceo@sprintpcs.com came back
with “mailbox full”. One address (I think it was support@sprintpcs.com)
succeeded. I got back an autoresponder message saying “please use our
stupid web form”.

I’d tried calling. I’d tried to “email” (post the stupid web form), and
I’d tried to send real email. Of the 3 communication channels I’d tried,
I was 0 for 3. This is a communications company?

I then just tried calling again just now (during their regular business
hours). They informed me that their system was unavailable due to
maintenance/upgrades. I take this as a lesson learned to never use
sprint anything for service availability.

So anyway, I’m still dealing with them. A month ago, I would have
happily recommended the service, but it’s a different story now. If
you’re already a sprint PCS customer, I can only advise you to be careful
to never become a “valued” customer, and to switch to another carrier as
soon as possible.

The only thing I can do at this point is fight to not be billed for this
last month of service, and do my best to ensure that nobody ever pays
them a penny ever again. If you’re thinking about signing up with
sprint, please don’t. Do me a favor by helping me pay them back for the
horrible service they gave me, and do yourself a favor by saving yourself
from ever being subjected to the same. I’m so interested in discouraging
people from giving sprint any money that I’ll even pay you to sign up for
Verizon instead. I think they offer a $10 credit for referrals. If you
were thinking about sprint and saw this page, and decide to use Verizon
instead, I’ll give you the whole referral credit ($10, or whatever it is;
it might be more). Contact me and we’ll work it
out. I can give you my Verizon number to get the referral credit and
I’ll paypal you the money as soon as it’s applied to my account.

Apparently, I’m not the only
one.

2003-02-21

Smoke and Mirrors

Filed under: security — Vineet @ 04:34

The other day I flew from Oakland to San Diego. It’s a pretty routine event, really, for me and hundreds of other intra-California commuters and travelers. Unfortunately, I had recently moved into a new apartment, and my printer still lay dormant in a box somewhere, under many other boxes. What does that have to do with anything? Well, The FAA has instituted new “security” measures dictating that only ticketed passengers will be allowed past the security checkpoint at the airport. I can think of only one time in history when I flew with an actual printed ticket — this is, after all, the 21st century. We have ticketless travel: just show your ID and board the plane. But now we have to present a printed itinerary showing that we are traveling
ticketless before being allowed past the checkpoint.

Here’s the point: because my printer was not yet hooked up, I had to stop at my office to print out my itinerary. This itinerary was emailed to me by southwest airlines. It’s a simple text document that says my name and a flight number. This document is trivial to forge. There’s nothing special about it. Any criminal or terrorist could create one at any time to get past the security checkpoint.

It’s a farce. The new rule adds zero security, while adding a large amount of inconvenience for legitimate travelers. They tell you to get to the airport 2 hours in advance, but your loved ones aren’t allowed to the gate to wait with you and see you off. As anyone can see, the name on the itinerary can easily be changed before printing. This is what’s being passed off on the American public as “added security.”

I’d go so far as to say that all of the new security measures were added with the primary focus being public perception rather than actual security. This can be seen in every new “security measure” added on each week. People get scared about shoe-bombs, so they institute random shoe-checks. People feel safe having boys in camouflage and assault rifles standing around. It doesn’t make me feel safe. It makes me feel sick. Every security measure I’ve looked at has turned out to be inconvenient for legitimate travelers but easily circumvented by potential attackers. This is just my amateur eye giving a cursory glance; imagine what the scrutiny of a criminal mastermind may reveal!

Create a free website or blog at WordPress.com.