Markov Chains, Twitter and Radical Texts

The next few posts will cover some pet projects that I did whilst not being able to work due to recent civic duty.  They cover things from the role of familiar strangers on the internet and anti-social networks, through to meteorological hacks, funny memes to twitter bots. The first in this series is about what happens when you use markov chains and radical texts with twitter.

Detournement is a technique now considered to the father of remixes or mashups, but with a satirical political nature. Have a look at the wikipedia entry for detournement if you want to know more about it. Basically you do something to something which twists or re routes it so that it makes new meanings. It was the Situationists, led by Debord who really adopted and ran with this as a practice.

guy_debord1

Debord would often frequently plagiarise other radical texts in his own work. (The Situationists were also the ones behind original notion of psychogeography – something that you may have caught me talking about before.)

So what would happen if we could detourn, or mashup, or plagiarise Debord’s own writings? And how about if we could publish it periodically, and how about if we had a 140 character limit? Yeah so this is my experiments with these ideas.

Bruna Rizzi; it is from this disastrous exaggeration. The peasant class could not recognize the practical change of products

The proletariat is objectively reinforced by the progressive disappearance of the globe as the bureaucracy can

Markov chains basically work like take a couple of sentences: “A lazy dog likes cheese” and “My house likes to be clean” then look at groups of two or three words together. Then if one of these groups share the same word (“likes”), make a new sentence using that word to chain together. “My house likes cheese” or “A lazy dog likes to be clean”. Markov chains result in sentences that look human readable. The more sentences you feed the population sample, the better or more varied the same of generated sentences.

Some radical texts are complete nonsense and really hard to read, so perhaps applying Markov chains to them can help reveal what truths the obscure language hide.

@markov = MarkyMarkov::TemporaryDictionary.new
@markov.parse_file "debord.txt"
raw_text = @markov.generate_23_words

My solution uses Ruby, the Twitter gem and the marky_markov gem.

https://github.com/timwaters/rattoo  is the work in progress twitter bot – it works currently on Heroku using the scheduler to periodically tweet a sentence, see if any other users have asked it questions and reply back to them.

With GeoCommons

I’m now working with FortiusOne and GeoCommons!

Which will mean me working on lots of exciting geo stuff, and you getting to play with it on GeoCommons.com soon!

Can’t really get into much detail at this time except that GeoCommons shares the same vision of making geospatial data, tools and analysis available for all to use, through the web – the same vision which got me started freelance in the first place, so I’m very enthusiastic.

I’ll still be supporting and developing on mapwarper.net and the NYPL Warper maps.nypl.org – and on that note, expect some eye popping news from Stamen Design related to this soon!  In the meantime have a play with http://polymaps.org/.

using RAM as chromium cache for speed

Just a little post to help other folks find this hint and tip. I’m using Ubuntu on an Acer Aspire One with the SSD – I recommend fellow Ruby allied Leodian George’s post on getting it all set up if you are interested.

Okay, to make Chromium or Google Chrome to go very fast and use a previously configured RAM filesystem (I used aufs). Use the –disk-cache-dir flag. For example, where /var/tmp is actually held in RAM:

chromium-browser --disk-cache-dir="/var/tmp"

Will get the browser using a cache in RAM, and not the actual SSD. Hope this helps others out there.

Lazy Apps at Barcamp Bradford

Bradford had a barcamp at last, and it was rather good. What was telling was that every single slot was booked out, and repeats of some sessions were requested, and shoved in during breaks.

Cheers to all the folks who organized and sponsored it etc. Ian gives a good summary about what happened.

“Lazy Apps” was the title of my session, and as the room it was in was furthest from the wifi, we didn’t live stream them to twitter. Instead we lazily scribbled them on paper. Here they are for you.

pre update update

Just a quick note to say that I’ve been to and will be blogging about:

  • O’Reilly’s Where2.0 in San Jose, USA
  • Wherecamp 2009 in Palo Alto, USA
  • Humanitarian & geo coworking, San Francisco, USA
  • Maker Faire in San Mateo, USA
  • Alertnet’s Mapping Workshop / Webinar, in London, UK
  • Pateley Bridge OpenStreetMap Mapping Party, North Yorkshire, UK
  • Unsheffield (Barcamp), in Sheffield, UK
  • First UK Open Source GIS Conference in Nottingham, UK.

So that’s quite a lot of stuff for my brain to digest… expect to see a stream of posts starting shortly.

The shell meme.

Found The Shell Meme over on Caius’s blog and, since it’s a meme that’s entirely voluntary, and doesn’t require me to actively spam other people for them to do it, here it is:
Type this into a new terminal / shell:
history|awk '{a[$2]++} END{for(i in a){printf "%5d\t%s\n ",a[i],i}}'|sort -rn|head

and I got this:
79 svn
53 ls
52 rake
30 cd
25 identify
25 convert
21 gdalinfo
21 cucumber
18 gnome-open
15 rm

All in preparation of my newer Map Warper which will come out very soon.

bbc radio shell script

