• 0 Posts
  • 17 Comments
Joined 2 years ago
cake
Cake day: June 11th, 2023

help-circle
  • This reminds me of when I had to roll my own dynamic memory allocator for an obscure platform. (Something I never want to do again!) I stuck metadata in the negative space just before the returned pointer like you say. In my case, it was complicated by the fact that you had to worry about the memory alignment of the returned pointer to make sure it works with SIMD and all that. Ugh. But I guess with strings (or at least 8-bit-encoded strings), alignment should not be an issue.


  • Oh, so you’re talking about text representation in an editor or something along those lines? That’s kind of a separate problem isn’t it?

    At the lowest level though, I suppose you still need to consider whether to use null-terminated segments. I think I’d still be going length + data, though I wouldn’t worry about packing down the length representation like with serialization formats. Your code will need to be highly cognizant of the length of strings and managing dynamic memory allocation all over the place, so it’s good to have those lengths quickly accessible at all times.


  • Better in what sense? I put some thought into this when designing an object serialization library modelled like a binary JSON.

    When it got to string-encoding, I had to decide whether to go null-terminated vs length + data? The former is very space-efficient, particularly when you have a huge number of short strings. And let’s face it, that’s a common enough scenario. But it’s nice to have the length beforehand when you are parsing the string out of a stream.

    What I did in the end was come up with a variable-length integer encoding that somewhat resembles what they do in UTF-8. It means for strings < 128 chrs, the length is a single byte. Longer than that and more bytes get used as necessary.


  • I don’t really have an answer for you, but can say when recompiling older codebases (some in C and some in C++) using a modern C++ compiler, typing errors are among the most common I have to address. In particular, compilers seem to insist more on explicit casts for type narrowing, which is a good thing. But I don’t know about modern C itself? It wouldn’t surprise me if the language has become stricter.




  • The worst part is that he tried to blame me for the accident.

    Good God. Now there’s some drama you could’ve done without. Sounds like you had a competent lawyer though. Glad that part worked out!

    I looked up what the model the local dealer was selling. They’re made by a company called trivel which I see now seems to specialize in orthopedic designs. Specifically, they were selling the e-azteca model. What I remember from watching others ride around the parking lot was the seating position looked a bit more recumbent than a regular bike and there was some back support? Wish I had tried one myself! Would have more to say about it then.

    Since you were cool I’ll share a few pics of the accident I plan to put in the video I’m making. I warn you it’s a bit graphic but it’s not blood and gore levels of graphic.

    Thanks for sharing those. I think the importance of such photos is that they give you a baseline to compare where you are today. I had some major surgery to remove a growth from my neck and looked like hell afterwards. I also had some facial numbness and the doctor wasn’t sure that would ever heal? It did after several years but in a weird way. Like I can touch my neck and feel it on my earlobe. Weird stuff like that. lol


  • That is one hell of a story! It just burns me that one second of dumbfuckery by a dude with no idea of the responsibility that comes with driving a large vehicle created this life-altering saga for you.

    Also this is a bit weird, but my ankle is super problematic.

    Keep bitching about this to the doctors or get a second opinion. Maybe they’ll send you for an x-ray or some physio? You have to be your own advocate with this sort of thing. And as they say, the squeaky wheel gets the grease.

    If I can ride a bicycle one day, even just for a short ride.

    Last time I was at the ebike dealer, they had a bunch of these 3-wheeler cargo models and I saw several people take off on them. I asked the owner about them. He said he rides one himself in the winter since they are much more stable over snow and ice, and the extra storage in the back between the 2 wheels is handy. He also said the last 2 he sold were to people with mobility issues. One was a husband with some sort of condition that kept him house-bound a lot of the time until his wife figured out he could do this and now they ride everywhere. The other was a 91-year-old cyclist who was saying his balance was not what it once was. I kid you not! Anyway, something to consider.

    I’m working on a YouTube video that will recount the story.

    Please drop a link here if you do this. I would love to see this.


  • I am long since past my teen years, but as an avid traditional cyclist who is now an ebike enthusiast, here are a few points off the top of my head:

    • ebikes are consistently faster. It is easier to plan your day around ebike trips, since they take about the same amount of time every day. With a regular bike, your trip could be twice as long today because yesterday’s tail wind has been replaced by a stiff head wind.
    • Issues involving extreme heat and poor air quality (in my experience, these often go hand-in-hand) have less impact on ebiking.
    • Terrain not being an impediment gives you more options. There may be some path you’d never have contemplated before since it is hilly or goes down into a deep ravine you will eventually have to slog your way out of, and so you’d wind up taking busy city streets instead with the danger that entails.
    • ebikes do give you exercise. You can usually control the amount of pedal assist or even turn it off for a real workout. When off, you will get more exercise than with a traditional bike since ebikes are heavier. But you can do this exercise wherever it is safest to do so and go electric when you need to move with traffic.
    • If your city has a main corridor for cycling in terms of say an off-road paved trail to downtown, but you’d have to go out of your way to an extent to reach it, you will be more likely to do so on an ebike. It is just not as much of bother to seek out the better and safer routes.


  • I think the pros outweigh the cons? Anything that steers us away from car culture is desperately needed at this point, and this is one of the only practical alternatives in suburbia.

    I would be for bike safety being taught at schools, though I feel licensing for minors would be a quagmire? Let’s not go there. I would be for speed limiters that are harder to bypass. For example, I can disable mine by phone app. If I had any trouble I could ask, well, a teenager? lol

    But perhaps most importantly, cycling infrastructure, at least in North America, is a joke and there is so much that can be done on the safety front it’s not funny. I wish the decision makers were all bike commuters. Then they would understand the level of impracticality in their well-meaning but futile attempts to improve the situation.




  • I’ve always wondered about the cassava root: a staple food product eaten by millions that contains cyanide. It takes a multi-step, multi-day process to make it safe to consume. How many bothans had to die to bring us this information? Something to ponder next time you’re enjoying some tapioca.