[Linux] daemon() considered harmful

I'm currently writing a Linux program that is supposed to run in the background. When it was time to implement the --daemonize, I look at the current options and I was quite surprised to learn that daemon() or fork() are not the best way to write a daemon nowadays. Indeed,…

READ MORE

Embrace abstractions!

Abstraction is probably the most powerful concept in programming. Nevertheless, from time to time, I hear (or read) people questioning the value of abstractions. Here is my answer. We are surrounded by abstractions An abstraction is a simplified model (a mental model, if you will) that is used in place…

READ MORE

[C++] Embarcadero C++ Builder is a joke

Last week I discovered that Embarcadero offers a free version of C++ Builder Starter, apparently for a limited period. So I took this opportunity to install the IDE and try to compile ArduinoJson. It turned out to be a very disappointing (nearly infuriating) experience. BTW, if you try to get…

READ MORE

[CSS] Transform a button to a text input

Here is a cool CSS trick I found for actions that require a text value: See the code in action on CodePen HTML <form id='buttonWithText' onSubmit={this.onSubmit}> <div id='slider' class='collapsed'> <input type='button' id='toggle' value='Change username'> <input…

READ MORE

[Links] JSON Hypermedia Types

When designing a REST API, every developer faces this issue: what JSON format to use for the API. Let's see the current options. HAL - Hypertext Application Language Collection+JSON - Hypermedia Type JSON API UBER - Uniform Basis for Exchanging Representations Mason - A hypermedia enabled JSON format YAHAPI…

READ MORE

[Links] Mission statements

Today at work, we talked about the idea of having a "mission statement". We wanted to write down the values that our company carries. That would be a few statements that define who we are as a company and could guide us when making decisions. That exercise was more complicated…

READ MORE

[DIY] Add Z-wave to an old Velux

I own a couple of Velux WUX 101 that I needed to automate. This article explains how I removed the Velux remote control to replace it by a Z-wave compatible solution. I reused the original power supply box and replaced the electronic board. On this new board, I wired a…

READ MORE

[Gradle] How to make a flat source jar

As a C# and C++ developer, I sometimes like to have a different layout for source code and namespaces. I recently wrote a Java library and was surprised to see that the convention is to name packages after the source folders, whether this makes sense or not. This article explains…

READ MORE