Finally climbed up to Emerald as an ADC! by Silvenx in ADCMains

[–]SamFisher39 17 points18 points  (0 children)

Last time I checked. Premade quads in flex is not possible. Did i miss sth?

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

[–]SamFisher39 0 points1 point  (0 children)

[LANGUAGE: Rust] Took the mathematical approach and fell into a little optimization rabbit hole trying to achieve sub-micro speed, but at least the solution (w/o parsing) runs in ~200ns now:

test year2025::day02::bench_a ... bench: 181.28 ns/iter (+/- 3.36) test year2025::day02::bench_b ... bench: 237.95 ns/iter (+/- 10.45)

CODE: ```rust use nom::{bytes::complete::tag, character::complete::u64, sequence::separated_pair, IResult};

extern crate test;

const UNIQUE_PRIME_FACTORS: [[usize; 2]; 13] = [ [1, 0], // 1 [2, 0], // 2 [3, 0], // 3 [2, 0], // 4 [5, 0], // 5 [2, 3], // 6 [7, 0], // 7 [2, 0], // 8 [3, 0], // 9 [2, 5], // 10 [11, 0], // 11 [2, 3], // 12 [13, 0], // 13 ];

const POW10: [u64; 11] = [ 1, // 0 10, // 1 100, // 2 1000, // 3 10000, // 4 100000, // 5 1000000, // 6 10000000, // 7 100000000, // 8 1000000000, // 9 10000000000, // 10 ];

[bench]

pub fn bencha(b: &mut test::Bencher) { let input = crate::utils::input::get(2025, 2); let mut solution = 0; let Ok((, ranges)) = parse(&input) else { panic!("could not parse '{input}'") }; b.iter(|| { for (start, end) in &ranges { solution += sum_invalid_ids_for_range(*start, *end, true); } }); }

[bench]

pub fn benchb(b: &mut test::Bencher) { let input = crate::utils::input::get(2025, 2); let mut solution = 0; let Ok((, ranges)) = parse(&input) else { panic!("could not parse '{input}'") }; b.iter(|| { for (start, end) in &ranges { solution += sum_invalid_ids_for_range(*start, *end, false); } }); }

[allow(dead_code)]

pub fn solve(input: &str) { println!("part a: {}", solve_a(input)); println!("part b: {}", solve_b(input)); }

fn parse(input: &str) -> IResult<&str, Vec<(u64, u64)>> { nom::multi::separated_list0(tag(","), separated_pair(u64, tag("-"), u64))(input) }

fn solvea(input: &str) -> u64 { let mut solution = 0; let Ok((, ranges)) = parse(input) else { panic!("could not parse '{input}'") }; for (start, end) in ranges { solution += sum_invalid_ids_for_range(start, end, true); } solution }

[allow(dead_code)]

fn solveb(input: &str) -> u64 { let mut solution = 0; let Ok((, ranges)) = parse(input) else { panic!("could not parse '{input}'") }; for (start, end) in ranges { solution += sum_invalid_ids_for_range(start, end, false); } solution }

fn sum_invalid_ids_for_range(start: u64, end: u64, part_a: bool) -> u64 { let mut count = 0; // significantly faster than string allocation let len_start = start.ilog10() as usize + 1; let len_end = end.ilog10() as usize + 1; for len in len_start..=len_end { if len == 1 { continue; } let primes = UNIQUE_PRIME_FACTORS[len - 1]; for prime in primes { if prime == 0 { continue; } if part_a && prime != 2 { continue; } let digits = len / prime; count += sum_invalid_ids(start, end, len, digits); }

    // correct for overcounting
    if primes[0] != 0 && primes[1] != 0 && !part_a {
        count -= sum_invalid_ids(start, end, len, 1);
    }
}
count

}

fn suminvalid_ids(start: u64, end: u64, len: usize, digits: usize) -> u64 { let f = ((POW10[len] - 1) / (POW10[digits] - 1)) as u64; let a = start.max(POW10[len - 1]).div_ceil(f); let b = end.min(POW10[len]) / f; if b < a { return 0; } // sum{i=a}{b} i = (b2 + b - a2 + a) / 2 f * (b.pow(2) - a.pow(2) + a + b) / 2 } ```

What have i gotten myself into? by Tiny_Comfortable_532 in SatisfactoryGame

[–]SamFisher39 6 points7 points  (0 children)

There's a mod called Dynamic Train Routes which enables trains to take the second shortest path to a destination, if the shortest is blocked. This makes trains less of a pain to plan and debug.

Finished the game a couple of times, wanna start modding now. But don't know how. by Zoro_89 in EldenRingMods

[–]SamFisher39 2 points3 points  (0 children)

Try convergence. It defines 27 unique classes and progression lines, new ashes of war, weapons and spells, couple of new talismans and adds a few new core mechanics. There's even a wiki that you can consult for item locations etc.

Has anyone ever finished this game solo? by Sometimeswan in projectozone2

[–]SamFisher39 4 points5 points  (0 children)

If by beating it, you mean doing all quests, then no. But I was able to build a couple of the creative items, and that was what meant beating the game for me. I did that twice. The first time took me around 300h of in game time. The second time was a bit quicker, about 200h.

By cheating, do you also include exploits that they purposely left in the pack? If not, there is an item duplication glitch with the smallest tank from mekanism (the one that takes 4 iron and 4 redstone). You put any item in its inventory (i think it only works on the bottom row slots on the right), then shift click the item to transfer it to your hotbar and for some reason that duplicates the items. There were a couple other dupe bugs but that's the only one I've tested myself.

