Ye Olde Clue

Random musings on random stuff.

Synopsis Box

When you move your mouse over the headlines on the boxes, this synopsis box will update.

Post Something!

Start a new discussion here! Yes, without registration!

Concurrent software is not the problem - Intel talking about 1000s of cores

Posted: Michael, 5 Jul 2008 at 12:47
Comments: 5

Intel have recently been talking about the fact that we'll probably have to deal with not hundreds but thousands of cores on a machine at some point in the near future (5-10 year time frame based on their 80 core prototype). Now many people seem to be worried about how to use even a dual core machine, so naturally many people are probably going wa-HUH? However I suspect the Erlang crowd have a similar reaction to us - which is "cool".

Why? Like the erlang group, in Kamaelia, the thing we've focussed on is making concurrency easy to work with, primarily by aiming for making concurrent software maintenance easier (for the average developer). In practical terms this has meant putting friendly metaphors (hopefully) on top of well established principles of message passing systems, as well as adding support for other forms of constrained shared data. (STM is a bit like version control for variables).

We've done this by using various application domains as the starting point, such as DVB, networking and use of audio/video etc, and used Python as the language of choice to do so (Though we probably could've shouted about our application uses more/better, though we've getting better I think :-). However the approaches apply to more or less any non-functional language - so there's a proof of concept of our miniaxon core in C++, Ruby, & Java as well. (C++ & ruby ones deliberately simple/naive coding style :)

This does mean that now when we approach a problem - such as the desire to build a tool that assists a child learning to read and write - we end up with a piece of code that internally exhibits high levels of concurrency. For example, even the simple Speak And Write application is made of 37 components which at present all right in the same process, but could be easily be made to use 37 processes... (prepending all Pipelines & Graphlines with the word "Process")

Despite this, we don't normally think in terms of number of components or concurrent things, largely because you don't normally think of the number of functions you use in a piece of code - we just focus on the functionality we want from the system. I'm sure once upon a time though people did, but I don't know anyone who counts the number of functions or methods they have. The diagram below for example is the high level functionality of the system:


Unlike many diagrams though, this has a 1 to 1 correspondance with the code: (skipping some details below)

bgcolour = (255,255,180)
Backplane("SPEECH").activate()
Interesting post on requirements for project websites

Posted: Michael, 4 Jul 2008 at 09:06
Comments: 0

I quite like this list of requirements for project websitesby Brian Jones. We've been planning a rebuild of the Kamaelia website to focus on applications written using kamaelia, how to modify them, make your apps using it, and how to join in (hoping people are interested in doing so), and whilst that's a wider scope than some of the things he's suggesting, but it's a good checklist. (After all, each of the applications themselves should actually have a project page with that sort of information).

Semantics changing on whitespace?

Posted: Michael, 3 Jul 2008 at 10:41
Comments: 4

In python it's clear that the semantics of a piece of code change depending on whitespace - for example:

if True:
    print "Yay"
    print "Woo"
frag. 1
vs
if True:
    print "Yay"
print "Woo"
frag. 2
However, generally speaking this does actually mean what people intended it to mean. The common exception is where, you might want to write this:
class Foo(object):
    def main(self):
         while True:
              print "Woo"
sys.stderr.write("DEBUG - UM, in loop\n")
              print "Yay"
frag. 3

Whereas of course python views the sys.stderr.write line as the end of the while, def, & class blocks. Often people do the above (in non-python languages) because they want to make it easier to find where they've inserted debug code, and lament the lack of it python. As an aside, you can of course do the above in python, if you add an extra line in:
class Foo(object):
    def main(self):
         while True:
              print "Woo"
              \
sys.stderr.write("DEBUG - UM, in loop\n")
              print "Yay"
frag. 4
Is it just me...

Posted: Michael, 2 Jul 2008 at 17:20
Comments: 0

... or is this a neat way to open a gaping security hole on your server? I can only presume that the backend of said beast only allows "arbitrary" connections to known hosts and ports, or it's a spammer's (and similar) delight.

Drawing Kamaelia Systems?

Posted: Michael, 28 Jun 2008 at 00:29
Comments: 4

Just been fiddling around with the idea of using the handwriting/gesture recognition code to allow the creation of kamaelia systems using an entirely pen driven approach. At first blush this does actually look like it could be a realistic proposition. The code that enables this in terms of proof of concept is *incredibly* hacky at present, but does seem, on a very basic level, to work. Using our packaging tools, I've packaged this up as an experimental release here:

