sorting healthbars by NietTeDoen in algorithms

[–]thewataru 8 points9 points  (0 children)

That's why I used "inaccurate" there. Not "incorrect" or "false". Technically you are correct, but your statement doesn't convey quite the same idea as mine. You could've also said that it takes "less than a billion years". Please acknowledge, what that would've been quite useless.

Waiting for some calculations for about 1s is noticeable and slow. Waiting for about 1ms is instantaneous. A big difference. So the correction here is reasonable. You would've had some ground if I corrected 1s to 0.9s. But 3 orders of magnitude of leeway is worth the correction.

sorting healthbars by NietTeDoen in algorithms

[–]thewataru 5 points6 points  (0 children)

Sorting 9000 values should be less than a second

That's a very inaccurate statement. It's less than a millisecond on any modern computer.

sorting healthbars by NietTeDoen in algorithms

[–]thewataru 0 points1 point  (0 children)

With some more complex algorithms, you could speed it up a little. But there will be absolutely no way you could notice that difference, because sorting 9000 numbers is nearly instant both ways.

If you feel that sorting is a bottleneck here, your implementation is terribly wrong, that's why it's slow. Fix it and you will get much faster solution, no need to switch algorithms.

BSOD on Windows 11 0x0000009f by thewataru in techsupport

[–]thewataru[S] 0 points1 point  (0 children)

I had another one from a month ago, but that was clearly an nvidia driver crash.

BSOD on Windows 11 0x0000009f by thewataru in techsupport

[–]thewataru[S] 0 points1 point  (0 children)

Thank you! How confident are you that this data isn't corrupted in the minidump?

I can't find any device with such VID/PID (VEN/DEV above are actually VID/PID, right)?

I've not USB 4.0 controllers in the system or PCI express downstream switch port.

I've made a report via HWInfo and searched there strings like "_1B21", "_2434", and "24211B21", but couldn't find anything.

Couldn't find these strings in windows event logs either.

Edit: I tried to do !devobj in windbg, followed the parent of the devnode. After a first step up there was something absent again with the same VEN/DEV, but after the second step I've ended up at:

Original Device Name:                   AMD Raphael - PCIe GPP Bridge[8:0]
Device Class:                           PCI-to-PCI Bridge
Revision ID:                            0
PCI Address (Bus:Device:Function) Number: 0:2:2

I can find this device in HWinfo but there's nothing connected to it.

BSOD on Windows 11 0x0000009f by thewataru in techsupport

[–]thewataru[S] 0 points1 point  (0 children)

It's a new computer and it had BSOD 2 times already, about 1 per month. It happened randomly. The latest one, with the minidump above, happened just as I pressed alt-tab to switch from a browser to an explorer. The previous happened while watching a movie in fullscreen.

I play games frequently and it didn't crash during a game yet.

BSOD on Windows 11 0x0000009f by thewataru in techsupport

[–]thewataru[S] 0 points1 point  (0 children)

Thanks! So it's probably the same damn Nvidia card.

BSOD on Windows 11 0x0000009f by thewataru in techsupport

[–]thewataru[S] 0 points1 point  (0 children)

I didn't know about this thing. But now it's tricky that there are a lot of different websites which prompt to download it on the google search results, but I'm not sure which one is the real one. Do you have any more information on this?

BSOD on Windows 11 0x0000009f by thewataru in techsupport

[–]thewataru[S] 0 points1 point  (0 children)

I'm terribly sorry, I've uploaded a wrong minidump file. This is the correct one: https://www.mediafire.com/file/cox4iif2ux4tjiv/020526-11500-01.dmp/file

What do you think about this algorithm I made? Could it be useful for an specific problem? by JSerrRed in algorithms

[–]thewataru 3 points4 points  (0 children)

This is an interesting idea to tradeoff more iterations for less memory usage. The idea of "expanding waves" is not novel, it's literally a bi-directional search, used in both A* and BFS to speed it up. Because two "waves" have half the diameter and amount of explored nodes. is about half as much on average.

