we all know floating point numbers can be treacherous, but what are specific examples of when they've betrayed you?

so far I have:

* money calculations where you need to get the exact correct answer
* twitter's tweet IDs are bigger than 2^53 and can't be represented as a Javascript number, you have to use a string
* implementing numerical algorithms (like matrix multiplication) (I've never done this)

this floating point post had so many great replies that I had to write a custom Python program to download them all so that I could really read them properly

(well, you could argue that I didn't technically *have* to, but programmers gotta program)

downloading mastodon replies to a post is surprisingly hard, I ended up just downloading all my mentions and statuses and then writing a recursive CTE in SQL to get all of the replies to a given post.

There's a `/context` endpoint that returns replies to a status but it doesn't return all of them and it doesn't seem to support pagination.

@b0rk

I'm surprised by this. Each post has a replies collection that you can fetch. Fetching collections is slightly annoying (because they're usually paginated and paginated collections in ActivityPub work by each page providing the link to the next page), but is not too bad.

Is this more annoying than I realize or does that simply not work?

@robryk what's the specific api endpoint you're talking about? if it's `GET /api/v1/statuses/:id/context`, it didn't work for me (no pagination)

Follow

@b0rk It's not a Mastodon, but an ActivityPub API.

@robryk thanks, that looks promising! I haven't learned about ActivityPub APIs yet

@b0rk

The appropriate part of the spec for this particular thing is w3.org/TR/activitystreams-core, in case it's helpful (it describes all the weird quirks where field can be a string with the url of the object, a Link object that describes the same, or the object inlined which then might or might not have a canonical URL of its own...).

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.