That Linux feeling… on Windows

I have been trying to get along with Windows Powershell at work for the past couple of months and, while it is a huge improvement on the more traditional Windows console, it is nowhere near as functional as the Bash terminal I spend most of my time in when at home. So I started poking around online and ended up on the Cygwin.

Cygwin is:

  • a large collection of GNU and Open Source tools which provide functionality similar to a Linux distribution on Windows.

This does sound good, but it also sounds like potentially much more than I need. I am, after all, only looking for a terminal that I can use to edit and shunt text files without being driven to curse my keyboard.

Luckily, I do have a small Windows partition on my own laptop, so I thought it would be worth giving it a spin at home before screwing up my work laptop enough to attract the attention of the helpdesk.

Before I go on, I shall reiterate that much of the Cygwin functionality os of no interest to me. I really am just looking for a functional terminal environment that I can use while at work.

The install was easy enough. This being a Windows application, it’s just a case of downloading the setup.exe file and clicking on it. You do need to hang on to this file once the install is completed, though, as it also provides the package management functionality for Cygwin. As someone who frequently bins everything, this felt a tad odd to me – but it’s not a problem.

The install creates its own file structure under C:\cygwin64 which took me a moment to find. That said, it makes sense that the *nix environment isn’t mixed up with the rest of the Windows stuff. It’s easy to find and, once you are aware of this, the Cygwin terminal starts in the expected folder.

And onto Vim. This is installed by default, or appears to be. Even though the initial screen says Vi Improved, it does look like Cygwin is actually installing Vi by default.

So I added an alias (alias vim=vi) to my .bashrc and renamed my .vimrc to .virc and then things went a bit wrong as Vi is unable to support any of the functions in my default .vimrc. So, back to the setup.exe file I went where I found and installed vim-minimal.

This does not seem to have helped as I am still seeing a whole bunch of comman not available errors.

I was also rather unnerved when I tried the ftp command and saw my password being echoed back at me as I typed it.

At this point, one of the twins came in and wanted to play Cat and Mouse and I’d had enough of being in Windows, so tinkering was abandoned. But, based on first impressions, the Cygwin Terminal is going to struggle to meet my needs.

The search continues.

flattr this!

Of cupcakes, children’s parties and cranial catastrophes

Saturday was the day that the twins celebrated their birthday. It’s a couple of weeks early, but this date had some pragmatic advantages and it was off to Kinderweelde that we went. You have to have cake, of course, and for convenience Eve spent Thursday and Friday baking cupcakes. These had the added advantage of not needing to be cut while we were at the speeltuin and they turned out rather well.

There is no after photo as the cakes were demolished.

The party itself went pretty well. The nice thing about Kinderweelde is that you can let the kids their own thing and only need to be available top deal with bruised hands, black eyes, trapped fingers and… my head.

Don’t worry, it looks a lot worse than it is. Eve insisted that I see a doctor but he basically put a plaster on it and commended Eve on her first aid skills.

So, a broadly successful day was enjoyed by all.

flattr this!


The Akismet spam filter in WordPress really is very good indeed. It does an excellent – and endlessly improving – job of identifying and deleting comment spam that I can simply leave it running and forget about it.

Nothing is perfect, however, and the occasional comment does make it through to my moderation queue. Like this one:

I am John, how are you everybody? This paragraph posted at this network site is really fastidious.

And the post containing this comment worthily fastidious paragraph… Is here.

flattr this!

Quote of the Day: Teenager (almost) passes for human

The Turing test was first proposed by Alan Turing in 1950, and luckily our understanding of computing, artificial intelligence, psychology and human communication has remained unaltered since then, so it’s just as valid as ever.

- Dean Burnett

In other news, George Dvorsky explains why Why The Turing Test Is Bullshit and The Register has a handy overview of Kevin Warwick’s life in publicity stunts.

flattr this!

Creeping Sectarianism

While responding to the recent Birmingham School Trojan Horse Kerfuffle, Catherine Bennett makes the following point:

It is difficult, for example, to conceive of a school more openly rejecting of Britain’s predominantly secular culture than the Cardinal Vaughan comprehensive in Kensington, London, where 99.7% of the pupils are Catholic, the principal activity is “the apostolic mission of the Church” and “the teachings of Christ permeate all areas” – unless it is the Yesodey Hatorah Senior girls’ school, a state-funded institution serving the Orthodox Jewish Charedi community in Stamford Hill in London. An Ofsted inspection in 2006 noted: “The Charedi community do not have access to television, the internet or other media. All members of the community aim to lead modest lives governed by the codes of Torah observance.” It was marked grade one, “an outstandingly effective school”.

It’s certainly true that faith schools promote intolerance and division, yet successive governments have happily stored up problems for themselves, and the rest of us, by not only allowing but actually encouraging these divisive institutions.

It’s not just in schools, though. Society as a whole seems to have lost sight of (or maybe never understood) the value of keeping church and state apart. AC Grayling puts it better than I could in The Secular and the Sacred. The article dates itself slightly by referring to political leaders no longer in power, but the conclusion is worth quoting in full:

This is the chief reason why allowing the major religions to jostle against one another in the public domain is extremely undesirable. The solution is to make the public domain wholly secular, leaving religion to the personal sphere, as a matter of private conviction and practice only. Society should be blind to religion both in the sense that it lets people believe and behave as they wish provided they do no harm to others, and in the sense that it acts as if religions do not exist, with public affairs being straightforwardly secular in character. The constitution of the USA provides exactly this, though the religious lobby is always trying to breach it, for example with prayers in schools. George W. Bush’s granting of public funds for ‘faith-based initiatives’ actually does so.

