[-] [email protected] 7 points 6 days ago

If proper SATA ever goes away, I'd wager that there will still be SATA-to-USB adapters on sale. Heck, people still find ways to connect floppy drives to their modern PCs.

[-] [email protected] 29 points 1 month ago

Wow, Europe, you guys sure are worrying us a little.

-- Best regards, South East Asia

[-] [email protected] 28 points 1 month ago

Assuming the entire US court system isn't in the corporate pocket

I love your optimism

[-] [email protected] 30 points 2 months ago

But personal files are... personal?

Research journals are published. Public.

[-] [email protected] 37 points 2 months ago

I still don't quite get why some people are defending manufacturers which remove the headphone jack on their phones...

3.5mm jacks don't cost much materially. Removing it doesn't bring any benefit at all, and you are forced to buy a bluetooth headphone or a Type-C-to-3.5mm dongle on top of that.

[-] [email protected] 49 points 2 months ago

Entitled brat? What... Have you ever seen how GNOME developers respond to some bug reports and merge requests?

Since when has reporting bugs and contributing to the project become an entitlement?

[-] [email protected] 40 points 2 months ago* (last edited 2 months ago)

I've noticed that many Reddit users with the username format Word_Word_Number (for example Absolute_Bot_1230) are almost guaranteed to either be a bot or extremely inflammatory -- it's like everything they post is meant to generate controversies.

[-] [email protected] 83 points 2 months ago

Society in general encourages and rewards those who speak more, even if the things they speak have zero contribution or are absolute nonsense.

[-] [email protected] 27 points 3 months ago* (last edited 3 months ago)

This also explains why VPN is a possible workaround to this issue.

Your VPN will encapsulate any packets that your phone will send out inside a new packet (its contents encrypted), and this new packet is the one actually being sent out to the internet. What TTL does this new packet have? You guessed it, 64. From the ISP's perspective, this packet is no different than any other packets sent directly from your phone.

BUT, not all phones will pass tethered packets to the VPN client -- they directly send those out to the internet. Mine does this! In this case, TTL-based tracking will still work. And some phones seem to have other methods to inform the ISP that the data is tethered, in which case the VPN workaround may possibly fail.

[-] [email protected] 50 points 3 months ago* (last edited 3 months ago)

Not sure if it's still the case today, but back then cellular ISPs could tell you are tethering by looking at the TTL (time to live) value of your packets.

Basically, a packet starts with a TTL of 64 usually. After each hop (e.g. from your phone to the ISP's devices) the TTL is decremented, becoming 63, then 62, and so on. The main purpose of TTL is to prevent packets from lingering in the network forever, by dropping the packet if its TTL reaches zero. Most packets reach their destinations within 20 hops anyway, so a TTL of 64 is plenty enough.

Back to the topic. What happens when the ISP receives a packet with a TTL value less than expected, like 61 instead of 62? It realizes that your packet must have gone through an additional hop, for example when it hopped from your laptop onto your phone, hence the data must be tethered.

[-] [email protected] 86 points 10 months ago

It's the fear of centralization, I believe (correct me if I'm wrong!).

Seeing that the whole point of federation is to decentralize the web, putting everything under the Cloudflare umbrella goes against this philosophy.

[-] [email protected] 35 points 10 months ago

Awesome! I don't have a Discord account (well, I had) so this will be very useful.

12
submitted 11 months ago* (last edited 11 months ago) by [email protected] to c/[email protected]

For context: I am trying to write a Rust wrapper over a C library.

Like many C libraries, most of its functions return an int. Positive return values are meaningful (provides information) and negative values are error codes.

To give an example, think of something like int get_items_from_record(const struct record *rec, struct item *items). A positive value indicates how many items were returned. -1 could mean ErrorA, -2 ErrorB, and so on.

Since this is Rust, I want to represent this kind of integer as Result<T, E>, e.g.:

enum LibError {
    A = -1,
    B = -2,
    // ....
}

// LibResult is ideally just represented as an integer.
type LibResult = Result<NonNegativeInteger, LibError>;

// Then I can pass LibResult values back to the C code as i32 trivially.

Is there a way/crate to do this?

view more: next ›

orangeboats

joined 1 year ago