About DataHamster

The Data Hamster stores facts and information in its capacious cheek pouches and regurgitates them from time to time.

The %~dp0 Variable

Reblogged from https://htipe.wordpress.com/2008/10/09/the-dp0-variable/

The %~dp0 (that’s a zero) variable when referenced within a Windows batch file will expand to the drive letter and path of that batch file.

The variables %0-%9 refer to the command line parameters of the batch file. %1-%9 refer to command line arguments after the batch file name. %0 refers to the batch file itself.

If you follow the percent character (%) with a tilde character (~), you can insert a modifier(s) before the parameter number to alter the way the variable is expanded. The d modifier expands to the drive letter and the p modifier expands to the path of the parameter.

Example:  Let’s say you have a directory on C: called bat_files, and in that directory is a file called example.bat. In this case, %~dp0 (combining the d and p modifiers) will expand to C:\bat_files\.

Check out this Microsoft article for a full explanation.

See also this thread on stackoverflow.

This differs from the %cd% variable which is the current directory.

You can easily see the difference by creating the following batch file called, say, test.bat
@echo off
echo The current directory is %cd%
echo The batch file is in %~dp0

If you were to run this from d:\temp by calling c:\bin\test.bat then the output would be
The current directory is D:\temp
The batch file is in c:\bin\

Suzuki Swift Sport Mk1 info

I owned a 2008 Suzuki Swift Sport Mk1 for a while but have now sold it. However, I did assemble some useful information on it, which in keeping with the ethos of DataHamster, I am putting here in case it is of any use to anyone.

Wheels and tyres

Standard wheels

The standard OE wheels for the Swift Sport Mk1 are:
5 x 114.3, 6.5 x 17, offset 50, centre bore 60.1mm

After-market wheels

Some sources say that after-market wheels with offset 38-45 are ok, others say 35-40.

If looking for cheap Winter wheels, many cars in Mazda’s line-up (such as the 3, 5, 6, 626 and Premacy) have the correct stud pattern, size and offset, but a 67.1mm bore. However, spigot rings to reduce the bore from 67.1mm to 60.1mm are readily available to buy (eg. on eBay).


The standard tyres are 195/45 R17, but these are a little unusual and choices are limited.
You can no longer get the original fit Goodyear Eagle F1 tyres.

205/40 R17 should work fine, according to many internet sources, although I did not try this myself.


Please see this post that I made on changing the standard fit stereo for an after-market one.

If you just want an AUX input, then you can get a neat little box of tricks that plugs into the standard fit stereo and makes it think it has the optional CD player fitted.
I still have mine and am happy to sell it. Contact me if interested (I will update this post when it is no longer available, so if you are reading this then assume I still have it!)

Washer motors

Ridiculously easy to change. Please see this post.

Outlook 2003 “Reduced Functionality” mode workaround.

I stopped using Microsoft Office years ago, having switched to LibreOffice instead. LibreOffice does everything I need, and can open all my old Word and Excel documents, so I haven’t really missed Microsoft Office. However, I still have Outlook 2003 installed in order to read archived emails residing in a PST file.

Recently I completely rebuilt my PC, with a new motherboard and CPU, and the change was enough that Outlook 2003 decided that it needed to be activated again. Unfortunately it is now no longer possible to activate Outlook 2003 (or, indeed, any of Office 2003) as Microsoft have discontinued support, and turned off the activation servers. It is no longer even possible to enter a manual activation key either.

If you click “Cancel” on the activation dialog, then Outlook 2003 runs in a read-only mode called “Reduced Functionality” mode. That’s fine, as I only want to be able to refer back to old emails.

However, the reduced functionality is really reduced. You cannot print an email, or save, or even copy & paste the text in many cases. That’s pretty harsh.

There are workarounds, though.


Attachments cannot be saved, but they can still be opened, and then the application that opens the attachment can be used to do a “save as”. So although it is an annoyance to have to actually open an attachment in order to save it, rather than just selecting “save attachment”, it’s merely an inconvenience.

Message body

Plain text emails
If the message is a plain text email then the text in the message body can be selected and copied (although “save as” is still greyed out). It is also possible to print the message.

HTML emails
For HTML emails, you cannot select any of the message text and copy it, which is a major annoyance. Neither can you print the message. However, if you right-click on the message, one option that is not greyed out on the right-click menu is “View Source”. Selecting this opens the HTML source of the message in your default text editor (i.e. Notepad, unless you have changed it).
From there you can choose “save as”, remembering to change the extension of the filename from “.txt” to “.html”.
You can then double click on that saved file from Window Explorer to open the file in your favourite web browser, and the message will then be available to view, print, and to copy & paste.


Compassion by Sydney Kosgard

Compassion by Sydney Kosgard

Compassion by Sydney Kosgard

We’re used to things staying up on the internet forever once they are posted, but things only persist for as long as people host them and that’s one of the things that DataHamster seeks to do. So I am reproducing this here in good faith with no intent to infringe copyright.

