Call Windows Support

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg
Showing posts with label computer. Show all posts
Showing posts with label computer. Show all posts

Sunday, 1 December 2013

that's not in the least bit suspicious

Posted on 03:35 by Unknown
Our internet connection at home travels along the same piece of wet string as does our phone line.  (I’m assuming it’s wet string, based on the bandwidth it achieves.)  Recently it’s been a bit glitchy, dropping out at random moments.  Then the other day I spotted a correlation: it drops out when the phone is in use.  This hasn’t always been the case: I’ve been on the phone to support while using my machine, so this is something new.

We spent a while trying to narrow the problem down. Was it answering, being connected, or hanging up the phone that triggered the event?  No, it was simply calling the number.  Was it one of the filters separating the phone and internet signals?  We tried swapping in and out these gadgets.  Eventually we had pared the system down to a single filter, with no handsets even connected.  Same problem.  Either all 7 filters are broken (not totally implausible, they are cheapo dinguses, all over 10 years old), or the problem lies elsewhere.

What will probably look weird, if not downright suspicious, to anyone monitoring us (not that anyone would do such a thing, obviously...) is what was visible from outside.  To see when the network went down, we watched the blinkenlights on the router.  To load the network during tests, we downloaded a YouTube video, let it play about halfway through to check the network was stable, then called the landline from a mobile, which stopped the network.

The result of this is that we downloaded the same YouTube video, and interrupted its download halfway with a call from a mobile, about 20 times. Moreover, because the network connection dropped out, it would re-establish with a different IP address each time, as provided by our ISP.

Oh, and what was this ultra-suspicious video?  Bonnie Tyler’s Total Eclipse of the Heart, obviously.
Read More
Posted in Bonnie Tyler, computer, web | No comments

Friday, 22 November 2013

prediction shouldn't be this difficult

Posted on 15:00 by Unknown
I have previously noted the inaccuracy of some computer predictions.  Tonight I observed how it also applies to cars.

As I started my trip, the GPS said the journey would take 2 hours 20 minutes, and the car instrument panel claimed I had 205 miles until an empty tank.

50 miles, and one hour, later, the GPS said the remaining journey would take 2 hours 5 minutes; more bizarrely still, the car instrument panel claimed I now had 215 miles until an empty tank.

So, it seems that the car thought I had taken 15 minutes to travel 10 miles backwards?
Read More
Posted in computer, driving | No comments

Saturday, 9 November 2013

the old and the new

Posted on 04:52 by Unknown
I’m just back from a 2 day residential Theo Murphy scientific workshop held in the Royal Society’s Kavli Centre at Chicheley Hall.  It’s my first visit there, and I can certainly recommend it as a marvellous venue for a workshop: great facilities, marvelous food, and friendly, efficient staff.  The science was great fun: I learned lots of new things, discovered links between seemingly diverse areas, and had interesting discussions over food and coffee.  I’m buzzing with ideas, which is the whole point!

I did the usual “photograph from my bedroom window” thing, which had a somewhat different from usual view:

first day of the workshop, view due east, into the rising sun

Oh, and then I took a photo from the other window in my bedroom:

first day of the workshop, view due south
Blissful.  I found an amusing view from the window half way down the main stairs:


A lovely formal garden, with lawns, paths, clipped bushes and trees, and, just visible at the vanishing point of the path … a wind farm!  The old and the new collide.

Read More
Posted in computer, conference, garden, history, research, science | No comments

Tuesday, 15 October 2013

too much tech!

Posted on 04:52 by Unknown
So, there I was, sitting at my computer, waiting for a Google hangout to start (an excellent way to have a meeting, btw – video on one screen, Google doc on another, everyone typing up the notes in the doc – works really well, at least for smallish groups).

My computer’s webcam is throwing a wobbly at the moment, so I had my tablet ready to run the hangout itself.  The hangout organiser sent the invitation.  My computer notified me.  My tablet’s screen lit up, notifying me.  What I hadn’t been expecting was that my phone, sitting next to my tablet, would also suddenly come alive, notifying me!

I’m surrounded by tech, all demanding to talk to me…
Read More
Posted in computer | No comments

Monday, 27 May 2013

the power of abstraction

Posted on 07:09 by Unknown
Prof Karen Spärk Jones
Prof Barbara Liskov
Last week I popped down to London to attend this year's annual Karen Spärk Jones lecture, sponsored by the BCS and IBM.  This year's speaker was Professor Barbara Liskov, from MIT, winner of the 2008 ACM A.M. Turing award.  Her talk was titled "The power of abstraction", and she gave us an historical overview of her work.

The excellent talk was videoed, and should be online at some point.  Here I just want to pick up on the points that particularly resonated for me.

She started off talking about the software crisis of the early 1970s.  There have been several software crises: this was probably the first named one.  People didn't know how to write large pieces of software, there was no methodology, and the programming languages of the day didn't help.  Dijkstra had published his classic paper, Go To Statement Considered Harmful, in Comms ACM in 1968, calling attention to one aspect of the problem.  Nowadays everyone has heard of this paper;  "considered harmful" in a title has become a CS trope.

What I didn't realise about his paper, however, was the reaction to it.  Liskov explained that many programmers were insulted: of course they could write understandable programs with gotos.  But more interestingly, there was a doubt about whether it was even possible to write all programs without gotos.  Today, of course, this problem is solved; we deride "spaghetti programming", and instead use languages that incorporate structured gotos encapsulated in commands such as if, for, while, break, continue, and try. (Although OO allows the possibility of spaghetti messaging.)

Liskov went on to talk about her own contributions to teasing out what was needed to structure code: the abstract data type.  She and her team designed and implemented the influential language CLU (short for "cluster", the name of its abstraction mechanism), which included ADTs, static type checking, separate compilation, polymorphism, iterators, and exception handling --- but no goto statement.

For this and subsequent work, Liskov won the prestigious Turing Award in 2008.  She said that when the award was announced, some student commented: "What did she get this award for? Everyone knows this, anyway!"  Precisely: everyone does, now.

Liskov finished off by talking about the present. We have seen Moore's Law take a right-angled turn recently: instead of chips getting small and faster, they have gone multi-core.  In the past, we have not had to worry too much about parallel processing, except in certain specialised domains, because Moore's Law would provide a single processor with the required power in a few years.  Now, for the first time, we have to bite the bullet of parallelism in everyday computing.  Liskov is now working on methodologies and language support for parallel computing, not for systems with just 4 or 8 cores, but with hundreds or thousands of cores.

In my mind, this folded neatly back to the beginning of her talk, and a relevant quote from Dijkstra's paper:
Our powers to visualize processes evolving in time are relatively poorly developed.  For this reason we should do ... our utmost to shorten the conceptual gap between the static program and the dynamic process, to make the correspondence between the program (spread out in text space) and the process (spread out in time) as trivial as possible. ...
    The unbridled use of the go to statement has an immediate consequence that it becomes terribly hard to find a meaningful set of coordinated in which to describe the process progress.

Back in the 1980s I was using occam, a parallel programming language.  One thing that struck me forcibly at the time was that the traditional linear textual form of occam code was completely divorced from the underlying static parallel structure (let alone the parallel temporal execution structure).  It was very easy to get lost in a spaghetti of communication channels.  I was so irritated, I even developed a 2D visualisation of the program structure.

