<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="http://wiki.preshweb.co.uk/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="http://wiki.preshweb.co.uk/feed.php">
        <title>PreshWiki</title>
        <description></description>
        <link>http://wiki.preshweb.co.uk/</link>
        <image rdf:resource="http://wiki.preshweb.co.uk/lib/images/favicon.ico" />
       <dc:date>2010-02-26T20:28:14+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="http://wiki.preshweb.co.uk/doku.php?id=perl:tricks&amp;rev=1267177688"/>
                <rdf:li rdf:resource="http://wiki.preshweb.co.uk/doku.php?id=perl:scripts:mp3-rename&amp;rev=1211977617"/>
                <rdf:li rdf:resource="http://wiki.preshweb.co.uk/doku.php?id=postgresql:mysqlcompare&amp;rev=1204648924"/>
                <rdf:li rdf:resource="http://wiki.preshweb.co.uk/doku.php?id=start&amp;rev=1204648132"/>
                <rdf:li rdf:resource="http://wiki.preshweb.co.uk/doku.php?id=perl:daterange&amp;rev=1189078257"/>
                <rdf:li rdf:resource="http://wiki.preshweb.co.uk/doku.php?id=linux:linendings&amp;rev=1185036954"/>
                <rdf:li rdf:resource="http://wiki.preshweb.co.uk/doku.php?id=svn:basicguide&amp;rev=1182342194"/>
                <rdf:li rdf:resource="http://wiki.preshweb.co.uk/doku.php?id=linux:mailman&amp;rev=1182340961"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="http://wiki.preshweb.co.uk/lib/images/favicon.ico">
        <title>PreshWiki</title>
        <link>http://wiki.preshweb.co.uk/</link>
        <url>http://wiki.preshweb.co.uk/lib/images/favicon.ico</url>
    </image>
    <item rdf:about="http://wiki.preshweb.co.uk/doku.php?id=perl:tricks&amp;rev=1267177688">
        <dc:format>text/html</dc:format>
        <dc:date>2010-02-26T09:48:08+00:00</dc:date>
        <dc:creator>David Precious</dc:creator>
        <title>perl:tricks</title>
        <link>http://wiki.preshweb.co.uk/doku.php?id=perl:tricks&amp;rev=1267177688</link>
        <description>Here's some random useful tricks with Perl, which aren't long enough to warrant their own pages.

Find longest entry in array


A quick way to find the length of the longest value in an array:


my @array = ('foo', 'bar', 'badger', 'wibble');

my $longest = (reverse sort { $a &lt;=&gt; $b } map { length($_) } @array)[0];</description>
    </item>
    <item rdf:about="http://wiki.preshweb.co.uk/doku.php?id=perl:scripts:mp3-rename&amp;rev=1211977617">
        <dc:format>text/html</dc:format>
        <dc:date>2008-05-28T13:26:57+00:00</dc:date>
        <dc:creator>David Precious</dc:creator>
        <title>perl:scripts:mp3-rename</title>
        <link>http://wiki.preshweb.co.uk/doku.php?id=perl:scripts:mp3-rename&amp;rev=1211977617</link>
        <description>mp3-rename.pl

 A simple script to rename MP3 files based on the ID3 tags.


#!/usr/bin/perl


# Rename MP3s in a given directory based on their ID3
# tags.
# 
# David Precious, originally 10/04/2006
#
# $Id: mp3-rename.pl 376 2008-05-28 12:21:59Z davidp $
#
# TODO: if ID3 'track' tags not given, auto-number tracks
#       based on the order we saw them in
# TODO: extend to support Ogg Vorbis (.ogg) and MP4 files

use strict;
use File::Recurse;
use MP3::Tag;
use Cwd;
use Term::ReadKey;

my $star…</description>
    </item>
    <item rdf:about="http://wiki.preshweb.co.uk/doku.php?id=postgresql:mysqlcompare&amp;rev=1204648924">
        <dc:format>text/html</dc:format>
        <dc:date>2008-03-04T16:42:04+00:00</dc:date>
        <dc:creator>David Precious</dc:creator>
        <title>postgresql:mysqlcompare</title>
        <link>http://wiki.preshweb.co.uk/doku.php?id=postgresql:mysqlcompare&amp;rev=1204648924</link>
        <description>PostgreSQL for MySQL users

 Quick tips for people who are familiar with MySQL, to help migrate to using PostgreSQL.