If you're curious about it and have python & pygame already installed, installation boils down to this:

~/tmp> tar zxvf Kamaelia-Scribble-N-Link-0.1.0.tar.gz
~/tmp> cd Kamaelia-Scribble-N-Link-0.1.0/
~/tmp> sudo python setup.py install
Right at this instant all that application does is this:
  • It will recognise strokes drawn that look like an "o" or a "u" and assume you want to "draw"/add a new unconfigured component
  • Drawing a joined up "x" (ie curvy one like a "backward c going upwards, then forward c downwards") will delete the last component added
  • Drawing a stroke from top left to bottom right will "switch on" the "makelink" mode.
    • The link will start from the next link clicked - eg an outbox
    • The link will terminate with the following link clicked - eg an inbox
And that's pretty much it. No configuration of nodes at this time. The sort of output it will happily create looks like this:


However, it is an interesting start/proof of concept - it certainly is beginning to look like we will be able to literally draw software at some point in the future... Any feedback welcome. :-)
Twitter: Why?

Posted: Michael, 25 Jun 2008 at 16:33
Comments: 6

Why do you twitter?

Hack for Mashed: Kamaelia Speak And Learn

Posted: Michael, 22 Jun 2008 at 06:10
Comments: 0

This hack is a "toy" for a small child to assist them to learn to readand write. They are asked to write specific words - both textually andalso using speech synthesis. What they write is then read out to them.This version is by no means "complete", but it works. It currentlyallows a child to learn to write the word cat :-)

Where to Get it:

First initial version here:

Installing:

~/incoming/> tar zxvf Kamaelia\ Speak\ N\ Learn-1.0.0.tar.gz

Where's the Source?

Running:

~> SpeakNLearn.py

Dependencies:

  • You need to have espeak installed
  • You need to have aplay installed
  • You need to have pygame installed
Michael, June 2008
Mashed Hack: IRC Speaker Bot

Posted: Michael, 21 Jun 2008 at 22:52
Comments: 0

Since I wanted to "sit" on  some IRC channels here at Mashed and rather than flit channels or waste screen estate I decided to do a short hack to listen to the channel. As a hack for mashed, it does the following things:

  • It's IRC bot
  • It joins 3 channels - #kamtest, #kamaelia & #mashed
  • It listens to the channel

Anything that anyone says is then spoken (via espeak) by the bot. ie speech synth.
Kamaelia Mashed Release Candidate

Posted: Michael, 21 Jun 2008 at 20:12
Comments: 0

As per my previous post, the Kamaelia 0.6.0 release candidate #6 is available and can be downloaded from http://edit.kamaelia.org/release/

Kamaelia at BBC MASHED

Posted: Michael, 20 Jun 2008 at 19:53
Comments: 1

Going to BBC Mashed? Want to go? (a few are tickets left) Interested in one of these : {Kamaelia, Python, Concurrency, Multicore, DVB, Building network systems, Pygame Based Systems, Audio/video based} ? If so, please come along to the talk! If there's a clash, don't worry, I'm starting a page called GetMashed which will contain at least some starting points which I'll cover. (It's not the same as seeing it for yourself though :)

Powering a home server using solar power?

Posted: Michael, 31 May 2008 at 16:07
Comments: 3

I'm considering looking at how to do this, since it looks doable, but wonder if anyone has any experience of actually doing this, even partially. It's a very similar problem, it seems, to running a TV using solar power when camping, so it's not that strange a scenario. I've come to the conclusion that one way of doing this is as follows:

  • Use a cheap/old/low power laptop
  • Buy a car battery - or perhaps a 12V 100Ah battery
  • Use a 60W solar panel (or similar) to charge the 100Ah battery
  • Use a car cigarette light connector based power adapter to connect laptop to battery
The issue there is the 60W solar panel is expensive right now, and I'm wondering if there's a way of reducing this figure down lower - if anyone has experience of doing this. I'm also not sure it's sufficient - I suspect it has to be higher rated than that.

I'd be interested in hearing from anyone who's tried doing this.

How will you be celebrating the 60th Anniversary of the Computer?

Posted: Michael, 30 May 2008 at 18:31
Comments: 0

The Small-Scale Experimental Machine, known as SSEM, orthe "Baby", was designed and built atThe University of Manchester,and made its first successful run of a program on June 21st 1948.It was the first machine that had all the components now classically regardedas characteristic of the basic computer. Most importantly it was the firstcomputer that could store not only data but any (short!) user programin electronic memory and process it at electronic speed. -- http://www.computer50.org/

We'replanning a new release of Kamaelia for that day, which also co-incideswith BBC Mashed (aka BBC hackday 2). The new release should include, among other things, our multicore support, basic software transactionalmemory, generator, thread, process based components, a variety ofexample applications, a revamped website (yes, it needs a lick of paint) as well as a large number of new components fromimproved DVB support, better pygame tools, etc.

How are you planning on celebrating the 60th anniversary ?

:-)

