Monday, 15 July 2013

A Whack-a-Carrot Game in an hour

This is a story about how we got a Whack-a-Carrot game up and running in an hour. Last Friday at 6.30pm, I suddenly decided to find a way to make a simple Whack-a-mole game with vegetables in the house and the Makey Makey, before people were to arrive at 8PM at our house for a going-away party.

It so happened that I bought a Makey Makey the other day. What is Makey Makey? Its a simple board that lets you plug things to become controllers for your computer. You can easily connect crocodile clips to it to make objects like vegetables and playdoh controllers for things on your computer - easily accessible keys include arrows, spacebar, standard directional keys for games (WASD), right mouse click, left mouse click. Objects you can use include anything with slightly conductive properties. That means most vegetables and fruits will work, but try not to use something too squishy/mushy/wet otherwise it will be a complete mess (unless that is the point of the thing you're trying to make...).

A few months ago I also signed up for a free licence for Loom game engine - attracted by its description of being similar to Actionscript 3; however I had never gotten around to investigating it further, besides looking inside its example folder, which had a Whack-a-mole example. So I reinstalled Loom on my mac (which was very small, the download was 8.1MB). By that point I also googled for WHACK-A-MOLE and MAKEY-MAKEY and interestingly someone had already made it! In fact extremely recently!! The whole thing was already on Github by a user called johnbatty - featuring a small modification on the Whack-a-mole example to use the A S D keys which are easily accessible on the Makey-Makey.

Makey Makey: http://www.makeymakey.com/
Loom Game Engine: http://theengine.co/loom
Github: https://github.com/johnbatty/WhackAPotato

Nevertheless in the interest of understanding what is going on and to see what Loomscript is like, I opened up the code (.ls) to make sure that I at least understood what was going on before utilising it. Loomscript does look almost exactly like Actionscript! The main modification here that makes it easy to use with Makey-Makey is that instead of a TouchEvent its been replaced with a KeyboardEvent which (surprise surprise) looks exactly like a KeyboardEvent in AS3.

ORIGINAL EXAMPLE:

mole1.addEventListener( TouchEvent.TOUCH, function(e:TouchEvent) { 
                if (e.getTouch(mole1, TouchPhase.BEGAN)) {                    
                    whackMole(e, mole1) 
                } } );   

JOHNBATTY'S MODIFIED EXAMPLE:

protected function keyDownHandler(event:KeyboardEvent):void
        {   
            var keycode = event.keyCode;

            if (keycode == LoomKey.A) {
                whackMole(null, moles[0]);
            }
            
            if (keycode == LoomKey.S) {
                whackMole(null, moles[1]);            
            }
            
            if (keycode == LoomKey.D) {
                whackMole(null, moles[2]);            
            }

            // etc etc etc
        }

Looks just like AS3 doesn't it? I can imagine people familiar with AS3 should have no problems doing Loomscript.

Next we needed a willing.... face. A victim was quickly found in the kitchen.

IMG_8888

The very sporting Star of the Whack-A-Kent... oops I mean Whack-a-Carrot

And within less than an hour of first taking the Makey-Makey out of the box, installing Loom, looking inside the examples, downloading the modified code from the user johnbatty (thanks!), and photoshopping some pics, we already managed to have a Whack-a-carrot game with Kent's face on it. The interesting thing is that Loom also has live reload so we could just swop in new pictures along the way....

Screen Shot 2013-07-15 at 6.03.51 PM.png

Here is Kent playing with his own Whack-a-Carrot game.

IMG_8889

IMG_8894

IMG_8891

More happy participants:

IMG_8916

IMG_8910

IMG_8913

I also swopped in a lemon at some point to prove that other vegetables worked too. Also, the reason I used carrots was because I only had carrots left in the house after having boiled all my potatoes to make mash earlier in the day.

Saturday, 13 July 2013

Hunt & Gather, Terraria - Wawi Nazarozza

Recently the Singapore Psychogeographical Society was up in Manila to speak at a satellite event for Wawi Navarroza's exhibition, "Hunt & Gather, Terraria". She had kindly invited me down, and I had long wanted to visit Manila, so it was perfect, especially because the project seemed really fascinating and close to my heart.

hunt and gather

From the project text: "Project Terraria is the artist Wawi Navarroza's public call for the urbanfolk of Metro Manila to forage for soil, plants, wild growth, moss, pebbles, and ephemera from unlikely places and meaningful locations in the city. The materials from various sources are then juxtaposed and arranged in terrariums by the artist, and photographed for exhibition "ULTRAMAR, Part II: HUNT & GATHER, TERRARIA" on view at Silverlens Galleries 5 June - 6 July 2013. Ultimately, the communal project builds a psychogeographic map of the corners of Metropolitan Manila, the city and its memories, and its pressing realities written in a created habitat of plantlife and native soil."

In short, a public call was made for urban dwellers in Manila to collect ephemera and other materials from all sorts of locations around Manila, and then Wawi arranged them into beautiful terrariums, which were documented in photographs and are later to be published in a book that Wawi and the Office of Culture and Design are working on at the moment. They should be announcing their book launch soon and I'm real excited to see the book - it already sounds like the book will be really amazing!

IMG_7448

IMG_7447

IMG_7452

IMG_7472

IMG_7461

Exhibition View

For me, reading the descriptions were just as interesting as viewing the terrariums. Here are a few of them...

IMG_7459

IMG_7444

IMG_7463

IMG_7446

Preparing for the talk in the Gallery

IMG_7473

"Matters of Psychogeography"

IMG_0076

Post-talk picture: Wawi, Marc, Clara, Debbie.

IMG_7477

As we departed from Silverlens, the group of us attracted the attentions of a taxi with an incredible name, and it pulled up, lingering in front of us for quite some time, trying to convince us to go together with him on the Metropolis Adventure Royal Cruise. A Metropolis Cruise to Nowhere...



I'll be really interested to see what happens to the plants after a few months. I suppose I've had some experience moving plants around - I remember being the sort of horrifying child that would put everything in her pockets, so much so that common statements that I constantly heard from my parents (and still hear to this day) include "DON'T PUT IN YOUR MOUTH!" and "DON'T PICK UP THE RED WAX!!!!". I once carried home some raintree seeds from the school playground and planted a small raintree in the utility area, somewhat to the detriment of my mother's washing. Repeated "scavenging" for plants outside, and bringing home new plants resulted in my realisation that plants could actually contract diseases from one another, that perhaps the reason why people did not pick up plants from random places to bring back to one's garden was that some soil and some plants were indeed carriers for diseases that could wipe out an existing garden, even if you initially couldn't see any traces of the bugs or the diseases. Or who knows, perhaps they will thrive in spite of the environment, developing a resistance to these strains of plant diseases.

I just love the idea of it being a movement of soil. I think being able to move and transport things around is part of life, or a sign of life. Soil and earth is the very fabric of the land, something so nurturing, yet also commonly referred to as dirt. Most people in the city don't like getting themselves muddy or dirty. But I am not afraid to get my hands dirty to get to know the soil and the earth. What if in a distant future all other information about the world was erased, but Wawi's terrariums were still alive, and a future archaeologist/geologists examines it without knowing the context of its formation. What would they make of it? Would it confuse them, that so much effort and time had been spent to bring these particles together to form individual little pods of ecosystems, the unusual combination of which might not be apparent visually until one examined the nature of the soil and the rocks, and the origins of the plants inside?

IMG_7456

Keep us updated on your terrariums, Wawi!



Facebook updates on the project here: https://www.facebook.com/WNterrariaproject
Thank you so much to Wawi, Clara, Marc, Karen, the people at Silverlens, for facilitating the talk, and making the project all come together!

Monday, 8 July 2013

From Shaw Boulevard to Manila Bay in four modes of transportation

Last month when I was in Manila, I ended up taking four different modes of transportation in one morning. It all began when someone I had met at the talks, Dinna, asked me if I would like to come along to a tour of Manila Bay planned around the sights and places mentioned in the book "Manila, My Manila", written by the late Filipino writer, historian and journalist Nick Joaquin. The tour was to be held in celebration of Manila Day, and I thought it seemed to be a good way to get to know the city, mediated through the writings of someone who was thought to be one of Philippines' most important writers in English. However, that morning I had woken up late as the talk we had the night before had dragged on well into the night. Fortuitously, Dinna's message woke me up, and I made the snap decision to rush out to Manila Bay despite not having a clue how to do so; it was my last day in Manila, and how could I not visit Manila Bay!

Unfortunately, Manila is a city with a very complicated transportation system. Tengal and Gene were still soundly asleep and could not be asked for directions, and asking the house helpers for directions did not help, and worst of all the internet was down in the house so I only had very vague offline maps on my phone to consult for directions. The message told me to come down to "Rajah Sulayman Plaza". Unfortunately, my offline maps did not have anything called "Rajah Sulayman Plaza" - there was only something called "Rajah Sulayman Park" near Manila Bay. Later I was to find that this was the same thing (PHEW) but I had a great deal of trepidation as well because my friends had told me that the names of roads frequently change with every new president, and sometimes there are multiple roads with the same name in different places...

Anyway, in any case, I manually scanned the maps and determined that the nearest station was "Quirino". I could not for the life of me get the route planner to work on my phone whilst offline, but at the very least I did know how to get to Shaw Blvd MRT, so I decided the stations must surely all be connected (FOR WHY WOULD THEY NOT BE CONNECTED?). On that hopeful note I set off for the station...

Jeepney


IMG_7369

IMG_7371

IMG_7374

In order to get to the Shaw Blvd MRT station, I had to take the Jeepney. Jeepneys are these loud, bright, garish lorry-like vehicles which purposefully roar up and down the road, with musical air horns, trails of billowing black smoke, transporting dozens of people at a ridiculously low cost. The first time I took one I was completely confused, even a little fearful that I was on the wrong jeepney. They do not have fixed stops or schedules, they are independently and privately run, and you can only tell where they are going to based on the locations painted on the side of the Jeepneys. God knows how one can ever spot the locations when one is in a mad hurry to get somewhere, or when the Jeepney is speeding past you and your hand is poised to wave but you're uncertain if your eyesight has betrayed you. Grave confusion is sure to ensue. You just flag one down, get into the back, pass your fee towards the driver - if you're at the back the other passengers will help pass your money to the front - and your change will also exchange hands from the driver in the front of the jeepney - and be slowly passed back down through all the hands of the other passengers back to you.

Another major issue is that because they are all independently run, they might not all have the same spellings or terms for their destinations. For people unfamiliar with the areas and road names, this is a big nightmare. On the first day I got to Manila, Tengal told me to look out for a variation of the words "EDSA", "Crossing", "MRT", or "Starmall". Eventually I caught one to Shaw Boulevard; in the end when push comes to shove and you are forced helplessly to navigate the world of jeepneys, you will find that the jeepney, however confusing it may seem, will actually still get you to your destination.

Cost: P8 per ride

MRT


IMG_7422

IMG_7724

IMG_7726

The MRT is very much like any other train service in the world. You buy the ticket at a counter, a security guard looks into your bag and scans you for bombs and knives just for show, and then you go through the turnstile with one of those old magnetic strip tickets. I was slightly disturbed that there seemed to be no women in the cabin I was standing in, but later I was told that there is actually a "women-only" car at the front of every train. I bought a one way ticket for P12 but when I got to the other end they said my card had zero stored value so I had no choice but to pay another P12 to get out at Taft Ave station. I can only surmise that the ticketing lady probably knowingly gave me a dud cos I was a foreigner. I shake my fist at them!

Cost: P24 (Probably should have been P12) (6-8 stations range)

LRT


IMG_7727

Connecting Walkway from Taft Ave MRT to Taft Ave LRT

The LRT is like the MRT but the trains are smaller. I did not understand why the ticketing lady demanded P30 from me when I only wanted a one-way ticket. It seemed like way too much for just a stop or two and she insisted I pay P30. In the end I paid it in order to get out of the long queue that I was holding up. She gave me two tickets in the end and I have no idea why. Again, I shake my fist at them!

Cost: P30 (Probably should have been P15)

Pedicab/Tricycles


IMG_7729

The view from inside a Pedicab

I paid about P60 for a short distance between Quirino LRT station and the park itself, which was fairly close by, down a straight road. I know I was definitely overcharged as a foreigner but at that point I was just glad to get to my destination quickly. Noticing that the fares I was paying on my journey were increasing with each subsequent mode, I felt that a man-powered mode of transportation should be worth more than an electrically powered ride so I was willing to pay a little more since I could probably afford it.

Cost: P60 (Probably should have been around P30)



My total journey cost 122 Philippines Pesos, which would be about SGD3.60, which means it cost me a mere PITTANCE although I was already being grossly overcharged on most of my journey. I felt in particular that the fares for the jeepneys were ridiculously low - P8 means S$0.20, which in Singapore is such a tiny amount that it will not buy you anything at any shop - how could anyone survive with such income levels? It is terrifying! Incroyable!

However, it also means that if you wanted to live cheap, there would be ways to get around the city on very very very little, if you were willing to endure the vagaries of the jeepneys and tricycles and taxicabs. To be honest, Manila is not really the best city to walk in, because you always feel like you're in imminent danger of being run over, so any real or serious exploration of the city would probably have to involve some skill in taking both the public and privately-run transportation networks.

IMG_7731

SUCCESS! Rajah Sulayman Plaza!



In the next post: more on Wawi's show, Malate Church, and a whole backlog of other entries about Venice and Teotihuacan...

Sunday, 7 July 2013

Disconnected from the Internet of Things in Singapore

Yesterday I attended a training for Arduino and Windows Azure at the Singapore Science Centre. Part of a training session conducted in the run-up to a programming contest organised by the ITSC to be held on the 2nd August, the initiative seems generally well-intentioned, but perhaps, ever so slightly lagging with the times. You know, the same feeling one gets when one first hears about Windows Azure... "Um, isn't it kinda almost too late for Windows Azure to try to compete with Amazon Web Services to be the biggest public cloud provider...? What exactly is the difference anyway?"

Nevertheless I'm always keen to explore to new classes about things that I don't know about because sometimes you find interesting leads from them. So I thought I'd give Azure a chance, hopefully find out how its different from AWS. I mean, sometimes one is very pleasantly surprised about how excellent some of these free classes can be - for example, once I attended a brilliant Rails for Girls class (walking us through Railsbridge's curriculum); it was a joy to learn and we all made something up and running within a day, and the instructors were so generous and patient with everyone...