So, what are the right static structures and abstraction principles to help us build dynamic parallel programs?  There are already many languages with parallelism, but I suspect that in 40 years time we will look back on them with the same pity we today reserve for the humble go to.  Let's hope Liskov and her successors can find the answer.
Read More
Posted in computer, history | No comments

Wednesday, 8 May 2013

Ctrl-Shift-T

Posted on 13:25 by Unknown
We've gone over to using Google products at work.  For the most part, I like Google Mail.  It has its quirks, but the selling point for me is that, being browser based, mail items have URLs, so I can just paste the relevant URL into my to-do list or Evernote daybook, rather than clutter up my inbox with emails I'm waiting to action or need for meetings.

However, Gmail has a user interface feature I just keep getting wrong.  I consistently click the "Compose" button to move to my contacts, instead of clicking the "Mail" menu, and selecting from there.

I keep clicking "Compose", instead of selecting "Contacts".  Why?

I don't know why I keep doing this (maybe because the first two letters are the same?), but I do.  All the time.  I don't blame myself: I have been well-enough educated in user interface design to believe that if the user consistently makes a mistake like this, the UI is to blame.

This particular mistake is not that serious: I just have to keep binning unwanted empty emails (and muttering imprecations at the interface).  But there's another mistake I keep making, this time with the Chrome browser: I often hit "close tab" instead of "back" when I finish reading a linked page.  And then I've lost that tab's history, in particular, the page I was trying to return to when I closed the tab.

But then the other day, I discovered that all is not lost!  Hit Ctrl-Shift-T, and the tab is automagically resurrected.  Hit it again, and the previously closed tab reappears. And so on. Yes!  A key combination to undo a user interface infelicity.

So why isn't this option in the menu?


Read More
Posted in computer, Evernote, web | No comments

Sunday, 14 April 2013

Evernote and the Con

Posted on 04:37 by Unknown
Every year we attend the British National Science Fiction Convention, or “Eastercon”. My first Eastercon was in 1984, and we haven’t missed one since 1996. It’s a great four days, of guest of honor talks, of serious scientific talks, of panels discussing authors and sub-genres, of silly SF-themed quizzes, and of meeting up with friends.

I take notes at cons, partly as a conditioned reflex, and partly because there are interesting ideas, and suggestions of new authors of books, that I want to follow up later. I have put some of my notes up on my website. But the last couple of years, I haven’t had the time (or the inclination) to transcribe the resulting 30–50 pages of notes, so they are languishing on paper only.

Recently at work, I’ve moved from paper to a computer-based daybook, based on Evernote. It started as an experiment, to see if it would work, but within a month I had abandoned paper note taking completely, and am exclusively Evernote-based. So I decided to trial Evernote at this year’s Eastercon, too. Here’s how it went.


Before the con


Gone are the days of waiting to get the Con programme guide on arrival at the con hotel. Nowadays it is up online in advance. So the day before we were due to drive to Bradford (these cons are in such exotic locations) I sat down with the online programme guide, and decided which items I would attend, from the four parallel sessions. First I created a new Evernote notebook for SF cons. Then I made a new note for each chosen item, adjusted its “creation time” to that of the item itself, and copied in the item title, location, and abstract. This had the helpful side-effect of giving me a schedule I could easily consult on my phone when I wanted to know where I was supposed to be next, and a reminder of what it was about.

At the con


I used the same Samsung N145 Plus Netbook for note-taking that I use at work. This has a 10" screen, and a nice keyboard that accommodates my just-about-4-fingered, semi-touch typing skills (although the Caps Lock is a bit too easy to hit accidentally).

ouch!
It weights in at 1.2 kg, which is fine for toting around between talks, but after a couple of days of it resting on my lap as I took notes, I became uncomfortably aware of its two sharp little feet at the back. It also runs quite hot. However, the battery is nicely long lasting: the Friday and Monday were less than full days, and I got by with a single charge; the Saturday and Sunday, being longer, required a recharge. One day that involved leaving it charging in the hotel room over dinner; the other day I found an unoccupied power socket in the programme room, and sat by it for that item.

It was all very straightforward to use: arrive at the item, sit down, open netbook, type in my password, click on the item’s note, and start typing. The keyboard is quiet, and so (hopefully!) the sound didn’t disturb anyone around me. And this set-up has one great advantage over manual note-taking. In the main programme hall, tech switches the lights off during items (I assume this is to aid with recording said items). This makes it rather difficult to take hand-written notes. But with the netbook, I just closed it up slightly (to around a 90 degree angle), which directed enough light from the screen to illuminate the keyboard sufficiently. Another advantage: no writer’s cramp. A further advantage: the notes synchronise to the cloud, so I didn’t have to make backups during the con.

After the con


Back home, I synched Evernote on my desktop machine, and started tidying up the notes, correcting spelling mistakes, removing irrelevant and incomprehensible bits, and tracking down interesting references and linking to them. This took about half a day (partly because I was spending time reading up about some of the interesting stuff I’d found). Once I was happy with the notes, I made a new note to act as an contents list for the entire event, comprising a bullet list of links to each of the item notes. That was very easy to do using Evernote’s “Copy Note Link” function. I sorted the list into earliest first order (rather than the latest first order I usually use), selected all the notes, then exported them as a single HTML file. I edited that file with Notepad++ (my current HTML editor of choice) to add in some preliminary material, and modify some of the formatting provided by Evernote. Hey presto, my con report web page! Everything from “Programme highlights” onward is output from Evernote. All in well less than a day.

What I’ll do differently next time


This was definitely a great success. However, next time I will add a little more markup to my note templates, to tag the title, panellists, and summary parts. This will let me use Notepad++’s regular expression-based search and replace more easily to modify Evernote’s formatting to my specific requirements. And that’s it, essentially.

What I’d like Evernote to do differently


Evernote is great, and the more I use it, the more I like it. But it’s not perfect, and the more I use it, the more the imperfections bug me. The main niggles from the con use:

  1. Undo. It doesn’t always work properly. Most of the time, it’s absolutely fine, doing what you’d expect. But every so often, it doesn’t restore to the exact previous state. A typical problem: paste in something with a format, realise you meant “Paste as plain text”, undo – but it doesn’t (always) reset to the previous format.
  2. Bullet list indent,outdent commands. These don’t always work properly. Again. most of the time, everything is fine: use tab or the icon to indent, use Shift-tab or the icon to outdent. But if you copy a bullet list, this can get messed up, and on indenting/outdenting, the bullets disappear. This is a big deal for me, as I am an inveterate user of nested bullet lists.
  3. Spelling mistakes. As you type, spelling mistakes are highlighted with the usual red wiggly line. However, when you move away from a note and come back, notes no longer highlight the spelling mistakes. This made the “tidying up” process harder. SF notes have a lot of weird words in them, and it’s easier to scan and ignore the red wiggles than step through the list using the manual spell-checker.
  4. Daylight savings time. This one is bizarre, and very annoying. As is often the case, Daylight Savings Time (here the move from Greenwich Mean Time to British “Summer” Time) kicks in over the Easter weekend (hey, let’s steal an hour from your holiday weekend!) On Sunday morning, I noticed that all the “created” times on my Sun/Mon notes were out by an hour: Evernote had changed them! It had decided that, when I created a note during GMT, even though I created the note for a time when BST would be in force, it needed to update it. Mutter, mutter. Later, when looking back at my previous notes (all my previous notes), I discovered that their creation times had also changed by an hour! That is, Evernote is currently displaying the creation times of all my notes, no matter when created, in BST. I can think of no circumstance when this would be the desired behaviour. This is definitely a bug. I suspect Evernote is treating daylight savings time as a different time zone, and “correcting” for the change (which is often not what is wanted in that case, either).
