Month: May 2013
-
Behaviour of Java String.split() when some answers are the empty string
Can you guess the output of this program? class SplitTest { static void split( String s ) { System.out.println( s.split( “;” ).length ); } public static void main( String[] args ) { split(“”); split(“;”); …
-
Checking the case of a filename on Windows
Windows generally uses a case-insensitive but not case-preserving file system. When writing some code that is intended to be used on Linux as well as Windows, I wanted it to fail on Windows in the same cases that it would fail on Linux, and this meant …
-
Branches in git
Series: Why git?, Basics, Branches, Merging, Remotes Last time we discussed starting a project and committing changes. Now we look at how to create branches, which are one of the main reasons for having source control. We’ll cover creating branches, sw…
-
Writing: Bug Hunting
The latest C Vu magazine from ACCU is out now. It contains my latest Becoming a Better Programer column. This month it’s called Bug Hunting and, as you might guess, is about the art of debugging code. This was inspired by conversations with…
-
Writing: Bug Hunting
The latest C Vu magazine from ACCU is out now. It contains my latest Becoming a Better Programer column. This month it’s called Bug Hunting and, as you might guess, is about the art of debugging code. This was inspired by conversations with…
-
Passing several values through a pipe in bash
I have been fiddling with some git-related shell scripts, and decided to try and follow the same approach as git in their structure. This means using the Unix system where each piece of functionality is a separate script (or executable) that communicat…
-
Goodness in programming languages, part 4 – Ownership & Memory
Posts in this series: Syntax, Deployment, Metaprogramming, Ownership There is often a trade-off between programming language features and how fast (and predictably) the programs run. From web sites that serve millions of visitors to programs running on…