Wed, 18 Sep 2013
The NSA spying on every packet on the Internet "scandal" continues. The question is, of course, for how
much longer will this be an issue. Countries around the world are increasingly seeking to avoid having
Internet packet traffic routed via the USA. The logical consequence is that the USA will rapidly lose
economic benefit from the Internet worldwide.
What does this mean for "The Cloud", well at this rate it's current USA-centric future is in grave
doubt. As soon as a USA company is involved in a service, or there are servers associated with the service
on USA territory, the USA claims jurisdiction and believes it can order the NSA to spy on all traffic
associated with that service. So can Amazon Web Services (AWS), the current market leader in
Infrastructure as a Service (IaaS), survive? Possibly not. Ditto all services hosted using AWS. Amazon as
a company, and a parent of other companies, is a USA company and so the USA claims jurisdiction over all
the Amazon group no matter where they are incorporated. So purchasers of "Cloud Services" need to know how
a service is hosted in order to know whether the USA will spy on their traffic. This undermines the whole
Will the Brazilians, Chinese, Indians, Russians foster their own infrastructures independent of the
USA. Of course they will. Sadly though they also believe in spying on Internet traffic. Either that or
simply censoring it.
Wed, 20 Mar 2013
Next week, 2013-03-27 15:50 to be precise (*)
at DevoxxUK 2013 being held at the Building Design
Centre I will be presenting a session "GPars: Groovy parallelism for Java". As well
as GPars and Java, there is likely to be
some Groovy. Expected really. A bit like the squirrels.
Assuming the schedule isn't changed!
The BCS Advanced Programming Specialist Group (APSG) asked
me to do a presentation about GroovyFX to the group 2013-03-14, which I
was most happy to do. Despite all the planning, the session did not go at all as planned.
I started with a little historical background to indicate why GroovyFX
exists. Originally JavaFX had a declarative UI
specification language JavaFX Script. However
JavaFX didn't take off as perhaps it should have done. When JavaFX 2 was being planned it was decided to
drop JavaFX Script and make JavaFX purely a Java API. GroovyFX is therefore the scripting language for
The audience were not familiar with either Groovy or JavaFX so I
tried to stick to a few simple examples to just get people interesting in learning more about the whole
area. Given that I use Gradle as my build tool, and it uses Groovy as
its build specification language, I digressed into a bit of build to demonstrate Groovy, and also
introduced an element of polemic against Maven (and Ant).
I got back onto the contents list by doing some demonstrations of code actually running. This led to
discussion of SceneBuilder and then finished off with a pointer
to Griffon, which is a development environment for Swing and
JavaFX based desktop applications.
Slides (*) for the session are available on
Slideshare here or on my
The session was videoed but appears to have been posted in two parts. Part one
is here, part two
(*) There is an import error in the code on one of the slides: groovyfx.javafx should read
For some reason known only to no-one, I have only just noticed that a post I had intended to make 2013-02-18
never actually made it to the website. I have therefore ditched that post and written this one instead.
Many moons ago The London Python Group
(TLPG) was formed. This has generally
been considered a good thing.
The organizational strategy has been to have monthly meetings alternately being a pub meet-up and a
technical presentation session. For 2013-02-12 it was technical session time, and I volunteered to present
a session encouraging people to drop use of Python 2 and to take on board Python 3. For various reasons
we held the session at Skills Matter. The original notice
is here. As ever
Skills Matter videoed the session and the page with the video
The slides associated with the talk can be found on
Slideshare here, or
on my website here.
My presentation was really a polemic against organizations failing to even plan to switch from Python 2 to
Python 3. Some folks in the audience said they had no plan to switch because critical packages and modules
were not available in Python 3, which ironically, made my point exactly. People writing applications need
to ignore Python 2 only package and modules, and work only with ones that are Python 3 or both Python 3
and Python 2, even if this means switching away from de facto standards. I am now ceasing to use, and
indeed replacing, any Python sub-system that isn't already Python 3 compatible or at least has a short
timescale milestone to be Python 3 compatible.
The Python software Foundation should set a date for the term Python to mean Python 3 not Python
2. In the meantime, organizations should just get on with it, pull their fingers out, and upgrade.
As it happens TLPG got a sponsor for the evening, so it turned into something of a social event as well as a
technical session. BMC were looking for a senior technical person to run
some of their product developments. They chose to spend some money on post-session beer and food for the
audience, in exchange for being allowed a 5 minute pitch at the start. The pitch was handled in excellent
spirit, so added to the overall experience, rather than being a tedious thing. The beer and food went down
well with the audience, and some great social happened.
I am told that BMC have yet to find the right person for the role they have available, if you think you
might be a contender
Sun, 27 Jan 2013
Alberto Vilches asked me when we met
at Gr8Conf EU 2012, whether I would submit a session proposal for
the Greach 2013 conference. As it made a great excuse to visit Spain for
the first time ever, and do a session on GPars to a different audience, I said yes. Good
Well the conference is just over, and great fun it was, as well as being informative. It being a Spanish
conference, most of the business was in Spanish, but it also ensured an international accessibility by
having a lot of business in English. Given the French, English and Mexican/Colombian contingents at the
conference, along with the majority Spanish audience, the mix of Spanish and English sessions worked well.
Given that the core Groovy
and Grails activist community is fairly small, many of the speakers
were familiar faces. Many speakers though, and this is really good news for Groovy and Grails, were new
faces presenting really good material based on solid experience.
My session, a GPars Workshop was intended as a hands-on practical
session. Things started as planned and seemed to be going well. However, a website failure and my using an
exercise topic that was too ambitious for the context, meant I ended up having to do much more of a
presentation session. Indeed I ended up having to skip some of the material. I believe I got the core
message across in a form that people learnt from, but I didn't feel this was the session I had
advertised. Still there were tweets that people liked the session, so in its dynamically amended form it
does seem to have been liked. I will be further amending and re-presenting this session at future
conferences to make it work well as a conference activity. Eventually I think I may well generate
a 2-day training course as an intermediate/advanced Groovy programming course – I am told 2-day rather
than 1-day works better logistically for training courses. It also works better for course content and usefulness.
A PDF file of the "slides" intended (not all were used) for showing at the workshop can be accessed by
Sat, 22 Dec 2012
The London Java Community (LJC)
happened Saturday 2012-11-24 and I failed to write up my contribution.
I had a more or less prepared 45 minute session presenting Groovy
as a programming language to prefer over Java 8, which I proposed, was accepted and given.
The slides for this session are
Hopefully those people who turned up went away thinking Groovy is cool, who needs Java 8.
I proposed a more or less prepared lightning talk Trying to convince people that GroovyFX was the one
true language for programming the JavaFX API (instead of fighting with Java), and it got accepted and
presented. The slides for this talk are here.
I was convinced to propose a completely unprepared session on Gradle as a build tool to replace Ant and Maven.
This was accepted and given. I hastily prepared a content free set of slides and did the presentation
entirely as a live programming activity with some presentation of already undertaken projects.
The slides for this talk are here.
I enjoyed presenting the sessions I did, and I very much enjoyed all the other session, and the breaks, and the
social afterwards. A great event.
Wed, 19 Dec 2012
In 2011, Laurie Tratt asked me to do a guest lecture in his BSc
final year/MSc course on testing at KCL. Sadly timings meant it
couldn't happen. However, we agreed to ensure it happened in 2012. The date that was settled on was
2012-12-06. The slot is a 2 hour slot ideal for 2 50 min session with a short break. As per usual, I had
prepared too much material; either that or I spent too long on some of the earlier parts. So I had to
somewhat curtail the practical elements, and I failed to really get stuck in to mocks.
Initially the intention had been to do all the practical bits in Python, but Laurie and I agreed that
doing some Java would be a good move given the background of the students. We also agreed on Git rather
than Mercurial or Bazaar as the version control system to make use of. Polling the students in the session
indicated this was good planning on our part! I also tried to show
of Spock as a
really Groovy testing toolkit for Java and Groovy code.
It has been 12 years since I was Professor of Computing Science and Head of Department at KCL. Much about
the place has changed, but much is the same. The lecture theatre in which the session took place is one I
used to do many of my lectures in. Except that it has had a serious refit since then and is now rather
splendid. It has also had a rename as an honour to Arthur Lucas, who was Principle of KCL when I was on
I enjoyed doing the session, thanks to Laurie for asking. I believe many of the students really enjoyed
the session given the questions people came up to me at the end and asked. Thanks to them for being a good
A PDF file of the slides used can be found here.
Tue, 18 Dec 2012
Last week was the 2012 incarnation of
the Groovy and Grails
eXchange annual conference held, as ever, at
Skills Matter. Two days of Groovyness and Grailery. I think most
people were Grails users, and primarily there for the Grails track, but there was a solid presence of
non-Grails Groovy folk which made the Groovy track (which is what I was attending) really interesting.
I was not presenting on GPars this year, but there was still a
GPars talk. It was Aurélian Maury presenting on his experience of using GPars for real, "in the
wild". See here for the page on
Skills Matter's website, which includes their video of the presentation.
My contribution to Day 1, other than being at sessions, was to be on the end of day panel. There were
known to be questions coming on concurrency and parallelism along with issues relating to Groovy and
Grails process. As a person known to have some knowledge and strong views on these topics, I was inducted
into the panel. I thought the issues relating to concurrency and parallelism led to an interesting and
constructive exchange, but then I am biased! I also managed to have the last word, mostly since the
audience, after I had my little rant on avoiding excessive backward compatibility and going forward
managing change and user expectations, burst into spontaneous applause. Peter Ledbrook, who was leading
the session, took this as a suitable closing. The Skills Matter page and link to the video can be
found here. I seems to
be the only person not wearing dark clothes!
As is traditional Day 1 starts with a Groovy keynote by Guillaume
Laforge, and Day 2 starts with a Grails keynote by Graeme
Rocher. Sadly I missed the first few minutes of Graeme's presentation due to traffic jams that delayed
busses by many, many minutes. But I got to see most of it, and Grails just seems to get better and
better. As was hinted at in the previous day's panel session, Grails will be
ditching Gant and using Gradle
as from Grails 3. As I understand it, Gant is not being replaced by Gradle per se, it is that Grails
wants some facilities that Gradle offers and as a side effect Gradle can do all that Gant is used for. It
thus makes great sense for Grails to go this route. To be honest Gant needs either a rewrite or to pass
into history. I suspect a rewrite will never happen.
My session was intended to be an analysis of the position of Groovy in the JVM-sphere, based on the
tensions between dynamically typed languages and statically typed languages. Groovy started as a
dynamically typed language but with optional run-time type checking but is increasingly supporting compile
time type checking and indeed compile time code generation as per statically typed languages. The
questions are whether the traditional barriers between dynamic and static languages should be attacked and
if they should is Groovy doing the right thing. Cédric Champeau the person driving the static type
checking and compilation was in the audience and I survived. Perhaps I wasn't contentious enough. The
intention was really to make people think about the direction Groovy was going and whether it can and/or
should attempt to replace Java. The slides for the session
are here and the
page with the Skills Matter video
All in all a good conference, I am already looking forward to the 2013 version.
Sat, 03 Nov 2012
Paul Allen via his organization, Interval Licensing Inc., is currently suing Apple, Google, Yahoo!, and
AOL, for some amount of money based on various patents including U.S. Patent
Looking at Groklaw,
particularly this article,
various stupidities of the case are highlighted. For myself, I find it incomprehensible that a patent
system can provide monopoly to the invention of: information to a user in non-distracting ways that do
not interfere with the user’s primary activity on a device such as a computer. It's not even a physical
device containing a computing system that the claims are being made on, just the act of presenting
information. So in the USA you can patent the display of information.
The folks at Groklaw are trained in USA law and far better commentators on this case than I am. I will
therefore leave the detailed argumentation of how stupid this case is to them. I do however want to
highlight something that, for me, proves the USPTO is not fit to operate as the government tool for
Let's consider the difference of title and abstract between
Indeed, the answer is they are exactly the
same. The 6,034,652
patent was filed in 1996 and granted in
2000. The 6,788,314
patent was filed 13 days after grant of the earlier patent in 2000 and granted in 2004. So the USPTO
believe it is right and proper for an organization to apply for a patent using exactly the same title and
abstract as a patent that had just been granted two weeks earlier after a four year wait. First reaction
has to be, well that is cynical behaviour by Paul Allen and Interval Licensing Inc. Second reaction has to
be: USPTO clearly do not actually read the patents and check in any way shape or form for obvious
similarities to earlier patents. Nor, clearly, do they check for obviousness, nor suitability for patent.
The only deduction, or even inference, from incidents such as this is that the USPTO exists only to
provide jobs for patent lawyers, and to keep the patent courts full of business. Why is this a bad thing?
Two reasons: firstly, it increases the costs of products to the end user since the costs to suppliers is increased
by all the patent litigation undertaken; and secondly it stifles innovation by small players as they have
to plan for potential litigation in patent court. Either of these is a reason to reform USPTO with respect
to software and business patents, but put them together and the argument is undeniable.
Even if you are a believer in software patents, and I am not, I think they should be forbidden, you have
to admit the current system is out of control, favouring only patent lawyers, and hurting everyone else.
The current high profile Apple vs. Samsung case serves only to reinforce this. Mobile phone manufacturers
and network operators compile massive software patent war chests in order to attack and defend against
each other as a part of the performance of trade. When Apple sue in their own backyard, confident in
having a positive jury, which provides the right decision for them, and then it is clear that the jury
were biased and cheated, the whole corruptness of the system is brought into stark relief.
Who wins? The patent lawyers. Who loses? Everyone else. How can the USA government justify USPTO
behaviour? Is it because most politicians are ex-lawyers?
I caught a part of an interview last evening that summarized for me the fundamental corruptness of the USA
presidential system. Prior to seeing the interview fragment, I already believed the system biased and
problematic. To start, the system is a closed one; it is invariably a two-horse race between candidates
offered by the only two political parties with a viable presence in the USA: Democrats and
Republican. Both of these parties are fascist right wing parties according
to The Political Compass, and nothing in the history of the
two parties really belies this analysis.
The parties go through an enormous spend-fest just to decide on their candidate. Even this is an
effectively closed system: only successful senators are allowed to enter the race and only those with very
deep pockets can afford to continue far into the race. Spending money is at the heart of the USA
primaries. This is political power by the purchasing of votes.
Once elected as the candidate, spending is even more important: candidates believe they have to buy the
votes in the swing states, and spend some on their secure states as well. "He who has the cash can win the
election". And note this is a definite "he". There has not been a woman as candidate, though Hillary
Clinton almost got there.
So why does an interview fragment make me write about what is so obviously a corrupt system? The
interviewer asked something like "many people worry about the negativity of the Obama campaign, what do
you say to this" in answer to which the interviewee, who was a prominent Barak Obama campaigner, went into
a tirade of how Mitt Romney had failed at this and done that wrong. The interviewer responded with
something along the lines of "but does not that just show that the campaign is one of negativity" to which
the interviewee responded "no the campaign is not a negative one" and then proceeded to effectively repeat
the tirade. You could see the interviewer metaphorically throw up his hands in frustration. I just thought
"Americans really don't seem to get irony".
What then came out was a discussion of spending, and the huge amounts of money spent on campaigns and how
it was spent. The answer was an eye opener to the cynicism and blatancy of the vote purchasing. Spend just
enough to keep your secure states happy and spend as much as you can in those states where there is a
possibility of the opponent winning to try and ensure you win. Given the system, a not unreasonable
strategy. But as a commentary on the fundamental corruptness of the system it was brilliant. The system
relies on the purchase of votes by trying to show your opposition is the voters enemy. This led to clear
statements of the racist and discriminatory assessment of the population. White working class in certain
states were assumed to be racist and therefore anti Obama because of the colour (or color) of his
skin. There were other instances of these discriminator assumptions dictating the nature of the spend of
huge amounts of money.
USA presidential campaigns are cynical spends of amount that can only be categorized as "conspicuous
consumption" to purchase votes.
Thank goodness the UK system is nothing at all like this.
Oh dear my irony meter just went off the scale. Clearly the UK system is as bad in it's closedness and
attempt to purchase votes by any means necessary. Basically democracy as we know it today is an appalling
system. It just sucks less than any other system. This is depressing.
Mon, 29 Oct 2012
Stephen Chin, one of the Java evangelists at Oracle (his blog
is here) is currently undertaking "NightHacking Tour – The
Road to Devoxx". It involves Steve riding a very serious BMW 1200cc bike round Europe having two hour
hacking sessions (that's hacking as in doing good programming) whilst putting out a video and audio feed
to live streaming (using some very serious Nikon kit).
Steve's first session was with James Gosling (yes, the James Gosling) in the USA. He then flew in
to the UK and did the second session with Ben Evans, one of the driving forces of
the LJC. Yesterday Steve visited me at home for
a session on GroovyFX and there was supposed to be
some GPars, but we didn't get that far since we only had a couple
This blog entry written whilst watching the fourth session, Steve with Stephen Colbourne, the person
behind JodaTime and JSR310. Steve is on a fairly hectic schedule. He does
the LJC session later today,
and a session with Trisha Gee before that.
I have been intending to do a GroovyFX version of 2-d balls bouncing in a box as a vehicle for looking at
quadtree algorithms and the use of GPars to support parallelization for many months. Steve's visit was
the impetus needed to get going on this. So I got a repository going for something to work on. In the
process I realized I didn't know as much as I should about JavaFX and GroovyFX. The repository, called
GroovyBalls, is on GitHub here. (I also have it on my
own website here.)
For technical reasons to do with the video and audio stream, we had to work on Steve's laptop. This
necessitated setting up his NetBeans configuration for Groovy. In
the process we got rid of some bugs in the Gradle build. I use Gradle
now for everything build on the JVM. Even if using Eclipse, IntelliJ IDEA or NetBeans, everything centres
on the Gradle build file: Gradle can generate Eclipse and IntelliJ IDEA projects, and NetBeans with it's
Gradle plugin "Just Works".
Having got my initial code working on his machine, Steve got stuck in to working with me to improve my
JavaFX knowledge by working on a couple of small evolutions of the code. It was great fun. I should be
able to provide a link to the video soon.
Having got a head start now I should be able to get the code into a position to apply GPars to. I have a
deadline: Groovy and
Grails eXchange 2012. GroovyBalls all has to work for then!
Mon, 22 Oct 2012
JAX London 2012 was last week (2012-10-15 to 2012-10-17) but I
haven't had time to sit down and think about what to write till today for lots of reasons, none of which
are interesting to anyone other than me.
I had two sessions in the program: It's All About Processes Communicating
and Closures: The Next "Big Thing" in Java
The first of these, It's All About Processes Communicating, was really an introduction to
dataflow approaches to solving problems and
to GPars as a framework for supporting them using Java
and Groovy codes. The first part of the talk was a bit of a rant against application level
us of the operating system technique of shared mutable memory multi-threading – this is where the
squirrels played their part. Squirrels are very territorial and despite there being five bird feeding
stations to choose from the senior squirrel refuses to let any other squirrel eat from them. Squirrels
therefore deny parallelism. This led to a short discussion of the synchronized keyword in Java
and the fact that any and all locks are designed to stop parallelism. So in today's world if you need more
performance, you need to use parallelism, so you need to avoid locks.
The session then moved onto a short description of actor model, dataflow model, and Communicating
Sequential Processes (CSP). Although I had been intending to present examples of dataflow model and data
parallelism, both of which are well supported in GPars, I took the decision to focus on actor model, which
is also well supported in GPars. So I skipped the material about approximating the value of Pi, and moved
straight to the Sleeping Barber problem. This led to showing various examples of Java and Groovy code
using GPars to create a simulation of the problem. This isn't really about performance increase it is
about avoiding deadlock. I think the examples worked well. They and many other are in a Git repository.
To clone use http://www.russel.org.uk/Git/SleepingBarber.git to just browse go
The second talk the following day, Closures: The Next "Big Thing" in Java, was proposed before I
knew Brian Goetz was giving the opening keynote. Since he covered much of what IO was going to cover I did
a serious overnight rewrite of my talk to try and be a reprise and follow on from what he had talked of.
The session started with a concern over whether people would follow the changes in Java or whether they
would just stick with the version they know: many people are still using Java 1.4.2. Personally I find
this shocking: they consider the changes of Java 5 to be to big a change for no benefit, and Java 6 and 7
with them. Of course Java 8 will be an even bigger change. The session then moved onto a short
description of the lambda expression syntax, trying to ease people towards it using examples from Scala
Of course the lambda expression syntax is really just a bit of syntactic sugar in many ways, but the
introduction of defender methods and the massive changes in the way data structure libraries are used is
the real message of Java 8. Stopping using "external iteration" and starting to use "internal iteration"
is the big shift: a move to a more functional viewpoint. Actually also a move to a more object-oriented
viewpoint. Too many people are writing Java code in C idioms of iteration.
The shift brings massive pay off when wanting to harness parallelism. You can get it for free. At least
data parallelism, the sort of parallelism associated with the use of sequences. The squirrels made an
impromptu appearance here to deny the need for parallelism a bit more.
The session closed by showing GPars and Scala examples of what Java 8 will bring. Java 8 is in the future,
Scala and GPars are here now. Indeed GPars can be used to do Java 8 style programming using Java 6 and
Java 7. So the push was to get out there and use GPars to change you programming style now the new Java
Of course the squirrels had to make a reappearance. Hopefully people found the sessions enlightening and
Sat, 09 Jun 2012
Gr8Conf is a tricorn of a conference, it has sessions in Australia,
Denmark, and USA each year. I haven't been able to get to any of the previous instances, but I did have
the opportunity to get to the European part this year. I therefore
submitted a proposal for a talk, about GPars, and it was
I wasn't sure on the level to pitch the presentation, for beginners, intermediates, or experts. In the end
I decided to go for a “manifesto” type presentation – the long-term plan being to submit
a session each year going into various different aspects of parallelism on the JVM using GPars. So
somewhere between beginner and intermediate then.
The initial part of the talk was to provide an impactful and humorous argument as to why locks
(semaphores, mutexes, monitors, etc., etc.) are a tool for managing time division multiplexing of multiple
processes and/or threads on the processors available. It turns out that there is an interesting analogy
from our front garden – if you can call such a small area a garden.
We have a number of feeding devices in our small front garden for feeding the robins, blue tits, great
tits and blackbirds that live in our very urban, but right next to a cemetery, area. Cemetery, trees,
squirrels. The squirrels come in and eat all the bird food they can. However, squirrels are hugely
territorial and have definite “pecking order” hierarchies. The senior squirrel (in this case a
female) always claims all of the bird feeding stations to the exclusion of all other squirrels. The
behaviour emulates an application that demands all processor resources but only uses one at any one
time. If another squirrel (process) tries to feed (use idle processors) then the senior squirrel simply
chances the intruder away. One squirrel, all resources.
The point here is that any use of any explicit locking algorithm can, and does, destroy any and all
parallelism. The answer is to use an architecture where the model itself manages all the processor,
process, and thread resources, and, most importantly, manages the synchronization. Most application
programmers no longer explicitly manage stack; most application programmers no longer explicitly manage
heap; most programmers no longer explicitly manage memory; so why are programmers told how they must
manage processors and threads? Wrong model, wrong abstraction.
Underlying all this is the point that processor speeds are no longer increasing, only the number of
processors is increasing. Thus there is no way of increasing application performance without moving into
These points lead directly the re-emergence of a number of models of concurrency and parallelism that were
side-lined in the rush to encompass shared-memory multi-threading as happened in the 1980s and
1990s. Actors, dataflow, Communicating Sequential Processes (CSP) and data parallelism, are now
architectural and design models that application programmers need to understand and work with.
On the JVM, GPars provides a framework allowing Groovy and Java programmers a way of working with these
architectural models. In this presentation I showed actors and futures using dataflow variables. I didn't
get to a full dataflow version or the CSP versions due to lack of time in this 50min presentation. The
application used for the code presentation was calculating “Π by Quadrature” a classic
embarrassingly parallel, but small, application. Small is needed so as to exemplify the points being made
rather than getting lost in large amounts of code. Anyone who has been to any of my talks in the last 5
years will know I love this problem. I also love the “Sleeping Barber” problem but we didn't
get to that in this session even though I have some material on it prepared.
The “Π by Quadrature” problem allowed me to discuss using the different architectural
models and to talk about using the right tool for the right problem. The right tool in this case is data
parallelism and this allowed me to show a few features of GPars. It also allowed me a short rant on
languages that provide one, and only one model of parallelism are not giving application programmers a
suitable toolkit. Mentioning no names, and I won't, but the audience knew.
I ended the session slightly rushed so as to stay within my allotted time, with a propaganda statement that
application programmers should never explicitly use any form of locking unless they absolutely have to and
there is no other way. GPars has the tools to allow programmers to avoid explicit locking, to abstract
away from explicitly managing processors and threads, and that therefore there was no excuse.
Audience reaction to the presentation seemed very positive, but I haven't seen the feedback. Hopefully
people learned stuff as well as had a bit of entertainment.
Thanks to Søren and his team for organizing a great conference.
The slides for my presentation are here as a
The Git repository of all the “Π by Quadrature” examples (only a few were presented) is at
http://www.russel.org.uk/Git/Pi_Quadrature.git. Or if you just want to browse the code
The Git repository of the “Sleeping Barber” examples (none of which were shown) is at
http://www.russel.org.uk/Git/SleepingBarber.git. Or if you just want to browse the code
Wed, 02 May 2012
ACCU 2012 was another great
conference in the series. Lots of good sessions, occasional not so good one, lots of time for
socializing (we'll ignore the euphemism networking, and call it what it is) and a lot learned.
There was more of an explicit emphasis on C++ this year, but this was due to the submissions offered to
the conference committee rather than any direction on their part. Almost certainly the history of ACCU
being a C and C++ focused organization, and the publishing of the C++11 standard, had much to do with this.
A great deal was made of the "death of C", but everyone was explicit that this is C being a dead language
in the way that COBOL is a dead language: you don't use it but there is an awful lot of it about.
My contributions this year was, as ever, to do with concurrency and parallelism. I did a session "Go, D,
C++ and the Multicore Revolution" which was asking whether the changes to C++ due to the C++11 standard
was just too little too late. C++ now has a memory model, asynchronous function call and futures but this
is still an abstraction level below that that applications programmers deserve. Go is trying to replace C and
incorporates Communicating Sequential Processes (CSP) as its model of concurrency and parallelism. Go is
considerably simpler than C++ and yet achieves most of the tools for abstraction and programming that most
programmers need most of the time. D is trying to replace C++ and has far better facilities for generic
programming and uses actors as its model of concurrency and parallelism. It could be said that D is
already that which C++ is evolving to become.
I introduced the C++ actor system that Anthony
Williams' Just::Thread Pro will have – I have
a preview version – to show that C++ could catch up with Go and D if there was a recognition in the
C++ community and standards committee that C++ needs to make use of the goodwill generated by the C++11
standard. C++ has the potential to be an interesting programming language. In the mean time Go and D are
already very interesting languages, they make native code working feasible. Unlike C, but then that is
now a dead language.
The slides for the session
are here but they probably don't
mean that much out of context. The codes shown are in the Bazaar branch to be
found here. We didn't do any of the Sleeping
Barber material, interactions during the session meant we only looked at the Π by Quadrature material.
I did a second session in collaboration with Schalk Cronjé. The core technical content was to show
actors, dataflow, and CSP in action. The subplot was to some some comedy. We had sketched out the plan a
few weeks before, but had to leave final planning to the very last moment. So we had a structure and a
rough plan, but hadn't done a full script; we had to do a lot of ad libbing. I am not sure it worked
completely, but the audience got involved and didn't leave. The problem we tackled was generating
signatures for files in a directory hierarchy. This is a real problem from Schalk's work, not a toy
problem. If people were enthused that Groovy already has, via GPars, everything that all the other
languages desire in the way of actors, dataflow and CSP support, and that the future of applications
programming is to use these models, then the session was a win.
The slides for this session are here. The
code used is in a Git repository: the bare repository for cloning
if you just want to browse without cloning then you want to
Sat, 28 Apr 2012
In his keynote at ACCU 2012 this morning, Uncle
Bob made a couple of arguably ill-judged asides. They weren't grossly sexist, but they clearly came
from a certain view of sex/gender stereotypes. A woman in the audience, quite reasonably, pulled him up
on them at the time, and again after the keynote. Which was good. Uncle Bob, not actually being a
sexist, nigh on immediately wrote and published a
statement. For me this showed what an excellent person Uncle Bob really is. Serious respect – as
the saying goes.
Being from the same era, albeit from the UK rather than USA, and a regular public speaker, I fully
appreciate his difficulty. All through growing up we had stereotype sex/gender role models rammed down our
throats. In the heat (and stress) of presenting, it is way too easy to let those early year attitudes
creep through despite 40+ years of trying to ameliorate them and replace them with sensible attitudes of
real equality. Let's forget political correctness here, that is almost as bad as the 1950s and 1960s
sexism, let's talk about real equality.
Sadly UK and USA society remains fundamentally sexist: parents are the problem here. Boys are dressed in
blue, given monster truck and guns as toys, and expected to be brilliant sportsmen or massive
intellectuals. Girls are dressed in pink, and expected to learn to be good mothers, even being given dolls
from Day 0. Dress codes and attitudes are fundamentally sexist: girls wear skirts, shirts or trousers, and
from puberty onwards, are often expected to wear as little as possible in public showing as much skin as
possible. Boys were shorts and then trousers and are expected to always be covered. Think of the rules of
evening dress: women are expected to be in fabulous gowns showing as much skin, especially around the
breasts as possible, men wear dinner suits. Only Scotsmen have permission to wear skirts and only then if
they are 8-yard knife-pleat kilts with the full Victorian extras – but not a dirk, that would be illegal.
OK so there is a massive simplification here but...the core point remains valid. Parents enforce sex/gender
stereotypes from Day 0 of a child's life and that is at the core of our society. Is it any wonder those
children of more enlightened parents who want to break out of the standard models have a problem? In the
case of ACCU 2012 we are talking "Girl Geeks". Sadly there remain far, far too few of them.
Uncle Bob's slip was not that serious but has become a bit of a storm in a teacup. However the underlying
problem is very real and is a serious problem: our society has no real equality no matter what the law
says. Until we find a way of men and women having equal opportunity generally even though women have to
bear the children, sexism will remain systemic. Biology may assign sex/gender roles, but humans are surely
intelligent and enlightened enough to be able to create equality despite this. Currently it seems not.
Being an individual male from the same era as Uncle Bob, I feel almost completely unable to do anything
that will actually change things for the better. This is really depressing.
Wed, 28 Mar 2012
Vodafone did me a part-way reasonable deal on a new contract involving me taking possession of a Galaxy
Nexus to replace the N900 I have had for two years. Of course when I got home and found it was a 16GB
machine instead of a 32GB machine I was not entirely happy; the Galaxy Nexus has no memory expansion
capability. Still it is Android, Maemo being well dead, ditto MeeGo, and version 4 at that. (No I am not
going to use inane terms like Ice Cream Sandwich, or even ICS.)
I have been reasonably pleased with the phone over all, and the Android Market, sorry Google Play,
downloading has worked – even to the extent of updating all the out of date operating systems and
applications. I am even looking forward to paying for some apps, not to get rid of adverts but to get some
of the extra functionality. I have actually been quite surprised at how immune I have been to the
advertising on free apps. If advertising can fund some apps, whilst having no effect on me, then long live
But there is a downside. Actually there are two:
Vodafone 3G coverage is still very poor and almost, but not quite, totally unrelated to the coverage map
that they publish. For a world rapidly going 4G, the UK is woefully under-resource with 3G and
3.5G. How can the UK compete in the information era with such appalling mobile network systems?
Thankfully the 3 UK coverage is not bad. Pricing for data is still a complete rip-off: the whole 3Gb
for 1 month business model should surely come under scrutiny. Either it should be unlimited for a month
or 3Gb for an unlimited period. I dread to think how little I'll be able to do on 500Mb per month on the
Vodafone contract if I can ever get 3G on Vodafone.
Bluetooth tethering does not work. USB tethering works fine. Wifi tethering works fine. Bluetooth
tethering says it has succeeded to the PC, but reports failing on the phone.
So I went to my local Vodafone store where I got the new contract a few weeks back. The very nice chap
there listened to my question and with good grace said he didn't know the answer. This I though was good
customer service because of the way he dealt with it. He suggested I should contact Technical Support via
telephone and set me up using their in shop free phone. Sadly this was the beginning of the problems.
Vodafone answers, and requires you to enter your phone number or account number and PIN number before you
can get anywhere. OK, annoying but... You then have to go through four, yes four, layers of listening to a
sequence of options before you get to talk to a human being. Well I say human being, but I am not entirely
sure it wasn't a trained monkey.
First question: "Please can I have your phone number." For ##### sake Vodafone get your systems working. I
already typed in the number to get through, you should present this useful information to the call centre
monkeys so that they can give at least a simulacrum of good customer service. So having ranted at the
monkey about this, I gave the seemingly duplicate information that he clearly was not being given (not
actually his fault though). I then explained the situation and his response was "It's a Samsung problem."
I tried to explain that I didn't think it was, but he insisted it was. Basically he was reading the one-line
answer printed on the sheet in front of him: "This is not a Vodafone problem, please
contact phone vendor." I gave up, asked him to text me the number, which to be fair he did within
about 30s. Good monkey. Bad Vodafone.
So, Samsung, or anyone, why is this your fault and not Vodafone's. I switch on Bluetooth on phone and
laptop. I switch on Bluetooth tethering on the phone. I select the "connect via Bluetooth" networking
option on the laptop. The phone reports tethering is activated, flashes up a message too fast to read and
then reports "not tethered" – I have absolutely no idea how to find out what the flashed message
was, but perhaps it is crucially important? So the phone believes Bluetooth tethering is active but not
happening. Meanwhile on the laptop it is entirely happy that a suitable connection is in place. Even DNS
lookup appears to be working. But no packets escape the NAT network. This would indicate that Vodafone is
black holing the connection, or am I missing something?
bnep0 Link encap:Ethernet HWaddr 70:f3:95:4e:b3:da
inet addr:192.168.44.79 Bcast:192.168.44.255 Mask:255.255.255.0
inet6 addr: fe80::72f3:95ff:fe4e:b3da/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:24 errors:0 dropped:0 overruns:0 frame:0
TX packets:38 errors:0 dropped:0 overruns:0 carrier:0
RX bytes:2859 (2.7 KiB) TX bytes:2702 (2.6 KiB)
eth0 Link encap:Ethernet HWaddr f0:de:f1:2f:cb:b3
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:126757 errors:0 dropped:0 overruns:0 frame:0
TX packets:126757 errors:0 dropped:0 overruns:0 carrier:0
RX bytes:11639041 (11.0 MiB) TX bytes:11639041 (11.0 MiB)
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.44.1 0.0.0.0 UG 0 0 0 bnep0
link-local * 255.255.0.0 U 1000 0 0 bnep0
192.168.44.0 * 255.255.255.0 U 0 0 0 bnep0
|> dig dimen.winder.org.uk
; <<>> DiG 9.8.1-P1 <<>> dimen.winder.org.uk
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 58035
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;dimen.winder.org.uk. IN A
;; ANSWER SECTION:
dimen.winder.org.uk. 86118 IN A 184.108.40.206
;; Query time: 29 msec
;; SERVER: 192.168.44.1#53(192.168.44.1)
;; WHEN: Wed Mar 28 18:06:45 2012
;; MSG SIZE rcvd: 53
|> traceroute dimen.winder.org.uk
traceroute to dimen.winder.org.uk (220.127.116.11), 30 hops max, 60 byte packets
1 192.168.44.1 (192.168.44.1) 6.028 ms 8.318 ms 11.069 ms
2 * * *
3 * * *
4 * * *
5 * * *
6 * * *
7 * * *
8 * * *
9 * * *
10 * * *
11 * * *
12 * * *
13 * * *
14 * * *
15 * * *
16 * * *
17 * * *
18 * * *
19 * * *
20 * * *
21 * * *
22 * * *
23 * * *
24 * * *
25 * * *
26 * * *
27 * * *
28 * * *
29 * * *
30 * * *
So Samsung, Vodafone claim this is your problem, that the Galaxy Nexus phone is borked with respect to
this functionality. What the #### is wrong. Of course my suspicion is that Vodafone is detecting
Bluetooth tethering instead of USB or WiFi tethering and blocking all packets, they are just not going to
admit that this is the case.
Actually what I want Samsung to do is to tell me how Vodafone are doing this so that I can undo it. I want
Bluetooth tethering. I used to have Bluetooth tethering on the N900. It is a good thing. I want it to work
Footnote: I am under no illusions, no-one other than me is ever going to read this mini-essay/rant, but
it has been cathartic writing it, so I will publish it anyway.
Fri, 02 Mar 2012
On 2012-04-02 and 2012-04-03 the JAX Days are being held in London. On
the first of these days, 2012-04-02, I will be presenting a one-day “learn in” on the Groovy
Groovy is a dynamic language designed to be symbiotic with Java:
Groovy and Java work together on the JVM, they don't fight each other. When developing systems on the
JVM, Groovy makes a very dynamic partner to Java: you write the bits of your system that are best handled
by a static language in Java, and those bits best handled by a dynamic language in Groovy.
This one-day session at JAX Days is designed to be for people who have some knowledge of Java to be able
to start learning and become proficient at using Groovy, and indeed mixing Groovy and Java in the same
system. The intention is for this to be a fun as well as informative day: I am strong believer that
programming should be fun.
Wed, 01 Feb 2012
At the session "Python is a High Performance Language" last evening, I showed some Python code executed
using CPython and PyPy. John Hoyland asked what the performance was with Jython or IronPython. An
excellent question about which I had no data. I will not be able to check with IronPython on CLR, but I
can certainly check Jython. Using the sequential version of my “π by quadrature” using a
for loop with xrange and multiplication, the code for which can be
I get the following results:
==== Python Sequential For/Xrange Multiply pi = 3.14159265359
==== Python Sequential For/Xrange Multiply iteration count = 10000000
==== Python Sequential For/Xrange Multiply elapse = 5.83972406387
==== Python Sequential For/Xrange Multiply pi = 3.14159265359
==== Python Sequential For/Xrange Multiply iteration count = 10000000
==== Python Sequential For/Xrange Multiply elapse = 0.224266052246
==== Python Sequential For/Xrange Multiply pi = 3.14159265359
==== Python Sequential For/Xrange Multiply iteration count = 10000000
==== Python Sequential For/Xrange Multiply elapse = 6.33100008965
So I think it fair to say, without fear of contradiction, that PyPy Rocks.
The PyPy Project needs your help. The project relies on voluteer labour
and donations. Currently it is trying to ensure PyPy can work
with NumPy and that PyPy conforms to the Python 3 specification.
Donate individually on the PyPy home page, get your company to donate. PyPy needs your help.
Yesterday evening (starting 2012-01-31T18:34) I presented a session with the above title
at Skills Matter. It was scheduled in their “In the
Brain” series, so I assumed licence to be very personal and idiosyncratic. The overall aim of the
session was to convince people that although Fortran and C++ are seen as the standard languages of high
performance computing (HPC), Python has a place. I opened with promise of a pair of arguments that then
came together as a form of “proof of case”.
The first argument was to address “high performance” as a term implying the ability to create
correct (and fully tested) solutions to problems quickly and with small amounts of code. The implication
being that high performance is about the ability of programmers to use the tools to great effect. I
emphasized “ceremony”, in particular “low ceremony” and “high
ceremony” as a major factor: “ceremony” here being code that has to be written to
satisfy the compiler that contributes nothing to the code that actually executes. Python is very
definitely a “low ceremony” language associated with the fact that it is a dynamic language.
Traditionally statically typed languages have been “high ceremony” and dynamically typed
languages have been “low ceremony”. The question is whether the drive to type inference in
all the major statically typed languages (D, C++, Java, Scala, Haskell) reduces the level of ceremony to
be equal to that of the dynamically typed languages.
This led to the issue of meta-object protocols (MOPs). All the major dynamically typed languages (Python,
Ruby, Groovy, Lisp, Clojure) have run time MOPs in one guise or another, and this gives them great
capabilities in creating domain specific languages (DSLs) as internal languages. C++ and D even though
they are statically typed languages have MOPs; it is just they are compile time MOPs rather than run time
ones. So there can be no dynamism to the DSL, but they are still very capable of creating DSLs –
just static ones. Although not stated explicitly the issue of internal DSLs leads directly to the idea of
coordination languages, and in the context of HPC to parallelism coordination languages.
I then switched tack to address computational performance as the focus of “high performance” ;
arguably the more traditional interpretation of the term. Python performs badly compared to C++ and
Fortran, generally about 50 to 200 time slower, at least using the CPython
interpreter. PyPy performs somewhat better being 10 to 20 times faster
on the small microbenchmarks I showed that CPython. As ever for me this was calculating a quadrature
approximation to the value of π. The problem is small, embarrassingly parallel and never ceases to be
able to be used for showing issues associated with parallelism in any number of languages. (All the code
for this problem is available in a Bazaar
branch here: feel free to browse or branch, if
you branch please let mw know of any amendments or additions.) Both CPython and PyPy have a global
interpreter lock (GIL) which means no parallel execution of threads at all. This can be got round in
three fundamental ways:
Remove the GIL. This is unlikely to happen in CPython, but the PyPy folk are experimenting with
software transactional memory (STM) as a way of being able to remove the GIL.
Use the multiprocessing package (or Parallel Python) to make use of multiple Python virtual
machines (PVMs) each of which runs a single threaded process.
Use native code PVM extensions for the parallel computations.
Using Python for the bulk of the code, and C for the core loop meant that execution was about the same as
using C for all the application. Thus Python is a high performance programming language. OK, Python is not
going to be used for the computationally intensive part, but it can be the coordination language.
Skills Matter videoed the session,
Fri, 09 Dec 2011
I forgot to upload the slides from my Groovy and Grails eXchange 2011 session and point at them. They are
Remember though not many of them were used. All used code in this Bazaar
Groovy and Grails
eXchange 2011 is as good, if not better, than previous years. The evolution
of Groovy towards 2.0.0, and the imminent release
of Grails 2.0.0 has resulted in an increased energy in the Groovy
and Grails community. I suspect this is founded on the more positive energy in the Java community since
Java 7 came out and the timetable for future Java releases published.
GPars is an integral part of the Groovy and Grails, and
increasingly Java, communities, as it allows folk to harness the increasing parallelism of computers using
Groovy and Java. I ran a
session “Just keep passing the
messages” yesterday 2011-12-08T16:30. The slides were a minor variant on the ones I used for
JAX London, but the use of them was very different and in fact I only used about 25% of them.
Most of the audience were not familiar with actors, dataflows, Communicating Sequential Processes (CSP),
and data parallelism. Everyone did appreciate though that the question “Is Java an object oriented
language?” was actually a deep and non-trivial one. So I skipped a lot of the ranting and
sermonizing and skipped straight to giving a summary view of the various models and showed some GPars code
– though I did retain my ranting against shared-memory multi-threading as an application level
technique. I even managed to run some it to show how GPars really does lead to parallelism, and how
Groovy is slow, but this doesn't matter as long as the computationally intensive tight loop is in Java.
Groovy/GPars for coordination of concurrency, Java/GPars for grunt computation. Yes GPars does have a
The example I used my standard example of using quadrature to approximate the value of π. Even
though I have used it for a while people still report that it remains a good example since it is small
relatively easy to comprehend and allows examples to be comprehensible. So it works! All the code is
available in a Bazaar branch
Feel free to branch, play, and report data back.
Skills Matter videoed the session, you can find
Sun, 04 Dec 2011
End of this week (2011-12-08 and 2011-12-09) is
the Groovy & Grails
eXchange 2011 being held at Skills Matter. Definitely a case
of “Be there, or be square” – or perhaps that should be “if you are not there you
cannot be groovy”, or some such weakly humorous play on 1960s lingo. Kick off is 08:30-ish, so
that'll be 08:30:01 then.
Sadly the conference is two track and I want to go to all of the sessions. I therefore need a volunteer
to be my proxy at the sessions I am not actually at. This is especially important at 2011-12-08T16:15
when I present my session “Just Keep
Passing the Messages ”.
Sun, 27 Nov 2011
120 people turned up yesterday (yes Saturday) for the London Java Community (LJC) annual unconference. I
had intended to be a non-presenting delegate. However when it came time to propose sessions, I could not
resist proposing a lightning talk on GPars and a group discussion
on "Parallelism on the JVM".
I quickly put some slides together for the lightning talk, they are to be
found here. I thought the talk
went well, certainly people came up during the lunch break to discuss various things about parallelism ion
the JVM generally and GPars in particular.
In the end my proposal for a discussion meeting and a proposal for a Q&A panel session got merged, so I found
myself on the panel. The natural direction given the members of the panel was parallelism so that seemed
fine. I thought the discussion worked well.
The conference was excellent. All the session I went to were great. Well done the team for putting on
such a good event.
Thu, 10 Nov 2011
Tomorrow being the 90th anniversary of the British Legion Poppy Appeal, the UK having troops in
Afghanistan, Afghanistan growing most of the world's poppies for the drug trade, one of which is opium,
and having been exposed to the appalling sight of parliament in action yesterday, it struck me that the
political classes really are putting one over on the electorate. Probably everywhere but certainly in the
The pathetic posturing, ranting, and petty point scoring on both sides of this verbal sparring, were awful
enough. I am guessing this is what 19th century school and university debating was like – preparing
the boys of the rich and famous to take on the role of leadership and governance. What was really
saddening though was that the two principles in yesterday's events were women. Instead of evolving
politics so as to be more sane, these women have descended into the worst pit of puerile behaviour aimed
at creating good television ratings that passes itself of as politics in this country.
So rather than bringing a new form of politics, the push to have more women in parliament (in and of
itself a good thing, there should be 50% female and 50% male MPs) has reduced these female MPs to the same
stereotype of a 19th century male MP as the men continue to adopt. An opportunity seriously missed.
I have no idea what can be tried next to bring a more constructive politics, our combative system is about
destruction not about construction – going to war appears to be more important to our politicians
than having an efficacious health system for all the people.
It has been said that democracy is a bad system, but it is better than all the others that have been
tried. If what we in the UK have today is democracy, please offer me something new that hasn't been tried
Lots of people appear to be getting very
excited about tomorrow being 11/11/11 as being something special. Well as 11/11/11, rather than the more
correct 2011-11-11, it is a special pattern. But what is really special is that this is the 90th
anniversary of Remembrance Day. 11th November is Armistice Day every year, and every year we should wear
a poppy as symbol of remembering the carnage and horror of war, and of the mutilation and death suffered
by innocent people and combatants. Even FIFA have relented in recognition of what it means to remember on
Remembrance Day. Do it. You know when – 2011-11-11T11:00+00:00.
Tue, 08 Nov 2011
I have just signed up to do an evening session on 2012-01-31 at Skills Matter entitled “Python is a
High Performance Programming Language”.
See here for the
Skills Matter advert and sign up page. Don't let the Skills Matter short bio let you believe I only work
with Groovy and GPars, Python rocks.
Also don't be concerned that Skills Matter categorize Python sometimes under .NET and sometimes with Scala
and F#. This is because they are just putting together a Python training activity and so there isn't yet
a proper silo for it in their portfolio. If people take up their newly established Python training
activity this will change. cf. this advert
Thu, 03 Nov 2011
I only went to 15 sessions of the total of 40, but given that Day 1 had five tracks and Day 2 had four
tracks, I think it was good going to be in a session at every slot. Sadly though there were at least 10
other sessions I would like to have been at.
The four keynotes were reasonable, with a nice mix of motivational aspects and informative aspects.
Nothing really stood out though, except perhaps that in Simon Ritter's summary of the road map for Java,
JavaFX on Linux is not due till half way through 2013, which shows how much the JavaFX team and Oracle
care about being truly multi-platform.
Given my main interest is concurrency and parallelism, I took in all the session related to that topic,
along with the Java 8, 9, 10, . . . summaries. I didn't hit the Android track.
Of course I have to mention my session: “Just Keep Passing the Messages”,
slides here. This
was really a rant against unthinking use of shared-memory multi-threading as an applications programming
technique, and a plea for applications development folk to learn about and use higher level models such as
actors, dataflow, communicating sequential processes (CSP). I
plugged GPars as a framework that Java
and Groovy programmers can use now to do all this, so they don't
have to wait.
All the other 10 sessions were good, worth attending, and I enjoyed them. The three “stand
out” sessions for me though (other than mine :-) were “An Introduction to Neo4j (and Doctor
Who)” by Ian Robinson, “JavaFX 2.0: Great Interface in Java” by Simon Ritter, and
“Understanding the Disruptor, a Beginner's Guide to Hardcore Concurrency” by Trisha Gee and
Ian Robinson managed to educate everyone attending in the subtleties of studying Doctor Who, including
retcons, whilst really showing that Neo4j is really a unique form of database management system. He
focused mainly on daleks, which was fine as they are clearly a common enemy! Ian mentioned that the
daleks first appeared in 1963-4, which came as a bit of a shock, as I remember watching those episodes at
a friend's house the first time they were shown.
Simon Ritter's presentation of JavaFX 2.0 showed for me that it was the right decision by Oracle to drop
JavaFX as a purely script based system and to transform it into a Java API. This is not because I want to
code UIs in Java, but because it makes it an open system that works well as an integral part of the JRE.
Simon's Java examples were fun, and worked well, but showed that Java is not the right language to
actually write UIs with. I will be using Groovy most likely. The point is that there is not one fixed
language to write JavaFX 2.0, and soon JavaFX 3.0, UIs with. JavaFX 2.0 seems a splendid successor to AWT
and Swing. But of course AWT/Swing UIs can incorporate JavaFX bits, so people can use evolutionary rather
than revolutionary development. Personally I will just dive straight into JavaFX 2.0, but only when the
Linux version is released so that UIs can be platform independent: Windows, Mac OS X, Solaris, and Linux.
Trisha Gee and Mike Barker's session stood out since above all it showed how to do some real science when
engineering a solution to a problem. Their problem is to process vast numbers of messages with various
transformations of data needed. They showed, via experimental evidence, that standard approaches to
concurrency and parallelism we insufficient to the task. Indeed employing parallelism made things slower
for their problem compared to a simple single threaded solution due to all the overheads associated with
the concurrency and parallelism tools. Here we are not just talking of Java and JVM overheads we are
talking of JIT generated assembly language and processor cache line management. I am used to C++ folk
worrying about cache lines, it was inspiring to have Java folk seriously worrying about these things
entirely appropriately. They then showed how they had analysed various data structures, reasoning with
the Java memory model, and experiments probing the JIT code generation, to write a lock free ring buffer
that is the data structure at the heart of the Disruptor. Opinion not necessary, the experimental data
shows they have been massively successful.
I will be submitting a session proposal to JAXLondon 2012.
Tue, 01 Nov 2011
Having just been to Ian Robinson's talk on Neo4j, where he presented significant quantities of Dr Who
data, I am sensitized to time travel. I am therefore loading the slides for my talk before I give it
rather than after. If I change the slides between now and then, there will be a retcon.
"Just Keep Passing the
Wed, 19 Oct 2011
OK so here I am sitting in a restaurant in Salford Quays, aka MediaCityUK, aka BBC North's now home, on my
tod, and bizarrely finding myself reflecting on personal history. In particular, at the moment, wondering
how the heck I am in the position of presenting Python training courses (*). For some obscure reason I am
transported back to a lecture room at UCL, sometime around 1985, where I was presenting one of a 30
lecture course on Software Engineering. I recollect in particular two faces, one I shall label Winnie
Pun, the other I shall label Martin Fowler. The question in my mind is: is Martin Fowler Martin Fowler?
Winnie Pun I know to be Winnie Pun as she subsequently undertook, successfully, a PhD with me as
supervisor. But is Martin Fowler Martin Fowler?
I remember a number of conversations in the corridor between the aforementioned lecture room and John
Washbrook's office involving John Washbrook, myself and the individual I have labelled Martin Fowler
– who may or may not be Martin Fowler.
I then skip across the Paradigm Wars (object-oriented vs. functional), various OOPSLA
conferences involving drinking sessions with Bruce Anderson trying to kick start the pattern movement
(cf. OOPSLA 1990 and 1991), and workshops with Kent Beck on "what is an object?" (cf. OOPSLA 1990), but I
come back to: is Martin Fowler Martin Fowler.
What is really at the heart of this angst is: have I done enough real world work with Java, Python, Groovy
to be able to teach Java, Python, Groovy? In 1985 I had had so little experience of actually doing big
systems development, that my lectures were basically entirely theoretical based on published work by
people who had even less practical experience than I had – is this a synonym for bullshit. I had at
least been a successful UNIX systems programmer before becoming an academic. I continue to wonder if any
of the people writing about software engineering in the 1980s had any actual experience of doing it at
all: far too many of the 1980s software engineering community clearly had absolutely zero real experience of
developing systems. How can anyone who has not done something for a period of time even pretend to be
able to teach that something?
OK, a necessarily rhetorical question in reality. Or perhaps not...
If Martin Fowler is indeed Martin Fowler, did he realize at the time I was lecturing that it was all
theoretical waffle or did that realization only come later?
There is a flip side here: being an effective teacher/trainer is a skill in itself. A good
teacher/trainer needs some real experience, but do they need more than is required to have empathy with
the practitioners and what it is they do? Or is this just self-involved double-think?
I guess the real question here is what gives a person the right to be considered as, and consider
themselves as, a guru on a given subject. Does being a guru allow one to pontificate? Or even
teach/train? What balance of practitioner and teacher/trainer is the right one? Oh and is Martin Fowler
(*) Now don't get me wrong, I really like Python and presenting training courses on Python. Not only do I
like doing this sort of thing, I like the income it generates :-)
Fri, 07 Oct 2011
The Scala user mailing list regularly and seemingly increasingly frequently has debates about attitude.
This is not just about the attitude of the theorists to the pragmatists, it is about newbies to oldbies,
trainers to practitioners, etc. Ultimately though, at the core, is the functional programming versus
object oriented programming debate. The difficulty is that this is not being debated in a programming
paradigms context alone, all the alignmnets of people on all the dimensions are conflated. A posting by
I don't really buy into the "two worlds coming together" thing. There aren't two worlds -- it's an
illusion -- a destructive one in my opinion. The issues at hand are so easily resolvable and indeed,
they are regularly resolved for certain individuals. It's comes down to a matter of what is important
prompted me to write the following, initially as an email to the list but also as this blog entry
– which is a slightly amended and extended form from the email. I agree with Tony's view that the
way forward is possible and should be trodden, but I disagree with him saying it is an easy technical
matter. It isn't. It is about the social structures arising from 30 years of Paradigm Wars.
In the UK at least, there is very much a "two worlds", at least historically. In the 1980s, the functional
programming (FP) folk set themselves up as people involved in the only form of computing that mattered.
They got into positions of research power and hence research funding. But they became insular, and indeed
dismissive of the non-declarative forms, e.g. object-oriented (OO). Also they did not worry about being
relevant to folk making money from software. As OO rose in the late 1980s and early 1990s, the OO folk
became an equally arrogant and insular crowd, who were as dismissive of non-believers as the FP folk were.
The FP crowd began to demean the approach of being relevant to industry and commerce, a line being trodden
by the OO folk. Both sides made jokes about any integrative work, cf. FOOPlog.
There was a real Paradigm War. You were on one side or the other, the two could never merge, cf. making
FOOPlog the butt of jokes.
End result: C++ and Java are the only programming languages that matter in an industrial and commercial
setting, with a smattering of C for the embedded systems folk. OO won the battle and the war. At least for
the hearts and minds of CEOs, CTOs, CIOs and entrepreneurs. Not to mention the VCs.
C++ though led the way for the comeback of FP. The STL opened the door to a more FP approach to data
structures in an OO world. Moreover template meta programming is FP.
Simon Peyton Jones (with Simon Marlowe) has been putting Haskell "out there" not just for its FP purity but
because it can be made to be industrially and commercially relevant in an increasingly parallel world. Old
views of concurrency are (finally after 40 years) almost irrelevant in the post Multicore Revolution world
of ubiquitous parallel processors, involving many different hardware architectures.
Nonetheless there is a underlying and pervasive "two worlds" mentality. People are being engaged by the
ideas of FP, are even looking to Haskell as an alternative to OCaml (which has a global interpreter lock
(GIL) and so is problematic). Yet unless the there is a connection to C++ or Java, languages do not get
actually used and hence absorbed into "real world" use.
It is not clear where the future is for native code, is it Go, is it C++, is it a merge of Miranda and C++
totally unlike the Objective-C mashup of C and Smalltalk?
On the JVM there is a much more obvious route given Groovy, Jython, JRuby, Clojure and Scala. Integration
is available for free on the JVM, unlike the attempt via p-code 40 years ago.
Scala is in a position to bring the "two worlds" together in association with the Groovy, Jython, JRuby
and Clojure communities. By not acknowledging that there really are, from a social perspective, "two
worlds" out there, then the opportunity to create a new computing fit for the ubiquitously parallel world
will be missed.
Fri, 16 Sep 2011
Last Wednesday evening I did my talk about
GPars to the BCS Edinburgh Group. I am not sure whether the audience was bigger or smaller than
usual, but most of the chairs set out in the room were taken, so about the number the organizers expected
turned up. The biggest problem was not the projector, which seemed to “just work”, it
was that the lectern was facing the wrong way, and so not usable, and the video cable wasn't long enough to
reach a good place to talk from. Nothing the meeting organizers could do about it, but something the
venue folk really ought to look to. In the end though a minor inconvenience.
For some reason or other, almost certainly a figment of my imagination, I had the belief this was
to be a 90 min session and had planned accordingly. In reality the organizers were expecting 50 to
60 mins of presentation, with a hard deadline of being out of the building 89 mins after the
session was due to start! Not a disaster, or even really a problem, but it meant rearranging the code
presentation part of the session on the fly to just pick out the core highlights rather than the lengthier
flow originally planned. Or to put it another way: sorry to the audience for a less than smooth
presentation of the code.
Having said that, the audience reacted in the expected ways at the expected points in the session, and the
questions and points raised were all on point and perceptive. Also the conversation at the adjournment to
a local hostelry was good. I enjoyed it all, I hope the audience did.
Oh, and I finally got to meet one person I have been having email exchanges with for four or five years
and another person I have been emailing with for two or three years without previously having met them.
It was great to finally meet them both. It must be said though that the photos on the Web do not make it
entirely easy to recognize them!
A PDF file of the slides I used for the session can be
Thanks to Seb Rose for the invitation, and to whoever sacrificed whatever to ensure a dry and sunny two
days to ensure The Royal Mile etc. was at it's best for September.
Fri, 09 Sep 2011
OK so I am referring to a report of a report of a report,
article on The Register makes it absolutely clear that
racketeering is not only legal but a whole business strategy when you have software patents.
Microsoft claim, but have never put to the test, that they have software patents that are infringed by
Linux. Without facts, we have just FUD. FUD is though that which you can threaten people with.
Microsoft are now bullying and cajoling manufacturers of Android-based equipment into signing protection
deals, sorry IP licences. Since Microsoft have no input at all into the development of the software that
is the focus of the deal, there can be no maintenance contract involved. It must be purely to do with
software patents. Yet there is no proof that the patents exist, let alone apply to Linux. And even then
this would only apply in those jurisdictions in which the patents have been taken out and approved.
Microsoft are clearly executing a protection racket, there can be no other word for it. Yet this
protection racket is actually legal since it involves state approved monopolies, i.e. patents. So what
we have here is state sponsored crime. Should the US government be put on trial for sponsoring crime?
Won't happen of course – patents are tools of business, not of crime, and it is these businesses
that keep the politicians in their positions of power.
Perhaps the Mafia should invest in a portfolio of software patents and thereby make their protection
racket operations entirely legal?
Endnote. This article
on Groklaw is interesting. Further reasoning as to why software is
mathematics. Mathematics cannot be patented – well not yet, I am sure some big business will start
making inroads on this soon. Till mathematics can be patented it would seem software cannot be patented.
On the other hand try telling that to the big business who are making shed-loads of money from either
extortion relating to, or licencing of, software patents.
Thu, 08 Sep 2011
Repeat announcement since it is now under a week away. Which means I probably need to think about
writing the talk :-)
I am doing a session with the above title for the BCS Edinburgh branch on 2011-09-14 at 18:30,
unsurprisingly in Edinburgh. Details are to be found on their
Fri, 19 Aug 2011
In our “quite surprising” section: T-Mobile 3G mobile Internet now recording 1.38Mb/1.1Mb.
That upload speed is really quite competitive.
As I have ranted about previously, Vodafone claim they have excellent 3G signal in B21 8EQ, and yet there
is provably (by experiment) absolutely no 3G signal at all. Vodafone really do need to reconsider what
their coverage map is saying, it clearly looks like an assumed expectation, rather than an experimentally
I decided therefore on this trip to B21 8EQ to try other network operators. I purchased a T-Mobile dongle
from the still open (this is a significant observation a week after the Clapham Junction “looting
with serious violence” incident) and busy T-Mobile store. I was also going to get an Orange and a 3
dongle so as to compare. The 3 shop was trashed by the “looting with serious violence” of
last week and was closed, whilst the Orange shop was pristine but no customers. The 02 shop was also
trashed and closed. I took these observations as a sign and went to Carphone Warehouse for a 3 dongle.
There are two Carphone Warehouse shops in Clapham Junction, both had been trashed in the “looting
with serious violence” but both were in good state, open and busy.
After an uneventful, but extremely wet, drive to the B21 8EQ destination, I was eager to try things, so I
did. Knowing that 3 block port 25, whereas Vodafone and T-Mobile do not, I tried Vodafone first. Why did
I bother? Very little 2G signal and definitely no 2.5G, 3G or 3.5G signal. T-Mobile next. Very weak 3G
signal but connection made. speedtest.net reported 0.6Mb/0.1Mb. Fairly poor. Then it dropped out to
2G. Very poor. But at least they allow HTTP, IMAPS, SSH, and SMTP. Next up 3. Poor signal but
definitely 3G, speedtest.net reported 1.2Mb/0.3Mb. But no port 25 and I need SMTP. Bed time.
Next morning I try things again and put the dongles on the other side of the laptop. 3 gives 3.2Mb/0.6Mb.
Healthy. T-Mobile 1.4Mb/0.6Mb. Passable. T-Mobile allows SMTP so wins – hands down.
Summary: Vodafone, get your act together and stop lying to people, and actually get 3G to where you say
you have it. O2, care more about your business. 3, care more about you business, and get your act
together and open port 25. T-Mobile get your act together and stop over-profiling TCP/IP connections.
PS Oh for a globally accessible WiFi, at a non-extortionate price.
PPS Why is mobile Internet so poor in the UK?
Mon, 08 Aug 2011
There has been an increasing number of articles recently coming out against software patents. The latest
that I have seen are Martin Fowler
Feld. I guess my problem is that the whole situation is simply depressing, not only of me but also of
innovation in software. The actions that Lodsys are bringing (see for
archive) against developers of smartphone apps is clear indication that patent trolling is going to
kill small company and individual software developer activity, leaving the field clear for the huge
corporations to be the only organizations able to develop new software. This will definitely lead to a
significant lowering of innovation. This is not because large corporates don't innovate, they do, but the
pace of their innovation is driven by commercial pressures not by the ability of technology to support new
and novel ideas.
What makes it all worse is that the situation is a self perpetuating one. Given that legal costs
generally exclude individual software developers and small and medium size enterprises (SMEs) from any
form of legal activity – be it offensive or defensive – the only players are the big
corporates. Big corporate either have large patent war chests, or they have to buy them. Notice this is
exactly what Google is having to do as a protection from Apple, Microsoft, and many others. If you don't
have patent war chests, then when an organization with a big patent war chest decides to attack, you have
no form of defence – there are only three forms of defence against a (assumed) valid patent attack,
and that is either to have patents for a counter attack, leading to a cross-licencing deal, to have enough
money to win in court against all comers, or to get the patents found invalid. Sadly this last relies on
the judges ensuring cases are only heard after challenges are made to patents, and so is very unreliable
– as Google and others are discovering.
The upshot of all this is that big corporates have to have patent war chests to stay in the game. Google
is proving this. It means there is no way of stopping patents being the tool of business.
In some areas patents can actually be sensible: Dyson's cyclone technology for vacuum cleaners springs to
mind. There is an application of physics leading to a new and novel technology for which the inventor
deserves some protection so as to recoup development costs and make a profit. Less clear cut are drug
formulas. New drugs cost a lot of money to research and develop, there needs to be some guarantee on a
return on investment. So having patents on the formulas seems like a good idea. Of course, patent
holders then charge extortionate amounts of money for their drugs especially to captive markets,
e.g. the National Health Service. There needs to be compromise between using patented drugs, generics,
encouragement of research and innovation, and profit margins.
Then there are user interfaces. Should these be patentable? My instant answer is no, and despite some
issues, I'll stick with this. The problem is the Apple problem: Apple has spent many years building up a
brand image based on certain user interface styles, architectures and techniques. Their brand deserves
some form of protection from “knock offs”. It is just not clear that patents are the right
tool. The whole of business processes really come under this heading as well. Why should processes be
patentable? Are they ideas or inventions? Well they are both, but patents relate to physical artefacts
not to ideas. So user interfaces should not be patentable, but products employing them should be. There
must be a way for the lawyers to enshrine this in law?
Finally for this piece, software. I have no problem with software embedded in a physical artefact having
the protection of patents. I have a huge problem with patents on software itself and software techniques.
The obvious one I have used before in the patent of linked lists. Why should anyone have a patent on this
idea. True these ideas have to be invented, they are inventions, but they are actually just new ideas
explained in source code. By all means patent products using such ideas, but not the ideas themselves.
Of course the problem is that now software patents are an integral part of the USA way of business, they
are immovable. The efforts of the USTR to force all signatories to ACTA to have software patents means
all ACTA signatories will have to have USA style software patents. This will kill innovation dead. How
can it be stopped? Only by direct political intervention. Big corporates cannot now get out of the game,
indeed they have to get into the game – cf. Google. Politicians can put a stop to this, but will
they? They seem to have been caught up in the web of power being pushed by the agents behind ACTA, a tool
for big corporates to maintain control of brands. (Not a bad thing per se, but some of the side effects
inserted into the tool are.) Moreover politicians have to be funded, this is generally by large
corporates, and the politicians then basically have to support the business interests of their funders.
We have Catch-22. The upshot seems to be that software patents cannot go away, even though they kill
innovation. Time perhaps for all software developers to give up interesting things and get jobs with the big
corporates? As I mentioned earlier perhaps depression is an appropriate state of mind?
Footnote: Only one person I know is a supporter of software patents. I think he is wrong, but he is
entitle to his opinion – albeit wrong :-) He is though very clear that he thinks that the current
system is broken. Patent trolls need to be removed from the system, and the granters of patents need to
stop granting clearly stupid software patents. You know, if the system actually did this, there would be
an awful lot less objection. Still wrong, but less so.
Sat, 06 Aug 2011
UPS batteries have a short life, 3–6 years on average. The usual indicator of a failed battery
is a failed UPS self test. Till last evening, I had purchased a new battery immediately on a self-test
fail, had it arrive next working day, installed the new one, and taken the old one to the recycling
centre. No dramas, just a period of tension between old battery fail and new battery fitting, in case of
Last evening was special. Self test fail, new battery ordered, enter tension state as always. Then
something new, horrendously nasty smell, and unusual irregular beeps from the UPS, not to mention the
batter charge lights going off and coming on. So I turned off all the equipment, and found that the whole
UPS casing around the battery was too hot to touch. I let it cool overnight, to discover the battery
casing was severely mis-shapen. The previous evening the battery had got so hot it had started melting
its casing. It is a good job the human olfactory sensors detected the problem, it seems the UPS internal sensors
didn't have this as a use case.
Thu, 04 Aug 2011
I forgot to add a link to a PDF of
the slides I used for my
session “You Need to Know
Python” at Skills Matter 2011-08-02T18:34+01:00 in my
previous posting. The first link in the previous sentence rectifies this omission.
Tue, 02 Aug 2011
I presented an “In the Brain” session at Skill Matter last
evening. It was initially intended to be focused on Python and why it is a real “must learn”
language – hence the title You Need to Know Python. However it became more a Python in
context sort of session.
I had initially assumed most people would have a little familiarity with Python, but it became clear
fairly early on that there was a very wide ranging experience of Python, from the very knowledgeable to the
“haven't tried it yet”. I therefore changed the content of various parts of the session on the
fly. This is why there might have appeared to be a few discontinuities, well more than usual anyway.
As ever Skills Matter videoed the session and have already uploaded it, you can find it
I enjoyed the session, and various people came up afterwards and said how much they enjoyed it. So
overall a success. Thanks to everyone who came, especially those who chipped in and made the session
interactive. Thanks to Skills Matter for hosting the event.
Tue, 19 Jul 2011
Given the tone of the writing
article about Apple winning a patent judgement against HTC, the author gives all the evidence of being
a shill for an interested anti-Android party (probably either Apple or Microsoft). Putting aside all the
emotive stuff (which is almost certainly just FUD), there is the point that two patents have been cited
explicitly. Both of these are on Google Patents:
- US Patent 5,946,647
- US Patent 6,343,263
Read them and fear.
Admittedly on a relatively cursory glance, and remember I am not a lawyer, just a person who does expert
witness work, it would seem that Apple have US patents covering all software that manipulates data
structures (5,946,647) and all devices that do real-time signal processing (6,343,263). Ok that seems to
mean all software and all signal processing hardware are covered by these patents and so royalties are due
to Apple for every sale of such a thing in the USA.
One has to hope that HTC files for re-evaluation of these clearly over-broad and obvious patents. I would
suggest little need to find prior art to invalidate the patents (though I bet there is a real mass of that
– every bit of software written and every digital electronic device created before 1990 really),
they fail on these other grounds. Why were the US Patent Office (USPTO) issuing such obviously over-broad
and obvious patents? I assume because that is part of the way of business in the USA. The USPTO issues a
patent if the paperwork is in order, and allows the courts to decide everything else – thereby
making the lawyers rich and everyone else not.
If USPTO had sent these patent filings to any sort of expert in the domain, the patent would not have been
granted. So whatever you believe about the rights and wrongs of software patents – personally I am
anti – it must be agreed that the USA software patent system is out of control, indeed broken. Will
it get fixed? Clearly not if Apple, Microsoft and IBM have anything to do with it. These are the tools
of protectionism for USA big organizations. They won't now give them up without a huge fight, one the USA
government are unlikely to have an appetite for. Sadly.
Don't forget though the USA, via the USTR (USA Trade Representative) are trying to impose the USA system
of patents on the rest of the world via ACTA (Anti-Counterfeiting Trade Agreement) . We really must fight
this patent imperialism.