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
is http://www.russel.org.uk/Git/ParalysedByParallelism.git,
if you just want to browse without cloning then you want to
go here.
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
free apps.
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?
|> ifconfig
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
collisions:0 txqueuelen:1000
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
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:20 Memory:f2500000-f2520000
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
collisions:0 txqueuelen:0
RX bytes:11639041 (11.0 MiB) TX bytes:11639041 (11.0 MiB)
|> route
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 87.127.116.10
;; 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 (87.127.116.10), 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
again.
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
programming language.
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
found here,
I get the following results:
- CPython:
==== Python Sequential For/Xrange Multiply pi = 3.14159265359
==== Python Sequential For/Xrange Multiply iteration count = 10000000
==== Python Sequential For/Xrange Multiply elapse = 5.83972406387
- PyPy:
==== Python Sequential For/Xrange Multiply pi = 3.14159265359
==== Python Sequential For/Xrange Multiply iteration count = 10000000
==== Python Sequential For/Xrange Multiply elapse = 0.224266052246
- Jython:
==== 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,
see here.
Fri, 09 Dec 2011
I forgot to upload the slides from my Groovy and Grails eXchange 2011 session and point at them. They are
now here.
Remember though not many of them were used. All used code in this Bazaar
branch
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
Java API!
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
at http://www.russel.org.uk/Bazaar/Pi_Quadrature.
Feel free to branch, play, and report data back.
Skills Matter videoed the session, you can find
it here.
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
UK.
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
yet.
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
Mike Barker.
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
Messages" 16:20--17:10
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
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
Tony Morris:
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
to whom.
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
found here.
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,
but this
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
website here.
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
determined fact.
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
and Brad
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
example Groklaw's
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
power problems.
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
at: http://skillsmatter.com/podcast/scala/need-python
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
in this
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.
Fri, 15 Jul 2011
As some people will already have seen from the announcements on Twitter, I have teamed up
with Skills Matter to provide a Python training activity. The
initial public courses are workshops for people who have some programming experience, but little or no
Python experience –
see this
page for details. I am sure, over time, there will be a demand for my intermediate, and possibly even
advanced workshops.
Although this activity is new, the courses themselves are not. I have been presenting Python training
since 2006 – and a Python user for many years before that. The courses are not of 5 year old
material though. After each presentation, the courses are reviewed and updated in the light of the
feedback from the presentation, and the state of the Python world at the time. So the material undergoes
continuous evolution to stay in tune with the Python language, its philosophy and its practical use.
If you fancy coming on one of these courses contact the Skills Matter sales folk by phone on
+44 20 7183 9040. Or even drop me an email.
If you spot anything you think is wrong or missing in the advertised course, please send me
an email.
Wed, 13 Jul 2011
I'll be 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
website here. I repeat the marketing
blurb here:
In the beginning, a computer had but one processor and one memory and programmers knew what to do.
Unless of course their program involved concurrency, in which case they had to learn about locks and
sempahores and monitors and all manner of things arcane, and indeed, obscure. But there were great
minds at work and as well as many “toy problems” to help programmers learn how to use locks
and semaphores and monitors, many new higher level applications structuring models were invented: Actor
Model, Dataflow Model, Communicating Sequential Processes (CSP) – to name but three. Sadly these
models were eschewed by the mainstream, who convinced themselves, and nigh on everyone else, that
operating systems techniques of shared-memory multithreading were a necessary evil of applications
programming. And concurrent programming was deemed hard. And parallel programming harder, even when
using frameworks such as MPI.
Then we had the Multicore Revolution, which started about 2004 and will continue for many years yet.
This brought parallelism from the upper stratosphere of high performance computing (HPC) to the very
heart of the mainstream. Worse, processor clock speeds stopped their even increasing rise, terminating
the free ride of ever increasing performance of single threaded programs. So mainstream programming had
to learn how to do concurrent and parallel programming, and they said it was hard, which it is.
Fortunately some remembered the old models, and they were revived, and given new life. And the models
prospered, as it is increasingly clear to all programmers that shared-memory multithreading is indeed
very hard, and should not be used for applications programming, except where direly necessary
GPars is a Groovy/Java framework that brings Actor Model, Dataflow Model, CSP, Agents and other
interesting high-level program structuring tools to the world of Java and Groovy programming. In this
session we will look at some of these tools and techniques, and indeed idioms, and show that concurrent
and parallel programming can be easy. Indeed it can be fun, which is a necessity for good programs.
Thu, 07 Jul 2011
In this world of a plethora of programming languages, where new ones seem to appear on a weekly basis, C,
C++ and Python have been, and remain, the main non-Java Platform
languages. Even on the Java Platform there is Python, in the form of Jython. Gnome emphasizes C, C++ and
Python, as does Canonical and many other organizations. The Python Software Foundation is definitely pro
Python. Why is Python so "front and centre" and high profile? What makes Python so strong, used and
loved as a programming language?
Even though Python is over 20 years old, it has evolved to stay modern and relevant. This is especially
poignant given the Multicore Revolution that has caused so much change in C++ and so much distress for C.
How does Python, a fundamentally sequential system in is CPython form, deal with the parallelism of modern
hardware?
These questions, and I have no doubt many others, will be investigated in a free event I am running at
Skills Matter at 2011-08-02T18:30+01:00. To sign up go
to this URL.
If you don't sign up, we'll send Monty the Python round to put the squeeze on you.
Sat, 02 Jul 2011
This paper by James Bessen has
stirred up the world somewhat regarding software patents – and a good thing too. As well as this
Groklaw article (it's also
worth looking at this one about
the proposed changes in the US patent system), it even got to be
a Slashdot
article
The headline from the Bessen article is that small companies do not generally obtain patents, whereas
large companies get them by the truckload, and that this is bad for innovation.
In the UK, software is not patentable per se, neither are algorithms. Bessen states that the case In
re Alappat was the one that changed the nature of things in the US system, and allowed software and
algorithms to be patented. Let us hope that the UK and EU do not allow the US to bully them into allowing
software patents, and especially not via the tool
of ACTA. What would be
even worse of course is the US bullying the UK and EU to accept US patents as valid in UK and EU. This
would likely kill small business software development stone dead. And UK software innovation would go out
with it. Remember the US strategy is to support US development not to foster UK development.
What is the problem? Well a patent is enforceable even if the person violating the patent didn't know
about it. Say you write some proprietary software and guard it as a commercial secret so there is no
publication. Say a patent troll wants to target you. They find one of their seriously general patents
which is bound to have been violated, cf. the
patent on
linked lists as an obvious example, they get an injunction to have your source code analysed to see if
it is in violation. Along the way they will of course find others of their patents that might apply, and
now they have access to your software,they can do lots of research on it. They then threaten to take you
to court unless you pay licencing fees. At this point the issue is one of extortion (normally
considered a criminal offence, and yet completely legal in the world of patents), you either suffer the
indignity of paying licencing fees or you fight the case in court. Either way you lose financially. And
most small companies cannot afford to go to court, it is simply too costly. So they either pay the fees
or go into liquidation. Or sometimes, get bought by the patent holder for a trivial fraction of the value
of the company.
So the situation where potential innovators do not play the patent trolling game but big companies do,
means either potential innovators avoid any area that might be seen as competition to the big companies or
they develop simply to sell to the big companies (not to create their own business). The big companies
thus drive the agenda, usually for their own ends, and genuine innovation is sacrificed at the altar of big
company profits and stock price.
The conclusion is inescapable: software patents destroy innovation in software development. Anyone
professing to support innovation, must therefore be against software patents. Yet the UK government is
towing the US party line and supporting ACTA and hence software patents. Clearly the UK government
wishes to terminate all software innovation in the UK.
Sadly though software patents are now an integral part of the US business model. Witness the way
Microsoft is using its unnamed patents as ammunition to force companies making Android phones pay licence
fees for what it claims is its intellectual property. What intellectual property can Microsoft possibly
have embedded in the Android system? Microsoft has made no contribution to Android and Android is not
based on any Microsoft technology. Microsoft of course will not say and the contracts of licencing
require silence from the licencee. This is definitely a “shakedown” operation by Microsoft.
Although in any other area than licencing patents this sort of extortion would be illegal, with patents it
is a valid business operation. So you can't blame Microsoft for employing valid business tools even if it
is evil and objectionable.
Clearly the “conspiracy theory” goes along the lines of: Microsoft are trying to validate
claims they will eventually take up against Google and Oracle, by having a lot of small companies already
signed up as licencees. The eventual goal is clear, Microsoft are failing to keep their position in the
market by creating new and possibly innovative products, so they are turning to software patent trolling
as a way of generating an income stream from other people creating new and possibly innovative products
– well at least products that people want to buy, in increasingly large numbers.
It would be good for the US government to put a stop to this software patent trolling business so that
everyone can get on with innovating and letting the market decide who makes money and who doesn't.
Software patents are a tool of protectionism, indeed a protection racket. It is a mechanism for squashing
innovation. Let us hope the UK and EU governments recognise this and do the right thing for innovators.
Make it clear that software and algorithms are not patentable, and let the innovation start.
Mon, 27 Jun 2011
A few days ago, Debian Testing changed its Linux kernel from 2.6.38 to 2.6.39. My Wifi connection between
Lenovo X201 and Lenovo T500 laptops and the Netgear DGN3500 suddenly stopped working. Oh it would start
fine and the laptops would connect, then a short while later, or sooner if there was a steady heavy load,
the Netgear would crash requiring a power cycle – even the HTTP server console froze. This never
happened with 2.6.38.
I reported this problem to the Debian
bugtracker only for the bug to be immediately closed as "So there's a bug in the router". I beg to
differ that it is so certain. Anyway the triager has agreed that should the evidence become more than a
single data point, then the bug would be reopened and a message sent upstream that there is a problem.
Personally I think the iwlagn folk in the Linux development community really ought to be very interested in
the problem that has suddenly started occurring.
I also reported the issue to the Netgear
forum – I had forgotten how much I hate fora, email for me any day. Someone has also spotted
someone having a similar problem with a different Netgear router, and a different distribution, but the
same Linux 2.6.39.
I tried some experimentation varying the WiFi connection speed on the Netgear and varying the kernel
version. I also tried Ubuntu Natty as well as Debian Testing, both the 2.6.38 kernel and 2.6.39 kernel
– Natty only has a 2.6.38 kernel as far as I can tell.
-
The 2.6.38 kernel works fine with the router at “upto 270”, “upto 130” , and
“g only”.
-
The 2.6.39 kernel fails to work after a period or with higher loads at “upto 270” and
“upto 130”, but works fine at “g only”.
The deduction from this is that something has changed in the 802.11n aspects of the 2.6.39 kernel that
either:
-
has diverged from the standard as implemented in the router; or
-
has corrected a divergence from the standard, that is incompatible with the router.
I am sure there are other possibilities, but these seem the most obvious.
I would have thought the Netgear folk would be investigating this now that two separate people have
reported it independently on different Netgear devices. Also the Linux/iwlagn people really ought to be
interested as to what change they made that is causing this problem to exhibit. We shall see.
Sun, 26 Jun 2011
A small postscript to the previous post: I get the following stats:
+----------------------+-------+-------+
| Name | Files | LOC |
+----------------------+-------+-------+
| Controllers | 1 | 7 |
| Domain Classes | 1 | 10 |
| Services | 1 | 11 |
| Unit Tests | 3 | 27 |
| Integration Tests | 1 | 15 |
+----------------------+-------+-------+
| Totals | 7 | 70 |
+----------------------+-------+-------+
The Unit Tests are not listed in the book. So removing them I have 43 lines of code, which I think
compares well with the 55 in the Smith and Ledbrook book :-)
ACCU is running a mentored developer project
on Grails using the Grails in Action book by Glen Smith and
Peter Ledbrook. The place to start is Chapter 1 which is a rush through the main concepts of a Grails
application. I did it once using Emacs and command line. Thought to try the whole thing in Eclipse using
STS, but never got to that before moving on to Chapter 2. This is a set of notes based on me redoing the
Emacs and command line sequence, to provide notes for someone.
Installed Grails 1.4.0.M1 to a place and ensured an alias to the right place so that grails works from the
command line.
"grails create-app qotd" works fine. If this is the first time of running grails it seems very slow as it
is downloading stuff -- I wonder what happens if you are not connected to the Internet? – and it
seems extraordinarily slow in this case if the filestore in NFS mounted rather than local disc.
Fortunately this delay all seems to go away if grails has been used before.
"cd qotd", "grails run-app" work as expected. Very seriously slow starting up on NFS mounted filestore compared to
local disc. Finally decides to load resources, hibernate, tomcat, and jquery.
Am seeing lots of Gant output :-) (wander
around http://gant.codehaus.org and the source code to get the point).
Finally Grails is ready and . . . after a long delay . . . the expected Grails page shows on
http://localhost:8080. Doesn't look anything like the image in the book of course as this is Grails 1.4 not
1.1, which is what was used for the book.
Grails and Groovy community seem to favour Git over any other version control system, so rather than fight
the community by using Mercurial or Bazaar, decided to use Git. Followed the instructions at
http://www.grails.org/Checking+Projects+into+SVN#Adding%20a%20new%20project%20to%20Git Methinks this
should be a separate page, and there should be stuff for Mercurial and Bazaar as well – Git is not
mandated by Grails. Then found out about https://github.com/github/gitignore/blob/master/Grails.gitignore
so used that instead. It seems that Grails deals with IntelliJ IDEA as well as Eclipse.
OK, ready to move on, so create a controller: "grails create-controller quote" seems to do the right thing
but slow on NFS mounted filestore. This comment about NFS mounted filestores comes up at all stages, so I
shall now assume you appreciate this.
Added the home closure (Groovy calls them closures, but technically they are not, they are lambda functions
-- the Groovy community knows that they are abusing the jargon term but it's all too late now :-( Grails
notices the file change and compiles the file but there is an error of some sort. "Failed to reload file".
This is reasonable as the file didn't exist when Grails was started, so a restart needed.
Did I mention how slow Grails is to start on NFS mounted filestore?
Anyway success. Added the index redirect. Updated file compiled and seemingly reloaded. Redirect works.
Excellent. Commit.
Added Emacs backup files to the Git ignore list.
Added a view and it worked!
Added the style template. Begin to wonder if SiteMesh is really worth it. Now discover that snazzy.css and
logo.png are not found. Reasonable really, the default Grails project shouldn't contain them! The book
really ought to say something about putting these things in the web-apps directory. I didn't think I'd have
to do a Grails restart but I did. Then discovered snazzy.css refers to three other image files
background.png, logo_background.png, and menu_background.png. Found versions, put them in . . . failure.
Restart Grails again. I get the feeling that adding any new file requires a restart.
Onto domain models. "grails create-domain-class quote" works fine. Listing 1.10 is slightly wrong, don't
use what is printed there ("jdbc:hsqldb:file:devDB;shutdown=true") instead use "jdbc:h2:file:devDB".
Short-circuited the loading of the database by writing a Groovy script and then executing it in the Grails
Console. Noted that qotd.Quote has to be explicitly imported, which the book doesn't mention.
Did I mention things are extraordinarily slow over NFS mounted filestore?
Apparently Grails not finding jquery at this point is not a problem.
Amended the controller to present a random message. Worked fine. Can't say I like the coding style of
Listing 1.12, far to imperative and not nearly declarative enough.
def random = {
def allQuotes = Quote.list ( )
[ quote :
( ( allQuotes.size ( ) > 0 )
? allQuotes[ new Random ( ).nextInt ( allQuotes.size ( ) ) ]
: new Quote ( author : 'Anonymous' , content : 'Real Programmers don\'t eat much quiche.' ) )
]
}
Scaffolding gives a CRUD interface by adding a single line to the controller. Magnificent.
Noted that all entries created via the scaffolding are created at 00:00 -- how to add a time to the date
of creation?
Grails gets confused by the .#Quote.groovy file created by Emacs.
Added constraints, but the screen doesn't quite look like the one in the book, no time, just a date.
Created the service, spotted error in book, path shown is grails-app/services/QuoteService.groovy but
should be grails-app/services/qotd/QuoteService.groovy
The field transactional is not in the default service as in the book, presumably a 1.1. -> 1.4 change.
Listing 1.15 still hideously imperative and insufficiently declarative.
class QuoteService {
boolean transactional = false
def getStaticQuote ( ) { new Quote ( author : 'Anonymous' , content : 'Real Programmers don\'t eat much quiche.' ) }
def getRandomQuote ( ) {
def allQuotes = Quote.list ( )
( ( allQuotes.size ( ) > 0 )
? allQuotes[ new Random ( ).nextInt ( allQuotes.size ( ) ) ]
: getStaticQuote ( ) )
}
}
Started adding the tests. Spotted that the code listings had the wrong class names QuoteService Tests
should have been QuoteServiceIntegrationTests. I hate * includes, not sure why but I do. the Grails
template integration tests is full of them. Also of course the book is using Grails 1.1 and hence JUnit3
whilst Grails 1.4 uses JUnit4 so the test files are very different looking. But this is good. Using
TestNG would of course be better than using JUnit4. But then using Spock would be even better. Must find
out how to use Spock for these Grails tests.
Test reports go in a different place that stated in the book, I found them at
target/test-reports/html/index.html. We are green :-)
Funny I always though AJAX was a scouring powder like VIM, apparently though it works well with Grails. I
use the word apparently as it seems http://jira.grails.org/browse/GPRESOURCES-66 means you have to hack a
lot to get it working. Something to do with JavaScript -- or should that be ECMAScript, is there actually
a difference?
I think at this point I am going to quit, I'll leave AJAX hacks until I need them. Maybe actually try to
do this with Eclipse/STS.
Final note: Grails is going to be great fun, and very efficatious at creating the Web applications I am
seeking to build.
Thu, 09 Jun 2011
Someone pointed out I had said that Jack Kreindler was at 56 Harley Street, whereas it is actually 76
Harley Street, a very different place. Correction now in place.
Yesterday I attended the ONEIS Open Day. ONEIS is a new way
of managing information created through a collaboration between Ben Summers and Jennifer Smith. Ben is a
programmer and Jennifer an information management expert. Between them they have created a system which
may be the harbinger of doom for the relational database as the way most people manage their information.
Saying that the demise of relational database is nigh, may seem a bit over the top. But we have the NOSQL
people (MongoDB, CouchDB, Cassandra, etc.) bringing new ways of managing persistence, and now there is
ONEIS which is a data store, but is neither SQL nor NOSQL. ONEIS treads another path, that of the object
store. The critical thing that ONEIS brings to the persistent data store game is that of not enforcing a
schema that remains static throughout the life of the repository. Instead, data and meta-data are held as
objects with links. Simple, obvious, and very effective. Why is it so effective in the eyes of the
current user base? Because of the attention to the detail of the user interface and user experience.
Having a domain expert be half the development team, it is nigh on impossible not to have a system that
works for the domain expert. In this case the domain expert has had an excellent grasp of what works and
doesn't work for a wide range of people using the system.
The presentations by the ONEIS folk were interspersed with "stories from the trenches" of people already
using the system. Most of these were interesting, and certainly supported the marketing of ONEIS as the
next big thing for users, but one in particular stood out as a show case for what is wrong in traditional
information management systems and what is exciting about ONEIS.
Jack Kreindler, Medical Director at 76 Harley Street, a private
medical practice, definitely not part of the NHS, talked about how they are using ONEIS to create a
complete, useful and usable electronic medical record system. The splendid thing about their system is
that it works for the patient, the medics and the practice. This is something the NHS electronic patient
record system can only dream of becoming. Yet Kreindler's system is exactly what the NHS system should
aspire to be.
What is so different? Well two things. First Kreindler's system has evolved from a small system that
worked to a larger system that works, albeit with a very different schema to the original. Secondly, it
has been evolved by the users as they use the system, i.e. it has changed in response to perceived user
needs. Contrast this with the NHS system. Firstly it is a government procurement which implies massive
upfront specification and huge documents, almost none of which is actually useful -- even though very
large amounts of money are given by the government to the contractor. Secondly, there is an attempt to
create a huge working system by direct fiat, and as John Gall has pointed out in his work on Systemantics,
big upfront design, and direct creation of big systems, just never works. The government is seemingly
unable to learn this simple lesson. Time and time again, huge projects are let and fail. Or is there a
conspiracy theory here that the contractors have a deal with the government to extract vast amounts of our
tax money in exchange for doing nothing useful?
The moral is of course that Kreindler's system looks like an excellent prototype for the NHS to pick up on
and evolve, stage by stage, into a national electronic patient record system. Sadly this is highly unlikely
to happen as government procurement is so entombed in waste and failure, and isn't going to change.
But let's go out on a high note. The beauty of ONEIS is that it allows the schema of the repository to
change over time according the the needs and desires of the users. Relational databases just do not have
a chance in the face of user evolvability to match need that the ONEIS way of doing things provides.
Thu, 02 Jun 2011
I can't remember how exactly I got there, but I alighted on this
webpage: Enough is Enough, by Fred
Wilson. The article is a reaction to the ongoing cases brought by Lodsys against Apple and Google and,
more terrifying, against individual applications developers. Lodsys appears to be a patent holding company
that does nothing but licencing patents, i.e. it is the archetypal patent troll.
Wilson opens his article with:
I believe that software patents should not exist. They are a tax on innovation. And software is closer to
media than it is to hardware. Patenting software is like patenting music.
So here we have a venture capitalist (VC), i.e. a person who buys innovation for a living, saying that
software patents should not exist. He is not the only one. Most VCs I know think patents are a waste of
time for startups unless you want to get into the patent trolling business. If you actually want to
create, market and sell innovative product, you are far better off using copyright and commercial secrecy
as tools to protect IPR.
Big Money will of course object to this since patents have become an integral part of their business model.
Fine if you are Big Money, useless if you are a small startup generating innovation. And everyone agrees
startups are where innovation happens not in big organizations. So a patent-based business model is pro
Big Money and anti startup, and hence anti-innovation.
Sadly I fear the patent system is so deeply enshrined in Big Money's view of business that it will not
allow the system to be changed, no matter how much the VCs complain. To those that have I guess.
Tue, 31 May 2011
For reasons which are unlikely to become apparent any time soon, I find myself in need of being much less
laid back about income generation -- even though I am currently involved with a pre-money startup and
writing a book. I have ongoing training gigs, but I need to increase income from that level. For various
reasons I need to telework rather than commute.
I have a CV (of sorts) on my personal
website http://www.russel.org.uk/cv.html. The short form
summary is skilled and interested in: Python, Groovy, Java, Scala, D, Go, Ruby software development
generally; parallel and concurrent programming in Python,
Groovy/Java/GPars, Scala/Akka, Go, D,
C++; SCons, Gradle, Maven and Ant
build frameworks; Bazaar, Mercurial, and Git distributed version control systems; LaTeX typesetting.
My accountant tells me it is best for me to work as a sole trader, which I do under my own name or, where
the people letting the contract cannot work with named individuals, under the trading name "Winder
Information Systems Engineering" -- which is my sole trader trading name registered with HMRC.
If the people letting the contract require to deal with a company, or there are liability issues which
preclude working as a sole trader, then I trade through It'z Interactive Ltd
(http://www.itzinteractive.com) -- though formally this is
dormant just now as I have not undertaken any of this sort of activity for 5 years or so.
So if you have any consulting or training needs which I can fulfil, please contact me. If you have funds
for projects, but no internal resource, where a project is amenable to being undertaken on a contract
basis via teleworking, I would love to hear from you.
Sun, 29 May 2011
The United States Patent and Trademark Office (USPTO) has been active again in trying to amend processes.
This time it is all about “re-examination”, and how to make it more streamlined. See for
example http://www.uspto.gov/news/pr/2011/11-28.jsp
and this
conference http://www.law.berkeley.edu/10988.htm
– thanks to Groklaw's "Groklaw Latest News Picks" of
2011-05-29T05:55+01:00. Also of course
this Groklaw article about recent
events in the case colloquially known to everyone as “Paul Allen vs The World”. I am sure there
are many other examples.
In a sense it is great news that USPTO are looking to the processes involving patents in the US. Anything
that appropriately streamlines useful processes is to be applauded. You are though waiting for the
“but . . .”
The point that should be obvious is that this is all about re-examination. They are looking to
the processes that involve the courts due to litigation bringing doubts as to the validity of a patent.
Of course it is good to make these processes simpler and easier, but why is this the focus of attention?
Surely the focus of attention should be on why there are so many patents out there that have so much doubt
and uncertainty surrounding them: why are there so many (software) patents approved that then come under
challenge from the courts? The obvious conclusion is that the initial examination is inadequate, that
(software) patents are being granted without proper “due diligence”. One has to doubt whether
there is any technical examination at all undertaken by the USPTO, that they only consider the syntactic
correctness of the documentation and the following of mandated processes in awarding a patent.
So the USPTO should look to its examination processes as well as its re-examination
processes. There should be assessment of potential prior art. There should be assessment of validity of
the claims. There should be assessment of the obviousness of the invention. Even cursory examination of
the patents involved in all the high profile software patent cases currently before the courts in the US
lead to the conclusion that very little notice was taken of the technical content of the application in
awarding the patent.
I believe that software and processes should not be patentable since they are not product with a
physicality, they are just a way of expressing ideas. However, even if such things were acceptable, the
USPTO do not seem to have employed any form of proper quality control over the patents they have issued.
One can only infer that they “approve and let the courts decide”. Is this really a sane way
of implementing monopolies approved by the state? (*) Well if you are a patent lawyer, of course it is.
It is a “gravy train”, a licence to print money. If you are an inventor or entrepreneur, it is
definitely not, it is a massive threat, with potentially huge legal costs. Big businesses may be able to
set aside monies as contingency for this, but the lone inventor, and the small and medium enterprises
(SMEs) that are supposedly the darlings of the western economies certainly cannot. So the process as it is
favours big businesses; it is by and for them.
I think the obvious conclusion is that USPTO should undertake a root and branch re-examination of
all of their processes, especially the ones at the beginning of the cycle. The US government clearly
needs to step in and ensure that this quango gets put onto a proper technical footing. Unless of course
it is culpable in preserving the status quo.
(*) Doesn't it strike you as ironic that states have so much legal infrastructure to stop monopolies from
existing – anti-trust laws, competition laws, etc. – and at the same time have a legal
infrastructure (patents) for enforcing monopolies?
Mon, 09 May 2011
The original post was wrong in some fundamentally fundamental ways, so much so that I have taken the
liberty of editing the content to be correct.
In JSR166 and the Maven repository I reported
that JSR166 snapshot artefacts were newly present in the Codehaus snapshots repository. In breaking news,
I can report that Doug Lea (helped by Tim Peierls) has tagged the master JSR166 repository with the tag
release-1.7.0 so that a non-snapshot release can be made, and artefacts appear in the main Maven
repository. I have employed my Git clone of the master JSR166 repository, with its gradleBuild branch, to
build artefacts and upload them. They are in the Codehaus repository now and will appear in the main
Maven repository at the next synchronization.
Details of the 5 artefacts:
| groupId |
|
org.codehaus.jsr166-mirror |
| artefactId |
|
jsr166 |
|
|
jsr166tck |
|
|
jsr166x |
|
|
jsr166y |
|
|
extra166y |
| version |
|
1.7.0 |
Each of the artefacts has source code and javadoc files as artefacts in the repository using the now
standard mechanism of using the classifiers “sources” and “javadoc”
&ndash with the binary artefact having no classifier.
The jsr166, jsr166tck, and jsr166x artefacts are there for completeness, the ones people will be
interested in are jsr166y and extra166y ones: jsr166y comprises all the new classes that will be standard in
JDK 7, whilst extra166y comprises the classes that will appears in JDK 8.
For further details or any questions about the artefacts, contact me directly. For information about
JSR166 see the project home page.
Tue, 03 May 2011
There was a regression in the 1.9.4 release
of Gant that could not be ignored. The problem has been corrected,
and a new release candidate checked by the people who found the regression (thanks due to Jeff Brown and
the Grails folk). There is therefore a shiny new Gant 1.9.5 release.
Everything should be in place at Codehaus already and Maven will get updated as soon as the Codehaus ->
Maven sync happens.
The regression whilst essentially trivial, was sufficiently fundamental that I have taken the drastic step
of removing the 1.9.4 release from everywhere. This should have no effect on people using Groovy 1.7 or
1.8, they should use Gant 1.9.5. People still using Groovy 1.6 will not see a Gant 1.9.5 and will have to
stay weith Gant 1.9.3. Of course people still using Groovy 1.6 should upgrade to 1.8.0 immediately and
therefore not have a problem with Gant :-)
Thanks, and sorry for the hassle.