Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Peaker
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
48 ms
·
451.
▲
by
Peaker
13y ago
Removing from any location is O(1), as is adding to any location you have a link to. With a real linked list at least, not with std::list.
452.
▲
by
Peaker
13y ago
As is often the case, writing the code from scratch in Haskell is easier than reusing a library in Java.. Android uses named integers rather than enums, due to some issue with Java enums.. And the switch would only help a bit, the main prob
453.
▲
by
Peaker
13y ago
I gave an example: a request that is in multiple linked lists. e.g one by chronological order for quick timing out of oldest requests, and one of active requests waiting on the physical wire. Now the timeout elapsed, so you have a pointer t
454.
▲
by
Peaker
13y ago
std::list can be used in 2 ways: * With an std::list::iterator in each of your data nodes that represents its own position in the list (this is called the "intrusive style") * Without an std::list::iterator in each of your data no
455.
▲
by
Peaker
13y ago
After using Haskell, using Java makes me very sad... In Java's OO paradigm, instance variables are inherently defined separately from their initialization, making it quite difficult to make sure they're always used when initialize
456.
▲
by
Peaker
13y ago
In C, you can use a bit of macro trickery to get the same safety, e.g: by defining a 0-sized array of the some type alongside the intrusive node. Then, macros that do the "cast down" from the intrusive node to the container elemen
457.
▲
by
Peaker
13y ago
That answer is attributing the badness to linked lists, whereas it is fully std::list's. Linked lists are very useful, but it's hard to see that when their canonical (and almost only) implementation is std::list, which is indeed
458.
▲
by
Peaker
13y ago
The rest of the data structures in the STL follow the same (anti-)pattern. They all either take ownership of your data, or point at your data unidirectionally. This means that given a pointer to your data you cannot, for example, delete it
459.
▲
by
Peaker
13y ago
If you really think that, you've missed CS 101. Or maybe std::list is the only linked list implementation you've seen. In that case, I agree, one should never use std::list. Linux's list.h is extremely useful, and for a wid
460.
▲
by
Peaker
13y ago
You can have generalized containers in C, using the intrusive pattern. For example, Linux's list.h has an intrusive list that is far better than the abysmal std::list from the STL.
461.
▲
by
Peaker
13y ago
Sounds like Rob Pike doesn't understand type theory.
462.
▲
by
Peaker
13y ago
> Bitcoin has already failed as a currency. It is subject to incredible moodiness and instability, which are the characteristics of a very poor currency indeed Bitcoin has to climb up to a stable value, once. The idea is that it will be
463.
▲
by
Peaker
13y ago
As http://christianengstrom.wordpress.com/2011/03/09/an-alterna... explains, patents and current pharma corporations are an extremely inefficient middleman, and the exclusion of poor people from live saving m
464.
▲
by
Peaker
13y ago
Copies are inherently cheap. So cheap, that everyone on Earth could have one. We have artificial scarcity of copies . Many people could derive huge benefits (in the case of patented medicines, life!) if we hadn't artificially made t
465.
▲
by
Peaker
13y ago
And nobody is now allowed to create any derivative work to benefit society for the next ~200 years (or perpetually, if Disney has their way). Ironic, since virtually all of Disney's works are based on public domain works that they them
466.
▲
by
Peaker
13y ago
That is more a statement about iTunes than about Disney.
467.
▲
by
Peaker
13y ago
It's a restriction put upon all of society, that creates artificial poverty and scarcity. Property rights have a net positive effect, increasing the value property yields. Copyrights decrease the value these works yield to society.
468.
▲
by
Peaker
13y ago
They are not pure code. They come with a protein coat and a bunch of proteins/enzymes to bring the code to the cell or nucleus, and sometimes more functions.
469.
▲
by
Peaker
13y ago
I'm pretty sure you didn't mean what you wrote! But maybe I'm whooshing?
470.
▲
by
Peaker
13y ago
Even if it is only the way things are perceived, and not the actual truth - it can still explain the decay of the community.
471.
▲
by
Peaker
13y ago
What if everything is video-recorded clearly with a modern smartphone?
472.
▲
by
Peaker
13y ago
That's not what the report claims at all. It claims that they may have wanted Stuxnet to be exposed, for boasting/deterrence. It also claims that they likely lost access to the internal network, and needed more virus-like behavi
473.
▲
by
Peaker
13y ago
Sure, you'll hit an underlying platform bug, once in a few years, whether in the RTS or the OS.. But you'll prevent orders of magnitude more bugs that would waste your time debugging in the best case, or hit production in a slight
474.
▲
by
Peaker
13y ago
Undefined behavior has advantages, of course. The C language is excellent at certain things, too. However, not every kernel driver and not every application needs the benefit of C or undefined behavior. The fact that Haskell's RTS is w
475.
▲
by
Peaker
13y ago
With rich types, you can get rid of the correct bugs, too. You can encode an arbitrary amount of information into a verified, proven specification. The specification is orders of magnitude smaller and simpler than the actual code, so much e
476.
▲
by
Peaker
13y ago
*nix commands are optimized for minimizing keystrokes, too. Would you like to type out 2-3x more characters per command?
477.
▲
by
Peaker
13y ago
One of the main uses of valgrind is to discover undefined behavior. Haskell doesn't have undefined behavior, so you don't need it. I don't think the C tooling is that great. Haskell has some neat tooling of its own.
478.
▲
by
Peaker
13y ago
I said parametric polymorphism. That doesn't involve any method resolution order.
479.
▲
by
Peaker
13y ago
> This is especially obvious in the stock market. If I think a stock is a sell at $X and you think it's a buy, we trade, but clearly one person knows (or thinks they know) something that the other doesn't Or maybe they just nee
480.
▲
by
Peaker
13y ago
Is parametric polymorphism leaky?
More ›