da: (bit)
I've given up on using LJ for my RSS feeds. I've got 88 of them, which means I sometimes don't see real people posts for pages and pages. I'm jumping to Google Reader. Google Reader will import "OPML" data, so that's how I wanted to do the transfer. This is a how-to.

(If you are hoping to read your LJ friends list directly from an RSS reader, you might instead try this exporter, which grabs the necessary data for friends- it doesn't include feeds and is beyond the scope of this how-to.)

The short version:

1) if you're handy with Perl, grab the code at the bottom of this entry, change the user name, and run the code.
1b) if you're not handy with Perl, give me a shout and I'll run it for you on my server. :)

2) Output is a list of RSS URLs. To translate these to OPML, feed them to this page. Copy and paste them into the big text box, then hit the "Create OPML" link. Seconds later, you will have an output file, which you should save to disk (the file name doesn't matter).

3) Optionally, open the file in a text editor and change the "title" parts from the URL into a sensible title for each feed. Yeah, I was too lazy to write my own OPML and fix that.

4) in Google Reader, the left-hand lower corner, choose "Manage Subscriptions". Choose "Import/Export". Browse and upload your OPML file.


So far, I like the google reader interface, and now I can actually pay attention to the real people on my list who do still post. (I appreciate y'all! I did this for yoooou!)

Don't bother reading the rest unless you want technical details; mostly here for google searching. Let me know if this helped anybody!

The code:


use strict;
use WWW::Mechanize;

my $base_url = "http://da-lj.livejournal.com/profile";

my $m = WWW::Mechanize->new ( autocheck => 1 );

$m->get( $base_url );

my $profile_html = $m->content;
my @feed_lines = ($profile_html =~ /watchingfeeds_body.*/g);
my @feed_urls = ($feed_lines[0] =~ /href='(.*?)'/g);

foreach my $lj_url (@feed_urls) {
    $m->get( $lj_url );
    print $m->find_link( text => 'XML' )->url() . "\n";

And that's it. I'm using WWW::Mechanize, which is the bee's knees if you have to do screen-scraping in Perl.

I started off with a manual grab of my "watching" page, a word-processor search-and-replace, and was about to run a batch of 'wget's to grab the lj-feed pages when I realized it would be quicker in perl.

The biggest drawback to this method is the cost of installing WWW::Mechanize in the first place. CPAN makes it easy(ish) but it has a tonne of dependencies. ...I guess it's just one step if you're on a reasonably recent Debian/Ubuntu.

A shift in work responsibilities has meant I'm suddenly working on programming projects nearly full-time (again). Today between 10am and 6pm, I:

1- made code changes to my hopeful patch to sshd (c++)
2- fixed a logic bug in a password-changing web-app (python)
3- fixed a display bug in a faculty-information web-app (php)
4- worked on a logic bug in a tool to produce faculty webpages (perl)

#1 included editing a bit of man-pages source-code, which is fairly difficult to read. But
#3 included editing .rtf source, which is quite difficult to read (nigh impossible if you aren't changing something simple, like I was; it's worse than html written by an older version of Microsoft Word. Not meant for human consumption.)

I considered editing a lisp macro for Emacs, just to add a fifth programming language, but that felt cheap.

In a nice cap to the day: we had our monthly Perl Mongers meeting, and afterward I discovered that one guy is quite experienced with the source to ssh (hacking for fun), and he's happy to be an additional set of eyes to look over my changes before I send them off to the project maintainers. Which I'm chuffed about, since I am not a strong C++ programmer. His bar tab was on me.

I was musing whether any parts of my work this week felt effortless or elegant. The python came closest: I wrote the rest of that app from scratch (in December) before I knew how exception-handling worked. Today's fix replacing an if/then with a try/except was clean, logical, quick, and most importantly, effective.

A lot of my work is push-up-my-sleeves-and-get-it-done coding, instead of big design. This summer I'm going to have to go back to two larger php projects, neither of my design. Both have some aesthetic merits, but neither feel at all elegant. Both are going to involve incremental change, though if I can, I would make the changes in a way that leaves the overall code cleaner than when I started.

I suppose what I'd like is a project that starts with elegant PHP. I'm sure it's out there somewhere.
Just got in from a production of Arcadia, by Tom Stoppard.

If you're local, a recommendation to go see it tomorrow or Saturday.

To start with the minuses: it felt too long by 20 minutes. It was 3 hours with a 15-minute intermission. The first act dragged, and not from the material- the pacing felt like they were sloooowwwwiiing down. The players, wisely I think, didn't try to put on English accents, but I kept having to remind myself we were in 19th Century (or modern) Derbyshire, England. The closing 20 minutes included a piece of music with a soft-pop singer in it, which totally jarred me out of believing in the time-period.

The pluses: the play itself is really good. The plot is complicated, and quite talky. Broad brush-strokes: it covers entropy, the second law of thermodynamics, fractals, whole piles of classical poetry, free will, determinism, romanticism versus classicism, love, madness...

I'm glad I read the wikipedia page beforehand, because many classical references were well above my head (the name Arcadia, for example; Thomasina the 13-year-old genius understands her Latin; and shares a moment with her tutor that is completely lost by her mother; I think there's a theme of "what exactly is going on with the tutor" that gets a bit more play with more knowledge of the references.) I hope you'll forgive me not explaining the bulk of the plot- the wikipedia page does a good job, at least.

There was a lot of dry humour. The setting is elaborate, set in the country house of a lord (or his descendants). For most of the play, scenes alternate between the 19th and 20th century. It's centered on a huge desk, where peoples' effects stay put as the stage resets flips between "then" and "now". This choice is understated in the first act; and then in the second, it feels intentionally "sloppier": a character leaves his laptop; one person pours a glass of wine in the 19th century and it is drunk by another in the 20th. There is a boy, Gus, who is mute and is played by the same actor (in the same clothes) playing Augustus, the brother of Thomasina.

For the last few scenes action is mixed with both time-periods at the same time. By the second act you get a good feeling for the characters' personalities, and seeing them around the same table, arguing in counterpoint, works well.

The actors are fairly good, for the most part. I was impressed by the woman playing Thomasina. Overall they were fairly good, but not polished- the indignant cuckolded poet and his friend the Captain felt particularly weak to me, which is a shame, because if they had been stronger, their pathos would've played a stronger counterpoint to the dry wit.

It was well-attended, at least; though I think 2/3 of the audience were highschoolers. (I watched a group of six try and decide where to sit; they acted exactly like starlings flocking, circling, settling, then taking off again to another bunch of seats. They did that, like, 4 times.) Also, the girls who were cooing after Gus (during the show! every time he smiled!) were a bit much.

I will need to close here, as it's after midnight. I think some time I would like to see this done professionally. And, possibly to seek out more Tom Stoppard plays; I've only seen "Rosencrantz and Guildenstern Are Dead". (And I've seen both "Brazil" and "Shakespeare in Love", though neither left me very favourably disposed).

Oh- and I think the way I wound up seeing it was neat; I ran into [livejournal.com profile] thingo, he invited me for tonight's show, I said I'd never heard of it, sounds great, then I discovered it was the night for the monthly Perl Mongers meeting. We were talking about it in IRC, and a small pile of folks said "actually, I'd go see that." So some of us did (and some of us bailed! Slackers! ...kidding). Go, go, coding poets!
da: (bit)
Unclutterer reports that O'Reilly tech books has an ebook promotion for $4.99 per book you already own. This looks quite useful to me:

- O'Reilly ebooks come as a bundle of three common formats (mobi, pdf, epub)
- they are un-copyprotected, a.k.a. not locked to existing software/hardware readers
- while only a fraction of their books are currently available in ebook, some others are also available as pdf

To get the $4.99 books, you need to make an account on their site, register the ISBNs of your books, add them each to your cart, and use the 499UP discount code. I tested one book, and it appears to work.

I may just have to get busy with our barcode-reader at work, since that's where my O'Reilly books live now. I figure at least a dozen of my books are worth future-proofing in case I eventually buy a portable bookreader. :)
The arts event I went to this evening was... meh.

I slept instead of going to the Cory Doctorow talk. It was a good nap.

I had a funny idea that solves a problem at work. I want to start hacking WWW::Mechanize to make a proof of concept, but [livejournal.com profile] roverthedog is standing at the door staring at me and her eyes are saying, "You haven't given me a walk yet."

I shouldn't write this code, anyway; I should give it to my co-op.

Really I shouldn't.

OK, Rover, time for a walk!
da: (bit)
I will freely admit this post will be of limited interest, but I'm quite happy with this result, and maybe you will be too, if you're a big 'ol label-making geek. :)

So, part of GTD is the importance of having labeled manila file-folders. I can corroborate that printed-label folders do work better than hand-printed labeled folders. Not only do they look good, there's something viscerally fun about filing something away in a new folder.

The GTD guy recommends buying an electronic label-maker. For a number of reasons (including: the clutter factor, the expensive label-tape they use, and typing on those chiclet keyboards annoys me) I've made do with printing onto a sheet of Avery 3x10 labels in OpenOffice. While this solves those problems, this still felt like "making do" because it takes OpenOffice a full minute to open, the template is a little mis-aligned, yadda yadda.

So I found a little script, and extended it. )

