Using 3rd Party batteries with the Canon HF100/HF10 Camcorder

3775 The Canon HF100 is a great HD camcorder, and I’d really recommend it, especially for the price. You probably want a spare battery to go with it, but be careful which battery you choose. In their “wisdom” Canon has put a stranglehold on the 3rd party battery market by making the camcorder *very* picky about the voltage tolerances when charging a battery that’s attached to the camcorder.

The one I tried from this company would power the camcorder, but just refused to be charged. The camcorder LED blinked quickly, indicating there was a problem with the battery.

Watch out for sites like B2C Shopping; in their terms and conditions they’ve got clause which says they won’t pay your return postage costs… even if the reason for your return isn’t your fault! Their product description categorically says the battery is 100% compatible with the HF10/HF100.. but it isn’t! They eventually refunded the item cost, but none of the postage costs I incurred sending the incompatible product back!

I’ve seen on eBay that any non-Canon batteries for the HF10/HF100 come with their own charger.. getting around the problem of the camcorder refusing to charge these 3rd party batteries. Even when you do buy one of these, the batteries aren’t “intelligent” like the official Canon batteries.. which means each time you switch it on, the camcorder will tell you it can’t communicate with the battery & is that okay. Very annoying.

Binatone IR804 Price Increase at Argos

dab For a few weeks I’d had my eye on the Binatone IR804 DAB, FM, and Internet Radio. It was listed at £60 which seemed like a good deal for something that was of reasonable quality. Okay, the sound isn’t going to be earth-shattering, but functionality-wise £60 seemed about right.

However, I saw today that Argos have their new prices out and it’s shot up by £28 to an outrageous £87.99! All the adverts on TV tell us how they bring down their prices, but they don’t tell you about all the prices they’ve increased!

Power Meter Plus featured on Lifehacker

Lifehacker is one of my daily visits, so it was brilliant to see that it had Power Meter Plus as the Featured Windows Download :-D

Creating a Netvibes / iGoogle Gadget for Multi-Image Display

To help make it as easy as possible for family members to see new pictures from the Collinge household I decided to set them up with Netvibes homepages, each containing a widget to display the latest photos from Picasa Web Albums. Picasa Web Albums provide an RSS feed that you can subscribe to which is a good start.. but I couldn’t find a way to display them just as I wanted.

The spec is to display the latest images, over as many columns as the user specifies.. and have the images resize to fit the width of the widget. They pretty much get displayed in a grid style layout.

Step 1) Get the URL for Picasa Web Albums (or whatever service you’re using) and make sure it works. The first gotcha here was that Picasa Web Albums has a limitation which means that images > 800px will not be embedded. They’ll result in a 404 File Not Found. To get around this, append ?imgmax=800 to the RSS’s URL.

Step 2) The feed for Picasa Web Albums is sorted in ascending date order.. I wanted it in descending date order so that the latest photos show first. To do this I chose to re-format the feed using Yahoo Pipes.. it’s a way of tinkering with a feed an invaluable for times when you need to do something simple like this.

Picasa gives you an Atom-based feed which seems to be causing a few issues with my code.. it basically makes the images go into a different node from the one I expected.. and I’ve been unable to work out exactly where it’s putting them. The best way around this is to simply run the RSS feed through a simple Yahoo Pipe; I’ve published one which sorts the images in date descending order. Use that and copy the RSS feed it generates.

Step 3) Create a new widget using UWA so that it works with Netvibes and iGoogle. This is relatively simple.. just requiring a bit of coding to make it happen. As usual I’ve tried to make the code as generic as possible & driven by user preferences. The user can specify which node in the JSON object (returned from the RSS feed) contains the image to display.. useful when dealing with non-standard image enclosures. It will default to the first enclosure at item.enclosures[0].url

