Eigentesting

"connect 80k simultaneous clients, logging in and out at an overall rate of 50Hz, and requesting pages at an overall rate of 100Hz"

lets model a client as a random walk on a state graph (a Markov chain), where the action taken by a client is drawn from a distribution conditioned on the current action. (TL;DR we will bootstrap frequency estimates from this representation using eigenvectors)

New workshops for the Science Festival!

Missed out on our recent Arduino or soldering workshops? You’re in luck! In April, we’re running workshops as part of the Edinburgh International Science Festival. We have four different workshops in the Festival programme, each one running twice during the two-week Festival: Getting started with Arduino Arduino is an easy to use microcontroller platform designed for Read more about New workshops for the Science Festival![…]

Thursday 20th: 3D printing with the Ultimaker 2

Hacklab member Gary Martin has a new shiny gadget: an Ultimaker 2 3D printer. This Thursday from around 19:00 Gary will host an informal workshop to demo some of the software, print some widgets, and bring along his stash of test 3D prints for closer examination (some seen in the photo above). Gary has been Read more about Thursday 20th: 3D printing with the Ultimaker 2[…]

Remove redundant brackets from expressions with Falafel

I am writing a static analyser for Firebase. My approach to precedence and brackets has always been, if in doubt, whack a bracket round it. Unfortunately when writing code generation tools my output ends up with more brackets than logic :s

Anyway, I was having trouble debugging my generated code, and it was impossible to reason why it wasn’t working what with all the brackets. So I kept with maximum bracket insertion in the 1st pass (a reliable strategy), but wrote a function for removing ALL redundant brackets from a Javascript expression post 1st pass (easier to read). It took a while to get right but I was very pleased with the brevity.

So the expression: (4 + 6) * 6 needs its brackets to operated correctly, but (((4) + (7) * 8) has a number of pointless brackets in it. There are some tricky cases like 5 / (7 * 6), which requires brackets despite * and / having equal precedence. To understand why 5 / (6 * 7) needs brackets you have to understand that when operators have equal precedence, by default, they associate to the left. Anyway the code to actually do this turned out to be super compact so I share it with you!

I used node-falafel which is an awesome package that allows in place source code rewrites during a bottom up parse. Woah! The function “simplify” takes an expression as a string, and returns a functionally equivalent expression but without the pointless brackets in it. Nice!

Game Jams: Preparing for the best

With the 2014 Global Game Jam fast approaching I have been asked a few times by new participants what they should take with them, and how they should prepare. Wikipedia defines a game jam as “a gathering of game developers for the purpose of planning, designing, and creating one or more games within a short span of time“, they are a wonderful experience for anyone interested in game development. They are often suited to any level of experience, as participants can form themselves into teams with total strangers of compatible skill-sets. Often people will volunteer to take a role that they know little about, experiencing a new side of the development process or polishing rarely used skills.

The Global Game Jam is a yearly event, taking place simultaneously around the world with a single theme given out to all participants. The event itself lasts for 48 hours, a very long time to be awake and developing, but a very short time to put a project together with a team of people you may have never met before! This makes it quite an exciting challenge that deserves at least a little preparation and planning! To that end I’m going to give you a few ideas and tips from my own experience. Ultimately a game jam is about being yourself, creating something, and having fun. There is no right and wrong, and it’s not a competition! Your experiences will vary, and my suggestions are only a rough guide. (Please note that none of the links in this post are affiliate links!)

Firesafe: A Prophylactic For Firebase

Firesafe has just been developed and uploaded to github

Firesafe is a technology to enforce data integrity, and enable complex transactions, on Firebase.

Firesafe compiles hierarchical state machines (HSM) definitions into Firebase security rules. The Firesafe HSM language is expressive, and a super set of the Firebase security language. Adding consistent, concurrent and fail safe protocols to Firebase is now a whole lot simpler (e.g. cross-tree transactions).

Firebase is already the future of databases, offering scalable low latency database-as-a-servie. Firesafe, compliments this amazing technology with an expressive syntax to get the most out of its security model. (Firesafe is not endorsed by Firebase)

Motivation

In multiplayer apps/games, people cheat. It’s a loss of direct sales, AND the free loaders also diminish the fun for everyone else. Multiplayer games are webscale, which means the old solutions to data integrity and transactions don’t work (e.g. SQL).

Firebase solved one problem of the cost of providing low latency persistent data storage to mobile and desktop games. It’s the first scalable NoSQL hosted solution that didn’t suck. It also provided an unorthodox security and transactions abstraction. Turns out that abstraction has enough purchase to do some really cool things not possible in many NoSQL environments. Unfortunately, properly configuring the security layer is extremely verbose and error prone. Firesafe makes it easy.

Weaving Wolfram Rule 90

I’ve been interested for a while in cellular automata, pattern generating mathematical formulae such as Rule 90

There are many of these rules, each generating different behaviour. Each rule generates the content of cells in a column based on the cells in the preceding column, and are each based upon given starting conditions.

These are the rules for Rule 90:

 current pattern 111 110 101 100 011 010 001 000 new state for center cell 0 1 0 1 1 0 1 0

Start 2014 with a Edinburgh Hacklab Workshop

We are repeating the very popular Soldering and Arduino workshops in the new year. Ideal as Christmas presents, especially for those often hard-to-buy-for geeks in your family. No previous knowledge of soldering, electronics or programming is required, we start with the basics and help you to learn at your own pace. Soldering Workshop Saturday 11th Read more about Start 2014 with a Edinburgh Hacklab Workshop[…]

The main trick in Machine Learning

I have been irritated that many recent introductions to machine learning/neural networks/whatever that fail to emphasise the most import trick in machine learning. Many internet resources don’t mention it, and even good textbooks often don’t drill it in to the reader the absolute criticality to success the trick is. In a machine learning context, we wish a learning system to generalise. That is, make good predictions on data it has never encounter before, based on what it learnt during from a training set. There is no easy formula to predict the ability of a learning system to generalise, but you can estimate it using held out data. That held out data is labelled but it is not used in training. It is called the validation set.