Ever wonder how Standard Normal and Student-t Distribution z-tables are generated?

I have created a program on github to answer this question with examples and code samples: https://github.com/jlinoff/ztables. It shows how to generate z-tables for Standard Normal Distributions and Student-t Distributions. It also shows how to generate the z-values for specific probabilities from those distributions without using any special libraries.

The program has been tested using Python 2.7.10 and 3.5.

Simple algorithm to insert commas (commaize) in 9 languages


This project contains nine different language implementations of a simple algorithm named “commaize” that inserts commas into a number. The languages are: bash, c++, java, javascript, perl, php, python, ruby and tcl. My hope is that it will be a useful reference.
Continue reading Simple algorithm to insert commas (commaize) in 9 languages

Select the k-th smallest item from an unordered array in O(n) in python

This blog contains two python implementations of the SELECT algorithm to select the k-th ordered item from an unsorted array of N items in O(N) time. They derive from the discussion of RANDOM-SELECT and SELECT in the CLRS “Introduction to Algorithms, 3rd Edition” on pages 215-222 and from Professor David Eppstein’s lecture notes entitled “ICS 161: Design and Analysis of Algorithms” from January 30th, 1996.
Continue reading Select the k-th smallest item from an unordered array in O(n) in python

C++ class that interfaces to OpenSSL ciphers

I have developed a class named Cipher that allows you to encrypt and decrypt files or strings using the OpenSSL AES-256-CBC cipher and SHA1 digest algorithms. It is interoperable with the openssl command line tool which makes it a good introduction to using OpenSSL for ciphers.

The project has been moved to github: https://github.com/jlinoff/openssl-aes-cipher. The latest version is 1.3. It has been updated to work with the opaque contexts that were introduced in openssl-1.1.

I am re-releasing version 1.2 into the public domain on 2013-11-21 because I wish that I had found something like it when I was starting out with OpenSSL.
Continue reading C++ class that interfaces to OpenSSL ciphers