Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
palotasb
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
11 ms
·
61.
▲
by
palotasb
8y ago
Forget the spiral rule. That's putting an if-statement into a buggy algorithm instead of using the correct algorithm. The simplest correct algorithm is to 1. From the identifier, go right one by one in the current parenthesis level an
62.
▲
by
palotasb
8y ago
A good exercise is to then guess why the spiral rule seems to work most of the time even though it is inherently wrong. The reason is that some types that are syntactically valid are forbidden by C/C++. You cannot have a function retur
63.
▲
by
palotasb
8y ago
The spiral rule is wrong. It breaks for things as simple as arrays of arrays. // +---------+ // | +--+ | // | ^ | | int /*|*/ aa[2][3]; /
64.
▲
by
palotasb
8y ago
In every way? One could argue that having a GC is a disadvantage compared to Rust regardless of how good a GC it is. Main reason for that is because it might still introduce unnecessary runtime overhead.
65.
▲
by
palotasb
8y ago
I'd guess because VLA on the heap already existed and it's called malloc. The only difference would be free() being called automatically but that is not something the C standard would do lightly.
66.
▲
by
palotasb
8y ago
IIUC the heuristic here is how much of the system to take down (i.e., back out of fast path [this case] < kill thread < kill process < kernel panic) and this seems correct (but could still be a symptom of more corruption). Anyway,
67.
▲
by
palotasb
8y ago
The point is that the binary encoding is the same for ROR and MOV, and only the disassembly of the binary is special cased: if it has a shift, it's disassembled into the ROR text with the shift otherwise it is displayed as a MOV. RRX i
68.
▲
by
palotasb
8y ago
They are supposed to be keywords like return or throw . Those cannot be namespaced either.
69.
▲
by
palotasb
8y ago
There is a similar debate about making wearing bicycle helmets mandatory. [1] One problem is basically that with cyclists wearing helmets, they and drivers around them might think that smaller safety margins are necessary. (Both physically
70.
▲
by
palotasb
8y ago
Can it still be solved if I generalize the question like this? * Same setup: two prisoners A and B overlooking two distinct gardens with a constant nonnegative integer number of statues each. * The guard asks A and B each day if there
71.
▲
by
palotasb
8y ago
I don't think too much knowledge can be a problem, only applying the wrong algorithm to that data. I think the thing you're missing is that you can independently reduce the set of numbers of statues possibly seen by the other guy
72.
▲
by
palotasb
8y ago
I think that's a great question, but I would guess the answer is no, there are no other solutions. One important axiom for this type of puzzle is that everyone does deduce every piece of information that they can mathematically deduce
73.
▲
by
palotasb
8y ago
Guessing wrong gets you locked up forever.
74.
▲
by
palotasb
8y ago
I don't think the idea of free software and banning specific uses is compatible. OSI also says that they require no such discrimination: https://opensource.org/osd (points 5, 6)
75.
▲
by
palotasb
8y ago
What I implied by "programmers are human" as exactly that they are 1x and make mistakes. The tools help in the situations where "100%" assumptions cannot be made. But you can't put a seat belt on everything and co
76.
▲
by
palotasb
8y ago
That's a good analogy except that with traffic, you have factors outside your control that can cause a crash. Avoiding bugs in code is theoretically completely within the programmers control. There are various tools that help with this
77.
▲
by
palotasb
8y ago
What is your definition of valid ? It's not valid by any C standard or common compiler implementation. For the sake of any argument, we should at least agree on a common definition for valid. As for deleting null checks, time-travelli
78.
▲
by
palotasb
8y ago
Isn't the reference compiler with trivial compilation equivalent to trying to make all UB implementation-defined where the implementation is the "trivial compilation"? For example this would preclude optimization based on ali
79.
▲
by
palotasb
8y ago
I guess you're focused on languages that don't have the following two constraints from C: (1) be as fast as possible (2) compile ahead-of-time. The "weird" behavior in case of UB in C/C++ is a direct result of these
80.
▲
by
palotasb
8y ago
One way to solve this is to at least treat dragging near the center of the screen as a simple rotation around the axis perpendicular to mouse motion. When dragging the mouse by the side of the screen (up-down near the side or left-right nea
81.
▲
by
palotasb
8y ago
Don't a lot of OS images start by importing a non-transparent prebuilt tarball containing nontrivial binaries? I would hide the malware inside those.
82.
▲
by
palotasb
8y ago
That's different. The rust toolchain is compiled by rust, and it relies on LLVM which can be compiled by GCC. But LLVM does not have a backend for every architecture (or even if it does, it might require extra effort from the Rust comp
83.
▲
by
palotasb
8y ago
I think you are getting down votes because you are answering 'why electron?' instead of the 'why base it on Canvas?' the GP meant. (The release notes say this version switched to Canvas rendering from DOM.) I would like
84.
▲
by
palotasb
9y ago
I guess that's the template text for releases and they forgot to remove it.
85.
▲
by
palotasb
9y ago
I uploaded the contents of the c++grammar2.0.tar.Z file to https://github.com/palotasb/c-grammar2.0.tar.Z
86.
▲
by
palotasb
9y ago
> who apart from utter novices would ever want to use a UI where the keyboard shortcuts are non-obvious How are keyboard shortcuts worse than in old Office? I still have the common shortcuts and everything is accessible vie accessible Al
87.
▲
by
palotasb
9y ago
Except that there is a lot of magic [1] and it does cause bugs. For example the implicit `%: %.o` rule has to be cancelled if you have a rule like `$(SPECIFIC_OBJ_FILES): %.c.o: %.c` [1]: https://www.gnu.org/software/ma
88.
▲
by
palotasb
9y ago
I was under the impression that they generally license the IP cores (or at least some IP blocks) to implement the ISA and downstream vendors don't implement those differently.
89.
▲
by
palotasb
9y ago
That's an orthogonal feature, it writes output after each line as opposed to every 4096 bytes, when the output is a pipe instead of a terminal. Useful when the other end of the pipe still goes to the terminal and you want to see it imm
90.
▲
by
palotasb
9y ago
According to the table here [1] it is a DSB (data synch barrier) instruction. I don't know if it corresponds to any of the listed valid option values in [2]. [1] http://kitoslab-eng.blogspot.nl/2012/10/armv8
More ›