<?xml version="1.0"?>
<!-- name="generator" content="blosxom/2.0.2" -->
<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">

<rss version="0.91">
  <channel>
    <title>peteg's blog   2007-01-07-Blosxom.autumn</title>
    <link>http://peteg.org/blog</link>
    <description></description>
    <language>en</language>

  <item>
    <title>img update.</title>
    <link>http://peteg.org/blog/2007/03/20#2007-03-20-img</link>
    <category>/noise/blogging/img</category>
    <description>
&lt;p&gt;

A massive port of some of my old &lt;a href=&quot;http://peteg.org//plog/&quot;&gt;PLog&lt;/a&gt; entries led me to update the img
plugin. Now it does some fancier &lt;a href=&quot;http://www.w3.org/Style/CSS/&quot;&gt;CSS&lt;/a&gt; stuff. Enjoy.

&lt;/p&gt;

&lt;ul&gt;

&lt;li&gt;&lt;a href=&quot;http://peteg.org/static/img&quot;&gt;img&lt;/a&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;

&lt;a href=&quot;http://www.w3.org/Style/CSS/&quot;&gt;CSS&lt;/a&gt; brokenness: The &lt;a href=&quot;http://www.w3.org/Style/CSS/&quot;&gt;CSS&lt;/a&gt; gunk from some &lt;a
href=&quot;http://www.w3.org/Style/Examples/007/figures.html&quot;&gt;W3 style
examples&lt;/a&gt; which works fine... if you don't mind your images flush left or
right.  Why is there no simple way to centre arbitrary objects?

&lt;/p&gt;</description>
  </item>
  <item>
    <title>99writeback</title>
    <link>http://peteg.org/blog/2007/01/28#2007-01-28-writeback</link>
    <category>/noise/blogging/writeback</category>
    <description>
&lt;p&gt;

I got a few doses of blog clap, and being bored and idle I put some effort
into tidying up &lt;a href=&quot;http://blosxom.ookee.com/blog/&quot;&gt;Blosxom&lt;/a&gt;'s venerable &lt;code&gt;writeback&lt;/code&gt; plugin and
adding &lt;a href=&quot;http://captchas.net/&quot;&gt;Captcha&lt;/a&gt; support. (I don't believe in the centralised blacklisting
epitomised by &lt;a href=&quot;http://akismet.com/&quot;&gt;akismet&lt;/a&gt;, it's too readily
abused.) I get the impression that somebody in &lt;code&gt;ee&lt;/code&gt; land is
manually spamming, so I might need a plan B. My other concern is that the &lt;a href=&quot;http://captchas.net/&quot;&gt;Captcha&lt;/a&gt; times out, meaning that if you take longer than a day to go from
page load to post-comment it will bugger you up. Also the interaction with
the back button is less than ideal.

&lt;/p&gt;

&lt;ul&gt;

&lt;li&gt;&lt;a href=&quot;http://peteg.org/static/99writeback&quot;&gt;99writeback&lt;/a&gt; (plugin)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://peteg.org/static/writeback&quot;&gt;writeback&lt;/a&gt; (flavour file for writebacks)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://peteg.org/static/writebacksform&quot;&gt;writebacksform&lt;/a&gt; (flavour file for the writeback form)&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;

You'll need to instruct &lt;a href=&quot;http://www.cpan.org/&quot;&gt;CPAN&lt;/a&gt; to &lt;code&gt;install Authen::Captcha&lt;/code&gt; (or
use your package manager to do it for you, or remove those bits of code). It
should be easy to adapt it to
 use another &lt;a href=&quot;http://captchas.net/&quot;&gt;Captcha&lt;/a&gt; library. I'm thinking
about constructing a logic-puzzle one.

&lt;/p&gt;

&lt;p&gt;

