Readit News logoReadit News
mc10 commented on Every V4 UUID   everyuuid.com/... · Posted by u/LorenDB
mc10 · a year ago
Would love it if the scrollbar was draggable on iOS! I thought it was broken until I realized you can click on a spot to scroll to.
mc10 commented on Ask HN: Machine learning engineers, what do you do at work?    · Posted by u/Gooblebrai
davedx · 2 years ago
pip install pytorch

Environment broken

Spend 4 hours fixing python environment

pip install Pillow

Something something incorrect cpu architecture for your Macbook

Spend another 4 hours reinstalling everything from scratch after nuking every single mention of python

pip install … oh time to go home!

mc10 · 2 years ago
uv is a great drop-in replacement for pip: https://astral.sh/blog/uv
mc10 commented on Go east from Seattle   finmoorhouse.com/writing/... · Posted by u/simonebrunozzi
cush · 2 years ago
Travel exactly due East. Now, ignore what East means. Then, ignore the giant white arrow pointing East into Montana in the image we've created to illustrate this question. Also, don't worry about anything called a Great Circle, it's completely unimportant. What country would you first encounter?

Did you get it, idiot? No? Let me explain to you why you're wrong.

First, you completely missed that the Great Circle I told you not to worry about doesn't actually follow along the white arrow I used to illustrate the problem. Clearly, if you completely ignore all the information that was given to you, and what East is, the answer is obviously Australia. Because if you were at the North Pole, a line going East would be a tight circle.

Please like and subscribe. To leave a comment, first you must solve this simple math problem

    6 ÷ 2(1+2) = ?

mc10 · 2 years ago
The instructions state the following:

> Imagine you begin a journey in Seattle WA, facing exactly due east. Then start traveling forward, in a straight line along the Earth’s surface.

Where does it say to "travel exactly due East"?

mc10 commented on Go east from Seattle   finmoorhouse.com/writing/... · Posted by u/simonebrunozzi
bialpio · 2 years ago
It's not a bias for 2d projection. If someone tells me to "go east in a straight line", I think about how practically I'd go about it. In this case, I'd take a compass, point myself to go east, and keep adjusting my bearing so that I keep facing east. Bonjour, France.
mc10 · 2 years ago
Perhaps the HN headline doesn't match the article, but the instructions say:

> Imagine you begin a journey in Seattle WA, facing exactly due east. Then start traveling forward, in a straight line along the Earth’s surface.

where there isn't any wording saying "go east in a straight line".

mc10 commented on Go east from Seattle   finmoorhouse.com/writing/... · Posted by u/simonebrunozzi
brokencode · 2 years ago
Did they change the title of the blog post? When I open it, it says “A path from Seattle”. The “Go east” part is only in the Hacker News post.
mc10 · 2 years ago
The Substack version says "Go east from Seattle": https://finmoorhouse.substack.com/p/go-east-from-seattle
mc10 commented on After 6 years, I'm over GraphQL   bessey.dev/blog/2024/05/2... · Posted by u/mattbessey
int_19h · 2 years ago
IMO the fact that being a full-stack dev is so taxing is an indication that the stack as a whole is just way too complex and overengineered. Which is rather obvious from looking at the state of affairs on the frontend side of things. Desktop GUI devs don't usually have those problems.
mc10 · 2 years ago
I don’t think this is a fair conclusion; web development is harder than desktop GUI development for various reasons.

For one, clients (mobile, desktop) are drastically different with all sorts of downstream implications:

- Differing screen size requiring responsive design

- Internet speeds magnitudes different

- Intermittent internet

- Uneven feature support due to different versions of browsers

- Everything needs to be JS at the end of the day

Desktop apps generally don’t have to worry about any of these issues.

Also, desktop GUI frameworks are typically either fragmented (one per OS) or don’t look OS-native.

kji commented on API Shouldn't Redirect HTTP to HTTPS   jviide.iki.fi/http-redire... · Posted by u/oherrala
alberth · 2 years ago
Doesn’t returning a 403 on HTTP break HSTS?

https://security.stackexchange.com/questions/122441/should-h...

Doesn’t HSTS require only responding to a user via HTTPS (even for error codes).

kji · 2 years ago
HSTS is intended for browsers. For API clients the correct behavior (following curl's lead) is probably to never follow/make any redirects by default.
mc10 commented on Branded types for TypeScript   carlos-menezes.com/post/b... · Posted by u/carlos-menezes
stiiv · 2 years ago
Sure! You need a `type` field (or something like it) in TS.

You don't need that in a language like F# -- the discrimation occurs strictly in virtue of your union definition. That's what I meant by "native support."

mc10 · 2 years ago
Aren't these two forms isomorphic:

    type MyUnion = { type: "foo"; foo: string } | { type: "bar"; bar: string };
vs

    type MyUnion = Foo of { foo: string } | Bar of { bar: string };
You still need some runtime encoding of which branch of the union your data is; otherwise, your code could not pick a branch at runtime.

There's a slight overhead to the TypeScript version (which uses strings instead of an int to represent the branch) but it allows discriminated unions to work without having to introduce them as a new data type into JavaScript. And if you really wanted to, you could use a literal int as the `type` field instead.

mc10 commented on Branded types for TypeScript   carlos-menezes.com/post/b... · Posted by u/carlos-menezes
exceptione · 2 years ago
It is a form of strong typing because integer could be the length of your toe nail, a temperature or the seconds since the unix epoch.

Sometimes you really want to make sure someone is not going to introduce billion dollar bugs, by making the type different from the underlying representation. In Haskell that would be sth like

     newtype Temperature = Int

At other times, you just want to document in stead of forcing semantics. A contrived example:

    type AgeMin = Int
    type AgeMax = Int

    isAdmissible :: AgeMin -> AgeMax -> Bool   
    isAdmissible :: Int -> Int -> Bool          // less clear

mc10 · 2 years ago
The AgeMin/AgeMax example seems more of a deficiency due to a lack of named function parameters; it would be equally clear if it had a type signature (using OCaml as an example) of

    val is_admissible : min_age:int -> max_age:int -> bool

mc10 commented on XDP for game programmers   mas-bandwidth.com/xdp-for... · Posted by u/gafferongames
Galanwe · 2 years ago
If you want to use kernel bypass on the server, not the client, then XDP is even more useless. Because on the server world, you have access to professional NICs that you cannot expect clients to have.

It's been decades now that people routinely do kernel bypass on servers using e. g. Solarflare NICs with OnLoad. You just write your networking code normally using BSD sockets API, and LD_PRELOAD the OnLoad SDK which will intercept the socket API and perform a bypass. You get 90% of the latency benefits of kernel bypass without modifying your code, which still runs everywhere.

mc10 · 2 years ago
Both Katran[1] by Facebook and Unimog[2] by Cloudflare are L4 load balancers written using XDP. It's factually incorrect to claim that XDP is useless on servers as many companies intentionally choose to design their systems around commodity hardware.

  [1]: https://engineering.fb.com/2018/05/22/open-source/open-sourcing-katran-a-scalable-network-load-balancer/
  [2]: https://blog.cloudflare.com/unimog-cloudflares-edge-load-balancer

u/mc10

KarmaCake day138December 3, 2016View Original