| pg 1 of 2 | More |

revford blog

Install the neutron flow


      Traveller UWP Decoder Update

Wed, 01 Sep 2010 17:44:57 GMT

Just a quick update, the decoder was borking over system names with spaces in, all fixed now.


     Traveller Search Galaxy, proof of concept

Tue, 31 Aug 2010 02:14:46 GMT

Another new Traveller tool for the website, it's a search tool to find planetary information.

Searches return UWPs you can click on to get a plain English description, they lead to the decode UWP page I update the other day.

You can search on any part of a UWP, most useful would be a planet name or remark. For example, searching for Green would return all systems with Green in the name, while searching for Ga would return all planets with Ga in the name and all planets with the remark Ga for Garden World.


This is very much a test of concept, it currently only covers a few subsectors of the Spinward Marches and Foreven Sectors. This will improve once I get motivated to enter more data, or talk David into doing some more of it.

As we create our own universes for Traveller games, I'll add search boxes for them too.


Traveller

     Traveller UWP decoder updated, now useful

Sun, 29 Aug 2010 15:38:13 GMT

I've finally made the traveller UWP decoder useful.

It now has two modes of operation, you can access it with a link as before:

Emape 0103 B564500-B N I Ag Ga NI A G

Or just go directly to the page where you'll get a box like this one, where you can enter your own UWP and hit enter to decode.


As a bonus it now translates the remarks to plan text descriptions, to save you remembering what Ag and Ht mean.


I am planning more features, like a searchable database of OTU worlds, but all that is for the future. It's taken most of the year for me to drag my lazy arse back to this and add an entry box.


UWP Decoder

     Traveller UWP decoder

Thu, 04 Feb 2010 17:37:31 GMT

I've added a simple web based UWP (Universal World Profile) decoder, it should turn regular Traveller UWPs into a human readable description of the world.

I've turned all the UWPs on the Machine Parts Transit Solutions page into links that decode them. Which is much more useful than code only Dave can read. :)

Here are a few examples:


Traveller: Machine Parts Transit Solutions

     Site Updated

Sun, 02 Aug 2009 13:46:38 GMT

It's been months but I've finally managed to sit down and write some more proper code.

I've replaced more of the Javascript that drives this site with Perl, this means more of the work is carried out offline, on my machine that generates and uploads this site, leaving less work for the web browsers of visitors to do.

Basically that means the whole site should speed up a bit. We should loose that second or so delay before the menu and logo appear.

I've also stopped trying to fix things for IE 6 now. Seriously now if you're still using IE 6 you should either switch to a standards compliant browser [Firefox| Opera|Chrome| Safari|Lynx] or at worst upgrade to a more recent version of IE.

    iPlayer Search Updated

Fri, 24 Apr 2009 16:22:30 GMT

I know it's been a while without it working now but I've finally updated my iPlayer search tool, the BBC changed the format of the results pages again which broke the old version.

Just replace the old lib-rf-iplayer.dl with this new version.

# lib-rf-iplayer.pl # by Gav Ford # gav@revford.co.uk # http://revford.co.uk # 2008-04-17, updated 2009-04-24 # subroutines for dealing with the BBC iPlayer sub iplayersearch # search the iPlayer and return a list of result URLs { $searchterm = $_[0]; @resultspage = split(/\n/, get('http://www.bbc.co.uk/iplayer/search/?q=' . $searchterm)); ($resultbox) = grep {/div\ class\=\"episode/} @resultspage; @results = split (/\>/, $resultbox); @results = grep {/a\ class\=\"episode-title/} @results; foreach (@results) { $thisresulturl = $_; ($null, $null, $null, $thisresulturl) = split(/\"/, $thisresulturl); push(@resultlist, 'http://www.bbc.co.uk' . $thisresulturl); } return (@resultlist); } sub iplayertitle # take an iPlayer URL and find some program information { $pageurl = $_[0]; @showpage = split(/\n/, get($pageurl)); ($showtitle) = grep {/title/} @showpage; $showtitle =~ s/\ \ /\ /g; $showtitle =~ s/\<[^\<]+\>//g; $showtitle =~ s/\t|\n|//g; $showtitle =~ s/BBC\ iPlayer\ -\ //; return ($showtitle); } 1;

Now I can go back to forgetting Heroes is on Mondays and catching up on the iPlayer.

   Bookmarks

