News for hackers. Stuff that matters.

mc10

Re:Every UUID Dot Com on Friday December 06, 2024 @09:22PM (#42346740)
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.
uv is a great drop-in replacement for pip: https://astral.sh/blog/uv
Re:Go east from Seattle on Monday June 03, 2024 @06:35PM (#40568428)
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"?

Re:Go east from Seattle on Monday June 03, 2024 @06:32PM (#40568401)
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".

Re:Go east from Seattle on Monday June 03, 2024 @06:26PM (#40568354)
The Substack version says "Go east from Seattle": https://finmoorhouse.substack.com/p/go-east-from-seattle
Re:Why, after 6 years, I'm over GraphQL on Thursday May 30, 2024 @04:51PM (#40528574)
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.

Re:API Shouldn't Redirect HTTP to HTTPS on Tuesday May 28, 2024 @08:34PM (#40507022)
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.
Re:Branded Types for TypeScript on Wednesday May 15, 2024 @04:02PM (#40371655)
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.

Re:Branded Types for TypeScript on Wednesday May 15, 2024 @03:52PM (#40371570)
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
Re:XDP for game programmers on Saturday April 06, 2024 @09:34PM (#39957366)
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
Re:Training great LLMs from ground zero on Thursday March 07, 2024 @09:43PM (#39637254)
simdjson can parse JSON files at ~2.5-3GB/s: https://github.com/simdjson/simdjson
Re:GGUF, the Long Way Around on Friday March 01, 2024 @02:23PM (#39565707)
It would be cool to also discuss how llamafiles[1] work, and how they differ from the GGUF files.

[1]: https://github.com/Mozilla-Ocho/llamafile

Re:Confusing Git Terminology on Thursday November 02, 2023 @02:17PM (#38117813)
In this section:

> I think in the context of the merge commit ours/theirs discussion earlier, HEAD^ is “ours” and HEAD^^ is “theirs”.

Should HEAD^^ be HEAD^2 instead?

I wish there was some way to evolve the DMARC spec such that only DKIM and not SPF is used for validation. Sadly things like Google Calendar invites still fail DKIM…
Re:The Frustration Loop on Saturday September 23, 2023 @01:15PM (#37625232)
Yeah I guess it depends on how sophisticated the "hiddenness" of the field is. Instead of straight up using the hidden property (which is easier for a bot to detect), you could try other things, like moving the input field offscreen and using overflow: hidden, or styling it such that it's the same color as the background and is unfillable. Now though you'll need to worrying about tabbing through fields (change tabindex to -1) and screen readers that might pick up the fields.
Re:Apple TV, now with more Tailscale on Saturday September 23, 2023 @03:24AM (#37621316)
Tailscale recently announced an integration with Mullvad [1] that is probably what you're looking for: Mullvad's VPN servers act as Tailscale exit nodes, and they have servers in countries around the world. This lets any of your existing Tailscale nodes route traffic through Mullvad.

[1]: https://tailscale.com/blog/mullvad-integration/

The default relay can be found in constants.go [1]:

  // DEFAULT_RELAY is the default relay used (can be set using --relay)
  var (
   DEFAULT_RELAY      = "croc.schollz.com"
   DEFAULT_RELAY6     = "croc6.schollz.com"
   DEFAULT_PORT       = "9009"
   DEFAULT_PASSPHRASE = "pass123"
   INTERNAL_DNS       = false
  )

[1]: https://github.com/schollz/croc/blob/f91c7a9948f94007d6be2b0...
Does this run a mini IPFS node on the sender and relayer and rely instead on the IPFS network being up to propagate the DHT changes through the network?
This looks very different; it requires having a server to temporarily store the file, while croc and magic-wormhole directly connect two peers (via a relayer) to send the file.
magic-wormhole (which croc was inspired by) also uses a public relay server: https://magic-wormhole.readthedocs.io/en/latest/welcome.html...

Any tool that wants to reliably connect two clients P2P is going to need something like a TURN server to traverse restrictive NATs. See for instance Tailscale's use of DERP servers: https://tailscale.com/blog/how-tailscale-works/#encrypted-tc...

Re:The Frustration Loop on Friday September 22, 2023 @10:55PM (#37620240)
Maybe I'm thinking specifically of 1Password which can store your previously-filled out form fields as well as autofill fields like address or credit card number.
Re:The Frustration Loop on Friday September 22, 2023 @10:28PM (#37620110)
I've heard this concept described as a "honeypot field" before and it works pretty well as you've said. I'm curious how password managers/autofill avoid tripping up though; are they able to detect that the field is not visible?
This comment (and the subsequent follow-up reply) violates the HN comment guidelines:

- Be kind. Don't be snarky. Converse curiously; don't cross-examine. Edit out swipes.

- When disagreeing, please reply to the argument instead of calling names. "That is idiotic; 1 + 1 is 2, not 3" can be shortened to "1 + 1 is 2, not 3."

Re:Functional Programming Library for Golang by IBM on Friday August 18, 2023 @02:38AM (#37172047)

  data := F.Pipe3(
   T.MakeTuple2("https://jsonplaceholder.typicode.com/posts/1", "https://catfact.ninja/fact"),
   T.Map2(H.MakeGetRequest, H.MakeGetRequest),
   R.TraverseTuple2(
    readSinglePost,
    readSingleCatFact,
   ),
   R.ChainFirstIOK(IO.Logf[T.Tuple2[PostItem, CatFact]]("Log Result: %v")),
  )
This looks like a pain to modify if you're not intimately familiar with the fp-go library and are just trying to insert a debug statement. Also, the passing two values in parallel via a chain of functions seems really brittle.
On iOS the YouTube website only supports video resolutions up to 720p.
Re:TypeScript 5.0 on Thursday March 16, 2023 @02:15PM (#35185952)
Until WASM can touch the DOM you’re still going to need JS (and hence, TS).
In your Battery settings, do you have “Wake for network access” set to “Only on Power Adapter” or “Never”? If it’s on “Always”, your laptop could just be getting woken up frequently.
Re:OCaml 5.0.0 release (including multicore and effects) on Friday December 16, 2022 @09:07PM (#34023567)
Probably not, given that their public sample code[1] has C++, Go, and Python.

[1]: https://github.com/ftexchange/ftx

SAP has a market cap of $135B, not a trillion dollar business but in the top 100 largest companies in the world.

Older »