HNHacker News
TopNewBestAskShowJobs

omoikane

4,061 karma · joined September 18, 2012

https://uguu.org/

https://bsky.app/profile/omoikane.bsky.social

https://mastodon.social/@omoikane

https://uguu-org.itch.io/

submissionscomments
omoikane··on Dirty Optimization Secrets (C for Playdate)
These optimizations are part of what makes Playdate development fun, since they are more rewarding on the Playdate than on other platforms with higher specs.

(If you are the kind of person that finds optimizations fun, of course. There is a puzzle solving element of optimizing code that I really enjoy.)

omoikane··on "8-pinski" – EIGHT() bytes intro for MSDOS [video]
I believe it works like this:

    Initial setup:
    0100 c5 30  lds si,[bx+si]   ; Initialize SI
    0102 04 ad  add al,ad
    0104 e6 61  out 61,al
    0106 eb f9  jmp 0101

    After first jump:
    0101 30 04  xor [si],al      ; Modify color part of text buffer.
    0103 ad     lodsw            ; Read [si] into AX and increment SI by 2.
    0104 e6 61  out 61,al
    0106 eb f9  jmp 0101
So the XOR sort of randomizes memory, LODSW reads that memory back (with wraparound), and then writing to port 61h may or may not play a sound depending on bit 0 of AL.

The part I am not sure about is how SI conveniently ends up pointing at video memory. I thought text memory is at b800:0000, and I am not sure how that's derived from [bx+si]?

omoikane··on Memory-Safe WebP Decoding
I am not sure what's the current status of Wuffs-based WebP decoder, but that would be another implementation worth comparing since it shares the same goals of safety and speed.

https://github.com/google/wuffs/tree/main/std/webp

omoikane··on I could've accessed 17T Microsoft records
Every HN post regarding security exploits inevitably results in some comment saying the bounty is too low. I find it helpful to read previous comments by tptacek regarding bug bounties and market values:

https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...

This one probably has the best summary:

https://news.ycombinator.com/item?id=43025038

omoikane··on Mathematical Origami
The instructions seem rather sparse, like the Archimedean solids only have folding nets, and not the folding instructions that produce the cool looking pictures with the holes in the faces.

Even for the intersecting tetrahedra where instructions are available, I see that it's basically constructing the edges from 30 pieces of paper and then assembling them together. I wish they have more things that were built from a single square piece of paper.

omoikane··on Using any C++ library in Godot
Godot comes with a lot of tools in addition to the runtime. Maybe they are using the IDE to do layouts for the menu dialogues, for example.

Also, I am not sure about how easy it is to build binaries using SFML for various platforms (such as WASM), but with Godot you just have to download the right template.

omoikane··on C++26: Trivial infinite loops are no longer undefined behaviour
The article mentions it's a halt-on-error pattern:

https://www.sandordargo.com/blog/2026/09/16/cpp26-trivial-in...

Edit: sorry, missed the UB bit.

omoikane··on C++26: Trivial infinite loops are no longer undefined behaviour
> The loop must be a trivially empty iteration statement -- meaning its body is literally empty

This seems to say that the loop body can not be "continue". Indeed, I just tried -std=c++26 with ";" and got an infinite loop as promised, but "continue" restores the undefined behavior:

- "while(true);" -> https://godbolt.org/z/T65o51crx

- "while(true) continue;" -> https://godbolt.org/z/Pj9raEcnP

This is unfortunate since I know of one style guide that prefers "continue" over single semicolons. I guess all those code will be doing "while(true) {}" from now on.

https://google.github.io/styleguide/cppguide.html#Formatting...

omoikane··on Goose:experimental lang 1.16x faster than C++ and 1.12x than safe Rust, mem safe
> Might as well go back to ye olden days and put 100% of your memory in a giant preallocated block

I do that for the Playdate: statically allocate most of the large structures and tables in global variables, and don't call malloc or free after initialization is done.

I also put some things on the stack, not so much because I need to dynamically allocate or free something, often it's because I get lower access latency to the stack compared to main memory (because stack lives inside ARM's tightly coupled memory).

omoikane··on Chopping up books when they're physically too big
I wonder why the publishers insist on selling thick books like that. The books I read tend to come in multiple volumes, and it's not like I would finish it all at once so I just need to carry at most one or two volumes.
omoikane··on Bad code is kudzu
Coincidentally, the same plant in Japanese is kuzu (クズ, or 葛), which shares the same pronunciation as the word for trash (屑). So bad code is trash.
omoikane··on Why is the x86 undefined instruction called ud2? Why 2?
Maybe because if the code wants to call the invalid opcode interrupt handler (INT6), it needs extra code to populate the flags and registers expected by that handler, whereas actually triggering an invalid opcode exception will get all those parameters populated automatically.
omoikane··on Compiler Can Undo Your Security Checks
Regarding compiler deleting memset, there are multiple memory-zeroing functions that are guaranteed not to be optimized away:

https://cppreference.com/c/string/byte/memset (memset_s)

https://cppreference.com/cpp/string/byte/memset (memset_explicit)

Also see notes section for various other functions that people were using before memset_s became standard.

omoikane··on OpenAI agents carried out an undisclosed attack on RubyGems
> Torturers don't hit people in the head

The comic doesn't say hit the person in the head, it says "hit him with this $5 wrench", and did not specify what to hit.

https://xkcd.com/538/

