Informative Jottings Pieces of Useful Information

Random Integer in Linux. shuf Generates a Number in an Interval.

The easiest way to do this is to use shuf. You can generate a single integer between n and m with:

where you replace {{n}} and {{m}} with the appropriate integers.

On macOS, where shuf is not installed by default, just use python:

Solution to "Integer Identifiers" problem on Learn OCaml

Here’s the problem:

Suppose that a variable x exists and is an integer.

Define a variable x_power_8 that uses three multiplications to calculate x to the power of 8. The only function you are allowed to call is the (*) operator.

Hint: use auxiliary variables.

Solve this exercise using a nested sequence of auxiliary variable definitions. Here is a definition of x_power_8 which Learn OCaml recognizes as correct:

This can be written more simply if we use the Jane Street stdlib, Base. Assuming you have the library available, entering the following lines of code into utop will work:

Good Enough Hugo Themes

Here’s a list of Hugo themes which are good enough. Order is random. Motivation for this post follows the list.

Finding an aesthetically pleasing Hugo theme which is maintained is difficult. The main Hugo themes site offers no real way to sort things. Other sites offering some filtering of the themes are frequently unreliable because they are also selling themes.

Get the RSS feed url from an Apple Podcasts url using curl and jq

The above should work on Linux and MacOS. You may need to install jq.

The id is at the end of the https://podcasts.apple.com/... url. For example, https://podcasts.apple.com/us/podcast/behind-the-news-with-doug-henwood/id73801817 has id 73801817.

This method is known to be working in the year 2019.


Advanced one-line version using the original url (requires grep):