This picture was made by Sydney Kosgard, who was a 10th Grade school pupil at the time, and it was made for The Appleton Compassion Project with the accompanying words:

Compassion is the conjoining of souls, an insight into another human’s core. It is the deepest level of understanding. It is an unspoken bond. Compassion connects two spirits together; their souls bound by a whispy, airy fiber clinging between them like a spider’s knot. Running from thread to thread is an electrical current that stimulates the spirit. Compassion is more than empathy, care, and love; it is the escape of man from earthly and bodily confines. Compassion is the Eden we so hungrily crave. It is an innocent and protected realm. It is ecstasy and an epiphany. When two souls connect, an aura of revelation is released. Much like switching on the lights after being shrouded in darkness, compassion illuminates our lives.


About the Appleton Compassion Project

The Trout Museum of Art, in partnership with the Appleton Area School District and Appleton Education Foundation, is proud to announce a project that aspires to teach the practice of compassion through the use of art. “The Appleton Compassion Project” is a community art project involving 10,436 Appleton Area School District K-12 art students. Appleton private schools, including Lawrence University, were also participated. In fall 2010, participating students received a 6-inch-by-6-inch art panel to draw or paint their idea of compassion. Completed works of art were exhibited at The Trout Museum of Art (Appleton) from May 1-June 30, 2011. The inspiration behind the project came from Richard Davidson, PhD — a University of Wisconsin-Madison psychology and psychiatry professor and brain investigator who has scientifically found that those who practice compassion have measurably healthier brains, and generally, a happier outlook on life. Davidson’s vast research has earned him the most distinguished award for science given by the American Psychological Association — the Distinguished Scientific Contribution Award in 2000; he was also named one of the world’s most 100 influential people in 2006 by Time Magazine. Davidson’s research shows that compassion can be learned, and should be practiced, as a skill.

Canon Powershot G7X

Canon G7X

Canon G7X

I recently bought a Canon Powershot G7X, which is Canon’s high-end compact camera to rival the Sony RX100 III

These are my initial thoughts on it:

I’m really liking it so far. In auto mode a variable size square locks on to what it thinks is the main subject of the photo and this is the focus point, which then adjusts automatically as it works out how much of the subject to keep in focus. It then automatically switches to what it thinks is the appropriate scene mode – so if it detects a face it will switch to portraiture mode and throw the background into blur. It even has facial recognition and can store up to 12 people, and in group shots will favour those people and prioritise them, making sure they come out the best. It even has blink detection. It’s rather too scarily clever for its own good!
You can override the auto-selection of the subject with the touch-screen and then as you move the camera around it tracks it. It’s a really cool feature.

At 390g it feels a little heavy compared to my old Panasonic DMC-SZ9 but not excessively so.

The only annoyance so far is that it seems that you can only charge the battery by removing it from the camera and charging it on the separate charger – it seems that not only does it not charge from its USB port when connected to a PC, it actually very quickly drains its battery on file transfers whilst connected. That’s a pretty big annoyance. (Edit: Some reviews seem to suggest that it *can* be charged via USB so I’m happy to be corrected. But that was not my experience)

The other annoyance is that there isn’t a dedicated wireless remote – you use an app on your smartphone for remote shooting. I would have preferred a system like the one used by the GoPro, which has a choice of using a smartphone or a dedicated remote.

I haven’t even begun to scratch the surface on its features or capabilities yet, so there is doubtless more to come. Those are my initial thoughts though.

Suzuki Swift Sport Mk1 vs Mk2

I’ve owned a 2008 Suzuki Swift Sport Mk1 for a year or so now, but lately have been doing a lot of motorway miles and the short gearing of the Mk1 is really starting to grate. In case you are not aware, at 70mph (GPS-verified rather than speedometer) the engine is pulling 4000rpm in 5th gear and is quite a noisy and unrefined place to be. It can get very wearing.

Today I test drove a 2015 Suzuki Swift Sport Mk2, and here are my thoughts on it.

First the good things:
It feels like it is in the next class up, with a much more contemporary interior, nicer seats, much better ergonomics, much higher level of equipment, and all altogether much nicer place to be. The leather steering wheel is a nice bit of tactile luxury. It also has a lower seating position which I liked a lot. It makes the Mk1 look and feel very dated, basic and cheap.
The 6th gear is a very welcome addition, as is the more comfortable ride and much better sound proofing. It is far quieter, more refined and more comfortable than the Mk1. When I took it out onto the motorway and set the cruise control, it felt like a car that could eat up the miles on my daily 100 mile round trip commute. Overall, a much more grown up car, and something you could use every day – far more so than the Mk1 which is extremely wearing on the motorway.

