Implementing good logging in an application can be challenging. Using args4j we can easily set the root logging level of log4j via a command line parameter.
When it comes to logging in Java, log4j2 is a wide-used framework. For small applications, using the configuration files to change the log level might be a bit of an overkill and a command line parameter is much more appropriate. If you don’t want to parse the command line parameters yourself, you can use a framework for that. args4j uses annotations to automatically populate the fields or properties of an object with the appropriate command line parameters.
Using Hue bulbs to extend the Ambilight of my TV makes me happy. Using a Raspberry Pi instead of an app for that makes me even happier.
For some time now, I have been wondering whether there is an easier ways to link my Philips Hue smart bulbs to the Ambilight of my Philips TV. Basically, my current setup is that I need to launch the Ambilight+hue app each time I want to watch TV to establish the link. Newer Philips TVs (I think later than 2014) seem to be able to provide this functionality without relying on this app. Unfortunately, my TV is from 2013, so no luck here.
If you only care for the result / download, then skip right to the end of the article.
With classes and methods such as Task.Run, Task.Factory.StartNew, TaskScheduler, SynchronizationContext, ThreadPool and others it’s very easy to get confused by all the ways to distribute work between the UI thread and background threads in the .NET framework using C#. However, if you follow some easy rules and avoid some pitfalls, the TPL (Task Parallel Library) and the async/await keywords greatly simplify development of reactive user interfaces.