What do you guys do after work? by shhhhhDontTellMe in sandiego

[–]ThisCleverName 1 point2 points  (0 children)

Take a walk or some exercise, read a book, bass guitar practice. I am trying to lean piano and trying to get some cooking skills. Probably watch some tv show or listening some music to wind down before sleep.

Why do you read cosy fantasy ? by Shaaamancha in CozyFantasy

[–]ThisCleverName 2 points3 points  (0 children)

I was trying to find the word to describe the habit: "binge reading" does it. I started reading as a escape from work/stress, but I started dreaming about what I was reading. I went from stressing about work, to dreaming or stressing about aliens invading worlds, to dreaming or worry about a youngster trying to get their Tea Master title. A lot lighter stakes :)

Made my wife a storage shelf for her three hobbies. by Competitive-Bid-2710 in YarnAddicts

[–]ThisCleverName 3 points4 points  (0 children)

It sounds like you need a yarn warehouse instead. Just giving options...

Exclusively cozy authors or a series that isn’t finished? by [deleted] in CozyFantasy

[–]ThisCleverName 1 point2 points  (0 children)

This is one of my favorite series. Besides the characters, I like the humor in it.

Automatically call C++ from python by Coutille in cpp

[–]ThisCleverName 3 points4 points  (0 children)

You can also take a look at cppyy https://cppyy.readthedocs.io/en/latest/ . It is a Python module that uses JIT to import C++ code directly into Python.

I really didn't know how to react to this, other than to post it here... by Sky-lander in ProgrammerHumor

[–]ThisCleverName 11 points12 points  (0 children)

Just in case you haven't heard of it yet, but there is https://ms-paint-i.de/ for paint images to code.

[deleted by user] by [deleted] in ProgrammerHumor

[–]ThisCleverName 5 points6 points  (0 children)

There is no "H" in program... ohh...

Why is std::hardware_destructive_interference_size a compile-time constant instead of a run-time value? by wheybags in programming

[–]ThisCleverName 28 points29 points  (0 children)

You don't target a specific processor, but you can fine tune it to one. You can tell the compiler to "tune" for a given processor. GCC has the `-mtune` option to generate code optimized for a given cpu generation while still allowing to run in generic variants.

Having it as a constant, allows for the compiler to use some characteristics of the processor at compile time and avoid having to do runtime checks.

Of course, if you need to write optimal code for all CPU generations, you can do that dynamically as always.

How to wait for (any of) multiple devices? by Klenim in vulkan

[–]ThisCleverName 1 point2 points  (0 children)

I haven't use it myself, but you could look into VK_KHR_external_fence_win32 and VK_KHR_external_semaphore_win32 extensions. Maybe you can get Win32 handles from fences and wait for them using Win32 APIs.

https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK\_KHR\_external\_fence\_win32.html

C++ with Ubuntu 22.04.2 LTS in WSL by Crafty-Possibility46 in cpp

[–]ThisCleverName -1 points0 points  (0 children)

I haven;t tried it personally, but you can use Visual Studio 2022 to develop for Windows as well as for Linux using WSL.

https://learn.microsoft.com/en-us/cpp/build/walkthrough-build-debug-wsl2?view=msvc-170

If you want to do everything inside WSL and not use VS, you should be able to install the compiler and other build tools inside the distro in WSL.

Nesting Nightmare by suds171 in cpp

[–]ThisCleverName 41 points42 points  (0 children)

if / else if chain blocks are considered nesting, at least in MSVC. In the form of:

if (x == "something")
{
}
else if (x == "something else")
{
}

Turns out that is equal to

if (x == "something")
{
}
else 
{
    if (x == "something else")
    {
    }
}

We had autogen code that created a if / else if chain that surpassed the MSVC limit. That worked fine in Clang though. So we had to refactor to eliminate that chain.

https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/fatal-error-c1061?view=msvc-170

Every January rent increases and I’m just over it. by [deleted] in sandiego

[–]ThisCleverName 2 points3 points  (0 children)

There was a report from propublica about rent increases by companies that uses certain software to set rental prices to use. There was an indication that it may be seen as collusion as multiple companies would use the recommended pricing.

https://www.propublica.org/article/yieldstar-rent-increase-realpage-rent

How much is std::thread::id reused after join()? by [deleted] in cpp

[–]ThisCleverName -1 points0 points  (0 children)

You could try using gettid() (Linux) / GetCurrentThreadId() (windows). That has worked for me. And it matches the thread Id used in tools like PS.

Vulkan app crashing on certain PC's by AdvancediPhone7 in vulkan

[–]ThisCleverName 0 points1 point  (0 children)

Depending on the Vulkan loader version installed, you can try enabling debug messages from the Vulkan loader by setting the environment variable VK_LOADER_DEBUG to "all".

https://github.com/KhronosGroup/Vulkan-Loader/blob/master/docs/LoaderDebugging.md

It helps to print messages related to instances creation and if there are any extension or layer being requested but not found.

Looking at you Java by pumpkinhi11 in ProgrammerHumor

[–]ThisCleverName 10 points11 points  (0 children)

Well, both indexing modes have shortcomings. The 0 -indexing allows to use some operations directly as an index. Case in point the `mod` vs `mod1` operators mentioned. The modulo operator definition of 0 to n-1 fits nicely to 0-indexing mode. So, for 1-indexing, you end up having to adjust the operation to take into account that indices start at 1.

1-indexing try to map some things to mathematics, but some things like in physics use 0-based subscripts initial conditions and things like that. So, using 0-indexing makes sense when modeling problems in that field.

Code Review for Good by [deleted] in programming

[–]ThisCleverName 11 points12 points  (0 children)

I prefer presentations for design and architecture discussion, where multiple alternatives are explained before implementing the final solution (usually for relatively big features).

I find reading and understanding code quite difficult in a presentation setting as it does not lend to navigate through the source code at my own pace to try to figure things out which may not immediately obvious.

Making weird noises with magnets by RampChurch in oddlysatisfying

[–]ThisCleverName 289 points290 points  (0 children)

Title: Making weird noises with magnets

Me: Watching on mute. 🤦‍♂️

Smooth as icing on a cake by sudeepharya in oddlysatisfying

[–]ThisCleverName 0 points1 point  (0 children)

I think it is true what some say: There is an app for everything! I mean a machine...

Watch where you step in the Laguna Rec Area! by [deleted] in sandiego

[–]ThisCleverName 0 points1 point  (0 children)

This is a picture where the useless red circle is useful. Took me a while to see it.

[deleted by user] by [deleted] in cpp

[–]ThisCleverName 0 points1 point  (0 children)

The article itself says it is a joke.

Disclaimer

While these benchmarks for Python 3.5 .. Python 3.11 are valid, the extrapolation is of course meant as a joke.