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

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

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




Concurrency and Painting

This metaphor comes from Herlihy's The Art of Multiprocessor Programming; maybe in the future I'll extend it.

Multiprocessor synchronization and Concurrency is painting a house. You have four workers, two brushes, one roller, one ladder, and one giant can of paint. The goal here is to paint the house as …

more ...

iTunes 11 and mp3 files

"I can't import mp3 files into iTunes 11" you say. I hear your pain.

Disclaimer, I am not importing music from audio CDs. If you're looking to do that look at the apple documentation here.

Attempts

There are various ways of 'importing' an audio file into iTunes. You can drag …

more ...