Categories

Pseudobaking

Being a geek who likes to bake brings with it some exciting conflict: on one hand I’m a very methodical cook, following the recipes to the number and being all ‘mise en place‘ about organizing the kitchen. On the other hand, there’s so much that is sense-based: beating to soft peaks, cooking until ‘nut coloured’, ‘not over-mixing’, etc. Recipes are a blend of the reproducible and the non-reproducible.

This got me to thinking how chefs come up with recipes. What makes one recipe for tomato soup different to another recipe for tomato soup? Why did they make that change? Is it based on something they read elsewhere, or is it just from experience? Partly it comes down to chemistry (kneading to form gluten strands, or using baking soda to produce CO2), but I’m sure there must be some happy accidents or successful tests that lead to alterations.

So, I wanted to compare some recipes. I started with brownies, as these have a very simple recipe, but also a combination of different ingredients, processes, and subjective measurements. And then I shifted to some pseudocode:


ingredients:
200g of 70% dark chocolate
250g of unsalted butter
360g of caster sugar
4 eggs
65g of plain flour
80g of cocoa powder
1tsp of baking powder


X = recipe:
O = preheat(oven, 180C)
G = line(tin, greaseproof paper)
A = wmelt([chocolate, butter])
B = stir([cocoa powder, flour, baking powder, caster sugar])
C = stir([A, B))
D = beat(eggs)
E = stir([C, D]) until silky
F = fill(G, E)
bake(O, F, 25)

This brought to light a few interesting questions:

  • What happens to the variables? Once stir([A, B]) has been performed, A and B no longer exist in that form. Any reference to them should probably fail. If we had B=100g of A then A would then weigh 100g less – or would another variable be created implicitly?
  • Which steps can be optimized? If we’d had B = stir([cocoa powder, flour]) and B2 = stir([B, baking powder, caster sugar]), how would we know that the two can be combined?
  • Is it possible to tell when operations can be handled concurrently? If there were two cooks in the kitchen, one could have handled the creation of A, and the other the creation of B. But what if creating A somehow impacted the creation of B?

The next step is to make a parser for the above, possibly with some minor changes to address the questions, but I’m keen to keep any recipe language flexible enough to keep the ‘sensual’ aspects, even if it means that it cannot be run by a machine. For me the interest lies in comparing recipes, seeing where processes are equivalent, or taking aspects from one recipe and applying them to another. Watch this space!

Semantic Forget-Me-Nots

Before we begin this post, I’d like you to learn the following information. There will be a test, of sorts:

  • Roses are red
  • Roses are puce
  • Koalas are not bears

Done? Good stuff – now forget them. Take whatever strong alcoholic beverage, blunt instrument, or designer drug you fancy, and carefully forget everything up to here. I’ll put an arrow where you should start reading again.

→ So now you most likely have a bit of a headache, even if you aren’t quite sure why you have one – it’s all in the name of science. You probably also have an odd gap of a few minutes, which you can’t quite explain. This is normal. So what happened?

At the beginning of this post, I introduced three pieces of information, which you dutifully retained. Some neurons joined up (I am not a neuroscientist) in interesting ways, possibly reluctantly. Following that, you carefully undid all those intricately arranged connections and forgot the information. These things happen – both accidentally and deliberately: you forget someone’s name, or you realise that the world isn’t flat after all.

Let’s get a bit more technical. You are, unless you’re a Google Bot, a Being. You have a name, friends, etc, and are a unique snowflake in the gigantic universal triple store. The information above is also in this triple store, whether it’s correct or not. At a certain instant in time, just now, the Being that is you committed this information to memory, and then a bit later lost it. If this information above was referenced by a graph URI, we could define it like this:

<http://example.com/memorygain>
 mem:agent <http://example.com/you>;
 mem:information <http://example.com/somegraph>.

<http://example.com/memoryloss>
 mem:agent <http://example.com/you>;
 mem:information <http://example.com/somegraph>.

Here the subjects are a subclass of Event (be it the OntoMedia Event or the Event Ontology Event), so they can have some timing or positional data. They might be called RetainEvent and DisposeEvent, or something like that, with a possibility of a RecallEvent when prior information is referenced. We can now query for any knowledge you may have gained or lost during some time period, though it needs a little post-processing to be useful.

Now, let’s extend what we have to cover a bit of Doctor Who. A character gains a large amount of information, chooses to purge it from her memory, and then sees a video of herself recorded during the erased event. Here we have four Events: One in which the character learns the Horrible Truth; one in which the character creates a recording; one in which the character erases her memory; and finally one where she sees the recording. The first is a RetainEvent, with the information being that ‘some nasty Events occurred before now’ – at least, that’s all the viewer knows. The second is a bit odd, as it’s an ActionEvent resulting in the creation of another representation of that Event (the recording). The third is a DisposeEvent, in which knowledge of both the information and the occurrences of the events are lost. Then, finally, the character gains memory of the recorded Event. If we were to request all memory events prior to her reclaiming her memory, we would effectively have a gap in our Timeline.

As a second use case, we can go one step higher. A popular approach in television recently has been to show a dramatic event at the beginning of an episode, such as a lead character dying. Then you get a ’24 Hours Earlier’ caption, and the rest is filled in. So, when you see the shooting take place, you gain a memory of the event and of the character’s state at the end of the scene. If you were a hardy TV watcher, you may choose to accept the memory of the event as fact, but disregard the character’s state (‘I know what’s going to happen!’). Once the episode then goes back in time, and you see the character alive, you store this piece of knowledge away. So now the character is both ‘alive’ and ‘dead’, in a nice Schrödingery way, and if someone were to turn the episode off, you’d likely be horrified. But, when it’s revealed that the character was faking his death, you can discard the ‘dead’ information and be happy that everything’s resolved. The hardy watcher, of course, would know that the character was alive all along.

