The latest krazee plan from the Home Office’s policy department seems to be a massive database containing the details of every phone conversation and email sent in the UK.
Assuming it works (it won’t) then at least they’ll realise just how bad the spam situation is.
I’ve been trying to install Macromedia Adobe Flash Media Server 3 on my local development box and have run into some problems.
To help out anyone else trying to do the same thing, here’s how I did it.
First you need to install nspr
emerge -uDv dev-libs/nspr
Add a user/group for it to run under:
groupadd fms
useradd -g fms -d /dev/null -s /bin/bash fms
Then download and extract the media server as per usual. Before installing it, you need to fiddle the install script so that it will install on your “unsupported” platform. Open installFMS in your favourite text editor and find the line that reads
DISTRO=`check_distro`
Change it to something appropriate like
DISTRO=redhat-RHEL4-i686
Then start the installation script as normal. Tell it that you don’t want it to run as a daemon (as it requires the Red Hat only chkconfig command) and that you don’t want it to start the server when done.
After you’ve installed the server, you’ll need to make the bundled libasneu.so.1 library available for use:
ln -s /opt/fms/libasneu.so.1 /lib/libasneu.so.1
For some reason the install messed up the configuration files, adding things like the administrative user name twice. Check conf/fms.ini to make sure this hasn’t happened to you.
The installer creates init scripts at /etc/init.d but in order to use them you first need to create a file called .autostart in the installation directory:
touch .autostart
You should then be able to start and stop the server normally:
/etc/init.d/fms start
/etc/init.d/fms stop
And use rc-update to have the server start on boot:
To save you the trouble of running it yourself, I’ll tell you what happens - the unescaped percent symbol causes a URI malformed error to be thrown.
Very odd. The Prototype documentation for toQueryParams says:
Parses a URI-like query string and returns an object composed of parameter/value pairs.
Since it’s a URI-like query string and not an actual query string (by which I mean one that’s been through the browser address bar and as such subject to whatever text munging the browser does), my example above should be a legal use case.
After a little digging around in prototype.js, it seems that the problem is caused by the JavaScript function decodeURIComponent() not enjoying being given a string that contains an unescaped percent symbol. Usually percent symbols are used in conjunction with a number to represent a non-alphanumeric character in a URL - %20 for space, etc, but in the above it’s a literal percent symbol.
My first attempt to fix it changed lines 98 and 100 of string.js in the Prototype source to use the built in escape function:
var key = decodeURIComponent(pair.shift());
…
if(value != undefined) value = decodeURIComponent(value);
to
var key = decodeURIComponent(escape(pair.shift()));
…
if(value != undefined) value = decodeURIComponent(escape(value));
This worked for my use case but caused Prototype to fail a different unit test. Changing them to the following worked out okay:
var key = unescape(decodeURIComponent(escape(pair.shift())));
…
if(value != undefined) value = unescape(decodeURIComponent(escape(value)));
Granted the unescape(…(escape(…)) is a little clumsy, but it seems to get the job done.
Adding the following unit test to string.html allows to test for the above:
this.assertHashEqual({‘key1′: ‘va%lue1′}, ‘key1=va%lue1′.toQueryParams(), ‘rogue percent symbol test’);
I’ve created some test pages which demonstrate the problem.
There is also a patch file available. Apply it to /src/string.js in your Prototype source tree.
I haven’t posted here for a while, mainly due to the time sink that is Facebook, but I have been writing code in my spare time, honest. I thought I’d have a little skim through what’s on my machine and share a few choice nuggets.
Recently I’ve been trying to get into programming applications for Mac OS X - I use it on a day to day basis so thought it would be best to get involved. I’ve put some new things on the Stuff page for your perusal. They are:
A program to run AppleScripts on a computer on your local network from your iPhone or iPod Touch - I use this to control a Mac mini attached to a projector. The projector is not always switched on so Front Row was insufficient. It also allows you to force quit applications that have hung.
A Cocoa native web server packaged as a framework so you can use it in your own projects. Based on Jurgen Schwiezer’s SimpleHTTPServer.
All of the above require OS X 10.5 Leopard as coming from a Java/PHP background I have a strange fetish for garbage collectors and consequently find manual memory management tedious.
They are all BSD licensed and source is included with each program so go crazy.
I’ll get round to posting about each one in more depth in the near future.
Welcome to version 4 of Aching Brain. It’s been an awfully long time, but I promise to post more often.
The major change is that I’ve switched from a custom back end to pre-written blog software as maintaining it became a bit of a nightmare. I say maintaining - what I mean is writing new versions of it as who wants to administer crufty old code when they get home? AB4 has been in the works for over a year but I never seemed to be able to finish it without wanting to re-write great big chunks of it so I’ve bitten the bullet and gone down the shoulders-of-giants route. And I have to say, so far it’s been relatively painless - the only thing that’s really given me trouble is getting apostrophes to play nice in code tags, but more on that later.
All the old content should be here somewhere. The only difference is a slight change in the URL structure but a little bit of .htaccess fiddling should mean that incoming links still point in the right place.