And that's my labeler, which I figure is at least 5 times cheaper than the tape-label machines, going by the price of the refills.

Data can come from a unix pipe or from standard input. Turning a manual task into a unix pipe command is about as good as it gets, productivity-improvement-wise. (assuming it's not a stupid task in the first place).

Oh and also, if we decide to do them this year, I think it will work wonderfully on holiday address labels, even straight from an emacs buffer of addresses, because you pipe data to it.

Now *that* is cool.

Friday, 30 May 2008 02:49 pm
Three years ago, I read about 9-block quilt patterns and I turned it into a perl program and article, purely for amusement-value. And a Christmas present.

Someone else has taken the original idea and made them into a security feature for web discussion-boards to prevent spoofing. It's a one-way hash from someone's IP address into a unique picture. Quite a clever idea!

I noticed a few weeks ago when these shapes started showing up on wordpress blogs. It seems they've added it as a standard wordpress plugin option. It will take me a while before I don't do a double-take each time I see them though. :)
da: (bit)
While [livejournal.com profile] melted_snowball is learning the very useful R statistics environment, I'm learning just enough about Piet, a graphical language whose programs look like Mondrain paintings. I foolishly volunteered to present on this topic for my local Perl Mongers group. I'd hoped I could reimplement my quilt-building program to make executable programs, but that part has fallen by the wayside. If you want to know what I present on, either show up [1], or ask me after the fact what went down, 'cause I'm sure I'm not going to have time in advance to write up proper slides.

