Better HN
topnewbestaskshowjobs
Log inSign up

codeflo

9,664 karma · joined Jun 14, 2010 (16y ago) · 1,504 submissions

Submissions

comment 4y ago · link · parent

Codebases that do that are very rarely const correct, however.

(Personally, I don’t think typing unique_ptr<Foo> or unique_ptr<const Foo> is such a big deal. But then, I also consider having “using namespace std” the only somewhat sane way to use the STL.)

comment 4y ago · link · parent

First, programs are defined to be finite in length. Second, for a program to be said to compute a function, it must do so for all possible inputs.

That’s by definition, but there are good reasons why these definitions are useful: if we accept infinite or incomplete programs, everything would be considered computable.

Anyway, your program can only compute BB for a finite number of inputs (depending on how far you bother to expand the “else …” part).

comment 4y ago · link · parent

I’m not sure I buy that completely. If this were a neutral choice, why would a gene take the 50% chance of not having made it to the next generation? (Or in the case of many offspring, invest half its resources into a different copy of the gene?)

At least in mammals, killing the soma is on the surface such a massive waste of resources that I believe it must be either: (a) biologically implausible to keep an animal reproducing for a longer timespan or (b) caused by mechanisms that are counterweighted by massive reproductive benefits while the animal is young.

comment 4y ago · link · parent

That’s plausible, but there might be trade-offs involved. There’s a theory — not sure how serious it’s taken by experts — that at least some of the mechanisms involved in aging have other benefits. For example, the fact that telomeres limit the number of cell divisions might also be a defense against cancer. A mutation that increases lifespan at the cost of this mechanism could be a net negative, from an evolutionary point of view.

comment 4y ago · link · parent

Not sure if this is within the spirit of the question, but: The individual ADSL bands are only 4 kHz wide, so you could modulate 4 or 5 of them down into the audible range (20Hz - 20kHz) and back up again after the transmission through the acoustic coupler. In theory, ADSL should then pick those bands to transmit the data.

comment 4y ago · link · parent

That fact that this delivers 3.5 MBit/s really makes you wonder how many low speed connections out in the wild are literally broken cables that still have some amount of coupling somewhere.

comment 4y ago · link · parent

Hard disagree that most of these are metaphors in actual use. They’re more like mnemonics, arbitrary names for highly abstract concepts that are only incidentally borrowed from ordinary languages.

For example, I never think of a physical dictionary when using the data structure. Much less a heap or a tree (we even draw those with the root at the top!). And the stuff in the article about database queries being “supplications” is just ridiculous. It’s again an abstract idea. No idea of a the social relationship between humans ever enters the picture in any way, metaphoric or otherwise.

What’s hard about programming isn’t the names, it’s learning the concepts. At least in my opinion.

comment 5y ago · link · parent

We’re talking about the same thing I think: the context was pre-game preparation, where the teams of the contenders can (and according to every top GM commentary I’ve seen, extensively do) use engines to look for “off book” but good moves that pose some problems.

comment 5y ago · link · parent

I said "not just", not "not". It's a matter of degree. Picking a top three engine move instead of the top one, when it's only 0.01 worse, isn't a losing strategy. Even at this level, and especially if it takes a human opponent a lot of time to counter the move accurately. And from the analyses I've seen, that's precisely what seems to be happening in this world championship.

comment 5y ago · link · parent

I considered clarifying that, but it's a bit subtle.

First of all, neural networks are typically trained from (millions of) self-play games. So you have the "equally strong opponent" assumption right there in the weights of the network.

Second, when actually playing, the variations that are explored with high probability in MCTS are (recursively) informed by the same neural networks that are applied at the root. This means that there's no extra reward for moves that lead to complications in lines that only a "stupid human" would play.

In effect, neither alpha-beta search nor Monte-Carlo tree search have any concept of "tricking" a weaker opponent, admittedly for very different reasons and more probalistically in the MCTS case.

That's what I meant with "the implicit assumption that they play against the best response of an equally strong opponent" -- yes it's a simplification, but directionally true I think.

comment 5y ago · link · parent

I'm personally a bit more interested in computer chess, but find it very interesting how engines are used for preparation in human chess.

