7 November 2020

Goodbye!

Well, that's all for content on this blog.

 I decided to finish blogging on this blog as I keep my personal knowledge base on the github in this project: https://github.com/pastorcmentarny/DomJavaKB


I didn't stop blogging as I will carry on blogging on my homepage: https://dominiksymonowicz.com/ but about my hobbies.

23 October 2019

How to fix error :xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun after update to MacOS Mojave ?

Solution for

  • Git
  • macOS Mojave 10.14.x


STORY:
Did you upgrade your amazing macOS Mojave? Did you wish to crack on your project and start to use git but you were hit with error: 
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun


SOLUTION:
You need to install Command Line Developer Tools, so simply run this command:
xcode-select --install

4 June 2019

Awesome Articles and presentations about Software Developemt stuff



  1. (Java) Style Guidelines for how to use var in Java
    • http://openjdk.java.net/projects/amber/LVTIstyle.html
  2. (Java) The Future of Java / OpenJDK and how it impacts you!
    • https://www.youtube.com/watch?v=078QIrp0SD8 
    • Java 11 is coming and Java will be still free or ... is Oracle planning to follow evil game practices like EA  and spam Java with loot boxes, DLC and other money-draining activities? As it turns out 6-month release brings lots of goodness with release feature as soon as they ready rather than wait years for the next release and some challenges:
  3. (Containers) Build Containers from scratch
  4.     




27 May 2019

Awesome artciles about software developer



List of articles that I found interesting to read as my 
  1. https://www.joelonsoftware.com/2003/10/08/the-absolute-minimum-every-software-developer-absolutely-positively-must-know-about-unicode-and-character-sets-no-excuses/
    • Good article that explain basics on Unicode and why is important 
  2. https://medium.com/@flyk6cr/hipster-it-will-destroy-the-world-229218fd5c15
    • Good article that talks about dangers of premature work using "buzzwords" technologies 
  3. http://www.helloerik.com/ux-is-not-ui
    • Link to 2-column UX/UI comparison from above article UX is not UI. http://www.uxisnotui.com/
  4. https://www.youtube.com/watch?v=teJWPrrKSZ4
    • Interesting  comedy explains Usability in booking ticket to cinema by michael mcintyre
  5. https://technicalmumbojumbo.wordpress.com/2010/01/31/xml-comparison-tutorial-using-xmlunit/ 
    • Are you about to enjoy XML comparison tests.XmlUnit doest job well for you.\

29 April 2019

Where Azul Java is installed on Mac OS?

If you are not Apple acolyte but just a person who is using Mac for development, you may wonder where Azul Java is installed?

Answer is ....

JDK 11
/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home

JDK 12
/Library/Java/JavaVirtualMachines/zulu-12.jdk/Contents/Home

I think you got pattern :)

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

STORY
I needed a method to check if the current hour is in the specified time range. So I wrote this:
@staticmethod
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. 
@staticmethod
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.

SOLUTION

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


@staticmethod
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.


Resources:

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.

DATE: 
07.08.2018


SHIT HAPPEN COUNTER:
4

STORY:
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

ISSUE:

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


FIX:
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.


WHAT I LEARNT:
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
v75

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

Problem.
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:

Workaround:

  • 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 :(