Where to put our Multicore support in the Kamaelia tree?

Posted: Michael, 28 Apr 2008 at 21:11
Comments: 3

As discussed before, Kamaelia now has multicore support in subversion in the form of ProcessPipeline and ProcessGraphlines, meaning taking any Kamaelia system and making it multicore is a matter of simply pre-pending "Process" to the pipeline set up. That's pretty cool - especially if you're aware of what our normal cookbook code looks like. The question I've really got is where to merge this on the mainline. Given how useful this would be, it strikes me that like ThreadedComponent & LikeFile and Introspection, this ought to live in Axon. However, like Introspection, it probably also ought to be used from inside the Kamaelia Namespace.

Interesting thing new faces....

Posted: Michael, 27 Apr 2008 at 23:29
Comments: 0

New faces bring new ideas. As part of Google Summer of Code this year I asked upfront our students why they didn't want to use the mailing lists the project uses on sourceforge (since it was clear they didn't) - preferring private mails and IRC (as a project we tend to prefer IRC generally nyway). The response we got was unaminous around the fact they didn't want to subscribe due to SF lists being highly spammy, and requested we move over to google groups - so they could also gain better web access and RSS feeds. It was the one answer I hadn't thought of or expected :-)

Recent requests/Q and A

Posted: Michael, 27 Apr 2008 at 23:22
Comments: 0

People have used the comment or new post feature of my blog recently to leave some useful comments. Rather than have them as top level posts though, I'll drop them as replies to this post. In summary though:

  • I had a complaint/bug report from Steve (no surname) about the dates in my RSS feed (which should now be fixed), about double escaping of entities (which is also hopefully fixes). Steve also made a comment saying that he wished he didn't have to enter HTML manually. This strikes me as odd, because I'm typing this using Dojo's editor widget, so I guess that failed disgracefully on his machine. I've seen that on a few machines, but Dojo's generally got the most browser friendly wysiwyg editor, so I'm not sure what's up there.
  • I had a request whether Kamaelia's latest release is available for windows as a special bundle. The answer to that really is "it's python, so it should work, but we tend to develop under linux & Mac OS X so you may find some niggles". I certainly haven't created an installer for windows. All that said, we are overdue doing a new release, and /trunk is far and away recommended. Even so, that needs updating as well with recent developments... :-)
  • Finally, another anonymous poster made the following comment:
    • Came across this today and thought you might be interested in it Michael:
Python Bindings for AR Toolkit

Posted: Michael, 28 Mar 2008 at 16:56
Comments: 1

Not tested this, but this looks really interesting/promising. The AR Toolkit is really cool, and this appears to be linux & mac os x bindings for it. (Means that using this people should be able to access a webcam easily from both of those OSs using python...)


Writing successful applications - common questions and answers regarding summer of code

Posted: Michael, 28 Mar 2008 at 13:09
Comments: 1

We're getting some commons questions regarding GSOC, which boil down to "how do I write a successful application". I've taken the common starting point and generalised my comments, questions and suggestions in the hope of helping those in the crunch. This will also go on the Kamaelia website linked from the GSOC pages. As such this is written on the assumption the reader is someone interested in putting in a GSOC application.

Summer of Code

Posted: Michael, 27 Mar 2008 at 10:38
Comments: 0

Only a few more days to get your application in, and less if you want good feedback. The ideas we're seeing look really good and interesting, but we'd love to hear from more talented developers, and see your really cool ideas. Our ideas page continues to expand with more ideas and the mixture we're seeing is really interesting. If you haven't put in your application yet, why not? :) After all, this year we're after ideas that are completely different from previous years, since the intent is to allow students to produce something really cool they've always wanted to build, such that it grows the component set in interesting ways, as well as the kamaelia cookbook which given all components (from DVB through Open GL through networking) can be used with one another is kinda fun. (as well as useful because the whole thing is naturally multicore friendly) 

