|
Recent Entries...
Week 3, day 2 for push ups
I'm posting a bit more than a day or two per post, hoping I ...
Chin ups week 1 column 2, push ups week 3
August 6:
Push ups: 27 then 20 (wow these seem tougher than...
Exhausting chin ups, continuing with push ups
August 4:
I'm really glad I took the opportunity to rest ...
Logarithmic tag cloud
It's been a while since I've posted anything technical. Pos...
Weekend bike rides
August 2:
I got out on my bike today. I had to raise the s...
Still week 3 for push ups, finishing week 2 for chin ups
July 31st:
Push ups: 27 then 19 then 19 (the last 5 of whic...
Tough push ups, and easier chin ups? Oh, kettlebell, too!
July 29th: The push ups day I'm dreading. I'm feeling mostl...
Push ups exhaustion test, continuing on with the chin ups.
July 27th: Exhaustion Challenge, push ups. 31. Kind of dis...
Weekend Respite.... or is it?
So I ended up buying a kettlebell and getting back on my bik...
Gotta keep going - on with week 2
July 25:
Super tired today. Woke up very early, had a pedi...
|
|
weblog | `web·lôg -läg |
noun
Another term for BLOG
ORIGIN 1990s: from web in the sense [World Wide Web] and log in the sense [regular record of incidents.]
blog | bläg |
noun
A web site on which an individual or group of users produces an ongoing narrative.
ORIGIN a shortening of WEBLOG.
Gravatars. Good idea, but I apparently can't figure them out.
 Posted by
on Monday, September 10 2007, 12:09am
I just read an interesting (but apparently now controversial) idea in Micheal Schwern's use.perl journal about trying to put face to names on CPAN.
I think it's a great idea.
BTW, as I'm testing this out, I'll be adding my gravatar to all of my posts. And if you, dear reader, feel obligated to leave a comment, and have a gravatar setup for your email address, give it a try. Please note that I do take some care to obfuscate email addresses from address farmers, so you should feel a little better about that.
Unfortunately, I haven't waved my hands appropriately or chanted the magic incantation, so my gravatar is just showing up as a default logo :(
You'll notice as soon as it shows up, I'm sure :)
Update: So I guess I figured it out after all :)
HTML Test Reporting
 Posted by
on Saturday, September 08 2007, 1:30am
I wrote a few days ago about writing my own Test::Harness parser since I had been unable to install the module that does that, and does it well.
On my machine, Test::TAP::HTMLMatrix is beautifully installed - however where this module could do me the most good - as in having tests run all the time for me - I have historically had issues getting modules installed. At the very least, I need to identify all the various dependencies of every module and their dependencies in order for the SAs to search for .rpm files for ease in making the modules easily installable on every other production machine in the cluster. Which makes a certain amount of sense. As long as you don't remember that this test reporting module has no business on production anyhow.
But a brief perusal of the source for HTMLMatrix, and I'm starting to get the impression that having the SAs install it, plus all it's dependencies, plus all their dependencies, might be more hassle and take longer than I'd like.
Since I got my html harness pretty much working before trying to install HTML Matrix again, I might as well start using that at work to keep at-a-glace test results at a handy web page. Without all those dependencies.
So I did. And I copied all the tests over to our dev server. And I tweaked the hell out of them to make them actually run. More on that later.
The above picture is just a snippet of it to be able to fit into my blog, but you can see a fuller version here.
The code to create this is pretty simple. Here are the important bits of it:
#!/usr/bin/perl
use strict;
use warnings;
use Test::Harness::Straps;
my $strap = Test::Harness::Straps->new();
my $graph_width = 600;
my $filename_width = 150;
my $percent_width = 75;
print report_head();
my $cnt = 1;
my $tot = 0;
my $ok = 0;
for my $file( @ARGV ){
next unless -f $file;
$cnt++;
my $style = $cnt % 2 ? 'blue' : 'tan';
my $result = $strap->analyze_file( $file );
my( $this_tot, $this_ok )
= ( $result->seen, $result->ok );
$tot += $this_tot;
$ok += $this_ok;
my $graph
= return_graph( $this_tot, $this_ok );
my $percent
= int( $this_ok / $this_tot * 100 );
my $status = $percent < 100
? '<span style="color:red;">NOK</span>'
: 'OK';
my $perstyle = get_percent_style( $percent );
printf <<END_REPORT, $style, $file,
$file, $status, $graph, $perstyle, $percent;
<tr class="row">
<td class="%s">
<a href="%s">%s</a>
</td>
<td class="status">%s</td>
<td>
<table class="graph">
<tr>
%s
</tr>
</table>
</td>
<td class="%s ctr">%d\%</td>
</tr>
END_REPORT
}
print report_end();
sub return_graph {
my( $cnt, $run ) = @_;
my $width = int( $graph_width / $cnt );
my $leftover = $cnt - $run;
my $bad_cell
= qq{<td class="nok" style="width: }
. qq{${width}px"> </td>};
my $good_cell
= qq{<td class="ok" style="width: }
. qq{${width}px"> </td>};
my $cells = $good_cell x $run;
$cells .= $bad_cell x $leftover;
return $cells;
}
sub get_percent_style {
my $pct = shift;
return
$pct == 100 ? 'hundred'
: $pct >= 95 ? 'ninetyfive'
: $pct >= 90 ? 'ninety'
: $pct >= 80 ? 'eighty'
: $pct >= 70 ? 'seventy'
: $pct >= 60 ? 'sixty'
: $pct >= 50 ? 'fifty'
: $pct >= 40 ? 'forty'
: $pct >= 30 ? 'thirty'
: $pct >= 20 ? 'twenty'
: 'ten';
}
The missing report_header() and report_end() routines add the head, title, stylesheet, body tags, etc. to turn the meat of the output into a web page.
Btw, if you have 1) unresponsive SAs or 2) too much bureaucracy to get modules installed, and 3) have an improper Scalar::Util installation, and 4) need to use Test::MockObject (or some other module that 'optionally' uses Scalar::Util::weaken - and some Enterprise Linux Distributions ship a broken version of Scalar::Util) you can use this sneaky workaround:
BEGIN {
require Scalar::Util;
no warnings 'redefine';
*Scalar::Util::weaken = sub { return @_ };
*Scalar::Util::export_fail = sub { return };
}
Wikipedia Vandalism
 Posted by
on Friday, September 07 2007, 10:59am
Wikipedia vandals are awesome. I took a peek at the page for the iPod Touch (recently released by Apple Computer) and just happened to see that a vandal had added a new image in place of the fancy product shot that used to be there.
A few minutes later, it was gone.
However, I couldn't resist making a copy of the picture, posted here for your amusement. Be sure to check out a screen shot of the vandalized wikipedia page.
For more on wikipedia vandalism, check out their page on wikipedia vandalism, which hasn't (at the time of writing) been updated yet to include the iPod Touch vandal.
There are some more funny screenshots of wikipedia vandalism.
Perhaps my favorite is Stephen Colbert's repeated urges to continue vandalism.
Handy vim mapping
 Posted by
on Tuesday, September 04 2007, 11:12am
I'm going through a lot of legacy code lately, and got tired of manually opening up the first legacy file I documented (to make sure I was following the same standard I had implemented - it's not quite in my long term memory just yet), scrolling through the tedious documentation, copying (or retyping(!)) the text into the file I was working on, etc.
So, I decided to write a quick little mapping for that menial task.
First step is to create a template for the POD I want to insert:
~/podtemplate
And then this helpful mapping in my ~/.vimrc
noremap ,ap maG:r ~/podtemplate<cr>'a
Mnemonic: Add Pod.
... which is at least smart enough to set a mark at your current position, move to the end of the file, insert the contents of ~/podtemplate, and return to your saved position. Caveats: It's NOT smart enough to know if you've already set an 'a' mark, and it's NOT smart enough to NOT insert the template if there's already POD in the file.
CPAN annoyance
 Posted by
on Tuesday, August 28 2007, 10:56pm
Ok, to be fair - it's really not a problem I have with CPAN.
A month or so ago, I won a copy of Perl Testing: A Developer's Notebook as a 'door prize' at a Chicago Perl Mongers meeting. I devoured it within a few days, reading it during my daily commute.
Of special interest was the section on creating a test harness (or custom status report) for testing output by making use of Test::Harness::Straps . This was very cool because I had tried to get Test::TAP::HTMLMatrix to install on my Mac earlier this year only to be met with failing tests, or failing tests of dependencies. I don't recall, but I was really bummed. Figuring out the issue was beyond me at the time - I looked into it, but didn't have a ton of time, and I couldn't quickly see the issue.
Anyhow, today I had a bit a inspiration to make use of the example code from the book and see if I couldn't use it to produce some fancy HTML output of my own to give an at-a-glance status of tests I had run, similar in nature to the cool Pugs Smoke Reports . So, I whipped open my copy of Perl Testing , typed in the example code, ran it against some tests I had recently written at work, fixed the bits that were broken (by consulting the documentation for Test::Harness::Results )... run, view, tweak, repeat ad nauseum.
I finally got something fairly close to approximating those cool Pugs reports. But there were some big differences - which I couldn't figure out how to implement quickly (after all - the rest of the development of this parser was really quick and easy) - and I was running short on supplemental time. I actually thought it might be beneficial to take another look at HTMLMatrix and see if I could tweak that a bit.
I took a look in my .cpan cache directory, but it wasn't still there. So I fire up my CPAN shell and try to install it (knowing full well it will fail, but my fingers are trained to type install MODULE).
And before I know it, it's successfully installed.
Related Photos:
perl
cpan
modules
Claiming my blog
 Posted by
on Tuesday, August 28 2007, 10:32pm
Just a quick post claiming my blog by posting a link to my Technorati Profile.
Please drive through.
Perlbuzz.com launches
 Posted by
on Tuesday, August 21 2007, 11:33pm
Have you heard?
I just heard that perlbuzz.com just launched. From the announcement:
“ Introducing a new Perl news site with a difference. Via three blogs, Perlbuzz.com brings you the best of the world of Perl. Perl Buzz reports on the interesting software, websites and users of Perl. Project Hum tracks what's happening in projects around the net. CPAN Watch keeps an eye on CPAN uploads and reports on what's worth your notice. ”
I just hope Andy remembers that he said he'd post up something about my perl testing vim plugin :-)
Related Photos:
perl
buzz
site
launch
I'm kind of a big deal.
 Posted by
on Monday, August 13 2007, 1:05am
I don't know how to put this, but I'm kind of a big deal. People know me. I'm very important. I have many O'Reilly books, and my house smells of computers.
Every once in a while, you just have to google yourself. I tend to do it while I'm alone - but sometimes I do it at work. I just finished googling myself a few minutes ago, and was happy to find that I am 10 out of the first 10 google hits for "kent cowgill" (without the quotes, even).
Even better, I am 39 of the first 50 google hits.
The other three Kent Cowgill's've got nothin' on me, even though one's a marginally popular medievalist author, one doesn't even have Kent as his first name and has written (or reviewed, it's not clear) a journal article or two, and the last is (or has been) apparently an english professor at WSU.
Don't be fooled, though. Even though meetup.com makes it look I'm from Lombard, I'm not. (I'm still in Chicago).
I also didn't attend the Chicago Hackathon in 11-06. I wanted to, but I was out of town that weekend :(
If any CPAN links show up, make sure you're looking at the most recent version of a module.
That's really my wishlist on page two. Feel free to get my anythingon that list. Or an iPhone. It's not on the list, but I won't mind if you go "off-list" for that.
I do have helpful advice about out-of-towners sharing cabs from O'Hare to one location, specifically when a bunch of perl geeks converge on Chicago for YAPC::NA::2006.
I was linked to from Sun's BigAdmin portal for my article about chrooting sftp on Solaris 8. I was really proud about that. Even though at this point it's completely out of date. UNLESS you happen to be nursing along an old Solaris 8 box.
I'm starting to give talks at my local perl mongers meetings. I'll probably post more of those types of things.
That's me at UniForm Chicago. My first meeting I'm presenting at, too.
I gave a lightning talk a year or so ago golfing perl, and David Romano wants to see it sometime. Now anyone can.
I helped Andy Lester a little with perl101.com. Just a little CSS if I recall correctly.
I also helped Andy with the name for his wiki, xoa. I just threw out a name or two, and one of 'em stuck.
I registered at the TWiki dev site. And gave some helful advice. And promptly lost all interest, as I no longer has a job requiring me to admin and/or work heavily with TWiki.
It appears Marcus Ramberg linked to my blog (this one!) on del.icio.us. A nod always feels nice from one of the core developers of the framework this very blog runs on.
I participated in a Catalyst BOF, and a Hackathon after YAPC::NA::2007 in Houston. I didn't do much other than help a lot with logistics - arriving early, procuring the room, finding network connectivity, hooking it up, figuring out why it didn't work, helping to rig up an intermediary solution... etc.. Did a little QA work with Marcus Ramberg and Jon Rockway on the mojomojo project - a catalyst based wiki.
I sought help trying to run linux on a handhelp ipaq (which I apparently posted shortly after I came back from my bike ride - having raised $7,080 for a worthy cause, and a heck of a physical challenge - hit the ride tag to the right for more info on that).
And the rest of the hits for kent cowgill either point to this blog, or variations on the themes above.
I recall the good old days (more like a year ago) where the primary things google turned up were 10-12 year old emails I sent to a MacPerl mailing list for a job many moons ago, about topics that frankly at this point, are a little embarrassing :)
Code contributed to the world
 Posted by
on Wednesday, August 08 2007, 6:01pm
So I've decided to spread my testing goodness throughout the world.
It started with a vim plugin to quickly go through some perl source and create stub test files for a given source code file.
Then I got the bright idea to create a perl module to do the same thing. Partially helped by a suggestion from Jon Rockway after a quick lightning talk about my plugin.
Available for your enjoyment is the original vim plugin as well as the perl module it evolved into, the current version of which is located in my CPAN directory
Hopefully these are of some use or helpfulness to someone. Possibly even you. :)
Related Photos:
perl
vim
cpan
Lessons Learned in Home Ownership
 Posted by
on Monday, July 30 2007, 10:06am
I just had the opportunity to learn two very important lessons in the ownership of an older home.
- No matter how well you think you know how a circuit is laid out, you're almost certainly wrong.
- So long as you have decent balance, getting zapped with house current at the top of a ladder won't actually kill you.
In retrospect, thinking that the entire garage's power was switched off with the solitary switch by the door was completely ridiculous. How else would the garage door opener work?
Naturally, the corollary is:
* Always locate and shut off a circuit before manhandling the wires connected to it.
|
|