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

Running Hadoop 1.1.2 on Ubuntu Linux (Single-Node Cluster)
In this tutorial I will describe the required steps for setting up a pseudo-distributed, single-node Hadoop cluster backed by the Hadoop Distributed File System, running on Ubuntu Linux. Note: This walkthrough targets Hadoop 1.1.2 (2013) on Ubuntu 13.04, both long past end-of-life. Hadoop 1.x predates YARN, so the JobTracker/TaskTracker daemons, the conf/ layout, and config keys such as fs.default.name and mapred.job.tracker no longer apply to current releases (3.x uses etc/hadoop/, fs.defaultFS, and different web-UI ports). It is kept here as a historical reference; if you are setting up Hadoop today, follow the official Single Node Cluster guide instead.
Install Google Pinyin in Ubuntu
I had been using Sun Pinyin for a long time, but once I tried Google Pinyin I never looked back. Here is how to get a comfortable Chinese Pinyin setup on Ubuntu. Note: This post has been updated for Fcitx5, the input method framework that ships with current Ubuntu (20.04 and later). The original 2013 version installed the standalone fcitx-googlepinyin package on Fcitx 4 through the fcitx-team PPA. That package is now unmaintained; Fcitx5’s built-in Pinyin engine, paired with the Cloud Pinyin addon, is its modern replacement, and no PPA is needed.
Configure Unity Workspace Layout in Ubuntu
Note: This post describes Unity 7 and Compiz, Ubuntu’s default desktop through Ubuntu 16.04 LTS. Canonical ended its work on Unity in 2017, and the default switched to GNOME Shell starting with Ubuntu 17.10 — where workspaces are configured differently and compizconfig-settings-manager no longer applies. The steps below are kept as a historical walkthrough; they still work on the community-maintained Ubuntu Unity flavor. Why change the layout? Every time I upgrade to a new Ubuntu release, the desktop defaults to a 2×2 workspace grid.
Convert Excel Date into Timestamp in PHP
Excel stores a date internally as a number of days since January 1, 1900. For example: “June 9th, 2011 10:30 AM” would be stored as “40703.4375”. 40703 is the number of full days since 01/01/1900 and 0.4375 represents the time (10.5/24 = 0.4375). When you process dates read from an Excel spreadsheet (e.g., using PHPExcel) you often want to convert them into a UNIX timestamp, i.e. a number of seconds elapsed since midnight of January 1, 1970 UTC.
Writing Your First Win32 Application with C++
Welcome to the first windows tutorial. In this tutorial, I’ll give you the basic information on how to code in windows and we’ll go over a few important details first. Messages The basic windows program has two important functions inside. The first one is the event handler(I’ll talk about this one later on) and the second one is the main function(WinMain from now on). WinMain is similar to DOS’ main function, in fact, WinMain is called from the DOS main function but in windows, we don’t have access to the DOS main; everything is covered up by windows. Windows introduces us to messages. A message could be easily described as a pile of data that gets sent to the event handler which then tells the window what to do. A message’s name is prefixed with WM(stands for Windows Message as you might have guessed?). There are a whole lot of messages that a window can handle, however, we’ll only need a few of them. You can use these messages in many ways. For example, the message WM_CREATE, can be used for initialization purposes, it gets sent to the window when it’s created, and WM_PAINT is used when you want to draw something on the screen, and so on, you get the image. Most of the messages get sent to the window automatically; for example, when you move your mouse around you send a message to windows, and any other actions like that send messages to windows. You can also send a message to your window yourself, but you’ll probably never need to.
Use CodeIgniter Resources within Library
To access CodeIgniter’s native resources from inside your own library, use the get_instance() function. It returns the CodeIgniter super object, the same one you reach through $this inside a controller, so your library can load helpers, read config, or call any other class the framework has instantiated. Note: get_instance() is a CodeIgniter 3.x (and earlier) technique. CodeIgniter 4 dropped the global super object. There you reach framework features through Services, such as service('session') or \Config\Services::session(), or by injecting the dependencies your class needs through its constructor. Everything below applies to CodeIgniter 3.x.
Generate a Random File Name when Uploading Files in WordPress
The passage is telling you how to rename the file name automatically by WordPress (without using any plugins). A Word of Warning Warning: To apply this hack, you’ll have to edit one of WordPress’s core files. Keep in mind that it is never recommended. This hack should be redone if you upgrade WordPress. Editing the Upload Handler Open the wp-admin/includes/files.php file, and go to line 324 (approximately here). You’ll see the following:
C# - Run Application as Administrator Automatically
In this tutorial, you will learn how you can run your application as an administrator automatically using Visual C#2012. Adding an Application Manifest Start by opening your C# Windows forms application. Right click on your project name in the solution explorer and add a new item… Select an application manifest file: Click add. Requiring Administrator Privileges A new tab should open up, most of the codes in it are not important to us. There is one line however that we need to change: