Zikeji

joined 1 year ago
[โ€“] Zikeji 6 points 2 days ago (3 children)

Javascript

Behold an abomination!

const input = require('fs').readFileSync(0, 'utf-8').toString();
const towels = new Set(input.split(/\r?\n\r?\n/g)[0].split(', '));
const count = (p, t) => [...new Array(p.length).keys()].reduce((acc, i) => [...new Array(i + 1).keys()].forEach(j => acc[j] > 0n && t.has(p.substring(j, i + 1)) ? acc[i + 1] += acc[j] : null) ? acc : acc, [1n, ...new Array(p.length).fill(0n)])[p.length];
input.split(/\r?\n\r?\n/g)[1].split(/\r?\n/g).filter(p => p.length > 0).reduce((acc, p) => { let c = count(p, towels); acc[0] += c > 0 ? 1 : 0; acc[1] += c; return acc }, [0, 0n]).forEach((v, i) => console.log(`Part ${i+1}: ${v}`));
[โ€“] Zikeji 8 points 3 days ago (1 children)

The placement of the dog is just evil.

[โ€“] Zikeji 4 points 3 days ago (2 children)

The AM5 chipset only supports up to 28.

That being said, performance loss depends on your inference engine. You could try and find a older threadripper to get proper 2x 16x, but you'd still be spending a pretty penny for PCIe Gen 4.

Unfortunately, whole gen 5 is twice the bandwidth as gen 4, 2x 8x PCIe 5 doesn't become 2x 16x PCIe 4, though that would have been nice.

[โ€“] Zikeji 2 points 4 days ago

Javascript

Reused my logic from Day 16. For part two I manually changed the bytes (i on line 271) to narrow in on a solution faster, but this solution should solve it eventually.

https://blocks.programming.dev/Zikeji/c8fdef54f78c4fb6a79cf1dc5551ff4d

[โ€“] Zikeji 1 points 5 days ago* (last edited 5 days ago)

Javascript

So my friend tells me my solution is close to Dijkstra but honestly I just tried what made sense until it worked. I originally wanted to just bruteforce it and get every single possible path explored but uh... Yeah that wasn't gonna work, I terminated that one after 1B operations.

I created a class to store the state of the current path being explored, and basically just clone it, sending it in each direction (forward, 90 degrees, -90 degrees), then queue it up if it didn't fail. Using a priority queue (array based) to store them, I inverted it for the second answer to reduce the memory footprint (though ultimately once I fixed the issue with the algorithm, which turned out to just be a less than or equal to that should have been a less than, I didn't really need this).

Part two "only" took 45 seconds to run on my Thinkpad P14 Gen1.

My code was too powerful for Lemmy (or verbose): https://blocks.programming.dev/Zikeji/ae06ca1ca88649c99581eefce97a708e

[โ€“] Zikeji 12 points 1 week ago (1 children)

What you describe - that feeling when you think of doing those things, my personal experience has me classify it as overthinking becomes getting overwhelmed. And once I'm overwhelmed, I want to escape.

Keeping in mind coping mechanisms aren't one size fits all, the coping mechanism that helped me is to write out the problem step by step. This forces me to think slower, and helps me get out of that recursion of thinking about the same things.

I've also found some success in the age of AI LLMs asking one to break it down as well.

An example would be the dentist. First I need to find one, I need to look at reviews, I need to make sure they accept my insurance, I need to make sure they're reasonably close by. Alright, I compile a list of a few options, now the next part is the hard part: I have to actually call to get scheduled. But once I have it scheduled, my social anxiety is superceded by my desire to just get it over with. Sure I may feel that anxiety once I get close to the appointment, but I can cope with that - the real trick is by breaking down the process I didn't get overwhelmed as quick, and if I did I had notes to come back to.

[โ€“] Zikeji 13 points 1 week ago (3 children)

I'd recommend just getting a live version of a distribution that you don't have to install, that way you can play around with it before committing.

[โ€“] Zikeji 13 points 1 week ago (1 children)

I used to have a fair bit of imposter syndrome but now that I've been working with a proper team I've come too accept I have an aptitude for code and logic in general, alongside a fairly good abstract memory.

I'm not the best by any stretch of the imagination, but I'm a little more competent than the average software engineer, enough that it gets noticed.

I also got lucky and scored a job at 17 in the field (with no nepotism involved), not a great one but enough to look good on my resume, and have been working in the industry for just over a decade with no college.

[โ€“] Zikeji 4 points 3 weeks ago (1 children)

It is, which is why I check on darkpattern.games when finding a new one.

In a similar vein, Slice and Dice is on mobile and well worth it in my opinion.

[โ€“] Zikeji 2 points 3 weeks ago

It's been a while since I've been reminded Teletubbies exist.

[โ€“] Zikeji 4 points 3 weeks ago

The ad serving companies (Google) don't care about what happens after the click (yet). As far as I'm aware no "handshake" process exists that would allow an advertiser to communicate with the as server and validate a click (such a process could be abused).

Most likely the advertiser would be using some form of client side analytics, so the click wouldn't show up in their statistics, meaning the advertiser would see a huge discrepancy between the clicks they saw in the campaign and the clicks the ad server reports.

[โ€“] Zikeji 2 points 3 weeks ago

I'm not sure what you mean by "open source compatible". Do you mean the camera itself can have open source firmware installed, or that it's compatible with open source NVR software such as Shinobi or ZoneMinder?

If the former, I know some of the Wyze cameras have that option. Like OpenMiko. There's all OpenIPC, which does have a list of supported devices.

If the latter, any camera with RTSP and some sort of API to expose PTZ controls would do. My personal recommendation would be Axis, which makes solid cameras.

view more: next โ€บ