What does “afronding” mean on Dutch receipts?

Dutch shops tend to round to the nearest 5 eurocents, so a bill coming to €4.89 would be rounded to €4.90. This is shown as afronding – literally, “rounding” – a correction of up to two cents either way.

The net result is that 1 and 2 eurocent coins in the Netherlands are rare (although they are still in circulation).

I’m not sure quite when the decision was made to do this; I’ve been aware of it for a few years now and, frankly it’s a great way to cut down on coppers.

If the price was, say, €4.87 then it would be rounded down to €4.85 – ie. the customer “gains” two cents. This should balance out but I suppose it depends on the use of psychological prices (the whole 99 cent pricing strategy clearly works in the shop’s favour) and how many items you buy (three items at 99 cents each would benefit the customer).

Somebody, somewhere has earned a PhD from this I’m sure!

I would be curious to know if there have been other effects of this. Are charity pots (not that I’ve seen any) less full as a result?

“This site is running TeamViewer”

Beware if you decide to use TeamViewer, a remote control app. It appears to launch a webserver on port 80 I think for some kind of NAT/firewall detection. In any case, if your computer is also used as a webserver this will cause a few issues :-)

The solution I have found (for Teamviewer 5 Windows) is to close the program (right click and exit; make sure it’s completely closed). Then open the registry editor (Start menu > Run > regedit) and find your way to the following registry entry:
HKEY_LOCAL_MACHINE\Software\Teamviewer\Version 5\
and change ListenHttp from 1 to 0.

You must close Teamviewer first, I found that if you change it while Teamviewer is still running, the setting will be reset (back to 1) when the program is next closed.

Copy Database in SQL Server 2008

You want to copy a database, maybe for development purposes? Try this: It is based on this code by Michael Schwarz, but updated for SQL Server 2008:

USE master
GO

-- the original database (use 'SET @DB = NULL' to disable backup)
DECLARE @DB varchar(200)
SET @DB = ''

-- the backup filename
DECLARE @BackupFile varchar(2000)
SET @BackupFile = 'c:\temp\backup.dat'

-- the new database name
DECLARE @TestDB varchar(200)
SET @TestDB = 'MydatabaseDevelopment'

-- the new database files without .mdf/.ldf
DECLARE @RestoreFile varchar(2000)
SET @RestoreFile = 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\MydatabaseDevelopment'

-- ****************************************************************
-- no change below this line
-- ****************************************************************

DECLARE @query varchar(2000)

DECLARE @DataFile varchar(2000)
SET @DataFile = @RestoreFile + '.mdf'

DECLARE @LogFile varchar(2000)
SET @LogFile = @RestoreFile + '.ldf'

