Subscribe via RSS

  • Record#with - a thought experiment

    Recently, there were some interesting discussions about Record#copy() and Record#with(...) on the amber-spec-experts mailing list (1, 2) which has lead me to implement both methods with a very clear & typesafe way, which I’d like to discuss below. The code demonstrated below is available as Gist.

  • Use Jekyll on Windows via the Subsystem for Linux (WSL)

    The Windows Subsystem for Linux works surprisingly well by now – at least for simple tasks. In this blog post, I describe how to install the WSL as well as Jekyll (with GitHub Pages support) using Ubuntu as the distro of choice. Installing the WSL and a Linux distro is suprisingly easy and has only 4 steps (one is optional).

  • A small side note on JEPs 384 and 359

    When reading about records and having read Pattern Matching for Java, Gavin Bierman and Brian Goetz, September 2018, it would be easy to assume that pattern matching in instanceof would also include deconstruction patterns. This isn’t a preview feature in Java 14 which included records via JEP 359, but was slated for Java 15 with JEP 384. Unfortunately, this JEP has changed and deconstruction patterns are no longer planned for that JEP. Records will be re-previewed as-is.

  • Records & their constructors

    A look at the constructors of records in Java 14, and how one can leverage the formal parameter list of records to already enable libraries like Jackson to work with records (and in this example, deserialize JSON to records).

  • On records & (im-) mutability

    Records are sometimes described as immutable, which is unfortunate. Looking at the JEP, we see them being called “shallowly-immutable”. That is an important distinction. A record can still be changed in a multitude of ways, and this article sheds some light on the strategies one can employ to ensure records actually are immutable.

  • Failure Modes

    Programs often have to deal with less then ideal conditions – intermittent internet connections, hardware dropping in and out, user input not being reliable, files being corrupted, and many, many more scenarios in which failure is not only a possibility, but to a certain has to be expected and worked with without fatally crashing the application, but instead gracefully resuming and informing the user of the problems and allowing them to fix them.
    In this article, I’ll talk about the following three ways to handle failure modes.

  • Java 8 Lambda Cheat Sheet

    Even though Java 8 is just a little over six years old and brought a tremendous revolution to Java, adoption of lambdas and functional approaches to programming problems is still an ongoing process.
    I have introduced numerous people to functional-style programming & lambdas, and at one point came up with the idea of a small “cheat sheet” only one or two DIN A4 pages in size that you could have in hand when thinking about functional stuff. This is by no means meant to be a comprehensive introduction, but a small reference document, and has been received very well, so I thought I’d share it here.

  • How To: Use language variables

    WCF 2.0 comes with built-in internationalization (i18n) or, as some call it, multi-language support. I18n within WCF 2.0 is realied using so called language variables. Those variables can be filled with values in multiple languages and even allow adminitrators to translate their whole board to another language themselves. But how do plugin developers use language variables correctly?
    In the last article, where I wrote about creating a simple WCF 2.0 pugin, I presented a template in which the term “Hello, World!” was hard coded into the template in english. This is not only strongly discouraged, but is also dangerous in terms of encoding and escaping. Languages variables ansure the proper ecspaing of HTML entities and much more, therefore one should always use language variables over hard coded text.

  • How to: Create WCF 2 Plugins

    Customizing your WBB4 / WCF2 installation is usually done via plugins. Editing files, following bogus installation and hacking instructions, this is all long gone. Since WBB3, which was built on top of WCF1, hacking is obsolete and was replaced by simply installing plugins via mouse-click in the ACP. The general principle is the same for WCF2 as it was for WCF1, but some detailes have changed.

    So what is a plugin?

    Basically, just a TAR- or TGZ- archive that contains some files in a specific structure. The heart of each plugin is the package.xml, a configuration file which defines the plugins dependencies and it’s delivered functionality. The package.xml file is placed in the root of the plugin archive.

  • New responsive blog layout

    I wanted to make the blog layout responsive for a long time now, but since I don’t even own a smartphone, this wasn’t really one of the top priorities for me. But then, the Jekyll 1.0 update came along, and I had to rework the liquid templates anyway, since e.g. Jekyll now exports a post.excerpt variable on it’s own. So I sat down and started hacking, and I ended up reworking a whole lot of the templates to match Twitter-Bootstrap, which I ended up using for the responsive grid of the site.

  • JTT in action

    Ever wanted to see JTT in action? Then there is no time like the present! JTT is already used on numerous websites, some hosted on GitHub Pages, some elsewhere. Take a look at some excellent examples on how JTT can be used!

  • wmake - WCF 2.0 package build script

    The release of WBB4 and WCF 2.0 beta gets closer every day, and writing plugins for it becomes more and more interesting, especially since we knowget a good overview about the things that might not be included by default and make a good plugin. To make things easier, i wrote a little shell script that automagically packs WCF 2.0 packages: wmake!

  • 1st quarter of 2013 roundup - Spread the word!

    The new year saw some interesting developments, as I have been mentioned with my software several times throughout the web.

  • Awesome etckeeper

    The idea behind etckeeper is as simple as smart: Use a VCS to keep track of changes to config files in /etc/, providing you with a history, rollback options and much more.

  • Note to self: Do not use junctions with GitHub for Windows

    The GitHub for Windows client does not work properly with junctions (mklink /j ..).
    I encountered this issue when I set up my working environment for WCF 2.0 on Windows (yes, I am back to Windows temporarily for my working needs, but I will switch back to Linux asap).

  • Update for JTT

    The update for the Jekyll Template Toolkit (JTT) included several bugfixes.
    While working on my blog, I have encountered several flaws in JTT and went to fix them. There were some minor issues, e.g. an escaping issue in the category list widget, which made the site fail the validation check and a minor issue with the pagination.

  • Installing (and/or migrating) TS3 on Debian 6

    This guide covers how to install a teamspeak3 server on Debian 6, as well as migrating from an old installation.

  • Note to self: `literal` is now `raw`

    As of the last update to GitHub Pages, the literal tag is now raw.
    Today I wanted to start on a new series of blog entries, called “Notes to self”. The “Notes to self” series of blog articles is a series of brief facts, tricks and code snippets that I consider to be useful, memorable and don’t want to forget.

  • Installing LAMP on Debian 6

    Installing LAMP on debian 6 is refreshingly easy. This guide covers a typical LAMP (Linux, Apache, MySQL, PHP) installation on Debian 6. I had to set it up yesterday, so I thought I’d share some of the steps on the way. Since I have also needed a TeamSpeak3 server, there will be a follow-up on that, too. I will use example.org as a server domain, but replace it as appropriate for your needs when following the guide.

  • Group posts by month and year in jekyll

    This article describes the technique used in this blog to display posts grouped by month and year in jekyll, most prominently seen in the widget within the sidebar. No plugin is required for this.

  • Tag cloud in jekyll (without plugins)

    Creating a tag cloud with jekyll is not a simple task and most solutions found online use plugins for that. In this article I describe the solution I’ve found, which is baesd on a vanilla jekyll installation without plugins. My solution is based around the fact that there are several math filters available for Liquid: <pre> {{5 | plus: 3}} => 8 {{5 | minus: 3}} => 2 {{5 | times: 3}} => 15 {{6 | divided_by: 3}} => 2</pre> More filters and documentations can be found on the Shopify/Liquid Page.

    Although these filters are present, using them is not easy, as you can not set brackets in terms, and jekyll processes arguments for filters quite oddly from time to time.

  • Release of Jekyll Template Toolkit (JTT)

    Today I’ve released my Jekyll Template toolkit, a collection of templates and layouts for jekyll, which is 100% compatible to github-pages. The source code can be found in the repository on GitHub.

  • Blogging with jekyll

    Yet another blog? Yup, and some interesting stuff to read. Development announcements, interesting code snippets, oddities from programming languages and much more.

Subscribe via RSS