Thursday, November 03, 2011

A Review of QI Live

When Douglas Adams visited Brisbane in 2000 (possibly 1999) I had a friend sign a copy of "Starship Titanic" - I was too busy at work to see him myself.  I have always been a little disappointed that I didn't take the hour to see him.  When Stephen Fry announced "QI Live" on Twitter I made sure I wasn't going to miss out.  It was only in Melbourne and Perth (at the time) and bugger it if I was going to Perth, so even though I didn't live in Melbourne, I got some.

As I walked into the theatre the place names of France that sound funny appeared on the screen.  I remembered them from a previous episode of the TV series.  It didn't matter, they'd just played the theme for "Pinky and the Brain" and were playing Tom Lehrer's "The Elements".  I was in a good mood and I was happy to be there.

My wife thought she saw the producer, "What John Lloyd?".  Surely not, but soon after, an usher told us to stop taking photos.  It was a little annoying because I was mainly taking photos of the theatre - I'd never been to the Queen Victoria Theatre before.  Then a prissy voice said that Mr Fry's man servant would like you all to turn off your phones - so I did.

The only bit I now remember of Stephen's opening was him telling a joke about a chicken going to a library.  It was told well, I guess, but too long for me because I'd heard it before and spent most of the joke remembering my grandmother telling me it about 20 years before.  Maybe that was what he was going for.  What was worse, it lead to the fact that a frog in California is the only species in the world to go ribbit.  Another recycled fact and I was getting a little bit annoyed.

Colin Lane was the first panelist and pretty forgettable.  He and Andrew played tennis with the "Nobody Knows" paddles which was okay the first time.  Denise Scott didn't really seem to get the format but she had some good anecdotes - such as being recognised as looking like that person on TV but that she couldn't possibly be that person.  Andrew Denton was by far and away the star - he seemingly, confused Stephen by saying that, "If nobody knows, why isn't he on the panel?"  It made the whole thing almost worth it.  Except that Stephen then went on to spend most of the evening calling him stupid.

The first question was about koalas having fingerprints that are indistinguishable from human fingerprints and that maybe they were doing all the robbing in Australia (which they said has the highest burglary rate in the world).  This fact doesn't seem to be true now although it was true in 2001 which is probably closer to when it was written.

Some of the other content that was from previous episodes included: kangaroos not farting and having 3 vaginas, when does the sun set (a video), Beatles' HELP album cover, the most popular song being the default Nokia ring tone and slavery not being illegal in the UK until recently.  This is just me guessing but Andrew Denton knew every answer.  The members of the audience shouting out certainly did.  But then so did Alan and so did I.  Well, I might not have known every question.  Alan answered over the top of the question for 100 points so I didn't hear what it was.

I might be wrong, but one of the ways the show works is that Alan doesn't know the answer to every question.  Sometimes some of the guests do (John Sessions and Rory McGrath) but the point is: Alan is the kind of guy the show is supposed to be educating - he's the audience - he's coming along with us for the ride and a laugh.  He probably did reflect some of the audience that night too though, he looked a bit bored and a bit uncomfortable.

Given the amount of recycled content I don't think they would've done this show in the UK but apparently it's okay to do this in Australia.

At the end of the show, when Stephen was awarding the points, he said either the people in the audience were smart or that they had downloaded episodes not shown in Australia from BitTorrent.  This is what made me mad.  All episodes had been shown on the ABC from series A (you can Google the series number and ABC to find them on iView like Series 4).  And some of the facts were also available in the QI books (like Animal Ignorance).  Stephen seemed to be saying that we (whoever we are - the producers of the show?) reserve the right to charge you for content that we don't think you should've seen and we're a bit surprised you have because you've really cheated yourselves out of $200 a seat.

I'm still mad.  QI has a philosophy about facts and curiosity.  Recycling facts, that are now wrong, goes against that philosophy.  The original idea for the show seems to have been going against accepting common knowledge and laziness.  The show seemed to scream, "Look it up!" or "Why do you think that?".  Recycling content was pure laziness.  Stephen and Alan knew that the content was recycled and it ruined the show or at least the idea behind the show.

In the end, it's hard to know if you should regret the things you don't do versus the things you do.