You may find this useful. Shell script for listening to bbc radio feeds via mplayer, nice and short. “bbc 1″ plays bbc 1.
list of feed urls: http://www.bbcradio.mobi/
#!/bin/bash
bbc[0]=""
bbc[1]="http://www.bbc.co.uk/radio1/realaudio/media/r1live.ram"
bbc[2]="http://www.bbc.co.uk/radio2/realmedia/fmg2.ram"
bbc[3]="http://www.bbc.co.uk/radio3/ram/r3g2.ram"
bbc[4]="http://www.bbc.co.uk/radio4/realplayer/media/fmg2.ram"
bbc[5]="http://www.bbc.co.uk/fivelive/live/surestream_int.ram"
bbc[6]="http://www.bbc.co.uk/6music/ram/6music.asx"
bbc[7]="http://www.bbc.co.uk/bbc7/realplayer/bbc7.asx"
bbc[8]="http://www.bbc.co.uk/england/realmedia/live/localradio/leeds.ram"
bbc[9]="http://www.bbc.co.uk/1xtra/realmedia/1xtra.asx"
if [ $# -eq 0 ]
then
echo "usage bbc 1"
for ((i=0; i<${#bbc[@]}; i++))
do
echo $i . ${bbc[$i]}
done
exit 1
fi
mplayer -quiet -playlist ${bbc[${1}]}

download: http://chippy2005.googlepages.com/bbc.txt

tip: stop webrick script/server (address already in use)

Quick tip of the day.

Somehow you’ve got out of the script/server console (ctrl-Z instead of ctrl-C perhaps), but the server is still running, as you get this message if you try to start a new one
“TCPServer Error: Address already in use – bind(2)”

type “jobs” and you will see it there. (should be number 1)

type “fg 1″ to bring the  server back and then if you want, ctrl-C to quit it

Barcamp Leeds

Attended the first Barcamp Leeds this weekend, it was very good. Many good talks, chats, and laughs were had.


(photo by Moshin Ali)

My talk (slides) on Openstreetmap Leeds (creating a free map of Leeds)went ok, helped to crystallize some of my recent thinkings of the project and will be the subject of a forthcoming post. Some comments about OSM, how to encourage more people to take part? possibly though the use of “here’s my places i’ve mapped”, possibly a chart of personal stats, for some competition. I think OSM is still pre-early adopter at the moment. Oh, and special thanks goes to Kevin Whitworth for the use of some of his great photos! please don’t sue me! ;-)

Some of the talks I enjoyed:

  • Victor Szilagyi “on getting lost with GPS”. A fascinating look at locative media, and some ideas about new interfaces, passive, for experiencing these. Like a braile / pin face on a device so you can feel events and locations, and a locative radio player. Had some good chats with Victor: he organized Mobile Camp London.
  • Reinhold from Leeds Met gave a fun account of his work in augmented reality and vision, robot cars and races, and puts out the challenge for Leeds, shall we enter a car for the next DARPA grand challenge? (also, he talked about how these types of challenges, with a big award at the end encourages good development).
  • Tom Scott, one of the organisers, and who is doing interesting things with pineapples apparently, did a very fun “zero to game in 20minutes”. We made a card game, based on Ninjas in Space. Fun!
  • Ikem Nzeribe, who I first met at the State of the Map conference, presented his ideas for Doodol, a great idea – using vernacular geographical sketch maps to describe places that blows the pin on a map out into last century. Worth watching for.
  • Tom Smith, I have loads of time for. He presented about “stuff we may not know, but might want to”, amongst all the gems he talked about, were the works of Tufti and Robert Horn, how paired programming makes your code better, aka Talking to the teddybear (Made me want to register that as a domain name!), and is looking for good ideas to take into reality. His slides are here
  • Ben Dalton from Leeds Met, did a wonderfully funny session on futurology and “paleo-futures”, and we split into groups and devised the future for Dogs and Metal detectors… well you never know! Paul Robinson then did a session where he looked at how futurology is crap, and you cannot predict the future.

As with all events with more than one stream, there’s things I missed, alas. On the whole things went really well, apart from ASDA who delayed and generally messed up the refreshments delivery. Boo to ASDA!

Yay! to local games developers, Rockstar Games for the booze etc, was first time I played with a wii on their new game, table tennis, and for general hilarity!

Thanks to Dom, Tom, Deb, Linda and Imran for all their hardwork. Looking forward to a two day event in the springtime!

HackDay London 2007 & Boxr.org

Attended Hackday London at Alexandra palace last weekend. Interesting panels and presentations, flickr machine tags by Dan Catt was hilarious, and Yahoo’s FireEagle was interesting too. Perhaps the name, “Fire Eagle” was too similar to other flying types of fire, as the venue was struck by lightning. This caused the building to think it was being attacked by fire and open up its windows, letting in the rain, thus soaking us and the electrical equipment. So the last presentation was cancelled.

Then the wifi (for me) was utterly non-functional, with a few computers having the same SSID for their ad hoc networks (BT Openzone). Fun Fun Fun!

My contributions were pretty minuscule compared with the end result, of our team (Frozen Indigo Angels) http://Boxr.org – a locative / location based game. Capture the flag but with static pay phones. Teams run to the payphones, ring up a skype bot, which records the number, which team is ringing and records the score… twitter feed for scores and yahoo map for live updates. Very neat! and probably the only Hackday hack that can still work after the weekend!