- curl on the mac seemed to require a mime type to be explicitly referenced like this:
curl http://localhost:3000/players --header 'Content-Type: application/octet-stream' --data-binary @someone.zip
- as we were using clojure I had to up the rock-paper-scissors game timeout as JVM startup was too long
Tuesday, October 04, 2011
London Clojure Dojo Robot Tournament
Tuesday, October 05, 2010
iTunes Connect Report Download
Although there are some paid and free options to obtain the data (or at least there were until Apple updated their website a while ago) as far as I know they all have to manually scrape it from the iTunes Connect website.
As I've been learning Clojure recently I thought it was a great opportunity for a mini-project to automate this process. The financial reports are the easiest to get as they are on 'real' pages.
Anyway if you'd like to automate the retrieval of the financial reports then give my script a go.
You can download it from:
Let me know how you get on.
Sunday, November 08, 2009
Erlets - Easier Erlang-Java interfacing
public class MyErletServer { @ErlangFunction(module="pinger", function="ping") public OtpErlangObject ping(OtpErlangObject arguments) { return new OtpErlangString("pong"); } public static void main(String args[]) { Erlets server = new Erlets("java@127.0.0.1"); server.addFunctions(new MyErletServer()); server.start(); } }This can then be called from Erlang:
$ erl -name 'erl@127.0.0.1' Eshell V5.7.3 (abort with ^G) (erl@127.0.0.1)1> rpc:call('java@127.0.0.1', pinger, ping, []). "pong"It's available here: http://bitbucket.org/dale.thatcher/erlets
Saturday, May 31, 2008
Silly Mii
Presentation
Program
Wednesday, May 21, 2008
Ruby: Debugging backticks
module Kernel alias_method :real_backticks, :'`' def `(cmd) puts "`#{cmd}` => #{output = real_backticks(cmd)}" output end end
Wednesday, April 23, 2008
Four pixel high font
Wednesday, April 09, 2008
HOWTO: Get wii-mote data into Android
In the previous post I demonstrated live wii-mote data going into Google Android. Here is how to replicate this for yourself.
Overview
A C program communicates with the wii-mote over bluetooth and outputs the accelerometer readings to a file. This is then read by a patched version of the OpenIntents sensor simulator and relayed into Android.
The bits
There are four main parts you'll need to get this going:
- http://dalethatcher.com/android-wii/wiiacc.tar.bz2 A small home grown C app that uses the CWiid library V0.6.
- http://dalethatcher.com/android-wii/wiimote-sensor-simulator.jar A patched version of the OpenIntents sensor simulator program that supports input from wiiacc.
- http://openintents.googlecode.com/files/openintents-binary-0.1.5.zip The OpenIntents binaries, which includes the sensors demo program.
- http://code.google.com/android/download.html The Android emulator.
Setup
Setting up each of the parts.
wiiacc
- Get cwiid-0.6.00.tgz if you need to and install it.
- Download wiiacc.tar.bz2 and unpack it.
- Run bootstrap.sh and then follow the instructions in the INSTALL file to build and install it.
- Run the program with the output filename as an argument. I use '
wiiacc wii
' in my home directory. - Follow the instructions from the program and if all is well you should start to see wii accelerometer data in the output file.
Patched Sensor Simulator
- Download wiimote-sensor-simulator.jar or build from the source if you prefer.
- Run "
java -jar wiimote-sensor-simulator.jar
" - Scroll down to the bottom of the settings window to the "Real sensor bridge" section.
- Enter the path to the output file in the text field (I use '
/home/dale/wii
') and select "Use Wii-mote accelerometer". - If all is well you should see the image of the mobile phone in the top left mostly match the movement of the wii-mote. I say mostly because the wii-mote works out it's orientation by gravity which means that it doesn't measure yaw. There is a good explanation here.
OpenIntents and Android
There are some instructions on the OpenIntents wiki here. However this is the short version:
- Unpack android and run "
tools/emulator
" - Unpack the open intents binary package and install the OpenGL viewer by running:
android_install/tools/adb install openintents-binary-0.1.5/OpenIntents.apk android_install/tools/adb install openintents-binary-0.1.5/samples/OpenGLSensors.apk
- When the emulator starts launch the OpenGL Sensors program and go to the settings menu, enter the most plausible IP address found under 'Possible IP addresses'.
- You can then test it's working by going to the "Testing" tab and clicking connect, you should see the wii accelerometer data.
- For some reason I usually find at this point you'll need to come out of the OpenGL Sensors app and go back in. However once I've done this selecting 'connect' in the menu works.