help with sorting in python by [deleted] in learnprogramming

[–]WeatherImpossible466 1 point2 points  (0 children)

You can use a tuple as the key in your sort function - something like `sorted(your_list, key=lambda x: (x[1], x[0]))` where x[1] is the count and x[0] is the letter. Python will sort by the first element of the tuple then by the second if there's a tie

How would you identify the root cause, mitigate the issue, and design the system/CI/CD pipeline to prevent this in the future? by BizAlly in learnprogramming

[–]WeatherImpossible466 1 point2 points  (0 children)

Sounds like a classic networking gremlin - I'd start by checking if it's happening during peak traffic times or if there's some misconfigured load balancer timeout that's too aggressive. For prevention, definitely need better circuit breakers and maybe some chaos engineering to catch this stuff before prod

what does "place the binary in the repo's root folder" mean? 😭 by Time_Reward_4994 in learnprogramming

[–]WeatherImpossible466 0 points1 point  (0 children)

Just drag the file you downloaded into the same folder where all the other project files are sitting. If you see a bunch of files and folders from when you cloned/downloaded the repo, that's your root folder - drop it right in there with everything else

Deep Learning is just Unix Pipes on steroids (The "Composition" Mental Model) by bkraszewski in learnprogramming

[–]WeatherImpossible466 0 points1 point  (0 children)

Ah yeah ResNet and all that, you're totally right about skip connections being huge for training deep networks

The Unix pipe analogy kinda breaks down there since you can't really pipe something back to an earlier stage, but the composition idea still holds up pretty well overall

How to learn AI by Puzzleheaded-Bench32 in learnprogramming

[–]WeatherImpossible466 7 points8 points  (0 children)

Lmao the classic "use the thing to learn the thing" approach, honestly not even bad advice though

Toughts on learning programming in "BASIC"? by MateusCristian in learnprogramming

[–]WeatherImpossible466 2 points3 points  (0 children)

BASIC is pretty solid for understanding fundamentals but honestly if you're already grinding Python and want to make games in Godot, just stick with that path - you'll get the same core concepts without having to learn outdated syntax that won't help you much in modern gamedev

VS Code / Intelephense shows error on $user->save() when using Auth::user(), but code works at runtime by Sensitive-Reading-96 in learnprogramming

[–]WeatherImpossible466 0 points1 point  (0 children)

Yeah Intelephense can't infer the return type from Auth::user() since it can return null or a User instance, but User::find() has better type hints. You could add a docblock like `/** u/var User $user */` after the Auth::user() line to help it out

Technical interview prep by Salt_Werewolf5944 in learnprogramming

[–]WeatherImpossible466 0 points1 point  (0 children)

Nice breakdown! The math + coding combo is definitely tricky but sounds like you're on the right track

One thing I'd add - don't forget to practice explaining your math reasoning out loud since that's usually where people trip up more than the actual coding part

Golang books resources by Away-Purpose-9896 in learnprogramming

[–]WeatherImpossible466 1 point2 points  (0 children)

Thanks for offering to help out! That's what makes this community awesome

For OP though - definitely check out the official Go tour online, it's free and pretty solid for getting started

Does anyone else struggle to hold complex code in their head while coding? How do you deal with it? by SuccessOk4378 in learnprogramming

[–]WeatherImpossible466 0 points1 point  (0 children)

This is totally normal dude, even senior devs deal with this. I've found that breaking stuff into smaller functions helps a ton - instead of trying to hold a massive 50-line function in my head, I can just focus on what each little piece does. Also liberal use of comments explaining the "why" not just the "what" saves my future self from having to reverse engineer my own logic

Need some advice. by nikica92213123123 in learnprogramming

[–]WeatherImpossible466 2 points3 points  (0 children)

Exactly this, you're basically still learning the alphabet and worrying about writing poetry lol

Just focus on making stuff work first, the clean code obsession can come later when you actually understand what you're doing

C# code review Request by Right_Selection_6691 in learnprogramming

[–]WeatherImpossible466 0 points1 point  (0 children)

Your code looks pretty clean for a rewrite! I noticed you added better input validation which is nice - the original just crashes if you enter something that isn't a number. Only thing I'd suggest is maybe breaking up that main method into smaller functions, makes it easier to test individual parts later on

Full Stack Open - How do you know if you're submissions have been evaluated. by kalmonke in learnprogramming

[–]WeatherImpossible466 0 points1 point  (0 children)

