I should've made this

When checking my twitter feed an eerily incomprehensible series of tweets from Ryan McLeod (of Consolevania and VideoGaiden fame) popped up.

The reason they were familiar is that they use Markov Chains to generate sort of original looking tweets, and I had previously done something similar to recreate a gibberish talking Brian Cox bot. I had hoped that the  bot would use the word "billions" a lot like Brian does in "Wonders..." but he just ended up tweeting nonsense to Brian's wife so I canned him.

Anyway the service is quite cool and I wish I had taken my stupid Brian Cox not idea a bit further and made it myself but never mind! 

Check it out: http://yes.thatcan.be/my/next/tweet


hiding Foreign Policy's social media popup

Foreign Policy has an annoying lightbox which occasionally pops up, prompts you to sign into facebook and prevents you from viewing articles until you sign in.

If you create a new bookmark with the text below as the address you can click it to hide this popup and read the story without logging in:

javascript: (function(){document.getElementById("TB_window").style.display = "none";document.getElementById("TB_overlay").style.display = "none";}());

taps aff

Definitions

taps aff: /tæps æf/, interjection

The removing of one's shirt or other upper body garments, most often in the event of warm weather but also often for purposes of celebration or simple antagonism.

Also
 taps.af: /tæps dɒt eɪ ɛf/, website

Weather service at http://taps.af borne of a drunken evening's nonsense talk followed by Easter Sunday morning in bed learning to use CherryPy and Heroku. Given a location a one word verdict on the weather is decided: "AYE" (indicating warm weather) or "NAW" (denoting colder, more unpleasant weather)

Screenshots


dcraw and stdin

You may or may not have noticed that dcraw.c has a "-I" command line argument reserved for read_input_from_stdin, however it doesn't as yet do anything - when you attempt to use it you'll see that dcraw outputs "No files to process" and quits. I crafted a quick-n-dirty hack to allow you to use this functionality.

Just apply the patch to dcraw.c and you're all set:

$ cat _MG_2184.CR2 | dcraw -e -v -w -I
Writing data to /var/tmp/tmp.0.thumb.jpg ...

It's rather shoddy but it did what I wanted it to do. One happy/weird side effect of how I implemented it (writing stdin to a temp file and stuffing the filename into argv[]) is that as well as converting from stdin it will also take care of any RAW files supplied as a command line argument:

$ cat _MG_2184.CR2 | dcraw -e -v -w -I _MG_2041.CR2 
Writing data to /var/tmp/tmp.0.thumb.jpg ...
Writing data to _MG_2041.thumb.jpg ...

The reason I employed this hack rather than substituting stdin for the FILE* objects used by dcraw to open and read the files was that fseek() was used at various points, and it doesn't play nice with stdin.

iTunes: Agree to what?

I installed iTunes 11, and hit "Agree" when the all-too-familiar license agreement appeared (which may have been a bad idea) and it opened to greet me with this:

I have no idea what I'd be agreeing to if i hit "Agree", perhaps the irritating and false assertion that "iTunes is the simplest way to enjoy your favorite [sic] music, movies, TV shows and more on your computer".

Awkward Texter (SL4A/Python is fun)

Have you ever felt like there's not enough awkward moments in your life? Well I have the solution in 3 easy steps!

1. Download SL4A by doing scanning the QR code below

2. Download the Python libraries for SL4A:

3. Paste this badboy in and run

SL4A is my favourite App. Now I just need to figure out how to use the text-to-speech interface in voice conversations...

I got bored and recreated donut.c in C# (aka donut.NET)

While waiting on a release to finish, I got thinking about donut.c, then got more bored and made it in C#

Sincerest apologies to Andy Sloane, the formatting is awful and to be honest it's pretty much just his code line-for-line but in c#. I'm not sure if the worst part is my templated memset() or the nl() function (which inserts a new line in the buffer passed to Console.Write()). Hideous. It does manage to generate a passable torus rotating through two axes, however:

Blackbox on Mac OS X

Blackbox is a lightweight X11 window manager I used to use when I used linux as my main OS. The only UI elements on display by default is a small bar down the bottom to control what workspace you are using (called the "slit") and you can launch programs and configure blackbox from a menu visible when you right click the desktop:

It's quite nice to use something so uncluttered after the colourful noisy UIs I'm used to, so I figured I'd see if it's possible to use it under OS X and share the steps involved.

As a prerequisite make sure you have XQuartz installed as well as either Xcode or the Command Line Tools for Xcode. To get a working copy of blackbox you can either use MacPorts or build it from source by hand:

1a. MacPorts (easy)

First install macports, and open up a terminal window and enter the following

   $ sudo port install blackbox   

All the requisite dependencies should be downloaded for you and once it's complete you should have a functional blackbox binary installed in your system.

1b. Build by hand (less easy)

You'll likely need to download and install the following, as they're not provided by default in OS X (well one version of libtool is, but it's not what you want. To prevent overwriting this we'll use --prefix=/usr/local). I hacked together a script you can just copy + paste into your terminal (you'll need to enter your password to allow the `sudo make install` step to work.

Next grab the blackbox sources:

   
 $ cvs -d:pserver:anonymous@blackboxwm.cvs.sourceforge.net:/cvsroot/blackboxwm login </br>   
 $ cvs -z3 -d:pserver:anonymous@blackboxwm.cvs.sourceforge.net:/cvsroot/blackboxwm co blackbox   
 $ aclocal & autoheader && automake && autoreconf -i 
 
And do the standard ./configure && make && sudo make install malarkey. I ran into an odd error during ./configure where something to do with xft was dying. Running with -disable-xft didn't help, so I opted to skip it from the build by hand - you can do this by downloading this patch...

and then applying it + building:

  
 $ patch -P0 < fix_xft.patch 
 $ ./configure   
 $ make   
 $ sudo make install 

2. Configuration

By now you should have a working blackbox binary in /usr/local/bin. Now create an .xinitrc

  
 $ cat << END > ~/.xinitrc   
 PATH=$PATH:/usr/X11R6/bin   
 export PATH   xterm &   
 exec /usr/local/bin/blackbox   
 END 
 

3. Launch!

Open up XQuartz, go to Preferences and tick the "Full-screen mode" box, and on your keyboard hit ⌘-⌥-a (press and hold command, option and "a") and you'll see a lovely blackbox desktop. You can use the same sequence to switch back out of XQuartz and see your OS X desktop again.

Palestine in iOS Maps

There's been a lot of criticism of the new iOS Maps app, and rightly so. However I'm not going to go down that path here. In a previous post I was puzzled by the omission of Ramallah and Bethlehem from all but the closest zoom levels of Google Maps. Well by accident or otherwise Apple have correctly identified where they are at roughly the same zoom levels.

Sadly they have also missed out about 70% of my adopted hometown of Brno's city centre - the big empty blob in the middle should be a feast of winding alleys, cobbled roads and wide squares: