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 ...

The Enchiridion by Epictetus

According to Wikipedia:

Although the content is similar to the Discourses of Epictetus, it is not a summary of the Discourses but rather a compilation of practical precepts. Eschewing metaphysics, Arrian focused his attention on Epictetus's work applying philosophy in daily life.

So, chapter 1 says:

Some things are in …

more ...

Explain the Filter Lock

The Art of Multiprocess Programming is great, but occasionally you find an explanation which is needlessly complex. I hope this clarifies things Use this graphic alongside the code to better understand the filter lock. If you have any questions or are confused, feel free to reach out to me.

First …

more ...

What does Montjoie mean?

In the Song of Roland I ran into a battle cry which escaped translation. The italics are not mine.

He saw the miscreant stretched on earth:

"Caitiff, thy threats are of little worth.

On, Franks! the felons before us fall;

Montjoie!" 'Tis the Emperor's battle-call.

And again

"Well fought," said …

more ...

Falcon: How to do Long Running Requests?

Someone posed a question on the falcon mailing list the other day. They asked "How do I handle a long running-request > 15 minutes, but ensure termination when the client kills the http connection?"

The response was: Don't

Instead of having the client wait on one request for the 15 minute …

more ...