Better HN
topnewbestaskshowjobs
Log inSign up

codebje

1,356 karma · joined Jun 19, 2017 (9y ago) · 591 submissions

Submissions

comment 1y ago · link · parent

Callbacks with closures are continuations with bad syntax. Admittedly one could call those horrifying without being accused widely of hyperbole, so it’s not a great counter to your point.

comment 1y ago · link · parent

It wouldn't be an online service's T&C document if it didn't include at least one vague, threatening, unworkable, and unenforceable condition.

The useless but true answer is nobody knows what's allowed and what isn't, until it's tested in court. Practically (not being a lawyer, though) I suspect that the clause will never be pursued on its own, because it's bullshit and everyone involved knows it is so.

In your scenario, though, assuming you publish in a way that's not overtly and primarily meant for AI training, I think the "use" of data isn't yours and would be hard to argue as violating the terms of the agreement.

Of course we might take it to the absurd end of this line of reasoning and demand that any code base that Copilot was involved in should have a license term preventing the training of any other AI in it, and we wind up in a place where all AIs are trained on source material they're explicitly licensed not to be trained on, or trained only on a mostly static set of "pre-AI" publications.

Daft stuff.

comment 1y ago · link · parent

I got as far as having the cash to pay for the door before running out of time jumping through hoops to transfer it.

It’s horrifying. The only not-unpleasant thing, though, is that once you start making money it’s absurdly easy to make a massive sum. I was expecting something horrible to happen to my balance at some point but it never did. Maybe that’s a bug!

comment 1y ago · link · parent

That’s a great project, there seems to be a small but persistent market for well crafted retro systems.

comment 2y ago · link · parent

Yeah, that one appeals to me more than the morrow example. The difference between that and the Haskell, other than any particular choices I made about use of operators instead of more explicit bindings, is really just syntactic decoration around functions and such.

comment 2y ago · link · parent

    data Color = Color
        { r :: Word8
        , b :: Word8
        , c :: Word8
        } deriving Show

    hex_primary :: Parser Word8
    hex_primary = toWord8 <$> sat isHexDigit <*> sat isHexDigit
        where toWord8 a b = read ['0', 'x', a, b]

    hex_color :: Parser Color
    hex_color = do
        _ <- char '#'
        Color <$> hex_primary <*> hex_primary <*> hex_primary
Sure, it works in Rust, but it's a pretty far cry from being as simple or legible - there's a lot of extra boilerplate in the Rust.

comment 2y ago · link · parent

No-one likes playing with a cheat in Uno, either, and the table stakes for Uno are pretty low.

comment 2y ago · link · parent

Keeping cheating to a low enough level that players don't quit in frustration (or never start playing due to bad press) is critical. Eliminating it entirely is not.

Valve added vote kicks to CS to help keep cheating (and other antisocial behaviours) under control - it seems pretty important to them.

comment 2y ago · link · parent

Remember that you don't need perfection: you need people to believe that they're likely enough to get caught that they don't want to use a pre-canned cheat, and you need just enough cheat detection mechanisms to make it hard for people to make new cheats. Not all of that has to be technological: you can spread rumours that your cheater ban waves are bigger than they actually are, for example, and that'll keep more people from even trying in the first place.

You don't have to trust the timestamp - and you shouldn't. You can use a bunch of methods to go from untrusted to grudgingly accepted: requiring monotonicity means cheating clients have to be permanently slower rather than selectively slower. Having tolerances for out of order packet rates or accepted deltas before discarding player actions will have some false positives for players on terrible networks, but will also reduce the impact of any possible timestamp-related cheats.

It can't be fully solved server side, not without sacrificing acceptable performance. I reckon it can probably be dealt with enough on server side to keep cheating to a tolerably low level. It's probably cheaper to just license a windows rootkit though.

comment 2y ago · link · parent

The LoL game development studio probably rates their game being a commercial success as a significantly critical thing.

comment 2y ago · link · parent

False positives would very much hurt in that model. But returning to a small multiplayer experience with chosen friends would work: the in/out decision is local and personal.

It’s only a problem when you game with strangers.

comment 2y ago · link · parent