Wed, 04 Feb 2009 12:35:09 GMT

As a special bonus for Harvey, you can now access my browser bookmarks here:

Bookmarks

     Random Pathfinder NPC, tiny update

Mon, 22 Dec 2008 06:58:52 GMT

I've started to make some tiny updates to my random Pathfinder NPC generator. A few more serious updates are planned.

for a start I've removed the terms Hero and Paragon from the level options, as they are from D&D4, the system we were looking at before we fell for Pathfinder.

Next up will be properly replacing the old D&D3 code with the Pathfinder code, then incorporating any new options from David's Perl NPC generator into this one.

Following on from there, will be stats by points buy (set arrays), rather than dice roll (random number generation).


Pathfinder Mk 1 Complete
Pathfinder NPC

    Conky Theme

Tue, 21 Oct 2008 10:32:05 GMT

The fancy transparent system monitor dodah that has replaced a few old dockapps for me, Conky is itself an updated decedent of Torsmo.

I've recently updated my theme/config with more information and colours to match my other themes.

screenshot of conky
conkyrc

Remember to edit the conkyrc file to point to your own mail spool (or just) delete that line, it's currently set to /var/spool/mail/gav .

The volume detection requires two simple scripts, save these in your ~/bin or wherever you like to store scripts.

vol-now-mas

#!/usr/bin/perl ($null, $volume) = split(/\ /, `aumix -v q`); $volume =~ s/\,//; print "$volume\n";

vol-now-pcm

#!/usr/bin/perl ($null, $volume) = split(/\ /, `aumix -w q`); $volume =~ s/\,//; print "$volume\n";

   iPlayer Search Tools updated

Thu, 25 Sep 2008 19:01:51 GMT

Updated the iPlayer Search tools, simple console based search tools for the BBC iPlayer.

No new functionality, just cleaning up the output and slimming down the code.

Just a simple update this time, cleaning up the show title information. When the BBC last updated the iPlayer is started getting more detailed headings, I'll simply use these now rather than messing about trying to pull different bits of information together.


Libraries
lib-rf-iplayer.pl

Download
iplayer-search
iplayer-notify

    New Site Feature, Sortable News Updates

Wed, 24 Sep 2008 23:26:45 GMT

A new feature for the website, you can now click on the news topic icons to get all news posts on that subject.

So if you just want news about roleplaying, click on a icon like this:

d20

It makes things quicker to find than trawling through 17 pages of posts.

   Perl Icon

Tue, 23 Sep 2008 02:55:08 GMT

I've been trying to fine-grain the subject icons on the site recently, with a view to later creating a way of sorting posts by subject. This is a way off yet and shouldn't be too hard to code once I get around to it.

Back closer to the topic, I wanted to add icons for the different kinds of code I write, those being mostly Perl and Javascript. Thinking this would be simplest, I started with Perl.

The obvious thing was to use the Camel.

Well, no, it turns out that the use of the Camel, in reference to Perl is the IP of O'Reilly, who publish The Camel Book, one of the standard texts on Perl.

O'Reilly have published some, well, overly strict guidelines on the use and formatting of the Camel logo here.

Usage Guidelines for the Programming Republic of Perl Logo

The part that makes this most useless to me, is the fact I can't resize it or colour it to match my site.

The fact I have to make any use of it a link back to perl.com doesn't help either.

The other known icon for Perl is the Onion, this however is the IP of The Perl Foundation. They also have a page of rules governing the use of the Onion.

Perl Trademark

Similar guidelines here, requiring that the logo link back to perl.org this time.

Which is a shame, as it basically means I can't use either.

So, I've been out and looked for an image I can work with, that doesn't infringe on the logos, icons, trademarks or any other kind of IP of either O'Reilly or The Perl Foundation, but still suggests Perl to me and others.

Wikimedia Commons to the rescue, a search for camels found me this public domain image of a Camel Skeleton.

Image:CamelSkelLyd2.png

It is public domain and very clearly not the O'Reilly Camel. Due to it's skeletal nature.

Bare Bones Bare Bones Bare Bones

So, the Bare Bones icon. For my simple Perl coding projects.

   Roleplay Tools in Perl

Thu, 04 Sep 2008 14:22:26 GMT

I've been collecting together the Perl versions of my various random stuff for roleplay programs, collecting the arrays and subroutines into a shared library of code so I can combine the effects in new ways.

