Category: Sci/Tech

Goal-based artificial intelligence for home automation (and maybe piloting a network of autonomous killbots) (by )

For a while, I've been mulling the idea of writing zmiku, a daemon that can be programmed to automatically control various kinds of systems. My application is home automation, and maybe automating the management of servers (restarting and failing over services, dealing with overload situations, gracefully handling disks being full, that sort of thing); but it occurs to me that the same basic problem also applies to controlling autonomous robots such as space probes, industrial processes, and that sort of thing. A good solution to all these problems in one would be quite useful!

You might say that this is a non-problem; normally, people would just write programs from scratch to control these kinds of things, sitting in a loop reading inputs and updating state variables and choosing what output actions to generate, but the complexity of the resulting program tends to increase rapidly as the problem complexity rises.

Rather than traditional programming languages, a better notation for such a reactive system is a state machine. The Wikipedia articles on a UML state machine diagram gives a good introduction to one version of this notation, including some discussion of ways to extend the most basic version in ways that increase its expressiveness and modularity.

I'd like to base zmiku on a textual version of the UML statecharts, but today I've had a horrible stomach ache, so been unable to do much more than lie around and think about stuff, and what my mind settled on was the interesting question of how to integrate state machines with goal-based programming, which is also useful for controlling complex systems. In a goal-based system, various goals are known to the system, each with a priority; for instance, a flying robot may have a destination demanded by the user, which the navigation system tries to fly the robot towards; but a collision-avoidance system may sometimes override the navigation system when it detect that a collision will result otherwise, with a higher-priority goal for the steering system. And when the collision has been avoided, that goal will disappear, and the earlier goal of getting to the destination will take over once more. And if the robot's batteries are running low, then flying towards a charging place (or a place where the solar panels are in sunlight) might be a higher priority than the user's chosen destination, but not a higher priority than avoiding collisions. And so on.

So I came up with a model for integrating the two, using the "scoreboard" model from artificial intelligence; giving a system a shared global state between a number of concurrent subsystems. And this blog post is the result of me writing up my scribbled notes. I'm still in a lot of stomach pain, so I'm afraid it's going to be a bit rambly 🙂

Read more »

You Can’t Be A Scientist (by )

Me: explains science

Kid: How do you know all this slits eyes

Me: Because I happen to be a trained scientist

Kid: No you're not

Me: Yes I am

Kid: Nooooo, he's the scientist points to Al

Al: Nope I'm an engineer, she's the scientist

Kid: What really?

Me: Yep, I've blasted moon rock with lasers

Kid: puzzled look

This was last week. I am sure I've told you all about the time the toddlers refused to believe I was a geologist and that my friend with his shorts and big beard was the geologist?

I'm sure you've all read the posts I've made about how I get parents thanking me for having Ada and a list of female scientists and engineers but this time I don't think the issue was one of gender exactly - I am a mum, I had occupied the space of "mum person" "stay at home parent" and in our society that means, person who doesn't do anything but house work, or maybe a side job in a shop or nursery.

He had no problem with there being female scientist puppets or the idea of girls in the group doing science but Mums? Mums don't do/know this kind of stuff, mums well they're kind of dumb and reserved and frightened things.

And I have gotten this so much.

I noticed that crutches aside people just assume I don't want to/can't do stuff anymore because I've had a baby or two and it is INFURIATING, more so as though Alaric suffers from this too it is a watered down version - probably as he is out at "proper work". Stay at home dad's I know tend to have issues with people thinking they are lazy and heaven forbid they try and expand their minds by reading or anything whilst at home - surely they should be fixing everything - what you mean they cook and clean? They need to go out and get a job.

And on and on and on.

But I am kind of feeling a bit stressed about bits of science that are not my bit of science because though at primary school age etc... I know all the stuff I feel like I am now The Proof and the only proof that slightly dumpy mummies can do science too.

The Dyslexic Author (by )

