Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Purdy (2383)

Purdy
  jasonNO@SPAMpurdy.info
http://purdy.info/
AOL IM: EmeraldWarp (Add Buddy, Send Message)
Yahoo! ID: jpurdy2 (Add User, Send Message)

Bleh - not feeling creative right now. You can check me out on PerlMonks [perlmonks.org].

Journal of Purdy (2383)

Saturday December 18, 2004
09:56 PM

Pictures from London

Enjoy. :)

Peace,

Jason

09:01 AM

JavaScripting

I know some people just don't like JavaScript, but have you seen Chris Justus' recent dissection (also /.'d)of Google's Suggest application?

Even cooler, someone built one around CPAN!

Peace,

Jason

Monday December 13, 2004
09:31 PM

LPW Recap

Long entry here - I wrote this up on the plane ride back ... you've been warned.

7 hours of sleep does do wonders, though I probably shouldn't have gone to bed around 9pm, as my body woke up at 4am and wouldn't go back to sleep. There's really not much to do at 4am, let me tell you! So I flip and flop back & forth, try throwing in earplugs, etc. All to no avail. So around 5am, I give up, wake up, get ready and read and surf the TV channels.

The burst of sleep has helped my attitude – I have decided to not worry about the money and diet parts of this trip, though I won't be doing any Christmas shopping.

I met up with cog in the hotel at 8:30am and we eat breakfast and then walked over to LPW (which was a brisk 30 min. walk – oh well, that should help burn off those carbs I've been downing). Coincidentally, that morning, I saw on the front page an article that Britons are ignoring government warnings on eating healthy, with increased sales of cakes, chocolate, beer and wine, etc. As I mentioned in my previous post, I've found it impossible to stay on my diet over here, so I've just given up. Now I'm not saying that a low-carb diet is THE way to go, but the typical food around here is very unhealthy, with the high-fat AND high-sugar. I almost fell in shock when I saw my first “sugar-free” candy in the tube.

Ok, so back to LPW. Overall, I was very impressed with the workshop. I attended the Learning Perl talks and they were timed at 30 minutes apiece (with some presenters opting for even less time), which made for a good compression rate, as any longer and my attention wanes or my head gets full of the material and cannot handle any more. Another nice feature of the talks was that they started with the basics and built up to more complex matters and upon previous talks.

The first talk (an Introduction by Dave Green) was kind of a keynote, which was pretty funny, which is saying a lot from me, as I find it very hard to laugh that early in the morning. He gave some great Perl cameos in the mainstream media as well as breaking out into some Karaoke, with a homespun song, “Tainted Perl.” Great start!

The next talk was “Perl Gimmes” by Greg McCarroll, which was half-tutorial and half-rant. The one thing I learned from that talk was the difference between || and or, though that was because I was sitting next to cog and he helped me understand it. Basically, Greg mentioned that these two perl lines were different:

open FILE, $filename || die “Cannot open $filename: $!\n”;
open FILE, $filename or die “Cannot open $filename: $!\n”;

I didn't get it.. I didn't see the difference. Thanks to cog, he pointed out that it's a precedense thing, where the difference is like this:

open FILE, ($filename || die “Cannot open $filename: $!\n”);
( open FILE, $filename ) or ( die “Cannot open $filename: $!\n” );

So if $filename is true, you'll never get the die to evaluate, regardless if the open failed. So that's cool to know, but I've never had that bite me because I've always used the format:

open ( FILE, “$filename” ) || die “Cannot open $filename: $!\n”;

That's just my coding style and come to find out, it's helped prevent this from worrying about this.

Greg also highlighted the Log::Log4Perl module, which seems pretty interesting. He said it's a standardized way to do logging on your applications, which I could definitely use. I don't know how many times I've either written my own or used DBI's trace as a log.

The reason I mentioned that his talk was half-rant was that he ranted on “Don't Ask to Ask a Question”

The next talk was “Perl coding best practices” by Mark Fowler and the best thing I learned about this is to not be scared of die(), especially when you're coding in what will be a nested object, because the code that uses it can do an eval and then use $@, like so:

eval {
    $my_object->dicey_function( $dicey_data );
};
if ( $@ ) {
    # there was some problem
}

So now in my deeply-nested object, I can put die's all over the place and $@ will contain the message that you passed on to die, so you can do custom error handling.

Next up was “Sorting out sort” by Lance Hoffman, which was a cute little presentation, even involving audience participation. The main thing I learned from that talk was that when you write your own sort method and Perl gives you $a and $b, your custom method needs to return -1 if $a is less than $b, 0 if they're equal or +1 if $a is greater than $b. I never really understood that, as all my custom sort methods are either an override of the standard lexigraphical sort to a numerical sort and then flipping $a and $b if I wanted the reverse. Another important point I learned is that you don't want a lot of time-intensive logic in your custom sort method because it will be called quite a few times in the process of sorting an array. Something like N*log(N), which for an 8-element array can be called 33 times!

Marty Pauley gave the next talk on “Testing basics. Introducing Test::Simple and Test::More”, which was a challenging talk, as I KNOW I should be writing tests before writing the code, but I don't. So this was yet another reminder that I need to get my act together. ;) Marty was very entertaining (what is it with the British and their quick humorous wit? Must be the Monty Python...), too. Test::Harness comes with the prove command, which can be useful for non-module code. Test::More also extends Test::Simple with more functionality (ok, is, isnt, is_deeply, cmp_ok, etc) all while offering compatibility with the Test::Simple API.

Next up was Dave Cross with “Writing objects in Perl”, which I'm sure was a challenging talk to give in 30 minutes! Dave did an admirable job and it really dawned to me what objects really are in Perl. They're simply a declaration (package ...), a constructor (which initializes the internal hash {or other data structure}) and support methods. The only complaint I have w/ the talk is that he didn't go into the export aspects, which is where I am currently in my learning with objects, though I'm sure that was more of a constraint issue with the amount of time that Dave had (or didn't have, rather). No worries, though ... one late-night session with cog cleared that up.

The next class was John McNamara's presentation on “Spreadsheet::WriteExcel”, which is a module I will be looking into real soon. It provides an API to write out data in the Excel binary format. There's even a complementary Spreadsheet::ParseExcel, which could be used to open an uploaded Excel spreadsheet, for example.

After lunch, classes resumed with Tom Hukins talking on Class::DBI. This was one of the main reasons I wanted to come to the conference, because that's the next evolutionary step for me. I was disappointed that Tom spent time on background and DBI itself, but some of the circular concepts he covered did bring up some other modules that I should take a look at, including Ima::DBI, which can be useful for separating the SQL code from the Perl code, and Template::Plugin::Class (actually, I don't remember why I wrote that down now, but I'm going to check it out later).

Leo Lapworth gave the next talk on “Pages, results and caching”, which highlighted the Data::Page and Data::PageSet modules. After going over those, he did get a little more complicated with caching, so it was hard for me to understand, but one thing that came to comprehension is that disk caching is faster than database accesses. After the conference, in a talk with cog & his friend Peter, they also talked about how you could cache into memory to get even faster. Who cares if the data is lost when it could be rebuilt? So this could also have ramifications into how I build our Web applications, so that's pretty neat.

The next talk was on MVC and building Web Apps rapidly, by Ben Evans. Ben talked about separating the code into MVC layers, something I'm very familiar with already, with extensive experience with CGI::Application. It looked like cgiapp, smelled like cgiapp, but Ben actually handrolls his own architecture for every application. I asked him afterwards why and he said it was because he couldn't guarantee that CGI::Application could be installed on the servers he works with.

Barbie gave the next talk on CPAN testing, talking about the Phalanx project and how the CPAN testing service works. The main emphasis is to prompt the module authors to strive for a greater common demoninator and increase the quality of their code and packaging. I know it has helped me with my modules, as I would get messages, letting me know that my package was missing a file. The only gripe I have is that I cannot perform similar testing on my own box (or maybe I can & I just didn't know about 'make disttest' at the time). Someone asked Barbie that and he confirmed that we couldn't do our own testing, but testers are out there (including him) that would be more than happy to run a preliminary test before your module release. Maybe I didn't understand the question/answer, though, as cog & I talked about how it could have been the other platform testing that they were talking about.

After that, David Cantrell gave a talk on API standardization, but it was more like a full-blown rant, as David is tired of running into modules that have different API's to do the same thing, such as getting a string format out of a Class. In his research, he said he's seen string, to_string, tostring, toString, ToString and I think he even said 2string. I feel his pain, as I run into this myself, but it's hard to enforce that kind of thing and David didn't really offer any suggestions, but at least he brought it up and hopefully with that awareness, authors will pay more attention to that.

I bailed on the next talk, because I don't want to learn Python, so I went upstairs to listen to the advanced talk on “Dark Perl” by Simon Wistow, which was kind of disappointing, but I doubt I could actually understand it anyway, even if he had covered the subject matter (it was supposed to cover a lot of stuff like AUTOLOAD, XS, Perl guts, tie-ing and reversible computing) and been able to wrestle an old PowerBook (it was so old, it was black!) into working. Once everything was smoothed out, he talked about the 'whatif' module, which seems really cool and yet Evil at the same time. Basically, it's a module that you can use and then write a block like:

whatif {
    try_some_dicey_stuff();
    # We Succeeded!
}

Actually, I'm not sure if that's right or not, it's so beyond me. As it was explained, you set a point somewhere in your code and then later, if something fails, it will return back to your marker as if nothing happened in the first place. Scary, huh? Brilliant work, though.

So that wrapped up the conference and everyone dispersed to the bar downstairs. I was running short on currency, so I left to go find a cashpoints. Little did I know that it would be so far away, near the South Kensington tube stop! So I went back and then cog and his friend, Peter and I trapsed off to go find an Italian restaurant I heard about, La Famiglia. It took us about an hour to get there, with a bad tube run to start with and then the distance it was from the tube destination. By the time we got there, we found out they were booked and we didn't have a reservation, so it was all for naught. We ended up eating at a Thai restaurant next door, which wasn't all that good, but it was neat to introduce people to Thai food (and a good drink, Thai Iced Tea). After that, we caught a cab back to our hotel and talked Perl for a while longer.

The great thing about this conference, as well as attending any conference in general is that they help guide your next steps in evolution. There's a lot to be said for reading documentation, newsgroups, mailing lists, Perlmonks, etc, but it's a completely different thing to interface with fellow Perl hackers face-to-face to ask questions and get advice. The organizers promised the slides would be available shortly. I also noticed a video crew recording the talks and the organizers promised video availability sometime early next year.

You know, the one thing I would love to know is how some of those presentations are put together, technically. I mean, skipping over the obvious PowerPoint and Keynote presentations. There were a couple of them that were nice-looking and used within a Web browser (John McNamara's Excel presentation, as an example). I asked cog what he used and it was a PDF that came out of LateX, so there's one datapoint.

Peace,

Jason

Friday December 10, 2004
04:27 PM

LPW: Day -1 ... or Day 0 ... whatever.

Actually, I should disclaim that this whole post is being done before I've had a chance to get some good sleep, so it may be punchy. Also, I'm a fish out of water here, too. That's my disclaimer.

Hmm - I'm not sure where to start ... so let's start w/ the flight over, shall we? No wait ... let's again re-emphasize how £1 = $2 (or close enough)! So this has tainted all of my expenditures... which I guess I shouldn't be TOO concerned, as this is a business trip and most of it will be reimbursed, but it's still annoying to spend so much money for meals. As an example, I ducked into a small cafe for a tea (.79p) and on a whim, I added a muffin and that brought the total to over £3. So $6 for a muffin and tea!

Ok, so now the flight over. It's been a while since I've been on an international flight, but the last time I did, they gave free alcohol. I was looking forward to this, to burn the edge off and help me sleep, but no ... AA now charges $5 per drink. Also, AA has introduced these neat lil' mini-TV's per seat (flying Coach here, people). So that's a neat gadget and I soon get hooked into a predictable, sappy romantic comedy (which upon reflection wasn't really much on both counts): "Win a Date w/ Ted Hamilton". No, please ... don't hurt me... I couldn't help myself!

Anyway, the flight was sparesly populated, with seat configurations of 2-5-2 (Boeing 777), so there were quite a few empty center aisles. The flight ran overnight (left RDU at 7pm local and arrived at London at 7am local), so there was a great opportunity to grab an center aisle and stretch out. So what did I do? I get hooked into this movie and forfeit sleep. ARGGGGG!!! Darn you, Hollywood!

Ok, so I arrive and get to my hotel ... no wait ... let me also share w/ you that I forgot my train vouchers, so I have to re-buy tickets. And I get suckered into re-buying Gatwick Express tickets! I hope I can cancel those vouchers or something.

Ok, so now I go to the BBC Good Food Show, which I paid £11.50 for, which is a lot, but I'm anxious to see some good food & what-not. What does the £11.50 get you? Well, entrance and a free magazine. Oh, then you can buy a show guide for £5 (what? that doesn't come w/ the ticket?) Then when I get inside, there are some good things, but there's also a slew of vendors hawking their wares upon you ... including a credit card company (what does that have to do w/ food?!).

Then for lunch, I crossed town over to Jamie Oliver's Fifteen restaurant, which was an awesome experience. It's a little hard to find, tucked away in a side street, but definitely worth it.

Another bad thing about this trip is that I've had to break my diet. I was down to 211.5 (that's 38.5 pounds!), but everything here, including the plane fare, seems to be high-carb. I hope all the walking I'm doing is helping to burn off some of this stuff.

After lunch, I came back to the hotel and was able to check into my room, which is your typical London hotel room (that you don't pay a lot for), where the bed & room is much smaller than you're used to (from an American perspective). I took a shower & crashed on the bed, out cold until cog called me. Then we met and then met up w/ some of the other LPW folks and ate dinner at a nearby pizzeria (Zizzi).

Ok, I'm going to sleep now. Tomorrow will be a new day and I should be better caught-up w/ the whole timezone thing. That is, unless there's something on the telly! ;) No, no ... I promise ... straight to bed! I could go on & on, on the Fifteen restaurant review ... maybe a separate post.

Cheers & Peace,

Jason

Thursday December 09, 2004
08:55 AM

$2 ?!?!

This story isn't a good way to start a trip. Guess I won't be doing as much Christmas shopping as I thought I would.

Peace,

Jason

Wednesday December 08, 2004
04:52 PM

Busy busy...

I think I'm getting the hang of this CPAN thing! Unfortunately, Mark Stosberg threw me a curve by introducing me to Module::Build, so now I'm wondering what's the best way to build CPAN modules ... the Makefile.PL way or the Build.PL way? Guess I need to buy Writing Perl Modules for CPAN.

Anyway, I have released two new-from-scratch modules:

I'm also starting to prepare for my trip. I hope I can find my power adapter. I'm not sure what to pack for the weather (besides rain ;)) - my expat friend says now's an arctic time, but weather.com says it'll be around 50. Must be that global warming... ;)