Kamaelia and Google Summer of Code

Posted: Michael, 21 Mar 2008 at 14:23
Comments: 0

Kamaelia Multicore Pipeline. The future is here.

Posted: Michael, 16 Mar 2008 at 00:16
Comments: 1

As the next step forward, I now have multiprocess support for basic pipeline. Essentially I have the equivalent of "self.link" implemented for multiprocesses. Kinda like the Postman in the MiniAxon tutorial. It's a little messy right now, but works, and does NOT require any changes to existing Kamaelia components. It builds on LikeFile from last years summer of code efforts and pprocess. The core code currently looks like this:

# setup code snipped, and specifically ProcessWrapComponent snipped
Sociable Software (Presentation)

Posted: Michael, 3 Mar 2008 at 23:57
Comments: 0

Well, I travelled all the way up to barcamp this weekend, and it was well worth it. Whilst I was there I gave a talk called "Sociable Software", as a general over arching description of how Kamaelia deals with concurrency. I'm going to write this up as a proper blog entry as well shortly, but in the meantime I thought adding the slides here would be a good idea.

What is wrong with free software zealots?

Posted: Michael, 29 Feb 2008 at 12:12
Comments: 0

Now they think they have the right to dictate to me what software I get to choose to run? cf in italics
On Thursday 28 February 2008 15:58:08 Dave Crossland wrote:
>  Even if I choose to use a proprietary program on a open source operating
>  system. Sorry, I'm not wrong,
25 years

Posted: Michael, 25 Feb 2008 at 00:23
Comments: 0

Well, this year will mark the 25th year that I've been writing code, so at some point later in the year I'll probably have some sort of party/drinks relating to that, since it means something (not sure what :-) ) to me. I have to decide a date where that makes sense, maybe some of the following will make sense. This post is a bit self indulgent as a result.

Javascript turtle

Posted: Michael, 25 Jan 2008 at 09:05
Comments: 0

A turtle/worm written using javascript: http://languagegame.org/tmp/jstile/exp/worm.html

Register Article on cross platform iPlayer "issues"

Posted: Michael, 15 Jan 2008 at 00:42
Comments: 4

I tend to understate certain things sometimes. From The Register article: MP accuses BBC chief of illegally championing Microsoft - John Pugh - MP for Southport:

As part of a Public Accounts Committee session on BBC procurement last Tuesday, the director-general was grilled by Liberal Democrat John Pugh MP on the decision to release the download version of the iPlayer for Windows and Internet Explorer only.
...
Pugh followed up the meeting with a letter to Thompson on Wednesday. He wrote: "By guaranteeing full functionality to the products of one software vendor [the BBC] is as a public body handing a commercial advantage to that company - effectively illegal state aid!
Parsing XML in Kamaelia using an expat parser

Posted: Michael, 13 Jan 2008 at 15:05
Comments: 0

Generally we've used sax for parsing XML, but it's useful to show how to parse XML using a parser like expat that works by calling back into your code. The trick, as usual with anything long running, is to put the thing that does the long running call into a thread and have it emit messages when a callback is called. The following is a minimal example:

import time
import Axon
import xml.parsers.expat
from Kamaelia.Chassis.Pipeline import Pipeline
from Kamaelia.Util.Console import ConsoleEchoer
Debugging Kamaelia Systems

Posted: Michael, 13 Jan 2008 at 14:56
Comments: 0

One thing that is particularly useful when debugging Kamaelia systems - especially servers - is the ability to dump out what's running. Fortunately Kamaelia provides a mechanism to introspect the scheduler, so you can do this as follows:

import time
import Axon
from Kamaelia.Chassis.Pipeline import Pipeline
from Kamaelia.Util.Console import ConsoleEchoer
Wish list for component systems in python

Posted: Michael, 13 Jan 2008 at 01:32
Comments: 0

