Notes from react.sphere 2018 – chaos engineering tool (aka symian army from netflix) – solutions for high scalability of internet giants – slides from presentation of Tomasz Nurkiewicz – articles about serverless (AWS lambda in particular)

Misc thoughts

Never mock a type you don’t own //context is lost, perhaps taken from here

Lambda per verb (i.e. delete user) – allows permissions segregation, better finance tracking, better insight on capabilities (it’s clear what it can do based on it’s name) //advice from theburningmonk

Write metrics to log to avoid io waits //advice from theburningmonk, mentioned in the context of lambdas topic

GWT Designer for Eclipse Juno on Ubuntu 12.X

Today I’ve tried to install Google Eclipse Plugin to draw some forms for my GWT-based app and caught the exception:

GWT http-server started at
# A fatal error has been detected by the Java Runtime Environment:
#  SIGSEGV (0xb) at pc=0x00007fb2229d45a0, pid=8150, tid=140404439688960
# JRE version: 6.0_37-b06
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.12-b01 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  []  void WTF::freeOwnedGPtr<_GdkEvent>(_GdkEvent*)+0x15df0
# An error report file with more information is saved as:
# /home/ipcreeper/hs_err_pid8150.log
# If you would like to submit a bug report, please visit:
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.

Searching for at least an hour I’ve finally found the solution:


Step 1:

Download and install libhunspell package (xulrunner has a dependency on it):

sudo dpkg -i libhunspell-1.2-0_1.2.14-4_amd64.deb

Step 2:

Download and install xulrunner package:

sudo dpkg -i xulrunner-1.9.2_1.9.2.28+build1+nobinonly-0ubuntu0.11.04.1_amd64.deb

Be aware that both libhunspell and xulrunner should be either i386 or amd64 version.

Step 3:

Open eclipse.ini and add path to installed xulrunner:

Step 4:

If editor still not running, try to set the environment variable GDK_NATIVE_WINDOWS to false before starting Eclipse. Do it with following command:


How to switch version of Java in Ubuntu

Had a little headache trying to change version of JDK back from 1.7 to 1.6, so here is the instruction:

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install update-java

Then type:

sudo update-java

… and you’ll see the window with versions of Java to switch to.


P.S. To extend the list of available JDK’s download the version you need and extract it to /usr/lib/jvm/

The importance of the hashCode()

Interviewers like to ask questions about the importance of hashCode() function, kind of “what would be if the hashCode() returns the same value for different objects” and vise versa, “what could be if it returns random number every time, can it break anything”?

I think the best way to memorize the answers for such a questions is to understand how it actually works in a real life code. Simple remember the following implementation from java.util.HashMap:

public V get(Object key) {
        if (key == null)
            return getForNullKey();
        int hash = hash(key.hashCode());
        for (Entry<K,V> e = table[indexFor(hash, table.length)];
             e != null;
             e = {
            Object k;
            if (e.hash == hash && ((k = e.key) == key || key.equals(k)))
                return e.value;
        return null;

Even just these two lines:

if (e.hash == hash && ((k = e.key) == key || key.equals(k)))
                return e.value;

As we see, two different keys can have the same hashes. If we make the hashCode() always return the same integer it won’t break anything but it will decrease performance of searching the key. HashSet collection is based on the HashMap and works the same way when we use it’s contains(Object key); method (basically it just delegates the task to the hashMap’s getEntry(Object key); method which is using the above algorithm).

So, the answers are: if we use a custom object as a key, we need to provide our own hashCode() to have a greater performance. If hashCode() returns random integer every time, the hashMap won’t probably ever find the key you’ve put into it.