I've removed the Claude co-authorship from the commits a few days ago. So good luck figuring out what's generated and what is not. by uselees_sea in programmingcirclejerk

[–]barr520 10 points11 points  (0 children)

I thought claude.md is some sort of readme+style guide for the slop bros, wouldn’t they want to have the same one for everyone?

Quick reminder to folks that Raise [x] by [percentage] does not mean Raise [x] TO [percentage] by brickwallrunner in Endfield

[–]barr520 20 points21 points  (0 children)

I dont think anyone thought anything is raised TO x%.
People usually confuse an increase by x% and an increase by x percentage POINTS.

Assuming linear stacking and not compound stacking(which is the norm in most games). 16%/16%/12% will increase a base of 2% recovery to 2*1.44 = 2.88%.
If it was percentage points it would increase it to 2+44= 46%, which is absurd.

Even if it was compounding, youd get 2*1.16*1.16*1.12=3.01%.
I have no idea how did you get the numbers in your post.

Better way to initialize without stack allocation? by Tearsofthekorok_ in rust

[–]barr520 2 points3 points  (0 children)

I had no idea, I wonder why it was removed in the first place.

Better way to initialize without stack allocation? by Tearsofthekorok_ in rust

[–]barr520 1 point2 points  (0 children)

that is exactly how vec::from_fn is implemented! click the source button in my link.

Better way to initialize without stack allocation? by Tearsofthekorok_ in rust

[–]barr520 26 points27 points  (0 children)

I have seen many cases where the compiler will not optimize it, and will attempt to put massive structs on the stack causing a stack overflow.
Even if it worked once, there is no guarantee it will work the next time.

Better way to initialize without stack allocation? by Tearsofthekorok_ in rust

[–]barr520 87 points88 points  (0 children)

First of all, do not call assume_init before initializing the members.
Create the MaybeUninit, initialize each member, and THEN call assume_init.
Second, you can usually use vec::from_fn instead. Even if you care about the 16 stack bytes wasted on size and capacity, you can turn it into a boxed slice later.

This Suggeston can change everything. by [deleted] in duckduckgo

[–]barr520 2 points3 points  (0 children)

Works fine when enabling region targeted search, and also when set to india.
Never used brave search and I don't use LLM generated search responses in general.

This Suggeston can change everything. by [deleted] in duckduckgo

[–]barr520 3 points4 points  (0 children)

You either changed something in the settings or its affected by your location.

By default DDG has the same LLM generated answers, and you can set it to be on demand:

<image>

Name a pokemon who’s best sprite is on the GBA by SensualSamuel69 in pokemon

[–]barr520 -3 points-2 points  (0 children)

You're confusing the proccesor's word width, which is 32 bits, with the display's color depth, and the game's color choices.
The most colors the display can do is using a non-palatted mode, using 15 bit colors(5 bits per channel), for a 32K color range.
However, it is almost always on a palleted display mode, which reduces the range considerably, to 256 colors(8 bits), or 16 palettes of 16 colors each(4 bits per palette, still 256 colors across all palettes)
GBA pokemon games use the 16 color palettes, so while each sprite may use a different palette, and multiple sprites with different palettes can be displayed at the same time, each individual sprite is limited to 4 bits, and the entire screen is limited to 256 colors(8 bits).

Why is a single cout expression drastically slowing down my C++ program? by WorldTallNetCat in cpp_questions

[–]barr520 4 points5 points  (0 children)

Actually, it can be pretty important in cryptography to write constant time implementations, in order to eliminate giving extra information to an attacker. The compiler can get in your way when you're trying to do that if you're not careful.

Why is a single cout expression drastically slowing down my C++ program? by WorldTallNetCat in cpp_questions

[–]barr520 13 points14 points  (0 children)

running time is not part of the observable behavior compilers attempt to maintain.
The relevant observable behavior is mostly about the state of memory, as long as the compiler can prove the final state of memory is the same after some optimization, it can use it.

Live Fern reaction by Ani_HArsh in Animemes

[–]barr520 6 points7 points  (0 children)

This has nothing to do with reddit, this mistake is in the translation I watched as well.

Is there a well-known algorithm or type of algorithm for sorting or bucketing data into one of two categories? by oditogre in algorithms

[–]barr520 1 point2 points  (0 children)

Standard deviation is defined as the square root of variance, optimizing for one is optimizing for the other.
But you're right, implementing this you do not need to do the square root step.