Interesting wishlist for kamaelia (and others, but I'm interested from a kamaelia perspective) here: http://darkness.codefu.org/wordpress/2007/12/26/295
I'm not sure I buy all the criticisms, and feel they're more a wish-list in terms of improvements specific points mentioned about kamaelia as (IMO) potential wishlist items:

  • "the implementationneeds to be updated to support the new features of generators inPython 2.5...." - that I don't buy particularly. The new features of generators are : you can now do try..finally (which was a wart, and is just a matter of using that in new code) Another is that you can send values directly into a generator. If you do that, you effectively make your generator synchronous (or at best isochronous) with the caller. I'm not convinced by a long shot that's a good thing and it feels like a mistake in the language. However by chaining with a pub/sub generator you may be able to gain somethng a bit erlang-ish (to do the matching). I'm not convinced though. The other major thing is that you can send exceptions in to kill a generator. Now that is useful, but is something we'll only do when we decide to kill off completely the kamaelia on python series 60 - which is something I'm not sure I want to do yet. The other point is "how do you model that correctly in other languages" - which is unclear.
  • "....as the current syntax strikes me as rather ugly." - is the other half of the sentence. That can be true at times, though I think the use of WaitComplete and the new STM code makes this somewhat nicer - cf the greylisting server.
  • "In fact,it looks like Kamaelia needs a recent release, period: the last one Isaw was from 2006." - ouch! I hadn't realised it had been quite as long as that. That's actually quite embarassing! It was on my todo list, but I'll take that on board.
  • "Kamaelia also fails to offer multi-process operation" - yep. This is something I don't make any bones about - we wanted to make sure that the current API was useful and used it in a variety of scenarios before moving this forward. The recent experiments I've made here suggest this should be relatively simple to achieve. (multiwindow pygame, first multiprocess test)
  • The idea of a networked pipe seems desirable as well given this: "itneeds a way to generalize its “wires” to support communication with,e.g., remote components. You could actually combine the marshallingcomponent with the framing component and a TCP client/servercomponents and make this work" - this is something I've played with in /Sketches - but that's nowhere near the level I'd want to use as yet - partly because we hadn't at that point really got a feel for how this could be useful. (That's changing) However, this isn't something I've had a real chance to move forward at all.
  • The code should be able to migrate from microthread to thread to process as desired. This comes back to the idea that ThreadedComponent should be a chassis (ala FirstProcessBasedComponent) rather than a component you instantiate. (that would allow the threaded component to accept any component into running in its thread). This is something I realised early on could be a real problem when it comes to the issue of shared data. However the recent STM code designed to replace the dictionary in the CAT could be a real boost there. Definitely worth reconsidering. This opens up the general idea of proxy components further.
  • Components in multi-language- this seems at odds with the request to use more features of python generators. My guess is actually the core would be a core set of constructs,and then a predefined inter-language comms style. I've been leaning towards JSON more and more lately, and this would certainly hit the multi-language compatibility & ease of working with issues.
Beyond that however there's also an implication of a desire for lower level configuration as well - along the lines of Shards as experimented with by Tara last summer. All of this is doable, but with limited time, its debatable how much kamaelia can satisfy all these things, especially when I'm the only person working on it, with little feedback. As a result I'll focus on the areas I'm getting feedback on :-)
Axon.STM 1.0.1 - New Release

Posted: Michael, 24 Dec 2007 at 11:59
Comments: 0

Just posted this to comp.lang.python - but posting here as well :-) I've received some great feedback since the initial beta release of the minimalistic STM code I discussed and released 2 weeks ago. I've incorporated the feedback, and created a couple of examples based on the canonical dining philosophers example. (One based on normal python threads, one based on Kamaelia)

Dining Philosophers In Kamaelia

Posted: Michael, 23 Dec 2007 at 23:36
Comments: 0

After playing around with the STM code, and spotting the dining philosopher's code in the MASCOT example/manual that I found, I've now implemented the traditional dining philosophers example using Kamaelia. This is largely about acquiring and releasing resources - something we largely do in a really simplistic way right now, and have explicitly excluded threaded code from directly accessing.

Software Transactional Memory updated - Code Review Sought!

Posted: Michael, 20 Dec 2007 at 12:49
Comments: 0

I've updated the STM code in subversion at present here:

https://kamaelia.svn.sourceforge.net/svnroot/kamaelia/branches/private_MPS_Scratch/Bindings/STM/Axon/STM.py
I would really appreciate any code review from anyone who's capable of doing so - even if you've never done a code review before! Things I think need particular attention is the detail around locking. Specifically the following 4 methods are intended to be used by a user of the code:
class Store(object):
    def usevar(self, key):
    def set(self, key, value):
    def using(self, *keys):
    def set_values(self, D):
The above 4 functions entirely manage the locking. The following functions are internal and all assume that the store is locked appropriately before an update attempt:
    def __get(self, key):
    def __make(self, key):
    def __do_update(self, key, value):
    def __can_update(self,key, value):
