Packages form the basic building blocks of software components in many programming languages. For example, in Java you use the package statement to define the package for a class as follows. package a.b; public class C { public static void main(String[] args) […]
Author: M. H. Neifer
Unit testing in Lisp
There are some frameworks and libraries available for doing unit tests in Common Lisp. You’ll find a list for example in Wikipedia. I have decided to have a look at lisp-unit from Chris Riesbeck, Associate Professor in the Department of Electrical Engineering and Computer […]
Unit testing in Java and C#
Unit testing has become a cornerstone of modern software development. Some of the most popular frameworks for unit testing are collectively known as xUnit. Originally developed for Smalltalk, there are now xUnit frameworks available for many programming languages. The current version 4 of the […]
Some notes on lists in Lisp
As you have seen in my previous post, working with lists is easy if lists are build into a programming language. But what if the language itself is made of lists? The Lisp programming language is made of lists. Let’s have a look at […]
Some notes on lists in Java and Python
Java and Python both have collection types (or compound data types). For a general introduction into collection types, you might want to have a look at Wikipedia. One of the most basic collection types is a list. In Java, you use the interface java.util.List […]
About coding conventions
Coding conventions are an important part of software development. Contrary to popular belief, it is not only the functionality of the code that matters, what the code does, but also the readability, what the code looks like. That is because code is read much […]
Writing shell scripts in Python
After browsing the web for some time, your download folder might be filled with a lot of files of different type. PDF files, image files and more. Or maybe you collected a lot of files in a temp folder and now you want to […]
How do I write and read plain text files in Python?
Writing and reading plain text files is easy in Python. Look at the following functions. def write_file(txt, filename): with open(filename, ‘w’) as f: f.write(txt) def read_file(filename): with open(filename, ‘r’) as f: return […]
Can I add elements to a java.util.List that is backed by an array?
It seems that you can add elements to a java.util.List that is backed by an array. For example, you could try this: import java.util.Arrays; import java.util.List; public class ListSample { public static void main(String[] args) { String[] a = {“foo”, “bar”}; List l […]