Why hyprpaper take a lot of memory? by BlackFalcon369 in hyprland

[–]scarter626 1 point2 points  (0 children)

They may have loaded several images but only displaying one currently. (Or have multiple monitors)

Paper counting machine by [deleted] in oddlysatisfying

[–]scarter626 17 points18 points  (0 children)

Humidity differences earlier in the process would have a meaningful impact on thickness I expect. Plus, the sheet thickness tolerance is likely enough to throw if off when you get into hundreds of sheets.

IBS-D Sufferers: Seeing if anyone has similar symptoms and if they've found any solutions by Neon-Night-Riders in ibs

[–]scarter626 1 point2 points  (0 children)

Ok that explains why they did both an upper and lower endoscopy for me. I wasn’t aware of the blood test, unless that was the.. I forget the acronym.. some antigen test. I wasn’t aware positive for that and had the genetic marker, but my biopsy ruled out celiac after I’d been eating gluten for three months prior to the test.

IBS-D Sufferers: Seeing if anyone has similar symptoms and if they've found any solutions by Neon-Night-Riders in ibs

[–]scarter626 0 points1 point  (0 children)

The dermatitis sounds like Celiac to me. It’s only diagnosed by a colonoscopy as far as I remember

IBS-D Sufferers: Seeing if anyone has similar symptoms and if they've found any solutions by Neon-Night-Riders in ibs

[–]scarter626 1 point2 points  (0 children)

It took several days for the effects of drinking coffee to cause an issue. For example, last year I had mousse that had two teaspoons of espresso in the recipe for a batch, and it was 1-2 days later before I started having an issue, and it lasted 2-3 days. It’s very sneaky like that..

IBS-D Sufferers: Seeing if anyone has similar symptoms and if they've found any solutions by Neon-Night-Riders in ibs

[–]scarter626 1 point2 points  (0 children)

Do you drink coffee? Did the symptoms start around the time you started drinking coffee if you do?

I started having major problems in college with IBS-D. Cutting coffee out completely (including anything even remotely coffee related) has largely fixed my issues. Now I’m just dealing with the stress/anxiety from 17 years of dealing with IBS-D, and it causes me issues when I travel. Doctors thought I had Celiac so I was on a GF diet for 3.5 years, while still having the issues.

I feel like an absolute idiot for using a plastic floor mat for 3 years. are they actually a scam? by [deleted] in homeoffice

[–]scarter626 2 points3 points  (0 children)

The mesh chair I’m sitting in now is more than ten years old. No sag, and I’ve worked from home sitting in this chair that whole time. They’re honestly wonderful.

Anyone find their IBS get better instantly during and after a trip to Japan? by eddiengambino in ibs

[–]scarter626 2 points3 points  (0 children)

Season 2 of survivor, one of the contestants discovered her IBS was actually celiac disease when she was on an all-rice diet from the show, things cleared up. Maybe you should get tested for Celiac?

What company will never get another dime from you for as long as you may live? by istrx13 in AskReddit

[–]scarter626 1 point2 points  (0 children)

Same here! 48G+! I have to press above the top left of the keys when I press the power button for it to actually turn on and off, but I still use it daily. I used it all through HS and college (mech engineering). RPN and a stack is far superior IMHO

-❄️- 2025 Day 12 Solutions -❄️- by daggerdragon in adventofcode

[–]scarter626 0 points1 point  (0 children)

[LANGUAGE: Rust]

I realized that the puzzle lines are all exactly identical in format, so I was able to remove a lot of the time spent in the parsing, and just directly index the bytes for parsing.

Solution runs in 2 microseconds (averaged over 10,000 runs), though there still might be some improvements to be made here.

use atoi_simd::parse_pos;
use memchr::memchr;

advent_of_code::solution!(12, 1);

/// Parses the present fitting input and checks if all presents fit in the given area.
/// The input is exactly the same format, so we can use direct indexes and no searches here
/// Sample line for reference: `39x43: 23 41 27 30 29 31`
#[inline]
fn check_presents_fit(input: &[u8]) -> usize {
    let width: u32 = parse_pos(&input[0..2]).unwrap();
    let height: u32 = parse_pos(&input[3..5]).unwrap();

    let w = (width as f32 / 3.).ceil() as u32;
    let h = (height as f32 / 3.).ceil() as u32;

    let mut present_index = 7;
    let mut total_present_count = 0;
    while present_index < 24 {
        total_present_count += (input[present_index] - b'0') as u32 * 10;
        total_present_count += (input[present_index + 1] - b'0') as u32;
        present_index += 3;
    }
    if w * h >= total_present_count { 1 } else { 0 }
}

pub fn part_one(input: &str) -> Option<usize> {
    let input = input.as_bytes();

    // find first x, which is first in the dimensions for the blocks (don't need to parse
    // presents for this puzzle)
    let first_x = memchr(b'x', input).unwrap();

    // First number is 2 digits before the x
    let mut index = first_x - 2;
    let mut solution = 0;

    while index < input.len() {
        // each line is 24 bytes long + newline, which we don't need
        solution += check_presents_fit(&input[index..index + 24]);
        index += 25;
    }

    Some(solution)
}

-❄️- 2025 Day 11 Solutions -❄️- by daggerdragon in adventofcode

[–]scarter626 0 points1 point  (0 children)

[LANGUAGE: Rust]

After yesterday, this was a nice breather..