Anyhow, why is this useful? Well, it turns out this should make resource management a lot simpler. If I'm right, the following code should be sufficient for the Dining Philosopher's problem:
take forks... (pseudo python, ignoring various details)
not_have_forks = True
while not_have_forks:
   try:
      S = <get the store from somewhere>
      forks = S.using("fork.1", "fork.2")
      if forks["1"].value == None and forks["2"].value == None:
          forks["1"].value = id(self)
          forks["2"].value = id(self)
          forks.commit()
          not_have_forks = False
   except ConcurrentUpdate:
       time.sleep(random()) # random backoff - doesn't guarantee success
   except BusyRetry:
       time.sleep(random()) # random backoff - doesn't guarantee success
eat()
# Put forks back - should always succeed. Should. :-)
try:
    forks["1"].value = None
    forks["2"].value = None
    forks.commit()
except ConcurrentUpdate:
    pass
except BusyRetry:
    pass
... which I think is pretty neat :-)
Concurrency: The difference between functional call context & object context

Posted: Michael, 17 Dec 2007 at 22:25
Comments: 0

A common idiom in functional programming at least with the functional languages I've used and systems I've needed to build - is a call context. That is any sufficiently large functional piece of code is at some level modelling interacting with a model. So in pseudo-functional-language you (conceptually) end up doing something like:

fun move_x context distance:
   let
       x,y,z = Parts(context)
   in
       return Context(x+distance,y,z)
   done
This context then gets passed around, and updated. This means you can end up with lots of functions that look like this:
fun move_x contet ...
fun move_y context ...
fun move_z context ...
The web is stateless, please

Posted: Michael, 12 Dec 2007 at 00:50
Comments: 0

Arrgh. If I hit "delete" on a form, I'd like the thing I'm deleting to be encoded in the form rather than associated with an opaque sessionid which "helpfully" remembers what I last looked at. The web is meant to be stateless after all. kthxbye.

Simple assistive short term memory

Posted: Michael, 10 Dec 2007 at 22:54
Comments: 2

OK, here's a challenge. Build a tool to assist with short term memory loss. The idea is this:

  • You go to the top of the stairs to do something
  • You get there, and wonder what you were there for
It'd be neat if you could do this:
  • Wear a simple looking pedant, which was a short term memory assistive device
  • Simply mutter to yourself what you're doing
  • When you forget what you're doing you press/tap a button & hear a repeat of the last muttering
    • Press it again in rapid succession, and you get the one before, and so on. (giving you context "what was I doing before...")
  • Aesthetically, it would be nice if the device looked like a pedant or similar.
  • The playback/recording could be a simple earpiece/microphone (ala mobile phone handsfree).
  • It should be sufficiently low power to run happily for as much of a day or more as possible.

image (c) 2007 daniboi1977 (flickr)
(original license cc-nc-nd)
Technologically this sounds like it should be really quite simple & trivial to make today.
  • Now here's the thing - you could do this today with a notebook & pencil hanging from a necklace - except that you replace muttering with scribbling, and pressing a button with looking at the notebook. Or perhaps hanging a dictaphone round your neck and remembering to hit "record" every time you say something.
  • However, not everyone who might find such a thing useful (ie most of us when we get older) would be comfortable with the notebook on a necklace or dictapone on a necklace approach, but may find a short-term memory pendant assist socially acceptable.
So, the challenge is - could you make this today (almost certainly), and given that, how would you do so? This isn't entirely a thought experiment - people with alzheimers may find such a beast useful, and simply having to press a button to hear what you were doing and double tapping to hear what you were doing is probably something learnable. (maybe, dunno in that context really)
Interesting: Transparent messages instead of modal "monolog" boxes

Posted: Michael, 10 Dec 2007 at 01:37
Comments: 0

Wins bonus points for looking straight out of a film :-)
http://humanized.com/weblog/2006/09/11/monolog_boxes_and_transparent_messages/
Their point is somewhat less shallow than this, but it does remind of film interfaces... :-)


Widefinder in Kamaelia?

Posted: Michael, 9 Dec 2007 at 17:55
Comments: 0

Tim Bray's widefinder project is an interesting little problem. How do you find the top 10 most popular accesses to your website in a way that gains performance when you use more CPUs? Having done log analysis in the past, there's always a tradeoff Looking at the original Ruby source

counts = {}
counts.default = 0
Minimalistic Software Transactional Memory

