Tuesday, 30 April 2013

The Making of StrangeLah

cleanandgreen_new_banner

IMG_5189

I was at the Clean & Green Hackathon over bits of the weekend, organised by NEA and run by the good guys from Newton Circus. Since this is Singapore, I figured that most of the people attending it would gravitate towards making fairly predictable, conventional mobile app or social media / community sites or data visualisation, or to just go about gamifying everything. And... this is exactly what happened there, it was all like LET'S GAMIFY RECYCLING! or LET'S GAMIFY FREECYCLING! or how about LET'S GAMIFY CYCLING! etc etc. I'm sure we've all heard that one before.

Whilst I love seeing the energy and passion that people have for building things at hackathons (and that's the reason I go to them), I feel like sometimes a lot of this energy is not always directed efficiently into making new things and trying hard to think of new ideas. At any rate, I could also have made a version of App-o-tron for generating random ideas for a green app and then we could have given this list to people for them to work on. I noticed that phrases such as "green technologies" and "sustainability" and "we want to leverage on NFC" were practically overused, and to be honest even if the app can be described as "smart" and "scalable", in the end it probably also contributes to the current saturation of unnecessary information. I mean, do we really need an app for everything? Do we need yet another social media app to share more things with each other all the time? Do we really want to read all the tweets automatically generated from our electrical appliances and power switches and storm drains? But then again, I know I am hardly one to talk about having practical objectives. In any case, I had already decided that my goal was not to build an app but simply to see which was the most interesting dataset provided, and to set about finding an unusual use for it.

I noticed NEA had provided a dataset of feedback on food hygiene which had not previously been released. It could not be not confirmed whether any or all these entries had been previously substantiated or not, and precise location data had been removed the entries - which was probably for the better, because no one wants to create a mass food hygiene panic (which is actually probably the state you will be in, after you read all the entries one by one, whether or not they are true). The litany of horrors go on and on and on, almost 10,000 entries of terrifying food-related atrocities. It is hard to tell whether they are all true, or merely one-off accidental food contamination incidents. Let's face it but when in the face of random rage and being called on to be witnesses, Singaporeans sometimes lose objectivity, or the ability to describe something adequately. Sometimes the feedback entry was a compendium of a list of possible places where they might have contracted food poisoning, which isn't very useful data either. For this dataset of user-submitted feedback, here was really no way of finding out how reliable the reportage truly was.

However, I still like this idea of these reports being significant points of data which might, as a whole, still point to something about each area. A high incidence of reports could mean that those places had a lot of food places and thus a lot of people eating there in general, or it could also mean that more people were having unhappy or unpleasant times there.

One of NEA's feedback categories was a category titled "Strange taste". It seemed that a number of people had described their food as strange possibly because of this somewhat suggestive category title. But, strange is not very specific. It could mean many things. There was no way I could find out who had been the person who lodged the feedback, so I would never be able to know precisely how strange it was, or in what manner.

Another dataset from Cleanlah included a set of cleanliness complaints with images. These were even more curious, because looking at these pictures was looking into an abyss of uncanny-ness. It was not always clear what we were supposed to be looking at. Amongst some of the obvious pictures of litter and dead rats were some ordinary pictures of normal, everyday scenes. But what was wrong with it? Were we supposed to search for the one thing that was amiss in the picture? Why had these photos been submitted? Did the person really mean to submit this picture of an empty corner? Why is that middle-aged man standing alone in a field? It was all a mystery!

So I wondered, what if we only looked for the strange, mysterious complaints?

So I began by stripping out all the fields except ones with vague words such as "strange", "weird" and "funny". After cleaning up the data and adding "Singapore" to the end of the street names, I opened a blank spreadsheet in Google Docs, and then imported my excel file to the Google Spreadsheet.

To Geocode it on your own (simplest method): set up Geo for Google Docs by going to Tools > Script Editor, paste mapbox.js into code.gs, rename code project as Geo, and then refresh your spreadsheet - you should see Geo appear as an option next to Tools. Now you can select the fields with the addresses you want to geocode. It will generate three new columns - geo_latitude, geo_longitude, and geo_accuracy. The last field (geo_accuracy) seems to describes whether its a primary/secondary/tertiary/trunk road or public building/retail/residential/house/mall/station.

Since this was to be a fixed set of data, I converted it to an xml (for my ease of use) and with my very limited vegetable powers of php, this is what I came up with:

<?php
  $doc = new DOMDocument();
  $doc->load( 'csv/strangefood.xml' );

 $entries = $doc->getElementsByTagName( "row" );
 $totalentries = $doc->getElementsByTagName('row')->length;
 $randtotalentries = rand(1, $totalentries);
 $randcamera = rand(0, 359);

 $Dates = $doc->getElementsByTagName( "date" );
 $Date = $Dates->item($randtotalentries)->nodeValue;

 $Titles = $doc->getElementsByTagName( "description" );
 $Title = $Titles->item($randtotalentries)->nodeValue;

 $Lats = $doc->getElementsByTagName( "lat" );
 $Lat = $Lats->item($randtotalentries)->nodeValue;

 $Lons = $doc->getElementsByTagName( "lon" );
 $Lon = $Lons->item($randtotalentries)->nodeValue;
    
 echo "<img src=http://maps.googleapis.com/maps/api/streetview?size=640x480&location=$Lat,$Lon&fov=90&heading=$randcamera&pitch=10&sensor=false>";
 echo "<div id='strangelabel'>Date: $Date ($Lon, $Lat) <br /> <div id='strangedescription'>$Title</div></div>";
?>

Why a google street view image? Because I think it compounds the uncanny, uneasy feeling by showing you a quotidian, everyday Singapore street scene. You're imbued with the knowledge that somewhere close to that location, you know someone has eaten something very, very strange - but you don't know what, you just know it was strange enough for them to want to tell someone else about it.

Screen Shot 2013-04-30 at 9.21.57 AM.png

Visit StrangeLah

Sunday, 28 April 2013

Ghost Trap: Markov Text Generator

This post is overdue, as I have been meaning to type this out since the previous month! I had been asked to design a Mouse Trap and a Ghost Trap as an "entrance exam" for a postgraduate programme I had been applying to (and if you must know, that endeavour was successful!!!), and I thought it would be good to record the process of making the Ghost Trap in particular, for it has proven to be a very useful tool in other projects (and for playing around with words...)

mousetrap

A Mouse Trap

The Mouse Trap I designed was cute but quite normal by most standards; I won't pretend to be a product designer, but the Ghost Trap was clearly meant to be the more exciting exercise of the two. Firstly, I don't believe in ghosts, having not seen one, and there was no reason to try to imagine ghosts in the supernatural sense if there wasn't anything there to begin with, so I felt it was more appropriate to contemplate the idea of a ghost trap vis-a-vis digital presence. Secondly, another thing to note is that I am more of a "hobby" programmer than a serious programmer, so whatever solution it was also had to be realistically possible to execute over one weekend (which had been the time I had to develop this). I didn't have the luxury of time to invent something fantastically complicated.

So, the simpliest idea was to generate the ghost of myself. As those of you who follow this blog will know, I write a lot here, and this basically sounds like Debbie speaking in real life, obviously because I wrote it). Another thing I do is use foursquare and flickr a lot. For people following my updates and reading all of the gratuitous amount of information and digital flotsam that I generate each and every day, this might constitute all of what some people might ever see or hear of Debbie. My digital footprint could be, in some ways, the only surviving evidence of Debbie. So what if Debbie wasn't there but something else continued generating and posting what I would probably say on my blog, and posting location information about Debbie? Would people believe in the ghost of Debbie?

