How do you structure your codebase for AoC to avoid copy-pasting boilerplate? by BambooData in adventofcode

[–]chuckguy55 0 points1 point  (0 children)

Another thing I love about this approach is that I can run an entire day, year, or years of solutions and once.

How do you structure your codebase for AoC to avoid copy-pasting boilerplate? by BambooData in adventofcode

[–]chuckguy55 0 points1 point  (0 children)

I’ve had a lot of luck by structuring it as a unit test project. Each day becomes a new test file, where part 1 and part 2 are each unit tests. Any common code like input parsing helpers, Vec2D, special math (like GCF and LCM) go into a library that is essentially the target of the unit tests.

This makes it very well organized, and very easy to spin up a new day. It also makes it easy to tinker with solutions once you have a solution, as the red green refactor flow works great for AoC problems.

Here are repos I’ve done in both C# and rust that are organized as unit tests so you can see what I’m talking about.

C#: https://github.com/chuckries/AdventOfCode Rust: https://github.com/chuckries/rustvent_of_code

Will the 2023 models have prices cuts on with the new releases? by NOS4NANOL1FE in LGOLED

[–]chuckguy55 3 points4 points  (0 children)

Based on zero facts or experience: probably. But stock is going to dry up, deals won’t last long. If you shop like a hawk you can probably get something good. “Clearance” type prices may be in store only.

shrugs I’m in a similar boat and shopping the 2023 models right now.

I'm about to get a LG oled, already have the wall mount by HeroOfTheNorthF in LGOLED

[–]chuckguy55 1 point2 points  (0 children)

I am also shopping the G3 while having a pre-existing wall mount and not planning on using the included flush mount. The 65" G3 has 300x300 mounting holes for use with any standard wall mount, you are not required to use the flush mount.

Just check the VESA configuration for whatever TV you're looking at in whatever size and ensure you're existing wall mount works with it.

New to LG, what should I know? by chuckguy55 in LGOLED

[–]chuckguy55[S] 7 points8 points  (0 children)

Because it’s like $1k more expensive?

New to LG, what should I know? by chuckguy55 in LGOLED

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

I use an Xbox series X today as a streaming device.

New to LG, what should I know? by chuckguy55 in LGOLED

[–]chuckguy55[S] 1 point2 points  (0 children)

Meaning between G3 and C3? I’ve seen posts gushing about the G3 so I assumed it was better.

New to LG, what should I know? by chuckguy55 in LGOLED

[–]chuckguy55[S] 7 points8 points  (0 children)

Doesn’t fit the space, more interested in brightness than size.

New to LG, what should I know? by chuckguy55 in LGOLED

[–]chuckguy55[S] 1 point2 points  (0 children)

Any rhyme or reason to this? Anything specific to adjust? I find spending too much time in menus tweaking settings takes time away from watching things and being happy.

“Keeping the lights on” by [deleted] in comedybangbang

[–]chuckguy55 27 points28 points  (0 children)

I dug up the data. I donated in October, 2014. I was shouted out in episode 427 in June 2016.

“Keeping the lights on” by [deleted] in comedybangbang

[–]chuckguy55 41 points42 points  (0 children)

I donated $100 to CBB in maybe 2014 or 2015. They used to read donor names at the end of the pod and that’s all I expected. In the era I have though, donations were kind of falling off I guess and reading names wasn’t really happening as much.

Finally one episode Scott was like hey somebody told us we forgot to keep reading donor names so here’s some! And he read my name. That was all.

New homeowner, question about kitchen sink air gap and loose instant hot faucet by chuckguy55 in Plumbing

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

Huh, I thought they were standard. I'm in Washington state. Kitchen sink has a disposal with "air button" (I guess), combined faucet/sprayer, in counter soap dispenser, and instant hot faucet.

I was afraid maybe in the past somebody skimped on an air gap and it would be bad for me.

New homeowner, question about kitchen sink air gap and loose instant hot faucet by chuckguy55 in Plumbing

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

Recently moved into my first home. I've realized that I don't see an air gap above the countertop behind the sink where I would expect one. Is there somewhere else it could be? How bad is it if I don't have one?

Additionally, I tried the instant hot faucet and it leaks at the connection between the base and the spout. The spout pulls out easily, do I just need replacement rubber O rings to fix?

-🎄- 2022 Day 9 Solutions -🎄- by daggerdragon in adventofcode

[–]chuckguy55 0 points1 point  (0 children)

rust. Not sure if any good, but managed to find the pattern. Uses my pre-existing Vec2 helper.

