Tuesday 25 December 2012

Atheist wishes all a Happy Christmas

The eldest of the Bondie household has used his Christmas Facebook status message to spread good wishes to all regardless of religion, personal beliefs and life choices.

The Archwizard of Maidenhead, David Bond, said Christmas was "lovely" and a "time for friendliness".

Speaking to the congregation of Christmas Day iPhone Facebook app users, Archwizard David said miserable old duffers had no mandate to push through any laws around humbug and exclusion.

"There was no announcement in any party manifesto, no Green Paper, no statement in the Queen's Speech. And yet here we are on the verge of a "nice day" with the people we love.

"From a democratic point-of-view, it's a shambles. Awesome. Let's all stay home and warm instead. And avoid the West Coast Mainline like the plague.

"George Osbourne is shambolic," he added.

The Archwizard claimed during a "period of using their eyes", those who looked outside this morning were "7-1 against doing anything energetic today".

In the past, the Chief Daft Old Brush in England and Wales has likened committed relationships to "profound friendships".

The government launched a 12-week consultation in March on how to remain relevant when more people voted for Strictly Come Dancing than Police Comissioners. Only policemen responded, resulting in "the worst selection bias ever seen in the history of Statistics".

'Peace and Joy'

Delivering his first Christmas Day message from The Bondie Household wearing only his T-Shirt and Boxers as one of the spirited leaders of the Bondie household, The Archwizard meanwhile will acknowledge that although the vote for women has fundamentally changed the definition of "Democracy", no-one got hurt..

He will also acknowledge comments made in November, in which many said he had "lost a measure of credibility" after the Company Christmas Do.

The Archwizard will not take up the role of Master of Magdalene College, Cambridge in January
He said at the time atheists had "considerable" work to do both internally and externally to redress perceptions of arrogance and over-reliance on "science" in the eyes of both the secular and Christian communities.

"We have, to put it very bluntly, a complete lack of explaining to do," he added.

More positively, he will also cite 2011 census data which showed a 46% decline in the number of Britons who still view themselves as Jedi when compared to 2001.

The Archwizard has also listed some of the people he has had the "privilege" to meet during the past year in his sermon.

He has paid tribute to his lovely friends and family and has acknowledged their "willingness to explore the new humanity of forgiveness and rebuilding relations" despite their own suffering at knowing him.

"These are the ones who look, as if at a raving lunatic but without actually pointing and laughing," he added.

David, along with his lovely wife, the Chief Bondy Mummy, are not going to "live tweet" their Christmas ramblings on the micro-blogging site Twitter, as it is "pretty much a dead duck" technology-wise and "utterly pointless".

They are expected to be joined by around 3 billion Church members also not tweeting on Christmas morning.

Happy Christmas everyone - children are awake now... Please switch off your gadgets...

Tuesday 4 December 2012

Creating a list of numbers in TransactSQL

