Claus Witt

Formatting Xml Files with xmllint

I am currently working on a project where I need to parse Open Xml files comming from the Office Suite. As you may already know this involves opening what is...

Using tcpdump to Spy on Webservers

I recently had to debug an error where stuff that should have been returned through a server to server call did not work correctly. Both servers - in development mode at...

How to Read a File in C#

Csharp was probably the first compiled language I really loved. When the first version of .net came out I wrote a small CMS using C# and the new runtime. (A...

How to Read a File in Lua

Reading a file in lua is pretty straight forward.

lines = {}

for line in io.lines(arg[1]) do lines[#lines + 1] = line end

for k,v in pairs(lines) do print(k .. '...

How to Read Program Arguments in Lua

Lua is among the programming languages - that I write about here - I have used the least.

Reading program arguments is as easy as in most languages.

for i=1,#arg,1
do
  print(arg[i])
end

First...

I Wrote a Pong Game with My Son using Cocos Creator

My son (Toke, 7 years old) and I have long talked about making our own computer game.

I have four reasons for doing so.

  • I would like him to know a...

How to Read a File in C++

Reading a file in C++ is almost identical to how it's done C.

#include <iostream>
#include <fstream>
int main()
{
  std::ifstream in("test.cpp");

std::string line; auto num = 0; while...

How to create a plugin system in C++

To create a plugin system in C++ you need three things.

  • An interface for the plugin
  • A way for the plugin to inject itself into your program
  • A way for...

How to parse JSON in Rust

To parse json in Rust you need a library. The one used here is called rustc-serialize.

The first step is to create a new project.

cargo new test_json
cd !$

And then include...

How to parse JSON in C++

In C++ there are no built-in ways to handle json. However there are many open source libraries to help you.

One of the more popular ones is JsonCpp - and it...