All this talk about job application/interview tips has reminded me of my favorite personal interview horror story.
I was invited to a telephone interview for a job with Yahoo in California. I wasn't really interested in moving to CA but I figured what the heck. How could I say no to Yahoo, right?
The programming part of the job turned out to be mostly in PHP which I didn't realize at first. I don't really have a good opinion of PHP but my experience with it has been limited and based on free internet code, not enterprise systems.
So, when prompted if I had any questions, I tried to say that I was curious about how Yahoo has used PHP in a positive, efficient way and what aspects of the language they feel makes it best suited for their environment. I guess what I actually said sounded to the interviewer more like "PHP sux and you are stupid for using it."
Unfortunately, I didn't get much of a response and needless to say, I didn't get the job (or even a free trip to CA).
Every beginner programmer (of C-style languages) has to learn to deal with '=' (assignment) vs. '==' (comparison). Using = in an if clause is probably one of the most common early mistakes.
I'd like to think that I'm past that stage of my programming experience. However, about once a year I'll waste a couple of hours debugging to eventually notice the missing =.
I was working on some Javascript today and I had the feeling something was wrong with that if but my brain kept telling me to change the = to eq. Must be the jet lag from Ireland. Yeah, the jet lag. That's it, that's the ticket.
Is it just me or has use.perl.org been real flaky lately? Seems like the connection times out about half the time.
Tuesday night dfw-pm is having a technical meeting hosted at NerdBooks in Richardson. I am planning to take advantage of the opportunity to pick up a copy of Perl Testing. I have also been trying to decide if I need a copy of PBP. I currently have the misfortune of working on a SOAP project which I am having trouble wrapping my brain around so perhaps I should go ahead and get Programming Web Services with Perl (does it have much that is not free online?).
Any other recommendations for must-have Perl books, particularly those recently published? I already have Perl Hacks. Shameless plugs and non-Perl books also allowed.
There Is More Than One Way To Do It - Not All Of Them Are Good.
Some legacy code that I am working on, frequently uses this "interesting" idiom for getting the first element of an array.
my @array = some_function();
my $i = 0;
foreach my $hash (@array) {
$i++;
$var = $hash->{somekey};
last;
}
I am particularly puzzled by the unused $i.
In my daily programming, I frequently search the perldocs from the Firefox search box (even though a Perl Pocket Reference sits on my desk). When you start typing a search query for Google you get suggestions on what you might be typing. This is often useful and occasionally amusing.
Wouldn't it be nice if you could get suggestions when searching perldoc too? It turns out to be pretty easy to setup. To get started, I took the functions list and pushed it into an SQLite db. Then wrote a short script to output the required JSON.
You can install the end result from Mycroft. I'm not sure it is particularly helpful but it was an interesting little diversion.
I was trying to fix some code today that was attempting to do delayed string interpolation. Something like:
$str = 'Foo: $foo'; # Actually defined in a config file.
$foo = 'bar'; #...later
print eval("\$str"), "\n";
Except that just gives you:
Foo: $foo
My first thought was to check the FAQ but then, no, I think I've seen something like this in the eval doc. No, that's not helpful. Oops, gotta catch the bus...
Then I figure I'd take a shot at it before bed. I give Google a try but the closest hits are on Ruby. After an a-ha moment I came up with this:
print eval(qq{"$str"}), "\n";
Which works. But then as I start writing this post, I figure I'd better check the FAQ before I sound like an idiot. Yes, it is in the FAQ although my solution seems much simpler. Am I overlooking any problems with my solution?
Here's what the FAQ suggests:
eval { $text =~ s/(\$\w+)/$1/eeg };
die if $@;
I've been experimenting with Plagger for creating a personal planet sort of thing. It works pretty well. It seems very flexible but it is hard to figure out how to really take advantage of all the options and "plugability". For example, I wanted to change the title of some of the individual feeds. Eventually I figured out that if you use the explicit method of defining a feed, rather than the typical url only shortcut, you can specify the title. Like this:
- url: http://rss.whatever...
title: This is a title
I'm also finding that even though lots of sites give you feeds, they are not always very good. Netflix gives you feeds of the DVDs you are watching but rather than giving you a pubdate tag, they put the date in the description. Now I'll have to see if I can use Plagger to fix it.
I just signed up on Vox.com to use for a personal blog. I picked Vox because my impression was that it is MySpace done right. Six Apart+Danga have been around for a while, they know what they are doing. Plus they like Perl (and some Perl folks seem to like them).
So, after I sign up, I get a welcome email with my password, the one that I entered (not a random system generated thing), right there in the plain text of the email. WTF?
Ok, so it is just a blog, not a bank or something but sheesh! Mailman does the same thing but at least it warns you about it.
Am I overreacting or should I look elsewhere for my personal blogging needs?
Update: I also used tried the "forgot password" function and it again emailed my password in plain text. This means that they are either storing the passwords with two-way encryption (unlikely) or simply plain text. This is bad on top of bad. Storing passwords as a salted hash is not hard and pretty much standard best-practice security!