[1] google for our town and perl, should be easy to find our website. The talk's tomorrow night at 7pm. Pizza's on the house. Beer, after, probably at McGinnis in the Plaza.

Come watch me make a fool of myself!


Saturday, 24 June 2006 12:44 am
I'm in Chicago. First task tomorrow: replace my camera's CF card.

I bought my digital camera in 2001. One of its features was its massive storage capacity: a 340 MB hard-disk, in CF form-factor. (Man, that was a lot of storage then. And so tiny!) But progress marches on. Now my camera is old, slow, and I was wondering when I could afford to replace it.

Yesterday, I tried a regular CF card in it. Weow, it's like a whole new camera, so much faster.

Staples has a sale on CF cards. $30 gets you 1GB. That seems like progress to me.


[livejournal.com profile] emaki and I are in a hotel just next to McCormick Place. It's overlooking some odd looking statuary.

Blade Runner? )

Also, the
bedside table )
has both a Gideon Bible and The Teaching of Buddha. [ed: fixed titles]

Tomorrow: architecture tours.

Web 2.0

Tuesday, 20 June 2006 03:10 pm
da: (bit)
I'm going to Chicago for a perl conference that starts Monday. This is the most geekish group I am involved with. In addition to many other things about YAPC that I enjoy, I like the opportunity to learn what all the alpha-geeks are up to these days. The conference flavour is not particuarly higher-ed, corporate, or trade-show. It's more like a smallish con, or a swap-meet trading in programming ideas. I always learn something interesting, and often something I can take and use at work immediately. But a lot of it is just plain fun. (For example YAPC was my first exposure to massive numbers of laptops with wifi, in '01 or so.)

This year's mailing-list and wiki have been gearing up for a few weeks, and people are starting to make their plans for hacking sessions, being tourists in Chicago and so on. (I've made plans for a less herd-oriented tourist experience; [livejournal.com profile] emaki , another friend Arguile, and I will be touring in a small group on Saturday and Sunday).