Sarah Snell-Pym Award Winning Author

This week is Dyslexia Awareness Week, it is also the begininng of an insane writing challenge called NaNoWriMo which stands for National Novel Writing Month. The idea is that you write a minimum of fifty thousand words in a month and I have been doing this challenge and a picture book sister challenge called PiBoIdMo (Picture Book Idea Month) since 2009, which is now scary long ago.

When I first started the challenge and using the forum I felt very edgy, being severely dyslexic made me hesitate to enter into online written discussions with grammarian monsters - the sort that correct friends' emails. How was I ever going to compare to such writing experts when sometimes I can't spell mine or my kids' names correctly?

Trying to belt out a novel is an amazing experience but it is also an emotionally fraught one, especially for those low on self confidence. Self confidence is a key to success - it is not the only key but it is one of the main three - Self Confidence, Endurance and Improvisation/Adaptability. Dyslexics, due to our education system and social attitudes, tend to be high on intelligence and low on that whole confidence thing. To keep going with the writing you kind of need to believe that your story is good enough, that your imagination is fantastic and that everyone is going to want to read it. Many authors go through a cycle of thinking their stuff is amazing and will win a nobel prize, to sinking into a pit of despair over how rubbish it is.

But dyslexics have an added edge of nerves, an extra question over their abilities. Not only is there the language structure issues but there is the widely held idea that if you cannot spell you cannot write. This is wrong.

And it turned out that the way NaNoWriMo works is fantastic for boosting dyslexic writers. It goes something like this - everyone is rushing to get down as many words as they can, you are encouraged to leave the typos as they are and just keep going, everyone has typos, inversions of letters, missed letter where they are just typing so fast. Normal people see these and correct them, the dyslexic brain may think that that is the correct spelling and at other times it will see it as wrong - but conversely it might see the correct spelling as wrong and correct it to something incorrect - DOH!

What this means though is that when you are sitting in a cafe or pub with a group of writers your red line squiggles are no longer an issue - everyone has them. Then there is the concept that you can edit a book with mistakes in, no matter how many mistakes there are, but if there is no book to begin with you cannot edit it into something. This frees you up to write.

One of the things I also found was that increasingly I was learning language intricacies and histories and that I could grab the grammar nazis by the proverbial and correct them if and when they started. Grammar is not a fixed thing - look at the history of writing and you find that Shakespeare couldn't spell his own name, that names themselves are pretty fluid, that grammar is just basically a mark up language to tell the reader when to breathe when talking out loud.

But can a dyslexic ever be a writer, be a published author, a journalist?

Yes, they can, and when they do they tend to be multi-genre writers, not brilliant for becoming a household name but good for writing how-to and last minute books, to be able to switch the brain from science to sports to craft, to be journalists (with patient editors!), to be non-specialist all round jacks of all trades. And, increasingly, this is becoming acceptable back in the realm of fiction, thanks to authors such as Neil Gaiman.

So where does that leave me? I have said repeatedly that I must be insane trying to be a writer whilst being very very badly dyslexic but, you know what, I wasn't - I find that being dyslexic helps with research for stories and articles, as I can't rely on words or even the grammar. I often have to use both plus the context, meaning that I can often pick up on the big or small picture, the hidden concepts and deeper meanings. It also stops me making stupid assumptions as I can't take the writing literally and if it doesn't seem right I am forced to ask, to check. For science writing this is extremely important.

Now before we go any further, dyslexia is not something I can really define; it is just a part of how my brain is wired so I will not say that my writing success is because of, nor in spite of, the dyslexia. It could have stopped me; it was a hurdle, and it has stopped many but mainly because they are told they can't do things because of it. Also, yes, I am contrary and stubborn so when people told me I could not, or that I would find stuff hard, I was determined to show them I could do it - especially when my intelligence itself was under attack.