You might think that engines make opening preparation trivial: just play what the engine recommends. However, that misses a critical point. To simplify a bit, engines (whether neural network or classical engines) always play with the implicit assumption that they play against the best response of an equally strong opponent. But in human chess, the strategy is not just to make objectively good moves, but also to give your opponent a chance to make mistakes.

For example, Stockfish's search doesn't distinguish between a move where the opponent has an obvious answer, and a move where you need very deep calculation to find the correct response. Mathematically, both moves are equally good. Strong human players would, of course, always prefer the line that's more "difficult" to play for the opponent.

Therefore, in opening preparation, the goal is to find moves that are both:

* objectively "good enough" (that is, they don't immediately lose if the opponent happens to know or find a good answer)

* difficult/confusing enough for a world championship contender to give you at least the chance to gain an advantage

Finding such lines with engine help is to my understanding an important part of the work of seconds. Not only does that take a lot of time, you also need to be very good yourself to make realistic judgements about what a top player might or might not find over the board.

comment 5y ago · link · parent

Why wouldn’t those objects be loaded in a competitive multiplayer game?

comment 5y ago · link · parent

I don’t follow. Spawning objects (which the article talks about as part of the network code) is unrelated to (re-)spawning players as a gameplay feature (which is where griefing could be an issue), neither of them make hardware use “unbounded”, and both are completely orthogonal to using pools as an allocation technique.

comment 5y ago · link · parent

I just hand-derived it both ways to make a comparison, the standard way was from memory.

So. The standard way to complete the square uses a trick to rearrange the equation so that one can use the formula (a+b)^2 = a^2 + 2ab + b^2.

This uses a different trick to rearrange the equation to make use of (a+b)(a-b) = a^2 - b^2.

Frankly, I don’t see how this is any easier. If anything, I think it’s harder to do from memory because you need to introduce a new variable in a very specific way to make the simplification work. The standard way feels a lot more systematic.

comment 5y ago · link · parent

Is infrastructure at this scale typically unable to do a cold start? I can believe that this is very difficult to design for, but being unable to do it sounds dangerous to me.

(Edit for the downvoters: I was genuinely curious how these kinds of things work at Google’s scale. Asking stupid questions is sometimes necessary for learning.)

comment 5y ago · link · parent

I agree, and the article doesn’t really explain a difference, either. Two quotes:

> Campbell’s law states that the more important a metric is in social decision making, the more likely it is to be manipulated.

> Goodhart’s Law, states that “When a measure becomes a target, it ceases to be a good measure”.

These are basically paraphrases if you accept that “target” = “important in decision making”, and “likely to be manipulated” = “not a good measure”.

That’s fine, important discoveries are often made multiple times independently, but let’s not pretend there’s some important difference where there isn’t any.

comment 5y ago · link · parent

The “theatrical backdrops for complex ceremonies relating to status and prestige“ is a bit oversimplified I think, at least for continental Europe. In German, for example, we have two words that translate to “castle”: “das Schloss” is a representational building, but “die Burg” describes a military fortress, which often were small, plain, very well fortified buildings with multiple clever layers of defense. There’s no confusion between the two even though many Schlösser had Burg-like features for decoration. It’s perhaps also not a surprise that the article’s examples for representational castles are mostly from England, I think Britain’s military history is a bit different from that of the rest of Europe.

comment 5y ago · link · parent

> essentially free to the home user

There’s a world of difference between “free” and “priced in”. And anyone who builds their own PCs would disagree with this anyway.

comment 5y ago · link · parent

While this is nice, I don’t like the idea that lecture times should vary depending on the century I find myself in. Clearly, we need to take the average, which is 52 minutes and 35.6952 seconds if I calculated correctly.

comment 5y ago · link · parent

Thanks, that helps. When I notice errors in the stuff I already know about, it find it hard to trust the other information that’s new to me.

comment 5y ago · link · parent

The writing is cute and the animations are nice, but none of it makes any sense. I stopped reading at

> It is important to remember that bivectors have a certain redundancy built into them in the sense that s a ⃗ ∧ b ⃗ = a ⃗ ∧ s b ⃗ s a ∧ b = a ∧s b . We can write them using 6 numbers or 3 numbers, but they actually convey 5 degrees of freedom.

Three (real) numbers have three degrees of freedom, by definition. (And nothing about complex numbers was mentioned.) Is this a parody I don’t get? I feel like I have wasted ten minutes on nonsense.

comment 5y ago · link · parent

Debian is my preferred distribution for servers, I'm simply in awe of what the community has achieved. Most of the good features that people associate with Ubuntu are actually in Debian, with none of the proprietary weirdness that creeps into Ubuntu year over year.

The project does, however, sometimes have its share of people who dogmatic/pedantic to the point where it really doesn't help the cause. This might be expected from something that's a passion project for many of its contributors, and to Debian's credit, they've always been able to resolve these conflicts eventually.

The article mentions the systemd drama. The recent kerfuffle around the 'which' command might be a smaller example of this kind of thing: https://news.ycombinator.com/item?id=29026623 And note: As silly as that discussion was, when it got widespread attention, it was actually already resolved.

comment 5y ago · link · parent

I think the bad writing in D3 is a weird consequence of WoW's success. Either because they hoped to attract part of WoW's audience, or for the simple fact that a lot of Blizzard's staff at the time had also worked on WoW and were more familiar with that style, both Starcraft II and Diablo III suffered from a cartoony art direction and a story that didn't take itself very seriously compared to their predecessors.

In Diablo II, Diablo greets you with "Not even death can save you from me", one of the most iconic lines in all of gaming, creepy and to the point.

In Diablo III, Diablo holds an entire monologue explaining the boss mechanics, something like, "Now you're trapped in my realm, you can only escape by defeating the shadows, but none have ever managed to do that har har har". You can't get emotionally invested in a world with writing like that.

comment 5y ago · link · parent

I remember reading a Perl 6 design document back in the day that made a convincing argument that operator precedence should be a partial instead of a total order. The language was supposed to have user defined operators. The idea was that you would make some declarations that your new operator would bind e.g. "between * and +", or "tighter than *". The system would build up a minimal partial order that satisfied these constraints.

One of nice things about such a system is its compositionality: If you mix and match custom operators from different modules, you wouldn't get a conflict or a random precedence order, instead, you'd simply be forced to disambiguate using parentheses.

Contrast this with Haskell, which also has custom operators, but only a fixed number of precedence slots (10 IIRC), and some libraries really suffer from the fact that there's no "good one" available that works for the intended usage.

comment 5y ago · link · parent

I don’t see how those problems are related.

Finally replacing those dozen terrible USB port variants with a single good design is great, and solves problem (3). You’d finally only need one type of cable.

Routing all kinds of other protocols through that same port creates problem (2), and introduces a completely new kind of cable fragmentation. I think that’s orthogonal.

comment 5y ago · link · parent

Everything about which people tell you to “not invent your own” must be invented by someone.

comment 5y ago · link · parent

This sort of bug only happens when running a multithreaded program (with shared memory) on a multicore processor.

You do need both for the problem to happen: Without shared memory, there’s nothing to exploit. And with a single core only, you get time-sliced multithreading, which orders all operations.

My point is, that combination was a lot rarer in ARM land before people started doing serious server or desktop computing with those chips.

comment 5y ago · link · parent

OTOH, 11 is the first version of Windows where Microsoft actively tells a large portion of their userbase that they don’t want them to run it. I’m not a believer in “the year of the Linux desktop” either, but those insane policies around fictitious hardware requirements surely must have some impact on market share?

comment 5y ago · link · parent

Ah, I get your question now, I thought you were talking about const functions. Well, const values in Rust are funny things, they're not linked into the executable, they don't have an address or a lifetime. That confused me too for a while. They're purely a shortcut for a value expression, not that different from a #define in C.

Statics, in contrast, have a storage location and a static lifetime.

Compare:

  const CONST_STRING: String = String::new();
  static STATIC_STRING: String = String::new();

  fn main() {
      let x: String = CONST_STRING;  // fine
      let y: String = STATIC_STRING; // error: cannot move out of static item
  }
1
333435
51