Link of the day: Jon Skeet speaks
2016-Mar-15Jon Skeet on the tricky edge cases that can show up with basic data types and how they model reality. Back to basics: the mess we’ve made of our fundamental data types
Jon Skeet on the tricky edge cases that can show up with basic data types and how they model reality. Back to basics: the mess we’ve made of our fundamental data types
In this post I’ll share a way to get a Grooveshark-like experience with a Linux command-line application.
Step 1: Build a YouTube playlist with some music you like.
Step 2: Go to your channel, select Playlists, find the one you just made,
and click View full playlist.
Make sure the privacy setting is either public or unlisted.
Copy the playlist ID in the URL (after list=
).
For example, the playlist ID of one of my playlists is
PLmaRvdyzIrIGkRbl7jJdzEYrRcXe4od9G
.
Step 3: Install mpv
and mps-youtube
.
Step 4: Run
mpsyt pl <playlist ID>, dump, \*
You’re streaming the playlist!
Press <space>
to pause/play, <
to play previous track, >
to play next
track.
To play the playlist shuffled, run this instead:
mpsyt pl <playlist ID>, dump, shuffle \*
I have this alias in my .zshrc
file:
alias playlistName="mpsyt pl PLmaRvdyzIrIGkRbl7jJdzEYrRcXe4od9G, dump, shuffle \*"
so I can get music playing with just one command.
If, as in Grooveshark, your YouTube playlists are public, you can open
mpsyt
and run userpl <YouTube username>
to see your YouTube playlists
and select one to play.
The good thing is that the whole videos aren’t streamed, just high-quality audio.
Among other features, mpsyt
allows you to search for YouTube videos and
create local playlists (not connected to a YouTube account), which you can do
if you want to avoid the YouTube web interface completely.
Wojciech Szpankowski:
From Wojciech Szpankowski’s book, drawn by Philippe Jacquet:
The first intellectual operation in which I arrived at any proficiency, was dissecting a bad argument, and finding in what part the fallacy lay; and though whatever capacity of this sort I attained was due to the fact that it was an intellectual exercise in which I was most perseveringly drilled by my father, yet it is also true that the school logic, and the mental habits acquired in studying it, were among the principal instruments of this drilling. I am persuaded that nothing, in modern education, tends so much, when properly used, to form exact thinkers, who attach a precise meaning to words and propositions, and are not imposed on by vague, loose, or ambiguous terms. The boasted influence of mathematical studies is nothing to it; for in mathematical processes, none of the real difficulties of correct ratiocination occur.
-J.S. Mill, Autobiography
I believe “school logic” is a.k.a. scholastic logic and is something along the lines of “philosophical” logic and what Mill covered in his A System of Logic. Sometimes I found combinatorics problems to require careful thinking in order to avoid plausible-looking mistakes. At Art of Problem Solving, instructors suggest “counting in two ways”, i.e. using two different counting strategies and comparing the results.
Programming wisdom:
Someone wrote to me once suggesting that JSLint should give a warning when a case falls through into another case. He pointed out that this is a very common source of errors, and it is a difficult error to see in the code. I answered that that was all true, but that the benefit of compactness obtained by falling through more than compensating for the chance of error. The next day, he reported that there was an error in JSLint. … I investigated, and it turned out that I had a case that was falling through. … I no longer use intentional fall throughs.
This reminds me of a story from the time when Queen Mary and Westfield College, University of London decided to change its name to Queen Mary, University of London. My colleague Wilfrid Hodges was giving a lecture in Germany, and put up his first slide, giving his name and affiliation as “Wilfrid Hodges, Queen Mary, University of London”. Somebody asked, “Is that a joint publication?”