Drawing lots online

As a member of Toastmasters club I sometimes lead so-called Table-Topics in which I need to give participants tasks from a list of tasks – randomly, without repeats (unique task per participant).

I’ve used a free iPhone app in which I could configure the texts of tasks and which returned a random result on shaking phone. But I wasn’t satisfied with it. First of all it had a fixed amount of item slots so I had to leave blanks for non-used slots, and often got blank instead of a result. And I was getting results that were already used – repeats – so I had to shake more and more until I got valid result. The number of slots was big enough though, but still it was also theoretically possible to have a need for more tasks than the slots in the app. So 3 downsides in total.

So I spent several hours to quickly code my own solution – in HTML+JS+CSS, so I could use it on desktop and on mobile easily.

Here it is: http://mvmn.ho.ua/lot.html?items=one;;two;;three…

It’s all single file HTML+JS+CSS, no external libs are used, so it can be cached locally and used offline. All the data (list of items to choose from) is going into URL. This imposes a limit on total text length unfortunately, but for me that’s not a problem – hopefully won’t be a problem for you either. Otherwise storing data in URL only makes it very convenient – again, you can use it offline, and there’s no need for a server-side storage, which makes it all work faster.

I also tried to make UI touch-friendly, and tested it on my good old iPhone 4.

The source code is on GitHub: https://github.com/mvmn/lot

A couple of screenshots from iPhone: Continue reading

Advertisements

SQLite: export BLOB to file; ToastMaster SpeechTimerz: export audio records; Apple CAF to MP3

UPD: Apparently the sqlite BLOB export stuff is a popular request, and my article on how to do it here with Java program source code is just too complex for people that aren’t familiar with Java. So I’m going to do a better one soon, with more complete Java program, precompiled for anyone to use. Stay tuned.
Done! Check this post.


UPD2: It seems JailBreak is not really necessary to get the files from SpeechTimerz – you can use tools like DiskAid or iExplorer to get files from your iPhone apps, JailBreak is not necessary for that (which is good, because it seems iOS5 on iPhone4 isn’t properly jailbreakable still, and for 4s and iPad2 there’s even no “beta” jailbreak).


Intro
There is an iPhone app called SpeechTimerz that (among others) I use for ToastMasters public speaking club meetings to perform “timekeeper” role. Besides helping to track/indicate time this app also records audio during speech time, so technically by the end of the meeting all speeches are recorded and can be listened to from the iPhone. But there is no audio export feature in the app, so there is no way to get recordings anywhere.

Having a jailbroken iPhone I have access to all files on it, so I decided to dig in this apps files to see where does the audio go and check wether I could get it out. And I succeeded.

What I found out was that audio (in Apple Core Audio Format) is stored in SQLite database as BLOB (Binary Large OBject) field. So once I’ve got my hands on the file the task was to extract BLOB values from it. It turned out to be a bit harder than I thought.

The final touch was to batch-convert Apple CAF (Core Audio Format) to MP3, which also took me a bit of digging.
Continue reading