Tutorials

Testing Akka Performance

Few weeks ago I attended a workshop called “Understanding Mechanical Sympathy” ran by Martin Thompson. During that workshop we written and tested few concurrent programming techniques and as a first exercise we have written a simple Ping-Pong program: package uk.co.real_logic; import static java.lang.System.out; /* Original exercise did during "Lock Free Workshop" by Martin Thompson: http://www.real-logic.co.uk/training.html */ public final class PingPong { private static final int REPETITIONS = 100_000_000; private static volatile long pingValue = -1; private static volatile long pongValue = -1; public static void main(final String[] args) throws Exception { final Thread pongThread = new Thread(new PongRunner()); final Thread pingThread = new Thread(new PingRunner()); pongThread.

How To Setup Garmin 310XT To Work With Linux

In this post I intent to provide a overview of the steps that need to be performed to setup Garmin 310XT GPS Sports Watch to work with Linux (Ubuntu). (This tutorial should also apply to other similar Garmin GPS Watches -Garmin Forerunner 60 – 405CX – 310XT – 610 – 910XT) Install Required Packages sudo apt-get install python-pip python-qt sudo pip install pyusb Install GFrun GFrun is the program that you can use to download recorded workouts from your watch.

How To Setup CI Build Pipeline With Travis CI, Heroku and sbt

This post covers all steps that are required to setup a Continuous Integration (CI) build pipeline using Travis CI as a main driver for deploying our Play application written in Scala to Heroku cloud. Expected end result: After each commit to the master branch of my Github project, I’d like to run full test suite. Following that, each successful build, should trigger a deployment to Heroku. If the tests fail, application should not be deployed.

Scala Case Classes vs Enumeration

After my previous post which was received quite nicely, I wanted to write a little bit more about the topic of designing Typesafe Domain objects, this time I’ll focus on the problem of how to model a deck of cards in Scala. I’ll go over 2 different approaches you might take when designing a solution to the problem of card games in Scala. I’ll try to show how this can be done with Case Classes (Sealed Case Objects) and Enumerations.

Typesafe Domain Objects in Scala

Today I’d like to cover the topic of how to approach type safety in Scala in case of the simple domain of players in free to play games - this is a real example from a past project of mine. If you have played any of the free to play online games, you are already aware that these games every often have 2 kinds of currencies: In game cash or points that can be earned and spent during the game play

Fix screen flashing problem with redshift

As an alternative to flux I use redshift on my Linux machine. Recently I stumbled upon very weird problem – each time I close Java desktop app and redshift was active, the screen flashed. It was a very quick change that looked like redshift was disabled and then enabled again. I was starting redshift like this: redshift-gtk -l manual -l 51.126:17.033 After trying out few configuration options it turns out that changing video method to vidmode was the right solution for my problem:

How to put custom messages into Bitcoin blockchain - OP_RETURN

I have spent last few days looking very closely at OP_RETURN features. This blogpost summarizes my findings and thoughts. Bitcoin transactions – recap Every bitcoin transaction creates outputs (called transaction outputs, sometimes called txout) from one or more transaction inputs. All except one type of these transaction output types will create spendable outputs (called unspent transaction outputs – UTXO), the type that behaves differently is OP_RETURN The UTXO are tracked and stored by every full node (btcd or bitcoin-core/satoshi client).

Add code coverage metrics to your maven project

While working on the bitcoinj project I have added support for code coverage collection and tracking. This post summarizes steps you have to take to add that for your own maven projects. Figure out what type of code coverage you want For the bitcoinj library it is important to have a “unit test coverage” - it works by verifying which parts of the source code are reached during unit testing phase during build process.

Signing Android App With Gradle Using CLI

Recently I stumbled upon a problem of creating a signed Android app via command line, after spending some time on this, I have decided to post following tutorial. This problem exist in 2 situations. For example when you want to share your application publicly, but do not want to share any details about your signing key or you would like to automate building process using some kind of CI server.

DynDNS at OVH

When you want to use a domain name with dynamic IP address, very often you’ll either have to use one of paid or free providers like http://dyndns.com/, http://duckdns.org/, etc… But it turns out that most of DNS providers offer dynamic DNS solution, in many cases it’s not very widely advertised. I use OVH for my domains, and after some time spend looking around, it turns out that they also support dynamic DNS.