However, despite these grumps, I’ll be continuing to use Evernote. The more I use it, the ever more useful it becomes, because the more material I have in it, have linked from it, and can access really easily.

Read More
Posted in computer, Evernote, holiday, science fiction | No comments

Sunday, 24 March 2013

the rise and fall of Ctrl-S

Posted on 14:35 by Unknown
I first used a computer back in the late 1970s, when I was an undergraduate physics student. In those days, we wrote programs on punched cards. To lose your program, you had to lose the cards (or, actually, just shuffle them).  To prove we never throw anything away, here is a program from the 1970s:

a program statement from yesteryear: 12  MAG(J,K) = 0
a whole program; no idea what it does
By the time I was a research student, punched cards had given way to text editors through VT100 terminal sessions.  I wrote my thesis in troff (one of my fellow students was writing his in this new-fangled thing called TeX), using the ZED line editor.  In order to save your changes, you had to exit the editor, save, and restart the editor, a non-trivial sequence of operations that interrupted the writing flow.  However, by the time I was writing up, the IBM 370 mainframe was on its last legs, about to be replaced by a new IBM 3081, and crashing frequently.  So I got in the habit of exiting the editor every 5-10 minutes, saving, and re-entering.

Frequent saving was ingrained in my workflow by the time applications came uniformly equipped with Ctrl-S.  (Saving without exiting.  Luxury!)  Every time I would pause to think what to write next, in word processor, spreadsheet, or text editor, I would automatically hit Ctrl-S.  It's now an automatic behaviour.

But modern applications no longer use Ctrl-S.  They just continually save, automatically. There's no need to keep saving explicitly.  Most applications that have an auto-save feature also let you do your own saves in between.  But some applications no longer have a user save command at all.  I noticed this first with Evernote, and then with Google Docs.

Fortunately, these applications haven't mapped Ctrl-S to any other function (mail programs where Ctrl-S means "send" are a real nightmare), so nothing bad happens if I do reflexively hit Ctrl-S.  Which I do sometimes, because it feels really weird not to keep saving after all these years.

Three generations of saving technology: manual-slow-and-clunky, manual-easy, automatic. That's probably progress.


Read More
Posted in computer, history, LaTeX | No comments

Sunday, 10 March 2013

normality has been restored...

Posted on 15:02 by Unknown
...partially, anyway.

When my home machine died, and I upgraded to Windows 7, my incredibly ancient 16-bit Smalltalk/V would no longer work.  As this was what I used to generate the book review pages on my website, it was a bit of a disaster.

So over the past several weekends, I've been re-implementing my book list program, from scratch, in Python, and the new pages have finally gone live.  (There are still broken links from the non-automatically generated pages; I'll fix those next.)

This was my first major foray into Python.  Three years ago, I wrote my first ever Python program -- a Game of Life implementation, using Gosper's hashlife algorithm -- but then didn't touch it again until recently.  Instead, I was using Matlab for all my number-crunching needs.  However, I needed something a bit more friendly for teaching some non-computer science students a little bit about simulation.  So before Christmas I wrote a small flocking program in Python, and a few little bits and bobs.  Then I learned about NumPy, which does a lot of the matrix stuff that Matlab does, so I thought I'd give it a try, by reimplementing some Random Boolean Network code I'd originally written in Matlab.

I was really impressed, so decided to do some more NumPy programming, to learn it better.  I wrote a few programs to support some practicals for a module I teach: a quantum random walk simulator, an iterated function system, and a 1D cellular automaton.  And after that exposure, I decided I was deeply in love with Python.

But the book list program is my biggest yet, by a long way.  All the previous programs had a core of essentially about 10 lines of code (each of those lines doing a lot, mind you!), each written in an hour or so.  The book list program is several hundreds of lines (many of which also do rather a lot), split over 5 files and several classes.  I also decided to take the opportunity to reorganise and tidy up the structure of my web pages, which involved writing a few utilities, to rename a bunch of files, to write a new table in the database, that sort of thing.  File handling. Database access. All amazingly simple in the marvellous language that is Python.

Although, frankly, I couldn't have done it without the wonderful Stackoverflow forum.  The Python documentation is useful if you know how to do something, and just need to check the syntax or method name.  It's not so helpful if you don't know how to do something. And Python has its own way of doing things.  But every time I typed into Google: "python how to  XXX", for a wide range of XXX, there was Stackoverflow with the answer -- often several answers!  Thanks, guys.

When I started writing this, I was consulting online resources for nearly every line.  But now, I'm happily typing things like
reviews = [bk for bk in have_reviews if bk.isNFBook()][0:10]
without looking things up any more.

And I'm now looking round for my next Python project...
Read More
Posted in algorithm, books, computer, python, web | No comments

Tuesday, 19 February 2013

too blue

Posted on 01:04 by Unknown
I have been resisting moving from MS Office 2003 to any of the more recent versions. However,  my new machine at home has Windows 7 and the newer MS Office.  So I have to grin and bear it.

The main reason I didn't want to upgrade is that I hate-hate-hate the "ribbon".  It's ugly, it's cluttered, and it seems to encompass a work flow orthogonal  to mine.


However, it struck me after I had changed the default blue wallpaper on my home machine to the Hubble Deep Field photo, that another reason I dislike the latest Office is that it is so very very BLUE.

a much more soothing wallpaper image
Ah!  Surely I can change that?  After much hunting (did I say that I hate the interface?), I discovered a "Word Options" button skulking at the bottom of the main menu (you know, that absolutely crucial menu that hides behind a little circular icon that looks nothing like a menu button?)  I clicked it, and I found that one of the "popular options" allows me to change the colour scheme.  Result!


What, a whole three options?  What an embarrassment of riches!

I had a look at "black":


Better. But my goth period is long past.  What about "silver":


Much more civilised, if somewhat ... grey.

So, I've now set the option to "silver" (I set it in MSWord, and it magically propagated to Excel and Powerpoint), and I now only hate it when I look at the ribbon (which, of course, I have to do every time I need to do anything more complicated than plain typing, ie all the time), rather than looking anywhere else on the screen.  I suppose that counts as a win.
Read More
Posted in computer | No comments

Sunday, 3 February 2013

carry on installing

Posted on 10:54 by Unknown
So, after the sad demise of my home PC last week, it is off to our local computer shop, World of Computers (an excellent place where we have been buying our machines for the last two decades at least), for its replacement.

