Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
moefh
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
22 ms
·
211.
▲
by
moefh
7y ago
> These annotations do not appear to be essential to understanding the law At least 3 judges disagree with this (quoted from the article): > “The annotations clearly have authoritative weight in explicating and establishing the meanin
212.
▲
by
moefh
8y ago
That's really nice. I did something very similar a few years ago: https://github.com/moefh/stereogram/ My version shows a simpler scene (a single tumbling cube) and also works with random-dot rendering, but a
213.
▲
by
moefh
8y ago
Java Unicode escapes are kind of a mess, and the raw string literals proposal only makes it worse. Unicode escapes are processed in Java not just inside string literals, but everywhere in the source code. So, for example, the following pr
214.
▲
by
moefh
8y ago
I'm not familiar with that site, I don't see any way of passing arguments to the compiler. To reproduce you have to compile with "-fsanitize=undefined", as in: gcc -fsanitize=undefined -o test test.c ./tes
215.
▲
by
moefh
8y ago
Interestingly (and pedantically), the code from the otherwise excellent "Byte order fallacy" article technically contains undefined behavior in C on machines where int is 32 bits wide (which is almost everything nowadays). Conside
216.
▲
by
moefh
8y ago
Elliptic curve crypto (the kind that is in common use, like ECDH) is just as broken by quantum computers as RSA. The quantum algorithm that breaks RSA (Shor's algorithm) does it by efficiently solving the hidden subgroup problem[1] for
217.
▲
by
moefh
8y ago
No, it only uses an int if the value is less than 0xffffffff, otherwise it uses a double. That means it's ok up to 2^53 milliseconds, at which point it starts losing precision (you can't represent every integer above 2^53 as a dou
218.
▲
by
moefh
8y ago
The bug happened for setInterval() with any timeout (the bug report is for one with 500 milliseconds). The problem is that the function that returned the current time was overflowing a 32-bit integer, so interval calculations were messed up
219.
▲
by
moefh
8y ago
Twitter's count of "characters" is code points after normalization[1]. I don't know who expects emoji to count as one character, but they'd be surprised by Twitter's behavior: something like [2] counts as 4 ch
220.
▲
by
moefh
8y ago
Another thing that could be fixed: the table in page 9 says long is 32 bits (with a footnote saying that depends on the compiler, the value shown is for gcc and g++). That's only true when compiling for x86 (32 bits). When targeting x8
221.
▲
by
moefh
8y ago
That's still only relative to an oracle, though (i.e., BQP^O vs NP^O). We also have oracle separations of P and NP, and that proves nothing about P vs NP without an oracle.
222.
▲
by
moefh
8y ago
> Its suspected P lies entirely within BQP. It's actually known that BQP contains P[1]. It also contains BPP. What's not known is the relationship between BQP and NP (most experts suspect there's no containment in either
223.
▲
by
moefh
8y ago
> special means without accelerated reference frames That's something a lot of people say, but it's not strictly true. Special Relativity is fully capable of describing acceleration in a flat (Minkowski) spacetime[1]. General R
224.
▲
by
moefh
8y ago
Assuming OP was talking about overloading the '=' operator: struct A { int *p = nullptr; A& operator=(int i) { *p = i; return *this; } }; int main(void) { A a; a = 1; /* boom
225.
▲
by
moefh
8y ago
Signed overflow will still be undefined behavior even after the planned change (making signed integers 2's complement). This is explicitly mentioned in the page linked in that tweet: > Status-quo If a signed operation would naturall
226.
▲
by
moefh
8y ago
Nah, it's a valid optimization as long as ereport() returns. The compiler doesn't need to follow the order of operations as long as the observed behavior is the same as if the operations were performed in the order in the code. Si
227.
▲
by
moefh
8y ago
I don't disagree, but I feel "code that checks the value of the divisor prior to a division can be removed by a compiler" needs clarification: it's not as insane as it sounds. The example given in the referenced paper[
228.
▲
by
moefh
9y ago
> implies that even if the timestamp certificate AND signing certificates are revoked on a date following the purported timestamp, then the signature is still trusted. That's not how I read it. The "lifecycle table" doesn&
229.
▲
by
moefh
9y ago
> solving systems of linear equations have been mathematically proven to have a quantum speedup I'm not an expert, so please correct me if I'm wrong, but my understanding from Aaronson's paper is that this is not really tr
230.
▲
by
moefh
9y ago
> Even if you had a gigabyte of text in an #if 0, that's only about 2 more seconds on the compile Are you sure your implementation is correct? How does it handle this: #if 0 "\ #endif \ " #endif I&
231.
▲
by
moefh
9y ago
> will only block if you request more data then is available in the buffer Sadly, that's not true on Linux. According to the man page[1]: > Under Linux, select() may report a socket file descriptor as "ready for reading"
232.
▲
by
moefh
9y ago
From a quick look at the source[1], it seems the compiler will always generate an executable with the text from the paper (which is read from the "paper/" directory, and some bits hard-coded in the compiler source). Or someth
233.
▲
by
moefh
9y ago
The argument is that whether people choose to use mutable when it's not necessary has nothing to do with being harder to type. In Scala, using mutable is not harder and people still do the right thing.
234.
▲
by
moefh
9y ago
This is nonsense. If typeof(x) is 'boolean', then x is either true or false. Now, if you don't know the type of x and try to use it as boolean without being careful, it might look like it has four values. That comes partly fr
235.
▲
by
moefh
9y ago
Yes, a common way to store the text in editors is a gap buffer[1]. It allows efficient text insertion/deletion in one point and doesn't have too much overhead. [1] https://en.wikipedia.org/wiki/Gap_buffer
236.
▲
by
moefh
9y ago
That's sad. Both gcc and clang at -O3 can optimize it++ to ++it (see [1]). Hopefully MSVC will improve soon. [1] https://godbolt.org/g/pxzVdP
237.
▲
by
moefh
9y ago
The problem happens if you do uint64_t = uint8_t << 24, for example. The shift will promote the uint8_t to int (not unsigned int), and then the conversion to uint64_t will sign extend, so uint8_t u8 = 255; uint64_t u64 = u8 &l
238.
▲
by
moefh
9y ago
An ugly thing about using negative digits with base ten (or any even base) is that you either have ambiguity on how to write numbers, or you have a different number of positive and negative digits. For example, if you do base ten with digit
239.
▲
by
moefh
9y ago
Compilers will do the "wrong" thing. For example, gcc optimizes out the "x >= 0" check in for (int x = 0; x >= 0; x++) making it an infinite loop, because it assumes "x++" can't overflow.
240.
▲
by
moefh
9y ago
> If there were, then a TM could follow that algorithm to construct its own Godel sentence. I don't understand what's the problem here. TMs are allowed to be inconsistent. There's a TM that outputs every single finite stri
More ›