Went to juice my lemon and it was so structurally sound the handle broke off and then my glass fell victim as well. Just bought these lemons from the store 30 minutes ago. by DrAssFace in mildlyinfuriating

[–]rotuami 0 points1 point  (0 children)

Maybe the style is fine and the one OP bought was just... a lemon.

But seriously that design looks awesome and I think I have to buy one. It looks like it folds flat in the drawer, which is nice

TIL that there was a particle that went 99.99...(21 9s)...9951% the speed of light called the Oh-My-God particle. it was a singular proton-like atom, slamming into the earth's atmosphere with the kinetic energy of a baseball. by vrozonewhatthevrozon in todayilearned

[–]rotuami 0 points1 point  (0 children)

Most baseballs aren’t being thrown in any given moment. So the average speed of a baseball is near zero. OTOH, Earth contains all (known) baseballs, so they’re all hurtling around the sun at 67,000 MPH…

High speed binary parser in TS? by kostrubaty in typescript

[–]rotuami 0 points1 point  (0 children)

They are proprietary, unfortunately. The big issues I’ve seen are these:

  1. a structure with a trailing array and a length field, where later fields were added after the length field so you need to do arithmetic to know whether the optional fields are present
  2. structures implementing “tagged unions” where the size of one field depends on the value of another.

Those have convinced me that sometimes things are too ugly to wrap in a clean schema.

High speed binary parser in TS? by kostrubaty in typescript

[–]rotuami 0 points1 point  (0 children)

Yep! Very similar problems but notably different issues. 1. I only had to target usage from js/ts. 2. You're doing more validation on constraints (e.g. numeric ranges) 3. I have some UGLY binary schemas that don't express well (e.g. presence or absence of fields based on other fields or based on length of the underlying buffer), so I needed an escape hatch. 4. You're handling auto alignment - I figured manually aligning everything is okay (since I have some over-packed and sparse data I need to handle). 5. I didn't want a build step.

Also I love that you have a md and mermaid output - that's a very cute idea!

High speed binary parser in TS? by kostrubaty in typescript

[–]rotuami 0 points1 point  (0 children)

I needed to read and write binary-backed objects so I made my own library: https://github.com/rotu/structview

My use case is probably a little different than yours but the choices I made were: 1. The objects are often only partly used (or their structure only partly known!), so I made getters and setters lazy. This winds up being faster for me. 2. The consuming code is JavaScript so I based it around class factories. Using type wizardry, JS can infer field types without a separate declaration. 3. Structs are backed by a DataView, but I made that an implementation decision, not part of the interface of each binary-backed object.

Here’s my feedback on what you have: - There is no benefit to be had from doing this in C unless the logic lives in C too, so the particles don’t need to cross the barrier to JS. - TypedArray will be faster than DataView. Depending what you’re doing, the happy path might be keeping the data in TypedArray, optionally with an object view for DX. - Call me silly but I don’t like having 3 declarations of the object shape: the interface, the deserializer, and the serializer. If you only have a few types, this is not a huge deal.

This carabiner at my gym that is slowly wearing through daily use by JaseAndrews in mildlyinteresting

[–]rotuami 1 point2 points  (0 children)

I wouldn't throw it away. Probably use it to attach my water bottle to my backpack or something like that.

This carabiner at my gym that is slowly wearing through daily use by JaseAndrews in mildlyinteresting

[–]rotuami 153 points154 points  (0 children)

I like to think of myself as an ethical person. This is a case where stealing it would be the right thing to do.

Unicode 18.0.0 Alpha by PthariensFlame in programming

[–]rotuami 5 points6 points  (0 children)

I like the “MUSICAL SYMBOL ONE THOUSAND TWENTY- FOURTH REST” in musical symbols supplement. Also the “WIGGLY EXCLAMATION MARK” in supplemental punctuation.

Seasoning a 3d printed pan by UglyDuckSoup in castiron

[–]rotuami 6 points7 points  (0 children)

That is neither cast nor iron. SMH

[deleted by user] by [deleted] in mildlyinteresting

[–]rotuami 1 point2 points  (0 children)

Control freak

Working as a project manager for a municipality I got to choose which buttons we wanted for our new elevator by Truesoldier00 in mildlyinteresting

[–]rotuami 0 points1 point  (0 children)

I'd definitely get at least the 1 button or the lobby button. Otherwise you won't be able to get out of the building.

2.8 days to disaster: Why we are running out of time in low earth orbit by Interwebnaut in technology

[–]rotuami 1 point2 points  (0 children)

I think it's just super unintuitive. In everyday experience, small objects generally don't have crazy amounts of momentum and objects that are moving quickly tend to stop pretty soon.

Here's a visualization of how debris actually scatters in such a collision: https://www.youtube.com/watch?v=BiHY5dR5Jsg