Unfortunately, this is not going to be one of those happy stories.

If the tutorial was to inform people about the bigger picture of why its important to explore new technologies like Arduino, Windows Azure, xively, etc, then I suppose that was achieved. However, if this tutorial was to arm its attendees with the actual practical skills to do it, then this drew a complete blank.

For an introduction to connecting Arduino to the internet, you would have thought they would have informed attendees to get and bring an Arduino and Wifi shield in advance, in order to make the session more meaningful. The Arduinos connected to the computers in the lab were resultantly just for show, because without the wifi shield we could not follow the example shown on screen, and staring for half an hour at the code on the big screen was generally pointless, even if I could follow the instructor's general reasoning and chain of thought.

The room used for the training had Windows computers stuck in the dark ages - only running IE8, meaning that sites with minimum browser requirements such like xively (which was being demoed) could not run on them. The most bizarre of all was that the room where the talk was held did not have a free/open or reliable wifi connection, which you would imagine, IS SOMETHING THAT WOULD BE VITAL WHEN CONDUCTING A TALK ON HOW TO USE THE WIFI SHIELD FOR ARDUINO? How does the Science Centre NOT have its own wifi network? Why is the Wireless@SG there so infuriatingly slow to the point that trying to surf the internet was like trying to eat jelly with chopsticks? I could only facepalm in the corner as the instructor asked people if they could ping him to see if he was online. My iPhone-tethered 3G connection was disappointingly slow from that location as well.

