HNHacker News
TopNewBestAskShowJobs

kmstout

876 karma · joined May 1, 2019

https://www.reindeereffect.com

https://reindeereffect.github.io

submissionscomments
kmstout··on How to rebuild social media on top of RSS
I used to do this. A long time ago, I had a setup that would sync feeds from BBC, CNN, Janes [0], and a few other places; extract and sanitize [1] the text of the articles for the previous day; and ultimately prepare a nicely typeset, five column, landscape oriented PDF. It took some trial and error to get something usable, but the printed result was a pleasant way to stay informed.

That was many moons ago.

---

[0] Circa 2008, I could find several feeds from Janes that carried meaty non-subscriber extracts.

[1] LaTeX is picky about all sorts of "special" characters that are more common than one might expect.

kmstout··on Jqjq: Jq Implementation of Jq
Aye, computation is a medium of expression.
kmstout··on Why it’s hard to buy deodorant in Manhattan
I'll remember this if I ever recreate my RSS to five-column-PDF-emailed-to-myself-every-morning setup. I had to do some ungood things to make BBC articles safe for LaTeX back then.
kmstout··on Why it’s hard to buy deodorant in Manhattan
Instead of `paps`, you could also try

  ... | sed -re 's/$/\n\n/' | uniq | man -Tps -l - | ...
If you have groff, you can also have `man` go straight to PDF.
kmstout··on Life in the slow lane: how the slow cooker changed the world
I find the slow cooker is most useful for making lots of food ahead of time. Two slow cookers, a good freezer, and a stack of cheap containers are excellent tools for keeping people well fed when time is short.
kmstout··on Why it’s hard to buy deodorant in Manhattan

  $ curl -s 'https://www.economist.com/united-states/2022/11/24/why-its-hard-to-buy-deodorant-in-manhattan' | grep articleBody | jq -r .articleBody 2>/dev/null | fmt
kmstout··on Hacker News Parody Thread (2013)
POST THANKING PARENT FOR LINK TO ENDLESS ENTERTAINMENT.
kmstout··on APL deserves its renaissance too (2018)
Suppose you have a couple graphs, represented by adjacency matrices (A and B) whose cells represent travel times or distances or some other notion of cost. Assuming their dimensions are compatible, and that the columns of A correspond to the same nodes as the rows of B, then

  A ⌊.+ B
will produce a new adjacency matrix (call it C) where each c_ij is the minimum traversal cost from node i to node j. For example, if A represented driving times from all cities in NY state to all airports in NY, and B represented direct flight times from all NY airports to all CA airports, then our result would be the minimum travel time (ignoring parking and security) between any NY town and any CA airport.

The sequence `⌊.+` is an inner product chosen specifically to achieve this effect, with addition where multiplication would normally be, and ⌊ (min) where multiplication would normally be.

Notice that it took me longer to give this under-caffeinated explanation of what is going on than to write the code.

kmstout··on Wheels Within Wheels: The “Flammarion Engraving” (Ca. 1888)

  import spice
  assert spice.flow()
kmstout··on YouTube confirms that it has removed the “sort by oldest/newest” option
For anyone who finds this, here's a much faster ytsearch:

  ytsearch
  ========
  #! /bin/bash

  nresults=$1; shift
  query="$@"

  yt-dlp -j --flat-playlist ytsearch${nresults}:"${query// /+}"
I now also have

  ytgetlist
  =========
  #! /bin/bash

  yt-dlp -j --flat-playlist "$@"
which is handy for listing entire channels. The downside of using --flat-playlist is that the upload_date ends up null, so `ytplaylist` is modified to cope:

  ytplaylist
  ==========
  #! /bin/bash

  jq -r '"\(.upload_date // .playlist_index) \(.id) \(.duration)\t\(.title)"' "$@" \
      | sort -k1n | uniq      \
      | fzf --bind "enter:execute(ytplay {+2})"
The playlist indices so far reflect the order one would get by sorting on upload date.
kmstout··on Chaos Bernie: Delete Azure resources by playing Doom
Semi-related is dungeonfs [0], a game masquerading as a FUSE filesystem.

- [0] https://fossbytes.com/dungeonfs-fuse-filesystem-dungeon-craw...

kmstout··on YouTube confirms that it has removed the “sort by oldest/newest” option
I've been rebuilding my command line YT client based on mpv, fzf, and yt-dlp (compatible with youtube-dl in all the ways that matter). Here's my search command:

  ytsearch
  ========
  #! /bin/bash

  nresults=$1; shift
  query="$@"

  yt-dlp -j ytsearch${nresults}:"${query// /+}"
This will give back my results as JSON, which I can save to a file or pipe to `ytplaylist`:

  ytplaylist
  ==========
  #! /bin/bash

  jq -r '"\(.upload_date) \(.id) \(.duration)\t\(.title)"' "$@" \
      | sort | uniq      \
      | fzf --bind "enter:execute(ytplay {+2})"

Note that, because of the layout of the lines, records get sorted based first on date.

Streaming is done via mpv:

  ytplay
  ======
  #! /bin/bash

  id=$1; shift
  mpv "ytdl://$id" --ytdl-format='best[height<=720]' "$@"

Finally, since I often don't care about saving results, wanting instead to just view the playlist,

  yt
  ==
  ytsearch "$@" | ytplaylist
So, if I want to search for videos on butchering cows, I might do

  $ yt 5 butcher cow