The conference planners are taking advantage of the stuff that seems to be called "Web 2.0" these days, including social-networking services, AJAX (which is less server-intensive web tools built with javascript and xml), and "mashups" between web tools. This makes sense; the organizers this year include a number of bloggers, a podcaster, and a part-time magazine-publisher.

Yesterday, they announced the "official tag of YAPC". I initially scoffed, thinking it overkill. Then I thought about what it would be used for; del.icio.us bookmarks, flickr photos, perhaps technorati blog-searches, and google searches. So yes, it makes sense to standardize on a tag, and since most people will be bringing laptops, cameras, blogging, and maybe bookmarking whatever they discover at YAPC, it makes finding stuff in these web services much easier for those of us who come along a bit later.

This morning someone converted the official schedule to ical format, including abstracts. Someone else posted it to Google Calendar, which is pretty handy for me, though I'll probably use ical for the duration of the conference since there isn't a guarantee of network quality.

So what's the point? I suppose it all comes down to laziness. ;) And, hopefully, building on the work of others (and giving it out for others to do the same in an open-sourcy way).

Good evening

Thursday, 20 April 2006 10:53 pm
I'm a happy camper. We just had our first guest presenter at my Perl User Group meeting; he was an excellent speaker, on a great topic [1], followed up by some good local-ish [2] beer, and biking home in shorts and tee-shirt for a total of ~10km today. And [livejournal.com profile] melted_snowball is coming in 2.5 days, huzzah huzzah.

Logistically, in the list of: preparing the talk, presenting the talk, reserving the room, ordering and getting the pizza, paying for the pizza, and cleaning up after the pizza, I only had to do one item. There have been many months when I didn't have to do most of them (some when I did) but I think this time it was distributed more evenly; two people each did two items, the other two were chiefly done by one person each. That is to say, I think we're more organized. I think if I were to be hit by a bus, the group would continue. Which is a good stage to be at.

[1] Cees Hek spoke to us on AJAX - Dynamic web sites with DHTML and Perl: How to use the popular Prototype library to fill your web application with flashy widgets such as draggable lists, autocompleting text boxes and transition effects. With a focus on HTML::Prototype and CGI::Application.

That is to say, some of the magick behind gmail, flickr, and such; sending data without reloading pages. With a minimum of fuss/writing XML (ugh).

[2] I've been corrected. It was by Molson. (*sigh* Shows what I know about beer.) But it was still OK beer; Rickard's Red.

Weekend fun

Monday, 27 March 2006 07:15 pm
Friday night, I went to dinner with Quaker friends; two who are going away on a 4 month trip to walk across Spain. We'll certainly miss them, partly since they are responsible for a lot of the week-to-week repair tasks for the Meeting House. Speaking of which, the weekend also featured not one but two Quaker Meeting House disasters, one sewer-pipe-related and expensive, they other boiler-related and expensive. Those became the capstone to Sunday's Quaker Meeting, which included an emergency Business Meeting to deal with the problems. Otherwise, the Quaker Meeting continued the last month's string of really good Meetings- there were a few surprising messages, all of them good.

Saturday, I lazed and programmed. Fish and I talked about photo mosaics and by the time we were done talking, we were most of the way toward planning the code, so we (mostly he) went ahead and wrote a mosaic-builder. That will get its own post, later.

I also went over to our favourite neighbours' (L & D) house for an extended chat and coffee. They just bought a shiny silver espresso-maker for L's birthday. D, being D, had to try out what happened if he turned on the steam-maker when there wasn't a cup in place ("to clean it out") with predictable results. L, being L, rolled her eyes and shoed him from the room while we made coffee. :)

In the evening, I went to the concert for [livejournal.com profile] melted_snowball's chorus, themed for Easter. Most of the first half was a capella and I was really feeling the harmonies. Great stuff.