The finished widget is published here.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:widget="http://www.netvibes.com/ns/"  >
	<head>
		<title>Multi-Image Display</title>
		
		<meta name="author" content="Matt Collinge" />
		<meta name="email" content="do-not-email@mt2009.com" />
		<meta name="description" content="Display multiple images from an RSS feed. Useful for feeds like those from Picasa Web Albums" />
		<meta name="version" content="1.0" />
		<meta name="website" content="http://eco.netvibes.com/widgets/298784/multi-image-display" />

		<meta name="keywords" content="image, rss, picasa, web album, picture, multiple, display, grid" />
		<meta name="autoRefresh" content="15" />
		<meta name="apiVersion" content="1.2" />
		
		<link rel="stylesheet" type="text/css" href="http://www.netvibes.com/themes/uwa/style.css" />
		<script type="text/javascript" src="http://www.netvibes.com/js/UWA/load.js.php?env=Standalone"></script>
		
		<style type="text/css">
			.imageDisplay {
				margin:0;
				padding:0;
			}
		</style>
		
		<widget:preferences>
			<preference name="title" type="text" label="Title" defaultValue="Multi-Image Display" />

			<preference name="url" type="text" label="RSS Feed" defaultValue="" />
			<preference name="limit" type="range" label="Number of images to display" defaultValue="10" step="1" min="1" max="50" />
			<preference name="columns" type="range" label="Number of columns to use" defaultValue="2" step="1" min="1" max="8" />
			<preference name="imagenode" type="text" label="Node in RSS Feed Containing Image" defaultValue="item.enclosures&#91;0&#93;.url" />
		</widget:preferences>
	
		<script>
			var BasicRSSReader = {};
			 
			BasicRSSReader.feed = false;
			 
			widget.onLoad = function() {
				if (widget.getValue('url') === '' || widget.getValue('url') == undefined) {
					widget.setBody('Please edit the preferences and enter the URL of the RSS feed where you want to take images from.<br><br>. Use a feed re-formatter like Yahoo Pipes if you need to tinker with a 3rd party RSS feed.');
				} else {
					widget.body.addClassName('imageDisplay');
					widget.setTitle(widget.getValue('title'));
					UWA.Data.getFeed(widget.getValue('url'), BasicRSSReader.display);
				}
			}
			
			BasicRSSReader.display = function(feed) {
				var bodyHTML = '';
				if (feed) BasicRSSReader.feed = feed;
				
				var imageWidth = widget.body.getDimensions().width / widget.getValue('columns');
				var imageCount = 0;
				var columnCount = 0;
				
				bodyHTML += '<table border=0 cellpadding=0 cellspacing=0>';
				for(var i=0; i < BasicRSSReader.feed.items.length; i++) {
					var item = BasicRSSReader.feed.items&#91;i&#93;;
					
					if (imageCount >= widget.getValue('limit')) {
						bodyHTML += '</tr>';
						break;
					}
					
					if (columnCount == 0) {
						bodyHTML += '<tr>';
					}
					bodyHTML += '<td><a href="' + item.link + '"><img src="' + eval(widget.getValue('imagenode')) + '" width="' + imageWidth + '" /></a></td>';
					
					columnCount++;
					
					if (columnCount == widget.getValue('columns')) {
						columnCount = 0;
						bodyHTML += '</tr>';
					}
					
					imageCount++;
				}
				bodyHTML += '</table>';
				
				if (imageCount==0) bodyHTML = 'Unable to load feed.';
				widget.setBody(bodyHTML);
			}
		</script>			
	
	</head>
	<body>
		<p>Loading...</p>

	</body>
</html>

Power Meter Plus 1.5 Released

This release of Power Meter Plus – the popular replacement for the standard Windows power meter – fixes a bug with widescreen monitors.

Click here for the Power Meter Plus download page.

Power Meter Plus

Netvibes UWA

Netvibes is a pretty awesome personal homepage web app. It’s very similar to iGoogle, but IMO it’s a lot more stable & a lot better looking. Netvibes offer a unified API that allows you to write using their API and deploy your gadget to multiple providers, such as iGoogle, Opera, iPhone, MacOSX and Vista.

