Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
garethrees
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
10 ms
·
31.
▲
by
garethrees
9y ago
The author of beep needs to read the POSIX specification on async-signal-safety [1]. In particular, it is not safe to call exit, free, ioctl, putchar, or perror from a signal handler. [1] http://pubs.opengroup.org/onlinepubs
32.
▲
by
garethrees
9y ago
Very nice! Reminiscent of Michael Gondry, on what must be a minuscule fraction of the budget. Compare with Gondry's "Come Into My World": https://www.youtube.com/watch?v=63vqob-MljQ
33.
▲
by
garethrees
9y ago
This is right: finalizers are difficult to combine with garbage collection for several reasons. As you say, there's no guarantee that the garbage collector will find the finalizable object in a timely manner. Additionally, if it's
34.
▲
by
garethrees
9y ago
I'm a trackball fan, but trackballs and mice have different properties that make them suitable for different tasks. Mice are better than trackballs at fine motion and precise movement. Trying to get pixel-perfect movement (say, in a dr
35.
▲
by
garethrees
9y ago
The case for reducing the size of SVG is the same as for any kind of web asset: it reduces the initial transmission time (and improves the likelihood of a cache hit) and so reduces the time taken to load the page. I doubt if it's worth
36.
▲
by
garethrees
9y ago
It's worth knowing that NTP's round-trip delay compensation is not at all magic — it works like this (see RFC 5905, section 8): 1. Client records "origin" timestamp T1 when its sends a query to the server. 2. Server reco
37.
▲
by
garethrees
9y ago
In Sweden, as in most of the EU, electric bicycles are required by law to reduce the assistance as the speed increases and to cut out entirely above 25 km/h. So an electric bike wouldn't be much help to a courier, who would mostly
38.
▲
by
garethrees
10y ago
Unless it's a physical limitation of the motor, "moves slowly" is still risky, because a programming error could cause the robot to move unexpectedly quickly in an unexpected direction! But "motor too weak to cause injur
39.
▲
by
garethrees
10y ago
The design of the system requires the player to put their hand in the robot arm's work envelope in order to make a move, so in order to follow your advice one would have to avoid playing the game, which seems a shame.
40.
▲
by
garethrees
10y ago
Can you comment on the safety aspects of the design? It seems possible that the robot arm could collide with the arm of the human player, or that an unlucky player's finger could get caught in the robot's elbow joint as it closes.
41.
▲
by
garethrees
10y ago
(Slightly off topic, but maybe still interesting.) I used to write binary searches like yours, with two tests per iteration: while lo < hi: mid = (lo + hi) // 2 if a[mid] == x: return mid
42.
▲
by
garethrees
10y ago
I see — your experience suggests that rules inevitably get turned into thoughtlessly evaluated metrics that then get gamed. It is a shame when that happens, but when it does, it's not the fault of the rules, it's the fault of the
43.
▲
by
garethrees
10y ago
Obviously a recommendation to have a high assertion density does not mean "shotgun-spraying assertions in the code". If your point is just that the rule could be applied mechanically and without thinking and that would be bad, the
44.
▲
by
garethrees
10y ago
It looks to me as though the recommendation that RankRed has titled "Rule No. 5 — Low Assertion Density" would be better described as "High Assertion Density" — the recommendation is for a minimum of two assertions per
45.
▲
by
garethrees
10y ago
It follows that the axle count had better not be greater than 256 either, otherwise if the train splits then the front portion could decrement the axle count for the section down to zero, while leaving the rear portion in the section for
46.
▲
by
garethrees
10y ago
You're not addressing the point about shared data. How do I program my Celery tasks to operate safely on shared data? Well, I need a system that is responsible for maintaining the shared data, and I have to program my tasks to send it
47.
▲
by
garethrees
10y ago
Thinking about where the computation is bound is only one half of the space of use cases: you also have to consider the shared/non-shared axis. There's a 2x2 matrix of task types: non-shared shared c
48.
▲
by
garethrees
10y ago
The article makes claims that are way too broad: "fixed Python's GIL problem", "obsoletes GIL and coroutines". Maybe the claims are reasonable when addressing the author's particular use case, but they are not
49.
▲
by
garethrees
10y ago
The concern about missing necessary constraints seems reasonable, but then how does the current budgeting process avoid the same concern? Perhaps it does so by changing in small steps, so that each period's budget is similar enough to
50.
▲
by
garethrees
10y ago
I understand your concern. Perhaps if I give an example, it will be clear why I followed the approach I did. The project is an industrial control system. Different kinds of item are processed by the system. Each kind of item needs image acq
51.
▲
by
garethrees
10y ago
It makes sense to store serialized data structures in the database when these conditions apply: 1. There are no use cases that would require you to SELECT on the fields in the serialized data structures. 2. You anticipate that the data stru
52.
▲
by
garethrees
10y ago
France is above average in this respect — electricity accounts for about 25% of energy consumption.
53.
▲
by
garethrees
10y ago
This is an encouraging story but the headline is very misleading. It would be more accurate to say, "Portugal's ELECTRICITY GENERATION runs for four days straight on renewable energy alone." In Portugal (as in most Western Eu
54.
▲
by
garethrees
10y ago
Such a password has about 157 bits of entropy, which is far too big to be found by any kind of brute-force approach. Of course there are other ways that a password can be cracked, for example an attacker who breaks into the server can captu
55.
▲
by
garethrees
10y ago
"wrowd": a portmanteau for "wrong crowd". "Take care, you don't want to hang out with the wrowd". "aut": a logarithmic unit of measurement indicating the level of automation of a process. "I
56.
▲
by
garethrees
10y ago
Yes, that's right. 3SAT uses conjunctive normal form.
57.
▲
by
garethrees
10y ago
Yes, that's right. The paper doesn't explain in detail how the gadgets are assembled. But presumably the track is arranged so that from the starting point the car must enter the variable gadget for X1. The "true" branch
58.
▲
by
garethrees
10y ago
The proof is not quite complete — the paper says, "given a path in the track we can check in polynomial time whether it completes the track." But this is only true if the path has length that's polynomial in the length of the
59.
▲
by
garethrees
11y ago
I do exactly this in my own code, for one-sided bounds like "if (0 <= x)" as well as for two-sided bounds like "if (0 <= i && i < length)". But when collaborating with other programmers, I follow the maj
60.
▲
by
garethrees
11y ago
In the spirit of "reading philosophy backwards" [1]: Peirce is spot-on about "force"—in the 138 years since this essay, there has been no progress on the question of "what is force?", but huge progress on the q
More ›