To create a simple list of  numbers in an SQL table,
(from http://www.simple-talk.com/sql/t-sql-programming/faking-arrays-in-transact-sql/), the following TransactSQL does the job for a small number of rows (fewer than 32768)

WITH Nbrs ( n ) AS (
        SELECT 1 + n FROM Nbrs WHERE n < 500 )
    SELECT n FROM Nbrs

Alternatively (for higher row counts):

declare @i int
declare @rows_to_insert int
set @i = 0
set @rows_to_insert = 1000

while @i < @rows_to_insert
    INSERT INTO #temp VALUES (@i)
    set @i = @i + 1

Wednesday 14 November 2012

Disable annoying Panasonic banner ads


Saturday 20 October 2012

Adding accents to letters on a UK Keyboard

Grave accents can be added to characters by pressing [ ` ] (above the tab key) and pressing the another key: àÀèÈìÌòÒùÙỳỲẁẀ

Acute accents can be added by pressing [ Alt Gr ] (to the right of the spacebar) and pressing another key: áÁéÉíÍóÓúÚýÝẃẂ

Similar results can be achieved in some applications (e.g. Microsoft Word) with Control key combinations. Here are some examples:

[Ctrl] + [ ' ] then [ e ] --> é
[Ctrl] + [ ^ ] then [ e ] --> ê
[Ctrl] + [ , ] then [ c ] --> ç
[Ctrl] + [ : ] then [ i ] --> ï
[Ctrl] + [ & ] the [ o ]--> œ
[Ctrl] + [ ~ ] then [ n ] --> ñ

Typing tabs in textareas

Tum-te-tum... Typing text into a textarea...

Hit Tab. AGHHHH!! That's not what I meant you to do.


Hmm.. Tabinta (Tab in text area) seems to be what I want...

Try it out...


Wednesday 10 October 2012

RDP Shift Key Gets Stuck

Problem definition

Using RDP between a Windows 8 machine and Windows Server 2008 R2 (both fully patched), there is an issue whereby the shift key seems to "randomly" result in the shift key being "virtually" held down.  The shift key can be released by pressing and releasing the key.  This is annoying as hell.


To determine exactly what was hapenning, I tried a number of key-press and release sequences, including shift keys, control keys and arrow keys.  All sequences start with a "normal" state.


Here are the important results:
  • Press Shift and Control (either order) -> Release Shift -> Release Control: Normal state
  • Press Shift and Control (either order) -> Release Control -> Release Shift: Problem state


RDP has a bug whereby the shift state incorrectly remains in the "pressed" state if, after pressing Shift+Control, the Control key is released first.

Bug reference

Bug is with Microsoft: https://connect.microsoft.com/WindowsServer/feedback/details/766863/rdp-shift-key-gets-stuck


Thanks to "Unknown" (see comments, below), it seems that there is a hotfix for this https://support.microsoft.com/en-us/kb/2847932.

Thursday 4 October 2012

Classic Shell for Windows 8

I'm not a big fan of Windows 8's lack of Start Button on desktop machines.  Until now, I've been recommending Start8, but Dan recommended I look at Classic Shell as well.

And it rocks.  And it's free.  Windows 8 now looks more like this (their screenshot):

When installing, though, the default is for it to updated Windows Explorer and Internet Explorer.  Uncheck these - they are not necessary in Windows 8.

One note - when uninstalling (as I did briefly to correct my mistake and deselect these two unnecessary features), you have to reboot.  No biggie.

Advantage over Start8?  Typing [Start] c:\ [Return] works as expected again!

Incompetence and Inflexibility at Currys

So I've gone to Currys in Bracknell and ordered two fridge freezers.  One to replace mine, one to replace my father's.  Two separate transactions.  I shook the hand of the guy who processed the order and hoped he got a good chunk of commission.  I'd arranged for them to be delivered to two different addresses (mine and my fathers).  Mine was due to be delivered first.  It was.  It's lovely.  We love it. 

My fathers...  Geez.

My father's was due to be delivered today between 3pm and 7pm.  Instructions were given to call my mobile and not my father's landline.  I was working this morning so was unable to pick up 3 or 4 times when my father was trying to call me at about 10am.  I call him back and he says that he has been contacted (WHY?) to say that the delivery was now going to be between 11:30am and 12:30pm (WHY?).  "Grrr." I thought, but sighed and drove over there in time of the 11:30 delivery slot.  We get a call to his landline (WHY?) at about 12 to say that it's going to be there in 10 minutes.  Fine - I go downstairs (he lives in a flat) and wait for them.

I then get a call to my mobile to say that the goods have been delivered to the billing address (WHY?).  I say that there's obviously some mistake ask them to deliver to my father's address, 10 minutes down the road.  They refuse (WHY?).  I escalate two levels.  1/2 hour later I'm still on the phone at my father's trying to convince them to redeliver (they could have done so in that time) but to no avail.  I got one operator to admit that it was more than his job was worth.  The warehouse manager effectively said "the computer says no" and again, was inflexible to getting the delivery changed to the right address in the pre-arranged delivery slot because it was out of their region and the goods had to back to the depot and a different fridge freezer sent from another depot (I guess because the correct delivery address was a "RG" Reading postcode instead of my "SL" Maidenhead postcode.

Everyone I spoke to on the phone was courteous throughout, despite my increasing incredulity at their responses.  They were "just doing their jobs" (as defined by Currys).

So, net result it that:
  • I'm two half days' income out of pocket (1/2 day today and 1/2 day tomorrow that I have to take out of my day to be there when it's scheduled for redelivery)
  • I am getting a refund on the delivery charge.
  • I'm angry enough at Currys' general incompetence and inflexibility to blog about it
So, when ordering from Currys (which I'm not intending on doing EVER again), beware that the Currys delivery system (IT + processes), is incompetent and inflexible.
The issue has been traced back to the point of sale (the wrong checkbox was clicked or similar).

In my view, Currys need to correct the following:
  • Staff training at the Currys Bracknell store
  • Their distribution system's flexibility to mistakes (IT, people and processes)


Wednesday 3 October 2012

Adventures in VM Cloning

Adventures in VM Cloning

The post describes how to clone a Hyper-V VM.  In this instance, an SQL Server 2012 Database Server running on Windows Server 2008 R2 in a Hyper-V Core 2008R2 VM host.  Note that you should do this on a fresh install, NOT a copy of a production machine as various details of the machine being cloned are lost during the process.
  1. Prepare the VM for cloning.  All software is installed, Windows Updates are applied.  CCleaner has been run.
  2. Run [C:\Windows\System32\sysprep\sysprep.exe].  Select the "Generalise" option and leave all other defaults.
  3. The machine has now had its SIDs removed and has shutdown.
  4. Save these template .VHD file (disk images) somewhere safe.  Do NOT restart a VM based on these original files.
  5. Copy the VM's disk(s) for as many VMs as you are creating.
  6. Create new VM(s), attaching the new disk copies.
  7. Start the new VM(s) up, attached to the console.
  8. When booting, the VM will re-detect devices and ask for language settings.
  9. When booted, login as Administrator
  10. Apply network settings (which are reset if you are using Static IPs).
  11. Rename the machine and join it to the domain if required
  12. Set Windows Update settings as required
  13. Check all services.  We had problems with Analysis Services having lost directory permissions.  These were reapplied.
And that should be it.  Loads of time and bandwidth saved.

Cloning a production machine

In this case, we cloned a VM that we needed to have running again.  We took the wrong route and ran the above process against a production box. DO NOT do what we did.

If you MUST clone a production VM, export the production VM using Hyper-V Manager first and then run this process on an import of the export VM.

Tuesday 2 October 2012

TSQL grouping by hour

Dan's post from 2010 helped create an efficient way of converting a column to it's "top-of-the-hour" equivalent, useful for grouping by hour.

SELECT CONVERT(CHAR(13),SourceDateTime,20) + ':00:00' AS NewDateTime

Monday 1 October 2012


Yes, Windows 8 has some nice new features.  However the new "not Metro" UI sucks HARD for desktop users.  Here are my reasons for hating what happens when you hit the Start button in Windows 8 on a desktop machine:
  • THE WHOLE SCREEN!!! ARGH! MY EYES!  Really Microsoft?  Seriously, I developed a twitch when hitting the Windows button.
  • When I start Windows, I have to click on "Desktop".  Why?  ALL my apps are desktop apps.
  • The new apps are rubbish and take up the whole screen.
  • How on Earth do you turn off the machine?  Not intuitive
Fortunately, the lovely people at Stardock created Start8.  Currently in Beta, Start8 makes the Windows 8 start button experience sane again (i.e. almost identical to the Windows 7 experience).

I would strongly encourage desktop users to install this. OEMs - please work with Stardock to build the "Classic Windows feel" into desktop machines.  You will be doing your customers a huge favour.

A few minor issues:
  • Currently, typing [Start]C:\[Return] doesn't do what it does in Windows 7.  I expect them to fix this "bug" (as I see it) soon.
  • There is no word yet on pricing.  I'd expect a £15/$20 price point - we'll have to wait and see. Pricing is $4.99 if you order while in Beta.

Sunday 30 September 2012

Automated web testing with Selenium WebDriver

Excellent introduction to Selenium WebDriver. Example uses java/Eclipse but C#/.NET is also supported.

Selenium WebDriver has great documentation.