Edinburgh Hacklab

Making stuff since 2010

Visit from The Software Society of Dundee

Ted explains to the Software Society how to operate the laser cutter with the lid open.

Ted explains to the Software Society how to operate the laser cutter with the lid open. Image courtesy of The Software Society.

On Saturday we had a visit from around a dozen members of The Software Society of Dundee, who are currently pondering upon setting up their own space. Ted, Gareth and Gandolf showed them round and talked a little about what we went through in setting up the lab.

We’re planning an away team trip to Dundee on the 8th May 2014 to talk to those who didn’t have the opportunity to travel down, and do a bit more of a formal presentation.


my task

"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)

MarkovControl Read the full article »

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 learning. This all day no experience required, introductory session for teenagers and adults will show you how to create your own electronically controlled projects from simple blinking lights to robots and music generators. All you need to bring is your laptop as all materials are provided, including your very own Arduino and kit to take home.

Full-day, running on 5th and 8th of April. More information and online booking…


Solder On!

Soldering is easy and we’ll show you how. Starting with the absolute basics, you’ll be shown the tools you need and how to make a solder joint, then you’ll be able to get stuck in! Including your very own kit to solder and take home, this is your chance to learn a vital hacking skill.

Evening, running on 7th and 14th of April. More information and online booking…


Extreme Soldering: Surface Mount Components

Surface mount soldering isn’t hard! It might look it because of the tiny components, but we’ll show you it’s really not that scary. Including your very own kit to build and take home, this session will show you the tricks and techniques to help you solder on.

Evening, running on 9th and 16th of April. More information and online booking…


Taking Arduino to the Next Level

If you’re an experienced Arduino user, bring your project and your laptop and let Edinburgh Hacklab help you take your programming to the next level. This all day session will cover a wealth of advanced Arduino topics: find out how to update a display without missing any button presses, learn how to make your project talk to advanced sensors and devices and discover ways to make your project permanent and avoid a rats’ nest of wires.

Full-day, running on 12th and 15th of April. More information and online booking…

Thursday 20th: 3D printing with the Ultimaker 2

Ultimaker 2 test printsHacklab 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 experimenting in different filament materials including PLA, PLA-flex, XT, PLA/PHA, and ABS. Come down and join us on Thursday 20th at 19:00 to possibly see a working 3D printer. If you have a working 3D printer of your own, feel free to bring that down too and we’ll have a play!

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! Read the full article »

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!) Read the full article »

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)


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.

Read the full article »

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









new state for center cell










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 January 2:30 – 5pm £18/20 [Information & Registration]

Arduino Workshop

Saturday 1st February £35/£40 (+ £20 for Arduino) [Information & Registration] Whilst on the subject of Christmas, Roshenac a graduate from our November Arduino workshop sent us through a link to some Christmas light hacking she did. Check out how it was made in the Instructable

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. Read the full article »