| pg 1 of 3 | More |

revford blog

Calibrate the radio grid


      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

    Audio Player Updated

Sun, 29 Aug 2010 20:32:45 GMT

Updated the media player slightly, simplified it to a one button that switches between play and pause, rather than two individual buttons.

There is also a movie player in the code, but I've got no movies to post at the mo.

Grab the code from the links at the bottom.


media-player.js
media.css

     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

   HTML5 and CSS3

Sun, 29 Aug 2010 01:47:31 GMT

HTML5
I should have mentioned this in one of the previous site update posts, but I've moved over to HTML5 for the site now. This is long overdue as it makes things easier for me and all the modern browsers have great support for it.

The only thing holding me back was a Firefox validator extension, but I've given up waiting on it to add HTML5 support. This means I'm back to having validator links on the pages, they don't hurt so don't worry about them.

CSS3
The code that's causing pages to not validate is still the -moz- variants of border-radius for Gecko. I like the effect too much to give it up to make my code validate. The WebKit browsers no longer require the -webkit- addition. Come on Mozilla, catch up.

It doesn't cause problems for browsers that don't support it. It just gets ignored. But it's still irritating.



So that's it, the site is now updated to the latest web standards and ready for the crazy future world we've all ended up living in.

    New Audio Player

Sun, 29 Aug 2010 01:37:42 GMT

Some fiddling about with HTML5 and Javascript has created a new simple media player for the site.

Thanks to the <audio> tag in HTML5 I can move over from the mess of browser and plugin detection scripts I used to have to one simple player. No plugins required.

I've tested it in sensible browsers (Firefox/Chromium/Opera/Safari) on GNU/Linux and MacOS. It should work in recent versions of these and similar browsers for other platforms too.

Mac users will still need to install the Quicktime Components for Free media formats, I use Ogg Vorbis for audio on this site. MacOS doesn't include support for reasons of wanky Apple corporate greed.

Xiph QuickTime Components

     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.

   Javascript Projects

Sat, 07 Feb 2009 07:25:33 GMT

I'm back working with Javascript, building a new random character generator for another game.

Unlike the D&D/Pathfinder generator, this is going to be building full characters, not just basic NPCs.

So this one is a bit of an epic project, but after one night of coding, I've got the data structures defined, the web end working and some very basic output.

I've got a huge mass of data input to do to cover all the basic classes and all their options, then all the random customisation code to write.

Not sure why, but I seem to get the most coding done between 0300 and 0600 after a couple of hours of sleep.

When I'm working on these things, I seem to wake up in the middle of the night with a mass of code in my head I have to get working right away.

It's like I do my clearest thinking when I'm asleep.

   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";

  Transferring Movies to the eeepc

Sat, 27 Sep 2008 11:37:45 GMT

Recently Max picked up an eeepc, it's a great little linux based laptop with an 800x480 7" screen and a 4GB solid state drive that goes about 3 1/2 hours to a charge.

A tiny little machine, perfect for catching a movie or TV show while on the bus.

So, I've been looking for a way to format shift TV shows and movies I have on DVD onto the eeepc, it ships with MPlayer, but with it's reduced space I need to make the movies quite small.

Step one is to rip the DVD, for this I use a quick, single pass rip using mencoder, crunching down the movie into an XviD/mp3 file.

As OGG is, hopefully, heading towards being the standard format for web multimedia, it's well supported on the eeepc and good compression, step two is to convert the rip into Theora and Vorbis.

#!/bin/sh # rip # by Gav Ford # revford@blueyonder.co.uk # http://revford.pwp.blueyonder.co.uk # 2008-09-26 # rip a DVD into XviD/mp3 into an .avi # then convert that to Theora/Vorbis .ogg # usage rip tracknumber filename # -aspect 16:9 -vf scale=480:270 \ # -aspect 4:3 -vf scale=360:270 \ # -aspect 1.85:1 -vf scale=500:270 \ mencoder dvd://$1 \ -ovc xvid -xvidencopts bitrate=384 \ -aspect 16:9 -vf scale=480:270 \ -oac mp3lame -lameopts br=96 \ -af volume=15:sc \ -o $2.avi ffmpeg2theora $2.avi -o $2.ogg

On my machine, the whole process of converting a movie takes a couple of hours and results in a file of about 5MB/min as .avi and 4MB/min as .ogg.

Commented out in the code are alternate aspect ratios and scales for different movie formats, you can swap in the details based on what the DVD you're looking at says the aspect ratio is.

Here is an example of the results, a shot from the pilot episode of Stargate SG-1. Click the image for the full sized version.

encoding example, a shot from Stargate

While this produces good quality, quite watchable shows and movies. I'd going to try a two pass rip with just the scaling done by mencoder. Then compress that result directly to ogg, using ffmpeg2theora to reduce the file size down, skipping the XviD encoding.

   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.

   Code News Icon

Tue, 23 Sep 2008 10:05:23 GMT

Following on my new icons kick, while I'm feeling rough still. This time a new icon for the general topic of Code. That is source code, scripts, programs and the like, not secret codes, cyphers and cryptography.

Nice and simple, I wanted gears or cogs. So back to Wikimedia Commons to look for some public domain cogs.

Image:Cog-scripted-svg.svg

Perfect.

And so, we get these.

Code Cogs Code Cogs Code Cogs

  Code Jokes

Mon, 22 Sep 2008 11:51:50 GMT

Thanks to a link on the Bristol and Bath Perl mailing list, I stumbled over to this from xkcd.

Random Number, from xkcd

I don't know why, but it stuck me as the funniest thing I've seen in ages.

For bonus Nerd points, here is the code as Perl.

sub getrandomnumber { #Chosen by a fair dice roll. Guaranteed to be random. return(4); }

   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

  HTML5

Tue, 02 Sep 2008 00:13:55 GMT

Playing about with my sitebuild code, a switch to HTML5 would be so easy now.

My sitebuild code is a collection of Perl and Bash scripts I use to simplify the creation and updating of this website.

To go from HTML 4.01 Strict to HTML5, I have to switch this code:

# write the stock heading, doctype etc HTML 4.01 Version push @head, '<!doctype html public "-//W3C//DTD HTML 4.01//EN"'; push @head, ' "http://www.w3.org/TR/html4/strict.dtd">'; push @head, "\n\n"; push @head, "<html>\n<head>\n"; push @head, ' <meta http-equiv="Content-Type"'; push @head, ' content="text/html; charset=utf-8">'."\n\n";

For this:

# write the stock heading, doctype etc HTML5 version push @head, '<!doctype html>'; push @head, "\n\n"; push @head, "<html>\n<head>\n"; push @head, ' <meta charset="utf-8">'."\n\n";

A simple change to the code and all my pages validate as HTML5, so mechanically I'm all set.

Only slight problem is that the HTML Validator extension for Firefox I rely on, doesn't cover HTML5 yet. Being based upon algorithms by the W3C, who now have HTML5 checking in beta, it should gain HTML5 compatibility when that firms up.

HTML Validator

W3C Markup Validation Service BETA

I'll wait on the HTML Validator extension to get HTML5 support, then move over.

| pg 1 of 3 | More |

 HTML5
 CSS3
CC
2010-09-01