Software development resources, Linux systems administration, information security and cryptocurrency.
This site is maintained by David Egan:
- GitHub: @csknk
08 Jun 2020
It is sometimes necessary to obtain a pseudo-random number from a specific range. For example, simulating a fair die roll. This can be achieved by using modular arithmetic whereby numbers are limited to a certain range, wrapping around when the range is exceeded. Modulo bias can creep in to this process - this article explains modulo bias and shows how to eliminate it.
22 Mar 2020
Binary search is an algorithmically efficient way of searching an ordered array. This article describes a simple binary search implemented in Rust, contrasted with the same thing in C++.
21 Mar 2020
Do Fizzbuzz without using the modulus operator. Explores algorithms for computing divisibility by three and divisibility by five. Because...why not?
18 Jan 2020
Access the bitcoind JSON-RPC server securely across an insecure network by means of SSH tunnelling.
12 Dec 2019
Modular exponentiation is an important part of public key cryptography. Because the numbers involved are typically enormous, an efficient algorithm is essential for any practical applications.
01 Sep 2019
Merkle trees are an efficient way to verify that an element is in a set, without having to store the full set.
12 Aug 2019
Information Entropy is the average rate at which information is produced by a stochastic(random) source of data.
09 Aug 2019
In C++ a lambda expression or lambda function is a closure: an unnamed (anonymous) function that is passed inline - usually to another function. Lambda expressions are a concise way of creating simple function objects.
29 Jul 2019
getline() to read lines from a file, and add them to dynamically allocated memory:
21 Aug 2018
Radix 64 or base 64 is a binary-to-text encoding system that is designed to allow binary data to be represented in ASCII string format. This is an educational project accepts a string from a user and Radix 64 encodes it.
19 Jul 2018
When looping with an iterator, the index of the current iteration isn't immediately obvious unless you resort to incrementing a counter. Fortunately it's easy to find the start and end of your loop.
12 Jun 2018
This article describes a simple http server socket in Linux.
27 May 2018
Python comprehensions are syntactic sugar constructs that provide a way to build a list, dictionary or set from a starting list, dictionary or set whilst altering or filtering elements.
01 Apr 2018
04 Feb 2018
There are many ways to collect user input. In this example a user is prompted to make a selection from a numbered list. This sets the
int choice variable, which can then be used to control programme flow.