But would my life achievements have been different without the dyslexia? I kind of think not, I just had to take a different path. And that path has been strange and winding and this last week I have found myself writing craft workshops, reading my kids poetry and stories to kids whilst dressed up in ridiculous outfits at various kid clubs, being asked to perform my page poetry at several events, asked to run writing days for adults and kids, getting sci-fi stories accepted, writing blog copy and presenting my project Cuddly Science which includes script writing and picture book writing and report writing and talk writing.

And that was just this week. This last month included articles on sci-fi/fantasy and science and crafts and gardening and grant applications, and this last year saw me become a member of the Poetry Society, British Science Fiction Association and the British Science Writers Association (and yes that does confuse me especially as there is also the British Hen Well-Fare Trust that we got the chickens from too!), I have been asked to present awards to school kids and I completed a Science Communication course - something I dismissed as a "can't" during my undergraduate degree, due to the dyslexic issues.

I now firmly place myself in the role of writer, of author and so do others. I am finally what I was told I could never be - a dyslexic author. It was not trial free and it is not yet over, it kind of will never be over and I'm ok with that.

Back to NaNoWriMo, I find myself actively encouraging dyslexics to write - to take part and I love wondering around the forums and Facebook pages and twitter seeing articles like this pop up and I love to be able to say to those who are worried, those who are struggling, don't give up, you can succeed at this. And that doesn't just go for writing, it goes for every aspect of career and life 😀

Folding history (by )

Ugarit is a content-addressed store; the vault is a series of blocks, identified by a hash, that cannot change once they are written.

But logically, they appear as a set of "tags", each of which either points to an archive (a set of files with associated metadata, which can be added to, or the metadata of existing files changed) or snapshots (a chain of snapshots of a filesystem at a point in time).

So in a store where objects cannot be modified, how do we create the illusion of mutable state in these "tags"? Read more »

Further progress on Ugarit archival mode (by )

Further to my last post on the matter, I've been working on the basic user interface to accessing archive metadata.

As before, let's do an import to an archive tag in a vault. I've made a manifest file with three MP3s in - all data that could be extract from ID3 tags, and I plan to write a tool to automate the generation of manifests by examining their contents in exactly that manner, but for now I had to hand-write one:

[alaric@ahusai ugarit]$ cat test.manifest
(object "/home/alaric/archive/sorted-music/UNKLE/Psyence Fiction/13 Be There.mp3"
        (title = "Be There")
        (track = 13)
        (artist = "UNKLE")
        (album = "Psyence Fiction"))

(object "/home/alaric/archive/sorted-music/UNKLE/Psyence Fiction/11 Rabbit in Your Headlights.mp3"
        (title = "Rabbit in Your Headlights")
        (track = 11)
        (artist = "UNKLE")
        (album = "Psyence Fiction"))

(object "/home/alaric/archive/sorted-music/Led Zeppelin/Remasters/1-09 Celebration Day.mp3"
        (title = "Celebration Day")
        (track = 9)
        (volume = 1)
        (artist = "Led Zeppelin")
        (album = "Remasters"))