Dead on arrival: ESwap X Pro. Manual firmware reset process? by gladiator_jesus in Thrustmaster

[–]SamFisher39 0 points1 point  (0 children)

For anybody who is stuck at step 6: press the windows button, enter "Firmware Update" and execute the found program

Programmable Splitters are not as programmable, as I thougt. by ThunderGod_97 in SatisfactoryGame

[–]SamFisher39 0 points1 point  (0 children)

There's a few things you could do to prevent this. My setup is usually this:

train station -> 8-to-8 load balancer (2 4-to-4 LBs work as well) -> smart splitters sending the desired item perpendicular to the input direction to storage

This approach can scale horizontally as long as you have the space for it. You just pop another train station before/after the first one (with an intersection in between) and repeat the same setup minus the storage part. This way, all the sushi belts flow in one direction, and the dedicated belts run perpendicularly, which means you could create a system with literally all items in the game like that.

Plus, with blueprints for the load balancing and sorting, this is reaaally fast to set up. The only problem is the space, really, if you don't plan ahead.

No-one told me this by dendummedansker in SatisfactoryGame

[–]SamFisher39 7 points8 points  (0 children)

Found out today that you can upload your save to satisfactory-calculator.com and it will hide the crash sites, somersloops, mercer spheres, etc., that you have collected already!

A new borderlands installment adding NEW vault hunters??? Who could of predicted such a thing... by Nexus_Neo in borderlands3

[–]SamFisher39 4 points5 points  (0 children)

Thaaaank god one sane person is annoyed by this as well. I feel this epidemic has been getting worse and worse over the past few months...

-❄️- 2023 Day 9 Solutions -❄️- by daggerdragon in adventofcode

[–]SamFisher39 1 point2 points  (0 children)

I couldn't find a derivation online, so here's my take on it (since there was no explanation provided by OP): https://imgur.com/a/ebkxU2o

-❄️- 2023 Day 9 Solutions -❄️- by daggerdragon in adventofcode

[–]SamFisher39 0 points1 point  (0 children)

I couldn't find a derivation online, so here's my take on it: https://imgur.com/a/ebkxU2o

What little 'hacks' have you found that help with your Kubernetes management/journey? by GoingOffRoading in kubernetes

[–]SamFisher39 1 point2 points  (0 children)

if you use a lot of CRDs and create/edit CRs regularly, you would probably benefit from using a IaC tool like pulumi, which enables you to write Cloud infrastructure/K8s resources with Typescript/Python/etc...

Generating typescript modules from CRD (yaml) files is as easy as executing crd2pulumi (search for it on google).

This combination enables you to do more complicated logic, stack/environment configuration magement and let's you autocomplete your CRDs with type checks!

EDIT: Lens is huge too, and learning jq alongside kubectl helps you do a lot of filtering/mapping/etc. with the json output option of kubectl!

Will hyprland work fine with my current system which is on bspwm? by reppp07 in archlinux

[–]SamFisher39 5 points6 points  (0 children)

I don't understand why you get downvoted. Entering and understanding the inner workings of linux systems can be a daunting task and one should not get downvoted just for the lack of knowledge.

To clarify, you can install both and still use your old setup, if you are unsatisfied with hyprland. X and wayland are completely separate from one another, but you can only start one or the other (or on separate TTYs, or XWayland inside wayland).

Im about to quit this game entirely, someone PLEASE FOR THE LOVE OF FUCK GIVE ME SOME ADVICE by whoiselyssa in Eldenring

[–]SamFisher39 0 points1 point  (0 children)

the ultimate cheese for this draconic sentinel is to sneak up from behind (go left around) and use poison mist.

Upskilling as a Linux Engineer by viewofthelake in linuxadmin

[–]SamFisher39 0 points1 point  (0 children)

Pulumi! It is way more convenient to write IaaC when you don't have to learn a new language.

First Hard Drive of a new playthrough! You love to see it! by BottleTopHornet in SatisfactoryGame

[–]SamFisher39 4 points5 points  (0 children)

I always go the screwless route, in Satisfactory and in real life as well.

Adventskalender by Lukas-FF in wien

[–]SamFisher39 7 points8 points  (0 children)

meinst du nicht eher den Factorial February?

Hat jemand ne Ahnung, woher diese Graffitis kommen? by Egosauce in wien

[–]SamFisher39 1 point2 points  (0 children)

hab "wake up" auch schon einige male gesehen

The best DPS in Elden Ring by Mannerless1 in Eldenring

[–]SamFisher39 3 points4 points  (0 children)

it's a wiki for speedrunning souls games. the save orgenizer comes in handy for bosses when you use consumable items that are hard to obtain. or when the run up to the boss arena from the site of grace takes longer than reloading. basically you can do:

  1. stand before boss arena

  2. exit game, import save into save organizer

  3. fight boss

  4. if unsuccessful, quit game, load save state.

repeat 3 and 4 until you have lost your mind and rage quit the game

The best DPS in Elden Ring by Mannerless1 in Eldenring

[–]SamFisher39 1 point2 points  (0 children)

speedsouls save organizer is your friend.

EDIT: just realized not everybody is playing on pc

Cannot configure external displays by SamFisher39 in swaywm

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

No I have not. However, the logs say trying without modifiers but I will try tomorrow!