"this operation has been canceled due to restrictions in effect on this computer" #

Posted 15 Sep 2010 by Sven Latham

If you get the following message when clicking links on Outlook (2003, 2007, 2010):

"This operation has been canceled due to restrictions in effect on this computer. Please contact your system administrator"

It is most likely that your browser's association has become corrupt in some way.

I found the easiest way to cure this was to ensure the htmlfile registry key was correctly set up:
You will need to open regedit.exe and go to HKEY_Local_Machine\Software\Classes\htmlfile\shell\open\command

There should be a string value inside there called (Default) - in most cases it seems the following should work:
"C:\Program Files\Internet Explorer\iexplore.exe" -nohome

Make sure this is correct, close everything down and restart Outlook.

NB. make sure Outlook is completely closed - ie. OUTLOOK.EXE is no longer in task manager.

Microsoft support issue on the matter.

Usual disclaimer applies. Do this at your own risk. No warranty, etc. etc.


What does "afronding" mean on Dutch receipts? #

Posted 16 Aug 2010 by Sven Latham

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" #

Posted 16 Aug 2010 by Sven Latham

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 #

Posted 23 Jul 2010 by Sven Latham

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 #

Posted 28 May 2010 by Sven Latham

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 #

Posted 28 Feb 2010 by Sven Latham

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 #

Posted 25 Feb 2010 by Sven Latham

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 #

Posted 02 Dec 2009 by Sven Latham

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 #

Posted 30 Nov 2009 by Sven Latham

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? #

Posted 18 Nov 2009 by Sven Latham

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:


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 #

Posted 19 Mar 2009 by Sven Latham

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.


Google Earth 5.0 #

Posted 03 Feb 2009 by Sven Latham

Google's 3D world viewer, Google Earth has been updated to version 5.

The headline feature is the ability to view historic satellite photos, as in this picture of Cherque Farm housing estate, near Lee on Solent, Hampshire, UK.

 

[caption id="attachment_720" align="aligncenter" width="300" caption="Housing estate nr. Lee on Solent, Hampshire UK"]Housing estate nr. Lee on Solent, Hampshire UK[/caption]

In the series of photos, ranging from 1999 (left) to 2007 you can clearly see the construction of the estate over time.


Gap-aware locators #

Posted 29 Jan 2009 by Sven Latham

One notable thing about most location software is that it is usually fairly crude.

Most programmers take the easy route and simply work out the distance between two points via a bit of trig. Some smarter programmers are aware of the Earth's curviture and bear this in mind.

Usually - this is as far as it goes. The classic "find my nearest" search is great for most places but is a rough 'as the crow flies' measurement.

Living for a while on the Isle of Wight, I came to appreciate that while this normally works OK, on an island it's a profoundly dumb system.

If, for instance, you live in Ryde (north coast of the Isle of Wight) most systems will recommend a shop in Portsmouth or Gosport before the more sensible option in Newport or elsewhere on the island. A bit daft really, considering to get to the 'closer' shop might be one or two ferries at the least.

Today, I noticed that the Maplin website actually excludes shops which might fall in the radius of consideration, but are much trickier to get to.

Searching for an item from my Fareham (mainland) address gives plenty of options, but the Newport store (10.7mi as the crow flies) is not included.

Similarly, searching from an island postcode gives the Newport store only as an option.

I suspect that - instead of running calculations by travel time - somebody has manually identified island postcodes, mainland postcodes and separated them by zone so only those postcodes in the same 'zone' appear in the search... that's certainly my first instinct (I'd love to think they're doing a full journey check, but I somehow doubt it ;-) )

While it's not perfect (maybe the Newport address could be grouped separately, in case I happened to be going over to the island anyway), it's a step further than most location-based searches out there.


Texturific #

Posted 19 Jan 2009 by Sven Latham

Jen has uploaded a nice set of textures to prettify your artwork. It's all available with a fairly open license (use it as you will, but give credit).

 

[caption id="" align="alignnone" width="500" caption="Selection of textures"]Selection of textures[/caption]

 

 

You can see all the textures from Jen's flickr page.


A303 Diversion #

Posted 04 Dec 2008 by Sven Latham

Apparantly the big news in the Westcountry is that the A303 is to be closed some time early next year, with a 40 mile diversion. The BBC has more details and the Highways Agency press release is also available.

I wondered why neither the HA nor any of the press articles I'd seen bothered publishing a map. While they're happy to describe an elaborate route in text, it took me less than five minutes to knock this up.