Peace,

Jason

Monday December 06, 2004
09:56 AM

AmIFraudOrNot?

I'm trying to sell my car (shameless plug) and this suspicious e-mail comes through:

Hello, I am Mark Greene,sales manager for Businessdays consulting International England.We specialize in purchase of cars for our customers here in Europe and across the globle.please get back to me if your car is still available for sale.

This immediately raises my fraud alert, so I play this really close:

Me: It is still for sale.

"Mark": Jason Purdy, How are you? I just got your mail and i really appreciate your urgent response, please indicate your best price for the car and also give me a comprehensive detail about the present condition of the car.As soon as this is done we will arrange for the payment and pick up.please,don't fail to indicate the price of the car and hoping to hear from you soon.

Me: The best price & details are already on the AutoTrader Ad... what more do you need?

"Mark": Jason Purdy, What is your last asking price of your car.

Me: $15,400

"Mark": Jason Purdy, How are you doing?My client was much impressed and he hopes that the car is serviced and well kept too.He can't wait to see the car.However,my client made out a cashier's check of($23,000)before he travelled to japan on a business trip,for a previous car and its shipment charges etc,but it was unfortunately sold.The amount on the check he deposited for the car is bigger than what should be paid to you now,so the check is now meant for the total expenses which includes the purchase of your car,the pick up of the car from its present location and the shipping charges/other necessary shipping arrangements.However he has instructed us to carry on with this transaction. So you're required to deduct the cost of your car($15,400)and send the balance of ($7,600) to my client via money Gram transfer to enable him offsett shippingcharges/arrangements.once the transaction is concluded.My agent will be coming for the pick up of the car from its present location,on an open vehicle and then drive to a pre paid shipper for shipment while title papers and other necessary documets will be handed to the agent at the time of pick up. ATTENTION: MY CLIENT INSTRUCTED THAT THE PICKUP AGENT WILL BE COMING OVER TO YOUR AREA OF LOCATION WITH SOMEONE WHO IS GOING TO CHECK THE RECENT CONDITIONS OF THE CAR ON HIS BEHALF.THAT YOU ARE TO HELP THEM WHEN THEY ARRIVE.... Please Confirm this and provide name,address and phone number for check payment to be delivered to you via courier mail. Have a nice day.