As an aside, some interesting facts (sticking with the Australian theme): all living marsupials are from South America not Australia (from Wikipedia) and echidnas and platypus can make custard (as they produce both eggs and milk).

Wednesday, November 02, 2011

Building a Network Over Transactions

The new meaning of customer value: a systemic perspective analyses providing value to customers from a systems perspective.

I had a thought, a little while ago, that Google is probably one of the first companies where the users and content providers are basically the same people and that they make money, through adverts, between connecting these two together using search.

It's probably not a new thought but at the time I started to draw a diagram of how it all works.  I happened across this diagram (on the left) in this paper (page 4). 

A perverse example is when you search for something and the first hit is your own blog.  You're now both the producer and consumer of the same content - with adverts sandwiched in the middle - hmm value sandwich.

In the paper they use Google and Apple as examples:
"Google has indeed realized the usability of systemic value-creation principles in building its offering. In contrast to Apple, it uses the value network to generate the revenues. Google provides free, easy-to-use tools for customers to use on the internet, the aim being to generate “eyeballs” for the ads of the advertising customers. In collecting these “eye balls” it has or it creates a product for every internet activity that attracts lots of traffic. From the firm's perspective, the offering elements are integrated to provide the audience for the ads, information being gathered in order to better scope the ads or just to make the customers happy and to promote other products."
There's an old idea, for the Web anyway, of building a network of customers above extracting value out of each transaction. Over-valuing the creation of the network lead to the whole dot com bubble and I have been thinking about how business models have progressed since then.

Monday, September 05, 2011

One horizontal and one vertical monitor for Ubuntu 11.04

I recently had problems configuring Ubuntu with dual screens using an NVidia card - the first screen is horizontal and the second screen is vertical - they are both Dell U2711 monitors. The idea is to be able to have Firebug running on the screen without obscuring the web page.

This should be a simple thing. But from what I can tell NVidia's TwinView driver doesn't support different monitor rotations (under Linux). But having X Windows it should still be easy using dual X Screens. It should just be a matter of going to NVidia X Server Settings, selecting "Separate X Screen" and then selecting "Enable Xinerama". Unfortunately for me, this caused general weirdness where the first screen was mostly black and the second screen was displayed horizontally.

The way I fixed the problem was to disable Compiz. The easiest way I found to disable Compiz was to log in using the "Ubuntu Classic (No effects)" session.

Then it was just a matter of enabling multiple XServers and Xinerama and enabling rotation (RandRRotation). Here are the bits in my xorg.conf to rotate my second monitor to the left:

Section "Monitor" 
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor1" 
    VendorName     "Unknown" 
    ModelName      "DELL U2711" 
    HorizSync       29.0 - 113.0
    VertRefresh     49.0 - 86.0
    Option         "RandRRotation" "on" 
    Option         "DPMS" 
EndSection
Section "Screen" 
    Identifier     "Screen1" 
    Device         "Device1" 
    Monitor        "Monitor1" 
    DefaultDepth    24
    Option         "TwinView" "0" 
    Option         "metamodes" "DFP-2: nvidia-auto-select +0+0" 
    Option         "Rotate" "left"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Monday, August 08, 2011

When Kworkers Don't

I recently had the problem where kworker threads were taking up 100% on my Ubuntu box.

Various threads seem to suggest the problem lies with interrupts around PCI or power saving features. The thread with the answer that worked for me, "HELP !!! Zombie attack ... (kworker)"

To turn both of them off use:
noapic acpi=off


I found I only needed to turn off acpi though:
acpi=off


Put that in your grub configuration (sudo vi /etc/default/grub) and restart.

I hate not knowing why though.

Sunday, May 08, 2011

End of JRDF

Many things have changed since I started JRDF in 2003. It feels like JRDF has come to a natural conclusion.

Some of them are things I've failed to do very well: get contributors, implement different file format parsers, find enough time to refactor existing bits, etc. I'm also not that interested in Java anymore (as was becoming increasingly obvious as it did have Scala in there at one point and has some Groovy DSL code in there).

The most recent change I've seen is that JSON has achieved some of what RDF was trying to do and I see it more and more in the way people use it to expose their data in a RESTful way. The tooling is less onerous and the ease of use is higher even if what you get is much less.