I’ve been writing a gadget for my company but decided I also wanted one to take the first image out of an RSS feed and present so that it takes up all the space in the gadget. Useful for things like LOLcats. It was surprisingly simple to create.. so with some UWA coding, and a simple pipe at Yahoo Pipes, I’m now able to bring in the first image from a specified RSS feed.. assuming the image’s URL has been put into the item.content tag.

Here’s the finished gadget.. and the source code is below…

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:widget="http://www.netvibes.com/ns/"  >
	<head>
		<title>Single Image Display</title>
		
		<meta name="author" content="Matt Collinge" />
		<meta name="author_email" content="gadget@mattcollinge.co.uk" />
		<meta name="description" content="Display an image from the content section of the first item in an RSS feed. Useful for feeds like those from LOLCats. Use Yahoo Pipes to get the image URL (only) into the item.content tag." />
		<meta name="version" content="1.1" />
		<meta name="website" content="http://www.mattcollinge.co.uk/" />
		<meta name="keywords" content="image, rss, lolcats, single, full width" />
		<meta name="autoRefresh" content="15" />
		
		<link rel="stylesheet" type="text/css" href="http://www.netvibes.com/themes/uwa/style.css" />
		<script type="text/javascript" src="http://www.netvibes.com/js/UWA/load.js.php?env=Standalone"></script>
		
		<style type="text/css">
			.imageDisplay {
				margin:0;
				padding:0;
			}
		</style>
		
		<widget:preferences>
			<preference name="title" type="text" label="Title" defaultValue="Single Image Display" />
			<preference name="url" type="text" label="URL" defaultValue="" />
		</widget:preferences>
	
		<script>
			var BasicRSSReader = {};
			 
			BasicRSSReader.feed = false;
			 
			widget.onLoad = function() {
				if (widget.getValue('url') === '' || widget.getValue('url') == undefined) {
					widget.setBody('Please edit the preferences and enter the URL of the RSS feed where you want to take the image from.<br><br>The image URL must be in the item.content tag otherwise this will not work. Use feed a reformatter like Yahoo Pipes if you need to tinker with a 3rd party RSS feed such as LOLcats.');
				} else {
					widget.body.addClassName('imageDisplay');
					widget.setTitle(widget.getValue('title'));
					UWA.Data.getFeed(widget.getValue('url'), BasicRSSReader.display);
				}
			}
			
			BasicRSSReader.display = function(feed) {
				var feedList = 'Unable to load feed.';
				if (feed) BasicRSSReader.feed = feed;
				var item = BasicRSSReader.feed.items[0];
				feedList = '<img src="' + item.content + '" width="' + widget.body.getDimensions().width + '" />';
				widget.setBody(feedList);
			}
		</script>			
	
	</head>
	<body>
		<p>Loading...</p>
	</body>
</html>

Using JSLint with Notepad++

I’m doing a fair amount of development using the ExtJS framework. IE is a bit picky about getting JavaScript properly formatted (otherwise it refuses to render the page). That’s why I’ve found JSLint really useful for locating stray commas or semi-colons.

To make it a bit quicker to put the file contents in the JSLint box I decided to hook it up to the Run menu in Notepad++. However, the JSLint web page doesn’t allow us to pass in data to it. To get around this you can copy the HTML + JS files from the authors website an copy them locally. Once you’ve got them locally you can modify the source to allow the passing of data.. here’s the change I made to do it on my system:

jslint.php changes.. add this right near the end

<script src="javascript.js"></script>

You’ll then need a way to take the file contents and fire it off to the page. At first I tried passing the file contents via the GET request, but it’s limited in length. Also, Notepad++ won’t let you send the file contents via the Run command. In the end I chose to use a piece of VBScript to bring up the webpage in the default browser, and some JavaScript to read in the file & place it into the page.

launchJSLint.vbs

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(wscript.Arguments(0), 1)

Dim strCharacters

