Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
_kst_
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
39 ms
·
391.
▲
by
_kst_
8y ago
The title says "(1996)", but the document itself says "This is a rendition, after scanning, OCR, and editing, of an internal Bell Labs Technical Memorandum dated January 7, 1972."
392.
▲
by
_kst_
8y ago
If you want to make an argument about instructors giving students incorrect information, make that argument. I might even agree with you. If you insist on conflating it with sexual abuse of children, you are an idiot.
393.
▲
by
_kst_
8y ago
Nobody has mentioned that scanf has undefined behavior on numeric overflow. If INT_MAX is 2147483647 and the user enters 2147483648, the behavior is undefined. (That doesn't just mean you can get an arbitrary value for a and/or b.
394.
▲
by
_kst_
8y ago
I've mentioned elsewhere that strncpy is not a "safer" strcpy. Even if it were, there's safety and there's safety. A function (like strncat, for example) that quietly truncates your data if it's too long isn&#x
395.
▲
by
_kst_
8y ago
> ... an offense damn close to sexual molestation of minors ... Wow, that's remarkably offensive.
396.
▲
by
_kst_
8y ago
NULL is (a macro that expands to) a null pointer constant. The null character '\0' is commonly called NUL. I've written about strncpy: http://the-flat-trantor-society.blogspot.com/2012/03/no-strn...
397.
▲
by
_kst_
8y ago
Fortunately that comment appears to be gone.
398.
▲
by
_kst_
8y ago
Does the President's authority as Commander in Chief extend to creating a new branch of the armed forces? The US Air Force was created by an act of Congress (the National Security Act of 1947), not by a Presidential order.
399.
▲
by
_kst_
8y ago
I've worked on systems where env was installed as /bin/env and not as /usr/bin/env . (I think it was SunOS 4.) For that matter, under Termux on Android it's /data/data/com.termux/files&
400.
▲
by
_kst_
8y ago
#include <stdio.h> #define SIX 1+5 #define NINE 8+1 int main(void) { printf("%d * %d = %d\n", SIX, NINE, SIX * NINE); return 0; } https://github.com/Keith-S-Tho
401.
▲
by
_kst_
8y ago
C really does stress the difference. Look up the definitions of "pointer" and "array" in the C standard. They're entirely distinct concepts. p[i] is equivalent to (p+i), and that's possible because both the in
402.
▲
by
_kst_
8y ago
"always use strncpy" I disagree; you should almost never use strncpy. Its name implies that it's a "safer" version of strcpy, but that's not what it is at all. If the target array isn't big enough, it ca
403.
▲
by
_kst_
8y ago
I wouldn't call "arrays are pointers" a polite fiction. I'd call it a dangerous misconception that makes it more difficult to understand what's really going on. The language is partly at fault for a couple of rules
404.
▲
by
_kst_
8y ago
Perhaps it was supposed to be "%s\n".
405.
▲
by
_kst_
8y ago
"Explanation of needing ';' at EOL is not helping any beginner who'd be better off with the traditional "all C statements end with a ';'".]" Almost all C statements and declarations end with a
406.
▲
by
_kst_
8y ago
"In C an array is generally just a pointer to the first element." No, arrays are not pointers. "A String is generally a pointer to a series of bytes (chars) which ends in a byte value of 0 to indicate the end of the string.&q
407.
▲
by
_kst_
8y ago
Speaking as someone who happens to have a full beard, I find your use of the slur "neckbeard" insulting. Find another way to say whatever you meant.
408.
▲
by
_kst_
8y ago
People can make assumptions based on names and profile photos.
409.
▲
by
_kst_
9y ago
I presume "247 bytes" is supposed to be "2^47 bytes".
410.
▲
by
_kst_
9y ago
Or "bacterium + flagellum + circumflex".
411.
▲
by
_kst_
9y ago
We had a Tera MTA (serial #2, IIRC) at SDSC when I worked there. It looked really cool, but I never got to use it. Tera bought Cray Research in 2000 and renamed itself to Cray, Inc.
412.
▲
by
_kst_
9y ago
As I mentioned in my comment on the article, setting $TMOUT if you want a timeout on a 'read' command is unnecessary and unclear. Just use "read -t": read -t 5 foo || foo='No reply' Setting $TMOUT affe
413.
▲
by
_kst_
9y ago
If you want 30 rather than 15 bits of randomness: echo $(((RANDOM << 15) + RANDOM))
414.
▲
by
_kst_
9y ago
Use "%zu" to print a value of type size_t. A couple of ugly corner cases: const char str[] = "abcd\0efgh"; printf("length = %zu, size = %zu, value = \"%s\"\n", strlen(str), sizeof
415.
▲
by
_kst_
9y ago
I'd make the limit a lot more than 10 lines. I certainly prefer Perl for large scripts (Python is good too but I happen to know Perl better), but I often have to write scripts for targets that have bash but don't have Perl or Pyth
416.
▲
by
_kst_
9y ago
"Blocking a world leader from Twitter or removing their controversial Tweets, would hide important information people should be able to see and debate." I actually agree with this. "We review Tweets by leaders within the poli
417.
▲
by
_kst_
9y ago
It took me way too long to figure out that the article isn't about literal whale watching. I was expecting something about a small number of customers spending large amounts of money to go on whale-watching cruises.
418.
▲
by
_kst_
9y ago
Yes, it is, but I also initially assumed that this was a successor to SQLite3. No, it didn't take long to correct that misunderstanding, but it would be nice if the title were clearer.
419.
▲
by
_kst_
9y ago
The CSV version (with one field per line) is identical to the plain text version.
420.
▲
by
_kst_
9y ago
One simple requirement is that a README file should include, near the top, a brief summary of what the project is. I've seen too many README files that leave that out. Knowing what changed in the latest point release doesn't help
More ›