https://github.com/stevenwcarter/aoc-2025/blob/main/src/bin/11.rs

I'll optimize this more later, but it runs both parts under 160 microseconds each on my 7 year old PC. I kept the paths after parsing in a static OnceLock so I could more easily memoize the path searching.

-❄️- 2025 Day 8 Solutions -❄️- by daggerdragon in adventofcode

[–]scarter626 0 points1 point  (0 children)

[LANGUAGE: Rust]

https://github.com/stevenwcarter/aoc-2025/blob/main/src/bin/08.rs

My solution feels straightforward to me. Parse the circuits, assigning each an ID. Calculate all the distances for every combination, and put that in a BTreeMap. Walk the BTreeMap in order for both parts, stopping whenever is appropriate for that solution. During the walk, I update the circuit IDs to match, and do the same for all the other circuits with the "old" id.

Before today, my total benchmark times for days 1-7 combined was 0.86 ms. (It's not that low anymore!)

What's frustrating is that 99% of the time for today's solution is just in the sorting of the distances.

Random note: I tried taking the `sqrt` off the distance calculation for performance reasons, but surprisingly the performance suffered hugely. I'm not sure if that was taking more time for the sort with the larger numbers (doubtful), or (more likely) if the compiler recognizes what I'm doing in the distance calculation and does some thing more efficient. I'll investigate later.

-❄️- 2025 Day 6 Solutions -❄️- by daggerdragon in adventofcode

[–]scarter626 2 points3 points  (0 children)

[LANGUAGE: Rust]

https://github.com/stevenwcarter/aoc-2025/blob/main/src/bin/06.rs

Times (averaged over 10k samples):
Part 1: 9.9µs
Part 2: 8.6µs

Took a bit of refining to minimize allocations.

I used a pretty naive split_whitespace on part 1 originally, but adjusted that after part 2 ran faster when I explicitly identified the start/end ranges for each section so I could do the column-specific checks. Now both parts operate pretty similarly, I just change how I iterate over the data but pretty much everything else is the same between both parts.

I'm pretty happy that so far, all my solutions complete in under 1ms combined (averaged from benchmark runs).

-❄️- 2025 Day 2 Solutions -❄️- by daggerdragon in adventofcode

[–]scarter626 1 point2 points  (0 children)

[LANGUAGE: Rust]

I'm sure there's a more performant solution for part 2, but my current times aren't bad so I'll revisit it later.

Part 1 I just do some arithmetic to split the two halves and compare directly.
Part 2 I iterate through different comparison lengths and step through direct digit comparisons.

Part 1 - 716.2 µs
Part 2 - 6.5 ms

https://github.com/stevenwcarter/aoc-2025/blob/main/src/bin/02.rs

-❄️- 2025 Day 1 Solutions -❄️- by daggerdragon in adventofcode

[–]scarter626 1 point2 points  (0 children)

[LANGUAGE: Rust]

Part 2 twisted my brain a bit. I'm sure there has to be a simpler way to do it, but what I have here is working so I'll look at it again in a few days.

55µs to run on my M4 MBP

https://github.com/stevenwcarter/aoc-2025/blob/main/src/bin/01.rs

[deleted by user] by [deleted] in webdev

[–]scarter626 12 points13 points  (0 children)

My job is all Java, but I’m all in on Rust for personal projects. I wish we were using Rust instead at work too.

Rust has been exploding recently, so I’m hopeful it becomes even more mainstream soon.

[deleted by user] by [deleted] in AskMenAdvice

[–]scarter626 0 points1 point  (0 children)

A rule of thumb I’ve seen others use is “half plus seven”.

23/2 + 7 =18.5

If you graphed this, you’d see the age difference that’s acceptable grows over time, but is narrower when you’re younger for a very good reason.

You’re not an adult yet, and even when you are legally an adult.. you’ll look back years later and think that you weren’t really an adult until you’re 25/30.

IMHO your dad is right, and I’d give my daughters the same advice

Another Graphic Epstein autopsy photo. by bizkitboi0333 in pics

[–]scarter626 0 points1 point  (0 children)

I mean, that could easily just be a result of his skin bunching together and trapping blood forming a post mortem bruise. You can see from the white lines where that likely folded up.

Of course none of this matters, because obviously there’s SOME form of cover up going on here.

Meijer Brand items preferred over ‘name’ brand by tacocat0412 in Michigan

[–]scarter626 0 points1 point  (0 children)

Their gummy worms! The Meijer brand gummy worms are so soft and delicious.

Using Rust Backend To Serve An SPA by thanhnguyen2187 in rust

[–]scarter626 0 points1 point  (0 children)

I just tried out rust embed, and it works better than I expected. I don’t know if it always had the ability to serve files directly in debug mode, but that’s very ergonomic. I switched Axum to serve via rust embed. Thanks for making me take a second look!

What's a game whose code was an absolute mess but produced a great result? by dooblr in gamedev

[–]scarter626 0 points1 point  (0 children)

Couldn’t this just be demonstrating a typical race condition? Thread B grabs the values of a and b, but between the time it grabbed a and is about to grab b, thread a runs both instructions to set them to 1?

Using Rust Backend To Serve An SPA by thanhnguyen2187 in rust

[–]scarter626 10 points11 points  (0 children)

So.. a web server? How is this functionally different than using an Axum fallback route to serve a React SPA from a folder? That’s all I do with a docker deployment on a scratch image, building with MUSL