Edd Mann Developer

Using Bit Flags and EnumSets in Java

This article examines two popular methods for handling multiple boolean values in Java. It explores the traditional approach of using bit flags and compares it with the more modern EnumSet implementation. By analysing both techniques, you will gain insights into their performance, readability, and type safety.

Decimal to Hexadecimal using Bitwise, Bit Shift Operations in Java

I recently wanted to create a simple function in JavaScript which allowed me to generate a random background colour for a small experiment I was working on. The implementation I came up with worked very well, but the decimal-hexadecimal representation conversion was all wrapped up in one toString(16) function call. I was very interested in creating this method myself, and I decided to use the Java language for the attempt. The discussed functionality is already present in the Java language, within the java.lang.Integer class, as toHexString.

Reverse Polish Notation (RPN) in Scala

Continuing on with my exploration of the Scala language, I decided to solve the widely documented problem of evaluating a mathematical Reverse Polish notation string. Popularised by its use in the HP-10C series of calculators from the 1980s, the notation requires that every operator follow its operands (otherwise called postfix notation).

Changing the Timestamp of a Previous Git Commit

Git has two different types of timestamp associated with a commit. Although both typically hold the same value, they are used in subtly different ways. The author (GIT_AUTHOR_DATE) is the user who originally created the work (i.e. a patch), whereas the committer (GIT_COMMITTER_DATE) is the user who last applied the work (i.e. applied patch or rebase). The author date is the one displayed when the log is accessed. However, the commit date is used when applying the --since and --until filter options, which seems a little odd. To avoid confusion, you can include the committer date within your log display by setting the --format option.

Configuring SSH Public Key Authentication on CentOS 6.4

Having to use password authentication each time you wish to access your server can be a serious pain. Not only does it require extra keystrokes, it is also less secure and far more susceptible to successful brute-force attacks.