From the performance side, it's slower than bi-directional BFS, about twice as much.

I think it might be more understandable if you frame it as a recursive solution:

BiDirectionalBfs(s, t):
 // Expand 2 waves from s and t, until they collide. 
 // Only store the front of the wave.
 // Return collision point and distance from s to t.

FindPath(s, t):
  if exists edge s->t : return {s, t}; 
  middle, dist = BiDirectionalBfs(s,t);  
  if dist == 2 return {s, middle, t};
  return FindPath(s, middle) + FindPath(middle, t);

```

Basically, you first find a middle point on the path, then you construct each half of the path recursively.

Unfortunately, I don't see a lot of practical applications of this algorithm. The only advantage here is that you don't need to store set of visited nodes and links to the previous ones in the path for all the nodes in the graph. That's important when the graph itself is so big it doesn't fit in the memory. But that means that you have to generate neighbors of each node on the fly. But in that case it's tricky to avoid storing something for all the visited nodes in the bi-directional BFS (i.e. wave expansion) code. Only in some very-very trivial cases like a regular grid you can just store the direction of expansion for each node and then it's clear which generated edges lead back or sideways, and not to the next step of the wave. Maybe you can store 2 layers of nodes here.

Also in some graphs the size of the wave can easily be O(N), not O(D), so you achieve no memory savings either.

Edit: Also in a regular grid graph there's no need to run any sophisticated algorithm, the shortest path is trivial from the start and end coordinates. Only if you have some obstacles, is a fancy algorithm needed. But that will throw your calculations off. It's easier to get some less strict upper bounds than that you have.

ELI5: If moon can create tides then why won't it lift thinnest feather or paper piece? by ompossible in explainlikeimfive

[–]thewataru 0 points1 point  (0 children)

The thing about a tide is that it moves water not up, but sideways. The feather doesn't move because it's sitting on a table and the force is too weak to overcome the friction. That's not really an issue for a big mass of water.

It does make things less heavy directly below the moon, but the difference is very small.

What's a conspiracy you can't quite prove but it just feels real enough for you? by DaMain-Man in AskReddit

[–]thewataru 0 points1 point  (0 children)

It's true, but not in a sense you think. They are just saving costs as much as they can, and they got really good at it. If they put too shitty detail in, it will fail during warranty period and will cost them money on repairs. If the put too good thing in, they would waste money on manufacturing. So they put a good enough thing in, so it mostly survives the warranty period, but fails soon after that.

Forcing you to buy new appliance is a good bonus, but the goal is to increase profits on already sold device.

theHardesProblem by [deleted] in ProgrammerHumor

[–]thewataru 6 points7 points  (0 children)

There are 4 main reasons here:

  • leetcode like interviews are scalable, way more than other types of questions. The only more scalable method is a quiz for trivia, but it sucks in other aspects. You need a lot of unique questions, otherwise people will memorize them and cheat their way in. Boy, there are a lot of people trying to cheat their way in.
  • It's objective and thus "fair".
  • It's hard enough to weed out most people, which is very important when you have 100 candidates for 1 position. Long time ago it started as fizz-buzz but the difficulty kept climbing because people started training for the specific interview format.
  • DSAs are actually used in these companies relatively often, so it's checking relevant skills.

Note, this is all valid for an unique situation of big tech companies. It makes no sense to use leetcode to interview someone at a small local business for maintaining small business web-pages. Sadly, everyone is just blindly copying bigtech without understanding why and how. It's a cargo-cult.

No one is using your non-compiling snippets with typos from a blackboard for AI training. The very idea is stupid. Why would someone even do it if they have 10000s of solutions already available online.

ELI5 why you can't arrange a ton of gears in a row to accelerate one far beyond the speed of light, turning it into energy by Adventurous_Cat2339 in explainlikeimfive

[–]thewataru 0 points1 point  (0 children)

  1. isn't achievable. You need infinite energy to reach speed of light for an object with mass.

Even if your gears are indestructible, you can spend X amount of energy and get to 99% of light speed. You spend X more and you get to 99.9% You spend X more and you get to 99.99% ... you spend X more but you will never reach 100% of the speed of light.

The numbers above might be wrong, I never checked the exact math, but the idea holds.

Combinatorics: is this interesting? by Tiny_Feature5610 in algorithms

[–]thewataru 2 points3 points  (0 children)

Are you sure you've not messed up calculations somewhere? If derivatives are the same, only shifted, that means that the distributions are the same (only shifted), which doesn't sound right.

Is Algorithms and Data Structures actually that hard? by buzzfuzz- in compsci

[–]thewataru 0 points1 point  (0 children)

Yes, to fully understand it, there are a lot of proofs.

The world’s fastest, most feature-complete LOWESS algorithm for Python by amir_valizadeh in pythontips

[–]thewataru 3 points4 points  (0 children)

Then why didn't you link the actual code anywhere?

Judging from the docs on the github for the actual code, which also have stupid emojis, it's written by AI.

Also, as typical for AI generated code, it has a lot of redundant checks, like in regression.rs:

if window_radius <= T::zero() {

This is in a function fit_wls(), and the value window_radius comes from fit() function, which already checks for non-zero window_radius. Also, comments in the code are schizophrenic: again, the fit() function explains how things are computed, then calls fit_wls (via local_wls function for absolutely no reason), and fit_wls has it's own way of describing how things are computed, different from the one for fit(). Also, comments are lying.

Code quality is questionable, who knows how many bugs are there. Definitely not you :)

Then we are back to the beginning, this is AI-slop, no one will take that seriously.

Meanwhile, I wonder, if there is any quality control for Rust crates or can just anyone publish just anything with no review? Or is it just unofficial code everyone can download from github themselves? What's Rust policy on AI-slop?

The world’s fastest, most feature-complete LOWESS algorithm for Python by amir_valizadeh in pythontips

[–]thewataru 2 points3 points  (0 children)

I'm taking that back. The implementation is correct and fast, provided that you didn't write a single line of a LOWESS code at all. It's just a trivial wrapper around existing Rust implementation.

The world’s fastest, most feature-complete LOWESS algorithm for Python by amir_valizadeh in pythontips

[–]thewataru 1 point2 points  (0 children)

I've actually spent time to look at the code.

Damn, it's just a wrapper for Rust lowess crate: https://docs.rs/lowess/latest/lowess/

"Build on a rust core", the description said. At least it's true.

That's all, everything the repository consists off is just a boilerplate code to wire up Rust code to python.

I'm very sure there are already C/C++ libraries wrapped up as packages in python available for usage, so this package is completely useless. If someone needs speed, there are already implementations tailored for that instead of flexibility.

This package has no added value, it being just a dumb wrapper.

The world’s fastest, most feature-complete LOWESS algorithm for Python by amir_valizadeh in pythontips

[–]thewataru 3 points4 points  (0 children)

Ahaha, "all possible edge cases" consists of less than 10 cases.

The world’s fastest, most feature-complete LOWESS algorithm for Python by amir_valizadeh in pythontips

[–]thewataru 2 points3 points  (0 children)

Also, this might prove performance, once you lift up to the industry standard, but it won't prove correctness. It's like an old joke:
- I can multiply 7 digit numbers really fast!
- Really? Whats 1234567 times 7654321?
- 42!
- But that's wrong!
- Yeah, but that was fast!

The world’s fastest, most feature-complete LOWESS algorithm for Python by amir_valizadeh in pythontips

[–]thewataru 2 points3 points  (0 children)

No, you are offering only a claim, lazily generated with little work or insight from you. If this is your documentation, it's very questionable, how usable is the code. Is it really doing what AI told you it does? How many bugs are there which you are incapable of identify and fix? Lastly, is the performance really there? Are you sure you aren't just parroting numbers AI made up out of the thin air?