Part way through I realised just how fragile &lt;a href=&quot;http://blosxom.ookee.com/blog/&quot;&gt;Blosxom&lt;/a&gt; is (no non-word
characters in directory names? &amp;mdash; and I was going to call this
&lt;em&gt;writeback++&lt;/em&gt;!) and how badly coded most plugins are (let's do
everything ourselves! date functions, interpolation, file-backed databases,
...). If my &lt;a href=&quot;http://www.perl.org/&quot;&gt;perl&lt;/a&gt; was more fluent I'd have a shot at linting it all.

&lt;/p&gt;</description>
  </item>
  <item>
    <title>Hacking the &lt;a href=&quot;http://feedvalidator.org/&quot;&gt;RSS&lt;/a&gt; feed into shape.</title>
    <link>http://peteg.org/blog/2007/01/07#2007-01-07-Blosxom</link>
    <category>/noise/blogging</category>
    <description>
&lt;p&gt;

Blosxom's stitch-the-template-and-content-together code is pretty
nasty. Well, it's simple up to the point when one tries to use a fancy
interpolation (substitution) engine to, say, implement a schmick
&lt;code&gt;img&lt;/code&gt; tag. &lt;a href=&quot;http://feedvalidator.org/&quot;&gt;RSS&lt;/a&gt;'s not-invented-here-edness purportedly
disallows &lt;a href=&quot;http://www.w3.org/&quot;&gt;HTML&lt;/a&gt; in the feed, but in practice it appears that's fine
provided all the tags are suitably &lt;a href=&quot;http://www.w3.org/&quot;&gt;HTML&lt;/a&gt; armoured, which was the hoop
that &lt;a href=&quot;http://blosxom.ookee.com/blog/&quot;&gt;Blosxom&lt;/a&gt; was dutifully leaping through. I just tweaked the main
script so that some interpolation occurs before the escaping, and the same
again and some more after. Voila, with ugliness comes images. Yes, this sort
of thing makes one yearn for a mainstream blogging engine.

&lt;/p&gt;
&lt;p&gt;

While I'm ranting I've gotta say &lt;a href=&quot;http://www.perl.org/&quot;&gt;perl&lt;/a&gt;'s approach of making everything
magical wears thin fast. I want predictability, and while I accept that API
docs are written to be read I don't appreciate having to read
&lt;code&gt;perlsyn&lt;/code&gt; and &lt;code&gt;perlop&lt;/code&gt; (and &lt;code&gt;perlre&lt;/code&gt;)
manpages while doing simple imperative programming. How about: &lt;em&gt;small
language, verdant libraries&lt;/em&gt; instead of &lt;em&gt;here's fifteen ways to write
an enumerator&lt;/em&gt;? The great ideas in the language and fantastic libraries
are heavily obfuscated by noise, and I don't believe it's possible to write
robust &lt;a href=&quot;http://www.perl.org/&quot;&gt;perl&lt;/a&gt; applications &amp;mdash; aspect-oriented programming has nothing
on this for spaghetti. Any sane person looking at the &lt;code&gt;perlsec&lt;/code&gt;
manpage must surely agree with me &amp;mdash; &lt;code&gt;taint&lt;/code&gt;ing supposedly
works provided one doesn't defeat it, by omission or commission. Mutter,
mutter.

&lt;/p&gt;
&lt;p&gt;

Is it just my &lt;a href=&quot;http://www.apple.com/safari/&quot;&gt;Safari&lt;/a&gt; that struggles with &lt;a href=&quot;http://feedvalidator.org/&quot;&gt;RSS&lt;/a&gt; feeds? Those bugs have
been there for years now.

&lt;/p&gt;</description>
  </item>
  <item>
    <title>&lt;a href=&quot;http://blosxom.ookee.com/blog/&quot;&gt;Blosxom&lt;/a&gt; plugin: img</title>
    <link>http://peteg.org/blog/2007/01/03#2007-01-03-img</link>
    <category>/noise/blogging/img</category>
    <description>
&lt;p&gt;

