iopus6: format Katolaz's article - tgtimes - The Gopher Times Err bitreich.org 70
hgit clone git://bitreich.org/tgtimes git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/tgtimes URL:git://bitreich.org/tgtimes git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/tgtimes bitreich.org 70
1Log /scm/tgtimes/log.gph bitreich.org 70
1Files /scm/tgtimes/files.gph bitreich.org 70
1Refs /scm/tgtimes/refs.gph bitreich.org 70
1Tags /scm/tgtimes/tag bitreich.org 70
1README /scm/tgtimes/file/README.md.gph bitreich.org 70
i--- Err bitreich.org 70
1commit a490b2664631b88b9b72da536fc98f46af996d35 /scm/tgtimes/commit/a490b2664631b88b9b72da536fc98f46af996d35.gph bitreich.org 70
1parent 6cb09c45ab9e637ffdcc811e868b1dbdb14bcbb2 /scm/tgtimes/commit/6cb09c45ab9e637ffdcc811e868b1dbdb14bcbb2.gph bitreich.org 70
hAuthor: Josuah Demangeon <me@josuah.net> URL:mailto:me@josuah.net bitreich.org 70
iDate: Sat, 3 Sep 2022 20:48:24 +0200 Err bitreich.org 70
i Err bitreich.org 70
iopus6: format Katolaz's article Err bitreich.org 70
i Err bitreich.org 70
iDiffstat: Err bitreich.org 70
i M opus6/article-ig0r-I-Hate-Modern-T… | 28 +++++++++++++++++++++------- Err bitreich.org 70
i M opus6/article-katolaz-formatting-p… | 190 ++++++++++++++++++++++++++++++- Err bitreich.org 70
i Err bitreich.org 70
i2 files changed, 210 insertions(+), 8 deletions(-) Err bitreich.org 70
i--- Err bitreich.org 70
1diff --git a/opus6/article-ig0r-I-Hate-Modern-Technology.mw b/opus6/article-ig0r-I-Hate-Modern-Technology.mw /scm/tgtimes/file/opus6/article-ig0r-I-Hate-Modern-Technology.mw.gph bitreich.org 70
i@@ -2,7 +2,8 @@ Err bitreich.org 70
i I Hate Modern Technology Err bitreich.org 70
i . Err bitreich.org 70
i .PP Err bitreich.org 70
i-Modern technology sucks. This might be me behaving like a pathetic little angsty hipster or trying to LARP thinking I’m somehow cool, but I think it’s a genuine problem. Err bitreich.org 70
i+Modern technology sucks. Err bitreich.org 70
i+This might be me behaving like a pathetic little angsty hipster or trying to LARP thinking I’m somehow cool, but I think it’s a genuine problem. Err bitreich.org 70
i . Err bitreich.org 70
i .SS Err bitreich.org 70
i Planned Obsolesence Err bitreich.org 70
i@@ -14,16 +15,20 @@ Technology is being designed to fail. Err bitreich.org 70
i Apple purposefully makes batteries fail on their devices and solders them in such that replacing the battery on an older device makes no sense, forcing the customer to buy a new device. Err bitreich.org 70
i Err bitreich.org 70
i .PP Err bitreich.org 70
i-Lenovo’s quality has gone down the shitter. Thinkpads used to be thick, bulky, and rugged such that a caveman could use it in place of a club. New models bend and creak, the hinges breaking after several years of use while older models still run like new. Err bitreich.org 70
i+Lenovo’s quality has gone down the shitter. Err bitreich.org 70
i+Thinkpads used to be thick, bulky, and rugged such that a caveman could use it in place of a club. Err bitreich.org 70
i+New models bend and creak, the hinges breaking after several years of use while older models still run like new. Err bitreich.org 70
i . Err bitreich.org 70
i .PP Err bitreich.org 70
i-The reality is companies want people to consume technology, not use it. They care about making a profit rather than giving users a good experience, hence poor quality of manufacturing to speed up distribution, consumption, and the filling of landfills. Err bitreich.org 70
i+The reality is companies want people to consume technology, not use it. Err bitreich.org 70
i+They care about making a profit rather than giving users a good experience, hence poor quality of manufacturing to speed up distribution, consumption, and the filling of landfills. Err bitreich.org 70
i . Err bitreich.org 70
i .SS Err bitreich.org 70
i Modern Software Sucks Err bitreich.org 70
i . Err bitreich.org 70
i .PP Err bitreich.org 70
i-Modern software is just bad. Here’s a few reasons why… Err bitreich.org 70
i+Modern software is just bad. Err bitreich.org 70
i+Here’s a few reasons why… Err bitreich.org 70
i . Err bitreich.org 70
i .IP \(bu Err bitreich.org 70
i It’s idiot proof, in that I have little control over settings and configuration Err bitreich.org 70
i@@ -41,10 +46,17 @@ Smartphones Err bitreich.org 70
i Smartphones are the most annoying little shits, and for some reason they’ve become ubiquitous. Err bitreich.org 70
i . Err bitreich.org 70
i .PP Err bitreich.org 70
i-Restaurants are starting to ditch regular menus in favor of QR codes to be scanned with smartphones. Why? Paper is more reliable. This is a step backwards in my opinion. What if I don’t have a data plan? What if I don’t carry a smartphone? Err bitreich.org 70
i+Restaurants are starting to ditch regular menus in favor of QR codes to be scanned with smartphones. Err bitreich.org 70
i+Why? Err bitreich.org 70
i+Paper is more reliable. Err bitreich.org 70
i+This is a step backwards in my opinion. Err bitreich.org 70
i+What if I don’t have a data plan? Err bitreich.org 70
i+What if I don’t carry a smartphone? Err bitreich.org 70
i . Err bitreich.org 70
i .PP Err bitreich.org 70
i-Also why does everything have to be an app? Why does my passport have to be an app? I’m perfectly happy carrying around paper ID (paper ID doesn’t spy on my). Err bitreich.org 70
i+Also why does everything have to be an app? Err bitreich.org 70
i+Why does my passport have to be an app? Err bitreich.org 70
i+I’m perfectly happy carrying around paper ID (paper ID doesn’t spy on my). Err bitreich.org 70
i . Err bitreich.org 70
i .SS Err bitreich.org 70
i People are idiots Err bitreich.org 70
i@@ -53,4 +65,6 @@ People are idiots Err bitreich.org 70
i Most companies justify making technology suck more by saying it’s ‘easier’ and more ‘convenient’ for normal people. Err bitreich.org 70
i . Err bitreich.org 70
i .PP Err bitreich.org 70
i-Stop making easy and more convenient. Nobody asked for that. We were happy when technology was hard. Err bitreich.org 70
i+Stop making easy and more convenient. Err bitreich.org 70
i+Nobody asked for that. Err bitreich.org 70
i+We were happy when technology was hard. Err bitreich.org 70
1diff --git a/opus6/article-katolaz-formatting-paragraphs.mw b/opus6/article-katolaz-formatting-paragraphs.mw /scm/tgtimes/file/opus6/article-katolaz-formatting-paragraphs.mw.gph bitreich.org 70
i@@ -1 +1,189 @@ Err bitreich.org 70
i-gopher://republic.circumlunar.space/0/~katolaz/phlog/20190213_fold.txt Err bitreich.org 70
i+.SH katolaz Err bitreich.org 70
i+fold, fmt, par: get your text in order Err bitreich.org 70
i+. Err bitreich.org 70
i+.PP Err bitreich.org 70
i+If you happen to read plain text files (e.g., phlog posts), you have Err bitreich.org 70
i+probably noticed that, especially on gopher, the lines of a text file Err bitreich.org 70
i+tend to be wrapped all to a similar length. Some authors are very strict Err bitreich.org 70
i+on the matter, and like all the lines to be "justified" (i.e., all Err bitreich.org 70
i+adjusted to have exactly the same length, by inserting a few spaces to Err bitreich.org 70
i+get the count right). Some other authors (including myself) just do not Err bitreich.org 70
i+allow any line to be longer than a certain amount of characters (in this Err bitreich.org 70
i+case, as you might have noticed, the magic number is 72). But how to Err bitreich.org 70
i+they manage to do that? Err bitreich.org 70
i+. Err bitreich.org 70
i+.PP Err bitreich.org 70
i+Most common editors have a command to format a paragraph ('M-q' in Err bitreich.org 70
i+Emacs, 'gwip' or '{gq}' in vim normal mode, etc.). But obviously, Err bitreich.org 70
i+there are several Unix tools that can help you getting the right Err bitreich.org 70
i+formatting for your files. We are talking of fold(1), fmt(1), and Err bitreich.org 70
i+par(1), so keep reading if you want to know more. Err bitreich.org 70
i+. Err bitreich.org 70
i+.PP Err bitreich.org 70
i+The oldest one is probably `fold(1)` (and it is also the only one to be Err bitreich.org 70
i+defined in the POSIX standard...). It will just break each line to make Err bitreich.org 70
i+it fit a given length in characters (by default, 72, which is indeed a Err bitreich.org 70
i+magic number). Let's see how to wrap the lines of this post at 54 Err bitreich.org 70
i+characters: Err bitreich.org 70
i+. Err bitreich.org 70
i+.DS Err bitreich.org 70
i+$ fold -w 54 20190213_fold.txt | head -10 Err bitreich.org 70
i+ fold, fmt, par: get your text in order Err bitreich.org 70
i+============================================ Err bitreich.org 70
i+ Err bitreich.org 70
i+If you happen to read plain text files (e.g., phlog po Err bitreich.org 70
i+sts), you have Err bitreich.org 70
i+probably noticed that, especially on gopher, the lines Err bitreich.org 70
i+ of a text file Err bitreich.org 70
i+tend to be wrapped all to a similar length. Some autho Err bitreich.org 70
i+rs are very strict Err bitreich.org 70
i+on the matter, and like all the lines to be "justified Err bitreich.org 70
i+$ Err bitreich.org 70
i+.DE Err bitreich.org 70
i+. Err bitreich.org 70
i+.PP Err bitreich.org 70
i+Notice that fold(1) did not really think twice before breaking "posts" Err bitreich.org 70
i+or "authors" across two lines. This is pretty inconvenient, to say the Err bitreich.org 70
i+least. You can actually force fold(1) to break stuff at blank spaces, Err bitreich.org 70
i+using the '-s' option: Err bitreich.org 70
i+. Err bitreich.org 70
i+.DS Err bitreich.org 70
i+$ fold -w 54 -s 20190213_fold.txt |head -10 Err bitreich.org 70
i+ fold, fmt, par: get your text in order Err bitreich.org 70
i+============================================ Err bitreich.org 70
i+ Err bitreich.org 70
i+If you happen to read plain text files (e.g., phlog Err bitreich.org 70
i+posts), you have Err bitreich.org 70
i+probably noticed that, especially on gopher, the Err bitreich.org 70
i+lines of a text file Err bitreich.org 70
i+tend to be wrapped all to a similar length. Some Err bitreich.org 70
i+authors are very strict Err bitreich.org 70
i+on the matter, and like all the lines to be Err bitreich.org 70
i+$ Err bitreich.org 70
i+.DE Err bitreich.org 70
i+. Err bitreich.org 70
i+.PP Err bitreich.org 70
i+Nevertheless, the output of fold(1) is still quite off: it breaks lines Err bitreich.org 70
i+at spaces, but it does not "join" broken lines to have a more consistent Err bitreich.org 70
i+formatting. This is where `fmt(1)` jumps in: Err bitreich.org 70
i+. Err bitreich.org 70
i+.DS Err bitreich.org 70
i+$ fmt -w 54 20190213_fold.txt |head -10 Err bitreich.org 70
i+ fold, fmt, par: get your text in order Err bitreich.org 70
i+============================================ Err bitreich.org 70
i+ Err bitreich.org 70
i+If you happen to read plain text files (e.g., phlog Err bitreich.org 70
i+posts), you have probably noticed that, especially on Err bitreich.org 70
i+gopher, the lines of a text file tend to be wrapped Err bitreich.org 70
i+all to a similar length. Some authors are very strict Err bitreich.org 70
i+on the matter, and like all the lines to be Err bitreich.org 70
i+"justified" (i.e., all adjusted to have exactly the Err bitreich.org 70
i+same length, by inserting a few spaces to get the Err bitreich.org 70
i+$ Err bitreich.org 70
i+. Err bitreich.org 70
i+.PP Err bitreich.org 70
i+Now we are talking: fmt(1) seems to be able to to "the right thing" Err bitreich.org 70
i+without much effort, and it has a few other interesting options as well. Err bitreich.org 70
i+Just have a look at the manpage. Simple and clear. Err bitreich.org 70
i+. Err bitreich.org 70
i+.PP Err bitreich.org 70
i+Last but not least, `par(1)` can do whatever fmt(1) and fold(1) can do, Err bitreich.org 70
i+plus much, much more. For instance: Err bitreich.org 70
i+. Err bitreich.org 70
i+.DS Err bitreich.org 70
i+$ par 54 < 20190213_fold.txt | head -10 Err bitreich.org 70
i+ fold, fmt, par: get your text in order Err bitreich.org 70
i+============================================ Err bitreich.org 70
i+ Err bitreich.org 70
i+If you happen to read plain text files (e.g., phlog Err bitreich.org 70
i+posts), you have probably noticed that, especially on Err bitreich.org 70
i+gopher, the lines of a text file tend to be wrapped Err bitreich.org 70
i+all to a similar length. Some authors are very Err bitreich.org 70
i+strict on the matter, and like all the lines to be Err bitreich.org 70
i+"justified" (i.e., all adjusted to have exactly the Err bitreich.org 70
i+same length, by inserting a few spaces to get the Err bitreich.org 70
i+$ Err bitreich.org 70
i+.DE Err bitreich.org 70
i+. Err bitreich.org 70
i+.PP Err bitreich.org 70
i+will give more or less the same output as fmt(1). But: Err bitreich.org 70
i+. Err bitreich.org 70
i+.DS Err bitreich.org 70
i+$ par 54j < 20190213_fold.txt | head -10 Err bitreich.org 70
i+ fold, fmt, par: get your text in order Err bitreich.org 70
i+============================================ Err bitreich.org 70
i+ Err bitreich.org 70
i+If you happen to read plain text files (e.g., phlog Err bitreich.org 70
i+posts), you have probably noticed that, especially on Err bitreich.org 70
i+gopher, the lines of a text file tend to be wrapped Err bitreich.org 70
i+all to a similar length. Some authors are very Err bitreich.org 70
i+strict on the matter, and like all the lines to be Err bitreich.org 70
i+"justified" (i.e., all adjusted to have exactly the Err bitreich.org 70
i+same length, by inserting a few spaces to get the Err bitreich.org 70
i+$ Err bitreich.org 70
i+.DE Err bitreich.org 70
i+. Err bitreich.org 70
i+.PP Err bitreich.org 70
i+will additionally "justify" your lines to the prescribed width, while: Err bitreich.org 70
i+something like: Err bitreich.org 70
i+. Err bitreich.org 70
i+.DS Err bitreich.org 70
i+$ head file.h Err bitreich.org 70
i+ * Err bitreich.org 70
i+ * include/linux/memory.h - generic memory definition Err bitreich.org 70
i+ * Err bitreich.org 70
i+ * This is mainly for topological representation. We define the Err bitreich.org 70
i+ * basic "struct memory_block" here, which can be embedded in per-arch Err bitreich.org 70
i+ * definitions or NUMA information. Err bitreich.org 70
i+ * Err bitreich.org 70
i+ * Basic handling of the devices is done in drivers/base/memory.c Err bitreich.org 70
i+ * and system devices are handled in drivers/base/sys.c. Err bitreich.org 70
i+ * Err bitreich.org 70
i+$ Err bitreich.org 70
i+.DE Err bitreich.org 70
i+. Err bitreich.org 70
i+.PP Err bitreich.org 70
i+can be easily transformed into: Err bitreich.org 70
i+. Err bitreich.org 70
i+.DS Err bitreich.org 70
i+$ par 40j < file.h Err bitreich.org 70
i+ * Err bitreich.org 70
i+ * include/linux/memory.h - generic Err bitreich.org 70
i+ *memory definition Err bitreich.org 70
i+ * Err bitreich.org 70
i+ * This is mainly for topological Err bitreich.org 70
i+ * representation. We define the basic Err bitreich.org 70
i+ * "struct memory_block" here, which can Err bitreich.org 70
i+ * be embedded in per-arch definitions Err bitreich.org 70
i+ * or NUMA information. Err bitreich.org 70
i+ * Err bitreich.org 70
i+ * Basic handling of the devices is Err bitreich.org 70
i+ * done in drivers/base/memory.c and Err bitreich.org 70
i+ * system devices are handled in Err bitreich.org 70
i+ * drivers/base/sys.c. Err bitreich.org 70
i+ * Err bitreich.org 70
i+ * Memory block are exported via Err bitreich.org 70
i+ * sysfs in the class/memory/devices/ Err bitreich.org 70
i+ * directory. Err bitreich.org 70
i+ * Err bitreich.org 70
i+ * Err bitreich.org 70
i+$ Err bitreich.org 70
i+. Err bitreich.org 70
i+.PP Err bitreich.org 70
i+Pretty neat, right? Err bitreich.org 70
i+.FS Err bitreich.org 70
i+To be honest, par is not the typical example of a unix tool that Err bitreich.org 70
i+"does exactly one thing", but it certainly "does it very well" all the Err bitreich.org 70
i+things it does. The author of par(1) felt the need to apologise in the Err bitreich.org 70
i+manpage about the style of his code and documentation, but I still think Err bitreich.org 70
i+par(1) is an awesome tool nevertheless. Err bitreich.org 70
i+.FE Err bitreich.org 70
i+. Err bitreich.org 70
i+.IP "fold(1)" Err bitreich.org 70
i+appeared in BSD1 (1978-1979) Err bitreich.org 70
i+. Err bitreich.org 70
i+.IP "fmt(1)" Err bitreich.org 70
i+appeared in BSD1 (1978-1979) Err bitreich.org 70
i+. Err bitreich.org 70
i+.IP "par(1)" Err bitreich.org 70
i+was developed by Adam Costello in 1993, as a replacement for fmt(1). Err bitreich.org 70
.
Response:
text/plain