Elektrine lite

← Feed

Lesley Lai

lesley@mastodon.gamedev.place

<p>Computer Graphics &amp; Programming Languages person.</p><p>I twoot about languages like C, C++, Rust, JS/TS, and OCaml.</p><p>I organize <span class="h-card" translate="no"><a href="https://mastodon.gamedev.place/@graphicsmeetup" class="u-url mention">@<span>graphicsmeetup</span></a></span></p><p>he/him</p>

Posts

  • View post

    Reservoir sampling in #Blender 😅. There&amp;#39;s probably a better way to uniformly randomly select from different textures, but this one works

  • View post

    @0xabad1dea@infosec.exchange Agree with other stuff. Federation was a &quot;must&quot; for me, but you make me think whether we actually need it if clients can just manage credentials for multiple servers. The friction can still be a bit high to create one account for each server, but maybe OAuth can help

  • View post

    It&#39;s disgusting how many tracking requests it blocks. I knew the situation is bad, but I didn&#39;t know that microsoft sends telemetry every 20 seconds, for example

  • View post

    What a good treat when you are learning something (generating functions in my case) and find a blog post written by someone you know: https://blog.demofox.org/2025/01/05/dice-deconvolution-and-generating-functions/. Thank you, @demofox. Also, it&amp;#39;s a good observation that generating functions are like the z transform (and also Fourier/Laplace in continuous space). All of those solve problems by transforming into a different space, solving the problem there, and then transforming back.

  • View post

    Yet another person asked me &amp;quot;aren&amp;#39;t your programmer&amp;#39;s job to be replaced by AI soon?&amp;quot; This friend&amp;#39;s job is to predict the stock market.

  • View post

    Since I reduced my usage of em-dash (it&amp;#39;s pretty hard to type any way), my new best friend is parentheses. (Parentheses are really cool since you can use it to express non-linear flow, and you can also nest it (like this (isn&amp;#39;t this cool?))) What? It&amp;#39;s hard to read? If you can read Lisp (I am sure, you, my target audience, can), this is a piece of cake

  • View post

    TIL about #Rust &amp;#39;s Option::transpose. Pretty cool stuff: // this will give you Result&amp;lt;Option&amp;lt;T&amp;gt;, E&amp;gt; optional.map(|v| something_that_can_fail(v)).transpose() #RustLang

  • View post

    Added Mastodon comments functionality to my blog (the function is already there for the &amp;quot;microblog&amp;quot; section, and I just added it to regular posts). Now, if I link a Mastodon post in a blog entry, all the replies from Mastodon will appear on the page. Test page: https://lesleylai.info/en/fifty_shades_of_oop #indieweb #personalwebsite

  • View post

    I don&amp;#39;t know. The complexity of this issue (both implementations and the mental overhead of programmers) just to save a few keystrokes makes me feel it&amp;#39;s not really worthwhile? It feels more like a fashion when the convinience is debatable? #pldev https://terts.dev/blog/no-semicolons-needed/

  • View post

    I hope generators get more love in the C++ circle. Unfortunately, I think a C++ coroutine-based generator has a non-trivial overhead compared to a hand-written iterator or state machine. It probably doesn&amp;#39;t matter for a lot of use cases (like the example the author showed). https://mropert.github.io/2026/03/20/unity_cpp_coroutines/

  • View post

    Trying to apply for jobs, and one job sent me this LeetCode-style coding challenge that I failed miserably. I am not that kind of person performing well under high pressure. Choosing C++ was also a mistake. Their platform doesn&amp;#39;t support debuggers, and STL index-out-of-bounds errors don&amp;#39;t give me any information about where they occur. At the end, I am pretty much stuck in debugging hell with std::cout