Hacker Newsnew | past | comments | ask | show | jobs | submit | jrgv's commentslogin

The stale old enterprise code is not in public repositories.


> [...] how a typical store with a shopping cart works; do everything on the server side, and just display it to the client.

The same concerns apply for a typical shopping cart design. The price can change in between the time when you sent the price to the client, and the time when the user actually decides to buy.


Majority of times I've seen this being solved with shopping cart items being copied from the main product table by SKU with the current price.

There is a TTL on the shopping cart itself. However, that meant for a period of time you had a frozen cost per-line-item in a shopping cart.


Well, in case of the server-side shopping cart, the server would have enough state to know if the price has changed since an item was added to the shopping cart, so the client wouldn't necessarily need to participate in preventing this scenario. I'm sure in practice, the checkout confirmation process for modern e-commerce sites also takes extra precautions to ensure that it can only happen exactly once and that it fails if any details change during the process of checking out.


As you wrote in your article, the new category becomes "another thing that needs explaining", and Fastly doesn't explain it well.

I guess what's happening is that these companies spend a lot of time internally discussing and refining their product and their marketing, and then one day someone comes up with a term for that, and everyone agrees that that is a great way to express all that. But nobody outside the company knows what all that is, because they don't have the same background, so they're just like, what is an edge cloud?


The article explains how the site has been designed not to send passwords to the server. Of course, it's up to you to decide if you trust them to keep it that way.


what if your output is more than 2000 bytes?

The announcement says that "curl will inspect the beginning of each download", and I think that comparison just turns off the check after at least 2000 bytes have already been output (see a few lines below the change you quoted, where outs->bytes is incremented by the amount of bytes that were output).

what if your output is binary but doesn’t contain a byte 0?

I guess curl will incorrectly recognize the binary as text.

what if your output is a normal UTF-8 string but contains a byte 0?

I guess curl will incorrectly recognize the text as binary, and you can use `-o -` to override that and output to the terminal anyway.


> I guess curl will incorrectly recognize the binary as text.

This doesn't sound like a really good test.


Looking for a NUL byte is the standard test that is also widely used by other tools such as grep or diff.


Interesting, I'm going to try to implement that in my file parser.


The "15" is a link to a test case which shows the 15 commands. It's a contrived scenario in my opinion: it assumes that you want to merge a feature branch into the main branch while you're in the middle of working on some other, unrelated feature and have uncommited changes in your working directory.


Hardly a contrived scenario; I run into situations exactly like that at least once a week...


You could just make a new clean checkout in a different directory?


This is what I often do, however with larger repositories (where people have a bad habit of committing files that they probably shouldn't be, blowing out the size of the repo significantly), this can also be slow! But of course, this all comes down to your specific circumstances.

Mine were exacerbated by the fact that the bulk of the team didn't really understand git very well, and bouncing between features at a super rapid pace meant I could get into some slightly odd situations. Nothing a bit of git-fu can't fix normally, but can take a little bit of wrangling or forethought.


You could. I work with Firefox and that code base is huge so it's not a good idea to download 15+ gigs every time you don't know how to do something. Learning the tools is a more sustainable way to go.


Make an external worktree. No need to re-clone the whole repo, nor stashing/commiting your work, switching branch, doing the merge, etc (which you may know how to do, but is a pain if you often need to do so)

https://git-scm.com/docs/git-worktree


That's a neat command... it's also relatively new to git. I hadn't heard about it before... thanks!


Money that is put into an endowment fund effectively is a lifetime credit for anything.


Maybe they route all traffic through a VPN to Ecuador or something like that?

I doubt that GCHQ would be the reason for internet problems; even if they have "a van in the street", they'd have no incentive to impact the quality of the connection that they monitor.


Unless incompetence. Or malice.


> But if we take it to mean code point, then if the value is a surrogate… what should happen?

Surrogates are code points. The spec does not say what should happen if the surrogate is invalid (for example, if only the first surrogate of a surrogate pair is present), but neither does the JSON spec.

Java internally also represents non-BMP code points using surrogates. So, simply appending the surrogates to the string should yield a valid Java string if the surrogates in the input are valid.


I'd prefer to throw an exception in that else block:

    throw new AssertionError("Should never happen");


I just put a comment as an example. I typically log-and-throw.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: