Category: development
-
How long should it take to solve the FizzBuzz coding question?
So, it was past midnight, and I was pretty much done for the day when one of those random thoughts ran past me like a fleeting glimpse (thanks, Roger) and I just couldn’t let go: if I were asking a candidate to solve the FizzBuzz problem, how long would be fair to expect them to…
-
Integrating Open Policy Agent with Spring Security Reactive and JSON Web Tokens
We present a Java library that simplifies adopting the Open Policy Agent server to manage user authorization for a Spring Boot microservice, while also managing API Token (JWT) authentication. Motivation Spring Security assumes a fairly simplistic Role-Based access control (RBAC) where the service authenticates the user (via some credentials, typically username/password) and returns a UserDetails…
-
Modern C++: Implementing a Merkle Tree
Merkle Trees store a hash of the sub-tree in each of the Nodes, so that the whole tree’s contents can be validated against tampering.They are used, for example, in Bitcoin’s blockchain, and in Cassandra to validate replicas.In this article, we will show how to implement a generic Merkle Tree using features of Modern C++. Previous…
-
A python notebook to experiment with the Apache Mesos HTTP API – Part 3 of 3
This is the third and final part of a three-part series: Part 1 describes the required setup and how to get Apache Mesos Master and Agent running in two Vagrant VMs; Part 2 shows how to connect to the HTTP API and accept resource offers. This series is an extended (and updated) version of the…
-
libprocess – an Actor-based inter-process communication library
Introduction to libprocess In Apache Mesos we make heavy use of the Actor model implemented in the libprocess library: the most recent implementation can be found under the 3rdparty folder in the Mesos repository (here). libprocess was created originally at Berkley by Benjamin Hindman who is also the original creator of Mesos and implements “an…
-
The art of the command line
This is a very hand summary of daily useful tasks to be used on the command line The Art of the Command Line as the author notes, you can’t really call yourself a “true” developer, if you are not comfortable executing at least basic tasks in a shell. in fact, I would argue, I would…
-
Using Stout to parse command-line options
A new post of mine has just been published on Mesosphere Blog: Almost every program needs to parse some form of command-line argument. Often, this is a pretty large set of possible options, and the management of the various options is usually pretty tedious while adding virtually no value to the program’s functionality. Google’s gflags…
-
HOW-TO Build Mesos on Mac OSX – Eclipse
Update – El Capitan upgrade If you have recently upgraded to El Capitan (OSX 10.11.1) your Mesos build may be broken, due to “missing libapr-1 headers”: ../configure will cause the following error: libapr-1 is required for mesos to build. To resolve, install `apr` using `brew` and then add the `–with-apr` flag to `../configure`: brew install…
-
Do Not Allow Bad Smells In Your Code
Smelly Code I have recently been involved in a distributed SaaS application that was originally built by an offshore team; the chosen technologies (REST, Java, MongoDB) were actually valid technical choices for the problem at hand: they then proceeded to get it spectacularly wrong with a bloated (and unmanageable) data schema and an even worse…
-
Data-driven tests for Spring Data (MongoDB)
When testing a project that uses Spring Data repositories, we may want to insert ‘known-good’ data into arbitrary MongoDB collections, reading it, for example, from JSON iles (typically somewhere in the test/resources subtree). However, some of the data stored in Mongo is in BSON format, which extends the plain JSON format with some Object types…