Apr. 14th, 2008

Apr. 14th, 2008 12:45 pm

Pirates!

vin_petrol: (Default)
On Sunday afternoon Paul (WINOL), [livejournal.com profile] greynolds and I had a huge game of Pirates of the Spanish Main. Here's a picture of the board with our lovely pirate ships setting sail to do battle and plunder treasure:



Paul and [livejournal.com profile] greynolds were using 80 point fleets that Paul had worked out previously. I had decided to try something different: a massive fleet of cheap ships, so I outnumbered them 2 to 1. This was partly an experiment to see if this strategy would work. I even played some French ships as some of the cheapest ships I own are French.

I can now, on good authority, say that this strategy is a complete steaming pile of poo, and that I got my arse utterly kicked. Here are some of my ships about to engage ONE of Paul's ships (it's the large one on the left):



and here are the dismasted derelicts of my ships a couple of turns later:



One ship is missing due to it being sunk. You'll note his ship is completely undamaged. Oh dear. I will make one excuse, in that there's a particular crew piece in Pirates called "Captain", which you can add to your ship, which allows it to both move *and* fire in the same turn. Most of the other ships had this. My minimalist cheap ships had precisely zero additional crew elements, and could therefore only move *or* fire. This turned out to be a rather serious weakness. I hadn't actually realised there was such a crew piece before the game commenced. I don't own one and I hadn't noticed the effects when reading the rules.

Of course, now I'm thinking... How about a massive fleet of cheap ships where they all have captains? :-)
Apr. 14th, 2008 05:01 pm

Grumpy Vin

vin_petrol: (robot)
Once more, I'm reminded why I'm such a grumpy old hacker in the corner. This copy and paste from my screen should explain what I'm having to deal with now:

% curl -s http://www.rssboard.org/files/sample-rss-2.xml | head -2
<?xml version="1.0"?>
<rss version="2.0">

Look how this sample RSS feed correctly starts with an XML prolog. Look how well formed it is, not having anything *before* the XML prolog, as defined by the easily available XML standard, that's been around for about 10 years now, and isn't particularly hard to follow.

So I'm working with a new data provider, who (apparently) is going to give us an RSS feed. I plug their URL into my feed reading code, and it immediately barfs with an XML error, telling me that "XML declaration allowed only at the start of the document". I wonder what they've done. Let's take a look at their RSS:

% curl -s http://www.crappers.example/rss.orange/stuff/ | head -2

<?xml version="1.0" encoding="utf-8"?>

How exciting! They've put some spurious whitespace before the XML prolog, as COMPLETELY NOT ALLOWED by the XML standard if you intend to be well formed. And if you're not well formed, you're no bloody use. I'm not writing an HTML parser here. One of the main points of XML is that my input will be clean and well formed and I can just get on with using it.

So, let's get this clear, they've managed to send me crap in the very first byte of their feed. Fantastic...

Obviously, I'm an ancient Perl hacker, so I've hacked my code to remove spurious whitespace from before the prolog in their "attempt at XML", then I parse it. Then, as is often the case, I discover that "utf-8" is just something they copied and pasted into their document prolog, rather than something they've actually used in their data when they put a pound sign in...

This is going to be a long job, and involve me writing lots of pedantic emails, referring to the XML standard. *sigh*

Profile

vin_petrol: (Default)
vin_petrol

February 2013

S M T W T F S
     12
345 6789
10111213141516
17181920212223
2425262728  

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 15th, 2025 04:21 pm
Powered by Dreamwidth Studios