1. “Who’s the idiot who wrote this code?” Oh, never mind, it’s yours truly from a couple of weeks ago.

  2. The “users won’t be able to tell the difference” argument for Electron apps falls apart like a house of cards after every major OS release. It’s a weak argument to begin with, but these transition periods widen the chasm between proper native apps and all the other junk.

  3. Fixing Missing Input Sources when Upgrading macOS (Big Sur)

    I found a solution to the problem I posted about a while ago. It turns out that clearing input cache using these two commands takes care of restoring things to the way they’re supposed to be:

    sudo rm /System/Library/Caches/com.apple.IntlDataCache*
    sudo rm /var/folders/*/*/*/com.apple.IntlDataCache*

    Now back to typing Japanese. やったー!

  4. After updating my main partition to Big Sur, I noticed that my Japanese keyboard input sources entirely disappeared, from both the switcher and System Preferences. Anyone else came across this bug?

  5. To say that my study and work experience in the US shaped the person I am today would be an understatement. I purposefully stay clear of discussing politics with strangers, especially online, but it warms my heart to see that love and compassion prevailed this week. Onwards and upwards.

  6. You know your investment in good app architecture is paying off when you start knocking down features in a fraction of the time you allocate to the task.

    I added rerouting the user to the sign in screen when the refresh token expires by adding 8 lines of code in the publisher pipeline that refreshes the access token.

  7. I worked on a single server-side API endpoint for four hours straight. It involved an OAuth dance with a third party service, a database read then write, and some data validation along the way. I only compiled the code once at the end and fired a request against the new endpoint. Lo and behold, everything worked exactly the way it should.

    I love using Swift on the server.

  8. I just finished watching the latest episode of Pointfree. What they are working towards is nothing short of impressive, especially considering how little code it involves. Making an interactive onboarding tutorial using the same view code wouldn’t be possible without this level of encapsulation.

  9. There is something about pull requests like this that leaves me with a warm, fuzzy feeling that’s quite hard to capture in words. Knowing that there are people out there who care about details as much as you do and who actively seek to make whatever they come across better is truly motivating. Thanks @dkhamsing for making my day!

  10. The new site design is live! 🎉 This time around I focused on rethinking the landing page and expanding the light appearance to cover the entire site, not just the content area. For the light color palette, I drew some inspiration from the earliest iterations of the site, circa 2009.

    Other changes include a new portfolio page, pagination in the microblog, and moving This Week I Learned to the main blog.

  11. Starting next week I will be helping Hyper Island students take their first step into the world of HTML, CSS, and JavaScript. I am pretty excited about this opportunity to share my passion for the Web, and I hope that by introducing them to the basic building blocks I can help them see the forest for the trees.

  12. I am quite tempted to use the new @AppStorage and @SceneStorage in SwiftUI, but the hefty price to pay on the debugging and testing front is giving me pause.

  13. This Week I Learned #20

    Here are some of the things I learned this week, in the order I’ve noted them down.

    # Programming

    • How to use mdx and mdx-deck to create interactive slide decks. It’s essentially a mashup of Markdown and React that generates highly customizable HTML slides that can be deployed as is or exported as a PDF document. I usually scuff at the idea of using Web-based presenttion tools, but this stack lends itself particularly well for the Web-dev related material I am currently working on.
    • I never paid close attention to how bitwise operations and bit shifting exactly work, but this article by Donny Wals prompted me to stop procrastinating and go over the official Swift guide on the topic.
    • I managed to use the new redacted(reason:) modifier in SwiftUI and remove the custom view I used for the purpose of displaying placeholders while the content loads. Happy to see utility APIs like these make their way to the framework.
  14. People picking a side in these public feuds between mega corporations aren’t thinking straight. They are doing it for their bottom line—what are you doing it for?

  15. This Week I Learned #19

    Here are some of the things I learned this week, in the order I’ve noted them down.

    • Esprit de l’escalier, “the staircase spirit”, is a French expression used in English to describe the frequent occurrence of coming up with the perfect reply only after leaving the premises of the argument or debate.

    # Programming

    • What connection pooling means in the context of server-side applications and how it’s implemented and used in various Swift frameworks (link).
    • Orthogonality in programming refers to the ability to use a limited set of constructs in a limited number of combinations, where changing one part doesn’t affect the others (via this article).
    • Speaking of orthogonality, or extreme lack thereof, the Web front-end ecosystem is as fragmented, poorly documented, and messy as ever. With every new wave of build tools, frameworks, and dependency managers comes an additional layer of compatibility issues and gotchas. Sometimes writing few extra lines of code for one less dependency isn’t all that bad.
  16. As I started work on the next iteration of the site, I realized that I need to reconsider certain content-related aspects. For instance, I have been exclusively using this microblog for the past year or so, all but abandoning the main blog. One obvious change I could begin with is moving This Week I Learned entries over to the blog or even splitting them into their own thing altogether.

  17. This Week I Learned #18

    Here are some of the things I learned this week, in the order I’ve noted them down.

    • Polybius is an urban legend from the early 2000s around an arcade game experiment that was allegedly run in the 80s by the US government in Portland, Oregon. According to the legend, the game was extremly addictive and caused several psychoactive effect on the players. Shortly after its supposed release, it is said that all Polybius arcade machines have disappeared without a trace.1
    • The Zeigarnik Effect refers to people’s tendency to remember incomplete tasks better than successful ones (via Laws of UX). No wonder I have a constant sense of guilt over my abandoned side projects.

    # Programming

    • Writing both the client-side app and the server-side API in Swift has some pretty significant benefits. In addition to sharing a lot of business logic, this approach reduces the impact of context switching when developing a new end-to-end feature. Writing the entire stack in the same language, using the same IDE, in the same workspace is a godsend.

    1. Most of this sounds ludicrous, but it never hurts to indulge in an urban legend or two, especially if it involves video games.

  18. This Week I Learned #17

    Here are some of the things I learned this week, in the order I’ve noted them down.

    • The coastline paradox refers to the phenomenon where the fractal nature of coastlines causes their length estimates to vary widely depending on the scale of the ruler used. This length tends towards infinity as the measurement unit gets smaller and smaller, going against the logical expectation when measuring a finite distance (via Marc Edwards).
    • The proportionality bias refers to our tendency to assume that major events have major causes. While it’s often cited as a likely reason people believe in conspiracy theories, it’s also why programmers spend hours debugging a problem, probing every nook and cranny, only to find out that the cause is much more trivial than what was anticipated.

    # Design

    • In 3D graphics software, namely Blender, a shadow catcher is a completely transparent material that “catches” and renders the shadows of other objects in the scene—useful when exporting 3D renders for further 2D composition and editing. When using the Cycles renderer in Blender, this is as easy as ticking a checkbox. In EEVEE, Blender 2.8’s new rendering engine, it requires using a custom shader to obtain a similar effect.

    # Programming

    • I went trough the first half of the Tour of Rust guide with the intention of getting more familiar with its syntax and memory management APIs. Beside the relationship between ownership and mutability, many of the concepts introduced in what I’ve seen so far felt quite similar to their Swift counterparts.
  19. I enjoyed Chris Krycho’s take on the idea, but I totally understand where he is coming from. Like any other commitment, it takes time and energy that might not always be readily available.

    After four months of running this experiment, I am starting to feel the pressure. Some weeks go by where I don’t learn much worth mentioning, or simply don’t have enough time to elaborate. But I remain convinced this is a habit I’d like to keep—if anything, it helps me rebuild confidence in my ability to follow through commitments of this kind.

  20. This Week I Learned #16

    Here are some of the things I learned this week, in the order I’ve noted them down.

    • This week I picked up aws-sdk-swift with the goal of integrating with SES, Amazon’s cloud email service. After some initial struggle figuring out which API version to use and how, I managed to send emails from a server-side Swift app I am currently working on.
    • Some valuable lessons about S3, AWS billing, and CDNs by Chris Short (link).
    • SwiftUI’s new Menu component is now available on iOS 14 as of Beta 3. I suspect contextual menus to gain more traction on iOS and I am happy to see them join a growing list of SwiftUI components.