Also, external factors like W3C's official RDF API (for Java and Javascript) is largely the same thing but with official backing.

I've enjoyed developing it and meeting and talking to other people in other groups (especially Jena and Sesame). And of course, none of this would've happened if it wasn't for a lot of other people: Paul Gearon, Simon Raboczi, David Wood, David Makepeace, Tom Adams, Yuan Fang-Li, Robert Turner, Brad Clow, Guido Governatori, Jane Hunter, Imran Khan and Abdul Alabri and the other guys and girls Tucana/Plugged In Software/UQ.



Monday, February 28, 2011

Linkage

Friday, January 07, 2011

Build Broken Images

One of the things that we encourage where I work is to visually and aurally notify you when a build has broken. I did some images a while back for this purpose.

They are:

Monday, December 13, 2010

Using SVNKit from within Groovy using SvnAnt

To load in SVN Ant you use (this assumes it's in the classpath):
ant.typedef(resource: "org/tigris/subversion/svnant/svnantlib.xml")

This then allows you to use the runSvn closures:
runSvn {
"export"(srcUrl: "", destPath: "")
"import"(url: "", path: "", message: "")
"copy"(srcUrl: "", destUrl: "", message: "")
"delete"(url: "", message: "")
"checkout"(url: "", destPath: "")
"propset"(path: "", name: "", value: "")
}

SvnAnt documentation has more details.

Adding Active Directory properties to ApacheDS

One of the things I have to do during my day is replicate Active Directory in ApacheDS. The most simple properties are member and memberOf. The following uses an LDIF file to add these properties. I've reused the OID for memberOf but I think the adUser OID is from a tutorial or something so it may clash.


dn: m-oid=1.2.840.113556.1.5.8, ou=objectClasses, cn=other, ou=schema
objectclass: metaObjectClass
objectclass: metaTop
objectclass: top
m-oid: 1.2.840.113556.1.5.8
m-name: group
m-must: cn
m-may: member

dn: m-oid=1.2.840.113556.1.2.102,ou=attributeTypes,cn=other,ou=schema
m-usage: USER_APPLICATIONS
m-equality: distinguishedNameMatch
objectClass: metaAttributeType
objectClass: metaTop
objectClass: top
m-name: memberOf
m-oid: 1.2.840.113556.1.2.102
m-obsolete: FALSE
m-noUserModification: FALSE
m-syntax: 1.3.6.1.4.1.1466.115.121.1.12

dn: m-oid=1.3.6.1.4.1.18060.0.4.3.3.1, ou=objectClasses, cn=other, ou=schema
objectclass: metaObjectClass
objectclass: metaTop
objectclass: top
m-oid: 1.3.6.1.4.1.18060.0.4.3.3.1
m-name: adUser
m-supObjectClass: inetOrgPerson
m-must: cn
m-may: memberOf

What's a Dual?

Erik Meijer has been giving a talk at YOW (in Melbourne) and San Francisco at QCON about Key Value Stores being the dual of SQL.

The obvious question is what is a dual? And like most really good questions you already know the answer. Set operations AND and OR are dual. Which means that if A OR F = A is true, by replacing AND with OR and T with F (or as Erik said switching the arrows), you get A AND T = A. Likewise, A OR T = T becomes A AND F = F.

This is the bit where Maths almost becomes magical. Why should these properties hold? Why doesn't this work for multiplication and addition?

In his talk, Erik quoted Benjamin Black, that the noSQL movement took away the relational model and gave nothing back. His talk also seems to be about the beginnings of a noSQL/coSQL algebra and a project to write a noSQL database within Microsoft (noSQL Server perhaps?). He's not the only one thinking about these kinds of things obviously.

He also mentioned, closure as an important property of numbers and other things. That is you plug 1 + 1 in, you get 2 and you can plug 2 into + 1 and get 3 and so on - the answer of one operation can be used for the next. You can't do that with SQL or SPARQL, which in my mind is a big fail. Erik agrees - and suggested that noSQL (or coSQL) should support this property. He's not the only one to think that noSQL should support the Unix philosophy (which is not just closure but is an important part of it). And he's certainly not going to be the last.

He described these properties in the same way as I discovered them in RDF, which was through graphs. The object model in LINQ has a graph of objects - objects which don't have a globally identifiable name - much like blank nodes. The cool thing about LINQ, well one of the many cool things, is that it supports closure - you query your object graph, you get back another object graph and can continue to plug away at it as you narrow your query. This certainly makes a lot of sense from a user querying data perspective (among others) - where you start with all students, you ask for all male students, then you ask for all male students with a grade point average about 5 or whatever. Narrower and narrower is one typical way people find the answer they're looking for.

The other thing he mentions is that SQL is a nightmare due to normalization, the complexity of queries, null semantics and computing over them and the difference between objects and tables. Erik showed that objects and relations are dual.

This is the bit where I introduce monads and say it's like pizza delivery or something. Screw that. It's just good in that if your operations follow laws then they can be mapped to other things and inherit any work done to make them good - like optimisation or scaling. In Erik's talk that meant finding out cool things like noSQL being dual to SQL and LINQ can be done as MapReduce (see this slide of Erik's). This works because LINQ operations are associative and MapReduce operations are also associative. It's not just a good idea it's a monadic law. If you can, read 10 pages on category theory (I'm only up to page 8 though).

Obviously, not everything is peaches. The noSQL/coSQL people say don't do joins - they don't scale - you can't self join on the web for example. In a MapReduce/noSQL system you either end up querying multiple times or you end up processing the data again. I'd suggest that someone will write a library that does multiple queries and joins over noSQL databases so that you don't have to do it yourself - maybe locally and in memory at first, and then with disk based structures for scalability later - I guess this is where LINQ would fit in.

There were lots of dualing properties in the relational vs noSQL/coSQL talk. I only remember a few SQL vs noSQL/coSQL: closed world vs open world, identity by value vs identity by reference (or properties), and (I might be wrong) transactional vs non-transactional.

So with our arrows in hand, ignoring how cool the world will be without JOINs and UNIONs and our mighty knowledge of set theory, what would JOIN and UNION look like if they were a dual and if such a thing existed as 0 and U for relations. U JOIN R = R becomes 0 UNION R = R and likewise U UNION R = U becomes 0 JOIN R = 0 (which matches my existing prejudices).

Just to put the cherry on this pig of a blog post (to mix metaphors), objects and functions look like duals too (given that people claim there's no meaning behind what an object is and what a dual is I feel safe anyway):

But from another perspective, the apply "method" of a closure can be used as a low-level method dispatch mechanism, so closures can be, and are, used to implement very effective objects with multiple methods...With closures seen as a building block with which to implement objects, it's clear that objects are a poor man's closures...If your language only has these restricted closures, and you're forced to build an object system on top of them, it's clear that closures are a poor man's objects.

Erik via Eugene Wigner said there's an unreasonable effectiveness of mathematics and I have to agree. Monads, duals, properties for LINQ, noSQL, relational databases, SPARQL, and so on. Very unreasonable and very cool.


Sunday, September 12, 2010

WebDAV No More

This is reasonably old news. And has been obvious pretty much since WebDAV began. But it's interesting to listen to Greg Stein talk about WebDAV, it's history and the reason why it was put into Subversion. At the moment if you want to go over HTTP for Subversion there's not any other option.

In the next version of Subversion, 1.7, there's going to be a new, not your father's, Subverison over HTTP. It basically means stop pretending to be WebDAV and fix it's problems. Perhaps the most interesting of which is that versions will have public URIs rather than going around and around using PROPFINDs. The WebDAV methods remain but it does look like the sprinkle it with some proprietary headers like X-SVN-Version-Name (which seems like a sensible way to send "the version I last knew about" information without the WebDAV tomfoolery).

As well, there's some other Git like features (svn patch to support Git's format). While I probably still favour DCVS for OS projects, Subversion still makes sense a lot of times.

Monday, June 28, 2010

Sunday, January 17, 2010

Functional Mainstream

From reading, "Functional Programming Doesn't Work (and what to do about it)" - I found this post along similar lines, "Functional Programming Went Mainstream Years Ago":
You can view a Perl (or Python or Ruby or Lua or Rebol) program as a series of small functional programs connected by a lightweight imperative program...0% of the impressive magic from early functional languages has been rolled into mainstream languages. That last 10%, well, it's not clear that anyone is really wanting it or that the benefits are actually there. Purity has some advantages, but it's so convenient and useful to directly modify a dictionary in Python. Fold and map are beautiful, but they work just as well in the guise of a foreach loop.

Tuesday, December 29, 2009

Syntax Hell

As anyone who has applied a more functional style to Java will realize, the Java syntax really gets in the way. I was using my usual guinea pig, JRDF, with "with" so you don't have to iterate but apply a function and so you don't have to close a ClosableIterator. The typical code to print out the graph is:
ClosableIterable<Triple> triples = graph.find(ANY_TRIPLE);
try {
   for (Triple triple : triples) {
     System.out.println("Graph: " + triple);
   }
 } finally {
   triples.iterator().close();
 }

Using "ClosableIterators.with" this becomes:
with(graph.find(ANY_TRIPLE), new Function<Void, ClosableIterable<Triple>>() {
   public Void apply(ClosableIterable<Triple> object) {
     for (Triple triple : object) {
       System.out.println("Graph: " + triple);
     }
     return null;
   }
});
It's typically one line less but that's not that much of an improvement.

Saturday, November 21, 2009

JRDF 0.5.6 and testing

JRDF 0.5.6 has JSON SPARQL support and many things got a good refactoring including the MergeJoin (which now looks more like typical text book examples - for better or worse). The upgrade to Java BDB version 4 has improved disk usage and performance mostly around temporary results from finds and the like. The next version will include named graph support.

I'm considering this being the last version to support Java 5.

This release was also about learning things like Hamcrest, JUnit 4.7, various mock extensions (Unitils, Powermock and Spring automocking (which didn't make it due to not being able to mix and match runners). This seems to be a design flaw that I've been encountering with JUnit - you can't mix and match features from various runners. Even Powermock and JUnit's Rules (for exceptions anyway) was problematic. The answer was to go back to the inner class block version.

Wednesday, August 12, 2009

Simpler SPARQL Results

SPARQL Results have two different, distinct and unnecessary ways of doings query results - one for SPARQL SELECT and one for SPARQL ASK (the whole SELECT vs ASK is worth pursuing too).

The section of a SPARQL SELECT XML result looks like:

...
<results>
<result>
<binding name="x"> ... </binding>
<binding name="hpage"> ... </binding>
</result>
...


An ASK result looks like:

...
<boolean>true</boolean>
...


The with the value inside the boolean either true or false (or possibly fred - depending on how you parse it - it would be nice to have an XSD). One set of results live in a results/result/binding and the other in a boolean. A simpler way to do it is just to use the absence or presence of a binding within the results/result.

For true:

<results>
<result>
<binding/>
</result>
</results>


For false:

...
<results>
<result/>
</results>
...


The JSON looks pretty much the same:

{
...
bindings : [{}] // true
bindings : [] // false
}


No parsing of true or false or having special cases for code producing or consuming SPARQL different kinds of answers.

Sunday, July 26, 2009

A Dangerous Adventure

One of the many messages left by leaders of the world on a silicon disk was this: "May the high courage and the technical genius which made this achievement possible be so used in the future that mankind will live in a universe in which peace, self expression, and the chance of a dangerous adventure are available to all."

Via, Debate over future of US space program.

Sunday, July 12, 2009

See and Feel the iPhone

A recent patent backs up an idea I had about a haptic interface for the iPhone (it's not a new idea even for the iPhone):
The proposed solution is the adoption of "haptic" display technologies which allow for some tactile feedback from touch screen displays. Apple proposes including a grid of piezoelectronic actuators that can be activated on command. By fluctuating the frequency of these actuators, the user will "feel" different surfaces as their finger moves across it.

JRDF 0.5.5.5

It's been a long while between updates but it's finally here. There's been some general concessions made to long standing "features" in JRDF namely relational semantics and checked exceptions - both are gone. Yuan-Fang added merge-join support which improved join performance (by up to 8 times). There's Groovy support and a nasty memory leak fixed. It's in the usual place. The next version won't be so far away with some further SPARQL query improvements including perhaps some of the newly proposed features.