as a preliminary to make sure I'm getting the sorts of results I want, then do

  $ yt 50 butcher cow
and get myself a beer. I could also save the results

  $ ytsearch 50 butcher cow > deadbeef.json
and view the results at my leisure with

  $ ytplaylist deadbeef.json
`deadbeef.json` will have extensive metadata for each video found, including a channel URL. Suppose with a bit of jq I find the URL for a really good channel; I can then

  $ yt-dlp -j $CHANNEL_URL > cool-channel.json
to get a playlist for the entire channel, then operate on it like the results coming back from `ytsearch`.

Happy Friday.

kmstout··on Protein interface – how to change aproach to building software?
Clearly, you need a bank of magnetic core memory.
kmstout··on Ask HN: Is it still possible to live in a terminal?
One of the upsides of the pervasive JS is that it often calls APIs that do useful things. If you take the time to capture and study those interactions, you can develop your own libraries and CLI tools that operate those useful APIs, too [0]. Then, you can think of "browser time" as an investment that begets more "terminal time." Also, if you stick with simple interfaces for your CLIs (e.g., read and write pretty printed JSON instead of inventing your own "human readable" formats), it's much easier to make your tools snap together like German nouns, like McIlroy intended [1].

[0] This is all subject to how much you care, of course. Not all automation is worth the hassle.

[1] His metaphor was actually garden hoses that screw together.

kmstout··on Assyrian Soft Power
> "Apocalypse" ... means literally "the lifting of the veil" ...

You have just made weddings vastly more entertaining.

kmstout··on School vs. Wikipedia
Today, we learn about the toilegami.
kmstout··on Will We Ever Run Out of Sudoku Puzzles?
Early in the pandemic I cracked my knuckles on writing generator for monster Sudoku [1]; an example can be seen at [2]. I haven't solved a single one of them by hand.

[1] https://reindeereffect.github.io/2020/05/05/index.html

[2] https://reindeereffect.github.io/2020/05/05/images/5x5/new.p...

kmstout··on DBOS: A database-oriented operating system
There's a cool little demo [0] of AS/400's files-as-databases concept:

[0] https://www.youtube.com/watch?v=CDSgJE5mPJM

kmstout··on The end of the manual transmission is near?
That's a pretty car.
kmstout··on Using the power of the sun to roast green chile
There's an opportunity here to have a solar-powered Rube Goldberg contraption for transforming water and green coffee beans into something truly delightful.
kmstout··on Milwaukee Tool Raises the Bar with New USA Factory
If only they would make the Unix^H^H^H^HHole Hawg [0] in the US of A.

[0] http://www.team.net/mjb/hawg.html

kmstout··on Let websites framebust out of native apps
TotalNews was great for a young news junky who hadn't yet discovered RSS.
kmstout··on Excel never dies (2021)
The creators of awk wrote an excellent book on it [0]. Also, the man page is good for quick reference.

[0] https://archive.org/details/pdfy-MgN0H1joIoDVoIC7/page/n3/mo...

kmstout··on Take more screenshots
They use a lot of butter and they go well with coffee. Yes. (Both Wikipedia [1] and the Joy of Cooking consider them cakes rather than cookies.)

[1] https://en.wikipedia.org/wiki/Madeleine_(cake)

[2] Irma Rombauer, Marion Rombauer Becker, and Ethan Becker. Joy of Cooking (rev. ed.). Scribner. 1997. pp 962-963.

kmstout··on The Beauty of Unix Pipelines (2020)
Someone else mentioned using a hash table to accumulate counts; that approach would give something like

  ~/bin/freq
  ==========
  #! /bin/bash

  awk '{acc[$0]++} END {for (item in acc) {print acc[item], item}}' | sort -nr
kmstout··on The Beauty of Unix Pipelines (2020)
Roll your own:

  ~/bin/freq
  ==========
  #! /bin/bash

  sort "$@" | uniq -c | sort -nr
Once you get into the habit of capturing your habits as scripts that snap together like German nouns, you'll find the command line a wondrous place.
kmstout··on Don't just shorten your URL, make it suspicious and frightening (2010)
Previous discussion:

- http://www.5z8.info/backyard-fireworks-disasters_w0v6qb_hitl...

- http://www.5z8.info/foreign-brides_a7s2us_begin-bank-account...

- http://www.5z8.info/stoleniphones_w7e4ro_whitepower

- http://www.5z8.info/gruesome-gunshot-wounds_f1u0dv_usb-hijac...

kmstout··on Thinking in an array language
Somewhere on YouTube is a talk where Gerald Sussman described mathematics (or at least mathematical presentation) as "impressionistic."
kmstout··on Passenger with “no idea how to fly” lands plane after pilot incapacitated
"When did you learn how to fly?"

"I didn't, but I did stay at a Holiday Inn Express last night."

kmstout··on Parsing / Recursive Descent Parser
A long time ago I did a pair of articles about recursive descent parsing [1] [2], from very basic theory to a crappy programming language. As a side effect I also made a cantankerous parser generator [3] that produces a backtracking recursive descent parser from EBNF.

[1] https://reindeereffect.github.io/2018/12/08/index.html

[2] https://reindeereffect.github.io/2019/01/16/index.html

[3] https://github.com/reindeereffect/tools-from-blog/tree/maste...

← PreviousPage 4 of 7Next →