@b0rk Have you seen `csh`'s "noclobber" feature? If you had `noclobber` set, then `cmd > file` would fail without erasing `file`, if it already existed. You would have to explicitly demand its clobbering with `cmd >! file`.
Hey, do you know about the `-o` option of `sort`? I guess it's about 90% likely that you do but if not I think you will find it tasty. I use it frequently.
My kids' schools never taught them short division, which seems to me a sad and odd omission.
The idea is that instead of doing the big hairy thing on the left you do the compact speedy thing on the right. The left-side technique should only be used when the divisor is bigger than the multiplication tables you have memorized.
The thing on the right is simple enough to do in your head, and particularly so if you only need the remainder and not the quotient. My kids were often mystified by my ability to divide in my head but it's just that I was taught a better algorithm than they were.
Interesting thought this morning. It started with: is 509 prime? So I started doing trial division. Dividing by 13 I found \(509 = 13\cdot 30 +119\) and 119 is not a multiple of 13, okay.
Now moving on to 17, I can quit immediately *without* dividing because I just saw that \(509 = 13\cdot 30 +119\) and 119 *is* a multiple of 17.
Another handy trick is, when checking if 509 is a multiple of 19, you do *not* start by dividing 509 by 19 getting 380 plus some yucky remainder. Instead you observe that 509 = 19 + 490 and 49 is not a multiple of 19 so you move on.
I only thought of this embarrassingly late in life.
An elaboration on this is that when factoring smallish numbers of the form \(n = 10k+1\) you will often need to test for divisibility by 7 and then by 13 in succession. But \( 7\cdot 13 = 91\) so instead of considering \( n\), consider \[𝑛−91=10k−90=10\cdot (k-9)\] and do both at once.
For example, instead of dividing \(5031\) by \(7\) and then by \(13\), consider \(503-9 = 494\) instead. This is evidently not divisible by \( 7\), but for \(13 \) you can see from \( 494 + 26 = 520 \) that it is a multiple of \(13\), and therefore so too was \(5031\).
The overarching trick here is (a) "short division" and (b) short division is usually taught left to right, but it works just as well right to left and you should use the one that seems easier.
To do \(5486\div 13\) it's easiest to go left to right: \[ 5486 \Rightarrow 286 \Rightarrow 26 \] aha we are done.
But to do \(4726\div 13\) it's much easier to to right to left \[ 4726 \Rightarrow 47\ne 39\] aha we are done.
@b0rk@simontatham It's a leftover from when video terminals were not universal. You would set `EDITOR=this VISUAL=that` to tell the system to use `that` if you were on a video terminal, and to fall back to `this` if you were on a hardcopy terminal.
I'm looking for a job. I have 30 years of experience doing complex systems programming in many languages, most recently Typescript, Haskell, and Python. I learn quickly. I can do advanced mathematics.
This year I helped a company migrate 15,000 customers from another company into their own systems.
Last year I helped develop a differential privacy database product written in Haskell.
Before that I helped develop a laboratory information management system that tracked up to 30,000 Covid-19 tests per day.
I live in Philadelphia, Pennsylvania, USA, but I have years of success working remotely. I can start January 1.