Me: I am not proceeding with this type of transaction. This is a popular form of fraud. If you want to buy the car, you will need to send a US Money Order for the exact amount of the sale. http://www.minnesotacars.com/fraudalert/20040901a.cfm

Peace,

Jason

Update: vsergu nailed it. Gotta love these advance-fee fraud scams.

Wednesday November 10, 2004
12:20 PM

DNS Tool

I just noticed that Network Solutions, in a partnership bid w/ SnapNames has released a list of about-to-be-expired domain names.

So I downloaded the file, imported it into MySQL and whipped up a quickie search tool:

Purdy's Domain Name Search

Please be gentle - I'm not terribly confident that the code is secure (and I know that there's not enough error-checking). Feel free to comment on it here.

Some interesting results -- 29 words with .COM at the end are about to expire, including together.com and cot.com.

Anyway, enjoy and please let me know if my code is insecure and don't go stress testing it. ;)

Peace,

Jason

Wednesday November 03, 2004
02:14 PM

LPW, Diet, ApacheCon and Upcoming Published Review

First, let's start off with some really great news: my boss approved my trip to LPW and I've already booked my flight & hotel. I'm really looking forward to the talks, though it's humbling that with my experience, I'm more suited for the "Learning Perl" track. Oh well, I'll get over it, learn a lot and I'm sure a pint or two will quickly make me forget all about that.