Now the bad things:
It has no character. All the fizz, vigour, vivaciousness and hooliganism of the Mk1 has been dialled back or lost altogether, and the Mk2 feels rather soulless and anodyne. The controls are way too light and lack the precision of the Mk1. Also completely gone is the way the Mk1 will pivot around you and put a smile on your face from doing something as trivial as a flick-flack through a mini-roundabout. It just all felt a little joyless in the Mk2. Furthermore, you forgive the lack of power in the Mk1 because it has such great throttle response, and because it is such fizzy fun. However, it’s much harder to forgive the Mk2 because, although it has more power and is lighter, the throttle response is much less sharp, there is more flywheel effect, there is less engine braking effect, and the whole thing feels more sluggish despite also feeling slightly more accelerative. I realise that this doesn’t really make much sense, but it’s palpable.

After I had finished the test drive and returned to the dealership, I realised that for the whole drive I had been trying to like the Mk2, and had been trying to convince myself that it would be ok if I bought it. There were rare fleeting glimpses of the Mk1 but they were mere echoes. When I left the dealership in my Mk1, it only took one mini-roundabout to get me grinning and thinking “God, I love the Mk1”. That pretty much said it all really. The clutch in the Mk1 felt really heavy after the Mk2 though, but the steering had so much more heft and precision, the gearbox was more snicketty, the brakes were more positive (although that might be down to the fact that I run EBC Yellow Stuff pads), and it just felt so much more alive.

Summary: (for those for whom the above is TL;DR)
The Swift Sport grew up and is a better daily driver for it. But also far less fun.

Sniping on eBay

I didn’t write this, but saw it written on a public forum. I thought it was such a succinct explanation that it was worth preserving.

Item X is for sale in an eBay auction. The item is currently up at £10. Fred is the highest bidder. Fred has bid £20, but eBay hasn’t disclosed that amount yet.

You decide that the maximum you want to pay is £50….

Scenario 1
You bid £50 in the closing seconds. eBay sets the highest current bid at £21 (£1 more than Fred’s bid).
Fred does not have a chance to reconsider his bid. You win the item for £21.

Scenario 2
You bid £50 with several days left to go. eBay sets the highest current bid at £21.
Fred notices this, sucks air through his teeth and decides that perhaps he *could* go to £30 after all.
Fred bids £30. eBay automatically sets current amount to £31 (again £1 more than Fred’s highest bid).
You are still the highest bidder.
Fred is annoyed and bids £35. eBay sets the current amount to £36. Fred gives up and goes back to looking for internet porn.
The auction ends, you win the item for £36.

Scenario 3
You bid £50 with several days left to go. eBay sets the highest current bid at £21.
The auction owner notices your bid and shill bids against you. He reveals your highest bid amount by bidding more than you. He then cancels his bid and bids again at £49, which is £1 less than your maximum.
The auction ends, you win the item for £50.

In all cases, you’ve won. In all cases you’ve not paid more than your maximum. In two of the three cases, you’ve acted foolishly and have been parted from more money than you need have been.

Fitting an aftermarket stereo to the Suzuki Swift

This post is a “How to” on fitting an aftermarket stereo to the 2nd generation Suzuki Swift (2004-2010)

In it I will tell you what you need to buy to do this and, just as importantly, what you do NOT need (but people will try to sell you anyway) and then I will move on to how to fit it.

The procedure was performed on a 2008 Swift Sport (UK right-hand drive model). However, I have seen photos of this procedure done on a left-hand drive USA model so the procedure is the same.

Continue reading

Changing the washer motors on the Suzuki Swift

This post is a “How to” on changing the washer bottle motors on the 2nd generation Suzuki Swift (2004-2010)

Original washer motor

Original washer motor

Washer motor

Pattern part replacement

The procedure has been confirmed with a 2005 1.5 GLX 5d auto VVT and a 2008 Swift Sport, both UK right-hand drive models.

No representation is made as to the accuracy of the information in this article and any work undertaken on your own car is at your own risk.

This model of Swift uses two identical single-outlet motors; one for the rear and one for the front. They attach directly to the bottle and are push-fit, so are ridiculously easy to replace. They are also readily available and very cheap – expect to pay between £5 and £10 per motor for generic pattern parts on eBay. As you can see from the pics, it is pretty easy to identify the correct part as the outlets and electrical connector are fairly distinctive.

Access to the washer bottle and motors is via the inner wing on the front-right side. On RHD cars this is the driver’s side. I presume that on LHD cars it is in the same place.

It makes access a lot easier if you take the wheel off.

Remove the pop fasteners along the inner wing. On this car, the centre of the circular fastener is pulled out to release it and then the whole lot pulls out. Be careful not to damage them, however if you do then replacements are readily available on eBay.

Swift washer bottle

Swift washer bottle

Pull back the inner wing and the washer bottle is right there. You can clearly see the two identical motors. Rather logically, the one closer to the front of the car is for the front windscreen and the other for the rear screen.

The motor is a push fit directly into the bottle.

Pull off the electrical connector and tube hose of the one you wish to change, and then firmly pull the motor away from the bottle. Replacement is the reverse.