Back home, I plug in all the peripherals, and now I have a beefy spookily quiet machine with all my data transferred on to it (so at least I don't have to restore from backup), but essentially no software.  This is Windows 7; given some of the software running on my previous XP machine had been ported to it eight years ago from my previous Win95 machine, I may be in for a hard time.

First things first -- I install the security software.

Then I download Chrome and Evernote, and I'm ready to start serious installation, including taking notes to help me next time.  I set the wallpaper to a Hubble Deep Field image, and I'm starting to feel at home again.

The first thing I notice is that there's a thick black border around my monitor screen, and the text is slightly fuzzy.  I remember this happening when I first got it, and that I did something that wasn't to do with setting the resolution; but beyond that -- no recall.  However, the web comes to the rescue:  googling the problem reminds me it is called "overscan/underscan" -- googling that tells me to use Catalyst Control Centre.  Which is not installed, so that's my next download.

Full screen de-fuzzified, I next install MS Office.  That's a 1GB download, leading me to wish, not for the first time, that our internet broadband was fibre, rather than some species of wet string.  The Office download page provides me with download instructions in a pdf.  So I download Adobe Acrobat Reader.  Then I look at the download instructions, which are all out of date.  But the download and installation proceeds normally without their help.

Then it's Texnic Center and MiKTeX.  This all goes smoothly, and I test it on an existing LaTeX document.  Fine, except the spell checker doesn't work, as I have set it for English, rather than English (US).  It points me to a site of dictionaries, and I download one.  This needs to be unzipped.  So it's off to the 7-Zip website for that...

Next, Dropbox.  No problem, except that it is synching a gazillion files.

Then Skype.  This leads to the usual problems of ensuring that the speakers and the webcam microphone are plugged into the right sockets.  The sockets are colour coded; the jacks are not.  After grovelling about under my desk and swapping things around a few times to no effect, I google to find out which ones to use.  And now the sounds are going in the webcam microphone and coming back out the speakers a split second later.  More googling to fix that.

Now we come to the antediluvian software.  I use Quicken 2000 (yes, 2000) for my home accounts.  It doesn't install under Windows 7.  I consider upgrading, but various websites warn me that importing the data is hard to impossible.  (Well, after 13 years of upgrades, maybe that's not too surprising.) I wonder about changing to a different package, but, hey, I've been using it for 13 years with not problems.  So, install the XP emulator, and install Quicken in that.  Point Quicken at my backup data, and it's like old times.