I started this a while back, but the last few days I've got all the old code moved over.

As a first step, here are the old programs, tavern, dishoftheday, names-male and names-female converted to use the combined library.

As an example, here is the new version of tavern:

#!/usr/bin/perl # tavern # by Gav Ford # revford@blueyonder.co.uk # http://revford.pwp.blueyonder.co.uk # 2008 early # Tavern Name Generator use FindBin '$RealBin'; require "$RealBin/lib-rf-roleplay.pl"; print tavern() ."\n";

The $RealBin finds the directory where you've put the program and finds the library there.

Then it's simple calling the tavern() function from library and printing the result.

To install all this stuff, just dump it in a directory together and run the programs from a terminal.

If terminals aren't you're thing, there are still the web based Javascript versions here:

Roleplay Menu


As well as these roleplay tools, I've converted the technobabble generator in the same way. The sitebuild tools that create this page now use the babble library for the blog pages.

The plan is to create more kinds of technobabble and add them to the babble library soon.


Roleplay Library, contains the meat of the code and is required by all the tools
lib-rf-roleplay.pl

Programs, these are the individual programs
tavern
dishoftheday
names-female
names-male


Babble Library, required by the babble tool
lib-rf-babble.pl

Program, the babble program
babble

  Bookmarks in Firefox 3

Fri, 08 Aug 2008 11:30:14 GMT

I'm almost happy with Firefox 3 now, all the extensions I like are ported over now, it starts faster and uses less RAM.

That said, the new bookmarks system is a royal pain in the arse.

The old system dates back to the early Netscape days, bookmarks were stored in a slightly weird HTML file called bookmarks.html. Nice and simple, this system didn't really change through all the versions of Netscape, Mozilla and all the way up to Firefox 2.

As a simple HTML file, it was easy to parse with a bit of Perl to make a fancy start page.

Firefox 3 has switched this to a lightweight SQL database. Overkill doesn't even start to describe this, a single text file replaced by a database really is taking the piss.

You can export a bookmarks.html file, in the editing bookmarks window, or you can root through about:config and set the option browser.bookmarks.autoExportHTML to true, this exports each you shut down the browser.

None of this is as good as the old system to me, if I added a new bookmark, a simple reload on the start page was enough to make it appear. With Firefox 3, I need to restart the browser or go through a mess of menus and dialogue boxes to update it.

As a bonus pain in the arse, the new Firefox system renamed all the &amp; in URLs to &, not a big deal as it's easy to fix, but a pain none the less.

So, I decided to simplify everything and manage the bookmarks myself. I quickly settled on a plain text format of URL then description on a single line, any headings would be just a description. The code could tell what is a URL and what is a heading by checking to see if the line starts with http.

A quick example:

Forums - Regular http://www.lead-adventure.de/index.php?action=unread Lead Adventure http://www.worldeaters.net/search.php?search_id=newposts WorldEaters

Nice and clean, human readable. A blank line between sections is fine.

And here is the code to read it:

# take a list of URLs and descriptions and format them as HTML, used by index.pl sub bookmarkup { @incoming = grep {$_ =~ /[A-Z]|[a-z]/} @_; foreach (@incoming) { chomp ($_); if($_ =~ m/http/i) { @thislink = split(/ /, $_); $thisurl = shift(@thislink); $thisdesc = join(' ', @thislink); $_ = ' <a href="' . $thisurl . '">' . $thisdesc . '</a><br>' . "\n"; } else {$_ = "\n" . ' <h2>' . $_ . '</h2>' . "\n";} } @incoming; }

First we grep for lines that include words, this cleans out all the blank lines.

On each entry, we chomp the new line of the end, if the line starts with http we format it as a link, if it doesn't we format it as a header.

It all works fine, I just wish I could come up with a cleaner way to take the first word from a string than the split, shift, join that I'm using now.

   iPlayer search tools updated

Sat, 12 Jul 2008 23:54:32 GMT

When the iPlayer was updated recently it broke my old search tool. I fixed it up and here is the new lib.

The tools are still fine, just replace the old lib file with this one:


lib-rf-iplayer.pl

   Bristol & Bath PM map, Temple Meads to The Watershed

Thu, 15 May 2008 23:02:50 GMT

map