The software introduced was not free or open source, although there is 30 day trial for Azure. The signup for Windows Azure requires a credit card authorization (similar to AWS) although you will not be charged, something which I suspect most of the secondary school students in the room would not have been able to provide on their own. I could not immediately find a simple way to access their educators schemes as well, it required the educator to submit lesson plans involving Windows Azure in order to obtain an educators' pass for students and educator.

The free trial comes with up to $200 credits, although this was sadly not explained in terms of what $200 amounted to in services. On the other hand, I should note that at the AWS seminars which I attended in the past (and which were attended by working professionals), the payment charges and estimated payments for types of volume of service were explained in detail.

A survey of the room showed that none of the attendees besides myself had dabbled in making mobile apps before (and I have only dabbled on a very low-level), thus any deeper discussion of the technical aspects of Windows Azure was probably lost on many, which was a real pity.

Nevertheless, the Microsoft instructors made a good go at "selling" to us the overall importance of understanding the internet of things and the wide and amazing possibilities of what we could explore making. Pity he was already speaking to the converted though - because I mean, if I dragged myself OUT OF BED at 7.30AM ON A SATURDAY MORNING to travel from the eastside to the distant unholy nether regions of Jurong East to attend this talk at the Science Centre, you'd better damn well believe that I already have a pretty good interest in wanting to learn more about the internet of things!