Posted: Michael, 8 Dec 2007 at 23:03
Comments: 2

I've just posted this message on comp.lang.python looking for comments, but I'll post it here in case there's any feedback this way :-)

Fascinating new definition of Free Software

Posted: Michael, 5 Dec 2007 at 19:37
Comments: 2

On the backstage mailing list, out of the interminable rantings and ravings about whether DRM is a good or bad idea, whether people should call Linux GNU/Linux of "that piece of software I use" or just Tux, or indeed on a dozen other things, a (not to hot) flame war about BSD licensing vs GPL licensing came about. Now I've seen this argument played back and forth dozens of times (at least) over the past 10 - 15 years and it just get repetitive with the same arguments thrashed back and forth on both sides.

Multiple Windows in Pygame, using true concurrency in python via Kamaelia

Posted: Michael, 27 Nov 2007 at 02:11
Comments: 1

First of all, the proof that this works in Kamaelia, right now:


OK, this is using the new code for running multiple Kamaelia type systems in multiple processes relatively simply. Specifically, the "interesting" code looks like this:
The first Truly Concurrent Kamaelia Component

Posted: Michael, 25 Nov 2007 at 22:20
Comments: 0

OK, this is using a massively simplified version of the primitives needed for concurrency in Kamaelia, but the following is the first component that will happily run completely in parallel with the rest of the system.

class FirstProcessBasedComponent(SimplestProcessComponent):
    def main(self):
        while 1:
            yield 1
            time.sleep(0.3)
            if self.dataReady():
                print time.time(),"main : RECEIVE FROM CHANNEL", self.recv()
            else:
                print time.time(),"main: CHANNEL NOT READY"


As you can see this is pretty much identical to the traditional Kamaelia model. Indeed, change the baseclass & you get a single threaded component, though you'd probably want to change the time.sleep behaviour.
Kamaelia based (Extended) Entity Relationship Modelling Tool

Posted: Michael, 25 Nov 2007 at 01:52
Comments: 1

This weekend's hack - a tool to make my life easier - a tool to make creation, modelling and playing with extended entity relationship diagrams simpler (Of the kind found in Elmasri & Navathe). The tool is currently sitting in my /Sketches/MPS area named somewhat imaginatively ERTopologyTool.py and I think it's really quite funky. I'm using it to make it easier to communicate ideas I've got on the participate project (which is taking most of my dayjob time at the moment), and it can take a textual description of the schema that looks like this:

entity missionagent
entity person(missionagent)
entity team(missionagent)
Benchmarking: Kamaelia vs Stackless

Posted: Michael, 21 Nov 2007 at 23:48
Comments: 0

Interesting post by rhonabwy on comparing Kamaelia to Stackless. The benchmark figures there are pretty grim from my perspective, but a useful starting point:

10 concurrent objects, 1000 loops
python timeit.py -s "import hackysack" "hackysack.runit(10,1000)"

Pitivi

Posted: Michael, 21 Nov 2007 at 22:07
Comments: 0

So, I've been recommended to use "pitivi" a few times, so I figures, why not give it a go. Well, I'm running the latest version of open suse, just released, what can go wrong eh? So I download it. And then I start downloading the dependencies it asks me to install along the way. Then it finally starts. Then I get told I need to install another dependency (gnonlin). OK, grab that. And after all that then what? It then says that the version of gstreamer I've got is too old. I'm sorry, but at this point I'm giving up.

Using Python to push files using bluetooth

Posted: Michael, 19 Nov 2007 at 09:32
Comments: 0

Just jotting this down really. You need Lightblue installed, which also requires pybluez (hence bluez) and also openobex installed. OK, no further ado:

>>> from lightblue import *
>>>
>>> finddevices()
[('00:11:9F:C3:7E:A7', u'Nokia 6630', 5243404)]
>>> services = findservices("00:11:9F:C3:7E:A7")
>>> services
[('00:11:9F:C3:7E:A7', None, u'SDP Server'),
 ('00:11:9F:C3:7E:A7', 1, u'Hands-Free Audio Gateway'),
 ('00:11:9F:C3:7E:A7', 2, u'Headset Audio Gateway'),
 ('00:11:9F:C3:7E:A7', 10, u'OBEX File Transfer'),
 ('00:11:9F:C3:7E:A7', 11, u'SyncMLClient'),
 ('00:11:9F:C3:7E:A7', 12, u'Nokia OBEX PC Suite Services'),
 ('00:11:9F:C3:7E:A7', 9, u'OBEX Object Push'),
 ('00:11:9F:C3:7E:A7', 3, u'Dial-Up Networking'),
 ('00:11:9F:C3:7E:A7', 15, u'Imaging')]