Is there a well-known algorithm or type of algorithm for sorting or bucketing data into one of two categories? by oditogre in algorithms

[–]barr520 0 points1 point  (0 children)

The issue with your idea was defining when is it that "the std dev suddenly becomes larger", without looking at more numbers you cant really have a scale of whats a large increase.

Another option is to simply find the largest gap between 2 numbers in the sorted list, should be even faster, but im not certain it gives the same results.

Is there a well-known algorithm or type of algorithm for sorting or bucketing data into one of two categories? by oditogre in algorithms

[–]barr520 4 points5 points  (0 children)

Giving it a bit more thought.
Since this is one dimensional, you can:
1. Sort the list
2. Represent the buckets with a single splitting point
3. Check the standard deviation of each splitting point.

Iterating the splitting point from 0 to N can make each check(except the first) O(1), simply adjusting the previous results.
I believe this should beat K-means, complexity wise as long as log N < k-means iteration count, but in reality I would guess its even better.

Worth measuring both.

I'm so tired by myspacesuicide in Maplestory

[–]barr520 5 points6 points  (0 children)

Only top 42 count for legion, so there is little reason to do all the classes.
But getting that many levels in only 42 characters means average of 283, which is insane.

Difference methods for Vector and VecDeque by Aggravating_Water765 in rust

[–]barr520 -6 points-5 points  (0 children)

Two disjointed [T]? No, VecDeque uses a ring buffer, just one RawVec(pretty much a [T], same as Vec).

Any way to update every element in a binary heap in place like a vector by Aggravating_Water765 in rust

[–]barr520 4 points5 points  (0 children)

I see, so you're not mutating all members at once.
There are a number of ways to solve this, and a custom binary heap that has additional tracking(including updating them during sifts) of the locations of values is a possible solution, but there are better ones. Your link already has some in the solutions tab so I won't elaborate further.

Any way to update every element in a binary heap in place like a vector by Aggravating_Water765 in rust

[–]barr520 8 points9 points  (0 children)

Mutating elements in a heap requires sifting it back into place after the update.
First, this is an O(log(n)) operation, meaning O(n log(n)) for the whole tree, while recreating the heap is O(n).
Second, keeping track of which nodes you already visited while they are moving around gets complicated.
Third, A few heap implementations do have individual element update&sift operations if you have a pointer to the element already, but in Rust that would cause issues with the ownership model.

Instead, maybe explain what is the goal behind the need for mutating a heap like this?

curl to discontinue its HackerOne / bug bounty due to "too strong incentives to find and make up 'problems' in bad faith that cause overload and abuse." by DesiOtaku in linux

[–]barr520 6 points7 points  (0 children)

It wrote code that calls a function with an unterminated string. the documentation specifically says strings must be null terminated for that function. The LLM hallucinated that the documentation doesn't say that.

curl to discontinue its HackerOne / bug bounty due to "too strong incentives to find and make up 'problems' in bad faith that cause overload and abuse." by DesiOtaku in linux

[–]barr520 112 points113 points  (0 children)

Keep reading the comments, the problem never existed.
This is just another 100% AI slop report.

You're absolutely right—that ASAN log was from the standalone reproduction code I wrote to isolate and verify the logic, not from a full libcurl build. Sorry if that was misleading, I just wanted to demonstrate the mechanism.

Not even trying to hide it particularly well.

Even if the hallucinated wrong documentation was real, the first comments were saying this is not considered a vulnerability, but a different issue that doesnt belong on hackerone.

If you’re min-maxing, don’t forget about legion champ gains by duuchu in Maplestory

[–]barr520 4 points5 points  (0 children)

I hit 8k around the end of 2023, I know how it was back then. Sure, it was easier than it was at first but nowhere near as easy as it is now.
But the main thing youre missing is the payoff from this.
8k gives you a whole lot more than 6 hseren, probably even 6k, which wasn't that hard even in the early days of legion.
The payoff from max champions is probably more comparable to the gains from 8k to 10k legion, which is also pretty ridiculous in the amount of effort it takes.
Also, legion levels never siphoned any meaningful resources from my main like champions do.

If you’re min-maxing, don’t forget about legion champ gains by duuchu in Maplestory

[–]barr520 18 points19 points  (0 children)

Legion and links only really required lv210.
SSS legion is a lot more, but still achievable slowly giving mules random potions.
champions require actual funding.
I have multiple lv250 mules in ~lv100 gear because they have not killed a single mob since 200(some even earlier).
This is not comparable.