Live data from Hacker News

The most surprising Unix programs

minnie.tuhs.org

71–80 of 182 posts

Re: The most surprising Unix programs

#71
For me, the most surprising one was paste.

paste allowed me to interleave to streams or to split out a single stream into two columns. I'd been writing custom scripting monstrosities before I discovered paste:

    $ paste 
I wonder what other unix gems I've been missing...

Re: The most surprising Unix programs

#72

What about "comm" - compare two sorted files line by line. You can easily get occurrences only in file 1, in both files, only in file 2. Super powerful and saved me hours of work.

comm is a really useful tool, with one big caveat — you must make sure your input files are all sorted the exact same way. If not, you can get unexpected results, and worse, might not even realize it. This may seem obvious, but there are many tiny ways that sorts can differ between locales, operating systems and programs (e.g. Excel), especially when dealing with Unicode. It may look the same 99% of the time, and you…

GNU comm prints a warning if either file is not sorted, unless all input lines are pairable.

Re: The most surprising Unix programs

#73

What about "comm" - compare two sorted files line by line. You can easily get occurrences only in file 1, in both files, only in file 2. Super powerful and saved me hours of work.

Comm is perfect for scripting usage but you might find diff better for human usage. Added bonus diff also does binary. Plus diff was in part written by the author of the linked content :).

You might enjoy tkdiff

  sudo apt-get install tkdiff

Re: The most surprising Unix programs

#74
post #16

It's surprising that Doug McIlroy still reads and writes about UNIX. For those who don't know, Dough is the guy that invented pipes.

Also interesting: > Originators of nearly half the list--pascal, struct, parts, eqn--were women, well beyond women's demographic share of computer science.

Wirth is a man so who is he talking about wrt pascal?

Re: The most surprising Unix programs

#75
post #74

Earlier quoted context omitted.

Also interesting: > Originators of nearly half the list--pascal, struct, parts, eqn--were women, well beyond women's demographic share of computer science.

Wirth is a man so who is he talking about wrt pascal?

I'd suggest you go and actually read the article -- it's not about Pascal the language, but about a specific implementation of it.

Re: The most surprising Unix programs

#76
post #58

> The math library for Bob Morris's variable-precision desk calculator used backward error analysis to determine the precision necessary at each step to attain the user-specified precision of the result. I wonder if compilers could do this today? If you can bound values for floating point operations, you might be able to replace them with fixed point equivalents and get a big speedup. You might also be able to replac…

Replacing floats with fixed point isn’t usually a meaningful optimization on modern CPUs. The FPU runs in parallel to the integer units, so you can easily end up idling the FPU while the integer units are too busy doing both the math and the necessary state management (counters, pointer arithmetic etc.) This could make sense for SIMD however, but then the problem is getting the array data in the right format before t…

Fixed point uses a lot less power though, and many use cases are effectively power limited rather than functional-unit limited, since if you really do fill all functional units on every cycle you'll soon need to throttle back your clock speed...

Perhaps a good example of that is video encoding, which is mostly fixed point, despite it looking like a pretty close fit for floating point maths.

Re: The most surprising Unix programs

#77

Earlier quoted context omitted.

In the 40s, computing was seen as primarily women's work (similar to the stereotype of switchboard operators). Into the 60s, women still comprised up to half of the computing workforce. In 84, they peaked at 37%. So demographically speaking, the ratio was not as bad as it is today. (Source: https://en.wikipedia.org/wiki/Women_in_computing )

In the 40s, I don't think computing was a thing like you're implying, kind of like nuclear reactors were a very very tiny area. The explosion of computer usage and programming was more like the late 50s, when Fortran came out. Even then, I don't think people even thought in terms of a "computing workforce". Nobody majored in computers, a programmer might be a math major or might not. Male engineers had female assista…

50% is the workforce; 37% is for formal CS graduates. Most histories show unequal access to computing at home was a major factor discouraging woman, versus when any computing experience was on-the-job experience.

Re: The most surprising Unix programs

#78
post #75
post #74

Earlier quoted context omitted.

Wirth is a man so who is he talking about wrt pascal?

I'd suggest you go and actually read the article -- it's not about Pascal the language, but about a specific implementation of it.

I actually did, it did not answer my question, that's why I asked here.

Re: The most surprising Unix programs

#79
post #24

« Typo was as surprising inside as it was outside. Its similarity measure was based on trigram frequencies, which it counted in a 26x26x26 array. The small memory, which had barely room enough for 1-byte counters, spurred a scheme for squeezing large numbers into small counters. To avoid overflow, counters were updated probabilistically to maintain an estimate of the logarithm of the count. » This sounds like somethi…

https://link.springer.com/article/10.1007%2FBF01934993 which is one of Flajolet's early papers on the topic opens with "Approximate counting is an algorithm proposed by R. Morris". My guess would be Morris wrote it out of engineering need, and Flajolet and Martin followed up with formal analysis and resulting improvements.

Re: The most surprising Unix programs

#80
post #59
post #9

The fact that dc does (or at least tries to) guarantee error bounds on the result is news to me. And if that does indeed work, that's pretty cool.

I doubt the modern GNU or BSD versions of it that you are likely using do. Noone uses the original anymore.

Is scale factor the same as error bounds in http://man.openbsd.org/dc ?
Post reply on HN