1,089 karma · joined March 1, 2007
C, Unix system and shell, Python, X Windows, ARM, ...
The article was OK. I'm not sure it mentioned addressing line 0 for the start of the file, and comma is more common than % for all lines. ed(1) is brief and lots can be learned from it.
As for structural regular expressions as used in sam(1), see Rob Pike's paper. http://doc.cat-v.org/bell_labs/structural_regexps/
if (argc < 2) puts("y"); else {
for(int i = 1; i < argc; i++) {
if (i > 1) putchar(' ');
printf("%s", argv[i]);
}
putchar('\n');
}
A casual skim sees the if followed by an indented block, but that isn't the then-path but the else-path. Now yes, I can read it carefully and follow it, just as if I was debugging someone else's poorly formatted code, but in doing so my attention is being distracted from the main point of the article and frankly I have a huge pile of other things to read that are potentially more rewarding.I think part of the reason folks pillory PHP is their annoyance that people are using it as their first language and may never move beyond it to the better alternatives available.
tr -dc '!-~' </dev/urandom | head -c ${1-12}; echo
Change to A-Za-z0-9, etc., to suit."They rolled their own "high-level" serializer and deserializer for PB, built on top the lower-level stuff the documentation advises you not to use. Using the recommended interfaces, PB is faster than in their test. It is still slower than msgpack. Not sure why they'd make their test look cooked when they win in a fair test anyway. Further examination shows that the test is _mainly_ a test of std::string, for protobuf. std::string is required to use contiguous storage, whilst msgpack's test uses a msgpack-specific rope type."
LC_ALL=C egrep '^[[:lower:]]{4,8}$' /usr/share/dict/words |
shuf --random-source=/dev/random -n4 |
fmt
That's picking from ~35,000 words, which I think is still good enough but avoids ending up with "interpreters incredibility disciplinary constitutionality". (I need the C locale to stop this old GNU grep being painfully slow.)I thought it wasn't a great idea. OK for an on-the-fly solution to the problem but bittorrent or multicast would seem better; the serial route between machines isn't very fault tolerant requiring a start-from-scratch on failure.
socat > nc BTW, and does multicast.
As for ssh, it's a shame the "no encryption" option was removed.
But then you've got to remember that Sophie Wilson wrote the 16KiB 6502 BASIC interpreter for the BBC micro, and the BASIC for the Z80 second processor IIRC, and then brought that experience to bear when designing the ARM instruction set. Having done so, she then wrote BBC BASIC V in ARM; hardly surprising if it knew every little nuance and could wring speed out of it.
In later years, the BBC BASIC code, 6502 and ARM, were good stress tests for emulators because of her wide use of the instruction sets.
I think you're thinking of the four volume RISC OS Programmers' Manual, plus slim index, that came in a big white cardboard sleeve. Augmented later by a Volume 5 of changes with later OS versions to save re-printing costs. BASIC itself was introduced in the User Guide that came with the machine IIRC and had a one-volume reference manual of its own at additional cost.
The source of RISC OS was opened up. https://www.riscosopen.org/viewer/view/castle/RiscOS/Sources... shows part of the BASIC module which has pedigree going back to when Sophie Wilson, designer of the ARM instruction set, wrote it.
It had features I still miss today, e.g. drag a scrollbar thumb with Adjust (X's Button3) instead of Select (B1) and you were panning that scrollbar and its partner in the other axis. Adjust often did similar to Select but with a tweak, e.g. the pop-up context menu with Menu (B2) could have an item selected with Select and would disappear but use Adjust and the menu, possibly several deep, remained opened. How often today do you have to re-navigate to a nearby place to select a second item? Select on a scrollbar's up arrow scrolls up, Adjust down; no need to move to the other end of the bar. Same goes with paging by clicking to the side of the thumb.