Rampant cheating will wreck competitive multiplayer games fast, so there are perspectives from which this critical.

(I’d still lean towards expecting game houses to find another way, kernel drivers are still client side trust mechanisms).

comment 2y ago · link · parent

CGNAT is very common in broadband ISPs, to the point that you’re more likely to be sharing an IP with other users than not unless you’re specifically paying more for a dedicated IP.

comment 2y ago · link · parent

Path length is dependent on where you stand and look at it all, of course.

If anyone knows of a place in which a border router is only one (or 1.1 average) hop away from every other network on the planet, please let me know what real estate prices are like there, though.

(I suspect the 1.1 figure measures something quite different - the average path length inside a CDN or similar, which probably should be closer to one but might involve sneaky things like an overlay network).

comment 2y ago · link · parent

> The purported performance hit wouldn't be from the propagation delay on any given router, but rather from shifts in traffic resulting in a longer path.

You are right, I neglected to point out that origin validation is (in the absence of shenanigans) not going to cause one path to be preferable to another: if the origin is the same AS, either both paths or neither is valid.

If the origin in two paths is two different ASes, either both are valid or shenanigans are afoot - perhaps there's a hijack being prevented, perhaps the network operator has screwed up their ROAs, perhaps the network operator is measuring sBGP uptake, perhaps the network operator is doing a rather bizarre and ineffectual form of traffic ingress management, or perhaps the network is in a transition from one AS to another, but those are all "shenanigans" in which routing efficiency is secondary to some other goal.

An alternative source for average BGP path length is https://blog.apnic.net/2024/01/10/bgp-in-2023-bgp-updates/ - where many other similar statistics can be found, and independently repeatable methodology is available. The average BGP path length for IPv4 is around 5.5 hops, and for IPv6 it is just shy of 5 hops. These numbers have been stable for a while with IPv4 slowly shrinking and IPv6 slowly growing, albeit in both cases by around 0.2 hops a decade.

And perhaps also relevant to the parent's question: path length itself is a pretty poor indicator of network performance by just about any measure you can name (excepting perhaps the TTL field), and is a last resort measure used only when all else is equal. The case of a prefix hijack being thwarted by origin validation is an extreme example in which the shorter (invalid) path represents 100% packet loss and the longer (valid) path given preference due to origin validation is infinitely more performant.

edit: oh, disclaimer - I am a co-author of one of the RPKI RFCs, and while I am personally not involved in secure BGP at present my employer definitely is. Opinions presented are mine.

comment 2y ago · link · parent

> But what impacts does this have on performance? Great we solved hijacking issue. But this other ASN which used to be a preferred route doesn’t use ROA/ROV (yet or refuses).

No performance impact: a routing table is a very (ahaha) binary thing, it takes a destination address and does a longest prefix match search in a table to find the next hop interface, to which it routes the packet.

Route validity is considered (alongside a bunch of other routing policy inputs) when constructing the table, not when a packet arrives.

comment 2y ago · link · parent

This is in general only true for either trivial toy compilers or ones which have gone to lengths to have reproducible builds. GCC for instance uses a randomised branch prediction model in some circumstances.

comment 2y ago · link · parent

Guaranteed the time spent doing that is considered work.

comment 2y ago · link · parent

Crowdsourced data is not individually reliable and is already accounting for invalid and incorrect submissions. We can have our cake and eat it too.

The ‘us vs them’ mindset comes from ‘then’ determining what is acceptable for ‘us’ to do purely because it’s good for ‘them’.

If I want to set my location to somewhere I am not, and the only reason I can’t is corporate interests, then a battleground has been drawn up by those interests, not me.

comment 2y ago · link · parent

You can separate all of those examples into one of two categories: one in which the owner of the phone has a vested interest in providing accurate location and an easy means to enforce consequences for undesired behaviour (I want my ride to find me, I want emergency services to help me, I want to find a bike near me), and another in which a company hopes to use someone else's information for free for their own benefit: delivery companies with a "bring your own phone" policy, or crowdsourcing companies hoovering up free data to build their value.

