Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
_kst_
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
83 ms
·
361.
▲
by
_kst_
8y ago
I have a better (at least cleaner IMHO) workaround: PROMPT_COMMAND='printf -v today "%(%F)T" -1' printf's "-v" option was added in bash 4.0. printf's "%(...)T" format was added in b
362.
▲
by
_kst_
8y ago
> but it's hard to decide where to draw the line > It's actually very easy - legal and illegal. In what jurisdiction?
363.
▲
by
_kst_
8y ago
Not as good. I use $today a lot in file and directory names, The overhead of having to type $(today) rather than $today would be, for me , significant. I do have a workaround for this particular case: PROMPT_COMMAND='today=$(pri
364.
▲
by
_kst_
8y ago
Yes, just like that!
365.
▲
by
_kst_
8y ago
No, it's old; I've updated my comment accordingly.
366.
▲
by
_kst_
8y ago
With this release, bash now has three built-in variables (um, I mean "parameters") whose values are updated every time they're read: $RANDOM yields a random integer in the range 0..32767. (This feature was already there.) $EP
367.
▲
by
_kst_
8y ago
It surprised me too, since it's not what I got. $ perl6 --version This is Rakudo version 2018.03 built on MoarVM version 2018.03 implementing Perl 6.c. $ perl6 -e 'print 9999999999999999.0-9999999999999998.0;prin
368.
▲
by
_kst_
8y ago
I didn't say he has to prove anything to me. I said I see no evidence.
369.
▲
by
_kst_
8y ago
If he got permission from the publishers, it wouldn't be piracy. I see no evidence that he got permission from the publishers. (Thanking them doesn't imply anything.)
370.
▲
by
_kst_
8y ago
Have you talked to your representatives about changing copyright law so that out-of-print books can legally be copied?
371.
▲
by
_kst_
8y ago
I'd rather not see Hacker News get in trouble for linking to pirated material.
372.
▲
by
_kst_
8y ago
From the 6th page: "Copyright © 1983 by Xerox Corporation All right reserved." If Xerox had legitimately released this to the public, surely they would have changed the copyright notice. As far as I can tell, this is simply pirate
373.
▲
by
_kst_
8y ago
I humbly disagree on that point. a = b[i++] is certainly unambiguous to the compiler, but unlike the other example it should be unambiguous to the reader as well, assuming the reader is reasonably familiar with C. i++ yields the un
374.
▲
by
_kst_
8y ago
"19.26: How do you pronounce char? Like the first word of char *. The accent is generally on the first syllable." https://www.seebs.net/faqs/c-iaq.html
375.
▲
by
_kst_
8y ago
Does a ^ c | d mean (a ^ c) | d or a ^ (c | d) ? The answer is unambiguous, and can easily be found by consulting the standard or any decent reference, but I've been using C for decades and I couldn't
376.
▲
by
_kst_
8y ago
C has permitted mixing declarations and statements since the 1999 standard.
377.
▲
by
_kst_
8y ago
I use the names of the planets to remember the mnemonic.
378.
▲
by
_kst_
8y ago
Neptune was predicted from observed perturbations in the orbit of Neptune. Observations of Neptune in the late 19th century led to a prediction that there was another planet, beyond Neptune, that was also affecting the orbit of Uranus. Plu
379.
▲
by
_kst_
8y ago
I checked the section "Interlude: Arrays" because the relationship between pointers and arrays in C is a major sticking point. It claims that, given a declaration int array[] = { 45, 67, 89 }; the expressions "array&
380.
▲
by
_kst_
8y ago
Something I hadn't noticed before: https://xkcd.com/403/ https://xkcd.com/404/ https://xkcd.com/405/
381.
▲
by
_kst_
8y ago
Proposition 7 doesn't immediately change anything. It authorizes the state legislature to change the DST rules if authorized by federal law. Reading the text of the revised law, it does seem to emphasize the possibility of going to y
382.
▲
by
_kst_
8y ago
I guess you could think of it as an "implicit type". I prefer to think of it as a data format rather than a data type. (It doesn't satisfy the meaning of "type" as C defines the word.) char[n] (for constant n) is an
383.
▲
by
_kst_
8y ago
In C, the type of a string literal is char[n] where n is the length of the literal plus 1. In C++, it's "array of n const char", or const char[n] It's not of a reference type. See the ISO C++11 stan
384.
▲
by
_kst_
8y ago
The first sentence: "The C programming language defines a string as char* ." No, it doesn't. A string is by definition "a contiguous sequence of characters terminated by and including the first null character". A ch
385.
▲
by
_kst_
8y ago
"Yay for the wonderful "comma vee" extension that meant this didn't work on anything but Unix and even there some tools choked on it. Same for RCS and CVS ..." RCS and CVS use "filename,v". SCCS uses &quo
386.
▲
by
_kst_
8y ago
What about making the tool behave sanely so you don't have to play tricks with the OS to protect yourself from its behavior? If I type "grep", I don't want it to try to execute "g", "gr", and "gr
387.
▲
by
_kst_
8y ago
I've submitted an issue on GitHub, title "Executing incomplete commands is too dangerous". https://github.com/akavel/up/issues/8
388.
▲
by
_kst_
8y ago
A whitelist would make it far less useful. A blacklist would still make it possible to execute dangerous commands. The only solution that I would find acceptable would be not to execute incomplete commands as they're typed.
389.
▲
by
_kst_
8y ago
No, if I have a command line application, I probably want to write (possibly formatted) output to stdout -- very likely without colors or other features. A while ago, I tried to figure how how to do the equivalent of C's int n =
390.
▲
by
_kst_
8y ago
"Yoda conditions" are controversial. (Personally, I hate them.) Some people find conditions with the constant on the left, like `(0 == foo)`, jarring and difficult to read. Other people apparently aren't bothered by them. In
More ›