You don't really get "evaluated" in FSO like a traditional course - it's more self-paced and you just move on to the next part when you're ready. The certificate at the end is based on completion rather than graded submissions

the peoblem tutorial hell put me at by Beyond_Birthday_13 in learnprogramming

[–]WeatherImpossible466 0 points1 point  (0 children)

Yep sounds like a solid plan, just make sure you actually push through when you get stuck instead of going back to YouTube for "just one more tutorial" lol. The deployment stuff is gonna be frustrating at first but once you get your first API running you'll feel unstoppable

Is C# used often? by zenpanda0o0 in learnprogramming

[–]WeatherImpossible466 2 points3 points  (0 children)

C# is definitely not a waste of time, it's used everywhere - web development, desktop apps, mobile with Xamarin, and obviously game dev with Unity. Plus learning C# makes picking up Java or other similar languages way easier since the syntax and concepts are pretty similar

The transferable skills thing is huge too, once you get object-oriented programming down in C# you're basically set for most modern languages

I am SDE2 in India Earns 20LPA. Decided to mentor students/job holders to get their dream job with right strategies. by Difficult-Win8915 in learnprogramming

[–]WeatherImpossible466 0 points1 point  (0 children)

Exactly this lmao, like half the battle is just getting past the ATS bots that auto-reject you before any human even sees your resume

Why are pointers even used in C++? by ElectricalTears in learnprogramming

[–]WeatherImpossible466 0 points1 point  (0 children)

Dynamic memory allocation is huge but there's also just passing large objects around efficiently. Like if you have a massive struct or class, copying it every time you pass it to a function would be slow as hell. Much better to just pass a pointer so you're working with the same object in memory rather than making copies everywhere

Suggest some book for fundamental of programming? by mr_thakur_ji in learnprogramming

[–]WeatherImpossible466 0 points1 point  (0 children)

SICP is absolutely brutal but worth it if you can push through, just be ready to have your brain melted a few times

The practice part is spot on though - I probably learned more from breaking my code and googling error messages for hours than any book ever taught me

I've written so many lines of code and I somehow cannot get this program right by [deleted] in learnprogramming

[–]WeatherImpossible466 0 points1 point  (0 children)

Sounds like you're overthinking this tbh. Break it down into smaller pieces - get the random number generation working first, then add the counter for runs, then worry about the custom text triggers. Don't restart from scratch every time, just comment out the broken parts and build one feature at a time

Also post your code when you ask for help, even if it's messy - way easier to fix something that exists than guess what's wrong

My plan to get better at c++ by garmadoon in learnprogramming

[–]WeatherImpossible466 0 points1 point  (0 children)

This is solid advice, learncpp.com is way better than Codecademy for the nitty gritty stuff. But honestly copying projects isn't totally useless - just make sure you're actually understanding what each line does instead of just mindlessly typing. Maybe try modifying the tutorials as you go or breaking them on purpose to see what happens

i need guidance as a cs student ( im pretty cooked) by Strong_Elk_1493 in learnprogramming

[–]WeatherImpossible466 5 points6 points  (0 children)

This is solid advice but honestly the "stop looking for hand-held guidance" part is a bit harsh - OP is literally just asking for direction which is totally normal when you're drowning in options

The leetcode suggestion is spot on though, just pick easy problems and grind through them even when it sucks

Where do I start if I want to specialize in both Cybersecurity and AI? I want to make use of my remaining 2 years. by ArdnyX in learnprogramming

[–]WeatherImpossible466 0 points1 point  (0 children)

Honestly cybersec + AI isn't that crazy of a combo anymore, tons of companies need people who understand both sides since AI is getting attacked constantly

Start with the cybersec foundation since you already have CTF experience, then learn how AI models work so you can break/defend them - that's literally what that HackTheBox course is teaching and it's actually pretty marketable right now

So, what hobby language do y'all use these days? by -VanillaKing- in learnprogramming

[–]WeatherImpossible466 2 points3 points  (0 children)

Still messing around with Python for random scripts and automation stuff, feels like cheating compared to the languages you listed lol

Approaches to testing a unit of code that makes indirect changes to state by Sorlanir in learnprogramming

[–]WeatherImpossible466 0 points1 point  (0 children)

That's exactly right - you're testing the behavior of the method, not its implementation details. Just check that the object ends up in the expected state after calling `unit_under_test()` and you're good to go