28 October 2018

What I learnt from 000: Introduction

In the world of perfect people as seen on LinkedIn or Instagram and expert in everything as seen on Twitter, Facebook or other social media I don't need to write another review. There are many reviews by experts, 'experts' and bloggers, so adding another 'review' will create more noise in the internet universe. Instead, I will do  'What I learnt from': is a series of short notes about what I learnt from a book or webinar. I will add some loose opinion about the topic! 

8 October 2018

Lesson learnt:004 - Magic of static method in Python

I needed a method to check if the current hour is in the specified time range. So I wrote this:
def isInTimeRange(time = datetime.datetime.now().hour):
    #magic happen
  • I tested locally.. and it works on my machine. Good.
  • I push code to test environment and everything works. 
  • Great (however, it surprised me a bit as I expected to see some sort of teething troubles). 
  • On the day to deploy into production something went badly wrong.

I got very stressed because the outcome was very surprising to me and although I knew we could rollback changes I didn't know how to do it. We rolled back to the previous version and I started to investigate what went wrong.

At first, it looked I missed some configuration and I found that some information about configuration is incorrect too, so  I fix them.

I decided to re-run tests. 
  • As always everything works locally. 
  • I run on the test environment and it still works. 
  • I run in pre-production environment ... it works at first but my application didn't work at night.

The application works locally, on the test env but it doesn't work at night. Hmm...

After an action-packed investigation, I narrowed down to my method. The first hint was ... maybe this doesn't work as I didn't specify a time zone, so I added. As well, I added more logs to see actual times. 
def isInTimeRange(time = datetime.datetime.now(pytz.timezone('Europe/London')).hour):
    #magic happen
Results? Well.
  • As always "It worked on my machine". 
  • It worked on the test environment.
  • I see that 18.00, my method returns... 18.00. 
  • And then ... at night in pre-prod... At 4.00 (am) My method returns... 19.00. 
Why 19.00? At first, it didn't click to me how I got this strange time, but when I checked when my app was deployed (It was deployed at 19.00), then I figure out what went wrong.

