imsavva.com

Using sed in Jenkins Groovy pipeline

I spent some time trying to figure out how to fix unexpected slash char error in my pipeline. My aim was to change some value in a config file after checking out a Git repository. I have a Jenkins pipeline and I used sed to perform the substitution. The pipeline wouldn't even compile because of Groovy's way of…
Posted on
2020-05-22

Configuring Mach3 for a CNC milling machine on Windows 7

Long time no posts, huh? I have a lot of interesting news and I hope to have some time to write it here. However, this post was inspired by my yesterday's experience. Working with old desktop software makes me nostalgic. Look at this rich and a bit messy interface. My dad bought a CNC milling machine and the…
Posted on
2020-02-12

Generating PDF with Apache FOP and Maven. An example and some tricks.

This January (and, actually, February) I worked on generating PDF files. During the investigation process, we've chosen Apache FOP as a free powerful tool for this task. Firstly I wanted to write a step by step guide on how to generate a PDF file from a Java object. But eventually, I decided to keep it short, as…
Posted on
2019-02-13

Possible class names in Java

showPostImage(-353751602)

Uncaught exception: the image is currently being shown in a museum

What would be the result of execution of the following code? If your answer is "Hello", then you're right! You can use any characters from the Unicode charset, in any case, to name classes (as well as variables and methods), except some preserved words like "null", "volatile", "public", etc. However, it's strongly…
Posted on
2019-01-15

Switch case and default

showPostImage(-1561152684)

Uncaught exception: the image is currently being shown in a museum

This snippet will compile and run without issues. It might be dubious whether it's okay to put the "default" block at the first place, but you can place it anywhere. In this case, the result would be: However there is a good practice to put the "default" block at the end of the switch statement. Or avoid using switch…
Posted on
2019-01-13