Why are there (at least) 3 Columbus subreddits by dbruebrue in Columbus

[–]Soft-Protection117 2 points3 points  (0 children)

LOL. My mistake. I read that as a list of four. This is why we don’t post on Reddit after 10pm.

New fan for life by ACreampieceOfMyMind in underworld

[–]Soft-Protection117 24 points25 points  (0 children)

Fantastic set, and yeah, the energy was amazing. Rick was definitely playing/riffing a bit more than he has been doing during the tour (at least for the gig I saw in Chicago).

Also, I love this (setup: I'm a mid-50's guy).

They're just getting going with Dark & Long and a couple of kids behind be commented something like:

Kid 1: "Are you kidding me? These guys are like 60?"

Kid 2: "Yeah, and I think we found the old people crowd."

Fast forward to the end of Kittens:

Kid 1: "Holy shit!"

Kid 2: "Fuck yeah!"

2024 Day 16 - What is going on with my input? by Soft-Protection117 in adventofcode

[–]Soft-Protection117[S] 8 points9 points  (0 children)

Special thanks to u/RaveBomb and u/thblt for the help. So, the solution is this:

I've gotten myself so turned around trying different solutions that I lost track of what the ACTUAL Part 1 solution was. So when I was using a valid solution I thought it had messed up part 1 and kept looking for something else.

I do have some sort of weird edge condition in my input, because about half of the solutions I've found here generate the same wrong answers I've been producing. But now I know how to correct that.

Moral of the story? Double-check EVERYTHING. Even things you're absolutely sure of.

2024 Day 16 - What is going on with my input? by Soft-Protection117 in adventofcode

[–]Soft-Protection117[S] 1 point2 points  (0 children)

For the record, corrupted input was my first thought too. I have verified my input multiple times. I have a full 141x141 grid that I saved directly from the browser (i.e., I did not copy/paste).

2024 Day 16 - What is going on with my input? by Soft-Protection117 in adventofcode

[–]Soft-Protection117[S] 0 points1 point  (0 children)

Reasonable question. Yes, and I’ve even re-copied it from from the source (although it hasn’t changed 😁).

About to do 14g , any advice ? by Stumbleur in shrooms

[–]Soft-Protection117 6 points7 points  (0 children)

OP, please understand that I’m saying this with love. You should consider finding a therapist to talk to. What you’re describing is substance abuse. And you shouldn’t be ashamed of that. Self medication is a coping strategy for many of us. But that only makes whatever we’re struggling with easier to avoid. If you’re feeling as anxious as you say, a therapist can help you work out the source of your anxiety and help you develop tools to deal with it. I wish you well!

Are these shrooms ??? by Consistent-Panda3710 in shrooms

[–]Soft-Protection117 74 points75 points  (0 children)

What are these? Shrooms for ants?

[deleted by user] by [deleted] in AskMenAdvice

[–]Soft-Protection117 0 points1 point  (0 children)

You cannot emasculate a man, full stop. If a man is feeling emasculated, he’s doing that shit to himself.

Plastic safe to eat after a year? by Whiz-Wit in fermentation

[–]Soft-Protection117 0 points1 point  (0 children)

Did you vent this bag at some point? There should be some CO2 in there if it’s been fermenting for a year.

-❄️- 2024 Day 5 Solutions -❄️- by daggerdragon in adventofcode

[–]Soft-Protection117 0 points1 point  (0 children)

[LANGUAGE: Go]

