Friday, 8 October 2010

JW Player API

Thanks, authors of JW Player, for wasting at least 3 hours of my life because you have changed your JavaScript API and not published any documentation for it!

Quoting an entry buried in the help forum:

The v4 [and v5] player uses a completely different API, details here: http://code.longtailvideo.com/trac/wiki/FlashAPI

Sadly, that URL doesn't work. Now I expect Open Source software to have either completely useless, or just plain absent documentation, but we (and a great many others) have paid for this player - so its not acceptable.

Friday, 19 February 2010

Build a menu bar on-the-fly with JavaScript

Its not necessary to use either PHP or SHTML to include a dynamic menubar in a set of web pages - you can do it with JavaScript.

First define arrays containing all the links and the link text you want for the links - make certain the two arrays have the same number of elements!

Then have a loop that goes through these arrays, displaying them on the screen in order. You can do a bit of string testing to work out what page you're on and have that link displayed differently - perhaps in bold or just not underlined. Output all the HTML using document.write

Here's an example:

var textArray=new Array('home','news','people','places','views', 'faq');
var linksArray=new Array('index.html','news.html','people.html','places.html','views.html','faq.html');

for (i=0;i < textArray.length; i++) {
var str = window.location.toString();
var urlbits = str.split('/');
if (urlbits[urlbits.length-1]!=linksArray[i]) {
document.write(''+textArray[i]+'');
} else {
document.write(''+textArray[i]+'');
}
if (i!=textArray.length-1) document.write(' | ');
}

Note how the last line in the loop misses off the delimiter for the last item.

Save this JavaScript in a separate file - something like menubar.js - and include it in the same place in all of your HTML pages using a conventional link to an external JavaScript file:

<script type="text/javascript" src="menubar.js"></script>

My links here are just straightforward links, but they could equally be styled bullet list items, buttons, images, whatever.

Thursday, 18 February 2010

Parsing RSS with Dubin Core using PHP5

With the built-in XML functions of PHP5, its now pretty straightforward to parse well-formed RSS data, eg:

$link = $node->getElementsByTagName('link')->item(0)->nodeValue;

But when using getElementsByName you run into problems if you want to grab data in Dublin Core fields - this won't work:

$creator = $node->getElementsByTagName('dc:creator')->item(0)->nodeValue;

To solve this you have to use the getElementsByTagNameNS function and declare the namespace you are using - obviously in this case Dublin Core:

$creator = $node->getElementsByTagNameNS('http://purl.org/dc/elements/1.1/','creator')->item(0)->nodeValue;

Sunday, 1 November 2009

Air tax increase comes into force

"BBC NEWS | UK | Air tax increase comes into force
The first of two rises in UK airport departure tax has come into effect, adding up to £30 to the cost of flying. The price of the shortest flights rises by £1, with Air Passenger Duty on business and first class journeys over 6,000 miles up from £80 to £110."

Isn't the idea of environmental taxes to encourage people to use less harmful forms of transport? If so, surely the tax should be higher for internal flights - where you could take the train instead - and lower for trans-continental flights, where you don't have a choice. Or perhaps this tax is just to raise money...?

BBC NEWS | UK | Air tax increase comes into force

Tuesday, 27 October 2009

Canon 1D Mk.IV "launch"


Well, not exactly a launch - more of a preview - today at Pro Photo Solutions, held at the Design Business Center in London. All courtesy of the nice people (Colin) at SimplyDV.

I was hoping for a proper "hands on", particularly to do a proper test of the flash metering - which to date on Canon is complete pants. Unfortunately Canon UK only had two pre-production samples of the new camera, both tied very firmly to the deck and with card doors sealed, so you couldn't actually take any photos. All very disappointing.

Due to catching too late a train, I missed most of the initial press briefing, but attended a half-hour seminar later in the day. I was a bit worried what Canon UK were saying about the camera being more "susceptible" to blurred photos due to the resolution being so high and the pixels so densely packed. Not sure I entirely believe their argument - if it happens with this camera, why not also on the D1S Mk.III ?

