Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
tylerhou
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
25 ms
·
301.
▲
by
tylerhou
5y ago
I think it's an exaggeration to say that design flaws in JavaScript are "horrible" and that they have caused billions of hours of work. Of course there are warts in the language (e.g. everything gets cast to a string) but sim
302.
▲
by
tylerhou
5y ago
There is another reason: a group of Republican lobbyists (Americans for Tax Reform) deliberately want to make taxes more difficult. The idea is that 1) if taxes are difficult, you will spend as much as your time trying to get every deductio
303.
▲
by
tylerhou
5y ago
Referential transparency, as the original post says. For example, in a functional language you're always allowed to transform a = f() b = f() c = g(a, b) into a = f() c = g(a, a) because f() is guaranteed not to hav
304.
▲
by
tylerhou
5y ago
A situation where if two people cooperate, they both benefit, but if they don’t, they each benefit less? These types of situations happen all the time. Think of two businesses collaborating on a project, for example.
305.
▲
by
tylerhou
5y ago
As someone who lives near downtown Berkeley, there are plenty of people walking around and gathering during the day; particularly at the square area near Shattuck and Center. On University you see people lined up outside Berkeley Social Clu
306.
▲
by
tylerhou
5y ago
I saw your comments above as well. I'm not 100% convinced that this is better; I actually like the three "edge cases" because I find that code/proof of correctness easier to understand. In your code, I have to break the
307.
▲
by
tylerhou
5y ago
A previous version of the post used true/false, but I think color is easier to understand after revision (e.g. "left always points to an element corresponding to true" -> "left always points to a green element").
308.
▲
by
tylerhou
5y ago
Yeah, zero is probably not the best thing to return if left == right; same with an all red interval. Wasn't thinking carefully enough when generalizing it, but I will fix.
309.
▲
by
tylerhou
5y ago
It's Python, so there is no overflow. I considered mentioning this in a footnote but I didn't think it was necessary.
310.
▲
by
tylerhou
5y ago
Also, no integer overflow in Python, so no bug here.
311.
▲
by
tylerhou
5y ago
I think you're right that I don't do the "normal" implementation quite enough justice; I've been meaning to write a third followup binary search post to "redeem" it. As others have mentioned, you can prove
312.
▲
Binary search with confidence
(blog.tylerhou.io)
94 points
by
tylerhou
5y ago
|
76 comments
313.
▲
by
tylerhou
5y ago
DPV — textbook used by UC Berkeley for CS170 (Efficient Algorithms & Intractable Problems). It is the most succinct and understandable book about algorithms I have read, especially if you follow along with lectures. https://c
314.
▲
by
tylerhou
5y ago
Higher interest rates reduce the money supply and generally slow inflation. So if you don't like inflation, you should support higher interest rates.
315.
▲
by
tylerhou
5y ago
Let's suppose that your software currently has an incident where the service is degraded. For every day you don't push a fix, you lose 0.X% of revenue. Some engineer creates a fix by turning off some recently added experiment resp
316.
▲
by
tylerhou
5y ago
Knowing long-term effects (1+ years) is not a precondition of approval for most vaccines. It just so happens that vaccines usually take a long time for approval, so we end up knowing long-term effects as a side effect. This is because there
317.
▲
by
tylerhou
5y ago
Technically, if their notes can't be represented by a DAG, they also can't be represented by a tree either.
318.
▲
by
tylerhou
5y ago
Not worth the hassle of paying legally-required income tax?
319.
▲
by
tylerhou
5y ago
Seems like it; I don't work on WebKit, you could submit a patch.
320.
▲
by
tylerhou
5y ago
The file was probably https://github.com/WebKit/WebKit/blob/main/Source/WebCore/pa...
321.
▲
by
tylerhou
5y ago
> most COVID hospitalizations are vaccinated. Do you have a source for this? The math doesn’t add up (vaccinated are 10-15x less likely to be hospitalized, and around 60% of US is vaccinated, implies around 6/46 hospitalized people
322.
▲
by
tylerhou
5y ago
No incentive might be hyperbolic, but this is an HN comment. I meant less incentive. https://rufuspollock.com/papers/optimal_copyright_term.pdf
323.
▲
by
tylerhou
5y ago
I don't know about this. Without protection from copiers, there is no incentive for anyone to create a new mechanism or invention. It's true that patents can slow the growth of an invention after it is created, but you haven'
324.
▲
by
tylerhou
5y ago
> because labor gets allocated to the most economically beneficial sectors naturally through fluctuations in wages. In a perfect market economy, yes. In an imperfect economy, where the value of each teacher is hard to measure, and where
325.
▲
by
tylerhou
5y ago
These are probably admissions for high schoolers.
326.
▲
by
tylerhou
5y ago
It's impossible to tell whether a specific line of code makes a copy without knowing the types of all values. i.e. std::vector<int> numbers = Func(); may or may not make a copy depending on the signature of Func. So it&#
327.
▲
by
tylerhou
5y ago
I disagree that C++ makes expensive operations explicit; see the copy constructor and the copy assignment operators. C, maybe.
328.
▲
by
tylerhou
5y ago
Yes, you could. But normally when people analyze the runtime of matrix multiplication, they assume that the elements have constant size (hence constant runtime arithmetic) and the matrix size scales. But you could also write a runtime that
329.
▲
by
tylerhou
5y ago
No. Specifically, in this case we are multiplying exponentially large numbers meaning that they have linearly many bits with respect to the input, so you must account for the multiplication costs as they are not insignificant (e.g. O(n^1.59
330.
▲
by
tylerhou
5y ago
Technically not correct, because when you get to large numbers you have to take into account that multiplication of those numbers takes O(nlogn) at best. Fib grows exponentially, so fib(n) takes O(n) bits to write. Python uses Karatsuba’s,
More ›