Monday, July 24, 2017

Adafruit Trellis must have 30 ms delay between key reads

A bit disapointed by the Trellis requirement to have delay (30) ms in the Arduino loop (default is 30, it worked on 25ms setting). Apparently Trellis is using HT16K33 that in order to scan 39 key matrics (even Trellis exposing 16 keys) according to specs requires 20ms to complete the whole internal scan loop. The delay may be noticable in applications that require faster response than 20ms e.g. music instruments or gaming controllers.

BTW. This blog post explains details about HT16K33

Sunday, November 27, 2016

Eclipse Memory Analyser

That is probably by far the best heapdump analyser tool I've ever used. It provides immediate suggestions to problem but as well allows to drill into details of heap and navigate object tree. Understand how much memory data structure utilise.

There are number of good articles on the subject. One of the good intro articles here.

I've found that I had to run tool with increased memory on Mac in order to open large heaps. To run it on Mac with extended memory (below is 6Gb) execute following command:
open -a mat --args -vmargs -Xmx6G
Hope it helped someone...

Wednesday, January 1, 2014

Re-try pattern using Akka actor / ask pattern

Hi there...

Thought of sharing a relatively simple gist of Retry akka pattern I came up recently. It could be useful in case Client actor sends request to another Service provider actor and request may have to be retried due to different reasons (network failure in distributed environment, service down or other...). To increase resilience Client attempts to re-try operation until either response is received or after number of retries exceeded Client simply gives up.

The pattern is quite generic and I thought it would be cool to have a pluggable re-tries for akka actors.

Wednesday, December 4, 2013

How to build 64 keys MIDI keyboard

Hi folks.... Been a long time since I've promised to write a post on how to build 64 keys midi keyboard. In fact this post will be on what needs to be done to extend the original post where we built midi keyboard from 32 key piano toy. In this case, of course, you will require a toy with more keys... I have not seen much of the toy pianos with 64 keys (have you?) but I guess you could build a matrix from scratch yourself using push buttons (that is fun!)

Monday, October 28, 2013

Hello RPG... Or writing an RPG game template using Scala, Playframework, Akka, Websockets, Crafty...

After playing with Typesafe Activator I've spotted interesting template: reactive-stocks. The template simulates live data feed of stock prices and allows to look up market sentiments (buy/hold) via RESTful search requests to Twitter and lexical analysis service. It demonstrates several interesting frameworks / techniques. It uses Play-framework / Akka asynchronous and features / Websockets data streaming and browser client backed with JQuery.

After some consideration I thought it would be quite interesting as a project to write a small multiplier RPG game that would also make use of all above cool things:

1) Websockets for realtime communication
2) Akka: Model World / Scenes / Users as Akka actors.
3) Playframework to run the show...
4) JQuery / JSon / HTML at client browser

I also needed of course to have a client side Game engine that would allow me to concentrate on actual game implementation and handle rest of the stuff as Sprites, Animations, Collisions, Sound... And after some research I've found Carfty.

5) So Crafty it was...

I would not be discussing the advantages of technologies but will try to explain how I've used every of those technologies. Obviously some of the components were used more and some less. But all were necessary to put this thing together.

Sunday, October 27, 2013

Typesafe Activator - Get to know cool stuff quick...

I've recently gave a short intro to Typesafe Activator at Sydney JVM community meetup

Motivation for the talk was my personal experience with Activator and how helpful it was when I wanted to dive into trying Play framework, Akka and other related technologies...

The reason it was helpful to me was very simple - learning new things needs time and good intro / kick start that will get you going...So here it was a kick starter - Activator that promised quick introduction to technologies like Akka, Playframework for Scala and Java devs.

Using it as simple as getting to http://typesafe.com/activator downloading the application and executing it.