Excel and ZIP64

Deep dive into ZIP file format in the context of .xlsx

TL;DR; Excel has requires specific ZIP flag values in .xlsx that Java’s ZIP implementation does not provide when streaming. Problem with huge XLSX files The standard in Excel file creation in Java is Apache POI. It works fine, a bit slow, but still fine. As it turns out up to some size limit, arbitrary at first sight. You can try it yourself. Just run this piece of code: try (SXSSFWorkbook wb = new SXSSFWorkbook(new XSSFWorkbook())) { SXSSFSheet sheet = wb. [Read More]

Simplest Docker service

The Simplest Docker service My first thought when wanting to run a docker container as a system service, was to use docker service. Like this docker service create --name nginx -p 80:80 \ --mount type=bind,source=/var/www,destination=/usr/share/nginx/html \ nginx But this is sometimes an overkill. In case on nginx a much simpler solution would be docker run --detach --network host \ --restart=always \ -v /var/www:/usr/share/nginx/html:ro \ nginx It’s the way to go, when you just what to have one instance on one specific host. [Read More]
docker 

Prevent docker from filling up your disk

Deploying docker container as part of your continuous integration can cause your disk to fill up pretty quick. Docker does reuse the layers that did not change between deployments. But still, that last layer with you .war or .js bundle can take a few hundred megabytes. Taking into account, that you should be deploying a new version of every update of the master branch, this can take up a gigabyte every day. [Read More]
docker  cron 

What's so special about docker?

What’s so special about docker? There are quite a few comparisons between docker containers and virtual machines on the interwebs. That’s exactly what made it more difficult for me to understand what containers actually are. Then I came across the thought that docker is like chroot on steroids. That’s it! It’s just an isolated process. Not only on the filesystem level, but also all other resources like network and processes. [Read More]

Spring Data repository with empty IN clause.

The problem I’ve stabled upon started with a spring data repository like this: public interface SampleRepository extends CrudRepository<Sample, Integer>{ @Query("select s from Sample s where s.id in :ids") List<Sample> queryIn(@Param("ids") List<Integer> ids); } Actual query was of course more complicated that this. Complex enough to justify not using a query method. The problem emerges when you run this method with an empty collection as argument: repository.queryIn(Collections.emptyList()); The result is database dependent. [Read More]

Markdown all the way

I love Markdown. It made me change my mind about writing documentations. Makes it almost pleasant. Now, whenever I’m about to write some content I first look for a tool that lets me do it in markdown. So here’s a list of all my makrdown tools. Marp Let’s me create slides in markdown. Clean and simple. Exports to PDF. Works really well for prezentations that include code samples. Higlighting works out of the box. [Read More]

Exploaded WAR with Maven and Eclipse

The aim: setup a maven war project and JBoss7/WildFly so that the only thing needed to see your changes is touch my.war.dodeploy and F5 in the browser. Setting up Maven First thing to do is to setup outputDirectory, so that Eclipse will put the class files instantly in the right place: <project> <build> <outputDirectory>${basedir}/src/main/webapp/WEB-INF/classes</outputDirectory> ... Now you need to update Eclipse .project file: mvn eclipse:eclipse If you haven’t done that already, now’s the time to do File > Import > Existing Projects into Workspace in Eclipse. [Read More]