As someone who has spent a little time being an instructor (AS3), I know that I have a tendency to be very critical about how people conduct any form of IT/programming instruction. And I know its also hard to teach even if you are brilliant at the language - teaching is another thing entirely. But I think it is really important for IT education to be conducted PROPERLY and thoughtfully. I think a lot of people are put off from doing programming and learning technical stuff BECAUSE the classes are terminally dull, are intimidating in terms of what they expect you to know already before coming to the class (they did not ask what level of programming or what languages people used, so for all we know all that json or processing-type stuff they were showing on screen could have all been complete gobbledygook to the attendees!!!). And as usual, it was not really a female-friendly environment either, there were maybe a total of 4 females amongst a couple dozen males, and THE WHOLE COMPUTER LAB WAS PAINTED FROM FLOOR TO CEILING IN BLUE! Talk about overkilling on the gender signifiers...

Anyway the most important thing I want to say is:

DON'T HOLD A TALK ABOUT THE INTERNET OF THINGS
IN A ROOM WITHOUT RELIABLE WIFI!!!




But on to more productive things. Instead of trotting to the Science Centre again, I think I should embark on my own self-study of how to build small projects with Arduino and Raspberry Pi here instead. And yesterday to the credit of one of the instructors, he did introduce something called xively, a service that one can get up and running in a jiffy:

xively.com

Some might remember this as pachube, and them cosm. Xively is a cloud service that allows you to store data points collected from sensors on objects/devices/buildings on the web. From there, you can develop apps and other programs to use this data intelligently. The free option on xively allows you to connect up to 5 devices.

Within five minutes of signing up you can get a very simple example working with any smartphone - the test drive shows you an example of a "package" with gps and gyro sensor (in this case, your phone) and allows you to see what direction it is tilted at.

IMG_8637

On the iPhone

Screen Shot 2013-07-06 at 10.30.45 AM.jpg

On the xively site

Real-time visualizations can be made on websites, real-time alerts can be sent out triggered by the datastream, from which other devices or environments can be controlled and changed, or scripts can be triggered. In this example, if it is shaken too violently, it will indicate a Warning alert on the site in real-time. In the workbench, you can see all the numbers changing in real-time.

Screen Shot 2013-07-06 at 10.34.11 AM.jpg

Workbench

So getting the datastream online is so very easy and all the historic data will also be stored in case you should need to use it later on. It looks like a quick and easy solution to hooking up devices and sensors to the internet in real-time! And it is all connected up online and completely in real-time...

Well, that is unless you're in a room disconnected from the Internet. Because god knows, you certainly won't be connected to the Internet of things if you're in a room without the Internet. It should be SO BLINDINGLY OBVIOUS, but hey, case in point...

DON'T HOLD A TALK ABOUT THE INTERNET OF THINGS
IN A ROOM WITHOUT RELIABLE WIFI!!!




I didn't get to mention about Windows Azure because the introduction I had at this training session was very brief and I was too busy in the month to play with Azure. Nevertheless to their credit, a customer service officer DID call me back to ask me if i had problems or questions with it. Pity I had no time to explore it further in the month...