(or: reinventing &lt;a href=&quot;http://peteg.org//plog/&quot;&gt;PLog&lt;/a&gt;, one piece at a time.)

&lt;/p&gt;
&lt;p&gt;

I wanted to add images to the blog, and as I'm fed up with &lt;a href=&quot;http://www.imagemagick.org/&quot;&gt;ImageMagick&lt;/a&gt; I
was relieved to find that someone has written a more usable replacement for
&lt;a href=&quot;http://www.perl.org/&quot;&gt;perl&lt;/a&gt; called &lt;a href=&quot;http://imager.perl.org/&quot;&gt;Imager&lt;/a&gt;. You'll need to
install that first, and it should be as easy as politely asking &lt;a href=&quot;http://www.cpan.org/&quot;&gt;CPAN&lt;/a&gt; to
do it for you. Also you'll need &lt;a
href=&quot;http://www.blosxom.com/plugins/interpolate/interpolate_fancy.htm&quot;&gt;&lt;code&gt;interpolate_fancy&lt;/code&gt;&lt;/a&gt;
so you can invoke the method in your stories. Here's the code:

&lt;/p&gt;

&lt;ul&gt;

&lt;li&gt;&lt;a href=&quot;http://peteg.org/static/img&quot;&gt;img&lt;/a&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;

The instructions are in the script. It's still quite rough, and I'll be
updating it as I go along. Take a good look at your error logs if things
don't work.

&lt;/p&gt;

&lt;div class=&quot;figure&quot;&gt;
&lt;p&gt;&lt;a href=&quot;http://peteg.org//static/IMG_1667.JPG&quot;&gt;&lt;img src=&quot;http://peteg.org//static/cache/tn_IMG_1667.JPG&quot; width=&quot;93&quot; height=&quot;70&quot; class=&quot;scaled&quot; style=&quot;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;


&lt;p&gt;

The existing &lt;a href=&quot;http://blosxom.ookee.com/blog/&quot;&gt;Blosxom&lt;/a&gt; image plugins are a lot fancier than this; I just
wanted something that generates thumbnails and automatically adds the
requisite attributes to the &lt;code&gt;img&lt;/code&gt; tag. This photo is from my trip
up to Berilee last month &amp;mdash; if you squint you can see the car ferry at
Berowra Waters. The markup is:

&lt;/p&gt;

&lt;pre&gt;

&amp;lt;@img.img src=&quot;IMG_1667.JPG&quot;
 style=&quot;border-style: none; margin: 0 0 10px 10px; float: right; clear: right;&quot; /&amp;gt;

&lt;/pre&gt;

&lt;p&gt;

which, when run on my &lt;a href=&quot;http://www.apple.com/ibook/&quot;&gt;iBook&lt;/a&gt;, results in the &lt;a href=&quot;http://www.w3.org/1999/xhtml&quot;&gt;XHTML&lt;/a&gt;:

&lt;/p&gt;

&lt;pre&gt;
&amp;lt;a href=&quot;http://localhost/~peteg/images/IMG_1667.JPG&quot;&amp;gt;&amp;lt;
 img src=&quot;http://localhost/~peteg/images/cache/tn_IMG_1667.JPG&quot;
 width=&quot;93&quot;
 height=&quot;70&quot;
 style=&quot;border-style: none; margin: 0 0 10px 10px; float: right; clear: right;&quot;
 alt=&quot;&quot; /&amp;gt;&amp;lt;
/a&amp;gt;
&lt;/pre&gt;

&lt;p&gt;

I get the impression that the &lt;code&gt;interpolate_fancy&lt;/code&gt; plugin doesn't
like having newlines in the arguments.

&lt;/p&gt;
&lt;p&gt;

...and yes, I am vaguely aware that those suckling on the &lt;a href=&quot;http://feedvalidator.org/&quot;&gt;RSS&lt;/a&gt; nipple are
not getting the full technicolour experience. Bear with me.

&lt;/p&gt;</description>
  </item>
  </channel>
</rss>