There was much talk about the various Custom Functions that can be used to tailor the operation of the AF system. You can control how fast the AF reacts to changes, how many of the 45 AF sensors are used, how the selected AF point can be expanded, how large the AF areas are (that's a new one), etc. etc. "Do read the manual", the Canon UK man says, as you can basically duff up the AF operation completely. Let just hope all the AF issues that plagued the Mk.III (and some - including my - Mk.IIn) bodies are firmly behind us now.

Much was also made of the hiked ISO range. The standard range available without recourse to yet further custom functions is 100 to 12800. With a bit of fiddling, however, this can be expanded to 50 to a staggering 102400! Canon reckon the quality is "two stops better" than the already impressive Mk.III - meaning that if you were happy to work with ISO 800, you'd be equally happy with 3200 on the new body. Why hide this extra range away? Canon say its because the quality isn't really what they consider acceptable - I can live with that. Of course, the proof is in the pudding and I was miffed I couldn't see the quality for myself.

I asked, for the benefit of SimplyDV, about the camera's HD video capabilities. Via custom function (there are a lot of them) you can pick between full HD at 25fps or lower the resolution to 720 pixels or even VGA to get 50fps - could be useful for scientific or educational applications,as well as straight-forward slow motion. You can also switch from PAL to NTSC to get different frame rates.

Sadly, in the questions section at the end, predictable - and pointless - questions came from the floor regarding the camera's crop factor and the choice of resolution. Why is it that people cannot understand that if you want a "full frame" (35mm-sized) sensor, you simply buy a different camera? This new body is aimed primarily at sports, news and wildlife photographer who need the extra reach that a crop sensor body provides.

So, what's my verdict? Well, sadly I can't give one. Nowhere near enough real hands-on for my liking - the lack of real cameras for us media types to play with rendered the whole exercise somewhat pointless.

Tuesday, 11 August 2009

Phones and email tapped 1,381 times a day

"Phones and email tapped 1,381 times a day | UK news | guardian.co.uk
Police and other officials tapped phone calls and emails an average of 1,381 times a day last year, according to a report released today by the interception of communications commissioner, Sir Paul Kennedy.

A total of 504,073 surveillance requests to phone and internet companies were made in 2008, the equivalent of one in 78 adults being targeted. The figure was slightly lower than in 2007, but 60% higher than in 2006, the year covered by Kennedy's first report.
"

I particularly like this quote:
"'The government forgets that George Orwell's [novel] 1984 was a warning and not a blueprint. We are still a long way from living under the Stasi but it beggars belief that it is necessary to spy on one in every 78 adults.'"

Phones and email tapped 1,381 times a day | UK news | guardian.co.uk

Friday, 7 August 2009

ERA2: with Students near Howick

Students near Howick
Students near Howick,
originally uploaded by hockeyshooter.
Our one and only day with real SXR369 students, at the two bays near Howick. Slight variation from the setup we had tested earlier in the week, but essentially the same: cabled link from switch to omni for one site, then a long panel-to-panel hop to the omni for the second. Nearly everything worked to plan, although only half of the students opted to make use of the system.

Thursday, 6 August 2009

ERA2: Collingwood College again

Another day of testing, due to the need to demonstrate the setup to the two geologists who would be tutoring the Additional Requirements students tomorrow. Set up the two 17" monitors for the first time, but still problems being able to see the screens in sunlight, so Trevor and Mark went into Durham to buy a small tent and two picnic tables.

Wednesday, 5 August 2009

ERA2: Whitby

Base of operations
Base of operations,
originally uploaded by hockeyshooter.
A very much tide-dependant site for the students since everything they need to look at is either covered or inaccessible at high tide. Due to the timing, we had to start work after the morning low tide, with the tide coming in, which was a bit worrying and eventually forced us to pack up and scarper. Re-visited the location in the afternoon for some different tests. Weather with a mix of light rain in the morning and hot sun - and thousands of thunder flies - in the afternoon.

Tuesday, 4 August 2009

ERA2: Scremerston

BGAN
BGAN,
originally uploaded by hockeyshooter.
Extensive testing at the most northern site that the students visit - Scremerston, just south of Berwick Upon Tweed, which is less than 70 miles from Edinburgh. Ran two very long cables, via the switch, from the BGAN down to the beach. Added extra wireless hops to create the longest link we'd ever done - started to have problems hearing end-to-end with the PMR walkie-talkies. Equipment mostly worked very well.

Monday, 3 August 2009

ERA2: testing at Collingwood College

We stayed at Collingwood College today to do some testing of VoIP and bandwidth uing iPerf. Also tried some backhaul tests with both 3G and the BGAN terminal. Managed to FTP files up to the off-site server. Lewis could see into our machine via the 3 (Three) dongle but not via Vodafone or BGAN.

Sunday, 2 August 2009

ERA2: Cullernose Point

near Seaton Sluice
near Seaton Sluice,
originally uploaded by hockeyshooter.
More examination of possible sites for future visits, accompanied by a proper geologist. Tried a single omni aerial on the beach on a cable from the switch at the top of the cliff, but couldn't get a proper signal to the Asus. Two locations actually used by students this year: Rumbling Kern and Howick Haven. Tested wireless link to extremes - geologist and laptop moving around rocky outcrops out of site of the omni, yet video and VoIP still working.

Saturday, 1 August 2009

ERA2: Seaton Sluice &Hartley Bay

Seaton Sluice
Seaton Sluice,
originally uploaded by hockeyshooter.
First day of in-the-field recon at three possible sites, accompanied by a real geologist, at Seaton Sluice and Hartley Bay. Two very handy pubs nearby!

Tuesday, 28 July 2009

MoD seeks to cut soldiers' payout

"BBC NEWS | UK | MoD seeks to cut soldiers' payout
The Ministry of Defence will go to the Court of Appeal later to try to significantly reduce the compensation awarded to two injured soldiers. One, who was shot in the leg in Iraq, received £46,000, while the other, injured in training, got £28,750. Both had their payouts increased due to complications, but the MoD is arguing that they should only be compensated for their "original injuries".
"

I already knew the MoD was tight, but this really takes the biscuit. Wonder just how many of the tight-arses behind this decision have even been shot at, let alone injured in the line of duty? Will they even remember the names of these soldiers when they retire on fat, civil service pensions?

BBC NEWS | UK | MoD seeks to cut soldiers' payout

Thursday, 23 July 2009

Ofwat calls for lower water bills

"BBC NEWS | Business | Ofwat calls for lower water bills
Proposals set out by water regulator Ofwat will see average household water bills fall between 2010 and 2015. Taking out the impact of inflation, the proposals, if accepted, would see the average water bill fall by £14 to £330.
"

How come Ofwat can control water prices, whereas Ofgen are completely powerless against the money-grabbing electricity and gas suppliers?

BBC NEWS | Business | Ofwat calls for lower water bills

Wednesday, 22 July 2009

UK has enough helicopters - Brown

"BBC NEWS | Politics | UK has enough helicopters - Brown
Gordon Brown has said the UK has enough helicopters for an offensive in Helmand - and said lives lost during the past month were not due to a shortage.
"

So says a guy whose probably never been shot at once in his life.

"It comes after Foreign Office minister Lord Malloch Brown rowed back on comments in a newspaper interview that the UK did not have enough helicopters. The PM said the minister had 'corrected any misrepresentation' of his comments."

In other words, he's been told to retract his statement since it contradicts the aforementioned tight-arse.

But its not just helicopters they're short of.

BBC NEWS | Politics | UK has enough helicopters - Brown

Sunday, 5 July 2009

Remembering the moon landing 40 years on

"Remembering the moon landing 40 years on - The Daily Record
However, the Americans' progress was dwarfed by the Soviet's Sputnik in 1961, when Yuri Gagarin became the first man in space."

Er, check your facts guys. Sputnik was a series of robotic space craft - none were manned. On 4th October 1957, Sputnik 1 because the first human-made object to orbit the Earth. Gagarin's flight didn't happen until 1961, the first flight of the Vostok programme.

Remembering the moon landing 40 years on - The Daily Record

Wednesday, 17 June 2009

MPs launch probe of massive net snooping project

"Unrealistic, disproportionate and misleading, experts say
MPs and Lords will launch an investigation into the Home Office's £2bn plan to store details of every online communication, after a critical report by the London School of Economics branded it unrealistic, disproportionate and misleading.
IMP would be unmatched in the world as a communications surveillance mechanism.
"

MPs launch probe of massive net snooping project • The Register

Thursday, 16 April 2009

Pothole go-slow to 'calm traffic'

"BBC NEWS | England | Essex | Pothole go-slow to 'calm traffic'
An Essex parish council wants potholes to be left unfilled for longer to act as a "natural traffic calming" measure. Navestock parish councillors claim repairing potholes is costly and allows motorists to drive faster.
"

You can bet the dipstick that came up with this has never ridden a motorbike.

BBC NEWS | England | Essex | Pothole go-slow to 'calm traffic'

Monday, 13 April 2009

Police arrest 114 in(?) 'power demo'

"BBC NEWS | England | Nottinghamshire | Police arrest 114 in 'power demo'
More than 100 people have been arrested in Nottingham over a suspected plan to target a power station. Police said 114 men and women were arrested in Sneinton Dale on suspicion of conspiracy to commit aggravated trespass and criminal damage. Officers said they believed those arrested were planning to protest at nearby Ratcliffe-on-Soar power station."

One step closer to the Police State - people denied the right to protest.

BBC NEWS | England | Nottinghamshire | Police arrest 114 in 'power demo'