๐ŸŒธ Thu, May 16, 2024 ๐ŸŒธ

Similarly to Llama.cpp, there is a stable-diffusion.cpp, which allows you to generate AI images purely on CPUโ€”perfect for “image generation on potato computers.” Since itโ€™s written in C++, it might be super easy to integrate into Unreal Engine. What a great time to be alive!

https://github.com/leejet/stable-diffusion.cpp


๐ŸŒธ Wed, May 15, 2024 ๐ŸŒธ

So, I have got sick. Running nose, watering eyes, sneezing, itchy throat. I have got that sick first time after I got COVID last year in March. I thought I had gained a superpower from my long-COVID to resist any infection. My body definitely became more resistant to infections but not bulletproof.

I am actually hopeful. It is getting old, waking up in the morning and the chest pain slowly waking up with me. When I am sleeping, there is no chest pain; it only starts when I am awake.

Something different, you know, like when you are debugging a bug and trying all different things for hours and nothing is changing, and suddenly something changes. It may even become worse, but you are celebrating because something changed, which means you are making progress.

Same thing, I was not sick for more than one year despite long-COVID, and who knows, maybe my chest pain will go away? Who knows.


๐ŸŒธ Tue, May 14, 2024 ๐ŸŒธ

Tesla is embracing their failures and selling the cracked window decal for the Cybertruck.

https://shop.tesla.com/product/cybertruck-omfg_decal


๐ŸŒธ Tue, May 14, 2024 ๐ŸŒธ

Hey, next week is a technical interview with Meta. Wish me luck.


๐ŸŒธ Mon, May 13, 2024 ๐ŸŒธ

I realized that in the event of a zombie apocalypse and the collapse of civilization, we don’t need super-smart AI; we need super-knowledgeable AI. If we can ask factual questions and get accurate answers, that would be good enough. How do you start a fire with this, this, and this? What plants are safe to eat?


๐ŸŒธ Thu, May 9, 2024 ๐ŸŒธ

SpaceX can make an offer to install Starlinks on aircraft; I think it’s a pretty promising B2B idea.


๐ŸŒธ Wed, May 8, 2024 ๐ŸŒธ

Solar energy, harvested using solar panels, is essentially fusion power since it originates from the Sun, which is powered by a fusion reaction. ๐Ÿ˜ฒ


๐ŸŒธ Tue, May 7, 2024 ๐ŸŒธ

It seems that SFW and NSFW are merging, and they both are becoming NSFW. I am pretty sure nobody watching content in the office tagged as SFW.


๐ŸŒธ Tue, May 7, 2024 ๐ŸŒธ

Git should change the defaults to clone with recursive submodules by default. I am tired of typing --recursive


๐ŸŒธ Tue, May 7, 2024 ๐ŸŒธ

