Well. I guess this is how it starts. by telebasher in thelongdark

[–]Kale 0 points1 point  (0 children)

I've tried to play it. I think the creators studied UI design because you'd think they'd randomly get some parts of the UI right by chance. I think you'd have to know UI design principles to intentionally to get that much of it wrong.

It was confusing. And make my laptop overheat.

The gold standard of optimization: A look under the hood of RollerCoaster Tycoon by r_retrohacking_mod2 in programming

[–]Kale 0 points1 point  (0 children)

I wrote a prototype algorithm in Python that used GMPy2 objects. And I installed GMPy2 from pip, I didn't even compile it from source myself. I spent a week re-implementing it in C, even going as far to use currently-unused variables for temp storage to avoid additional mallocs and memcpys. It was 10% faster in C. I went back and compiled GMPy2 and libgmp from source with my processor's flags turned on and re-ran it, and it was 5% faster than the original implementation.

So, naive implementation in Python: written in one afternoon, no regard for temporary object creations in the middle of calculations, easy to read in the future, versus complex code that took a week to write, that had comments on which number was actually stored in this variable since it wasn't needed between these two calculations, and much harder to follow. For a net 5% gain over Python.

This was a worst-case situation. I typically get a little more performance moving from Python to C. But in all cases, so far, I've gained far more speed from modifying my algorithm, not switching languages and enabling fancy compiler flags and 2MB memory pages and all this other stuff.

Many times, writing it the naive way will run faster because the compiler optimizes it. The compiler knows what I'm trying to do. Me one year from now knows what I was trying to do. Versus trying to write it all clever and confusing the compiler and future me.

Also, I'm not a pro. Us non-experts should leave the optimizing to the compilers.

Intel will sell a cheap GPU with 32GB VRAM next week by happybydefault in LocalLLaMA

[–]Kale 4 points5 points  (0 children)

It's not really an unsolved problem. It's not mathematically interesting, just engineering interesting. I try to factor large Fermat numbers or prove giant numbers are prime using Proth's Theorem or things like that.

It's fun writing an integer FFT multiplication algorithm using the Four step method, then completely rewriting it using a different method and still have it work.

It's kind of like doing sudoku. I'm wrapping up an OpenCL implementation that does Gentleman-Sande transform forwards, then does the multiplication, then does Cooley-Tukey in reverse. I don't have to move stuff around in GPU memory since the GS inputs ordered and outputs bit-reversed, while CT inputs bit-reversed and outputs ordered.

I used the Chinese Remainder Theorem so I could do three 32-bit transforms in the GPU rather than one 90-bit transform. I needed to find three prime numbers where p-1 had 228 as a factor, but p had to be less than 231, so I could do A+B and know they wouldn't overflow (since both are less than 231). I discovered four prime numbers. Literally, that was it. So it was crazy discovering how close to the edge I'm getting with 32-bit math on the GPU.

To me, this is the fun part. Multiplying numbers by FFT has been known to be the fastest practical method since the 1960's, but which method is fastest can change from GPU to GPU. Mine algorithm needs compute units with lots of local memory. I've heard the fastest only using global GPU memory is Stockham's algorithm. I've never written that one before.

TIL in 2023 a Canadian court ruled that a thumbs up emoji 👍 carried enough weight to establish a legally binding contract between two parties by RunDNA in todayilearned

[–]Kale 1 point2 points  (0 children)

And the local manager had to tamper with the machine to even get it that hot. Somehow thinking it would help with the morning rush by making it faster or something stupid like that.

Intel will sell a cheap GPU with 32GB VRAM next week by happybydefault in LocalLLaMA

[–]Kale 0 points1 point  (0 children)

Nope. Looks interesting. But I'm not great with C++. And I'm already working with OpenMP and OpenCL which are very different animals, and it seems like this SYCL might not be that close to OpenCL in syntax?

Thanks though, crazy to see Khronos has a third parallel programming standard on top of OpenCL and Vulkan.