>>>
>>> D = [ (x,y,z) for x,y,z in services if "obex" in z.lower() and "push" in z.lower()]
>>> D
[('00:11:9F:C3:7E:A7', 9, u'OBEX Object Push')]
>>> (device, channel, description) = D[0]
>>> obex.sendfile(device, channel, "/media/usbdisk/Kamaelia/cat-trans.png")
[btobexclient_connect] Connecting transport...
[btobexclient_connect] Connecting OBEX session...
[btobexclient_done] Request 0x00 successful
[btobexclient_put] Sending file 'cat-trans.png' (116671 bytes)...
[btobexclient_done] Request 0x02 successful
[btobexclient_disconnect] Disconnecting...
[btobexclient_done] Request 0x01 successful
[btobexserver_cleanup] entry.
>>>


The Selfish Programmer

Posted: Michael, 1 Oct 2007 at 01:18
Comments: 0

I have the distinct pleasure of chairing the EBU Open Source workshop later today, having been invited to do so and give the opening welcome/talk. For a while I've been wracking my brains about "how do you open a workshop on open source where there's going to be a lot said on a lot of interesting topics without prejudging them or jumping the gun?". I decided therefore to do the only thing you can - to talk about what it means to me, why I develop open source, and what speaks to me. After all, many people distrust the concept of "something for nothing" (even though that's not really what open source is!).

Recently published RFCs

Posted: Michael, 25 Sep 2007 at 12:38
Comments: 1

RFC 4861 Neighbor Discovery for IP version 6 (IPv6)
This document specifies the Neighbor Discovery protocol for IP Version 6.  IPv6 nodes on the same link use Neighbor Discovery to discover each other's presence, to determine each other's link-layer addresses, to find routers, and to maintain reachability information about the paths to active neighbors.
http://www.rfc-editor.org/rfc/rfc4861.txt Draft Standard Protocol.

Greylisting using Kamaelia

Posted: Michael, 19 Sep 2007 at 22:49
Comments: 4

I've written a greylisting server using Kamaelia, and its turned my mail back to something usable. I've been running this server for 52 hours now & it's processed over 5000 mails. 94% of those have been rejected as spam, leaving a handful of spams coming through from mailing lists. It's a spectacular change for me.

Ye Old Cue: Visualizando multiples posts

Posted: guest, 13 Sep 2007 at 09:08
Comments: 2

Posted here ---

Ruby Based Kamaelia Core (miniaxon.rb)

Posted: Michael, 10 Sep 2007 at 23:07
Comments: 0

I finally got around to learning sufficient ruby to write a Mini Axon in Ruby - which means there is a basic Kamaelia core in Ruby available now. This means the following code is valid Ruby code and the components work in exactly the same way as Python based Kamaelia components:

class Producer < Component
   @@name = "Producer"
   def initialize(message)
      super
      @message = message
   end
   def main
      loop do
         yield 1
         send @message, "outbox"
         showboxes if $debug
      end
   end
end
Erlang vs Stackless

Posted: Michael, 2 Aug 2007 at 00:16
Comments: 0

Not sure how valid the following benchmark is, but it's an interesting datapoint.

More People on Facebook than live in Iraq

Posted: Michael, 31 Jul 2007 at 11:08
Comments: 0

Interesting factoid - there are over 30 million people on Facebook. That means if facebook was a nation, it would be the 39th (possibly 38th) largest country in the world according to the list of countries by population page of Wikipedia. This puts it in the spot above Iraq and below Uganda.

Greylisting for non-techies

Posted: Michael, 31 Jul 2007 at 00:03
Comments: 1

Greylisting is like magical glass for mystical flies. Real email is delivered by real flies, whereas spam email is delivered by fake mystical flies. The difference is that fake mystical flies don't bang their head against the glass repeatedly when they hit a window to try and get through, they just bounce of and don't try again. However real flies do bang their head against the window repeatedly until they get through.

Design Thinking Links

Posted: Michael, 20 Jul 2007 at 10:38
Comments: 0

A bunch of links nabbed from Michael Tiemann's OSI blog

I like this, because the second from last link focusses on design books. 3 of which I already own. Though it would be good to read t