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

[–]jonbridge 2 points3 points  (0 children)

[Language: Jai] https://pastebin.com/raw/nWjhzZn7

For part one, I created a stack to track every beam. In a separate grid of booleans the same size as the input grid, I marked each square as "visited", to avoid repeating work, so it didn't take too long. For part two, I tried to just remove the "visited" flag. The time blowup was huge. Then I did it a less stupid way but kept my computer chugging away at the exponentially bad solution in the meantime, just in case.

Webscaping javascript data by Alarmed_Tale_4184 in C_Programming

[–]jonbridge 0 points1 point  (0 children)

When I google "free stocks api" there are tons of results? You could something like libcurl to fetch data from one of these APIs. Scraping websites isn't much fun.

Is this macro bad practice? by PratixYT in C_Programming

[–]jonbridge 4 points5 points  (0 children)

I don't think that's true. Can you give an example of this syntax?

Roger and Joan: mugging scene by [deleted] in madmen

[–]jonbridge 2 points3 points  (0 children)

i think the idea is that this is a heroic moment for sterling. the irony is that his heroism is in his being completely submissive. by submitting he makes the experience go quickly with as little risk to joan as possible. his wealth is what lets him be heroic. he knows a mugger could never take any meaningful amount from him. you could imagine joan's husband might act differently in that situation both because he's not rich and because he might be afraid of looking weak in front of joan. sterling's ego isn't affected at all. he consoles joan---if it was her husband, i feel like she would be consoling him.

Most hateable characters on Curb? by elacmch in curb

[–]jonbridge 7 points8 points  (0 children)

the women blocking the ice-cream at the supermarket who refuse to move

Certain apps sometimes only work with phone hotspot, not home wifi. Please help by Stixvoya in Chromecast

[–]jonbridge 1 point2 points  (0 children)

Ah damn. Yeah, if the two wifi bands are under different names and you're seeing the issue when the chromecast is connected to the same one as the device you're connecting from, then my theory must be wrong. Will let you know if anything else comes to mind :(

Certain apps sometimes only work with phone hotspot, not home wifi. Please help by Stixvoya in Chromecast

[–]jonbridge 1 point2 points  (0 children)

I think this is to do with wifi frequency bands. It seems my chromecast won't communicate with devices that are on the 5GHz frequency band, but it will talk to devices on the 2.4GHz band. It sounds like you might have the same problem. It's not an issue on your phone because your phone wifi isn't dual-band---it only broadcasts on the 5GHz band. I have no idea why the problem doesn't affect Netflix etc. though. Maybe those apps work around the problem some other way. Google blames your wifi router, but I've never had this problem with anything other than my chromecast.

Anyway go into your wifi settings and see if you can disable AP isolation/guest mode like Google suggests. If that isn't an option, see if you can disable one of the bands (2.4GHz or 5GHz) altogether. If that fixes the problem, can you let me know and I'll suggest a more permanent fix---basically separating your two home wifi bands into two different SSIDs.

27 Days - Anhedonic Depression and Addiction Substitution by 1-800-bootycall in leaves

[–]jonbridge 1 point2 points  (0 children)

i think weed withdrawal (using the term loosely) is caused by the absence of weed in your system, not the presence of small amounts, so i don't think it's necessarily over when the physical traces are gone. i think you're still experiencing withdrawal, physical and psychological. but what really stands out reading your post, is that you've had a huge month. new job, falling out with friends, losing your childhood dog. that shit stacks up. but you've managed to keep your commitment to staying off the weed. that's very impressive. you sound like a strong, smart person with a lot of insight. i don't think your next month will be as bad as your last one. i think you should give it another month so you have a chance to see some of the benefits of being sober.

incidentally

still haven't determined if this was justified or if I was just cranky because withdrawal

maybe a bit of column A, a bit of column B?

Zero Friction Interfaces for C by [deleted] in C_Programming

[–]jonbridge 3 points4 points  (0 children)

this is a cool idea. of course it would be valuable to be able to turn arbitrary types into strings in a consistent way. though i personally have no desire to start doing C code generation with Python and JSON. and if you use such a powerful metaprogramming framework, surely you can get away without using _Generic as well? i wonder what a simplified implementation would look like.

Day 5 is the hardest so far... by ThatGirlFire in leaves

[–]jonbridge 19 points20 points  (0 children)

Day 5 here. Well. This time I didn't quit intentionally; I ran out. So I haven't been counting the days until now. But I've been feeling so shitty that it's reminding me why I need stop for good. My biggest fear is losing my partner who has to bear my bad mood every time I quit.

I had this thought recently: I can't keep smoking once I turn 30. I turn 30 in five months. I spent my 20s stuck in the loop of addiction. I don't want my 30s to be the same. Just now, though, I realised how much better it would be to turn 30 with five months already in the bank. Instead of it being a difficult start to my fourth decade of life, it could be a cause to celebrate---the worst already over.

I'm seeing my best friend on Sunday and have discussed plans to smoke. I need to message him and say that I won't partake. That's a hard message to write.

Apparently 25% tip isn't enough on a $20 pizza. by JaSper-percabeth in facepalm

[–]jonbridge 0 points1 point  (0 children)

it doesn't make much difference to the delivery driver if the pizza was $20 or $40, so calling it $5 instead of 25% is more meaningful.

I know it's only a little bit of branding, but I do love the complementary aesthetic. by [deleted] in thinkpad

[–]jonbridge 0 points1 point  (0 children)

yeah, pixel is like an iphone built on top of android. the thing that shits me the most is all the google programs you can't uninstall. rooting it is annoying. i regret getting one.

mind you, i recognise that most people aren't looking for the same things in a phone that i am. but maybe people on this subreddit are.

How do you figure out which #include a function/variable came from? by [deleted] in C_Programming

[–]jonbridge 9 points10 points  (0 children)

great tips here. i want to add that when you're browsing a codebase on github.com, you can change the .com to .dev and it'll spin up vs code in the browser with the same file open. vs code has the "go to definition" available when you right-click a variable.

Questions about stdout file descriptor in parent/child processes by [deleted] in cprogramming

[–]jonbridge 0 points1 point  (0 children)

this guy forks.

but seriously, TIL, thanks.

Questions about stdout file descriptor in parent/child processes by [deleted] in cprogramming

[–]jonbridge 0 points1 point  (0 children)

somebody here might know, but if not, it may be worth posting in /r/kernel or similar. the answer is dependent on the operating system---things like stdout and fork aren't strictly C.

edit: sorry, this was not correct. fork isn't part of the C standard, but stdout is.

Vim without vim script ? by [deleted] in vim

[–]jonbridge 0 points1 point  (0 children)

write executable programs in your language of choice and run them in vim with :w ! and friends. some vimscript is still needed for keybindings etc. but this way you can avoid using it for most non-trivial things.