As before, I import it, loading the files into the content-addressible storage of the vault, automatically deduplicating, and possibly storing the data on a cluster of remote servers (although in this case, I'm just using a local vault). This was done with Ugarit revision [80b324f3af]:

[alaric@ahusai ugarit]$ ugarit import test.conf music test.manifest
Loading manifest file test.manifest...
Importing from test.manifest to tag music...
Importing /home/alaric/archive/sorted-music/Led Zeppelin/Remasters/1-09 Celebration Day.mp3...
...imported with key 4d64e4650333741cb56c3e6a785b6de4d23324cb1055e529
Importing /home/alaric/archive/sorted-music/UNKLE/Psyence Fiction/11 Rabbit in Your Headlights.mp3...
...imported with key 370bee7debb458357a2b879014d4abbeb409215ed269c1c6
Importing /home/alaric/archive/sorted-music/UNKLE/Psyence Fiction/13 Be There.mp3...
...imported with key 39df8bafd530a66614ad60ab323033b1385cdd842528dbd2
Committing import...
Imported successfully to tag music with import key ac26354ccfb0530109932c1aaddd414b59d4394d44ec43cd
Written 16MiB to the vault in 24 blocks, and reused 0B in 1 blocks (before compression)

But now it's in, we can query the metadata. Firstly, let's see what properties are available - a combination of the ones we wrote in the manifest, and automatically-generated ones such as a MIME type and the original import path:

[alaric@ahusai ugarit]$ ugarit search-props test.conf music
album
artist
filename
import-path
mime-type
title
track
volume

Let's see what values there are for the "artist" property:

[alaric@ahusai ugarit]$ ugarit search-values test.conf music artist
UNKLE
Led Zeppelin

(they're sorted by popularity, and we have two UNKLE tracks, so that comes first)

Let's see what UNKLE albums we have, by filtering for objects with an artist property of "UNKLE" and asking what values of the "album" property are available:

[alaric@ahusai ugarit]$ ugarit search-values test.conf music '(= ($ artist) "UNKLE")' album
Psyence Fiction

Let's see what we know about music by UNKLE:

[alaric@ahusai ugarit]$ ugarit search test.conf music '(= ($ artist) "UNKLE")'
object 39df8bafd530a66614ad60ab323033b1385cdd842528dbd2
    (album = "Psyence Fiction")
    (artist = "UNKLE")
    (filename = "13 Be There.mp3")
    (import-path = "/home/alaric/archive/sorted-music/UNKLE/Psyence Fiction/13 Be There.mp3")
    (mime-type = "audio/mpeg")
    (title = "Be There")
    (track = 13)
object 370bee7debb458357a2b879014d4abbeb409215ed269c1c6
    (album = "Psyence Fiction")
    (artist = "UNKLE")
    (filename = "11 Rabbit in Your Headlights.mp3")
    (import-path = "/home/alaric/archive/sorted-music/UNKLE/Psyence Fiction/11 Rabbit in Your Headlights.mp3")
    (mime-type = "audio/mpeg")
    (title = "Rabbit in Your Headlights")
    (track = 11)

Ok, let's listen to all our music by UNKLE (the extra "keys" parameter to the search command says to just output the object keys, one per line, and the "archive-stream" command streams the contents of an archived file to standard output):

[alaric@ahusai ugarit]$ for i in `ugarit search test.conf music '(= ($ artist) "UNKLE")' keys`;
do ugarit archive-stream test.conf music $i | mpg123 -;
done

...music by UNKLE plays...

We're slowly moving towards having a usable and useful archival filesystem, backed on a modular content-addressible storage system! Isn't that neat? Of course, it's not amazingly useful as it stands - at first sight, it's like a very crude version of the browser found in any modern music collection management app these days; but this is the seed of something much more interesting. For a start, it can categorise files using any user-defined schema. The backend storage can be encrypted, and accessed remotely over a network (and, in future, replicated over a cluster, or mirrored between your laptop and a home fileserver, and automatically synchronised when they're connected). The same storage can be used to store backup snapshots as well as archives, and if files exist in any combination of archives and snapshots, then only one copy of it will be stored (or need uploading, even); most files in an archive will have started off in a backed-up directory tree, or will be extracted into one.

There are many interesting use cases for Ugarit, but my personal one is to have a fault-tolerant vault of all the data that matters to me, neatly organised so I can find things quickly, and so I can access things from different locations (even when offline). Rather than having files scattered over different disks on different machines, and having to move things around to make space, and remember where they are, I can add more disks to the vault when I need more capacity, and have Ugarit manage everything for me. With the amount of data I manage, that'll be a great weight off my mind!

WordPress Themes

Creative Commons Attribution-NonCommercial-ShareAlike 2.0 UK: England & Wales
Creative Commons Attribution-NonCommercial-ShareAlike 2.0 UK: England & Wales