The visual view is - I think - much more explanatory than any text, and it adds instant impact to the article.


VAT Dropped Today #

Posted 01 Dec 2008 by Sven Latham

Good morning! It's just gone 7am and those programmers out there involved in EPOS and e-commerce systems are either sitting smug or are running around trying to get the computers updated before the shops open.

Today's the day standard rate of VAT (sales tax) drops from 17.5% to 15%, in a move by the Chancellor to encourage spending. Whether it works or not remains to be seen, I've heard that many shops are simply keeping prices as-is, and pocketing the slight difference in markup from each sale. Some high-street shops have bizarre "offers" highlighting the VAT drop as the reason but (in one case) "offer ends 3 December".

In view of all of this number-crunching fun, I've produced a handy VAT Check Sheet for download, which allows you to see the VAT difference, new totals and how much shops should be dropping prices. I think the numbers are right but if anybody has any corrections, thoughts or comments I'll be happy to update.


The Obligatory "I'm Still Alive" Post #

Posted 03 Nov 2008 by Sven Latham

It's been a fair while since my last post. Various reasons come to mind but for me the biggest focus of the last six weeks has been my company, which has taken a far greater chunk of my attention in recent times.

While plenty of things have happened recently, I'm going to try focusing on my business as the basis for a series of new articles on this blog. I'm hoping to talk more about my experiences, ups and downs with the hope that this kind of writing will be useful to others.

The usual common-sense disclaimer applies: anything I write is personal, (usually) unqualified and should not be viewed as definitive. Simply take them as they are: anecdotal.

I'll be writing the first article real soon now, and you are actively encouraged to reply and give your own thoughts.


Going Solo - Review #

Posted 19 Sep 2008 by Sven Latham

Last Friday I spent the day in Old Broadcasting House, Leeds with a group of like-minded people interested in starting, or already on their freelance journey.

The event, organised by Stephanie Booth was originally intended to be a larger conference but due to disappointing numbers it was cancelled. The attendees were instead invited to a smaller, less formal gathering called SoloCamp.

The twenty-or-so of us who attended spent the day talking about a variety of issues: Finance, Confidence, Growth and Clients. The full overview of the day can be found on the SoloCamp wiki.

This was my first "BarCamp" style event, and I took the opportunity to get some presentational confidence by moderating the Growth session. I had a bit of a stumble with the session as my ad-hoc material quickly ran out, but thankfully the session turned into a rather interesting discussion about Hype Cycles towards the end (thanks to Dennis!).

All in all, a very interesting and educational experience. It gave me renewed enthusiasm about getting my company up and properly running. It also had me thinking about charging policies, marketing and finance, all of which are very important to a vulnerable technology start-up. More generally, it has been a great pleasure meeting a variety of individuals, from various backgrounds who I hope to keep in touch with.


Google Gears + iamnear.net Demo #

Posted 22 Aug 2008 by Sven Latham

Finally, I'm back into doing something that I love - fiddling with new ideas.

Today, Google released Google Gears 0.4 with geolocation. For those of you not yet aware of Google Gears, it's an attempt by the big G to enhance the client-side with a variety of rich add-ons, such as local databases, offline services and smoother integration with the host OS.

Gears is also available for Windows Mobile devices and, with the addition of geolocation, adds some exciting spice to the mobile platform.

Previously I've made aborted attempts to use a combination of Navizon (a mobile tracking service), Fire Eagle (Yahoo!'s location "platform") and iamnear.net (Tom Taylor's very handy directory of POIs). It works to a point, but is a hopelessly elongated way of serving geo-aware content from a web browser.

With Gears 0.4 it's now possible for the browser to interrogate directly the user's location, through a combination of cell IDs and GPS (where available). The natural conclusion is to slap this tool onto the front of something like iamnear.net, et voila, you have a location-aware website puling information directly from the client.

Without further ado, check out my painfully basic demo - you'll need Windows Mobile 5/6 and Google Gears (if it is not detected, it'll prompt you to install).

As a bonus, the site will also work on your desktop, but I'm presuming that'd only be available with a GPS dongle of some kind?

I'd love to spice it up a bit - actually without presuming too much I'm fairly sure this is a natural upgrade to iamnear.net and other sites... if you have any thoughts feel free to post below ;-)


Blast from the Past #

Posted 17 Jul 2008 by Sven Latham

A bit of a spooky advert from Facebook. Does it really know me that well that it serves up ads featuring names of websites I used to run?