Sunday
Jun152008

Jim Coplien on Design by Contract

From a few months ago, here is a video of a discussion between Jim Coplien and Bob Martin in which Coplien puts in a good word for Bertrand Meyer's Design by Contract approach to software development (about 15 minutes in).

Tuesday
Jun102008

Online Compilers

If you want to learn a new programming language at work, but you don't have the permissions to install new software on your PC and you don't want to 'bother' your system administrator, then maybe you should try an online compiler.  These are web sites in which you enter your code, click a button, and then your code is compiled and run, any output being displayed for you. 

Below is a list of a few online compilers that I have come across, along with the programming languages that each can handle.  They vary widely in the quality of their user interfaces, but if you are just interested in accessing the underlying compiler then that shouldn't matter too much.

  • JXXX Compiler Service - Java
  • Codepad - C, C++, D, Haskell, Lua, OCaml, PHP, Perl, Python, Ruby, Scheme, Tcl
  • The Zamplizer - Bash, C#, C++, Groovy, Haskell, Java, Perl, Python, Ruby
  • Tide - Javascript
  • CodeIDE - Pascal, BASIC, C++,  Asm, Perl, Javascript, HTML, Flex, MySQL, Prolog, Lisp
  • heroku - Ruby on Rails
  • AppJet - Javascript

Of these, CodePad is my favorite, but I have also used the JXX Compiler Service and The Zamplizer successfully (with the latter be sure to tick the "Wrap in <pre>" check box to get the output formatted correctly).  When I tried CodeIDE, it wasn't responding properly; maybe it was overloaded, or maybe it just doesn't work with Firefox.  Both Heroku and AppJet seem to be relatively serious web development tools.

In addition to the above, there are apparently moves afoot to produce online versions of the popular Eclipse and NetBeans IDEs.

 

Thursday
Jun052008

Echos of Stars Past

Two recent papers describe the detection of light echos from both Tycho's Supernova and the Cassiopeia A Supernova:

This means that it is now possible to study the outburst spectra of supernovae that exploded hundreds of years ago. This is just awesome.

Wednesday
Jun042008

The 'Beast' of Frimley

It was 7:30am on Tuesday morning, raining heavily, and I was hurrying along the path through the woods between Farnborough North station and Frimley, on my way to work. I was having to duck down every now and again to avoid snagging my umbrella in the overhanging branches that the rain had brought lower. Then, up ahead of me, through the rain and gloom I saw a low dark shape crossing the path and disappearing down the bank of the river Blackwater. My first thought was that it must be a deer, but the figure seemed too long and low, more like a big cat, a panther. I approached as quietly as I could, and peered down the bank, but there was nothing there. It must have waded across the river to the dense undergrowth on the other side, but again, I couldn't see anything over there. I stopped and looked around. An unnerving thought struck me: the animal, whatever it was, was probably sitting hidden in some bush watching me. I was completely alone, there was no sign of anyone else up or down the path. I came over all scared. What if it was a big cat?  I turned and hurried on my way. 

Looking back, I think the 'animal' was most probably two or more small deer running together in a way that made them look like a single, longer animal. I have seen single deer crossing the path near that point before, but I had assumed that they were going down to the river to drink. However, on Tuesday morning the heavy rain would have enabled the deer to drink without going down to the river. No, I suspect they were crossing the river to get to the small strip of woodland between the river and the Blackwater Valley Relief Road. This strip of land is overgrown and pretty inaccessible to humans, and would make a good place for deer to hide out.

Monday
May262008

Glade 3, pyGTK, and "Beginning Python"

I was working my way through "Writing a GUI with Python", Chapter 13 of "Beginning Python" (Peter Norton et al., 2005) using Glade 3.4.3 and pyGTK 2.12.1 on Windows XP.  However, I was unable to get any of the Glade examples to work.  The expected windows just would not appear.  There were no error messages, and breaking into the program while it was running in Idle showed that it was in the gtk.main() loop as expected.  I eventually worked out that I had to go into Glade and explicitly set the main windows Visible property to 'Yes' (see under the Common tab) .  Only then would the windows display as expected.  This need to set the Visible property seems not  to be mentioned in "Beginning Python" which is based on Glade 2.  Maybe it was introduced in Glade 3?