Odud's Journal http://use.perl.org/~Odud/journal/ Odud's use Perl Journal en-us use Perl; is Copyright 1998-2006, Chris Nandor. Stories, comments, journals, and other submissions posted on use Perl; are Copyright their respective owners. 2012-01-25T02:25:43+00:00 pudge pudge@perl.org Technology hourly 1 1970-01-01T00:00+00:00 Odud's Journal http://use.perl.org/images/topics/useperl.gif http://use.perl.org/~Odud/journal/ ENOMOREPERL http://use.perl.org/~Odud/journal/15504?from=rss Actually NOMOREPERL for money. Today marks the end of an era for me. I leave the place where I have worked for the last eight years - doing a job that started off as technical but has gradually moved more into the service management areas.<br>I did manage to keep some perl work going through the years though. Today as I moved a little web based app that I had written from one server to another I realised that I'm probably never going to do this again for money.<br>The plus side is that I'm probably going to enjoy the recreational perl programming side more.... Odud 2003-10-31T14:53:59+00:00 journal Tim O'Reilly http://use.perl.org/~Odud/journal/13032?from=rss <p>Went to see Tim speak at the UK UNIX User group last night. Tim entertained a capacity crowd <a href="http://www.city.ac.uk/ems/oliver.htm">here</a> to what I suspect is the usual blend of thought provoking stuff and humour.</p><p>I wonder if his slides will be published?</p><p>I recognised acme and davorg in the crowd (from their Identikit pictures on Crimewatch!)</p> Odud 2003-06-24T11:58:35+00:00 journal References hurt my brain http://use.perl.org/~Odud/journal/12616?from=rss <p>Why do references always trip me up? I tend not to use them greatly and always struggle when I do. Context: I was trying to make a subroutine return a reference to a slice of an array. I wrote<br> &nbsp; <br> &nbsp; <code>\@array[0..3]</code> <br> &nbsp; <br>which just returned a reference to a scalar before finding what I needed was<br> &nbsp; <br> &nbsp; <code>[@array[0..3]]</code></p> Odud 2003-06-04T15:00:45+00:00 journal DocBook munging http://use.perl.org/~Odud/journal/10556?from=rss <p>This week I've been doing the routine data munging thing. Turning a file with : separated fields into something else, in this case DocBook tables. All fairly straightforward, but it makes you long for the DocBook equivalent of CGI.pm. DocBook::Table goes someway to doing what I want so maybe I'll start to look at building something on top of it.<br> &nbsp; <br>I suppose that the set of Perl users AND DocBook users AND CPAN module writers is fairly small, which explains why there are only 4 modules found in searching...</p> Odud 2003-02-13T08:16:45+00:00 journal Simple Pleasures http://use.perl.org/~Odud/journal/9857?from=rss <p>A work colleague has started getting interested in Perl, he's reading Learning Perl (which can't be bad) - his background is in simple shell scripts. We've planned some short, informal, around the keyboard sessions - so far we've done opening, reading, and writing files. Today we do arrays, lists, and hashes.<br> &nbsp; <br>I've been doing a very very simple "Cookbook" approach and so far it has seemed to work. It's great to get back to basics, but sometimes hard when you have to explain something that you have been doing for years without really thinking about it.<br> &nbsp; <br>Future topics include pattern matching, regexes, and subroutines - but I haven't thought beyond that (suggestions welcome!).</p> Odud 2003-01-09T08:57:50+00:00 journal Commuting - Moan, Winge http://use.perl.org/~Odud/journal/8546?from=rss <p>After about 5 years of living 10 minutes walk from work I'm working about 2 hours single journey from home. I'd forgotten how much I hated driving up and down the motorways - and how tiring it is. Still, it's only supposed to be for 3 weeks.</p> Odud 2002-10-23T19:26:26+00:00 journal Perl Beer? http://use.perl.org/~Odud/journal/8354?from=rss <p>Wychwood Brewery (in Oxfordshire, England) have released their Halloween beer and called it <b>Pumpking</b>. <i>"... imparts a flavour reminiscent of dried fruits. The Northdown hops provide a balance with a heady, hoppy, bitterness. A delighful mysterious blend of pleasures"</i></p> Odud 2002-10-13T16:29:55+00:00 journal Taxonomy/Classification http://use.perl.org/~Odud/journal/7963?from=rss <p>I've been looking for Perl scripts/modules that will help with developing a taxonomy/classification system. Basically I want to be able to ask n questions and then based on the answer select a further m questions to ask etc. etc. until the end of the tree is reached. </p><p>The application I have in mind is identification of typefaces - but I don't think that is particularly relevant.</p><p><i>For UK readers with long memories there was a program for the BBC Model B that "understood" animals and would do a reasonable job of "guessing" what animal you were thinking of based on simple questions about number of legs/wings/horns etc. It also could be configured to add new animals - provided that you could give a distinguishing question. At the moment this is the sort of complexity I need.</i> </p><p>Searching CPAN (keywords: taxonomy, classification) hasn't yielded anything that looks relevant - for the first time ever in my experience! - is this a wheel that hasn't been invented yet?</p><p>Can anybody point me in the right direction?</p><p>Update: The answer is probably <a href="http://www.ghg.net/clips/CLIPS.html">Clips</a> with a Perl front end to make the question/answer part easy.</p> Odud 2002-09-24T14:01:15+00:00 journal Family Trees http://use.perl.org/~Odud/journal/4671?from=rss <p>I've been playing with GraphViz to try to make it produce family trees. It seems to be one of those things that look easy until you try it when it suddenly becomes non-trivial.</p><p>Basic problem: how do you make it put the husband and wife in the same rank with their childen in the next lower rank.</p><p>I note than some of the GraphViz::X authors report that reordering of the nodes is a problem - for family trees you almost always want the children to be in order of birth and not to be reordered by the layout algorithm.</p><p>The ability to produce a pretty diagram from a simple<nobr> <wbr></nobr>.dot file is very impressive however.</p> Odud 2002-05-04T21:10:52+00:00 journal Onwards http://use.perl.org/~Odud/journal/2765?from=rss Winter illnesses (me, the wife, the kids), real work, other commitments (I do the layout for the parish magazine once a month) and house redecoration has prevented any development on my book cataloguing/indexing project for the last few weeks. However I made some progress over this weekend.<br><br>Having decided that the XML describing a book was very simple:<br><br>&lt;book&gt;<br> &nbsp; &nbsp; &nbsp; &lt;title type='01'&gt;Some title&lt;/title&gt;<br> &nbsp; &nbsp; &nbsp; &lt;contributor type='01'&gt;An Author&lt;/title&gt;<nobr> <wbr></nobr>...<br>&lt;/book&gt;<br><br>It seems obvious that title, contributor, etc would be tables in the database each having a column linking back to a row in the book table. The book table has a single column holding a unique book id - its purpose is to link the other tables together.<br><br>So I've got a big file of input XML - parse it with SAX because I don't need to know anything complicated and won't suffer from "two stops before I do.." problems - write the rows to the database with DBI.<br><br>All worked fine - once I remembered to turn off AutoCommit and I've now got a populated database.<br><br>Next steps - write some stuff to query it and get the results back as XML - use Sablotron (or similar) to apply XSLT and churn out HTML, TeX, plain text as required.<br><br>It's been really good to fasten SAX and DBI to some simple code of my own and produce something useful - and hopefully the query/output stages will be equally rewarding.<br><br>But first I have to get the magazine finished....... Odud 2002-02-11T11:04:55+00:00 journal At last, technology put to a good use http://use.perl.org/~Odud/journal/2371?from=rss <p>Computer Weekly has a snippet describing a watch developed at Bristol University that uses GPS to provide the wearer with a description of, and directions to, the nearest pub.</p> Odud 2002-01-24T09:49:31+00:00 journal MARC-ONIX-??? http://use.perl.org/~Odud/journal/2300?from=rss EDItEUR (http://www.editeur.org) coordinate the development of standards for<br>electronic commerce for the book trade. They have created a standard called<br>ONIX which is closer to what I want than MARC but is still a bit too complex.<br>Also the terms of use seem to go against the usual free software licence in<br>that it seems that you can't modify it for your own use without their<br>permission. So in the end I've come up with my own way and what I have is<br>something like:<br><br>&lt;book&gt;<br> &nbsp; &nbsp; &nbsp; &nbsp; &lt;contributor type="03"&gt;Falkus, Christopher&lt;/contributor&gt;<br> &nbsp; &nbsp; &nbsp; &nbsp; &lt;contributor type="01"&gt;Woodhouse, P. G.&lt;/contributor&gt;<br> &nbsp; &nbsp; &nbsp; &nbsp; &lt;title type="01"&gt;Short Stories&lt;/title&gt;<br> &nbsp; &nbsp; &nbsp; &nbsp; &lt;category&gt;Fiction&lt;/category&gt;<br> &nbsp; &nbsp; &nbsp; &nbsp; &lt;location&gt;Folio Bookcase&lt;/location&gt;<br> &nbsp; &nbsp; &nbsp; &nbsp; &lt;publisher&gt;The Folio Society&lt;/publisher&gt;<br>&lt;/book&gt;<br><br>The type attribute for contributor is to distinguish between author and editor<br>etc. And for title it lets subtitles etc. be shown. This looks o.k. to me (in<br>that it lets me do the sort of searching and cataloguing that I'm interested<br>in) and because it is not too deep it should be easy to process with a SAX<br>parser.<br><br>All I need to do now is to work out how to store the XML in the database..... Odud 2002-01-21T20:55:41+00:00 journal MAchine Readable Cataloguing http://use.perl.org/~Odud/journal/2175?from=rss <p>MARC (MAchine Readable Cataloguing?) is old, comprehensive, and there are CPAN modules for it - including conversion to and from XML. It seems to record everything that a library could need for all types of holding. However it is way too complicated for what I need and not very easy to understand (at least for me) as the codes describing the types of records are numeric, e.g. 100 indicates the author and 245 indicates the title.</p><p>Back to googling then....<br> &nbsp;</p> Odud 2002-01-16T14:28:31+00:00 journal New Year's Revolution http://use.perl.org/~Odud/journal/2155?from=rss <p>Oh well, as everybody seems to be making resolutions to use the journal system more so I think I'll join in. One objective this year is to finish off something that I've been playing with for years now. What I want to do is create something that will let me catalogue all my books/CDs/etc. I first started trying to do this in the dim and distant MS days with Access but I never got it to the point where it either worked o.k. or I was happy with what it did. So this year I'm going to do it using Perl/XML/PostgreSQL or similar.</p><p>User requirements:</p><p>Add new books as I acquire them<br>Search by title, author<br>Print pretty catalogues<br>Produce simple lists that can be downloaded to the Palm</p><p>Other requirements:</p><p>Have fun doing it.<br>Learn more about XML.<br>Learn more about DBI.<br>Make it extensible.<br>Make it future proof.</p><p>Seems reasonable?</p> Odud 2002-01-15T21:23:15+00:00 journal CPAN classification for new versions http://use.perl.org/~Odud/journal/1518?from=rss <p>I've been putting some thoughts together at work about how we apply operating system patches - for the HP-UX systems for example you can do some clever things:</p><p>1. Get the current patch state and ftp it to HP<br>2. Go onto their site and analyse what patches you are missing (and any dependencies etc)<br>3. Collect all these patches together and download them to your server<br>4. Apply them all in one go</p><p>Of course you can specify what sort of patches you are interested in. For example 'CRITICAL' patches are those that can cause data loss or system failures - and these are the ones we are most interested in.</p><p>Of course in the perl world CPAN does something similar - you can get a report showing, for all the packages you have installed, if there is a newer version available. But if you want to go further you have to start looking at the README/CHANGES for each individual package (and hope that what the author wrote makes some sense to enable you to decide whether to upgrade or not). And this can be a lot of work if you haven't upgraded for a long time. (And we try to minimise change frequency for our production systems.)</p><p>I started wondering if something could be done for CPAN to enable new version to be classified so that you can see if you need to install them - everything from releases that fix serious bugs through minor bugs to added functionality releases.</p> Odud 2001-12-06T13:39:06+00:00 journal Security::Test http://use.perl.org/~Odud/journal/772?from=rss I have mixed feelings about this sort of thing. There's an element of trust needed for CPAN to be effective - and I think this sort of activity misuses that trust. <br>Yes you shouldn't install as root, yes you shouldn't install anything without knowing what it does, yes you shouldn't install without checking the source for backdoors etc. (<i>But how many people checked through every line of the source of 5.6.1 to make sure that it wasn't ftping<nobr> <wbr></nobr>/etc/passwd somewhere? - how many people installed KDE 2.2 from binaries because they couldn't/wouldn't compile the sources</i>)<br>I don't like information being collected/transmitted without warning/my permission - even if it may be for good reasons. Odud 2001-09-07T09:52:24+00:00 journal