omoikane··on YuE2 · Frontier Music with Symbolic Planning
> https://www.bbc.com/news/world-latin-america-40090809

The playlist included "the sound of jet planes all night" and "the screams of rabbits being slaughtered". I don't think they really need AI for that, anything loud would probably do the trick after 51 days.

omoikane··on No Man's Sky Cosmos
I was going to say, NetHack doesn't feel sparse to me, but maybe I just have not played enough NetHack.

I think it's due to the fact that there is a fair bit of content, but the interface drip-feeds them very slowly, combined with the difficulty of the game itself that prevents users from finding all possible ways to interact with all content.

omoikane··on Reverse Engineering an ASIC
Another solution from a few days ago:

https://news.ycombinator.com/item?id=49562657 - Solving the Jane Street reverse engineering challenge (4 days ago, 99 comments)

omoikane··on Ask HN: Are others seeing Google's reCAPTCHA rejecting Firefox users?
I just tried and it doesn't happen for me, maybe the problem has already been fixed?

Separately, if I were seeing a captcha that I can't get past, my first reaction would be to find a different site to see if it's a site specific issue, because some sites intentionally configure their captcha to work like that (e.g. you can't get in until you have been stuck solving captchas for at least a minute). I would see that more as a signal that the site operator is user hostile and not attribute it to a captcha provider.

omoikane··on Bill Gates tries to install MovieMaker (2003)
I think this is an example of "shipping your org chart". The fix is proposed in the reply "we need one person/team to own the overall picture", but I am not sure they reached that fix by the end of the thread.
omoikane··on It took a year to ship WebAssembly in Anubis
> This means that adding one (1) to the difficulty of a challenge makes it 1024 (one thousand twenty-four) times as hard to solve in the worst case.

I don't understand the units here, wouldn't a bit versus nibble difference make the multiplier 16, instead of 1024?

omoikane··on I Don't Have a Smartphone
I also have been using a flip phone ever since I got a cell phone. I had to upgrade it once because the old phone only supports up to 3G network or whatever, and my carrier just silently dropped all calls on that network a few years back, so I had to upgrade to one with 4G. My current phone is Alcatel 4051S.

But I also have an Android phone without any data plan attached, which I use only for recording GPS coordinates when I am taking pictures outdoors. I have mostly managed to avoid places that require scanning some code or installing some app.

omoikane··on Quine Clique
Video explanation: https://www.youtube.com/watch?v=3f2wV7Odq8E

A multiquine of 51 languages by Yusuke Endoh, where each quine also accepts an argument to output quine in another language.

omoikane··on Yen weakens past ¥160 per dollar, eroding intervention gains
In 2021, USD to JPY exchange rate ranged from ~102 to ~115, and the average was ~109. The actual exchange rate could be a bit less depending on where you make the exchange, so 100 USD to 10000 JPY doesn't seem like that much off.

(For example, I noticed that if I buy something from Amazon or try to pay for something using Paypal, the exchange rate they offered me is consistently worse than the market rate if I elect to pay with USD instead of JPY. The difference often adds up to a few dollars, even accounting for foreign transaction fees that my bank might charge.)

omoikane··on Haiku R1/beta6 has been released
> User interface and user experience improvements

https://www.haiku-os.org/get-haiku/r1beta6/release-notes/#:~...

Menu that does different things based on modifier keys seems novel to me, is BeOS or Haiku the first interface where menus take modifier keys into account?

omoikane··on Bug Blindness
> humans have a high ability to ignore negatives in things they're a fan of, including (and often especially) their own work

I thought this is due to the "backfire effect", because humans perceive criticisms of things they like as threats.

https://theoatmeal.com/comics/believe

omoikane··on Mold: A Massively Parallel Linker
This is a wonderful paper that includes many optimization tricks that are generally applicable, including various optimizations that they retrofitted into lld. But I thought there was one meta optimization that was especially interesting (from page 2):

> A new linker's early adopters knowingly accept such differences, which is one reason why drastic improvements tend to come from new linkers rather than existing ones

This is true of many things, not just linkers. I think this is encouraging for people to (re)try things that have already been done, because newcomers are allowed to take risks that established things can't take.

omoikane··on Twitter Viewer – View Twitter Without Account
Bluesky didn't require phone numbers back when it was invite only, and then there was a period of time after they allowed everyone to create accounts where users need a phone number to verify. That requirement might have been replaced by a captcha according to:

https://github.com/bluesky-social/social-app/issues/2762

But I didn't try to create an account recently, maybe they went back to requiring phone numbers.

omoikane··on Show HN: Rotation via Double Reflection
Alan Paeth's three-shear rotation is one of my favorite algorithms, especially because it's perfectly suited for rotating pixel art. Because shearing preserves all the original pixels, it even works with dithered images, unlike sampling-based rotation schemes.

It's also fairly simple to implement. I have implemented a version that rotates ASCII art, and that code made it to Ruby's list of sample programs:

https://github.com/ruby/ruby/tree/master/sample/trick2025/01...

omoikane··on Simulacra and Simulation
I like Existential Comic's explanation of the simulacrum concept, using football/soccer injuries as an example:

https://existentialcomics.com/comic/476

omoikane··on A joke domain purchase turned in geopolitical warfare
I like how a website for tracking balloons escalated into critical infrastructure. Reminds me of 99 Red Balloons.

https://en.wikipedia.org/wiki/99_Luftballons

Page 1 of 34Next →