The first thing I wanted to do was to fake Debbie's location. I tried compiling some stats from my currently active flickr and foursquare account:

525603193

525603203

525603209

My current flickr account started in October 2007
As of 17 March 2013, I have uploaded 37843 items to it.
It is 1995 days from the start date to the end date, end date included
Or 5 years, 5 months, 17 days including the end date.
All photos taken with my smartphone have been uploaded to flickr with geodata.
I have developed a habit of uploading every single digital photograph I have ever taken as soon as possible without editing. I also take photographs of notes, receipts, places I want to remember, but I file these as Private only.
Out of these 37843 photos, 24063 have geodata.
I have taken an average of 12.0616541353 geotagged images every day between 1 October 2007 and 17 March 2013

525603195

My current foursquare account was started on 9 October 2010.
From and including: Saturday, October 9, 2010
To and including: Sunday, March 17, 2013
It is 891 days from the start date to the end date, end date included
Or 2 years, 5 months, 9 days including the end date
As of 17 March 2013, I have made 1,115 Check-ins.
Most check-ins were only made when I wanted to find other tips and users in the area.
I have made an Average of 1.25140291807 Check-ins every day between 9 October 2007 and 17 March 2013

After looking at the sheer number of records, it looked like it would take too long to extract and process all the location data of Debbies (to produce a decent result), I thought it would be better to just generate a text which sounded like it had been written by me. This could be more quickly accomplished by what I thought would be a much simpler method: a markov text generator.