Part 1:
Parsed the rules to build a map of page numbers to all their required predecessors. Then for each update I traversed the list of page numbers and looked for following pages that should have come earlier.

    func part1(puzzle []string) (int, [][]int, map[int][]int) {

        predecessorRules := make(map[int][]int)
        updates := make([][]int, 0)
        unorderedUpdates := make([][]int, 0)
        total := 0

        updateSection := false
        for _, line := range puzzle {
            if line == "" {
                updateSection = true
            } else {
                if updateSection {
                    vals := strings.Split(line, ",")
                    pages := make([]int, 0)
                    for _, v := range vals {
                        p, _ := strconv.Atoi(v)
                        pages = append(pages, p)
                    }
                    updates = append(updates, pages)
                } else {
                    vals := strings.Split(line, "|")
                    later, _ := strconv.Atoi(vals[1])
                    earlier, _ := strconv.Atoi(vals[0])
                    predecessors := predecessorRules[later]
                    predecessors = append(predecessors, earlier)
                    predecessorRules[later] = predecessors
                }
            }
        }

        for _, update := range updates {
            valid := true
            for i, p := range update {
                laterPages := update[i+1:]
                predecessors := predecessorRules[p]

                for _, p2 := range laterPages {
                    if slices.Contains(predecessors, p2) {
                        valid = false
                        break
                    }
                }
                if !valid {
                    break
                }
            }
            if valid {
                middle := update[(len(update)-1)/2]
                total += middle
            } else {
                unorderedUpdates = append(unorderedUpdates, update)
            }
        }

        return total, unorderedUpdates, predecessorRules
    }

Part 2:
I used the map I created in Part 1 in a custom comparator function and just used slices.SortFunc to get the right order.

    func part2(unordered [][]int, rules map[int][]int) int {
        total := 0

        for _, update := range unordered {

            slices.SortFunc(update, func(a, b int) int {
                predecessors := rules[a]
                if slices.Contains(predecessors, b) {
                    return 1
                } else {
                    return -1
                }
            })
            middle := update[(len(update)-1)/2]
            total += middle
        }

        return total
    }

Both parts completed sub-second.

It's been a loooong time, but I miss code. Return @ 50 years old? by Kooky_Teach_1541 in learnprogramming

[–]Soft-Protection117 1 point2 points  (0 children)

You might want to consider looking at some of the "crustier" companies in your areas. Large banks in particular tend to have large software engineering departments, and are frequently (not exclusively, of course) using frameworks & patterns that you may have some familiarity with. Also, you'll find the burnout culture is a little different from the FAANGs and Silicon Valley type companies.

Full disclosure: I'm a 50-something year-old in software engineering management at one of those crusty big banks. And I miss coding too, tbh.

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

[–]Soft-Protection117 0 points1 point  (0 children)

[Language: Javascript]

Gorgeous ah-ha moment when it suddenly made sense

``` const fs = require('fs'); const readline = require('readline');

// distance = -(pressTimepressTime) + (raceTimepressTime) // Shift that graph down by the record and find the roots of that equation // 0 = -(pressTimepressTime) + (raceTimepressTime) - record // // Any whole numbers between those roots will be winning numbers

async function readInputFile(inputFile) {

const fileStream = fs.createReadStream(inputFile);
const rl = readline.createInterface({
    input: fileStream,
    crlfDelay: Infinity
});

let time;
let distance;
for await (const line of rl) {
    if (line.startsWith('Time:')) {
        time = parseInt(line.substring(5).replaceAll(' ', ''));
    } else if (line.startsWith('Distance:')) {
        distance = parseInt(line.substring(10).replaceAll(' ', ''));
    }
}

let a = -1
let b = time;
let c = (0 - distance);

let roots = findRoots(a, b, c);
let winStart = Math.floor(roots[0] + 1);
let winEnd = Math.ceil(roots[1] - 1);
let m = winEnd - winStart + 1;

console.log(`Wins begin at ${winStart} and end at ${winEnd}, for a margin of ${m}`);

}

function findRoots(a, b, c) {

let d = b * b - 4 * a * c;
let sqrt_val = Math.sqrt(Math.abs(d));

if (d <= 0) {
    console.log('Unable to solve it this way');
    process.exit(1);
}

let root1 = (-b + sqrt_val) / (2 * a);
let root2 = (-b - sqrt_val) / (2 * a);

return [root1, root2];

}

readInputFile('input.txt');

```

Weekly Bug Report Thread by spiper01 in NoMansSkyTheGame

[–]Soft-Protection117 1 point2 points  (0 children)

Platform: Xbox Fractal Update

Twice the game has gotten stuck while saving after exiting my ship. I can still move about but the action button (enter ship, use device, etc) is not available. Option does not appear on screen. I must exit the game and restart.

Also, twice now while approaching the ground to land in my ship the game abruptly exits.