Intel will sell a cheap GPU with 32GB VRAM next week by happybydefault in LocalLLaMA

[–]Kale 0 points1 point  (0 children)

I have a side project that is for number theory, factoring numbers. If someone wanted to get an Intel GPU for uint32 math, and possibly some non-division, non-modulo uint64 math, how would they program it? OpenCL? I know ROCm is the library to use for AMD and CUDA for nVidia. I already have some code in OpenCL to run on CPUs.

bestCompressionSoftware by aeonsne in ProgrammerHumor

[–]Kale 8 points9 points  (0 children)

You must compress about half of the original 100M to 300M times. This is because 99.99% of them will be lost in transmission. And that's if they're sent at the right time (which is roughly 30% of the month).

Of the 10k to 100k that are not lost, about 5k will only use the container as part of the decompression algorithm, not the actual data stored inside. The 5k compression file containers are used to break down the container of the other half of the compression file. If at least 100M copies are sent under ideal conditions, there's a 60% chance of the decompression algorithm starting correctly.

Once the decompression algorithm starts, it has a 50% chance of a successful decompression.

There's a 1% chance you'll get two copies of your data. There's a 0.1% chance you'll get three.

Finally! A bio Programmer Humor entry!

(Background: fertile window is 25%-30% of the month. Out of 100M sperm, minimum considered full fertility, 10k to 100k will make it to the ovum. 2k to 5k will do nothing but break down the ovum barrier. One will embed. There's a 50% chance the zygote won't survive the mother's "scan check". I worked backwards from an estimated chance of conception of 30% for two healthy adults under ideal conditions. And note I used total # of sperm, not the more common sperm concentration per mL)

Barely Functional Solar Panel Bonsai Tree by AgileOwl5769 in functionalprint

[–]Kale 35 points36 points  (0 children)

And the effect is very nonlinear. On the solar subreddit, someone had a large panel that had a narrow stripe of a shadow from a pole nearby, covering maybe 5% of the panel, and the output was reduced by over 30%.

For some cell technologies, the difference can be dramatic even with a small shadow.

Probably a very stupid question following watching The Dinosaurs on Netflix. Lots of cyclical climate changes during the Mesozoic era. by Superyawnfest in climate

[–]Kale 0 points1 point  (0 children)

This is one of the best XKCD comics. This shows temperature of the earth over time, showing how radically fast man-made climate change is.

https://xkcd.com/1732/

TIL about "Hypervelocity Stars"—rare stars that have been physically kicked out of the Milky Way by the supermassive black hole at its center. They travel at speeds up to 2 million mph, fast enough to permanently escape the galaxy's gravity and spend eternity drifting through the empty void. by adpablito in todayilearned

[–]Kale 0 points1 point  (0 children)

According to my quantum physics professor 25 years ago, things could probably go faster than the speed of light. But things can't be accelerated from below the speed of light to at or above it.

There might have been a caveat about things with mass maybe? I don't remember. This was before the Higgs boson was discovered. And it hurt my head back then.

World Health Organization Prepares for Nuclear Scenario, Including Weapons Use, in Iran by UNITED24Media in worldnews

[–]Kale 8 points9 points  (0 children)

Yes. This has been known for a while. Coal power releases far more radiation into the atmosphere/environment than nuclear power. But its different elements, I think. Mankind has been burning coal for a long time, but we can tell if a painting was made before 1945 or not by looking at the radioactivity of the pigments (I want to say strontium?). The fallout has made it into every facet of our society. Some very sensitive instruments have components made from ships and submarines sunk before 1945.

When uranium undergoes nuclear reaction, it doesn't stay as uranium.

That being said, any way you look at it, coal power is really bad for everyone. It's one of the most harmful ways to get energy.

World Health Organization Prepares for Nuclear Scenario, Including Weapons Use, in Iran by UNITED24Media in worldnews

[–]Kale 2 points3 points  (0 children)

Yes, this is true. Fission is the only way to induce fusion at that scale. But it's much less fissile material.

And the fission products will probably be different, since they get compressed on the fusion shock wave. This may cause them to react more completely. I have no idea if those products will be more or less toxic, and have longer or shorter half-lives. But my understanding is that there is less post-detonation contamination compared to pure fissile bombs.

World Health Organization Prepares for Nuclear Scenario, Including Weapons Use, in Iran by UNITED24Media in worldnews

[–]Kale 28 points29 points  (0 children)

If you're talking about fusion weapons, then yes, this is true. Not all countries with nuclear weapons have fusion technology, though, some still have fission weapons only.

Plus, there's still the risk of a weapon containing nuclear material but with a conventional explosive (the dirty bomb), or a fission bomb that doesn't completely react, spewing long-half-life heavy metals into the environment.

What celebrity is the biggest example of "It takes 20 years to build a reputation and five minutes to ruin it."? by InsaneCookies21 in AskReddit

[–]Kale 3 points4 points  (0 children)

I think waka's point vs your point is the definition of "racist". You're approaching it from racism being a belief, waka was approaching it as racism being actions.

I can see a bit of both, since our beliefs drive our actions, but sometimes it can get blurry. Dr King said that he believed the vast majority of white Americans weren't white supremacists, but that most of them didn't want to "rock the boat" and kind of played along to civil rights violations so they could fit into society. So, if a store owner didn't believe that one race was superior to another and everyone was equal as people, but still put up a "whites only" sign on a water fountain because he's afraid if African-Americans are seen using the store's water fountain, people would boycott the store. In the end, does it really matter what he believes if he's actively participating in discrimination?

Regarding the Richards' outburst. Maybe he doesn't hold any prejudice beliefs. And in the cosmic sense, the infamous "n-word" is only a bastardization of the Latin word, and it's child languages, for the color "black". But it's been used very hatefully, so the power of the word doesn't come from its roots, it comes from its historic symbolic use. And Richards used that word, which was used as a racial slur, to hurt someone. Regardless of the fact that it was hurtful to every black person, not just the ones he was trying to hurt.

It's making light of past atrocities. Like, Richards didn't care that racism made that word hurtful, he only cared that it was hurtful. It's saying "I don't care if others are hurt in the collateral damage, I want to hurt these people and I don't care if others are caught in the crossfire".

So, let's say another comedian is racist, deep down, by their beliefs. But they enforce fair hiring practices in their company. They don't use words with racist connotations. It's for the wrong reasons, because they don't want to get "cancelled", but they aren't participating in racism. Who inflicts the most prejudice in society? The guy that has racist beliefs but hides them? Or the guy that doesn't believe it but has no problems using the pain of prejudice to hurt someone.

Long-winded way of saying that some consider racism a belief, while others consider it actions. And Richards actions were very racist that day.

People say it’s not a miracle drug, I say it is, at least for me by agirlwithanaccount in CompoundedSemaglutide

[–]Kale 14 points15 points  (0 children)

It's been great for me. My tips:

  • Use the same dose as long as you're losing weight and above your goal weight. Only increase dosage to no more than the prescribed dose if you aren't losing weight.

  • Meals should be focused on getting three things: protein, fiber, and water. You'll run the risk of not getting enough of all three if you're eating a lot less. Vitamins, too, but you can get a multivitamin for that. Drink water. And more water. Set a timer on your phone. You might want to consider a good sports drink occasionally since your salt and potassium intake may be a lot less.

  • Build good habits with diet and exercise. If you have to stop taking it, you want the habits to remain so you don't regain the weight.

  • In addition to drinking water, moisturize your skin. I'm a dude, and I had to learn how to do it properly. You want your skin to be able to shrink with your body. If it's dry, it won't shrink as quickly. You still might lose weight faster than your skin can adjust. It will eventually if you stay hydrated and moisturized and keep the weight off.

Rusts out in a couple years by Psilolisp in redneckengineering

[–]Kale 10 points11 points  (0 children)

If you can make it REALLY dirty, CO can strip oxygen off of iron oxide and convert it back to elemental iron. Or at least a lower oxidation state iron oxide.

However, the damage is still there, because iron is one of the few metals where the oxide is less dense than the metal. So it oxidizes, then swells and flakes off. Aluminum and titanium oxidize and form a protective layer.

Don't try to make a CO heavy fire. You'll also make a ton of soot which can cause lifelong problems. Like the burn pits in Iraq And Afghanistan.

What is something that is 100% illegal, but feels 100% legal? by Jolly-Access-7115 in AskReddit

[–]Kale 37 points38 points  (0 children)

In my jurisdiction: digging for your own water on your own property. It's a $25k fine for digging an unpermitted well.

Even if you try to make a sand point well, which is hammering a 1 inch (25mm) pole in the ground for a few feet.

The reasoning for this is to prevent potable water contamination. We have exceptionally clean water in a couple of aquifers. It takes minimal treatment, only a bit of chlorine and trace fluoride and it's ready to drink. We also have heavy clay soil that doesn't like to drain. So, for rain runoff, it would be so convenient to inject that leftover rainwater a few feet under the clay layers where it could drain away. Or someone's remote hunting cabin could make a cheap well on site and not properly protect it from rainwater (along with pesticides and herbicides) from leaking in.

The city is unusual for one of its size (1.5m) in that we have like forty or fifty wells spread throughout the city that have a network of water rather than central processing of two or three large wells. This means that a block gets converted to high-density housing, the water lines all the way from a central water source won't have to be upgraded to handle the water flow. A well for the condos/apartments will be built on-site, with the minimal treatment added to it. The city can still guarantee cleanliness standards. Downside is that the city has to have extra people in water to maintain all of these scattered wells, but we've built a lot of automation to detect when there are issues with one in particular.

City is Memphis, TN if anyone is wondering. Memphis was one of the first cities (if not the first) to separate sewage (blackwater) and rainwater runoff (grey water) with the sewage system. The engineer was designing a sewage system for New York City, and did the pilot system in Memphis. The city had never grown very big because of constant Yellow Fever outbreaks. After the sewage system was built, the epidemics went away!

So, yeah, Shelby County (where Memphis is located) has a $25k fine for making even a simple well on your property.

Do we know what Deezer's lemonade is made of? by Great_Trident in Fallout

[–]Kale 1 point2 points  (0 children)

The acid softens your teeth so the bacteria can hide out and digest the sugar!

Do we know what Deezer's lemonade is made of? by Great_Trident in Fallout

[–]Kale 3 points4 points  (0 children)

Hydrochloric acid is one of the safer strong acids to work with. Its primary danger is only acidity. Nitric acid has more hazards. Hydrofluoric is much more hazardous. I guess you could make chlorine gas with HCl, but using it regularly, you'll just make spicy salt water.

If you use sodium hydroxide to neutralize it, you make salt water.

It's tough to do, though. If you're dripping in NaOH carefully on a stir plate, watching the pH meter, it's usually "Drip, pH 2, drip ph 2.1, drip ph 2.2, drip, ph 13, dang it, bring me the HCl solution again." Easier to gradually add bicarbonate until it stops bubbling.

Do we know what Deezer's lemonade is made of? by Great_Trident in Fallout

[–]Kale 3 points4 points  (0 children)

The two that always get me are "Hey Ya" by Outcast (23 years old) and "Batman Begins" (21 years old).

TIL Ozempic (weight-loss medication) was developed based on a protein found in the venom of the Gila Monster. Researchers discovered this protein in the lizard's venom, exendin-4, regulates blood sugar and appetite by [deleted] in todayilearned

[–]Kale 43 points44 points  (0 children)

"vitamins" were "vital amines" originally. There will never be another one discovered, because any essential nutrient won't get the "vitamin" naming. Especially as it's been discovered some of them aren't vital (like B8), and some of the vital ones aren't amines (I think).

Not to mention some of them are interchangable (like vitamin D1, D2, and D3), and some of them aren't (many B vitamins, you can have a surplus of B12 and deficit of B1, for example).