Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
_kst_
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
18 ms
·
181.
▲
by
_kst_
5y ago
At a previous job, we used a bug tracking tool called "Remedy". On September 8, 2001, it started reporting dates incorrectly; its idea of the current date jumped back to 1973 and started advancing at 1/10 the normal rate. It
182.
▲
by
_kst_
5y ago
I'm typing this now with my left hand on my main keyboard and my right hand on my laptop keyboard, which is about two feet away and at an angle. It's surprising how natural it feels to type this way. I don't have any particul
183.
▲
by
_kst_
5y ago
"Oh yes, smoking is very bad and only very bad people do it and they will die and you will live forever if you don't smoke. Is it a happy story now? Please don't accuse me of "thinking" anything I didn't say.&q
184.
▲
by
_kst_
5y ago
No, that appears to be a myth. https://www.nature.com/articles/s41533-021-00223-1 > To date, there is no strong evidence (i.e., evidence based on causal research) that smokers are protected against SARS-CoV-2 infect
185.
▲
by
_kst_
5y ago
I don't see a reference to "idx_t" anywhere in the latest draft of the C++ standard.
186.
▲
by
_kst_
5y ago
I often cite section 6. It's the best explanation I've found of the (often confusing and counterintuitive) relationship between arrays and pointers in C. If you think arrays are really pointers, you need to read section 6 of the F
187.
▲
by
_kst_
5y ago
The core language says that the result of sizeof is size_t, defined in <stddef.h> (and other headers). size_t is a typedef (alias) for an implementation-defined unsigned integer type. It could have been worded differently with the sam
188.
▲
by
_kst_
5y ago
Scope and lifetime are two different things, but they're related in the case of automatic (local) variables. Scope is the region of program text in which an identifier is visible. Lifetime is the duration during program execution i
189.
▲
by
_kst_
5y ago
I suggest that the title on HN should include the subtitle: "Bad News, Selling the story of disinformation".
190.
▲
by
_kst_
5y ago
I've seen this kind of things in articles posted to social media sites (Quora and Facebook, but it probably exists elsewhere). I don't have a specific example at hand, but it's typically an article a few paragraphs long with
191.
▲
by
_kst_
5y ago
The initial commit was 2 hours ago as I type this. The author is probably planning to expand it.
192.
▲
by
_kst_
5y ago
Yes, in my dialect of American English (raised in Southern California by parents from the midwest), "cot" and "caught" are pronounced almost identically.
193.
▲
by
_kst_
5y ago
And it's not just parameter passing. It can apply to anything that acts like an assignment. That includes assignment (of course), parameter passing, and returning a value from a function.
194.
▲
by
_kst_
5y ago
A trick for remembering that 91 is composite is that it's of the form x² - y² (specifically 10² - 3²), so it's (x+y)(x-y) or 13 * 7.
195.
▲
by
_kst_
5y ago
According to one source: “Recently, I was asked if I was going to fire an employee who made a mistake that cost the company $600,000. No, I replied, I just spent $600,000 training him. Why would I want somebody to hire his experience?” – Th
196.
▲
by
_kst_
5y ago
The C standard requires main to be defined as a function, but failure to do so is not a constraint violation, so no diagnostic is required. If you define it as something else, the behavior is undefined. A conforming C compiler could reject
197.
▲
by
_kst_
5y ago
As the hint explains, it's a combination of PDP-11 and VAX machine code, set up so that either system will run its own code and ignore the foreign code. You can extract a few ASCII strings from the data. As the hint says: "Can you
198.
▲
by
_kst_
5y ago
One of the winners of the 1st International Obfuscated C Code Contest (1984) used this technique. https://www.ioccc.org/1984/mullender/mullender.c https://www.ioccc.org/1984/mullender/hin
199.
▲
by
_kst_
5y ago
The format for floating-point is specified by the IEEE floating-point standard (or whatever it's officially called these days). C permits but does not require IEEE format. Most implementations these days use it.
200.
▲
by
_kst_
5y ago
I've heard that when Marc Okrand invented the Klingon language, he deliberately omitted the verb "to be". So of course for Star Trek VI, they asked him to translate "To be or not to be". Chancellor Gorkon: You have
201.
▲
by
_kst_
5y ago
Or they assume "param + 16" will never overflow, so they emit an ADD instruction and use whatever result it yields. Saying that a compiler "assumes" anything is anthropomorphic. A compiler may behave (generate code) in a
202.
▲
by
_kst_
5y ago
If param is unsigned, then "param + 16" cannot overflow; rather, the value wraps around in a language-defined manner. I've been assuming that param is of type int (and I stated that assumption).
203.
▲
by
_kst_
5y ago
Of course an implementation can do anything it likes, including defining the behavior. That's one of the infinitely many ways of handling it -- precisely because it's undefined behavior . I'm not using "undefined behavi
204.
▲
by
_kst_
5y ago
No, the C standard doesn't say that "undefined behavior can be ignored" (which would mean what, making it defined?). It says, "NOTE Possible undefined behavior ranges from ignoring the situation completely with unpredict
205.
▲
by
_kst_
5y ago
And my point is that as far as the language is concerned, there is no guaranteed loop count under any circumstances. (An implementation is allowed, but not required, to define the behavior for that implementation.)
206.
▲
by
_kst_
5y ago
No, the standard permits the implementation to ignore the behavior "with unpredictable results". If the value of param is INT_MAX, the behavior of evaluating param + 16 is undefined. It doesn't become defined behavior because
207.
▲
by
_kst_
5y ago
Actually, that's exactly what it means: > If a "shall" or "shall not" requirement that appears outside of a constraint or runtime-constraint is violated, the behavior is undefined. Undefined behavior is otherwise
208.
▲
by
_kst_
5y ago
for (int i=param; i < param + 16; i++) does not have a guaranteed loop count with the current rules. The loop body will execute 16 times if param <= INT_MAX-16, but if the expression "param + 16" can overflow, the behavior i
209.
▲
by
_kst_
5y ago
The author suggests that the text following the definition of "undefined behavior", listing the permitted or possible range of undefined behavior, should be read to restrict the consequences. But the first possibility listed is &q
210.
▲
by
_kst_
5y ago
The URL linked from the title is http:// ... It should probably be https:// ...
More ›