Hackthevalley Hackathon 2017 Baar


After the good experience last year at the six fintech hackathon, I was trilled to go to hack the valley which is even closer geographically and whose subject is even closer to Bitcoin. My goal was to gain experience with ethereum. So far I only completed the tutorials. I found the technology very interesting, but in the past, I couldn’t come up with a good idea how to make use of it. Neither did I learn of a killer product that went live. This is in stark contrast to Bitcoin. When I first learned about Bitcoin, it was immediately clear to me that this was something very special, something that I waited for without knowing.

Team formation

In contrast to the hackathon last year, most people already showed up as teams. I estimate that only about three of the fourteen teams were formed on site. I joined three guys from a bank in Paris, along with another French guy and a South African who lives in Zurich. First we had to decide on a project. We went through a list with a couple of ideas. But it turned out that for a lot of them it was hard to justify what benefit a blockchain would bring compared to a more traditional approach. That is something I see a lot in the current blockchain hype. Showing up as a team with a formulated idea is a big advantage, as the technology and possible problem areas can be explored before. But In both occasions I enjoyed it to meet new and interesting people and see what we can achieve together in this limited time.

Our project

We settled on the challenge “fighting fraud in the supply chain” with a project that puts smart locks on containers. The devices log all open and close operation on a blockchain. Unlocking operations would have to be authorized by a smart contract. The locks communicate with bluetooth low energy with an app on a smart phone. This in turn communicates to a backend that talks to the blockchain.


Shortly after we had the rough concept, the other team members stated that they would feel more confident implementing the smart contract in java, rather than solidity. That’s why they voted for using hyperledger instead of ethereum. Setting it all up and getting the docker containers to work proved a lot more difficult than anybody anticipated. Not only had some team members Windows machines, but also on linux we faced a problem. Namely the docker containers were configured to use the google nameservers, while apparently all outside DNS was blocked by the Thomson Reuters network. The connectivity was generally very flaky.


I enjoyed working with the team. But that we didn’t know the infrastructure we were working on, complicated our work considerably. The last time I programmed seriously with Java was probably 15 years ago. And we didn’t have good tool support within the environment. I’m sure it is possible to set everything up to work comfortably, but that would have cost us more time even than we lost with the complicated turnaround cycles. In the end, we couldn’t complete our prototype in time. Sure, that is is not a strict requirement of a hackathon. But it’s the pride and goal of every software developer to have the thing perform in a live demo.

Presentations and prize giving

As is common for events like this, the quality of the projects varies wildly. I think nobody in our team expected to be in the top ranks. Even though I must say the presentation looked better than my code.
The project that I liked the most was about subleasing parking spots while people don’t need them. I could imagine something like this generalized to become a decentralized form of AirBnB.
The winners were the same people that won the London HackEthon. During the presentation I thought it rather boring. It was about heart rate sensors publishing directly to ethereum. A smart contract would then take action if the data was out of order. Only after they received the price, I thought some more about it. In hindsight I can see the value in it, and that it was probably implemented better then most other projects.


Thanks to Thomson Reuters and all others involved for organizing this great event!
I hear a lot from Bitcoin maximalists that all other chains can’t compete with the one true blockchain. I’m also invested most in Bitcoin, but I want to be open to the possibilities of other blockchains and smart contract platforms in special. Although I must admit, I never saw a compelling reason for permissioned ledgers and private blockchains. A week before the event I learned about Bitcoin uncensored, and listened to a couple of the episodes. They essentially debunk most of the altcoins and blockchain projects. Calling them ponzi schemes and frauds. This made me skeptical of the blockchain boom, but all the more I was keen to discover good uses at and event full of blockchain hackers. I’m still positive that there are applications that can be improved with blockchains. But most of the ideas have to be descarded upon closer inspection. The only three practical uses for blockchain so far are monetary, timestamping and naming. I am looking forward to expand this list, but it’s not as easy as it seems at first.

Meeting C++ 2016

This is my first time at Meeting C++ in Berlin. I came here with my boss Andi. To profit more, we split up during the talks. Afterwards we shared what we learned.
I will complete this post later, and add links to the presentations and videos as they become available.

I attended the following talks:

Opening Keynote by Bjarne Stroustrup

He talked about the evolution and future direction of C++. Explaining the guiding principles and philosophy of the language. He also explained how the standards committee works, and that even he himself is sometimes over voted. He could tell that and even name the people of other opinions without any bitterness. Very professional and focused!
The main point that sticked out was: “zero overhead abstractions”

C++ Core Guidelines: Migrating your Code Base by Peter Sommerlad