Oh, Sunday also featured a walk uptown with [livejournal.com profile] roverthedog, to try and buy a book and a ticket to see Karen Armstrong speak next Saturday (her latest book is about the 9th century BCE, during which time she says all of the following were created: Confucianism and Daoism in China; Hinduism and Buddhism in India; monotheism in Israel; and philosophical rationalism in Greece. I don't exactly believe her dates are that tight; Confucus lived 350 years later; but I liked her other books on comparative theology so I'll go see her speak again.)


Tuesday, 21 March 2006 05:14 pm
da: (duck)
I have a talk to go to at 7. I previously decided to skip the potluck beforehand, because I didn't want to prepare Yet Another Potluck Meal * (it would be the 3rd since Sunday). But I still need to eat.

I also have a dozen and a half deviled eggs left over from last night's potluck. I wasn't sure how I'd manage to eat 'em all before they went bad; even considering I could mush them up into egg salad.

Gee, how ever can I solve both of these problems?...

(*) Not to be confused with Yet Another Perl Monger, which I also don't want to prepare tonight. Anyway.
da: (bit)
This is one of of sixteen perl posts, rescued from my defunct 'use.perl' blog. Comments on that blog will be pasted in as a single comment below.

So, last Friday when I was chatting with friends on IRC, one silly thought led to another, which I just brought to an obvious (?) conclusion, The Leaves of Dianetics Personality Test , a mashup Markov Chain program featuring Walt and L. Ron, together (hopefully) for the first time.

Some sample output:

Do you consider that you read? When recounting some amusing incident can you easily pleased?

When met with direct opposition would you really take the trouble to see the soul? See, your own inferiority?

people enjoy being in your demands on your past illnesses or painful
experiences? Do you consider the best points of most people and only
rarely speak slightingly of them? Do you have little regret on past
misfortunes and failures? Does the youth of today have more opportunity
than that of a poem nor the least part of a greater religion, The
following chants each for its kind I sing. My comrade! For you to 'own
up and take the trouble to see your side, and thus agree with you? Do
you openly and sincerely admire beauty in other people? Do you
sometimes completely unable to enter the spirit of things? Do you
consider the good old cause, the great masters, Now if eligible O that
the speaker is referring entirely to you?

The code is a Markov chain program by Dave Smith.

[perl blog] YAPC day 3

Wednesday, 29 June 2005 12:00 am
da: (bit)
Glad to be home.

First this morning, I went to the MVC talk by Perrin Harkins. He compared three web-app frameworks: CGI::Application, Catalyst, and Open Interact 2; his slides may cover other MVCs he didn't have time to discuss too. This talk felt like it should've been longer than 40 minutes, given the content. He was able to illustrate a bit of sample code, but wasn't really able to compare and contrast as deeply as he has in his online writings. I'm left wanting to learn more, but not knowing if I actually have any more additional knowlege than the little bit I wrote below.

