Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
_kst_
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
51 ms
·
571.
▲
by
_kst_
11y ago
Sure, but then you have to make sure that you always maintain the extra nulls. diff(1) doesn't seem relevant; it operates on text files, which normally don't contain any null characters.
572.
▲
by
_kst_
11y ago
> What do people get out of pedantic rants such as this? Anyone who's written anything in C is quite aware of the issue here. Unfortunately, that's not the case. I presume this link was posted here as a result of my recent comm
573.
▲
by
_kst_
11y ago
(I'm the author of the linked blog post.) strcpy() can be used safely if you ensure that the destination array is big enough to contain the source string. (Yes, that can be non-trivial.) strncpy() by itself doesn't write past th
574.
▲
by
_kst_
11y ago
strcpy_s is not universally available.
575.
▲
by
_kst_
11y ago
strncpy, when used as designed, can leave the target array without a terminating null character. Using that array later with any string function causes undefined behavior. strcpy, when used as designed, always leaves the target array proper
576.
▲
by
_kst_
11y ago
Part 3: "Wait a tic... Where's the Makefile? I've got just about as much chance of finding it as the FBI does of finding Jimmy Hoffa. Am I just supposed to imagine it into existence?" I think the point is that the make c
577.
▲
by
_kst_
11y ago
Slide 31 says: Actually, this is how arrays are handled in C. A C array is a set of consecutive memory addresses. The first value is pointed to by a pointer. int a[] = {1, 2, 3}; // create an array /&#x
578.
▲
by
_kst_
11y ago
A minor point: I found the references to "Ada 1.0", "Ada 2.0", "Ada 3.0", and "Ada 4.0" distracting. I worked with Ada for a long time, and I've never heard of those terms. The successive languag
579.
▲
by
_kst_
11y ago
2036-02-07 06:28:16 UTC is 2^32 seconds after 1900-01-01 00:00:00 UTC. Some systems represent time using a 32-bit unsigned integer counting seconds since 1900.
580.
▲
by
_kst_
11y ago
The page says "The ebook (in PDF) is currently available at part of a promotion by Embarcadero Technologies.", but I don't see a link to a PDF file.
581.
▲
by
_kst_
11y ago
"... and turn left where the big tree used to be."
582.
▲
by
_kst_
11y ago
It wasn't exactly a deliberate choice. The number system we use was imported to Europe from Arabia. In Arabic, the number 1234 is written with the most significant digit on the left -- but Arabic is written right-to-left, so it's
583.
▲
by
_kst_
12y ago
"Computer Science is no more about computers than astronomy is about telescopes." -- Edsger W. Dijkstra (origin disputed)
584.
▲
by
_kst_
12y ago
Yes, but how much of the information actually shows up in the GEDCOM file?
585.
▲
by
_kst_
12y ago
Strictly speaking, yes, it is, at least in the abstract machine. If a unary "&" is applied directly to the result of a unary " " operator, then neither is evaluated. But in this case, the "&" is being a
586.
▲
by
_kst_
12y ago
Before the first ANSI standard, we had the C Reference Manual in the back of K&R1. The definition was merely less rigorous (and that lack of rigor often led to complex nests of "#ifdef"s). If a compiler generated code that eva
587.
▲
by
_kst_
12y ago
That suggestion is pretty vague; the only way a compiler could violate it is by not documenting its behavior. The behavior itself can still be completely arbitrary.
588.
▲
by
_kst_
12y ago
The standard offsetof macro is sometimes defined as: #define offsetof(st, m) ((size_t)(&((st *)0)->m)) That expression has undefined behavior, since it dereferences a null pointer. That doesn't mean it's an invalid
589.
▲
by
_kst_
12y ago
Casting a constant zero to a pointer type yields a null pointer. The conversion is done at compile time, so the compiler knows that a null pointer is the required result. There is no requirement for an integer-to-pointer conversion to ret
590.
▲
by
_kst_
12y ago
This story was first published in 1956. As far as I know, it's still under copyright (I don't know whether the copyright is owned by Asimov's estate, by the publisher, or by someone else).
591.
▲
by
_kst_
12y ago
Do you mean C++? (It's a pet peeve of mine. The language is called "C++". "cpp" is commonly used as the suffix for C++ source file names, but the name "cpp" also refers to the C preprocessor.)
592.
▲
by
_kst_
12y ago
Do you see anything that depends on which edition of the C standard is being used? I don't.
593.
▲
by
_kst_
12y ago
I've seen 64-bit ints (on Cray systems). One disadvantage of making int 64 bits, even if that's the natural size, is that if char is 8 bits, then short has to be either 16 or 32 bits (or 64) -- which means that you can't have
594.
▲
by
_kst_
12y ago
5. size_t doesn't necessarily have to be the width of an address. An address (say, a value of type void* or char ) has to be able to refer to any byte of any object. A size_t only has to be able to represent the size of any single* ob
595.
▲
by
_kst_
12y ago
You should receive a notification whenever someone else edits one of your posts. If the edit is inappropriate, you can revert it or re-edit it. "Edit wars" do happens sometimes, but they're discouraged, and you can always fla
596.
▲
by
_kst_
12y ago
I'm pretty sure uranium is tightly controlled too.
597.
▲
by
_kst_
12y ago
In spite of the name "ThorCon", there's no mention of thorium on the front page. http://thorconpower.com/features/clean says: > And ThorCon obtains about 25% of its power from easily mined thorium whi
598.
▲
by
_kst_
12y ago
That's often configurable. For example, in xterm: > -cc characterclassrange:value[,...] > This sets classes indicated by the given ranges for using in selecting by words. See the section specifying character classes. and discu
599.
▲
by
_kst_
12y ago
Hmm? Ada uses the apostrophe for character literals and to introduce attributes. Strings are arrays; indexing uses the same `array[index]` syntax as any other array. S: constant String := "Hello"; H: constant Character :
600.
▲
by
_kst_
12y ago
Interestingly, when I did a "git commit" with a different commit message than the one they provided, a following "git log" showed their canned message, not the one I used. (Not surprisingly, they're not really givin
More ›