More layoffs :(

https://www.ign.com/articles/microsoft-closes-redfall-developer-arkane-austin-hifi-rush-developer-tango-gameworks-and-more-in-devastating-cuts-at-bethesda


๐ŸŒธ Tue, May 7, 2024 ๐ŸŒธ

AwesomeBump allows you to author textures. Yesterday, I played around with it a bit to create a normal map for the granola bar static mesh.

https://github.com/kmkolasinski/AwesomeBump


๐ŸŒธ Mon, May 6, 2024 ๐ŸŒธ

I think studying physics would be a lot more fun if physicists referred to particles as balls. Everything is a ball, and everything is made of balls. “Physics of Elementary Balls.”


๐ŸŒธ Mon, May 6, 2024 ๐ŸŒธ

A well-informed populace, being necessary to the security of a free society, the right of the people to develop, use, and control artificial intelligence technologies, shall not be infringed. ๐Ÿ˜›


๐ŸŒธ Mon, May 6, 2024 ๐ŸŒธ

Just updated the firmware on my laptop, hopefully it will start charging my battery to the level I set, not to some random numbers like 69%. Just checked, nope; it’s stuck on 64%. ๐Ÿ™ƒ


๐ŸŒธ Mon, May 6, 2024 ๐ŸŒธ

Quite often I see the following pattern in C++:

int64_t getSomeValue()
{
    static int64_t cache = 0;
    if (cache)
        return cache;
    // expensive calculation with assigning the calculated value to the cache
    return cache;
}

While this approach might seem effective at first glance, it has several issues:

  1. Magic Value Zero: The code uses 0 as a magic value to indicate that the cache hasn’t been initialized. This can lead to unintended behavior if 0 is a valid result from the expensive calculation. Additionally, using magic values like this is generally considered poor practice as it relies on implicit knowledge.

  2. Not Leveraging Static Variableโ€™s Reentry Protection: The static variable cache is initialized to 0, and the function checks if cache is non-zero to avoid recalculating. However, in C++, static variables are protected from concurrent reentry issues using a mutex during initialization. In the original pattern, the if statement checking cache is not protected with any mutex, so this pattern does not leverage the built-in protection provided by the language.

A better approach would be to use a lambda function for the initialization, like this:

auto getSomeValue()
{
    static auto cache = []() {
        return 314LL; // expensive calculation
    }();
    return cache;
}

With this code:

  1. No Magic Value: The initialization of the static variable cache is done directly through a lambda function that performs the expensive calculation. This avoids the need for a magic value and ensures that the actual result of the calculation is stored in the cache.

  2. Reentry Protection: By leveraging the static variable’s reentry protection, this code is cleaner and safer. The lambda function executes only once, and the resulting value is cached properly. Additionally, this version clearly communicates the intention of performing a one-time calculation.

  3. Improved Readability: In my opinion, this code is easier to read and understand. The use of the lambda function clarifies that the expensive calculation is only performed once, and the result is cached for future use. This clarity enhances maintainability and reduces potential bugs.

In conclusion, the lambda-based initialization pattern is not only cleaner but also takes full advantage of the safety features provided by C++. It’s an excellent way to handle expensive calculations that only need to be done once, while also avoiding the pitfalls of magic values and unnecessary reentry checks. Additionally, it makes the code more readable and understandable, which is always a bonus in software development.

The article was written with the help of ChatGPT 4.


๐ŸŒธ Mon, May 6, 2024 ๐ŸŒธ

My sense of taste changed after wisdom tooth extraction; noticeable change: water has got some hint of metallic taste. I hope I’ll get used to it or my sense of taste will get back to normal.


๐ŸŒธ Mon, May 6, 2024 ๐ŸŒธ

I’ve got an idea for a horror game where the player is an AI assistant, similar to Alexa or Google Mini. Initially, everything seems innocent, with tasks like telling the time or reporting the weather. However, things take a turn as the game starts to gaslight the player into thinking they aren’t a real AI, but a human in a simulation being trained as an AI assistant. The game creates psychological horror by making the player question, “Am I a real human or in a simulation?” There could even be a cutscene where a technician walks into a data center and casually presses the delete button, amplifying the player’s unease.


๐ŸŒธ Sun, May 5, 2024 ๐ŸŒธ

I just noticed I accidentally switched ChatGPT from 4 to 3.5. I literally got angry with ChatGPT earlier today because of how stupid 3.5 is.


๐ŸŒธ Sun, May 5, 2024 ๐ŸŒธ

What’s going on with UI lately? The X and Y coordinates have to be exactly the same on mouse button down and mouse button up. It’s impossible to click on buttons using my Wacom tablet. I remember having struggles on Samsung’s website once, with emoji selection on KDE, and with some UI elements in Bitwig. It’s kind of annoyingโ€”I have to click multiple times and keep my hands extremely steady.

In my opinion, as long as the mouse cursor stays within the area of the button, the button should trigger the on-click event.


๐ŸŒธ Sun, May 5, 2024 ๐ŸŒธ

Elon Musk was advocating for governmental regulation around AI development. I’m not sure what his current stance is. In general, I disagree. Even if he’s right about regulations, if we’re going to have them, they should be worldwide. Again, I want to emphasize that I disagree with regulations altogether.

So, imagine if regulatory laws are created by the US government. And remember, AI is not a toy; it’s a powerful tool. For example, it can influence people’s minds, spread misinformation and hate speech. If the development of AI is banned in the US, other countries can continue to develop AI and deploy AI systems to influence elections in the US, for example. Because AI is regulated in the US, the country wouldn’t have the tools to combat that sort of deployment.


๐ŸŒธ Sat, May 4, 2024 ๐ŸŒธ

I want to have an app that consolidates feeds from multiple microblogging platforms. X is fun, but sometimes it feels one-sided, with everyone praising Elon, dismissing white male privilege, and trolling woke people. At some point, I might get brainwashed. I need some other sources to cleanse my palate, but it takes more effort. If I had an app that allowed me to scroll through X, Threads, and Mastodon simultaneously, that would be great.


๐ŸŒธ Sat, May 4, 2024 ๐ŸŒธ

Use Git, Luke.


๐ŸŒธ Fri, May 3, 2024 ๐ŸŒธ

I have an idea for a game called “Backend Engineer.” The gameplay would be similar to a backrooms experience, but you’d get lost in a data center.


๐ŸŒธ Fri, May 3, 2024 ๐ŸŒธ

Another reminiscence of the early Windows days: We had a “hello world” example for Windows, and everybody was mocking that example for having an extremely heavy amount of boilerplate code. Question to Khronos: Why did you do the same thing to Vulkan?


๐ŸŒธ Fri, May 3, 2024 ๐ŸŒธ

Back in the mid-90s, I heard rumors that Microsoft was adding 3D capabilities to the Windows OS. Retrospectively, we know now that they were working on DirectX, but at that time, I did not understand the motivation behind it. It sparked my imagination; maybe Microsoft was going to make a 3D OS, and I pictured browsing files or the Internet in 3D. Since then, I have been dreaming of that OS.


Previous - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 30 - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 38 - 39 - 40 - 41 - 42 - 43 - 44 - 45 - 46 - 47 - 48 - 49 - 50 - 51 - 52 - 53 - 54 - 55 - Next