A Markov text generator is something that uses a markov chain to generate the next word in a sentence. The choice of the next word only depends on the current last word, and not on the entire sentence of all the words before that, and so in that sense it does not have memory ("markov property") despite often seeming to be smarter or more complex than it actually is.

It was not hard to find simple applications of it in action, as many spammers have used markov text generators to generate realistic looking paragraphs which are actually gibberish but then make it through spam filters. In fact, I first came into contact with the term while trying to figure out why I was receiving these realistic looking paragraphs of pure gibberish which were spam except in many cases there were no advertising links, thus rendering the spam pointless.

I found a simple example in python that I could read the code for (something that i could completely understand how it worked) and apply to my own text. The idea is that all the text is broken up and recorded as 3 word groups. For every A-B-C set of words, it checks: for each A-B, what is a possible C? After all the sets of A-B and possible Cs are recorded (if C occurs many times, then it will be repeated in the list of possible Cs for that A-B set, thus increasing the probability we will see that C returned after A-B. And of course, with location data, the same procedure could be applied to determine what would be a likely C Location for any particular A-B set of locations.

Screen Shot 2013-03-17 at 10.42.48 PM.png

Screen Shot 2013-03-17 at 10.42.53 PM.png

Next I generated a big text file of all the text in my blog. This was to be the base material for the debbietext to be generated.

Screen Shot 2013-03-17 at 10.39.46 PM.png

I ran the markov python script on the file and generated many fragments and snippets. I went on to tweak the script a bit along the way.

Screen Shot 2013-03-17 at 10.30.48 PM.png

From these snippets, I picked out a few I liked and compiled it into a full text with the punctuation cleaned up. For the interest of not making this blog any more of a piece of meta-writing than it already is, here is a generated text in image form.

Screen Shot 2013-04-29 at 12.52.27 AM.png

I used this markov generated text as the text for the newest Map without Buildings I have drawn, which is currently showing at Theo.do.lites (Lasalle ICA Gallery 1) as I had been working on that drawing at the time that I had been putting this together. So, what do you think? Does it sound like the ghost of debbie speaking?



To top this off, I wrote most of this blog post last night before falling asleep, and then at night I had a dream about visiting an old friend's house, browsing through his bookshelf, and picking up a 2nd hand copy of Jerome Rothenberg's The Lorca Variations. From there, I discovered that the copy of Lorca Variations was the exact copy of the book which I thought I had sold off some years ago. Even stranger still, I had been using the book as a diary, and some of my teenage diary entries had been scrawled inbetween the spaces of the pages! I had forgotten that I had used the book to write my personal diary notes, so I was shocked I had sold the book off without realising or remembering this! My friend had bought the book from a 2nd hand book dealer without realising what was inside the book - because he only collected books and did not read any of them.

I woke up soon after that dream, and upon waking I went to google the description of "The Lorca Variations", because I honestly could not recall what was in the book, except my general impression that the book had been really tedious and boring to me (sorry! but really not my cup of tea!) at the time I had read it for an English Literature module at NUS. I still remember it had been assigned to us by Dr Gwee Li Sui for the introductory EN2101 module, and I had tossed the book aside after that module and never looked at it since (except to try to hawk it off online to other unsuspecting literature students, but I can't even recall if I managed to sell it in the end...)

The blurb for "The Lorca Variations" on google books goes:
Having recently returned to translating Lorca, Rothenberg began to appropriate and rearrange items of Lorca's vocabulary and to compose a series of poems of his own that 'both are & aren't mine, both are & aren't Lorca.' As an original work, The Lorca Variations are, as he describes them, 'a way of coming full circle into a discovery that began with Lorca & for which he has stood with certain others as a guide & constant fellow-traveler.'
I can't believe my subconscious has reintroduced to me a book which I had completely forgot I had ever read. And at a time when I am working on a project like this.

Tuesday, 23 April 2013

DIY Wine-making with Lifepatch and Camera Hacking at L'Observatoire

On Saturday, we visited Isabelle's fantastic little space/studio, "L'Observatoire", near Turf club road. Set in a somewhat bucolic part of town - lush greenery, horse stables, and wide open spaces - Isabelle's space was full of plants and specimens and some really awesome microscopes for observation. We marveled at strange little wiggly green blobs inside the cells of plants and stained sample specimens from mice and other creatures - the output from a set of optical microscopes, magnified onto a wall with a projector. It seemed a fitting setting for our friend Andreas Siagian of Lifepatch to conduct a little workshop on the process of DIY wine-making, along with other friends from Indonesia who were also visiting Singapore.

IMG_4904

We began with a bunch of bananas. This was because bananas were the only fruit we happened to have there, and the store-bought fruit juices in Singapore almost always have strange additions to them. Naturally one could have tried using any manner of juice product as the base, but it seemed nice to start with the pure fruit. Here, Andreas explains to us the process before he begins...

IMG_4933

P4201313

P4201322

We were using a packet of inoculated yeast (extracted from Soursop) which had been specially prepared by Lifepatch.

P4201323

P4201321

Boiled water was allowed to cool slightly and then added to a blender with all of the cut fruit. Some of the boiled water was used to rinse the containers that were to be used later as well.

P4201324

P4201334

P4201335

P4201337

P4201338

P4201339

P4201347

P4201352

The fruit mixture was strained and the larger pulp removed.

P4201355

P4201364

The packet of yeast was added to water, and then later added to the fruit.

P4201368

A hole was drilled into the bottle's cap, and tubing was inserted so it would be virtually airtight.

P4201372

P4201374

At this point, a little sugar can be added as well to make it sweeter.

P4201377

P4201392

P4201398

The yeast eats the sugar, and turns it into alcohol and carbon dioxide. This is evidenced by the bubbling that will happen in the cup of water below, issuing forth from the tubing. When the bubbling has stopped, it means the yeast has finished its job. If there is excess sugar left, this makes the wine sweeter, which is why the addition of sugar can help result in a sweeter wine at the end, because there is excess sugar left after the yeast has done its course...

P4201399

After the fruit-wine-mixture was prepared, what could we do? Well next Isabelle suggested we could dissect some pens. And so we did! We dissected the pens. The pens were empty, because the children use a lot of pens. We dissected them pens good, and squeezed the dried ink sponges to see if there was any more ink in them. We squeezed them until there was nothing else to squeeze.

P4201407

After the pens were dissected, Isabelle took out a box of old cameras which she had been reserving for a "Tinkering Sundays" class she was conducting on 5 May 2013 for kids.

P4201409

P4201410

It was discovered there and then that if you give a bunch of artists/diy builders?/hackers?/programmers? some disposable cameras to take apart, they will be occupied for hours. If not days. Perhaps even weeks. They will be gluing bits of the camera lens to their smartphones permanently. I still have mine partially attached to my phone. You might have to pry them out of the work room with an electrified stick. It is truly that engrossing.

P4201419

P4201420

P4201421

P4201422

NEED A SUGGESTION FOR HOW TO CREATE HOURS OF ENDLESS FUN FOR THAT SPECIAL GEEK IN YOUR LIFE?
GIVE THEM AN UNWANTED OLD DISPOSABLE CAMERA, A PAIR OF PLIERS, AND WATCH THEM GO AT IT!

P4201417

HAVE YOU EVER WANTED TO TAKE MACRO INSTRAGRAMS OF EVERYTHING IN YOUR LIFE?
WHY NOW YOU CAN, WITH AN OLD DISPOSABLE CAMERA LENS!

IMG_4974

Mushroom which Isabelle picked up - with suspected beetle infestation.

[Note: Yuta's horrifying mushroom beetle story comes to mind, he told us a story about how he had bought a beautiful ornamental hard bracket mushroom which looked a lot like this. One day it suddenly changed colour, so he suspected something was happening inside the mushroom, so he put it in the microwave, a few small beetles fell out of a small hole in the mushroom. I know, I'm obsessed with this story and you've probably all heard it from me too many times, but I still can't get over it. I can't decide which is more horrifying - the accidental death of the beetles? yuta's decision to microwave the mushroom?? the idea that there might be lots of beetles secretly living inside these inert-looking mushrooms??? the secret life of beetles inside fungi, of which i know so little about????]

IMG_4975

Dead Bee from my kitchen.

IMG_4976

Dead spider from my table.

IMG_4977

Dead wooly aphid. Yeah I brought all these insects as a present for Isabelle.
Other people bring gifts of fruits and wine when they visit friends, I bring dead insects.

IMG_4982

IMG_4985

The surface of some seed pods.

IMG_4981

Basically I could go on and on and on...

Thanks to Isabelle (and her family) for hosting us at her wonderful wonderful space and spending the afternoon with us, and thanks to Andreas for conducting the little workshop! It was great to have other friends from Indonesia over (Ade, Coki, Monica) and to see Luis and Anne-marie there as well! Good times...