Let A Dinosaur Show You The Future

Our lives in the 21st century are in part governed by a series of systems which we rarely encounter directly but which can have a great impact upon our lives. The oil futures market, for example, for which [Igor Nikolic] has created a real-time visualisation in the form of a clock in which the “hand” is a plastic dinosaur (As ever, XKCD reminds us that oil contains homeopathic quantities of real dinosaur, but it makes a good talking point).

The clock is part of a series continuing from his previous grid balance lamp project which monitored supply and demand in the electricity grid, and takes a feed of oil futures pricing to an MQTT server which is then picked up by an ESP8266 in the clock. The dinosaur hand is attached to a stepper motor, the position of which is set according to the market movements. There are also three LEDs whose colours change according to price. The whole is mounted on a plaque made from the top of an oil drum, and placed for effect over a map of the Port of Rotterdam, one of Europe’s busiest trading hubs.

Monitoring of these invisible socio-technical systems is a fascinating subject, and in the past we have brought you news of the very real impact they can have on entire continents when international politics intrude.

Thread Carefully: An Introduction To Concurrent Python

The ability to execute code in parallel is crucial in a wide variety of scenarios. Concurrent programming is a key asset for web servers, producer/consumer models, batch number-crunching and pretty much any time an application is bottlenecked by a resource.

It’s sadly the case that writing quality concurrent code can be a real headache, but this article aims to demonstrate how easy it is to get started writing threaded programs in Python. Due to the large number of modules available in the standard library which are there to help out with this kind of thing, it’s often the case that simple concurrent tasks are surprisingly quick to implement.

We’ll walk through the difference between threads and processes in a Python context, before reviewing some of the different approaches you can take and what they’re best suited for.

Continue reading “Thread Carefully: An Introduction To Concurrent Python”