Do Until objFile.AtEndOfStream
    strCharacters = strCharacters + objFile.Read(1)
Loop

strCharacters = Escape(strCharacters)

Set objFileSystem = CreateObject("Scripting.fileSystemObject")
Set objOutputFile = objFileSystem.CreateTextFile("c:\progra~1\notepad++\jslint\javascript.js", TRUE)
objOutputFile.WriteLine("document.getElementById(""input"").value = unescape(""" & strCharacters & """);")

Dim wShell
Set wShell = CreateObject("WScript.Shell")
wShell.Run "c:\progra~1\notepad++\jslint\jslint.html", 9

Finally, this is the Run command you can use in Notepad++ to launch the script…

wscript "C:\Program Files\Notepad++\launchJSLint.vbs" "$(FULL_CURRENT_PATH)"

Switching FoxyProxy Profiles using Script

FoxyProxy is a useful extension to Firefox, but I’m always having to switch profiles back and forth as I take my laptop from work to home, and vice versa. I experimented with proxy PAC files without any success (mainly because laptops have multiple network adapters and the PAC scripts only detect your first IP address). Plus, as far as I can tell, PAC files are checked for every single HTTP request which must be a hit on browser performance.

Anyway, what I decided to do was directly modify the FoxyProxy config file before Firefox was run, and this would then select which FoxyProxy profile was used. The script below detects the host of something on my local network (which doesn’t exist at work) and switches accordingly. You could get it to switch on anything you like, but this works for me.

runfirefox.vbs

Set WshShell = WScript.CreateObject("WScript.Shell")

' Code to determine where you are and switch profiles accordingly
if (Ping("somehost") = "201.69.34.132") then
	ModifyFoxyProxy("3402440320")
else 
	ModifyFoxyProxy("patterns")
end if

' Run Firefox - this uses a specific profile.. your command line can simply exclude it
ReturnCode  = WshShell.Run("""C:\Program Files\Mozilla Firefox\firefox.exe"" -profile ""z:/firefox/profiles/qtxjee58.default""", 6, False)



sub ModifyFoxyProxy(sProfile) 
	' Path to your foxyproxy.xml file
	xmlfile="Z:\Firefox\Profiles\qtxjee58.default\foxyproxy.xml"
	outfile="Z:\Firefox\Profiles\qtxjee58.default\foxyproxy.xml"
	set oparser=createobject("msxml2.domdocument")
	with oparser
	    .async=false
	    .validateOnParse=false
	    .resolveExternals=false
	    .load xmlfile
	end with
	    
	if oparser.parseerror.errorcode<>0 then
	    wscript.echo "xml file " & xmlfile & " is not well-formed." & vbcrlf & "Operation aborted."
	    wscript.quit 999
	end if
	
	set oroot=oparser.documentElement
	oroot.setAttribute "mode", sProfile
	oparser.save outfile
	    
	set oparser=nothing 

end sub


function Ping(strHost)

    dim objPing, objRetStatus

    set objPing = GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery ("select * from Win32_PingStatus where address = '" & strHost & "'")

    for each objRetStatus in objPing
        if IsNull(objRetStatus.StatusCode) or objRetStatus.StatusCode<>0 then
    		Ping = ""
            'WScript.Echo "Status code is " & objRetStatus.StatusCode
        else
            'Ping = True
            'Wscript.Echo "Bytes = " & vbTab & objRetStatus.BufferSize
            'Wscript.Echo "Time (ms) = " & vbTab & objRetStatus.ResponseTime
            'Wscript.Echo "TTL (s) = " & vbTab & objRetStatus.ResponseTimeToLive
            Ping = objRetStatus.ProtocolAddress 
        end if
    next
    
end function 

Using OpenDNS with the O2-supplied Router

One thing that O2 didn’t put into the web interface for the Thomson TG585 wireless routers they supply you with, is a way to change DNS servers. It’s therefore a bit of a pain if you want to use OpenDNS. Luckily it’s not that hard to make the changes via a telnet connection:

telnet 192.168.1.254
Login name: SuperUser
Password: O2Br0ad64nd

Now make a note of your existing DNS setup using this command:

dns server route list

It’ll give you something like this;

DNS Server Entries:
  DNS Server     Source  Label   Metric Intf         State  Domain
D 87.194.0.53                    10     O2_ADSL       UP      *
D 87.194.0.52                    10     O2_ADSL       UP      *

The ‘Intf’ column is the type of connection you have (yours might differ from mine).. you’ll need this for the next commands;

dns server route flush
dns server route add dns=208.67.222.222 metric=0 intf=O2_ADSL
dns server route add dns=208.67.220.220 metric=0 intf=O2_ADSL
dns server route list
saveall

That’s it. Release and renew your IP address on all connected equipment and you’re all set.

IBM Thinkpad Hardware Control

The ‘Access IBM’ button on my laptop doesn’t get much use, so I decided to map it up to the PC release of XBMC (Xbox Media Centre). That’s the easy part, because you either set that in the registry, or use this small app.

When XBMC fires up I’d also like to set the volume levels of the laptop so that they output properly for the AV equipment I’ve got hooked into it. Once XMBC shuts down I’ll set back down so that the sound is at a lower level. The IBM laptops use a hardware volume control (independent to the Windows volume control) so I’m using some Python scripts to access the IBM hardware.

Here’s the finished scripts (the first one calls the second):

xbmc.vbs

Set WshShell = WScript.CreateObject("WScript.Shell")

'Set windows volume level
SetSoundLevel 90

'Set IBM ThinkPad volume level
ReturnCode  = WshShell.Run("C:\win32app\startup\thinkpadsetvolume.pyw 14", 1, true)

'Run XBMC and wait until it exits
ReturnCode  = WshShell.Run("C:\Progra~1\XBMC\XBMC.exe -fs -p", 1, true)

'Set IBM ThinkPad volume level
ReturnCode  = WshShell.Run("C:\win32app\startup\thinkpadsetvolume.pyw 3", 1, true)

'Set windows volume level
'SetSoundLevel 30

' ------------------------------------------------------------------------
' Function to set the Windows sound level
' ------------------------------------------------------------------------
Sub SetSoundLevel ( iMyLevel )

On Error Resume Next
Err.Clear 

Dim blSoundDevicePresent
Dim objSoundDevice

blSoundDevicePresent = False

For Each objSoundDevice In GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf ("Win32_SoundDevice")
 blSoundDevicePresent = True
 Exit For
Next

If Not blSoundDevicePresent Then Exit Sub

Dim iDefaultLevel, iSoundLevel, objSoundLevel

iDefaultLevel = 5

If Not IsNumeric ( iMyLevel ) Then iMyLevel = iDefaultLevel

MyLevel = CInt ( iMyLevel )
If Err.number  0 Then iMyLevel = iDefaultLevel

If iMyLevel  100 Then iMyLevel = iDefaultLevel

Err.Clear
set objSoundLevel = CreateObject ( "SetSoundLevel.SoundLevel" )
If Err.number  0 Then Exit Sub

iSoundLevel = iMyLevel * ( objSoundLevel.GetMaxSoundLevel - objSoundLevel.GetMinSoundLevel ) / 100

objSoundLevel.SetSoundLevel iSoundLevel

set objSoundLevel = Nothing

End Sub

thinkpadsetvolume.pyw

import thinkpad
import time
import sys

if __name__ == '__main__':
    try:
        c = int(sys.argv[1])
    except IndexError:
        c = 14
    hk = thinkpad.Hotkeys()
    hk.set_volume(c)

BT i-Plate

There have been a bunch of articles on the web about the BT i-Plate; a self-fit component that you stick into your master socket to improve your broadband speed. PC Pro gave it a good review, and so did a bunch of sites on the web.. for a tenner I thought I’d give it a try.

.
.
.
.
Speeds before:

5975 kbps (747kB/s) 376 kbps (47kB/s)
5812 kbps (727kB/s) 377 kbps (47.1kB/s)
5453 kbps (682kB/s) 373 kbps (46.6kB/s)
4873 kbps (609kB/s) 378 kbps (47.3kB/s)

Speeds after:

6151 kbps (769kB/s) 379 kbps (47.4kB/s)
5227 kbps (653kB/s) 379 kbps (47.4kB/s)
5350 kbps (669kB/s) 379 kbps (47.4kB/s)
4141 kbps (518kB/s) 366 kbps (45.8kB/s)
3622 kbps (453kB/s) 358 kbps (44.8kB/s)
4409 kbps (551kB/s) 360 kbps (45kB/s)

So far the results don’t look any different from before. Hey Ho. Maybe the connection will improve over time, with better line stability.

Harmony 555 – a hacker’s remote :)

To go with my purchase of a new Topfield 5800 Freeview PVR in February I replaced the mess of remote controls with a single universal remote from Logitech. As usual I did some exhaustive research so that I knew exactly what I was getting, and that it’d do everything I wanted. The remote I chose was the Harmony 555; now available for about £50.

The main thing with the Harmony remote controls is that they’re very customisable, however you’ll need patience to set it up if you’re a perfectionist. All in all it took me around 3 hours (on and off) to get it just right. Programming it requires you use some software on a PC & upload the settings to the remote via a USB cable. This worked pretty well and I couldn’t imagine trying to configure it without a PC. An added bonus is that even if you break the remote all your settings are kept with Logitech and can be synchronised back down.

Batteries (4xAAA) lasted around 4-5 months. Some of the more expensive Harmony remotes have colour screens and recharge an internal battery.. I’m really not that bothered about seeing the screen in colour and having to dock the thing to recharge it seems like a hassle & is another charger to add to the drawer.

After 6 months of use I’m still happy with it, and I’d recommend the Harmony 555 to anyone who wants a completely customisable universal remote.

USB Detect & Launch Version 1.5 Released

USB D&L USB Detect & Launch allows you to automatically execute a script or application each time a USB storage device is plugged into your PC. Different scripts can be executed for different devices and it’s the volume label that determines what action to perform.

Version 1.5 contains new functionality to monitor for any device being plugged in; useful when you have no control over what memory stick is being inserted, but need to fire off a script to perform a particular action.

e.g.

label:(any)
exec:”c:batchbatch-any.cmd” %1 %2

You can find the download on the USB Detect & Launch page.

File Mover 1.9 Released

File mover is useful little utility that will move files from one folder to another. This is useful when a program (or remote server) dumps files into a folder & you want to move them somewhere else. An added bonus with this utility is that it’ll (optionally) run a program each time a file is moved; this could be useful for firing off email notification.

Version 1.9 has been released and includes some small fixes and enhancements. E.g. copy from log now works, and the app doesn’t freeze when executing a script in ‘Wait for executed process’ mode.

You can find the download on the File Mover page.

Drive Map Pro 1.6 Released

Drive Map Pro is a great piece of Windows software for organising all the servers you connect to. It’s primary purpose is to give you easy access to mapping a network drive with the minimum of fuss, however it does a lot more that that, including managing your VNC/Radmin connections too!

The latest version of Drive Map Pro (version 1.6) is now available to registered users and includes the following:

  • Lots of bug-fixes :-D
  • Ability to have multiple UNC drive mappings under one entry, syntax is ‘\serverc$,d$,whatever’, which gives you the ability to map to any/all 3 of those drives without clogging up your list of servers!
  • Middle-click launches the application you’ve associated with the server.. saves a click or two!
  • Store notes against each entry.. handy for storing box info, like who’s the administrator
  • More application preferences (like auto-hide DriveMapPRO after launching an application)

Click here for more information on Drive Map Pro.

Drive Map Pro 1.6

Mapping a drive has never been easier!!