Quick command reference
 MySQL                               PostgreSQL                              USE database                        \c[onnect] database                     SHOW TABLES [FROM database]         \dt                                     DESCRIBE TABLE table                \d table                               
 (Finish this later)</description>
    </item>
    <item rdf:about="http://wiki.preshweb.co.uk/doku.php?id=start&amp;rev=1204648132">
        <dc:format>text/html</dc:format>
        <dc:date>2008-03-04T16:28:52+00:00</dc:date>
        <dc:creator>David Precious</dc:creator>
        <title>start</title>
        <link>http://wiki.preshweb.co.uk/doku.php?id=start&amp;rev=1204648132</link>
        <description>Welcome to my wiki.  I had a page of notes I'd jotted down as I went along, useful reminders on quick ways to do stuff, but it was not easy enough to manage, so I've installed DokuWiki to make it easy to make notes, both for myself and for anyone else who may find them useful.</description>
    </item>
    <item rdf:about="http://wiki.preshweb.co.uk/doku.php?id=perl:daterange&amp;rev=1189078257">
        <dc:format>text/html</dc:format>
        <dc:date>2007-09-06T12:30:57+00:00</dc:date>
        <dc:creator>David Precious</dc:creator>
        <title>perl:daterange</title>
        <link>http://wiki.preshweb.co.uk/doku.php?id=perl:daterange&amp;rev=1189078257</link>
        <description>I needed to calculate a date range in Perl, to work out today's date and the 14 previous days.  There are plenty of ways to do it, but I didn't really want to install a module like Date::Range to do something this simple.

So, my solution was:


my $ctime = time;

my $days = 14;
my @dates;

while (@dates &lt; $days) {
    push @dates, scalar localtime $ctime;
    $ctime -= (60 * 60 * 24);
}

print &quot;dates are:\n&quot;;
print &quot;$_\n&quot; for @dates;</description>
    </item>
    <item rdf:about="http://wiki.preshweb.co.uk/doku.php?id=linux:linendings&amp;rev=1185036954">
        <dc:format>text/html</dc:format>
        <dc:date>2007-07-21T17:55:54+00:00</dc:date>
        <dc:creator>David Precious</dc:creator>
        <title>linux:linendings</title>
        <link>http://wiki.preshweb.co.uk/doku.php?id=linux:linendings&amp;rev=1185036954</link>
        <description>Quick ways to convert Windows/DOS style line endings (CRLF / \r\n) with Unix style (LF / \n).

If the dos2unix / unix2dos commands are available, they're a quick, simple way to do it.

If not, the following commands ought to do it:


sed -e 's/$/\r/' inputfile &gt; outputfile  # Unix to DOS
sed -e 's/\r//'  inputfile &gt; outputfile  # DOS to Unix

# or to get sed to make the changes to the file directly (edit in-place),
# use the -i option... this means you can also glob to apply it to several
# file…</description>
    </item>
    <item rdf:about="http://wiki.preshweb.co.uk/doku.php?id=svn:basicguide&amp;rev=1182342194">
        <dc:format>text/html</dc:format>
        <dc:date>2007-06-20T13:23:14+00:00</dc:date>
        <dc:creator>David Precious</dc:creator>
        <title>svn:basicguide</title>
        <link>http://wiki.preshweb.co.uk/doku.php?id=svn:basicguide&amp;rev=1182342194</link>
        <description>This is a very basic quick start guide to the most common SVN commands.

Creating a Repository


Use the svnadmin command to create and manage repositories:


svnadmin create /path/to/repository


Importing files into repository


To import existing dirs and files into the repository:</description>
    </item>
    <item rdf:about="http://wiki.preshweb.co.uk/doku.php?id=linux:mailman&amp;rev=1182340961">
        <dc:format>text/html</dc:format>
        <dc:date>2007-06-20T13:02:41+00:00</dc:date>
        <dc:creator>David Precious</dc:creator>
        <title>linux:mailman</title>
        <link>http://wiki.preshweb.co.uk/doku.php?id=linux:mailman&amp;rev=1182340961</link>
        <description>Clearing held messages from moderator queue


With the amount of spam these days, the moderation queue can quickly become unmanageable.

If you need to clear all messages from the queue, look at data/heldmsg* (for 
my installation, that's /usr/local/mailman/data/heldmsg*).</description>
    </item>
</rdf:RDF>

