How to handle concurrent write queries with LinkedBlockingQueue

Here a simple way to handle incoming concurrent write queries. Here the complete description of my problem: 1 connection is equal to 1 thread, 1 thread has is own context and then writing to database with its own transaction. Multiple writes from several connections results to slow performances. We are…

Create a simple backend and expose it with Grails

Imagine you want to expose a simple REST web service over HTTP in few steps. You do not want to spend more than one hour to create the full stack which is : The web service The domain definition The configuration In this article I am going to use "H2" in…

How to create your Groovy SSH wrapper

Hi, Last time I needed for my own purpose a simple SSH wrapper. With the magic of closure you do not need to rewrite more than one time the same code. requirement: "net.schmizz.sshj" > gradle: 'net.schmizz:sshj:0.9.0' import net.schmizz.sshj.SSHClient import net.schmizz…

How to use custom fonts on Android

Hi guys, Today I am going to talk about how to use custom fonts on your android app, and especially how to extend a TextView widget to use it. Basically, there is only 3 things to do: Download a font (TTF one from dafont.com for example). Create "assets/fonts…

How to detect if a Listview is scrolling up or down on Android

Hi there, just a trick that I find on StackOverflow and adapt (to my case) for ListView instead of ScrollView. It could be nice to know if you are scrolling up and down over a list to be notified and then do whatever you want. Here I am gonna explain…

How to disable viewpager page switch on Android

Hello folks, One month since my last post.. so much work on Motortracker that I have no times to write article. Anyway, today I am gonna share with you a little trick to disable ViewPager switch on specific page. It could be used for example if you have several pages…