Speaking of which, I've been off beer as part of the South Beach Diet, opting for wine instead. I guess it's been close to 3 months now and I've lost 28 pounds. My goal is 40-50 pounds, but I may have to take a diet-hiatus come LPW-time, given the exquisite beer selections in London. More on the diet - I had a physical a few weeks ago and my bloodwork came back last week and my doctor called me and said it was flagged b/c my cholesterol was too low! Nothing to be concerned about, really (the body will make the necessary cholesterol to survive), but 97 total cholesterol. My "good" cholesterol is less than it should be, too (37 vs. >=40), so the doc recommended exercise (*grumble* - I'm much too lazy for that) and red wine (oh, ok ... I can handle that).

In ApacheCon news, I've had to cancel my tutorial. There were still only 2 registrants, the conference was (rightfully) backing down from their obligations and I didn't want to end up paying to present the material. Ever since the initial warning, I was also slack in preparing my presentation, so with less than two weeks to go, I'm not crazy about bum-rushing the presentation together (in addition to paying to present). I'm disappointed that I couldn't attract more registrants. I'm wondering if the conference as a whole is down this year, especially with some folks not liking the venue (Vegas).

I could ramble on about some politics and the recent election, but I'll save that for another entry (soon to come, I'm sure).

Tomorrow, my review of ActiveState Komodo 3.0 will be published on perl.com (or so chromatic tells me). I'm excited to have something written published, even moreso with O'Reilly - Stay tuned!

Peace,

Jason

Red Wine Recommendations:

  • Bogle Zinfandel
  • Big House Red
  • There's also a really great French one, but I don't have the label handy. I'll update this journal entry w/ the label after I go pick up some more.

Update: Review is now online

Friday October 29, 2004
10:51 AM

Sweet! LPW Talks Announced

Just got an email that the London Perl Workshop is now accepting registrations and they've announced the talks. The workshop itself is free, too (though prepare for vendors at 12 o'clock! ;)).

I just completed all my paperwork on my end at work, so if my boss can stomach the $825 and two days off work, I'm so there! ;)

Peace,

Jason