Since I paid for my phone, I really don't see why it's incumbent on me to help the latter case out. A delivery company is free to supply a managed device or fit a device to their trucks. A crowdsourcing company should in any case already be assuming all client data is suspect and ensuring it's properly correlated with other sources of information.

There's no fraud here. The worst case outcome in your list is perhaps a delivery agent just having their phone say they've done a particular route when they just sat in the movie theatre or whatever, but the fact that none of their packages got delivered is enough to out them even if the shipping company is trying to get location data for free from a device the shipping company doesn't even own.

If I hire a bike I'm nowhere near I still pay for it. Denial of service attacks in which the perpetrator is fully responsible for the cost of resources consumed just aren't a thing that happens.

The only group involved in these scenarios that's taking adverse action against another party for their own gain is the entitled companies demanding users' phones be locked down so they can continue to get material gain from them without compensation. The net benefit here is that these companies' profits should definitely be taking a back seat to users' rights.

comment 2y ago · link · parent

The fact that with transformer stacks you can wind up with state changes being discarded on exception if you get the stack arranged in a particular order isn't what I'd call a _feature_ of transformer stacks :-)

If effect A is invoked before effect B, effect A should happen and stay that way: if I update state before an exception is thrown, the update should persist. If I send a network message before an exception is thrown, the network message is still sent. If I launch the nukes before an exception is thrown, the missiles are still flying.

If I want to batch up state updates to only happen together as a unit, I'll use a transaction effect.

comment 2y ago · link · parent

Yes, but transformers have a few drawbacks: the order of stacking alters behaviour, and you need to write n^2 instances for n transformers.

Compare ExceptT e (StateT m a) and StateT (ExceptT e m a): if you just want your computation to have state and exceptions the difference shouldn’t matter.

comment 2y ago · link · parent

Schematics don't scale well at all - net labels and multiple sheets demonstrate this.

HDLs rule for gate and transistor level circuit design. I don't know what major PCB houses do but I'd be horrified to discover that 16-layer boards still have a visually built schematic producing their netlist: just finding the right pad on 256BGA components would be awful, let alone finding what else is connected to that net.

comment 2y ago · link · parent

The function gives the same result regardless of the sign of the two components, so there's axes of symmetry around the lines defined by (x ± xi): in the first image that gives four axes on the horizontal, vertical, and diagonal lines through the origin. The two zoomed images are along the diagonal extending up to the top left and so there's diagonal symmetry visible.

I think that would probably count as it revealing symmetry in the underlying object rather than in the lens, it's not a consequence of rounding or asymptotes or floating point errors or any such.

comment 2y ago · link · parent

> The only thing i dont like about rp2040 is the package, not hobbyist home soldering friendly for custom board designs.

- Use home SMT reflow solutions like toaster ovens or hot sand in frying pans; or

- As the other reply suggested, use 'breakout boards' to turn the RP2040 into a through hole part; or

- Use SMT assembly services, which are getting cheaper all the time

It's not just a problem with the rp2040 - loads of modern parts have very fine pitches and/or hidden pads, gotta find a way to work with them or stick to aging out, larger parts and miss out on things like PIO.

comment 2y ago · link · parent

Each wants to claim a keyboard and a mouse, but due to new pair programming requirements set by management there is one fewer set of peripherals than there are developers.

comment 2y ago · link · parent

Either software development teams are a wonderful metaphor for multithreaded code, or multithreaded code is a wonderful metaphor for software development teams. I'm not sure which.

comment 2y ago · link · parent

Maybe - often more to do with overeager coercion, which does tend to go hand in hand with loose typing.

comment 2y ago · link · parent

It's the other way around: null needs to be a subtype of MyType, not a supertype: anywhere I can pass a MyType I should be able to pass a null.

You could get most of the way to the blog post's outcomes by simply adding a few methods to Object (is(Not)Null, primarily) and having null be a magic (because it's all classes and none) instance that will NPE on all but the few defined Object methods, I think, but none of that answers the burning question of _why_ that I feel the article doesn't really address.

comment 2y ago · link · parent

I might choose to rephrase that as "the problem is, some of these languages think that "" and null are equal." :-)
1
91011
20