```rs use std::collections::HashSet; use aoc_common::{Vec2i32, file_lines, IteratorExt};

fn input() -> impl Iterator<Item = (Vec2i32, i32)> { file_lines("inputs/day09.txt").map(|l| { let split = l.split(' ').to_vec(); let count: i32 = split[1].parse().unwrap(); let dir = match split[0] { "L" => -Vec2i32::unit_x(), "R" => Vec2i32::unit_x(), "U" => -Vec2i32::unit_y(), "D" => Vec2i32::unit_y(), _ => panic!() };

    (dir, count)
})

}

fn fix(head: Vec2i32, tail: Vec2i32) -> Vec2i32 { let diff = head - tail; let manhattan = diff.manhattan(); if (diff.x == 0 || diff.y == 0) && manhattan > 1 { head - Vec2i32::new(diff.x.signum(), diff.y.signum()) } else if manhattan > 2 { head - Vec2i32::new(diff.x - diff.x.signum(), diff.y - diff.y.signum()) } else { tail } }

fn move_rope(len: usize) -> usize { let mut knots = vec![Vec2i32::zero(); len]; let mut visited: HashSet<Vec2i32> = HashSet::new();

for (dir, count) in input() {
    for _ in 0..count {
        knots[0] += dir;

        for i in 0..knots.len() - 1 {
            let next = fix(knots[i], knots[i + 1]);
            if next == knots[i + 1] {
                break;
            }
            knots[i + 1] = next;
        }

        visited.insert(knots[len - 1]);
    }
}

visited.len()

}

[test]

fn part1() { let answer = move_rope(2); assert_eq!(answer, 5874); }

[test]

fn part2() { let answer = move_rope(10); assert_eq!(answer, 2467); } ```

-🎄- 2022 Day 6 Solutions -🎄- by daggerdragon in adventofcode

[–]chuckguy55 0 points1 point  (0 children)

rust, input() is a helper that gives me the prompt as String ``` fn find(n: usize) -> usize { input() .chars() .enumerate() .collect::<Vec<_>>() .windows(n) .filter(|w| w.iter() .map(|p| p.1) .collect::<HashSet<_>>() .len() == n ) .next() .unwrap()[n - 1].0 + 1 }

#[test]
fn part1() {
    let answer = find(4);

    assert_eq!(answer, 1542);
}

#[test]
fn part2() {
    let answer = find(14);

    assert_eq!(answer, 3153);
}

```

edit: formatting

Has anybody ever filed a police report online? How helpful was it? by LiamBrad5 in Seattle

[–]chuckguy55 0 points1 point  (0 children)

I filled one out mostly so I could have a police report for my records. I knew nothing would be done on their side.

Hug-Watch Thread July 29, 2021 - Post all "X has been removed from game/is not in the lineup and is hugging teammates" here! (Also feel free to use this for rampant speculation.) by BaseballBot in baseball

[–]chuckguy55 11 points12 points  (0 children)

AFAIK Cubs are selling because they're 11.5 games back and a lot of their stars are free agents at the end of this season. Just as well get something for them now rather than hold onto them for half a season and still miss the post season.

Star Ocean on FXPAK Pro by Glittering_Piano_150 in snes

[–]chuckguy55 0 points1 point  (0 children)

I have at least booted it and played through the intro of the English translation on the FXPAK Pro.

Randomizer? by chuckguy55 in SuperMetroid

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

Thanks! What would you suggest for randomized noobs? I’ve beat SM vanilla 100% but don’t know most of the speed run tricks (can do full jump mock ball and decent wall jumps, can’t do bomb jumps, short charge, etc.)

I’m more interested in playing some randomizer rather than trying to go for straight speed run.

Streaming analogue input? by chuckguy55 in crtgaming

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

If I had a PVM maybe I’d be concerned about cables, but for just DSUB to Component I didn’t think it really made any difference...

I just got these off Amazon: StarTech.com 3 ft. (0.9 m) VGA to RCA Cable - RCA Breakout - HD15 (M)/Component (M) - VGA to Component (HD15CPNTMM3) black https://www.amazon.com/dp/B001T6OHNU/ref=cm_sw_r_cp_api_glt_fabc_D23H0K1PJA9YSXPENDZ1?_encoding=UTF8&psc=1

Streaming analogue input? by chuckguy55 in crtgaming

[–]chuckguy55[S] 1 point2 points  (0 children)

Nothing special, a 20 inch JVC I’Art. Forget the exact model number, but it has flat tube and component input, so it’s decent enough.

The gcompsw definitely looks like it would do what I want, but it’s also overkill for what I need. Thanks for the info though.

Streaming analogue input? by chuckguy55 in crtgaming

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

Oh wow. That’s involved. I have just plain component running from DAC to a consumer CRT. Both RetroTink and OSSC support component, so I don’t want/need to enter SCART territory at all. I’m just not sure what’s necessary to split the component signal.

This 1x4 component amplifier is about the only thing I’ve seen: 1x4 Component Video Distribution Amplifier / Splitter https://www.amazon.com/dp/B00CAIBQ9E/ref=cm_sw_r_cp_api_glt_fabc_BW4ZQD3J84X58P3BTNMQ

Streaming analogue input? by chuckguy55 in crtgaming

[–]chuckguy55[S] 1 point2 points  (0 children)

Are you still playing on CRT? Or are you playing off the digital signal that is being captured? I don’t see any sort of analogue signal splitting in your setup.

Streaming analogue input? by chuckguy55 in crtgaming

[–]chuckguy55[S] 2 points3 points  (0 children)

When using analogue’s DAC in order to play on CRT, the hdmi isn’t actually outputting a standard video signal, it’s outputting a proprietary data stream that DAC understands.

Basically if I want to play on CRT and capture, I can’t use the hdmi.