The Rules of Code

What lies beneath

A single file should contain fewer than 20000 lines of code. Preferably 1000. A single file should contain only one class. If this breaks the previous rule then your class is probably too large: refactor. It would be nice if a single routine could fit into 100 lines of code. Unit testing is awesome and will almost certainly catch on. Use consistent formatting. Even better: don’t bother and let clang-format do it. [Read More]


Most recent development is managed in GitLab. I started in GitHub using Travis CI but I jumped ship when I discoverd the bright lights and built-in CI of GitLab. See my Wikipedia contributions and techie tidbits (plus cat pics) on Twitter. Highlighted repos tracehost Network mapper using bash and GraphViz – repo website Have A Nice Day Trader Trading strategy backtester – repo, website tradeR Currency analysis in R – repo, website [Read More]


Ways to get

Via the (Linux) filesystem int r; std::ifstream("/dev/urandom").read(reinterpret_cast<char*>(&r), sizeof r); char r; std::ifstream{"/dev/urandom"} >> r; STL Uniform random bit generators uniform_random_bit_generator Engines and engine adaptors linear_congruential_engine mersenne_twister_engine subtract_with_carry_engine discard_block_engine independent_bits_engine shuffle_order_engine Non-deterministic generator random_device Distributions Uniform distributions uniform_int_distribution uniform_real_distribution generate_canonical Bernoulli distributions bernoulli_distribution binomial_distribution negative_binomial_distribution geometric_distribution Poisson distributions poisson_distribution exponential_distribution gamma_distribution weibull_distribution extreme_value_distribution Normal distributions normal_distribution lognormal_distribution chi_squared_distribution cauchy_distribution fisher_f_distribution student_t_distribution Sampling distributions discrete_distribution piecewise_constant_distribution piecewise_linear_distribution References https://en. [Read More]

Website hosting

On the cheap...

Hugo So this whole site is generated from markdown using the Hugo blog engine. And it’s hosted on GitLab completely free. See how I did it. This does really need settiing up from a softie, but once it’s in place you an edit and add articles within in the browser. 000webhost / Hostinger Free hosting is available from 000webhost – albeit with an advert. But you can go pro for as little as $2 a month. [Read More]


Challenger banks are small, recently created retail banks that compete directly with the longer-established banks in the country, sometimes by specialising in areas underserved by the “big four” banks (Barclays, HSBC, Lloyds Banking Group, and NatWest Group). See challenger bank on Wikipedia. Challenger banks Aldermore Atom Bank Metro Bank Monzo N26 OakNorth Shawbrook Bank Starling Bank Tandem Bank Investment banks lloydsbanking. [Read More]

Single board computers

Projects Plant irrigation system ANPR – car number plate detection system Webcam – with upload/sync to GoogleCloud (rsync, cron) Signal triangulation – calculate relative position of multiple devices using audio, Bluetooth etc. Media server using Kodi Send SMS message Send periodic UDP broadcasts from multiple devices and log in Wireshark Home certificate authority Mail server PXE boot server and client Regularly port-scan all devices on your home network Stores https://thepihut. [Read More]

Ports blocked over VPN

Or are they?

A problem that has followed me around for the last two jobs: I can’t access the git server using ssh authentication when I’m tethered. Yet cloning via https is fine… it kinda feels like ports are being blocked by the VPN. However, it seems to be my EE phone not working correctly over IPv6, or rather not switching back to IPv4 correctly. And the fix is to create another APN with only IPv4 enabled. [Read More]