Unfortunately Peter Sommerlad was sick and couldn’t come. So Bjarne Stroustrup agreed ten minutes before his own keynote to jump in, and give the talk without any preparation. He claimed never to have had a talk about this topic. He had some slides with the name of his employer, and he jumped around in those slides. Other than this barely noticeable detail, you couldn’t tell that the talk was not prepared. He talked about how to use the [GSL](https://github.com/Microsoft/GSL) in new code. But the main focus was on how to gradually improve old legacy code by introducing the types the GSL provides. In the future there should be even tools to perform the task automatically.

Reduce: From functional programming to C++17 fold expressions by Nikos Athanasiou

He started out by showing how fold can be performed at runtime with std::accumulate(). Then he gave some theory and showed the syntax of other languages such as: haskell, python and scala. The C++17 fold expression operator doesn’t just add syntactic sugar, but open up a load of new possibilities. With constexpr functions, the folds can be evaluated at compile time. As a consequence they can not only operate on values, but even on types. The talker shared with us how he broke his personal error message record: During his experiments he got an error with a quarter of a million lines!

Implementing a web game in C++14 by Kris Jusiak

In this talk we witnessed how a relatively simple game can be implemented with help of the following libraries: ranges, dependency injection and state machine. The code was all in pure C++14 and was then compiled to asm.js and/or webassembly using emscripten. The result was a static website that runs the game very efficiently in the browser. In the talk we were walked through the different parts of the implementation. In contrast to a naive imperative approach, after the initial learning curve this can be maintained and extended a lot easier.

Learn Robotics with C++ in 1 hour by Jackie Kay

We didn’t actually learn how to program robots. First, she walked us through some history of robotics. By highlighting some of the mayor challenges, she explained different solutions, and how they evolved over time. Because robots run in a real time environment and have lots of data to process, performance is crucial. In the past the problems were solved more analytically, while nowadays the focus is on deep learning with neuronal networks. She had a strong emphasis on libraries that are being used in robotics. To my surprise, I knew and used most of them, even the ones she introduced as lesser known such as dlib.

Nerd Party

In the evening there was free beer in the big underground hall. There was no music, so that people could talk. Not really how you would usually imagine a party. We had a look at the different sponsor booths, and watched some product demos. After a while we went up to the sky lounge in the 14th floor with a marvelous view over the city.

SYCL building blocks for C++ libraries by Gordon Brown

Even though I experimented with heterogeneous parallel computing a few years ago, I was not really aware what is in the works with SYCL. My earlier experiments were with OpenCL and Cuda. They were cool, but left a lot to be desired. I never looked into OpenAMP despite the improved syntax. In Contrast SYCL seems to do it right on all fronts. I hope this brings GPGUP within reach, so that I could use it in my day to day work sometimes. In the talk, he showed the general architecture, how the pipelines work. Rather than defining execution barriers yourself and schedule the work, you define work groups, and their dependencies. SYCL then figures out how to best arrange and schedule the different tasks onto the different cores. Finally he talked about higher level libraries where SYCL is being integrated: std parallel algorithms, tensor flow and computer vision.

Clang Static Analysis by Gabor Horvath

During this talk we learned how static analyzers find the potential problems in the code to warn the developers about. Starting with simple semantic searches, through path tracing with and without branch merging. Bottom line was that there is no one tool to beat them all, but that the more tools you use, the better. Because they all work differently, each on can find individual problems.

Computer Architecture, C++, and High Performance by Matt P. Dziubinski

This talk made me realize how long ago it was, that I learned about hardware architectures in school. Back in the day we thought mainly about the simple theoretical model of how an ALU works. The talk made clear how you could boost performance by distributing the work to the different parallel ALU’s that exist within every CPU core. In the example he boosted the performance by two simply by manually partially unroll a summation loop. Another important point to take home is the performance gap between CPU and memory access. Even for caches, it is widening with every new hardware generation. Traditional algorithm analysis considers floating point operations as the expensive part. But meanwhile you can execute hundreds of FLOP’s in the time it takes to resolve a single cache miss. On one side he showed some techniques to better utilize the available hardware. And on the other hand he demonstrated tools to measure different aspects, such as usage of the parallel components within the core, or cache misses. With so diverse hardware it is really difficult to predict, thus measuring is key.

Lightning talks

The short talks were of varying quality, but mostly funny. As with a good portion of the talks, there were technical difficulties with connecting the notebooks to the projectors.

Closing keynote by Louis Dionne

C++ metaprogramming: evolution and future directions
We both didn’t know what to expect from this talk. But it proved to be one of the best of the conference. He started out by showing some template meta programming with the boost::mpl, transitioned to boost::fusion, and landed at his hana library. The syntax for C++ TMP is generally considered insane. But with his hana library, types are treated like values. This makes the compile time code really readable and only distinguishable from runtime code at a second glance. True to the main C++ paradigm of zero overhead abstraction he showcased an implementation of an event dispatcher that looks like runtime code with a map, but actually resolves at compile time to direct function calls. Cool stuff really. Leveraging knowledge that is available at compile time and use it at compile time. He even claimed that in contrast to some other TMP techniques, compile times should not suffer so much with hana.


C++ is fancy again!
I have been programming professionally for about 17 years. In all this time C++ has been my primary language. Not only that, it has also always been my preferred language. But there were times where it seemed to be stagnating. Other languages had fancy new features. They claimed to catch up with C++ performance. But experience showed that none ever managed to run as fast as C++ or produced such a small footprint. The fancy features proved either not as useful as they first appeared, or they are being added to C++. In retrospect it seems to have been the right choice to resist the urge to add a garbage collector. It’s better to produce no garbage in the first place. RAII turns out to be the better idiom as it can be applied to all sorts of resources, not only memory. The pace with which the language improves is only accelerating.
Yes, there is old ugly code that is using dangerous features. That is how the language evolved, and we can’t get rid of it. But with tools like the GSL and static analyzers we still can improve the security of legacy code bases.
Exciting times!


After a long pause, I just started attending a MOOC again. It’s on Coursera, from Princeton and it’s about BitCoin. In one of the first lectures the teacher goes through some simple hypothetical digital coin concepts. I don’t know if the lectures are publicly available piecewise, but as a whole they are at youtube. Jump to minute 50 for scroogecoin.

Name property problem
GoofyCoin signed receipts double spend
ScroogeCoin centralized blocks corruption
BitCoin fully decentralized solved


ScroogeCoin reminds me a lot of the blockchain projects a lot of big financial institutions announced over the last few months. They talk about permissioned blockchains. That sounds like exclusive access and centralized control. BitCoins inclusiveness is one of the important characteristics, and I hope enough people recognise it as such.


trading agents

I always considered finance and accounting as the most boring things you can do with a computer. And while you can earn big bucks, working for a Swiss bank, I have always preferred topics with a more physical background.

But BitCoin got me interested in how some aspects of the established financial systems work. Looking at the bitcoin price fluctuations, I long suspected that it should be possible to write a trading agent to exploit the volatility. It could follow some fix pre-programmed rules, or find the rules by itself using machine learning. All the data it would need to work on, is easily available.

Last summer started btcrobot, a service that promised just that. They have a subscription model, and I’m sure, if it doesn’t work out, they still gain and the users loose. I didn’t really want to pay hundreds of dollars just to find out if it works. And to be honest, the whole site smelled like a scam.

So I completed the Coursera class “Computational Investing 1“. It was more about portfolio management and algorithmic trading of stocks. But a lot of the material can be applied to currency trading and in special to bitcoin as well. In the homeworks we built a small trading agent and portfolio optimizer. The main metric we used was the Bollinger Bands technical indicator.

So I started implementing a bitcoin trading agent that would use bollinger bands. I didn’t want to start completely from scratch, so I skimmed through github and sourceforge for a starting point. I selected funny-bot, and started extending it. But soon, my interest switched to other projects. Remember, finance is not my primary interest. In the last months I had an eye on the exchange rates, trying to see how such an agent might perform. And I think it would be very difficult to tune, at least without experience in that field.

Last week I found out again that I suck at trading. The bitcoin price started rising like cracy. I thought if it goes up so fast, it must come down again. In a rush, I sold some of my bitcoins. I wanted to buy again after the price would crash. But the price kept rising, and I would have gotten a lot more if I sold them just two days later. Apparently I was not alone with my false prediction.

Computational neuroscience class

This year didn’t start out so great for my online classes. I signed up and started a bunch, but quit all but one so far. Some were not as interesting as I thought, some didn’t contain enough new stuff or the material covered was too different from what I expected. I just couldn’t motivate myself to invest the time and effort to complete them. Maybe it’s not as exciting as it was for the first few classes or maybe these teachers are just trying out a new channel and are not as determined and enthusiastic about this new form of education. For me personally, the first MOOC that I completed, the introduction to AI is still the best.

Finally I found a class that I was keen enough to complete. That was about computational neuroscience. I read some books about neurology before, and was familiar with the basic structure of neurons and synapses as well as with some neuro transmitters such as GABA. But the details about ion channels and their detailed behaviour was new to me. The calculations with the spike voltages and spike triggered averages were very interesting. They highlighted to me just how simplified the common perceptron neural network models are. The second part of the class that was more about the application of the insight from the biological neuroscience into artificial intelligence and machine learning was more familiar and partly repetition.