Age of Reason by Thomas Paine

First, That the idea or belief of a word of God existing in print, or in writing, or in speech is inconsistent in itself for the reasons already assigned. These reasons, among many others, are the want of an universal language; the mutability of language; the errors to which translations …

more ...

Define Error Cases Too

When defining the interface between two sections of an app, don't forget to specify how errors are conveyed and how the receiving party can detect and handle them. Of course you should specify what errors might occur.

Notes from my mistakes...

more ...

Unix Fortune on Mac and Custom Fortunes

Install fortune on your mac with Homebrew.

brew install fortune

You can go ahead and start using it now, but if you want to customize your fortune files you need to know the following:

Fortune files are found in /usr/local/share/games/fortunes.

To add a new fortune file …

more ...

Msgpack vs Json in Python: Preliminary Investigation

Earlier this year in the Falcon documentation I chanced upon MsgPack. It has a pretty snazzy website you can find here. Wow, look at that! It's both smaller and faster than JSON!

I've compiled here a complete picture of the uses and disuses for the Msgpack encoding scheme. This document …

more ...

Getting a REST api into your Mac clipboard

Automator is handy. It's a visual replacement for stringing together commands with pipes. Suppose you have an exposed REST endpoint which provides JSON data and you want to get some of this information into your clipboard. You can create an automator workflow which does this. All you have to do …

more ...

Infinite Pebble Puzzle and Prolog

Puzzle: You have an infinite grid in the first quadrant. It extends infinitely as X and Y increase. You begin with a pebble in the 0-0 grid in the bottom left hand position. You can perform moves by removing a pebble and placing two new pebbles, one above and one …

more ...

Bug Review: Python Subprocesses and GET

Bug 1: Python and Operating Systems

This week I've run into two bugs of note. The first comes from a classmate of mine. His python scraping script terminated with an out of memory error. He determined the error came from a call to the subprocess module, specifically subprocess.check_output.

From …

more ...

Sicstus Prolog: Basic Workflow

I'm taking a course in Prolog; it's mind bending and I love it. But sometimes the developer environment can be a pain. Apparently there exist some nice Emacs integrations, but I needed some way to work with Vim.

  1. Enable line editing in sicstus. Install rlwrap.
sudo brew install rlwrap

or …

more ...

Code Read Through: TQDM

We begin with this:

# an explicit index of the packages for 'import *'
__all__ = ['tqdm', 'trange']

Here's a list of sub-functions:

  • format_interval()
  • format_meter()
  • StatusPrinter.print_status()
  • tqdm()

Notes: The default file is sys.stderr, this is overwritable The StatusPrinter manually flushes Actual loading bar creation occurs in format_meter There's a limiting feature …

more ...

Hunt's Concurrent Heap-based Priority Queue

Remember, this is just a collection of thoughts.

These research papers skim through fundamental computer science topics fairly quickly. Look at this terse summary:

A heap is a binary tree with a property that the key at any node has higher priority than the keys at its children (if they …

more ...