IF @DB IS NOT NULL
BEGIN
SET @query = 'BACKUP DATABASE ' + @DB + ' TO DISK = ' + QUOTENAME(@BackupFile, '''')
EXEC (@query)
END

-- RESTORE FILELISTONLY FROM DISK = 'C:\temp\backup.dat'
-- RESTORE HEADERONLY FROM DISK = 'C:\temp\backup.dat'
-- RESTORE LABELONLY FROM DISK = 'C:\temp\backup.dat'
-- RESTORE VERIFYONLY FROM DISK = 'C:\temp\backup.dat'

IF EXISTS(SELECT * FROM sysdatabases WHERE name = @TestDB)
BEGIN
SET @query = 'DROP DATABASE ' + @TestDB
-- EXEC (@query)
END

RESTORE HEADERONLY FROM DISK = @BackupFile
DECLARE @File int
SET @File = @@ROWCOUNT

DECLARE @Data varchar(500)
DECLARE @Log varchar(500)

SET @query = 'RESTORE FILELISTONLY FROM DISK = ' + QUOTENAME(@BackupFile , '''')

CREATE TABLE #restoretemp
(
LogicalName varchar(500),
PhysicalName varchar(500),
type varchar(10),
FilegroupName varchar(200),
size int,
maxsize bigint,
x1 nvarchar(1),
x2 nvarchar(1),
x3 nvarchar(1),
x4 uniqueidentifier,
x5 int,
x6 int,
x7 bigint,
x8 int,
x9 int,
x10 nvarchar(1),
x11 bigint,
x12 uniqueidentifier,
x13 int,
x14 int,
x15 nvarchar(1)

)
INSERT #restoretemp EXEC (@query)

SELECT @Data = LogicalName FROM #restoretemp WHERE type = 'D'
SELECT @Log = LogicalName FROM #restoretemp WHERE type = 'L'

PRINT @Data
PRINT @Log

TRUNCATE TABLE #restoretemp
DROP TABLE #restoretemp

IF @File > 0
BEGIN
SET @query = 'RESTORE DATABASE ' + @TestDB + ' FROM DISK = ' + QUOTENAME(@BackupFile, '''') +
' WITH MOVE ' + QUOTENAME(@Data, '''') + ' TO ' + QUOTENAME(@DataFile, '''') + ', MOVE ' +
QUOTENAME(@Log, '''') + ' TO ' + QUOTENAME(@LogFile, '''') + ', FILE = ' + CONVERT(varchar, @File)
EXEC (@query)
END
GO

Usual caveats apply, backup before running, etc.

SQL Server Notes

For fans (or reluctant users) of SQL Server – here is a quick and easy way to get approximate table sizes for a database:


USE [dbname]
GO
CREATE TABLE #temp (
table_name sysname ,
row_count INT,
reserved_size VARCHAR(50),
data_size VARCHAR(50),
index_size VARCHAR(50),
unused_size VARCHAR(50))
SET NOCOUNT ON
INSERT #temp
EXEC sp_msforeachtable 'sp_spaceused ''?'''
SELECT a.table_name,
a.row_count,
COUNT(*) AS col_count,
a.data_size
FROM #temp a
INNER JOIN information_schema.columns b
ON a.table_name collate database_default
= b.table_name collate database_default
GROUP BY a.table_name, a.row_count, a.data_size
ORDER BY CAST(REPLACE(a.data_size, ' KB', '') AS integer) DESC
DROP TABLE #temp

…and a way to list all column specs…

USE [dbname]
GO
CREATE TABLE #temp (
table_name sysname ,
row_count INT,
reserved_size VARCHAR(50),
data_size VARCHAR(50),
index_size VARCHAR(50),
unused_size VARCHAR(50))
SET NOCOUNT ON
INSERT #temp
EXEC sp_msforeachtable 'sp_spaceused ''?'''
SELECT a.table_name,
b.COLUMN_NAME, b.COLUMN_DEFAULT, b.IS_NULLABLE, b.DATA_TYPE, b.CHARACTER_MAXIMUM_LENGTH
FROM #temp a
INNER JOIN information_schema.columns b
ON a.table_name collate database_default
= b.table_name collate database_default
--GROUP BY a.table_name, a.row_count, a.data_size
ORDER BY CAST(REPLACE(a.data_size, ' KB', '') AS integer) DESC
DROP TABLE #temp

For this you could also SELECT * FROM information_schema.columns

Original code from http://blog.sqlauthority.com/2007/01/10/sql-server-query-to-find-number-rows-columns-bytesize-for-each-table-in-the-current-database-find-biggest-table-in-database/

Coastline Features in Google Maps

harboursGoogle Maps appears to be promoting coastline features and bodies of water above major cities in its terrain view. Far enough out, you will see harbours and banks; further in the usual littering of cities takes over.

Interesting for the fact somebody has clearly decided this is a better way to help people navigate in this view – maps and satellite views both continue to show cities at all zoom levels.

Separately, while coverage of Street View in the UK continues to grow (large chunk of north-west Scotland, and more motorways), I’m wondering when they’ll get round to adding the photos presumably taken while the cars were in Fareham and Petersfield summer last year…

Freecom Hard Drive Protection

I recently bought a Freecom ‘ToughDrive’ hard disk from eBuyer. It came with some virtual CD drive that automatically installed a Password utility.

Whenever I used other USB drives, the computer locked up. Not sure whether the Freecom software was to blame (it became unresponsive when I tried to reset), but still – I’m a bit of a tidy freak for startup processes, so anything that installs automatically is not likely to make me happier!

Anyway, this website appears to offer a CD removal tool, which should do the trick – just make sure you pay attention to the model number.

N770 Keeping Screen Display on

I have begun to use my old Nokia 770 as a sort-of dashboard for our company’s stats – a bit like a health screen. To achieve this I have created a webpage which just fits on the screen (in fullscreen mode) and periodically refreshes.

To keep the Nokia 770 display running, you’ll need the following instructions (note, not manufacturer approved, use at your own risk!)

Install XTerm and run two gconftool-2 commands (all shown on this page) – note, those gconftool commands do indeed extend for three lines. You need to enter them as one command.

Install Display daemon ‘acmonitor’ from here. This will allow you to set the display profile when on charge and on battery. Ideally you’ll not want the tablet running at full brightness when it’s on battery power!

I added 86400 (a day) which will show in your Display control panel as ‘1440 minutes’ – that should be enough!

Lessons in eCommerce development

This article from Paul Boag at local web design firm Headscape demonstrates some key features of their ecommerce site which apparantly lead to a 10,000% increase in sales.

It’s November already?

It’s been a while folks. Due to the pressures at work at the moment I simply haven’t found time to write here. There’s no point in making vague promises; let’s just see if I can reignite this fire and get back into the habit.

A little summary of my adventures over the last eight or so months:

  • We moved offices from Fareham to Petersfield
  • I took on new staff – our company doubled in size overnight (!)
  • We moved offices from Petersfield to Fareham

I’ve learnt far more than I ever imagined about running a business in the last year or so. It has been exhausting but thrilling. I hope to write more about this in the coming weeks.

Watching the Watchers

Last night, Google released an update to its Street View system to include new locations across the UK, Netherlands and other European countries.

My home city, Portsmouth, is not on there yet but Southampton is so, clicking through my old university stomping ground I came across this little treat:
shot1

First shot: The Google Car may or may not have gone through the first red lights. Who knows… the lights ahead are already on amber.

shot2

Second shot: Lights are still on amber. Technically you should be preparing to stop ;-)

shot3

Third shot: They’re red. Is the driver still going? Watch the two cars in front – a white one and a dark blue one. Also, note the two schoolkids walking under the tunnel.

shot4

Fourth shot: The two cars ahead are further away – either they sped up or the driver is slowing down… maybe he stopped after all? Note the two kids are closer too, so it’s a continuous set of frames

shot5

Fifth shot: The two cars are well away now, already around the left-hand bend. There’s no reason to believe from this particular shot that it’s a few seconds after the last – the driver might’ve waited for a green and gone a bit later, right? Well, take a look for yourself at the car behind the driver, and the two schoolkids will still be there. In the distance, cars are starting to come towards our fearless driver…

shot6

Final shot: there are more schoolkids running under the bridge, and the oncoming cars are now having to wait for our Google Driver to get out of the way!

Conclusion: well, none really. This is a pointless, but mildly satisfying discovery. Enjoy.