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 ]

boo_radley (2349)

boo_radley
  (email not shown publicly)

Journal of boo_radley (2349)

Monday February 11, 2002
04:46 PM

UML Update

I've had some people email me & ask me on perlmonks about the UML to code program I mentioned at the start of my journal. Firstly, if you work in languages other than perl, you might like dia2code, which handles Ada, C, C++, Java, PHP, Python,and SQL code creation. If you'd like to be somewhat mischevious, and use an existing perl or c++ file to create a UML diagram, autodia may be to your liking. (thanks, Briac!)

My own efforts will be available soon.

07:33 AM

bookstore adventures, continued

The real reason why I was posting about the bookstore was that I found this OSS listing in convenient dead tree version, for free. I picked it up along with my other purchases, planning to punch a hole in the corner so I could dangle it outside my cube with a little sign reading "Free Thought Leadership!" so as to interest the management in free/ open software.

This apparently counted as 'purchasing' an O'Reilly book, and I got a free t-shirt.

It's a burgandy shirt ( comment from my wife :"oh, good. another geeky burgandy shirt. I'll be sure to fold it next to the perlmonks shirt so they can talk with each other") and has the Java tiger on it...

07:19 AM

bookstore adventures

I found a copy of PTerry's The Carpet People while in Borders Books last night. This may not seem much of find to some of you, but finding this in the US has been pretty hard.

Whenever I find imported books of his, they're always slightly warped, and the pages have been gently abused along the edges as if someone had applied a cheese grater to portions of them. I know in my mind that these are probably just books that got abused in stores and couldn't be sold (in the UK, anyway), but I like to think the damage they suffered was sustained in transit to America via Valiant Book Smugglers, seeking to bring the works of Terry Pratchett to the unenlightened.

In other Terry Pratchett news, I found this quote in Strata :

"I'm proud to be human. Make no mistake! As for the other," he said, turning, "just because you're paranoid doesn't mean They aren't out to get you."

This book was written in 1981, which makes this the earliest version of the quote I know of -- is this a real live pterryism?

Monday February 04, 2002
11:47 AM

When XML::Twig Attacks !

While plowing my way through Damian Conway's Object Oriented Perl, I read something to the effect that, yes, you can type variables. so rather than

my $foo = Bar::Baz->new();

a script can define
my Bar::Baz $foo = Bar::Baz->new();
and $foo's methods will get checked at compile time, rather than run time, shaving precious time off script execution. Intrigued, I decided to benchmark. I couldn't think of anything that I was using that didn't make :

use Benchmark;
use XML::Twig;
$count=50000;
Benchmark::cmpthese($count, {
'typed' => sub {
my XML::Twig $twig=XML::Twig->new();
#$twig->parsefile( 'c:\test.xml');
},
'untyped' => sub {
my $twig=XML::Twig->new();
#$twig->parsefile( 'c:\test.xml');
},
});


This brought my memory usage to a little over 800 meg after the benchmark was done. The lesson being "When a module says 'be sure to call dispose after you're done with an object', you do it!". Although, after I corrected the benchmark subs, I still wound up short 20 MB or so after all was said and done. Very mysterious.

Oh, the results?

Benchmark: timing 50000 iterations of typed, untyped...
typed: 19 wallclock secs (17.56 usr + 0.00 sys = 17.56 CPU) @ 2847.06/s (n=50000)
untyped: 20 wallclock secs (19.12 usr + 0.00 sys = 19.12 CPU) @ 2614.38/s (n=50000)
Rate untyped typed
untyped 2614/s -- -8%
typed 2847/s 9% --


I think I need to work up a larger test case.
Saturday February 02, 2002
09:40 PM

It's....

a zen experience...
Every time I think I've seen everything I need to in perl's documentation, I realize I'm delusional. I spent a good 2 hours fruitlessly debugging a module. After that, I gave up, and started rifling through perldoc... and found documentation that I'd not only seen, but everyone I'd asked about hadn't used or heard of.

I feel like I've approached a zen teacher with a particularly stumping question, which is answered out of hand, using concepts and ideas I've never heard discussed. When I ask "Why haven't you taught any of this to me?", the answer is "you've never bothered to ask".
Wednesday January 30, 2002
09:21 AM

Withdrawl

All work and no perlmonks makes boo go crazy.
Tuesday January 29, 2002
10:18 AM

object oriented perl and UML

I've been thinking a lot about OOP in perl; this may be due to some excellent Java training I've taken recently, or just as a side effect of some of the apocalypse entries.

Part of my explorations of the subject brought me to UML, and although it's more used in Java communities, I think it has a role to play when designing OO perl modules and systems. There's a nice GPL'd diagram creation program called Dia (now with win32 port)which I've grown quite fond of.

Of course, once I'd a nice sized UML diagram completed, I wanted to export it out to perl. You can do so for a variety of languages (ada?), but perl wasn't in the gameplan, it seems.

I grew wroth, and coded. Well, wroth probably isn't the right word, but the end result is a set of packages under the Dia namespace, chiefly Dia::UMLDiagram. The module provides a read-only interface into the layers of a Dia diagram which can be manipulated for output. Currently only class objects are supported; but this provides the functionality for generation of a skeletal module.

Your feedback is humbly requested, either through comments or email to theeaterofsocks@hotmail.com.