To secularise society in Britain would would mean that government funding for church schools and ‘faith-based’ organisations and activities would cease, as would religious programming in public broadcasting. And it would mean the disestablisment of the Church of England. All laws relating to blasphemy and sacrilege would be repealed, and protection of private belief and practice would be left to the legal safeguards and remedies which already exist in common law and statute, and are already very adequate.

If society does not secularise the result will be serious trouble; for as science and technology take us even further away from the ancient superstitions on which religions are based (a separation tellingly emphasised by the current cloning controversy), the tensions can only become greater. The science-religion debate of the nineteenth century is a skirmish in comparison to what we are inviting by allowing not just religion but mutually competing religions so much presence in public space. Now therefore is the time to place religion where it belongs – wholly in the private sphere along with other superstitions and foibles, leaving the public domain as neutral territory where all can meet without prejudice as humans and equals.

At it’s core, secularism can be summed up in two very simple statements: No-one should be discriminated against on the basis of their belief or lack of it, and no-one should should gain any special privileges on the basis of their belief or lack of it.

Secularism is an essential prerequisite for an equal and fair society. This is more true now than it ever was.

flattr this!

Cat and Mouse

CAt and Mouse This is a game we aquired at Christmas and one that has been pulled out a surprising number of times over the past few months. The game is for two to four players and is pretty simple. Each player controls a mouse which they move around the board according to a roll of the dice. Depending on the square you land on, you either gain one or two pieces of cheese, or you drop a piece of cheese, or you go up a ladder and drop down on a random location, or you get to send the cat after someone.

The aim is to accumulate five pieces of cheese, which is easy enough but if the cat lands on you a piece of cheese must be returned.

The gameplay is simple enough and relies largely on luck. As such, it is easy for the kids to comprehend and to follow what is going on. Judicous use of the cat, however, allows for the bare minimum of strategy needed to keep the game close enough to be exciting. Not that you need too much strategy, however, as sending the mice up the ladders and through the big cheese is a whole bundle of fun all on its own.

Cat and mouse is a short, simple game and one that my three to seven year olds can set up and play quickly and easily. The only problem is that the cheese randomiser can be a little too appealing for the younger ones.

flattr this!

Using SQL to update one file from another

With a recent interface change, I was asked to go back and fix all of the affected historical data so that it matched the new requirements. Updating a field in one file with a value from a different file is something I have done several times in the past (far too many ah-hoc queries have been launched, if truth be told) and, while you do need to take a bit of care, the approach is pretty simple.

So here is an example (some names have been changed to protect the proprietary):

update target_file upd
set target_field = (select source_field from source_file
                    where source_key_1 = substr(upd.target_key, 1, 16)
                    and digits(source_key_2) = substr(upd.target_key, 17, 5) )
where exists (select source_field from source_file
              where source_key_1 = substr(upd.target_key, 1, 16)
              and digits(source_key_2) = substr(upd.target_key, 17, 5) )

The script is pretty simple. For each record in target_file for which an associated record can be found in source_file, populate target_field with the value in source_field. Obviously, the select clauses will need to reflect the relevant keys of whatever files you happen to be using.

Inevitably, there is a gotcha: for each record in target_file that you want to update, there must be exactly one record returned by the subquery. Handling this can be split into two parts.

The first part is handled by the where exists clause which ensures that the script will only attempt to update records in target_file if there is a record in source_file with which to update it. This ensures you don’t get caught out by subqueries that return zero records.

The second part involves that the subquery returns no more than one record for each record in target_file. This, unfortunately, cannot be solved generically – you just need to be a bit careful to ensure that the subquery selection is returning unique records. If in doubt, a variation on the below SQL can be used to validate.

select source_key_1, digits(source_key_2), count(*)
from source_file
group by source_key_1, digits(source_key_2)
having count(*) > 1

If you can’t find a unique selection criteria, the distinct clause may help and, if all else fails, try arbitarily using either max() or min().

flattr this!

Angry Gnomes

On Friday, I was home alone with the kids and, while the weather could have been better, it was certainly too nice to stay indoors all day. The kids, however, wanted to stay inside and play Angry Birds.

So we compromised…

flattr this!

58% Liberal

With the European – and other – elections coming up in May, a number of Belgian news (and other) organisations have compiled a voting test. The idea behind Stemtest 2014 is simple – you answer a series of 25 questions then weight the areas according to your concerns and the site tells you which party most agrees with you.

Always a sucker for a quiz, I gave it a go and discovered – to no-one’s great surprise – that the party I most agree with is the OpenVLD. I was quite interested, though, to note how close a match Groen are to my opinions. Maybe I’m more of an environmentalist than I realised.

Stemtest 2014

It’s worth mentioning, again, that I signed up the the WePromise campaign that called on EU voters to promise to vote, and to vote for digital rights-friendly candidates. I would still take this campaign seriously but have been very disappointed by the response of Belgian parties. Only three candidates are listed at the time of writing this post, and two of them are Francophone and, therefore, not an option.

There’s still almost a month to go, though, so I shall wait and see if any candidates actually do sign up.

flattr this!