IntelliJ Find and Replace with regular expressions

Regular expressions are not my forte, but never the less very useful. Recently I faced this fictional code snippet: var a = someFunc(b, c); //..... var d = someFunc(b, d); Almost a gazillion of calls to someFunc needed to be replaced with otherFunc. Cue big gasp! As always, IntelliJ is your go-to companion you always can rely on. I already noticed the regex checkbox in the Find/Replace dialog. Now it’s time to put this thing into practice....

May 10, 2020 · 1 min

Deploy Hugo generated site to Github Pages

Deploying to github pages is not as easy as I thought. I tried several things for building a Github Action workflow, however this is only meant for actions related to the repository in question. In the end, I follow the approach as mentioned on the Hugo website with a local script. I have pimped it by fetching the latest commit message and the use this message for committing the changes in the generated site....

May 2, 2020 · 1 min

Moving from Jekyll to Hugo

I’ve been using Jekyll for a few years now. Main reason to use it, is its nice integration with Github Pages. However the frustrations now have outweighted the advantages. Not so cool What annoyed me tremendously is getting Jekyll to run. All the ruby issues were hard to solve for me. Next in line is how to structure the content. As long as you only want to blog, Jekyll is good enough....

May 1, 2020 · 3 min

Colors for your presentations

As I will be speaking at the Data Science Leuven meetup this Thursday, I’m preparing my slidedeck. To make it visually more attractive, I’ve been looking into color schemes. And this quote was quite interesting: Limit yourself to maximum 4 different colors In the end I found inspiration from the slideteam website, the ‘Red and Grey’ color palette. Gray : #EFEFEF Darkgray : #7F7F7F Red : #E04556 Darkred : #2B1515 These colors are then combined so there is contrast in the combination....

November 11, 2019 · 1 min

Writing SQL for an unfamiliar PHP application

As I’m currently working for a famous yellow telco with a huge legacy, I recently had to deal with a PHP application. Although there is a PHP dedicated team, we were forced asked to deal with the PHP part as well. I did have some past experiences with PHP (and to some extend Drupal), so I faced this old dud. Luckily I just needed to spin up a Vagrant box so that was quite easy....

September 21, 2019 · 2 min

Custom property naming strategy with Jackson

For a pet project of mine, I’m consuming a REST API. Unfortunately it’s probably not written with Spring (Boot), as the body of requests and response are not according to what you’re used to, UpperCamelCase instead of lowerCamelCase. {"SessionKey":"7d38ec29-d1f3-42e9-b35f-91b505bf3206", "Status":"UpdatesComplete" } At first, I thought I could solve it with a @JsonProperty("...") annotation on every field, but there are so many of them :o This can easily be fixed with the property naming class annotation:...

August 11, 2019 · 1 min

Spring boot without a web container

I really like spring boot a lot - just throw in some dependencies and BAM it’s configured right out of the box. For a pet project of mine, I’m consuming a REST API. So I included the spring-boot-starter-web artificact. Not so surprisingly, the logs showed Tomcat was booting. In this particular project, I don’t need tomcat or any other web container for that matter. So how to exclude this? My first guess was the application properties, but there was nothing to turn the web container on or off....

July 31, 2019 · 1 min

How to check if a row with a specific column value exists in Spring Data

Spring Data has a great declarative way of defining queries, called derived queries. Suppose you have a Person class with an email field. Then you can define the following method in a Repository interface: public interface PersonRepository extends JpaRepository<Person,Long>{ List<Person> findByEmail(String email); } Spring derives the query based on the method name, in this case a query to retrieve all persons with a given value for the email field. As you can see, the method returns a List....

June 11, 2019 · 2 min

Postgraduate Studies in Big Data & Analytics in Business and Management

A year ago, In enrolled in the “Postgraduate Studies in Big Data & Analytics in Business and Management” at KU Leuven. And today, the project I’ve been working on for the past 3 months came to a conclusion with the final presentation. The dataset I’ve been working on was collected by The Belgian federal police during 2014-2016 and contains over 52K car crashes. It has been enriched by Informatie Vlaanderen with additional information on weather conditions, road conditions and severity of the accident....

April 30, 2019 · 2 min

Stream examples Part 3 - Conclusion

I would like to wrap up with some snippets I use a lot! Collect to a map When you want to collect to a Map, you need a function for the key and a function for the value. Suppose you have a list of Person objects with a firstname and last name. If you want to map the firstname to the lastname, you would write something like this: Map<String, String> firstToLastMap = persons....

April 8, 2019 · 2 min