This may be, and I suspect it is, a total abuse of graph URI use, but it really opens up potential for interesting queries: Can we spot when a character is lied to, and knows it? Can we spot plot twists based on the number of beliefs that are altered? Is a ‘filler’ episode something that doesn’t change any memories that you’ve built up prior to that? And will it make Eraserhead make sense? Maybe.

March Experiment: Hacking My Unconscious

For March, I’m going to see what I can do to improve my sleep patterns. I typically only need about 6.5 hours sleep per night (usually from 2am to 8:30am) and somehow still feel perfectly normal in the morning, but I figure my unconscious is there to be messed with. Here’s what I shall do, probably trying each for a week and continuing with them if they work:

  • March 11th: Hypnagogic sleep. Defined as the experiences you get when falling asleep, there are a couple of techniques to experiment with this outside of regular sleeping. This ebook suggests these two approaches, which I’ll try in order (the first for a couple of days, then the second):
  • The Arm Approach

    • Lie on your back in bed or sit in a comfortable armchair.
    • Rest your elbow on the surface of the bed or the arm of the chair so that your forearm is pointing straight up. Let your wrist go limp if that is more comfortable for you.
    • Focus your mind on a problem you wish to solve.
    • Allow yourself to drift toward sleep, while continuing to focus on the problem as long as you can.
    • Wait for your arm to relax and fall, waking you up. This will happen naturally when you begin to fall more deeply asleep.
    • Record any creative thoughts you had while dozing.
    • Repeat.

    The Spoon Approach

    Dali was famous for his spoon method. He rested his chin on a spoon held up by his hands. As Dali drifted off, his muscles would relax and the spoon would fall on the table and wake him up from a hypnagogic dream. He then proceeded to paint what he saw.

  • March 19th: Lucid dreaming. There’s a handy guide to this which looks intriguingly doable. Plus it ties in to the previous step (the ‘recording’ stage) quite neatly!
  • March 26th: Waking. I’m going to get one of these for this (and hopefully for future, given its price/good reviews/geekery!). It’s designed to wake you at your optimal ‘almost awake’ moment which is near when you want to wake up, through some cunning use of movement sensors (I believe), and it even keeps sleep data which you can download via USB. I’m also going to try replacing my traditional beepy alarm clock with various music genres to see which work well, and which don’t.

Other things: I’ve (finally) put a section of my table aside as a ‘breakfast space’ (I’m incredibly bad at having breakfast) to see if having everything ready and waiting makes me more likely to actually have it!

A Dev8D brain-dump

So, for the last week I was at Dev8D, a happy event (with an even happier logo) that is otherwise known as “JISC Developer Days”. It took a surprising mind-shift to think of Dev8D as not being a conference. It’s not quite an unconference (or at least not as I think of them), being generously backed by the lovely geek-feeders at JISC, though it does have many of the self-organizing hallmarks. The thing that took me the longest time to adjust to, that I find common at regular conferences, was that I didn’t need to feel guilty if I didn’t get to every workshop.

You see, the workshops and tutorials were all amazing: I have new-found knowledge of Clojure, Objective C, AWS, and all sorts of other things, not to mention a yearning to apply the coding dojo technique more prevalently. But breaking away from the schedule revealed a whole seam of rich knowledge. Getting time to chat to other coders, to work on little projects, to see what nifty things were being produced – this was what I found incredibly useful. Software development is such a huge area that it’s often overwhelming – language choice alone is boggling sometimes – and knowing how people have fared against hurdles in the past is invaluable. Standing on the shoulders of giants, or even just peering over the shoulders of colleagues, is essential in our field.

So now it’s the day after Dev8D and I’ve actually taken a day to de-geek: to write down all the inspiration that appeared before I forget it and get some of the links and articles stored away to read over the coming weeks. I’m going to get vim set up to do autocompletion; have a play with the Memento APIs to see if they can be hooked into TechTales; dig through some of the tweets for any links I may have missed; come up with a project for my Arduino; and see if I can get some small projects open sourced, so I can let developers peer over my shoulders a little, too. Thanks to everyone who put on such a great event!

Mouse Paths

Having read the intriguing article at Flowing Data, I downloaded Mouse Path (mac pc) and set it going on my lab setup for the day. My dock is on the left-hand side, and I believe the big blob is roughly central on my terminal…

Lime on Spotify: Episode #3

Lime Episode #3 (massaged, manipulated, mangled): http://open.spotify.com/user/mikej/playlist/5CURwMCBFVivtpPLv92tfj

Lime on Spotify: Episode #2

Lime Episode #2 (rejigged, restored, and reminiscent): http://bit.ly/bpWUcY

Pro Football is live!

Pro Football is live! http://www.miniclip.com/games/pro-football/en/ (via @State_of_Play) #games

Lime on Spotify: Episode #1

Here’s the playlist for episode 1 of my original Southampton University radio show (with a few substitutions): http://bit.ly/cIOKfT #lime

Check out our magical app!

Written at Music Hack Day, discover music based on what you’re listening to on BBC Radio or last.fm: http://www.discoveromatic.com/ (w/ @alsothings)