TeeJay's Journal http://use.perl.org/~TeeJay/journal/ TeeJay'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:04:59+00:00 pudge pudge@perl.org Technology hourly 1 1970-01-01T00:00+00:00 TeeJay's Journal http://use.perl.org/images/topics/useperl.gif http://use.perl.org/~TeeJay/journal/ note to self http://use.perl.org/~TeeJay/journal/40099?from=rss <p>note to self.. if puzzled why changes to a function/sub/method seem to have no effect make sure you don't have *any* warnings disabled, but especially the redefined sub one.. otherwise you'll never spot the accidentally pasted duplicate of the sub you want to change</p> TeeJay 2010-01-13T12:20:00+00:00 journal Maypole now Maint only http://use.perl.org/~TeeJay/journal/39877?from=rss <p>I've come to the conclusion that as I have neither the time nor inclination to spend my spare time working on Maypole, and I haven't used it for any paid work for several years, I won't be investing any more time on actively working on it.</p><p>However, I could be persuaded to work on it for a decent fee, and I would be happy to apply any patches applied and release new versions with fixes.</p><p>I'd also be happy to hand over the reins to anybody who wants to take over.</p><p>I do have a lot of ideas in this area, but family and work commitments mean that I'll more likely experiment on top of the newer frameworks that exist than try and rework Maypole beyond recognition.</p><p>I still think there is a large hole in the "market" for a more high-level app server than Catalyst, etc providing something more like Drupal in perl but I'm not entirely sure how to do it.</p><p>I guess I'll just see what happens, in the meantime I have plenty of other open source code I'm interested in and hacking on - from Autodia to Padre and Plack.</p> TeeJay 2009-11-11T10:16:27+00:00 journal Small F/LOSS projects still gather a lot of contributors http://use.perl.org/~TeeJay/journal/39521?from=rss <p>I first released Autodia back in late 2000, it's a fairly small project, doing a specific and small job of interest to some programmers.</p><p>I remember how pleased I was the first time somebody emailed me about it, saying thanks and how useful it was. It was a huge surprise and I was really chuffed, that somebody the other side of the world (I think it was South America), had found it and thought to contact me.</p><p>Nearly 10 years later it's almost an every day thing. The number of contributors is now just under 50, with another 20 or so bug reporters.</p><p>All that for a pretty simple tool that has no mailing list, a couple of (unfortunately out of date) web pages, and only had public version control since last year.</p><p>I put almost no effort at all into publicising it, releases are infrequent and the website needs work - but still people find it, post patches and test cases and even sometimes just say thank you without requesting a bug fix.</p> TeeJay 2009-08-24T13:01:01+00:00 journal Adding a new submenu and core feature to padre in an evening http://use.perl.org/~TeeJay/journal/39518?from=rss <p> Last night I decided I'd spend a few hours adding something like gedits 'insert date' and any office program's Insert stuff menu. </p><p> Previously I'd spent about 25 minutes looking at how the snippets feature worked and how it fitted into menu's dialogs, etc - just enough time to copy it and modify the menus </p><p> Adding a new submenu is fairly simple </p><blockquote><div><p> <tt>+&nbsp; &nbsp; &nbsp; &nbsp;my $submenu = Wx::Menu-&gt;new;<br>+&nbsp; &nbsp; &nbsp; &nbsp;$self-&gt;{insert_submenu}&nbsp; = $self-&gt;AppendSubMenu( $submenu, Wx::gettext('Insert') );<br>+<br>+&nbsp; &nbsp; &nbsp; &nbsp;$self-&gt;{insert_special} = $self-&gt;add_menu_item(<br>+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$submenu,<br>+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;name&nbsp; &nbsp; &nbsp; &nbsp;=&gt; 'edit.insert.insert_special',<br>+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;label&nbsp; &nbsp; &nbsp; =&gt; Wx::gettext('Insert Special Value'),<br>+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;shortcut&nbsp; &nbsp;=&gt; 'Ctrl-Shift-I',<br>+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;menu_event =&gt; sub {<br>+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;require Padre::Wx::Dialog::SpecialValues;<br>+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Padre::Wx::Dialog::SpecialValues-&gt;insert_special(@_);<br>+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },<br>+<br>+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;);<br>+<br>&nbsp; &nbsp; &nbsp; &nbsp; $self-&gt;{snippets} = $self-&gt;add_menu_item(<br>-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$self,<br>-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;name&nbsp; &nbsp; &nbsp; &nbsp;=&gt; 'edit.snippets',<br>+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$submenu,<br>+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;name&nbsp; &nbsp; &nbsp; &nbsp;=&gt; 'edit.insert.snippets',<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; label&nbsp; &nbsp; &nbsp; =&gt; Wx::gettext('Snippets'),<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shortcut&nbsp; &nbsp;=&gt; 'Ctrl-Shift-A',<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; menu_event =&gt; sub {</tt></p></div> </blockquote><p> The new insert sub menu now holds 2 entries - snippets, and 'insert special value', which calls insert_special method on the new Dialog class, which will be defined next</p><p> That's easy enough - now to add some actual functionality.. <br> <br> We define the functionality in the dialog class just below : </p><ul> <li>The menu item calls insert_special, which simply calls the dialog method.</li> <li>The dialog methid is where most of the setup is done, layout of the dialog and the widgets, specifying what functions to call when widgets are clicked or selected</li> <li>The widgets are best understood by looking at the examples in wxdemo, and Padre::Wx::Dialog which wraps some of the logic.</li> <li>The Choice widgets just expect an array ref of labels, when a selection is made the indice of the selection is available from the widget object - see get_value and get_category for examples of mapping selection indices into your own data structures.</li> <li>You can access the current editor object and thence document, etc using Padre::Current, see the _get_file_info sub.</li> </ul><p> And now for the source code in full.. </p><blockquote><div><p> <tt>package Padre::Wx::Dialog::SpecialValues;<br> <br># Insert special values such as dates in your code<br> <br>use strict;<br>use warnings;<br>use Padre::Wx&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;();<br>use Padre::Wx::Dialog ();<br>use Padre::Current&nbsp; &nbsp; ();<br> <br>our $VERSION = '0.01';<br> <br>my $categories = {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'Dates' =&gt; [<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { label =&gt; 'Now', action =&gt; _get_date_info('now')&nbsp; },<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { label =&gt; 'Yesterday', action =&gt; _get_date_info('epoch') },<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { label =&gt; 'Tomorrow', action =&gt; _get_date_info('epoch') },<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;],<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'File' =&gt; [<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ label =&gt; 'Size', action =&gt; _get_file_info('size') },<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ label =&gt; 'Name', action =&gt; _get_file_info('name') },<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ],<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'Line' =&gt; [<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ label =&gt; 'Number', action =&gt; _get_line_info('number') },<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ],<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;};<br> <br>my $cats_list = [ sort keys %$categories ];<br> <br>sub get_layout {<br>&nbsp; &nbsp; my ($config) = @_;<br> <br>&nbsp; &nbsp; my $default_cat_values = [map ($_-&gt;{label}, @{$categories-&gt;{$cats_list-&gt;[0]}})];<br> <br>&nbsp; &nbsp; my @layout = (<br>&nbsp; &nbsp; &nbsp; &nbsp; [ [ 'Wx::StaticText', undef, Wx::gettext('Class:') ],&nbsp; &nbsp;[ 'Wx::Choice', '_find_cat_',&nbsp; $cats_list ], ],<br>&nbsp; &nbsp; &nbsp; &nbsp; [ [ 'Wx::StaticText', undef, Wx::gettext('SpecialValue:') ], [ 'Wx::Choice', '_find_specialvalue_', $default_cat_values ], ],<br>&nbsp; &nbsp; &nbsp; &nbsp; [ [], [ 'Wx::Button', '_insert_', Wx::gettext('&amp;Insert') ], [ 'Wx::Button', '_cancel_', Wx::wxID_CANCEL ], ],<br>&nbsp; &nbsp; );<br>&nbsp; &nbsp; return \@layout;<br>}<br> <br>sub dialog {<br>&nbsp; &nbsp; my $class&nbsp; = shift;<br>&nbsp; &nbsp; my $parent = shift;<br>&nbsp; &nbsp; my $args&nbsp; &nbsp;= shift;<br>&nbsp; &nbsp; my $config = Padre-&gt;ide-&gt;config;<br>&nbsp; &nbsp; my $layout = get_layout($config);<br>&nbsp; &nbsp; my $dialog = Padre::Wx::Dialog-&gt;new(<br>&nbsp; &nbsp; &nbsp; &nbsp; parent =&gt; $parent,<br>&nbsp; &nbsp; &nbsp; &nbsp; title&nbsp; =&gt; Wx::gettext("Insert Special Values"),<br>&nbsp; &nbsp; &nbsp; &nbsp; layout =&gt; $layout,<br>&nbsp; &nbsp; &nbsp; &nbsp; width&nbsp; =&gt; [ 150, 200 ],<br>&nbsp; &nbsp; );<br> <br>&nbsp; &nbsp; Wx::Event::EVT_CHOICE( $dialog, $dialog-&gt;{_widgets_}-&gt;{_find_cat_}, \&amp;find_category );<br>&nbsp; &nbsp; Wx::Event::EVT_BUTTON( $dialog, $dialog-&gt;{_widgets_}-&gt;{_insert_}, \&amp;get_value );<br>&nbsp; &nbsp; Wx::Event::EVT_BUTTON( $dialog, $dialog-&gt;{_widgets_}-&gt;{_cancel_}, \&amp;cancel_clicked );<br> <br>&nbsp; &nbsp; $dialog-&gt;{_widgets_}-&gt;{_find_cat_}-&gt;SetFocus;<br>&nbsp; &nbsp; $dialog-&gt;{_widgets_}-&gt;{_insert_}-&gt;SetDefault;<br> <br>&nbsp; &nbsp; return $dialog;<br>}<br> <br>sub insert_special {<br>&nbsp; &nbsp; my $class&nbsp; = shift;<br>&nbsp; &nbsp; my $main&nbsp; &nbsp;= shift;<br>&nbsp; &nbsp; my $dialog = $class-&gt;dialog( $main, {} );<br>&nbsp; &nbsp; $dialog-&gt;Show(1);<br>&nbsp; &nbsp; return;<br>}<br> <br>sub find_category {<br>&nbsp; &nbsp; my $dialog&nbsp; &nbsp;= shift;<br>&nbsp; &nbsp; my $cat_name = _get_cat_name($dialog);<br>&nbsp; &nbsp; my $values&nbsp; &nbsp;= [map ($_-&gt;{label}, @{$categories-&gt;{$cat_name}})];<br>&nbsp; &nbsp; my $field&nbsp; &nbsp; = $dialog-&gt;{_widgets_}-&gt;{_find_specialvalue_};<br>&nbsp; &nbsp; $field-&gt;Clear;<br>&nbsp; &nbsp; $field-&gt;AppendItems($values);<br>&nbsp; &nbsp; $field-&gt;SetSelection(0);<br>&nbsp; &nbsp; return;<br>}<br> <br>sub get_value {<br>&nbsp; &nbsp; my $dialog = shift;<br>&nbsp; &nbsp; my $data&nbsp; &nbsp;= $dialog-&gt;get_data or return;<br>&nbsp; &nbsp; my $cat_name&nbsp; &nbsp; = _get_cat_name($dialog);<br>&nbsp; &nbsp; my $value_ind = $data-&gt;{_find_specialvalue_};<br>&nbsp; &nbsp; my $text&nbsp; &nbsp;= &amp;{$categories-&gt;{$cat_name}[$value_ind]{action}};<br>&nbsp; &nbsp; warn "cat : $cat_name, value $value_ind, text : $text\n";<br> <br>&nbsp; &nbsp; my $editor = Padre::Current-&gt;editor;<br>&nbsp; &nbsp; $editor-&gt;ReplaceSelection('');<br>&nbsp; &nbsp; my $pos = $editor-&gt;GetCurrentPos;<br>&nbsp; &nbsp; $editor-&gt;InsertText( $pos, $text );<br>&nbsp; &nbsp; return;<br>}<br> <br>sub cancel_clicked {<br>&nbsp; &nbsp; $_[0]-&gt;Destroy;<br>&nbsp; &nbsp; return;<br>}<br> <br>######<br> <br>sub _get_cat_name {<br>&nbsp; &nbsp; my $dialog = shift;<br>&nbsp; &nbsp; my $data&nbsp; &nbsp;= $dialog-&gt;get_data;<br>#&nbsp; &nbsp; warn Dumper (data =&gt; $data);<br>&nbsp; &nbsp; my $cat_name&nbsp; = $cats_list-&gt;[$data-&gt;{_find_cat_}];<br>&nbsp; &nbsp; return $cat_name;<br>}<br> <br>sub _get_date_info {<br>&nbsp; &nbsp; my $type = shift;<br>&nbsp; &nbsp; if ($type eq 'now') {<br>&nbsp; &nbsp; return sub {<br>&nbsp; &nbsp; &nbsp; &nbsp; return scalar localtime;<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp; } else {<br>&nbsp; &nbsp; return sub {<br>&nbsp; &nbsp; &nbsp; &nbsp; warn "date info $type not implemented yet\n";<br>&nbsp; &nbsp; &nbsp; &nbsp; return '';<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp; }<br>}<br> <br>sub _get_file_info {<br>&nbsp; &nbsp; my $type = shift;<br>&nbsp; &nbsp; if ($type eq 'name') {<br>&nbsp; &nbsp; return sub {<br>&nbsp; &nbsp; &nbsp; &nbsp; my $document = Padre::Current-&gt;document;<br>&nbsp; &nbsp; &nbsp; &nbsp; my $filename = $document-&gt;filename || $document-&gt;tempfile;<br>&nbsp; &nbsp; &nbsp; &nbsp; warn "doc : $document $filename \n";<br>&nbsp; &nbsp; &nbsp; &nbsp; return $filename<br>&nbsp; &nbsp; };<br>&nbsp; &nbsp; } else {<br>&nbsp; &nbsp; return sub {<br>&nbsp; &nbsp; &nbsp; &nbsp; my $document = Padre::Current-&gt;document;<br>&nbsp; &nbsp; &nbsp; &nbsp; my $filename = $document-&gt;filename || $document-&gt;tempfile;<br>&nbsp; &nbsp; &nbsp; &nbsp; warn "doc : $document $filename \n";<br>&nbsp; &nbsp; &nbsp; &nbsp; return ($filename) ? -s $filename : 0;<br>&nbsp; &nbsp; };<br>&nbsp; &nbsp; }<br>}<br> <br>sub _get_line_info {<br>&nbsp; &nbsp; my $type = shift;<br>&nbsp; &nbsp; return sub {<br>&nbsp; &nbsp; my $editor = Padre::Current-&gt;editor;<br>&nbsp; &nbsp; my $pos = $editor-&gt;GetCurrentPos;<br>&nbsp; &nbsp; my $line = $editor-&gt;GetCurrentLine;<br>&nbsp; &nbsp; return $line + 1;<br>&nbsp; &nbsp; }<nobr> <wbr></nobr>;<br>}</tt></p></div> </blockquote><p> It's mostly an exersize for me in hacking padre and a proof of concept for a word-processor style insert menu, at the moment, but I hope to integrate plugins so that, for instance, a version control plugin would allow you to paste the name of the repo, or the version, tag or branch into the document. </p> TeeJay 2009-08-24T09:04:58+00:00 journal New testing module : Test::HTML::Form http://use.perl.org/~TeeJay/journal/38404?from=rss <p>I've released, with the kind permission of <a href="http://www.slando.com/">Slando</a>, Test::HTML::Form which makes testing HTML and HTML::Forms considerably easier.</p><p> The API is loosely based on Test::HTML::Content, but it use HTML::Treebuilder and re-uses parse trees and objects where possible, making it much quicker - it also uses filenames instead of passing strings around, and has additional methods for extracting strings and testing form elements easily </p><p> So far it's already made a lot of testing easier, but I already have a wishlist of extra features - like being able to extract HTML::Elements easily, provide urls instead of filenames, and allow extra tests on more form elements. </p><p>Anyway.. its in SVN at <a href="http://code.google.com/p/test-html-form/">code.google.com</a> and on <a href="http://search.cpan.org/dist/Test-HTML-Form/">CPAN</a> </p> TeeJay 2009-02-03T19:46:34+00:00 journal Python and Perl on sourceforge http://use.perl.org/~TeeJay/journal/38175?from=rss <p>I tried posting another response to david at<br>http://journal.dedasys.com/2008/12/07/python-surpasses-perl but his blog doesn't cope with long replies.<nobr> <wbr></nobr>..so I posted it here..</p><p>David,</p><p>I can't even post a response on your blog so I posted it here :</p><p>What those of us who actually have written and developed open source perl projects are saying is that sourceforge is a very poor indicator of anything but sourceforge usage in languages.</p><p>I think you're article would be much better if you turned it on it's head : Which languages use sourceforge, vs which languages have strong software repositories of their own.</p><p>Ruby has it's gems, php has pear, Python has the caverns of thingywotsit.</p><p>CPAN just happens to be far larger and better equipped than the alternatives.</p><p>As a free software author it's simply not worth the effort of using sourceforge for any of my projects - CPAN provides better tools and distribution, I have my own homepages for my projects.</p><p>I would probably even surmise that Sourceforge is actually the thing that is losing market share : you have better and more focussed alternatives like ohloh, github and google code, most significant projects will host their own version control, bug tracking and wikis.</p><p>"f CPAN shows some growth for Perl, that seems normal to me - if there's no growth there, the language really would be dead."</p><p>16% is more than just healthy growth - it indicates exactly the opposite of your conclusions!</p><p>"Freshmeat indicates that, relative to Python and other languages, Perl isn't seeing as much code released."</p><p>I'd turn that on it's head : the usage of freshmeat indicates the lack of better alternatives for other languages.</p><p>CPAN and PEAR have both moved forwards a great deal since sourceforge was created, yet sourceforge is pretty much identical to how it was in the 90s.</p><p>"The point that perhaps people are less interested in Freshmeat these days isn't a bad one (although "myself as a case study" isn't great statistics either), but why should that be different for Python, Perl or, say, Lua users? If it's going to drop off, it'll drop off for everyone."</p><p>Because other languages don't have a decent repository of their own and/or have different eco-systems.</p><p>Despite the existance of PEAR, PHP is still dominant on freshmeat, but PEAR and Freshmeat don't overlap much - one being for applications one being for libraries.</p><p>"Python, however, is growing, whereas Perl hasn't. I'm sorry if that upsets you, but those are the relevant facts."</p><p>No - all you've shown is that freshmeat is more popular with python coders than perl ones.</p><p>"However, it is not as popular as it once was, in terms of new code being written."</p><p>Again, you can't sensibly draw this conclusion when you know that CPAN growth is 16% year on year.</p><p>You probably don't even have figures to compare growth in the vaults..</p><p>A quick check of the web page shows "Parnasus Totals: 2025 items in 49 categories." CPAN yearly growth is larger than the entire Panasus repo!</p><p>Maybe Python has a new repo - Parnasus looks like it hasn't been updated or worked on since the 90s - that would certainly explain why pythonista's tend to rely on sourceforge.</p><p>Yup, there is a new repo : 5393 packages on cheeseshop.python.org</p><p>So python has 5393 packages on cheeseshop, 3200 on sourceforge, and 2000 on parnasus.</p><p>CPAN has 14793 packages on CPAN and 3800 on freshmeat.</p><p>CPAN growth is 16%, Perl growth on sourceforge is 1.1%, Python growth is 1.4%.</p><p>Looks to me like python is being held back by the lack of a CPAN.</p> TeeJay 2008-12-29T13:29:22+00:00 journal optimising for fun http://use.perl.org/~TeeJay/journal/38091?from=rss <p>I came accross two blog posts today on enjoying your open source / personal projects and it's a helpful reminder that I don't need to stress about the projects I have.</p><p>* http://nickelcode.com/2008/12/08/developing-for-fun-some-observations/<br>* http://weblog.masukomi.org/2008/12/14/on-coding-for-fun</p><p>both very good, with reminders of the fact that if you're not getting paid or some other reward and it's not fun, then it's probably not worth doing.</p><p>It's also worth remembering the flip side of the coin - nobody owes you support or bug fixes in a project they're doing for free on their own time.</p><p>And finally, I got what you always ask for as a writer or maintainer of open source (or heck even commerical) code :</p><p>an unsolicited patch with test and explaination.. somebody read the README, and did exactly as I wishfull thinkingly asked and then seemed surprised that I was surprised.</p><p>in the words of Patrick Nice[1].. "which was nice"</p><p>1] http://www.bbc.co.uk/comedy/fastshow/characters/patrick_nice.shtml</p> TeeJay 2008-12-15T16:00:54+00:00 journal Influx of redditors http://use.perl.org/~TeeJay/journal/38023?from=rss <p>What's the betting all the people who turned up just to say that perl is dying won't be back to post anything at all tomorrow or the day after or ever again.</p><p>What's the odds that most of them never even bothered to join a perl monger group or attend a talk on perl "back when they used perl" before they discovered that python was all rainbows and unicorn. ?</p><p>Fairly low.</p><p>How insecure do you have to be to join use.perl.org just say how much you prefer python ?</p><p>lame, lame, lame.</p> TeeJay 2008-12-04T20:26:52+00:00 journal Hacking emacs keybindings into Padre http://use.perl.org/~TeeJay/journal/37898?from=rss <p>I've been meaning to play with <a href="http://padre.perlide.org/">Padre</a> (An Editor/IDE written in Perl) as it has perl extensions and therefore I can do with it, what lisp gurus can do with emacs, without the use of mind-altering drugs or lambda calculus.</p><p>This evening, in the space of 90 minutes I was able to add some very basic emacs keybindings, only a handful, and some of them work, while some still have their original bindings, despite using "$self-&gt;CmdKeyClear(ord('w'),Wx::wxMOD_ALT());" which should unbind them. Bah.</p><p>Anyway, that's enough for now, but it has encouraged me to hack on it some more when I get the chance and to start integrating autodia based tools for generating and creating documentation and code at the click of a mouse.</p><p>You can find the results of my efforts at : http://www.aarontrevena.co.uk/opensource/Emacs.pm</p> TeeJay 2008-11-17T22:12:29+00:00 journal Maypole development sprint - adding DBIx::Class Model http://use.perl.org/~TeeJay/journal/37873?from=rss <p>For the last few weeks, while my better half has been away on training for her new job, I've been doing a bit of housekeeping on Maypole.</p><p>This week I've been adding a DBIx::Class model, progress was pretty slow and painful initially, but now it's going much better and I end up "in the zone" only to realise that it's almost 1am and I will probably have to get up at 6am (again, done this 3 nights in a row, once reading a book, twice hacking code)</p><p>Headache, Gritty, burning eyes, but it's worth it - I just managed to get the list action working (apart from autocreating embedded forms and buttons) with the new DBIx::Class model.. soon I'll be able to use Maypole with DBIx::Class for both work and personal projects.</p> TeeJay 2008-11-14T00:44:47+00:00 journal review of Data::FormValidator http://use.perl.org/~TeeJay/journal/37633?from=rss <p>Test::FormValidator is wonderful, it works really rather nicely.</p><p>I needed to test some currency and price validation functions for a client's website, and it was both simple and painless.</p><p>With only a little effort, I think I can test all validation on the front end of the site now by checking each validation function, and then each profile with sets of known good and bad data.</p><p>This makes it really easy to add test cases for validation errors found by QA and User Acceptance Testing.</p> TeeJay 2008-10-09T22:06:20+00:00 journal (not) removing perlbuzz from my bookmarks http://use.perl.org/~TeeJay/journal/37617?from=rss <p>perlbuzz finally completes the transformation from an interesting blog about cool stuff in perl to andy lesters personal blog with plugs for his other blogs and random shit his friends IM'd him.</p><p>[edit]<br>Meh. Shit happens. Bloggers are human. Even heisenbugs can be fixed and overtired toddlers with colds can go to sleep.</p> TeeJay 2008-10-07T20:41:14+00:00 journal Perl 5 wiki 900 pages, 100 to reach 1000 http://use.perl.org/~TeeJay/journal/37014?from=rss <p>The <a href="http://www.perlfoundation.org/perl5/">Offical Perl 5 Wiki</a> at the perl foundation now has 899 pages, many of them are very good, and there is a steady if slow stream of improvements every week.</p><p>A while a go I cheerleaded it a bit and said we could reach 1000 pages - since then we've had about 115 pages added, and about 10 times as many updates - which is pretty good.</p><p>But there is still a lot of room for improvement - see the Most Wanted pages, or look at pages you're interested and see if there are missing links, content, mistakes or pages you could add</p> TeeJay 2008-07-25T19:14:40+00:00 journal Autodia 2.08 uploaded to CPAN http://use.perl.org/~TeeJay/journal/36832?from=rss <p>Just uploaded 2.08 to CPAN - now skip lists work correctly for most input handlers, Java has been entirely removed (it hasn't worked for most of this decade), and author tests are excluded - also graphviz options now include concentrate for tidier output.</p> TeeJay 2008-07-01T10:23:43+00:00 journal Help the Perl 5 Wiki reach 1000 pages http://use.perl.org/~TeeJay/journal/36443?from=rss <p>The <a href="http://www.perlfoundation.org/perl5/">Official Perl 5 Wiki</a> now has a <a href="http://www.perlfoundation.org/perl5/index.cgi?action=changes&amp;changes=all">total of 893 pages</a>, and 284 <a href="http://www.perlfoundation.org/perl5/index.cgi?most_wanted_pages">pages wanted</a> by other pages.</p><p>That means that 1000 pages is well within reach - pick from the "most wanted" page or the "wishlist", or even better - add more content to the many short pages already there such as mod_perl, applications, etc.</p><p>Other pages that would be cool to add would be </p><ul> <li>Perl usage - collate info about job statistics, cpan growth, surveys, perl monger census (past and current), numbers of conferences, etc</li> <li>Packaging applications using PAR</li> <li>Brief descriptions of each Perl Release, such as name of pumpking, major changes and links to annoucement, changelog, etc</li> <li>Translated pages - currently the entire content is in english - translations of popular and/or big pages would be incredibly useful</li> </ul><p>The Python wiki has about 4 or 5 <i>thousand</i> pages - it's been around a lot longer than this wiki, but Perl has been around longer than perl and there is a lot more that could and should be covered in the wiki</p> TeeJay 2008-05-16T13:36:45+00:00 journal dear lazyweb - I want more metadata when searching cpan http://use.perl.org/~TeeJay/journal/36334?from=rss <p>I'd really appreciate more ways to search cpan - there is so much information available that can help you find the right library that aren't currently used anywhere:<br>* ohloh and other metrics (sloccount, version control churn, bug churn, mailing list activity)<br>* koala tea<br>* recomended on the perl 5 wiki<br>* published articles, slides, advent calender on it<br>* cpandeps results<br>* SYNOPSIS<br>* SEE ALSO suggestions</p><p>And that's on top of the current reviews/rating system and bug count available on search.cpan.org.</p><p>If I had some spare time I'd give it a go, but I'm busy with work, sprog and current CPAN module workload. It would make a neat showcase for any framework like Maypole or Catalyst tho.</p> TeeJay 2008-05-06T10:09:43+00:00 journal Ohloh http://use.perl.org/~TeeJay/journal/36186?from=rss <p>I'm hooked on <a href="http://www.ohloh.net/">Ohloh</a>, and am a little disappointed how little perl is represented on there (in proportion to the number of users, projects, etc).</p><p>It would be a nice way to showcase both the breadth and quality for more perl projects - it's actually rather good for advocacy in a "just show me the numbers" way</p> TeeJay 2008-04-18T09:05:55+00:00 journal Perl 6 can has LOLCODE? http://use.perl.org/~TeeJay/journal/35274?from=rss found via <a href="http://syndicated.livejournal.com/simon_cozens/64738.html">Simon Cozen's blog</a> : <a href="https://svn.perl.org/parrot/trunk/languages/lolcode/">Perl 6 can has LOLCODE!</a> TeeJay 2008-01-03T10:55:59+00:00 journal what can I do with perl 6 today? http://use.perl.org/~TeeJay/journal/35246?from=rss <p>Following my response to chromatic and post to the perl6-users list - I've started a guide to what you can actually use perl 6 for today :<br>http://www.perlfoundation.org/perl6/index.cgi?what_can_i_do_with_perl_6_today</p><p>Mostly a rough outline, but I'll be filling it in more as I get the chance and would appreciate any help - whether formatting nicely or adding urls or suggestions.</p><p>Also I'd really appreciate a 'creating a cpan/cpan6 style module' in perl 6 howto.</p> TeeJay 2007-12-30T16:17:36+00:00 journal audit2policy - making selinux less painful http://use.perl.org/~TeeJay/journal/35165?from=rss <p>http://docs.fedoraproject.org/selinux-faq-fc5/#id2961385</p><p>Standard selinux policy in Centos 5 is infuriatingly unhelpful - fortunately 5 commands and it's less awful.</p> TeeJay 2007-12-20T14:56:02+00:00 journal activecollab fork.. activeCollab BC http://use.perl.org/~TeeJay/journal/35054?from=rss <p>Ace!</p><p>I was about to download activecollab yesterday when I discovered that you can no longer get it for free - I don't have time to go through the pain of persuading my clients to pay for stuff so I started looking for something else.. today I found just what I wanted..</p><p>http://freelanceescape.com/resources/activecollab-bc/</p><p>ActiveCollab - free fork, with added basecampyness ! I'll be trying it out for the next couple of days - hopefully it'll be fairly simple to integrate with my client's existing wiki and mantis bugtracker.</p> TeeJay 2007-12-06T14:42:45+00:00 journal Object::InsideOut - why on earth use it? http://use.perl.org/~TeeJay/journal/34978?from=rss <p>I'm dealing with a relatively recent codebase where the programmer has decided to use Object::InsideOut - and I'm really getting annoyed with it.</p><p>It doesn't offer any actual benefits over using a sane class system, such as Class::Accessor, doesn't provide any persistence (so that's all tacked on seperately via a heath-robinson contraption involving large SQL snippets all over the shop). I'd really like to replace all the Object::InsideOut code with DBIx::Class.</p><p>*sigh*</p><p>Today's fun problem is that I've added a new attribute, but the getter methods don't seem to exist, despite being specified in exactly the same way as all the others, naturally no useful information is provided about why it doesn't exist - merely that (despite all the code being in place) it doesn't.</p> TeeJay 2007-11-26T14:08:53+00:00 journal strange error when sending email http://use.perl.org/~TeeJay/journal/34902?from=rss <p>Error during compilation of<nobr> <wbr></nobr>/path/to/docs/emails/el-GR/some_email.mas: Unrecognized character \xCE at<nobr> <wbr></nobr>/path/to/docs/emails/el-GR/some_email.mas</p><p>how odd..</p><p>further investigation leads to this gem :</p><p>&lt;% &#913;&#957; ( !$category-&gt;&#945;&#966;&#959;&#961;&#940; &#954;&#940;&#960;&#959;&#953;&#959; event() ){ %&gt;</p><p>which should in fact be :<br>&lt;% if ( !$category-&gt;is_event_based() ){ %&gt;</p><p>That's right - somebody translated the perl in my clients email into greek, as well as the content.</p><p>Oops</p> TeeJay 2007-11-15T14:55:50+00:00 journal faster, pussycat! kill! kill! http://use.perl.org/~TeeJay/journal/34836?from=rss <blockquote><div><p> <tt>perl -e "use constant pussycat =&gt; 'pussycat'; sub faster { } ; faster(pussycat); kill kill;"</tt></p></div> </blockquote><p>It's a bit lame, but it compiles</p><p> I'm sure it must be possible to get the original <a href="http://en.wikipedia.org/wiki/Smell_of_Female">title</a> of the <a href="http://en.wikipedia.org/wiki/Faster%2C_Pussycat!_Kill!_Kill!">film</a> to compile (without source filters)</p> TeeJay 2007-11-05T15:35:30+00:00 journal emergancy embperl with text::template http://use.perl.org/~TeeJay/journal/34363?from=rss <p>So I agree to do a quick cgi script for somebody, after agreeing I discover that it's shared hosting on a windows box, with perl, but no way to install modules or do anything remotely useful.</p><p>Text::Template to the rescue! I could just embed the HTML directly into the script, but - yuck!</p><p>With a couple of very small modifications, I copy text::template inline at the end of the script, and hey presto : run anywhere embperl/templating.</p><p>HTML::Template would be well suited to this project, but this will do at a push.</p> TeeJay 2007-09-06T15:34:55+00:00 journal New releases - Autodia and Maypole http://use.perl.org/~TeeJay/journal/34277?from=rss <p>I just released new versions of Maypole (2.121) and Autodia (2.04) yesterday.</p><p>Maypole 2.121 contains minor fixes to 2.12, hence the name.</p><p>Autodia 2.04 adds some fixes to dynamicly named perl attributes/methods, C# support, and the ability to use a list of packages (or patterns) to ignore.</p><p>Both uploaded to CPAN yesterday.</p> TeeJay 2007-08-30T09:28:22+00:00 journal sql designer (online and php) http://use.perl.org/~TeeJay/journal/34199?from=rss This looks neat - I'm thinking of writing a Maypole plugin based on it... <br> <br> <a href="http://ondras.zarovi.cz/sql/">WWW SQL Designer</a> TeeJay 2007-08-23T20:00:52+00:00 journal bitchy http://use.perl.org/~TeeJay/journal/34006?from=rss <p>What is it about catalyst advocates that make them so catty and bitchy towards and about other projects?</p><p>Somebody posted a question to the maypole-users mailing list and was privately emailed offlist by somebody telling them to use Catalyst or Jifty instead, not even including the list or myself.</p><p>*sigh*</p><p>Ironically, it's these same people who cry foul when people call Perl dead or obselete or out of date, but are quite happy to bandy such terms around Perl projects that they consider out of favour - way to go!</p> TeeJay 2007-08-06T08:33:01+00:00 journal Project Euler : Neat idea to help learn math/compsci http://use.perl.org/~TeeJay/journal/33797?from=rss <p> <a href="http://www.projecteuler.net/">Project Euler</a> : <i>"Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve."</i> </p><p>Of course I have neither strong math or pure CS insights so it should be very helpful to work through</p> TeeJay 2007-07-13T13:49:04+00:00 journal Maypole 2.12 release http://use.perl.org/~TeeJay/journal/33575?from=rss <p>Maypole 2.12 has just been uploaded to CPAN, you should be able to download it shortly.</p><p>Here's the changelog :</p><p>Bug Fixes :<br> &nbsp; &nbsp; &nbsp; Fixed some db_colinfo test bugs<br> &nbsp; &nbsp; &nbsp; Fixed typo in edit form template<br> &nbsp; &nbsp; &nbsp; AsForm fixes to stringification _to_select<br> &nbsp; &nbsp; &nbsp; made DFV and FromCGI warn instead of die on unexpected cgi params<br> &nbsp; &nbsp; &nbsp; small improvements to some factory templates<br> &nbsp; &nbsp; &nbsp; fix to path handling in mod_perl and CGI when location ends in /<br> &nbsp; &nbsp; &nbsp; fixed template path ordering so i.e.<nobr> <wbr></nobr>/tablename/list is used before<nobr> <wbr></nobr>/list when provided with a tablename<br> &nbsp; &nbsp; &nbsp; fixed template path with array refs<br> &nbsp; &nbsp; &nbsp; fix to template being reset from path in plain templates (i.e. where no model), may affect those relying on the bug ( bug 23722 )<br> &nbsp; &nbsp; &nbsp; fix to display_line macro in factory templates (bug 22920)<br> &nbsp; &nbsp; &nbsp; fix to correct problem with LocationMatch and regex based Location directives in apache config.<br> &nbsp; &nbsp; &nbsp; fix to redirect_request<br> &nbsp; &nbsp; &nbsp; Fixed typo in _do_update_or_create (bug 26495)</p><p>API additions and enhancements :<br> &nbsp; &nbsp; &nbsp; new Class::DBI::DFV based model<br> &nbsp; &nbsp; &nbsp; New config method : additional, for stashing additional info, especially from additional_data method<br> &nbsp; &nbsp; &nbsp; new warn method in maypole/request class/object, over-ridden by Apache::MVC, etc or own driver<br> &nbsp; &nbsp; &nbsp; new build_form_elements attribute for Maypole request and Maypole::Config, set it to 0 to avoid building cgi form if you don't need it<br> &nbsp; &nbsp; &nbsp; added CGI params to TT error template<br> &nbsp; &nbsp; &nbsp; improvements to factory templates<br> &nbsp; &nbsp; &nbsp; added search_columns method to base cdbi model class, provides display_columns unless over-ridden<br> &nbsp; &nbsp; &nbsp; added new hook - preprocess_location<br> &nbsp; &nbsp; &nbsp; added new attribute to Maypole::Config - request_options<br> &nbsp; &nbsp; &nbsp; improved pager template macro</p><p>Internal additions and enhancements :<br> &nbsp; &nbsp; &nbsp; Inheritence simpler and nicer and less hacked<br> &nbsp; &nbsp; &nbsp; add_model_superclass method moves @ISA munging into the model<br> &nbsp; &nbsp; &nbsp; new test to check everything compiles<br> &nbsp; &nbsp; &nbsp; Model inheritance re-organised</p> TeeJay 2007-06-22T11:48:59+00:00 journal