Blog
Thoughts on programming, systems, robotics, and everything in between, sharing what I learn and build.

Jenkins Installation and Configuration with Maven and GitHub
In this tutorial we install Jenkins and configure it to build a Maven project hosted on GitHub. Note: This post has been updated for Jenkins 2.5x running on Java 21. The original 2014 version deployed Jenkins as a WAR inside Tomcat 7 on Java 7 and walked through a UI that has since changed substantially. Modern Jenkins is self-contained, so you no longer need a separate servlet container, and Git/Maven support now ships with the suggested plugins. The setup below is therefore shorter than it used to be.
Zend Framework 2: Get Parameters
The easiest way to read request parameters in a Zend Framework 2 controller is the Params plugin, introduced in beta5. It has utility methods to make it easy to access different types of parameters. As always, reading the tests can prove valuable to understand how something is supposed to be used. Note: Zend Framework 2 has been deprecated. The project moved to the Linux Foundation in 2019 and lives on as Laminas; the Zend\ namespace became Laminas\, so the plugin shown here is now Laminas\Mvc\Controller\Plugin\Params (in the laminas/laminas-mvc package). The API is unchanged, so the examples below still apply after that rename.
Zend Framework 2: Redirect to 404 page in Controller
I’ve been getting into trouble for several hours with redirecting to the 404 page in Zend Framework 2. Note: Zend Framework 2 has been deprecated. Zend Framework was migrated to the Laminas Project in 2020, where development continues today. The notFoundAction() technique below still applies in laminas-mvc. I asked about this on Stack Overflow. What Didn’t Work Before that, I was using the following code: $this->getResponse()->setStatusCode(404); return; This sets the HTTP status code to 404, which looks fine at first. But it only changes the response header; it doesn’t dispatch the error controller, so once I built a custom 404 page I found that it never rendered.
How To Convert Byte[] Array To String in Java
It is common to convert a String into a byte[] array and back again. The catch is that how you convert depends on what the bytes actually are: human-readable text in some encoding, or arbitrary binary data such as the output of a cipher. Using the wrong approach silently corrupts your data. Note: This post has been updated to always specify a charset explicitly and to cover the binary-data case. The original advice — new String(bytes) — relies on the platform’s default charset, which makes the result differ from machine to machine, and it cannot round-trip binary data at all. Both pitfalls are addressed below.
Building Vim from Source
Most Linux distributions ship a stripped-down Vim — often without +python3, +clipboard, or GUI support, and rarely the newest release. Building Vim yourself fixes all of that: you decide exactly which language interpreters and features get compiled in, and you get whatever version is on Vim’s master branch. The process is straightforward. This guide walks through it on a Debian-based distro such as Ubuntu. Note: This post has been updated from its original 2013 version to match how Vim is built today. The source has moved from vim.org’s Mercurial repository to GitHub, the Python 2 interpreter has been swapped for Python 3 and the GTK2 GUI for GTK3, and configure flags that newer Vim removed (such as --enable-sniff and the now-default --enable-multibyte) have been dropped.
Install PHP and PHPUnit on Windows/Ubuntu
Note: This post has been updated for PHP 8.5 and PHPUnit 13. The original 2013 version installed PHPUnit through PEAR (go-pear, pear channel-discover pear.phpunit.de), but PEAR has since been retired and PHPUnit no longer ships through it. The current approach is to install PHPUnit with Composer or as a standalone PHAR, both shown below. PHPUnit is the de-facto testing framework for PHP. This guide gets PHP and PHPUnit running on Windows and Ubuntu, then writes and runs a first test to confirm the setup works.
Use SQLite in Qt
SQLite is a lightweight, file-based database that needs no separate server process, which makes it a perfect fit for desktop applications that want to store data locally. Qt ships with a built-in SQLite driver as part of its SQL module, so you can talk to a database without pulling in any third-party dependency. This post walks through the few steps required to set it up and run your first queries.
How to Setup and Use Github in Ubuntu
If you are or want to be an open-source developer, you must try GitHub. It is a new hosted Git repository service that’s being called a “social network” for programmers. It is basically a distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Setup SSH key Generate SSH Key Suppose you have created your account at GitHub and now want to work with it from your terminal.