I have less joy with the scanner.  There are no drivers for Windows 7, and the XP emulator can't be made to see the scanner at all (despite it being a USB device).  So I swap it for Charles' newer scanner (he's still running XP, so is okay for now), then download and install drivers and software for it.

Next, it's the software I use for my website.  I edit the pages in HoTMeTaL Pro 4.0, a Windows 95 application.  Although I still have the original CD (note for youngsters: software used to come on CDs, rather than being downloaded from the web), I decide not to bother installing it -- it is just a bit too long in the tooth now, particularly since I've started using a bit of CSS.  So I have a trawl around the web, reading reviews, and decide to give CoffeeCup a go.  Download, install.  (Once I've used it for a while, if I like it I'll upgrade to the full version; I might review it.)

Next, it's the software I use to take the text output exported from my Access book database, and produce the various book review pages on my website.  This application is written in Smalltalk/V for Windows, a 20-year old, 16-bit implementation of Smalltalk.  It does not run in the XP emulator.  I'm going to have to reimplement it in a different language.  I do have it on my to-do list to reimplement in Python, but it's a non-trivial exercise (ie, more than a weekend hack), so I've been putting it off.  Bother.  Oh well, at least I'll be able to make the improvements I've been thinking about.  But that means, my book pages probably won't be updated for a while...

Nearly two days have passed, and I've still got Python, an OCR tool, and a picture editing tool to go (I suspect my copy of Paint Shop Pro 3 is just a little out of date...)  But I can now function again.
Read More
Posted in computer, web | No comments

Sunday, 27 January 2013

it's dead, Jim

Posted on 09:09 by Unknown
I arrived home on Friday evening, after a four hour train journey back from a meeting in Manchester. [Small rant: as we were coming into Nottingham, there was an announcement: "for those of you travelling beyond Nottingham, this train splits here.  Please make sure you are in the rear mumble coaches if you want to travel beyond Nottingham." It wouldn't have helped me even if I could have made out the mumble.  I had no idea which coach I was in (a very long train arrived at Manchester; I got on it somewhere; the train changed direction at Sheffield, confusing my already weak grasp on reality.)  I have a suggestion for these sorts of trains: make the announcement only in the "wrong" coaches, and tell people there that they have to move.]

Anyhow, I got home. I had tea.  I went to my study to switch on my computer.  Nothing.  Did all the obvious things.  Still nothing.  Dead as a nit.

Well, it is nearly 8 years old, so I'm probably due an upgrade.  So I spent a pleasant time speccing up a dream replacement, then down-speccing it to a more reasonable price.

But ... I'd arrived home (near Cambridge) by train.  The car is in still at work, in York.  I can't get to the computer shop until next weekend.  I'm having to making do with this little laptop that has none of my standard software on it.  Grump.

Oh, what first world problems we suffer!

Still, being without a computer this weekend isn't the disaster it might have been.  I have a pile of exam scripts to mark, and no time to surf do important computery stuff, anyway.
Read More
Posted in computer, trains | No comments

Sunday, 20 January 2013

RBNs with NumPy, sorted

Posted on 14:55 by Unknown
I've been using Python for a little while now, and love the ease of programming in it.  I also use Matlab, which is wonderful for programming scientific things, particularly with arrays.  But Matlab is expensive, so I only have access to it at work.  Python is free.

I heard that NumPy, the numerical package for Python, had Matlab-like array operations, so thought I'd give it a try.  This weekend I finally had some time (that is, I needed a displacement activity from marking), so I gave it a go.  I decided to do a comparison of something I'd already implemented in Matlab: a Random Boolean Network (RBN) tool.

RBNs were invented by Stuart Kauffman as a simplified model of gene regulatory networks. They have fascintating properties for so simple a construction.  An RBN has the following components:
  • +++N+++ binary-state nodes: +++n_1 .. n_N+++
  • each node can be off or on (in state 0 or 1), +++s_1 .. s_N+++
  • each node has +++K+++ input connections from +++K+++ randomly chosen different nodes in the network, +++c_{11} .. c_{1K} .. c_{N1} .. c_{NK}+++
  • each node has a randomly chosen boolean function of +++K+++ variables, +++b_1 .. b_N+++
An example of an +++N=5, K=2+++ RBN is


Here the node colours represent the different boolean functions +++b_i+++, and the numbers label the nodes from +++0 .. N-1+++.

You start the network in some initial state of the binary nodes.  Each timestep each node receives the state of its +++K+++ connected neighbours, combines them with its boolean function, and sets its next state to that value:
$$s_i(t+1) = b_i(s_{c_{i1}}, s_{c_{i2}}, ... s_{c_{iK}})$$
The marvellous thing about +++K=2+++ RBNs is that, despite being set up to be as random as possible, and having a total of +++2^N+++ possible states they could be in, they rapidly settle down into an attractor cycle of length +++O(\sqrt N)+++.

This establishment of order from seeming randomness is fascinating, but really needs to be demonstrated to be appreciated.  Hence NumPy.

Here's the code:
import matplotlib.pyplot as plt
from numpy import *

K = 2 # number of connections
N = 500 # number of nodes, indexed 0 .. N-1
T = 200 # timesteps

Pow = 2**arange(K) # [ 1 2 4 ... ], for converting inputs to numerical value
Con = apply_along_axis(random.permutation, 1, tile(range(N), (N,1) ))[:, 0:K]
Bool = random.randint(0, 2, (N, 2**K))

State = zeros((T+1,N),dtype=int)
State[0] = random.randint(0, 2, N)
for t in range(T): # 0 .. T-1
State[t+1] = Bool[:, sum(Pow * State[t,Con],1)].diagonal()

plt.imshow(State, cmap='Greys', interpolation='None')
plt.show()
There's essentially only three lines doing much substantive, which is the joy of working directly with arrays: no fiddly, wordy iterations.  Con holds the random connections, Bool holds the random functions, and the loop over t calculates the next State each timestep.

I dare say there's more elegant ways to do this, but I am still learning NumPy's capabilities. But what exactly is going on here?

For the Con array we need to choose K random inputs for each node.  These need to be distinct inputs, so we can't just choose them at random, because there might be collisions.  We could keep choosing, and keep throwing away collisions, but there's another way to do it:
  • range(N) gives a list [0, 1, .., N-1].  Let's take N=5 here
  • tile(...) makes an array of 5 stacked copies of this:
    • [ [ 0 1 2 3 4 5 ]
        [ 0 1 2 3 4 5 ]
        [ 0 1 2 3 4 5 ]
        [ 0 1 2 3 4 5 ]
        [ 0 1 2 3 4 5 ] ]
  • apply_along_axis(random.permutation, ...) applies a random permutation to each row individually
    • [ [ 2 0 1 3 5 4 ]
        [ 0 2 3 4 5 1 ]
        [ 1 3 2 5 0 4 ]
        [ 3 1 4 2 0 5 ]
        [ 4 2 0 5 1 3 ] ]
  • ...[:, 0:K] takes the first K items from each row.  Here K = 2
    • [ [ 2 0 ]
        [ 0 2 ]
        [ 1 3 ]
        [ 3 1 ]
        [ 4 2 ] ]
This gives the array of node connections: node 0 has inputs from node 2 and itself; node 1 has inputs from node 0 and node 2, and so on.  See the figure earlier.

Bool has the +++N+++ random boolean functions.  Here each function is stored as a lookup table: a list of +++2^K+++ ones and zeros.

For the State update
  • State[t,Con] gets the inputs from the connections
  • sum(...) converts this array of ones and zeros into an index +++0..2^K-1+++
  • Bool[: ...].diagonal() looks up the next state value from this index 
And that's it!  We can use this to plot the time evolution of an RBN.
The string of nodes is drawn as a horizontal line at each timestep, and  time increases down the page. You can see it has some random structure for the first few timesteps, then rapidly settles down into regular behaviour.

Well, it's not that easy to see the regular behaviour.  It's a bit of a jumble really.  We can do better.

The problem is, since an RBN is random, there's appears to be no obvious order to write down the nodes.  The picture above uses the order as first given, which is ... random.  However, an RBN does have structure; it has a "frozen core" of nodes that settle down into a "frozen" state of always on, or always off.  If we sort the nodes by their overall activity, it highlights the structure better.

So, there's a little bit of extra code, sitting just before the loop updating the state.
SRun = 5     # sorting runs
ST = 200 # sorting timesteps
State = zeros((ST+1,N),dtype=int)
Totals = State[0]

for r in range(SRun):
for t in range(ST):
State[t+1] = Bool[:, sum(Pow * State[t,Con],1)].diagonal()
Totals = Totals + State[t+1]
State[0] = random.randint(0, 2, N) # new initial random state

Index = argsort(Totals) # permutation indexes for sorted order
Bool = Bool[Index] # permute the boolean functions
Con = Con[Index] # permute the connections

InvIndex = argsort(Index) # inverse permutation
Con = InvIndex[Con] # relabel the connections
This extra code runs the RBN several times (from different initial conditions, each potentially leading to different attractor cycles involving different patterns of node activity), totalling up the number of times each node is active.  Sorting this array puts more inactive nodes towards the start, and more active nodes towards the end.  argsort() doesn't return the sorted array, however; it returns a permutation of the indexes corresponding to this sort.  This Index array can then be used to sort the Con and Bool arrays into the same order.  This results in something like:

Having done this, we need to relabel the nodes and the connection indexes.  This requires using the inverse sort permutation, InvIndex.  So we get
Running the modified code gives a much clearer picture of the RBN's dynamic behaviour:


So, after all this, what do I think of NumPy?

It's excellent.  Everything I needed (random permutations, sorting, applying functions across arrays, indexing arrays with other arrays, whatever), it's all there.  The code produced is very compact. (So compact that I've commented it quite liberally in the source file.)

The online documentation is mostly adequate, and whenever I puzzled over how to do something, a quick Google usually got me to a forum where my question had already been answered.

NumPy also has a big advantage over Matlab (in addition to the price!).  With Matlab, many functions and operations (such as array indexing) can be applied only to array literals, not to array expressions.  This makes it hard to build up compound operations without having to have a lot of intermediate variables.  With NumPy, you can just build up the expression in one go.  That makes for a more natural style of programming (although I suspect it could also make for some spectacular write-only code).

Anyhow, I'm please with my experiment, and will be delving further into NumPy in the future.
Read More
Posted in algorithm, computer, python | No comments

Sunday, 13 January 2013

not mailing but drowning

Posted on 07:42 by Unknown
Email takes out a large slice of my day.  On my first serious day back at work after the Christmas break, I spent all morning on the backed up emails (despite having been monitoring and keeping up to some degree); at lunchtime I had one more email in my inbox than I'd had first thing: I wasn't even keeping up!

Someone at work has suggested that we all adopt the Email Charter.  It's got much excellent advice, and a few things I disagree with, which I'll explain here.

1. Respect Recipients' Time. This is the fundamental rule. As the message sender, the onus is on YOU to minimize the time your email will take to process. Even if it means taking more time at your end before sending.
This is the fundamental rule of all writing. Don't just dash something off, expecting your reader to pick through the verbiage to extract your meaning.  This is particularly true if your writing is to be read by more than one person: the total reading time is multiplied by the number of readers.  Hence the important role of reviewers and editors in published writing: to reduce the amount of time people waste reading nonsense.  Be your own editor: proofread and edit down your emails. Don't fall back on Pascal's excuse: "I am sorry for the length of my letter, but I had not the time to write a short one."

2. Short or Slow is not Rude.  Let's mutually agree to cut each other some slack. Given the email load we're all facing, it's OK if replies take a while coming and if they don't give detailed responses to all your questions. No one wants to come over as brusque, so please don't take it personally. We just want our lives back! 
Way back in the day, before email was ubiquitous, before personal computers were common, we used to get our business letters typed up by secretaries.  I heard back then (I'm talking mid 1980s here) via the grapevine that one of the secretaries thought that my business letters were "short, to the point of rudeness".  I always forget to put in all that initial polite handshaking part, and just cut to the chase.  So email is perfect for me!

Slow, though?  Well, that depends on what you mean by "slow".  More than 10 minutes, that's not slow.  More than 24 hours -- I'm beginning to worry that your spam filter ate my email, and might think about sending it again.  A simple "ack" can help allay this worry.

3. Celebrate Clarity. Start with a subject line that clearly labels the topic, and maybe includes a status category [Info], [Action], [Time Sens] [Low Priority]. Use crisp, muddle-free sentences. If the email has to be longer than five sentences, make sure the first provides the basic reason for writing. Avoid strange fonts and colors.
This confuses two issues: the subject line, and the body, of the email. The body part is really covered by point 1. Subject lines should be a clear "title" about the topic of the email. There are a few points I think are important about subject lines.
  1. Your reader doesn't have the same context that you do, so the subject line that's best for you isn't necessarily the best for them. Let's say you are a project manager where all your emails are currently about project BettaWidget.  You email financial support with a query.  Subject "Financial query" is great for you, but pretty useless for them, as most of their email is about financial queries!  Subject "BettaWidget" is more informative to them, but won't mean much to you when you get the reply.  So, try "BettaWidget financial query".  It's essentially the union of your tag set and your recipient's tag set. 
  2. Good subject lines mean one topic per email : the one related to the subject line.  Two topics leads to lack of clarity, and the danger that one topic will get overlooked.  In the past, it also meant irritation of not being able to file it in the right place. But now we have tags rather than hierarchical folders, this isn't so pressing.
  3. Change the topic, change the subject line!  If your conversation has drifted off onto something else, change the subject line to reflect this.  This links to point 6 below. 

4. Quash Open-Ended Questions. It is asking a lot to send someone an email with four long paragraphs of turgid text followed by "Thoughts?". Even well-intended-but-open questions like "How can I help?" may not be that helpful. Email generosity requires simplifying, easy-to-answer questions. "Can I help best by a) calling b) visiting or c) staying right out of it?!"
Maybe a further "d) other (please specify)" is needed to allow for the creative solution that you are secretly hoping for!

5. Slash Surplus cc's.  cc's are like mating bunnies. For every recipient you add, you are dramatically multiplying total response time. Not to be done lightly! When there are multiple recipients, please don't default to 'Reply All'. Maybe you only need to cc a couple of people on the original thread. Or none.
It can be difficult to know who needs to see an email. Sometimes there's a few people who need to see it and do something, and a few who need it for information only.  The first should be recipients, the second should be the "cc"s.  But it can be hard to distinguish these categories: Gmail doesn't do this unless you look at "details", for example.  It might be worth having a couple of lines of intro:
  1. Hi X, Y, Z (for action)
  2. cc A, B, C (fyi)
I haven't tried this (yet), but it might help address the problem.  If you have people in the list who are neither for action nor for info, why are they there?

The "to all" message that starts out "To all of you who haven't done X" is the most problematic.  I confess that I have been guilty of this on occasion, usually when pressed for time, but I wince when I do it.  I hate receiving these, as I'm left thinking "have I forgotten to do X?", and have to waste even more time checking that, yes, I have done X.  Don't send to "all" with the disclaimer; send it just to those who haven't done X.   It may take less extra time than you think---you will be saved reading all those aggrieved emails from people telling you that actually, they have done X---and it saves the time of everyone who has done X (not least because they won't be sending said aggrieved emails!).

6. Tighten the Thread. Some emails depend for their meaning on context. Which means it's usually right to include the thread being responded to. But it's rare that a thread should extend to more than 3 emails. Before sending, cut what's not relevant. Or consider making a phone call instead. 
This isn't so much of a problem -- we can read as far through the historical provenance as we need to.  It saves deleting something that's actually needed.  And the academic in me feels bad at removing references: it's almost verging on plagiarism.

"Or make a phone call instead."  No.  No, no, no.  Absolutely not. In case I wasn't clear about this: no, do not make a phone call instead.  The glorious, wonderful thing about emails is that the recipient is in control of when, and whether, to respond. If I don't respond to your email, it's because:
  1. I'm busy in a meeting. Some of my colleagues are bemused that I don't answer my phone when I'm in a meeting with them.  When I do answer, the person calling often asks if I am free to talk: yes, I am, if I wasn't, I wouldn't have answered the phone.
  2. I'm busy doing some real work, and don't want to be disturbed.  It takes 15-20 minutes to get into a concentration "flow" needed for technical work; it takes a second to be broken out of it.  My phone is on such a soft ring I can ignore it in flow.
  3. I need to do something, find something out, contact someone else, read a document, even just think a bit, before I can give you a meaningful response, so it will take some time.
  4. I'm ignoring you for now.
  5. (unlikely) It's lodged in my spam filter.
The phone is ideal for a conversation that needs some back and forth discussion.  An example happened last week.  A colleague emailed to say that their group had been having a planning discussion, and she needed to tell me about it, and it was easier to talk through than write down.  Using email, we set up a time to talk.  The call lasted 50 minutes (it would indeed have been hard to write down!)  If you want to talk to me on the phone, email me and ask me to call you (tell me when, so that I don't disturb you in turn).

7. Attack Attachments.  Don't use graphics files as logos or signatures that appear as attachments. Time is wasted trying to see if there's something to open. Even worse is sending text as an attachment when it could have been included in the body of the email. 
Absolutely!  Central admin in particular seems to delight in circulating emails that say "please read the enclosed", which results in you spending 10-15 seconds reading that instruction, scrolling down to the attachment, downloading it, and opening it, only to be confronted with a few lines of text that could easily have been pasted into the email.  10-15 seconds, multiplied by every recipient, multiplied by every such email, amounts to a lot of wasted effort.  Especially when the attachment has been forgotten in the first place!  (Maybe those helpful little "did you mean to send an attachment?" popups, which sometimes appear when you forget a promised attachment, should be complemented with "do you really need to send this attachment?", when you don't!)

8. Give these Gifts: EOM NNTR.  If your email message can be expressed in half a dozen words, just put it in the subject line, followed by EOM (= End of Message). This saves the recipient having to actually open the message. Ending a note with "No need to respond" or NNTR, is a wonderful act of generosity. Many acronyms confuse as much as help, but these two are golden and deserve wide adoption.
EOM isn't even needed if you have an email client like that shows the beginning of the body text, or not, if there isn't any.  OTOH, NNTR seems to add extra acronym burden when there's already the well-known and perfects acceptable FYI.

9. Cut Contentless Responses. You don't need to reply to every email, especially not those that are themselves clear responses. An email saying "Thanks for your note. I'm in." does not need you to reply "Great." That just cost someone another 30 seconds.
This is another slightly tricky one.  Again, sometimes there's a need for an "ack", or at least the recipient feels the need to say "thanks", whatever.  Maybe an extra "RSVP regrets" or some explicit opt out scheme is needed in such cases?

10. Disconnect! If we all agreed to spend less time doing email, we'd all get less email! Consider calendaring half-days at work where you can't go online. Or a commitment to email-free weekends. Or an 'auto-response' that references this charter. And don't forget to smell the roses.

tl;dr: let's follow the Email Charter (except that phone call business, of course!) and make our, and our recipients', inboxes hold only short, content-full, attachment-less, relevant subject-lined, pertinent emails!

This may be a short term problem, though.  Apparently, teens don't use email. The next generation will need a Text Charter instead.
Read More
Posted in computer, education | No comments

Sunday, 11 November 2012

my magpie habits finally virtualised

Posted on 08:05 by Unknown
I'm in love ... with Evernote.

I first heard of apps to organise clippings, etc, several years ago, from Steven Johnson talking about DEVONthink in one of his books.  It sounded great, as I kept a paper commonplace book, and had an overflowing scrapbook, and wanted something more systematic to keep all those notes and thoughts and cuttings.  However, DEVONthink is Mac-only, so I started keeping an eye open for something else.

During my intermittent reviews of applications over the next few years, I came across Evernote, which seemed to be another alternative that people really liked.  But it too was Mac-only.  So I kept looking, experimenting with the odd app now and then, but nothing really seemed what I wanted.

Last week, I was having yet another look around.  This time, I was after something to keep an electronic laboratory day book, as my Word document version is too clumsy.  There didn't seem to be anything specific, and I was wondering whether to use a new blog, but in my web trawl, I again came across Evernote.  I noticed that now there is a Windows version, and an Android smart phone version.  I looked closer.  It seemed ideal for a clippings container.  I decided to give it a try, as a commonplace book at least.

I downloaded it to my home machine last Saturday, and experimented with it for a while.  I installed the Web Clipper app into Chrome, and started surfing/clipping.  I downloaded it to my phone, and played around some more.  It's got great searching capabilities, and a nice interface.  I particularly like the way the bullet lists work -- tab to indent, and return to outdent again -- very natural for note taking (where I am an inveterate bulleter).

my desktop version: snippet list on the left, detailed notes on the right

On Sunday, once I had a feel for what it could do, I decided I would also experiment with using it as a lab book. I planned to use one note per meeting/seminar/lecture, plus a "day note" for all the other bits and bobs that need recording on a given day.

Back at work, I downloaded Evernote to my work desktop and my netbook.  There I used it all last week, taking electronic notes in meetings, and during seminars.  It was really smooth.  For example, for one meeting I made a note that contained: what I'd done in preparation for the meeting; my notes typed in during the meeting; what I did to discharge the actions after -- all in one place.

Then I found the excellent blog of Jamie Todd Rubin, Evernote's "Paperless Lifestyle" Ambassador.  This opened my eyes to many other ways of using Evernote -- not just as a commonplace book and a lab book, but for other notes, projects, and whatever, and for automating various parts of the process.  I now have seven notebooks on the go, and more in mind.  (Although I probably won't go completely paperless.  But I am thinking of getting a faster scanner.)

I am seriously considering upgrading to the premium version, to get more monthly upload allowance, and some other nice perks.

Now all I need is for someone to port Penulimate to Android -- so I can scribble diagrams as well as textual notes in meetings.




Read More
Posted in computer, Evernote, grimoire, web | No comments

Saturday, 8 September 2012

unconventional identity

Posted on 13:35 by Unknown
I'm just back from a wonderful week in Orleans, at the Unconventional Computation and Natural Computation conference, and associated specialist workshops. Interesting people, fascinating science, good weather, great food: what more could you want?

Here's the semi-obligatory photo from my hotel window, with the cathedral visible in the distance (oh, the bells! the bells!):


As well as the packed science programme, there was the customary conference event.  The conference organisers spoiled us with a choice: a visit to Chambord Castle, or kayaking on the Loire.  Unsurprisingly, I chose the castle.  Very impressive, with an excellent guided tour giving us all the history, from its original use as a hunting lodge, to the bullet holes from WWII.

It's difficult to know how much to believe on these tours.  We were told that eating with a fork was introduced, because it was needed to get past the ruff worn around the neck. It sounds no sillier than the reasons behind any other piece of etiquette, but I can find no evidence for the claim.  The web seems quite happy to credit Catherine de Medici with introducing both the table fork and the ruff to France, but doesn't connect the two, in fact claiming that the fork didn't catch on for a while. Ah well, it's a nice story.

My favourite bit of the castle was the four storey double helix staircase, allegedly designed by Leonardo da Vinci:


This trip was followed by a walking tour of Orleans itself, which seemed to involve a lot of different statues of Joan of Arc.

several statues, of varying size
Our guide told us that all these statues depict Joan of Arc wearing a dress, because it used to be thought wrong for a woman to wear "boys clothes", as she actually did.  Why revere someone for saving you, yet deny what they actually did?

One of the things on the tour that was not a statue of Joan of Arc was Joan of Arc's house.  Except that it wasn't actually her house, she only stayed there; also, the original was destroyed in WWII, and later reconstructed, but at a different size.  It reminded me of the story of "my grandfather's axe". Identity is a slippery concept.

The availability of cheap and plentiful smart-phone photography changes what I snap, too.  As well as the obvious statues, vases, furniture, stair cases, carvings, and other typical touristy shots, I also photographed the timetable at the tram stop:


I didn't snap it (only) because it's a nice example of a stem-and-leaf plot, but because I actually wanted a copy of the timetable, for my trips back-and-forth between the conference venue and the city centre. I was accused by my colleagues of taking the most boring tourist photograph ever.  And then one of them photographed our restaurant receipt, for their expenses claim...


Read More
Posted in computer, food, history, science, weather | No comments

Wednesday, 22 August 2012

rough fonts

Posted on 13:03 by Unknown
I was reading the Boing Boing post about fonts that look like graphs. More interesting was the link to "postscript hacks to render slightly differently every time". I followed up, and discovered the Beowolf font family, with parameterised roughness, caused by adding some randomness to the PostScript rendering process:

Beowolf family, from MyFonts 

What's great about this site is the number of different kinds of text you can choose to display the various fonts.  I find the mid-rough R22 style most pleasing to my eye. 

A 2008 post on the Typographica blog gives some interesting historical background to this family.  (There's a blog all about fonts!?!  I may never get anything useful done again...)

This reminds me of "roughness", which is one of Christopher Alexander's 15 "generative properties", from his Nature of Order work, used to produce architectural structures that exhibit "wholeness".  We did some work a while back trying to formalise a few of the other properties, through BlobWorld, and were interested to discover an optical illusion that led to an appearance of roughness emerging.  Rough brickwork, or rough wall alignment, okay.  But rough fonts?  Neat.
Read More
Posted in algorithm, computer, font, graphics | No comments

Tuesday, 21 August 2012

way to discourage footnotes

Posted on 12:23 by Unknown
So, here I am, trying to add a footnote to my Word document (I know, I know, there's my first mistake; I do usually use LaTeX, but...) when I get the following error message:

 

So, just precisely what is wrong with my "Start at"1 value?  (Aside: I'm encouraged that I can have over 16 thousand numbered footnotes; I'm sure that will come in useful one of these days.  Or I would be encouraged, if I could get even the first one added.  But then I think, why shouldn't I be able to have a footnote numbered 0, or -42?) 

Anyway.  Maybe by "between", they mean "and not equal to"? Probably not, but let's try anyway, just in case:


Gah!  Oh well, I only need one footnote.  Rather than spend time figuring out what it really wants, I'll change the format, and use a custom mark instead:


Aaaaargh!!!!

---

1 Note the different capitalisation of the "at" in the dialog box and error message.  Sloppy.2
2 Also, note the easy use of footnotes in this post.

Read More
Posted in computer | No comments

Sunday, 1 July 2012

a stopped clock is never right

Posted on 07:42 by Unknown
A quarter past six? Or is it?
There's a saying that
Even a stopped clock is right twice a day.
This is used to mean: even something completely unreliable can (accidentally) sometimes be right.  The saying is sometimes cast as a paradox
A stopped clock is better than a clock an hour slow, because a stopped clock is right twice a day, yet a clock an hour slow is never right!
I want to explain how, in fact, a stopped clock is never right, and a clock an hour slow is always right.  This requires us to think of a clock as a simple computer, computing the current time, and ask ourselves, how can we tell the current time from the output of its computation?

A computation has three steps
  1. initialisation: set up the computer to perform the task of interest
  2. operation: the computer does its thing
  3. finalisation: read off the answer from the computer
(Don't blame me for the step names; I didn't invent them!  For those of you who are interested, this terminology comes from computational refinement theory.)  For a clock, these steps are instantiated as:
  1. initialisation: set the clock to the current time
  2. operation: the clock does its thing, marking off the passing moments
  3. finalisation: read off the (now later) current time from the clock
It's nearly ten past ten. Or is it?
Notice how the finalisation step is non-trivial.  The clock doesn't output "the time": it displays an output that requires some effort to be interpreted as the time.  To read the time from my analogue wristwatch (yes, I still use a wristwatch, and yes, it has an analogue display), I have to convert the positions of the hands, relative to a standard vertical (12 o'clock!) position, into a time.  This takes a (small amount of) skill: I can remember being taught how to "tell the time", that is, read an analogue clock face, by my aunt when I was about five. Even to read the time from a digital face requires some processing: to convert the displayed pattern of LED segments, or of pixels, into characters (ie, to read the  displayed pattern as characters), and interpret those characters ("12:30", say) as a time ("half past twelve").

This finalisation step is not the only one that can be applied, however.  This is the key step in the argument.  I realised this when I was attending a conference in Toulouse in 1999, and my watch was "broken".  It hadn't stopped, but I couldn't change the time (I couldn't reinitialise it), so it was an hour slow (stuck on UK time). That is, when I interpreted its output using the conventional finalisation, the time I got was off by one hour.  Given we started with "a clock an hour slow is never right", I could nevertheless use my watch to tell the correct time.  How?  (The answer will be obvious to anyone who has used a sundial during daylight savings time.)  By applying a different finalisation, one appropriate to its actual initialisation.  Here's the setup:
  1. initialisation: set my watch to the current UK time, so an hour behind the current French time
  2. operation: the watch does its thing, ticking off the passing moments
  3. finalisation: read off the (now later) time displayed by my watch, and add one hour
Voila! My watch was computing the correct French time, provided I finalised it correctly, that is, provided I correctly interpreted its output.  Well, you might say, but how did you know to add the hour?  Because I was the one who initialised it: I was the one who set up the computation. Other people looking at my watch would be confused, because they would be applying a different finalisation: the conventional one.  But it is merely a convention (established to make it convenient to use clocks other than ones that you have set yourself). In truth, you cannot tell the time looking at a clock unless you have some extra information: what finalisation you need to apply to interpret its display as a time. In practice, applying the conventional finalisation works, most of the time.

By using even more powerful finalisations, we can compute the time using even more faulty watches. For example, if I have a watch that loses a minute every hour, I can still use it, by adding the correct number of minutes back on when I read the time.  It is the combination of operation and finalisation that gives the resulting computation.

So how about the stopped clock?  Can you use it by applying an even more powerful finalisation? No. There is no finalisation that allows you to read off the correct time. The clock is performing no operation, it is not marking the passing time, so in order to get the desired computation from it, all the work would have to be done in finalisation alone, which would require using another clock!  The stopped clock is never right, because there is no finalisation: no way to interpret the display.  Your fortuitously looking at it when its display shows the current time does not make it right, not even coincidentally, because you have no way of interpreting its output.

However, there is something that a stopped clock has computed: the time at which it stopped (subject to applying the correct finalisation to its display, the one that would have been used when it was working).  This computation is the staple of many a TV cop show to tell the time of death of the newly discovered corpse with a conveniently smashed wristwatch (and the conventional finalisation being the wrong one is a cunning red herring in several detective novels).
Read More
Posted in algorithm, computer | No comments
Older Posts Home
Subscribe to: Posts (Atom)

Popular Posts

  • hyperbolic hyperbole
    What's with hyperbolic discounting? It's everywhere ! I first consciously noticed the term at a workshop about six weeks ago, and n...
  • better use seaweed
    As Neils Bohr is alleged to have said , “prediction is very difficult, especially about the future”. My smartphone has a weather app on it t...
  • oh dear
    We have a garden pond to help encourage frogs and other amphibians. Hedgehogs may suffer, however. :-(
  • "Windows support" -- not
    Just had another scam phone call -- someone with a strong Indian accent claiming to be calling from "Windows Technical Support" (o...
  • national stereotypes
    I've just got back from a very productive three day meeting in Paris. Just around the corner from where I was working, there was a marv...
  • retrospective holiday diary day 1: travelling north
    We went to the Lake District last “summer” ; this “summer” it was time for touring the other side of the country: Northumbria. The holiday s...
  • retrospective holiday diary day 5: trains
    Monday 24 September, and the long-threatened rain finally arrived. So this was the ideal day for the planned Carlisle-Settle rail trip . Bu...
  • funfair mirror trees
    One of the trees in our garden has died.  It died last summer in the drought, but we gave it a year to prove to us it really was dead.  It i...
  • retrospective holiday diary day 3: Lindisfarne
    Saturday 22 September, and the weather was still fine, sunny holiday weather so we decided to take advantage of the sunshine, and do Lindisf...
  • more scammers
    So not long after the scam phone call , the phone rings again. It's British Gas -- they get to call me because I'm actually a custo...

Categories

  • 3D printer
  • algorithm
  • astronomy
  • birds
  • Bonnie Tyler
  • books
  • cognition
  • computer
  • conference
  • Doctor Who
  • driving
  • ducks
  • duodecimal
  • education
  • electricity
  • estimation
  • Evernote
  • evolution
  • font
  • food
  • fractals
  • game
  • garden
  • graphics
  • grimoire
  • history
  • holiday
  • humour
  • language
  • LaTeX
  • lego
  • lol
  • mathematics
  • medicine
  • money
  • music
  • obituary
  • pedantry
  • politics
  • probability
  • psychology
  • publishing
  • python
  • quotations
  • research
  • robots
  • science
  • science fiction
  • space flight
  • statistics
  • TPS
  • trains
  • tree
  • TV
  • weather
  • web

Blog Archive

  • ▼  2013 (119)
    • ▼  December (1)
      • that's not in the least bit suspicious
    • ►  November (17)
    • ►  October (12)
    • ►  September (10)
    • ►  August (9)
    • ►  July (8)
    • ►  June (10)
    • ►  May (19)
    • ►  April (10)
    • ►  March (9)
    • ►  February (4)
    • ►  January (10)
  • ►  2012 (103)
    • ►  December (16)
    • ►  November (8)
    • ►  October (14)
    • ►  September (6)
    • ►  August (13)
    • ►  July (8)
    • ►  June (6)
    • ►  May (9)
    • ►  April (10)
    • ►  March (7)
    • ►  February (5)
    • ►  January (1)
  • ►  2011 (79)
    • ►  December (7)
    • ►  November (5)
    • ►  October (10)
    • ►  September (7)
    • ►  August (6)
    • ►  July (5)
    • ►  June (6)
    • ►  May (6)
    • ►  April (9)
    • ►  March (9)
    • ►  February (3)
    • ►  January (6)
Powered by Blogger.

About Me

Unknown
View my complete profile