The route from Temple Meads to The Watershed, the base is from Google Maps and I added a route in The GIMP.

Clicky-clicky the image for a bigger version.

   iPlayer tools

Sat, 03 May 2008 13:47:47 GMT

I've been fiddling with a bit more Perl code and built two versions of a quite useful tool for searching the BBC iPlayer.

There is no system for subscribing to shows so I can see when new episodes appear.

So I made one.

It's very simple, runs as a cron job and sends me an e-mail when episodes of of shows I'm interested in appear.

All these tools require LWP::Simple, which Ubuntu/Debian users can install from the console with:

sudo aptitude install libwww-perl

Everyone else can use CPAN.

perl -MCPAN -e 'install LWP::Simple'

As I have a few tools that search the iPlayer and tell me about it in different ways, I moved the actual searching subroutine into a shared file.

lib-rf-iplayer.pl

So first up, here is the simple iPlayer search tool modified to use this.

iplayer-search

This presents the results in a nicely colour coded way, like this:

BBC iPlayer search results
search term: QI 

QI: Series 5  -  Europe
http://www.bbc.co.uk/iplayer/page/item/b0082hyx.shtml

While this looks nice, I needed a version that is silent when there is no hits, iplayer-search always returns the header and the search term, also the ANSIColor details make no difference when viewed with a mail client, so I can leave them out too.

The quiet and plain version is called iplayer-notify:

iplayer-notify

This I add as cron jobs, using:

crontab -e

Like this:

# BBC iPlayer notifications, searches run every day
#   m   h  dom mon dow   command
   00  05    *   *   *   /home/gav/bin/iplayer-notify Doctor Who
   03  05    *   *   *   /home/gav/bin/iplayer-notify Spooks
   06  05    *   *   *   /home/gav/bin/iplayer-notify Waking the Dead
   09  05    *   *   *   /home/gav/bin/iplayer-notify QI
   12  05    *   *   *   /home/gav/bin/iplayer-notify Timewatch
   15  05    *   *   *   /home/gav/bin/iplayer-notify Torchwood
   18  05    *   *   *   /home/gav/bin/iplayer-notify Have I Got News for You

So each morning I get e-mails about any available episodes of shows I may like to see.

Make sure you set your actual email address in the crontab file, like this:

MAILTO="revford@blueyonder.co.uk"

Obviously use your own address not mine. You need it to tell you when your shows are on, not me. :)

Hopefully that will be a bit helpful to someone.

   Bristol and Bath Perl m[ou]ngers

Fri, 02 May 2008 20:59:40 GMT

bristolbath.org

Like the Constructicons before them, the BristolPM and BathPM lists rise from their slumber and combine to form Devastator.

Well, not Devastator, but the BristolBathPM.

It's a mailing list for Perl coders in the Bristol & Bath area. Now hosted on bristolbath.org.

Bristol and Bath Perl m[ou]ngers

   iplayer-search

Thu, 17 Apr 2008 01:51:46 GMT

Some new code here, a nice simple tool for searching the BBC iPlayer written in Perl.

Wang in a few terms and it returns links to shows with descriptions.

Usage and results example:

$ iplayer-search Doctor Who
BBC iPlayer search results
search term:  Doctor+Who

Doctor Who Confidential: Series 4  -  The Italian Job
http://www.bbc.co.uk/iplayer/page/item/b009yy2z.shtml

Doctor Who: Series 4  -  The Fires of Pompeii
http://www.bbc.co.uk/iplayer/page/item/b009wzbf.shtml

Doctor Who Confidential: Series 4  -  A Noble Return
http://www.bbc.co.uk/iplayer/page/item/b009v6v3.shtml

Doctor Who: Series 4  -  Partners in Crime
http://www.bbc.co.uk/iplayer/page/item/b009w049.shtml

Grab the code:
iplayer-search

   Random Name generators in Perl

Sun, 30 Mar 2008 02:50:45 GMT

A bit of an experiment here, a Perl version of the random Chondathan name generator. This time broken down into an included file with the subroutines in and two front end scripts.

lib-rf-names.pl
names-female
names-male

To make use of these as they are, you'll have to adjust the front ends, names-female and names-male to match where you installed lib-rf-names.pl.

I'm going to see about building a more portable module next.

| pg 1 of 2 | More |

 HTML5
 CSS3
CC
2010-09-01