As it turns out, @staticmethod is run before anything else is initialised.
It means that the default value was evaluated "run" first and the result was "reused" after that. (I don't want to use word cached). It is something that hasn't been mention in the documentation (or more likely I didn't see it) so for the beginner like me in Python it was a big surprise.


To solve problem In my case, we refactor the code to get time inside the method, which fixes a problem.

def isInTimeRange():

    time = datetime.datetime.now(pytz.timezone('Europe/London')).hour

    #magic happen

What I learnt from my mistakes?
  1. Do one thing at a time. If your code suddenly requires changes to Jenkins and then version of Python, then test them first. This is something that bites me a few times in this case and I could avoid some problems.
  2. Being aware of rollback previous version on production is not enough. Make sure you know to how to rollback if something shit hit the fan. As I knew we had a solution for rollback but I didn't know how to execute it.
  3. It is better when the project is configurable than changes requires git commit. This will speed up testing.
  4. I was bitten by a false-positive result of one of my tests. Time-based tests require more design next time.
  5. Fix one problem at a time. It helps me fix things step by step.


7 August 2018

Lesson learnt:003 - Auto optimise cause Manual fix

Lesson learnt is a series of blogs entries where I  write down a short description of the bug/mistake, the fix, and the lessons I learned.



I use IDE to automate boring parts like code format and cleanup imports.
Format code/optimise important works great for Java/ Spring Framework projects
While I was changing the code in projects that use Python, PHP, Symphony. I used to format code/optimise import feature during commit that removes imports that were required and


  • The project was unable to compile
  • One of  the pages didn't work

Undo commit
and commit without using automatically format code/optimise import feature.

Additional notes:
This project does not have UI tests since I discover a problem during manual testing on dev environment.

DO NOT USE Format code/optimise import in non-Java projects and double check what was published on git before request pair review

16 June 2018

Doms learn Chinese: Word Game v75.0 released!

Doms learn Chinese: Word Game

Download from: https://buff.ly/2zyCO5Z 
More info can be found here: https://dominiksymonowicz.com/2018/06/16/doms-learn-chinese-word-game-v75-released/ 
Study hard and have some fun .

23 April 2018

How to fix Error: Error:Module production: java.lang.Exception: (no MessageCollector configured) when you use Kotlin 1.2.40 ?

Solution/Workaround for:
IntelliJ IDEA 2108.1
Kotlin 1.2.40 ONLY

You try to run the program but you see this error:
Error:Module  production: java.lang.Exception: LOGGING: Loading modules: [java.se, javafx.base, javafx.controls, javafx.fxml, javafx.graphics, javafx.media, javafx.swing, javafx.web, jdk.accessibility, jdk.attach, jdk.compiler, jdk.dynalink, jdk.httpserver, jdk.incubator.httpclient, jdk.jartool, jdk.javadoc, jdk.jconsole, jdk.jdi, jdk.jfr, jdk.jshell, jdk.jsobject, jdk.management, jdk.management.cmm, jdk.management.jfr, jdk.management.resource, jdk.net, jdk.packager, jdk.packager.services, jdk.scripting.nashorn, jdk.sctp, jdk.security.auth, jdk.security.jgss, jdk.unsupported, jdk.xml.dom, oracle.desktop, oracle.net, java.base, java.compiler, java.datatransfer, java.desktop, java.xml, java.instrument, java.logging, java.management, java.management.rmi, java.rmi, java.naming, java.prefs, java.scripting, java.security.jgss, java.security.sasl, java.sql, java.sql.rowset, java.xml.crypto, jdk.internal.jvmstat, jdk.management.agent, jdk.jdwp.agent, jdk.internal.ed, jdk.internal.le, jdk.internal.opt, jdk.jlink] (no MessageCollector configured)
Solution is :
Rollback to the previous version and wait until Kotlin fixes the bug.

If you don't want to do that then:


  • 1.  Delete production folder in out folder
  • 2.  Run application
    • Bad news. You will need to do this every single time when you do changes to your program and you will try run again :(

15 March 2018

How to set groovysdk on mac in IntelliJ IDEA

The solution works for:
Groovy 2.4.12
IntelliJ IDEA 2017.2.6
macOS 10.12.6
Homebrew 1.5.10
It should work with other versions too.

    I tried to Config groovy SDK to use in IntelliJ IDEA ... but you need specific path which is .. something like that: /usr/local/Cellar/groovy/x.y.z/ libexec but I couldn't see usr folder. 
As it turns out you need to use a magical shortcut to enable a view of hidden files/folder in Finder on Mac.

  1. Go to Project Structure
  2. Go to Global Libraries
  3. Press +
  4. Select Java 
  5. In Finder, press  ⌘⇧. ( Command key, SHIFT key  dot key a the same time ) to enable 'view hidden files' mode
  6. Go to top level (MachintoshHD)
  7. go to /usr/local/Cellar/groovy/x.y.z/libexec and press open if you don't see usr folder... perform step 5 (and ensure you have all privileges required) 
  8. Press create
  9. Done :)

8 December 2017

What is the difference between a graduate, a junior, a senior and What is the difference between a developer, engineer, a team leader and an architect in software development?

If you want to know my answer on questions like What is the difference between a graduate, a junior, a senior and What is the difference between a developer, engineer, a team leader and an architect in software development? Then check my post on my personal blog (As this is not strictly IT subject).
 You can find my view here:


30 November 2017

How to clear cache partion on Nexus 9


Is your Nexus 9 get bit too slow over time?
Probably your problem is with fact that you ran too much on the tablet because  HTC screwed up badly as they decided to sadly have a crap idea to put on 2 GB RAM in this otherwise amazing tablet. There is nothing that you can do about it.
However sometimes Android get very slow due mess with the cache. In this case, there is a solution.
Did you search on the internet and found a few solutions to this problem? Well.. many of them are correct as it depends on the version of Android and bootloader.

This one will work on Nexus 9 with Android 7.1.1 and quite a decent version of bootloader.


  1. Charge battery to 40% (or to ensure that it will have enough battery for 30 minutes).
  2. Power off the tablet.
  3. Press and HOLD power button and volume down button for around 10 seconds.
  4. When the menu appears. Select Recovery (It is usually 2 or 3 position).
  5. When you will see lying down android with a red triangle (with the message "no command"), press and HOLD power button and press volume up button twice slowly.
  6. Then select wipe cache partition.
  7. Press Yes.
  8. Wait up to ...30 minutes (In my case it took 10 and 25 minutes, but it varies depends on the amount of crap on this partition.
  9. DONE.

13 November 2017

How to find Gradle home path inc on Mac if you install it using homebrew ?

It works on:
  • MacOS Siera 10.12.6
  • IntelliJ IDEA 2017.2.5
  • Gradle 4.3
    It turns out in my new work I will enjoy my development on macOS that is loved by hipster developers. As expected I needed to adjust mindset to macOS universe as I used to develop on Windows.

After you installed Gradle using homebrew,
Go to project in IntelliJ IDEA:
In Gradle SDK you simply type:
and it works... sort of.

Obviously replace 4.3  with version you are using.