Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ralph
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
26 ms
·
241.
▲
by
ralph
14y ago
No, you get room for one more negative int. x = x < 0 ? -x : x; is a common buggy abs(), e.g. when printing an integer. One should test if it's negative, perhaps print the '-', and then ensure it's negative for the rest of the per-digit
242.
▲
by
ralph
14y ago
Nice try, but efficiency aside, it breaks. $ sed '$G;1h;1!H;$!d' <<<foo | hd 00000000 66 6f 6f 0a 0a |foo..| 00000005 $
243.
▲
by
ralph
14y ago
sed is great but it's a stream editor; try moving the last line to the start of the file.
244.
▲
by
ralph
14y ago
I think knowledge of ed helps learning vi, just as knowledge of all the Unix programs that come before help learning Perl because it has so many influences. It always bemuses me that some people try to learn it as their first language. :-)
245.
▲
by
ralph
14y ago
DOS's edlin is a very crude line editor, unlike ed(1) which has regular expressions, the g// command, etc.
246.
▲
by
ralph
14y ago
I've used ed and other commands on headless systems more than once, back when networks weren't common. One has to be careful of typing and having a bell can be useful for reassurance; grep newthing foo && echo ^G.
247.
▲
by
ralph
14y ago
It probably also has vestiges of the assembler version in its structure and symbols. troff(1) certainly has; I had trouble groking one particular function's logic and asked Kernighan. He kindly replied and said that one had always troubled
248.
▲
by
ralph
14y ago
They're either the output of --help turned into -man macros or more noise than signal. Damn info!
249.
▲
by
ralph
14y ago
If you want an ed(1) tutorial why not try Brian Kernighan's original? http://nietzschegym.com/edtut.pdf
250.
▲
by
ralph
14y ago
Yes, I'm a user of ed regularly as well when I would like to mingle interacting with it with my other before and after command line use. If you use vim then `:set t_ti= t_te=' may be of interest to stop it switching to the terminal's other
251.
▲
by
ralph
14y ago
I'd just point out that I'm not complaining about something trivial, e.g. open braces on their own line, or a matter of taste, but something fundamentally weird, unexpected, and almost designed to mislead.
252.
▲
by
ralph
14y ago
I gave up reading this very early on. The striving for compactness of the source, in both C and Go, makes it misleading to read. Take if (argc < 2) puts("y"); else { for(int i = 1; i < argc; i++) { if (i >
253.
▲
by
ralph
14y ago
PHP has all the beauty of Perl with none of the power. 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.
254.
▲
by
ralph
14y ago
A key indicator of that is it treating ASCII LF as a line separator not a line terminator, creating text files that don't end in LF.
255.
▲
by
ralph
14y ago
Why the test of both $# and $1? tr -dc '!-~' </dev/urandom | head -c ${1-12}; echo Change to A-Za-z0-9, etc., to suit.
256.
▲
by
ralph
14y ago
I pointed out the Protocol Buffers comparison to a friend on IRC. He came back with: "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. Usin
257.
▲
by
ralph
14y ago
Why blacklist rather than whitelist? 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 en
258.
▲
by
ralph
14y ago
And note that assumes there are about 2,048 common words to choose from, not the 171,000 you can find in a dictionary.
259.
▲
by
ralph
14y ago
The font is nice but I'd like one with a sexy `' pair, like they used to be before ASCII went all 8-bit on us. ;-) Also, a dollar that only has the vertical line(s) beyond the S avoids it becoming too heavy compared to glyphs around it.
260.
▲
by
ralph
14y ago
Oh, OK, I agree, for 2-3 machines reliability isn't an issue, I was thinking more dozens.
261.
▲
by
ralph
14y ago
They're using pigz on [1] so they are compressing? 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 req
262.
▲
by
ralph
14y ago
Yes, it's a good habit to get into because . is allowed in user and group names whereas : can't be; it's the field separator in /etc/{passwd,group}.
263.
▲
by
ralph
14y ago
See if bash's ignoredups and erasedups helps.
264.
▲
by
ralph
14y ago
tmpfs for mysqld's tmpdir is a similar option, perhaps even better if, as I'd hope, tmpfs's internals are simpler and faster because it has an easier job to do that ext3-sans-journal. Obviously needs the RAM though.
265.
▲
by
ralph
14y ago
It was very fast, and the built-in assembler and easy integration of your code from BASIC, e.g. [.mol% mov r0, #42:mov pc, r14]:PRINT USR mol%, meant there were easy options when it wasn't quite fast enough. But then you've got to remember
266.
▲
by
ralph
14y ago
Strictly speaking, it wasn't P. being expanded to PRINT at the time of LIST but the byte representing the tokenised PRINT being expanded then. The P. was turned into that byte earlier.
267.
▲
by
ralph
14y ago
Oh, apologies, I was forgetting Arc's whitec doesn't handle Unicode things like U+2002. The youtube URL needs " The" removing from the end.
268.
▲
by
ralph
14y ago
Yes, in BASIC you could enter keywords abbreviated with a . to save typing. The tokeniser would turn it into the byte or two representing PRINT ready for it to be interpreted. I think you're thinking of the four volume RISC OS Programmers'
269.
▲
by
ralph
14y ago
* causes OSCLI to handle the rest of the line. Dot was an abbreviation for Cat, short for catalogue, IOW ls(1). P. is presumably at the BASIC prompt; it abbreviated the PRINT keyword. OPT had the filing system set some options stored on th
270.
▲
by
ralph
14y ago
The drag-and-drop of the file icons with the sender not needing to know whether it was going to another running program or a filing system? Yes, that was nice. You know of the ROX Desktop? RISC OS on X. http://roscidus.com/desktop/
More ›