So: briefly:

  • Catalyst features include very flexible URL handling, which you won't get in OI2 (without hacking). There are tools to generate lots of stub methods, for easy startup. However, documentation on this is shaky; perrin had to read sourcecode for 3-4 modules to get that to work. There are good plugins available, which will illustrate ideomatic code for you. Data relationships are stored in perl modules, such as via Class::DBI::Loader::Relationships perhaps.

  • CGI::Application is the most skeletal framework of the three; you end up rolling things yourself or at least, writing enough to piece together some of the (many) good plugins available.

  • Open Interact is quite automatic. You turn it on (it runs its own webserver at the outset), click a few buttons, and you have a MVC. There is more abstraction, for those plusses and minuses (he described one level which he found quite irritating; I didn't catch what it was called...) OI is quite appropriate for large-scale projects, where it will be worth the effort to learn. OI uses lots of configuration files (which I believe is where data relationships can be defined).

So, I have some information to go on for my next web app project. It's frustrating; the last MVC I used was Maypole, which I never quite got working well enough to do anything beyond the examples; since then I've re-invented wheels a few times on small db-backed projects, and I'm loathe to do the same again, but at the same time it's not completely clear that the existing frameworks will satisfy either. Guess I need to dive in and try them...

I skipped the next time-slot to check out and chat with people a bit; I was unhappy about missing Casey West's talk on development tools, but luckily (?) he got bumped due to over-runs and got to give a shorter version to everybody in the afternoon. Which was an awesome talk. He ended up with nine wonderful development tools I am pretty excited to learn about:

  • SQL::Translator - goes from any DBD to any other; and will even make images, too.

  • HTTP::Server::Simple::Static - lets you run a no-muss, no-fuss HTTP server in your web directory, for quick testing.

  • Devel::Cover - How much code are your tests covering? Not only provides answers, but spits out very pretty HTML tables of modules and functions which you can drill down into.

  • podwebserver - another standalone POD database, but looks quite fully-featured. Will show you the source, and tidy/colourize it for you, too.

  • perltidy - speaking of which, perltidy will allow your coding team write using each person's own preferred style, then you can run it through the (highly customizable) perltidy script to make it all standardized.

  • Test::Pod::Coverage - self-evident?

  • DBI::Shell - command-line tool, db equivalent of perl -e (or possibly perl -de1), with handy switches.

  • Module::Refresh - nit sure what this one did

  • CPAN::Mini - 600MiB of current CPAN goodness, as opposed to however many GiB are actually available.

After the morning break, I watched Ingy discurse about Data Driven Testing (so, writing tests in "0 lines of code" which actually means writing config files in a very easy to understand format) and Perldoc, his ideas for making POD suck less. I said "discurse" because he has an amazing ability to go off on tangents that are both trival and very important, and if you're not paying at least as much attention as he is, you might miss what he actually said. For example, I completely failed to take notes during them because they were so entertaining. On the other hand, he wrote the URLs for us to follow along; but I missed it. (Edit: and Autrejus told me what it is, below.)

Lunch was with other KW Mongers, down at the Bon Marche on Bay Street. We debriefed a bit about the morning, but I'm not confident enough about what people said to repeat it here. (See what I did when I echoed Allison on Monday?)

What else. Oh, lightning talks.
Of particular note for me to look up [this is not meant as a slight against those I don't mention!]:

  • The list of all 16 talks is here.

  • Regexp::Compost does automatic Regexp decomposition to make them predict /future/ matches as well. Sounds crazy but the demo seemed cool enough that it might just work for some applications (eg., monitoring web logs). By shields@cpan.org.

  • SPF was invented at YAPC::NA Florida (03)? I had no idea. Anyway, Meng Wong, the creator, is working on two new projects, Domain Keys and "The Karma Project" for improving site-to-site trust, and "RSS email" as a complete reversal of the ideas behind SMTP. URL: somewhere here and possibly here.

  • annocpan.org

  • Not Just Another Perl Hacker: The Perl Foundation is soliciting nominations for the best technical innovations in perl. talk to dha.

  • wikis and cities: cityguides.com

  • the talk of reimplementing CPAN for javascript has found a home; openjsan.org is live, today.

  • there was entertaining juggling. As opposed to lame juggling, which would've happened in other fora, but never at YAPC.

    Must go eat dinner now; more later (for some value of later) when I have a chance to look for stuff I only hinted at above... Comments welcome of course; it might be a few weeks before I respond though, because I'm off to the wilds of Virginia till the 12th. [edit: fixed URLs, 6/30]

    Thanks to all the people who made YAPC possible this year (from the organizers to the speakers to...) It was a lot of fun to help out behind the scenes, such as I was able to. Looking forward to next year.

da: (bit)
A review of YAPC day 1.

Larry Wall's keynote was quite high-level and syncretic. He enthused about tensegrity, the engineering design principle that opposing forces properly balanced can provide tension and integrity at the same time. The talk was based on one he was invited to give in Russia, on how to build an open-source community.

Allison Randal's "state of the carrot" was a snapshot of where perl 5 and perl 6 design are right now. I didn't take notes, but there were some perl6 milestones released the day before, and everything seems to be progressing. PUGs has 80% of perl6 features, wow. [edit: This should be corrected to <30% or 10% (based on fraction of design that has test cases to cover it; see Autrijus's note below!)]

When we all split up, I started off in the "Enterprise Workflow" talk by Jim Brandt, which described how he and his group at the U of Buffalo used a few modules to save their University lots of time and money. The modules were: Class::DBI, Data::FormValidator, and CGI::Prototype. I've not actually done coding with Class::DBI, though I've read about it. Some people seem to dislike it intensely, for any sort of difficult projects, because it creates as much work as it saves. But for simple database lookups and manipulation, it seems like a timesaver.

Then, becasue we were running late and I was hungry, I ducked out and got lunch instead of going to the second talk...

For the afternoon, I took the easiest route and went for the session on Kwiki with Brian Ingerson.
I probably would've decided differently if all of the talks weren't being recorded, but as it is, the other talks looked more formal and his looked more freeform. Sure enough, he started off by saying he was going to one-up Autrijus who wrote the first half of a talk on the train to the client's site, then wrote the second half during the intermission.

Ingy's talk had the first half written last night at 4am, and the second half was going to be written by us.

Sure enough, the first half he presented slides on the architecture of his freeform wiki.

The thing is entirely plugins based, and has interesting abilities to make plugins interact and do the Right Thing with the least amount of code. He invented a number of techniques from scratch, he says because he's too lazy to research how other people have done things. TIMTOWTDI, right? Yeah. The plan is for the design to be a lego set for perl hackers.

Stuff he wrote that he thinks is cool: 'spiffy': a source-filter that adds 'use warnings' and 'strict' and a trailing '1' to each package file, and 'my $self=shift' to each method (this is turned on if you 'use Spiffy qw( -Base )'. -base won't include those. mixins: anonymous class between base-class and current class. like in Ruby. allows for a simple inheritence chain. Allows you to wedge stuff to replace or enhance methods which were either defined or inherited from a parent-class. And, he wrote a program registry, which is shared between plugins, and has some funky interactions which make sense but I didn't write down how it works, sorry.

He decided, when the plugin modules started exploding in number (there are well over 100 now by over 10 main authors), that CPAN wasn't the optimal way to release, since dependencies and versions make things slow to install. Instead, he recommends checking out his svn.kwiki.org.

Interesting feature: 'kwiki -view [blah]' will create a new kwiki named blah, with its own configuration files, but whose data and metadata are symbolicly linked from the parent directory. So it's easy to set up an admin view with extra features.

Brian's not terribly excited by wikis; they were just a means to playing with these new ideas. Spiffy has universal improvements. Spoon is generic techniques that seem interesting outside Kwiki. and Kwiki is built on Spoon.

Spiffy has a function named 'xxx' which will die at that point and do a stack-trace and some sort of variable dump.

I asked about documentation, which is... sparse... and how one is to start learning this when everything is tied together so intimately. He pointed me at doolittle.kwiki.org, which is a wiki which incorporates all of the POD stripped from the live version; (and I believe, checks the POD back into the SVN for the files) when he releases to CPAN, he does a once-over of doolittle and it gets released along with. So the docs are written by the community. In theory. I haven't taken a look at it yet...

The second half was organized around a pair-programming session with him and Chris Dent, where they built a plugin to do tags, like Delicious. It seemed pretty straight-forward, though, I would have loved to have asked more questions about the bugs they worked through. However, I did learn a bunch about debugging kwiki.

Afterward, I met up with other kw.pm mongers, and agreed we'd meet at Simon's house later for beer and chat, and possibly coding.

I was going to precede that with an RT (request-tracker) BOF, which would've been useful for work, but they left before I could get myself sorted out. I'll have to meet Jesse Vincent later on. So instead, I rode around on a segway for a little bit.

So that was my afternoon. Listening to other peoples' afternoons, I'm glad I went for less-structured. Maybe I'll do the perl6 track on Tuesday. Dunno.

In the evening, Simon, Eric and I set up our laptops and started hacking on Bots and Kwiki. Shuchit, Arguile and Greg came a bit later, and we had really good pizza.

We saw a few Futurama episodes (including the Popplers one, yay) and took the train back.

da: (bit)
Well aren't I psyched, because I've gotten the oomph to follow day 1 with day 2. Ha, we'll see about day 3 tomorrow.

Today I pretty much followed the databases track, with a detour at the beginning for 1.5 hours of perl 6 and Pugs. I'm quite impressed with how the perl 6 projects are coming along, though, as Eric/fishbot just told me, he was excited to see how the specs for Grammars have changed since he last looked at them. Now, I'll be excited to learn them when the design is finalized, and I'm excited for neat design development happening, but I'm not a language designer so I'll leave those discussions for those who are competent at such things.

In the database track, I saw a total of 4 Class::DBI talks of various sorts; I'm not convinced it's as useful as some claim, but I'm not actually warned away by the equally strong warnings I've heard from other smart people. Class::DBI seems just right for projects that can deal with a simple model. I suppose the first time I hit a wall with it, it'll be clear where the limitations are. But it seems it can handle many-to-many relationships, the thing I was most concerned about.

I need to look at Shawn Sorichetti's weblog, which will have interesting notes about IMA::DBI, and also I should track down the wiki for Class::DBI.

Casey West's talk about advanced Class::DBI included a number of modules to look at; which will shorten the amount of code you write, even further.

  • Database-specific extensions: there are subclasses of Class::DBI for each of the major DBDs; each has a 'set_up_table' method which will semi-automatically create the tables you need, at compile time (for better and worse).

  • Automatic Class creation: Class::DBI::Loader has a method 'find_class' to shorten class-creation code...

  • Automatic Relationships: Class::DBI::Loader::Relationships will set up simple cases of relationships. Also, Loader has a 'relationships' flag to look into.

  • Globally Unique Keys: ::Loader has parameter for 'additional_classes => [qw [Class::DBI::UUID]] whih uses/adds UUID field for able; it's DB independent and creates 16-character string UUIDs.

  • Automatic XML Serialization: Class::DBI::AsXML (I think this was written by Casey): has 'to_xml_columns' method which will dump XML definitions for your data (non-recursively, I think; it might need more work)

  • Automatic CGI Input: Class::DBI::FromCGI : the name is a misnomer; it can be used for many things besides CGI inputs. It will allow you to define columns/form-entries to untaint (as per type; you can specify integer, printable, etc... Pseudocode:

    use CGI::Untaint;
    # create handler
    my $h = CGI::Untaint->new(CGI->new->Vars):
    my $a = $camoose->create_from_cgi($h);

    Class::DBI::AsForm creates populated or empty form.

Advice: Don't: write a Class::DBI subclass; that namespace is already too populated. Don't reinvent classes already on CPAN.

Do: write a Class::DBI mixin; use exporting to provide your plugin; and use Class::DBI internals.

I need to read up in the docs, and possibly ask Casey what he meant for the last two Do's.

Dan Friedman's talk on Class::DBI::DataMigration describes a framework for basically building a better database programatically, but mostly just requiring a YAML config file that will do the translations. Which certainly sounds easy.

As for non-Class::DBI talks: I enjoyed the Yahoo tlak on high-volume databases and the high-availability talk which suggests corporate appropriateness for MySQL (hm...). Finally, I got a little bit of graph theory schoolin' with Walt Makowski's talk on Graph Theory and one instance when to use trees instead of sets to describe data so it can be combined more quickly.

Gotta go run and catch a boat-cruise. :)

[edit: back. Boy that was a long auction. Why did I think it would feel shorter if it were on a 4-hour boat-cruise? The conversations were excellent, though.]

da: (bit)
OK, this will be an attempt to journal my thoughts about
this year's YAPC. Non technical notes will go in my livejournal.
Who knows whether I'll have time to keep up both; nor which one will
get priority on a particular day.
da: (bit)
Since taking a full-time job last month, I've had a pile of smallish project-requests fall my way. I've been directing people to the perl jobs list, but I'd like to do better than that because these are all for friends or colleagues who I'd like to do the right thing by.

Please drop me email for contact information. Here's the top two gigs:

About one month's work cleaning up a batch of 20 scripts used by an IC fabrication plant. Lots of DBI.

Hand-holding and basic CGI for a website design firm in Vermont. Likely ongoing work in 10-20 hour chunks. My most recent project was building a mySQL membership directory, moving scripts from a windows to linux host, and "cleaning up" some awful CGI, but they didn't have time to pay me to rewrite the bad stuff from scratch.

August 2013

4 5678910


RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Sunday, 24 September 2017 03:12 am
Powered by Dreamwidth Studios