Blog

Microbenchmarking Scala with JMH

Many times we find that there are multiple ways to write a piece of code and sometimes the choice may be determined by which implementation executes fastest. We might want to have a shootout between the different implementations to find out which one is fastest. The Java Microbenchmark Harness (JMH) tool can help us get an experimental answer to this type of question. The sbt-jmh plugin makes it very easy to execute JMH tests on Scala or Java code in…

Form-Based Login for Java WebSocket Client

Needing a Java-based WebSocket client, I started with Tyrus, the reference implementation for the Java API for WebSocket. Writing a simple Java WebSocket client with Tyrus went well enough — until I went to turn security on. The Web App I’m connecting to uses form-based login, and out of the box the only authentication support is for HTTP BASIC or DIGEST. But with a little custom code, connecting via form-based login turned out to be possible. Form-Based Login Mechanism First,…

Upgrading a WIMBoot Machine to Windows 10

Needing to drive a few touchscreen kiosks, I found myself in possession of some compute stick type devices. These are tiny but full-fledged computers, with an Atom CPU, 2 GB of RAM, and a 32 GB SSD. They shipped with Windows 8.1 with Bing. Naturally, I wanted to upgrade to Windows 10. There were a couple wrinkles. WIMBoot In poking around the existing Windows install, I found that some of the numbers didn’t add up. When I finally viewed the…

Basic Akka Actors

Anyone working on concurrent and distributed applications on the JVM should be familiar with Akka. Akka is an implementation of the Actor model that can be used from Scala or Java applications to provide a concurrency model that is designed from the ground up for systems spanning multiple machines. Defining an Actor The key abstraction in Akka is the Actor, which provides behavior and can store state. In Akka, actors are guaranteed to be run in a single-threaded illusion, which…

How can we help your company with your development needs?

Contact Us