tech.lgbt is one of the many independent Mastodon servers you can use to participate in the fediverse.
We welcome all marginalized identities. This Mastodon instance is generally for folks who are LGBTQIA+ and Allies with an interest in tech work, academics, or technology in general.

Server stats:

2.9K
active users

If you have the character set ' 0123456789' in ASCII/Unicode and you want the digits to be mapped to their numeric values and space to be mapped to zero, then ord(c) & 0xf does the trick.

This feels like something someone would have noticed already, but I have no idea how I could search for this.

Public

(there’s another of my AoC posts on its way, but it’ll be a while)

Public

@flowblok there's a similar trick for case conversion, also one of the design goals that EBDIC maintained, despite their other... bizarre choices.

Public

@flowblok Also there is only a 1-bit difference between uppercase and lowercase, making case-insensitive searches also trivial with a mask like that.

Quiet public

@flowblok A is 65 and A is 97 (64+32+1). The first 32 chars are control chars, then 16 punctuation signs, then numerals and some operators. Everything was thought out so that it would be reasonably easy to see on punchcards. Shift (lower to uppercase) is -32, etc.