DBLock Context Manager

Consider, for a moment, the shelve and dbm packages for storing things in a “database.” Built-in. Lightweight. The database is essentially a mapping from identifiers to objects. It can be quite nice.

The shelve module directly puts Python objects in a file. It’s an ideal database structure for Python …

more ...



More Reasons to Stop Bash-ing

There are many good reasons to use shell scripts. Mostly, a script can be useful when it's an alias that launches an application. Beyond that, I have doubts.

BLUF

Incumbency is a popular argument for bash.

It's not a good argument, however.

Use invoke and you'll be much happier.

Background …

more ...


It's Not THE Ternary Operator -- there are many

I'm sick of reading about THE Ternary Operator.

There is not merely a single operator that is ternary. There are many operators that are ternary.

Here's one example:

>>> 6+1 >= 6 >= 6-1

The >= >= operator is ternary. It has 3 operands. Count them.

There are a 36 of these ternary operators …

more ...

Cleaning up Examples

Stand-alone document files for tech writing are awful. They should not be used as widely as they are.

BLUF: Don't Use MS-Word

We used to call editors like MS-Word WYSIWYG -- What You See Is What You Get. Once upon a time, an editor that immediately presented the final rendered doc …

more ...

This is Awful

Date Tags bash / json

This is a disheartening thing to read

As someone who doesn't do a ton of JSON parsing on the command line, I tend to forget jq syntax.

Two tools I really like are gron (make JSON greppable) from @tomnomnom and jqp ..., which provides a "tui playground for exploring jq."

98 …

more ...


Analyzing a Dice Mechanic

A "Dice Mechanic"? Yes. The thing you do with the dice to determine an outcome. We'll use Python to see how the dice shake out.

A little backstory

For a casino game of craps, the roll of the dice can be 7 or 11 for an immediate win, 2, 3 …

more ...