I named a function "get_first_slice_left_of_object" when it actually gets the first slice to the *right* of the object, and used it that way for ages without noticing. Miraculously, it seems that in every place I used it, I wanted the thing it actually does rather than the thing it says it does.

I don't think "I don't care what other people think" is something to brag about unconditionally. Sometimes other people are right about things, and one would do better to be open to that possibility.

I've gotten the impression that writing correct thread synchronization in C requires either a library or manually inserting platform specific instructions of some kind. The educational resource I usually trust disagrees, but everyone seems to disagree about multithreading, so I don't really know how to gain confidence in any particular answer. Possibly get used to reading language specs, and OS specs, and maybe even more kinds of specs, to do a proper job.

It appears that the is a C standard library function to convert a float to a string, but not to convert a float to a wide character string. Naturally, that means I'll be writing my own, because doing a conversion in multiple steps when it's theoretically possible in one step makes me feel icky.

It's remarkable how much more convenient I find not having pattern matching as a separate thing from if-else, at least for my purposes. Lots of situations in Rust where I had to pull a block of code that makes no sense in isolation into a function because the fact that it isn't possible to match a pattern and check a boolean condition in a single line forced me to duplicate the block.

Last night I had a nightmare that I accidentally ruined my flute's head joint. In reality, the joints of my flute have been stuck together for a long time, though it is otherwise fine. I think it's time that I fix it once I get a few paychecks.

Rise of Skywalker had a brass chord that seemed to have a tuba on top.

I just saw someone call the fact that a programming language has a mandatory brace style "anti-intellectualism." Why would you care very much about brace style? Does it actually matter? I'd just as soon have a language remove it from the table so people won't waste time arguing about it...but apparently they'll argue anyway.

I believe I fell exactly one percent short of a 4.0 in my networking class this semester. As a class with a term paper, it could have gone worse–I always feel like I'm using Umbridge's torture quill when writing essays–but I could so easily have picked up just a few more points elsewhere in the class.

sex toy question 

Is there a word for all the pieces of data you copy when you make a deep copy of a data structure? The data structure's __.

In cases where I would have used function overloading if I were in C++, but I'm in C instead, I'm just gonna suffix the function name with a number if I can't think of a usefully different name.

Yay, I made one of my programs work on multiple operating systems for the first time.

Does macOS allow anything comparable? I'm not entirely clear on it, but it sounds to me like mmap does something more or less equivalent to VirtualAlloc with MEM_RESERVE | MEM_COMMIT: though it waits until virtual memory pages are accessed before mapping them to physical memory, it does do the equivalent of charging the size of the whole region against the commit limit right away.

However, reservations aren't charged against the system commit limit, which means one process making a reservation, no matter how large, has no impact on how much memory other processes are allowed to commit or reserve; reservations alone don't consume resources that other processes would otherwise have been able to use.

I often want large region of contiguous virtual memory that I can extend on demand. On Windows, I can call VirtualAlloc with MEM_RESERVE on a size that I think is larger than the region could ever realistically need to grow to. This does cause the memory footprint of the process to grow by an amount linearly correlated with the size of the reservation, no doubt due to whatever bookkeeping Windows does to keep track of the reservation.

Show more
Mastodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!