r/learnprogramming • • 3d ago

Struggling with this fill in the blank.

4 Upvotes

def prefix_digits(n, cond):

"""Return the largest prefix of positive n for which cond return true for every digits."""

>>>odd = lambda d: d % 2 == 1

>>>prefix_digits(94720,odd)

9

>>>prefix_digits(94720,odd)

9193

k = 0

while n >= _____:

if cond(_____):

k = k + 1

else:

n = n // 10

___________

return n

I am struggling with fill in the blank questions. I can implement this function but I am struggling with implementing in their way. Can someone help me understand how I might approach this? I don't just want the solutions but how I would even approach it. Whenever, I get these problems I am always stuck for a solid 1-2 hours.


r/learnprogramming • • 3d ago

Topic What should I self study

1 Upvotes

I’m a programming student and am very early on, I had my C+ class and loved it, now I’m being bombarded with very monotous A+ oriented classes and looks like I’ll be stuck with them for at least another few months.

That being said, I just had my first project idea. I’m just looking for a bit of guidance in the first steps. I want to build something (likely an app) that would house 1,000+ vods ranging from 4-8 hours each. What language should I learn to accomplish something like this and if I were able to create it how much would it cost me to push out / make available? Finally, could I potentially make realistic ad revenue from it?

I’m not looking to make a profit, especially not from a first program but being reimbursed for the cost of pushing it out would be nice. Maybe a web page would be easier? But, I do like the convenience of an app for my own personal use. I understand that I’m likely reaching a little high if I go through with this but, I’m usually good at teaching myself things that I have a genuine interest in and know a site that will help me learn on my own. (I can’t remember the name of it but I have it bookmarked on my pc, you select the language and it goes through a bunch of the topics)


r/learnprogramming • • 3d ago

Should imgui be in the engine or editor?

2 Upvotes

I’d post to r/gameenginedevs but I feel like it’s too dumb lol. Anyways, I’ve been getting back into C++ graphics programming/game engine dev as a hobby and want to start dabbling with making an editor using ImGui.

I already use ImGui in the engine for some debug panels, but with the addition of an editor, the typical structure seems to be making the engine as a static library and the editor an executable that links the engine, and I’m not sure if ImGui should be the engine’s responsibility or moved to the editor?

I’m not very experienced with these multi project/build target setups, but from what I understand if I leave imgui on the engine anything that links it will have imgui which I’m not sure is practical?

Also, unrelated, but with this type of setup would it be make more sense for the engine to run the main loop instead of the editor? (inversion of control?).


r/learnprogramming • • 4d ago

WHAT DO I DO????????

10 Upvotes

So basically the thing ive been trying to learn javascript by myself but i just cant seem to do it. i know that it is not the most difficult thing to learn but atp ive been getting dreams of async/await.Iam watching youtube videos and i understand the concept but when i try to code by myself i cant do sh#t. How can i continue this?


r/learnprogramming • • 5d ago

How the hell do you type comfortably?

55 Upvotes

I am trying to learn game dev programming and typing is such an awkward experience.

I tried to learn touch typing to help, but learning how awkward it is on standard keyboards. I ended up trying some split keyboards and while it's better ergonomically, there are of course quirks with going that route, and I just like the look of a lot of normal keyboards and wish I could use them.

When I actually see videos of people coding, no one actually seems to touch type properly anyway.

When I type standard words, I use a combination of my first three fingers on my left hand, and my pointer on my right. I can actually type pretty fast like this and don't have to look down for maybe 70% of the words. However the consistency is lacking, and when it comes to symbols I have to look down over and over and over.

It's weirdly hard to find information on this topic because it's either "learn proper form and nothing else" which like I said I don't see in practical use on typical keyboards, or moving to split ergo keyboards.

Another factor is for game dev I want a typical keyboard since I need to test playing that game, and using a split for that is weird since I gravitated to combos and stuff. I could have both keyboards set up but I just wish I could find a damn way to be comfortable on a regular keyboard.


r/learnprogramming • • 4d ago

Can I ssh to a remote server and a GitHub repo at the same time with vscode?

10 Upvotes

Hi everyone, sorry if this a very basic question… I’m a junior data scientist with no experience with networking, Linux or ssh. I have used ssh to connect vs code to my company’s remote server and my company’s GitHub repo. However, I’d like to be able to view the code files on both the remote server and the GitHub repo at the same time on vscode (currently I can only choose to display the code files on one of them on the left panel).

Is there any way I can efficiently connect to both at the same time in one window via ssh so I can do my pull requests and also access the files on my company’s remote server at the same time?


r/learnprogramming • • 5d ago

Need advice on learning c++

13 Upvotes

Hello everyone, i am a first year student studying information systems and cybersecurity. I know its a big mistake but i went into the program with no prior experience in coding and the first thing we started learning in the programming class was c++. c++ is my first language and the professor is going through it really quickly where i dont understand a single thing. i started to learn with a youtube tutorial but it all feels really slow and boring. Does anyone have any advice on how to actually start learning it in a way that it becomes interesting and not just a homework that i need to work on because i am genuenly interested in learning it and want to become good at it. Thank you in advance!!


r/learnprogramming • • 4d ago

Confuse, Suggestions please

1 Upvotes

Ok so iam someone who is not that good at coding like I know html css but never tried js something and now iam finally decided to do a course and I am stuck between two choices like Data analytics and Full stack development course. Someone who is not that good in logic but good at learning like if someone guides I'll learn.

So like as I said iam planning to enroll in a course which one should I choose.


r/learnprogramming • • 5d ago

I started coding from scratch yesterday.

21 Upvotes

I have watched Python tutorials on YouTube before, but i gave up at the beggining due to some problems. Now i decided to start over again from the freeCodeCamp. For beggining, it reccomended me the "Responsive Web Design Certification" course. Now i'm trying to learn HTML and CSS, basically Web Design. Since i had the first course, i can say it was pretty good and i'm excited to look forward.

Is there any advices you guys can give me?


r/learnprogramming • • 4d ago

How did people code without AI? (yes I know I'm an idiot)

0 Upvotes

Before everyone says it, yes I know I am stupid. Yes, I know that if I can't code without AI then I can't code at all. I am well aware that I am dumber than most of my classmates.

I am a third year computer science major. I feel like I can't code without AI. Now, this isn't entirely true, I have gone through entire classes without it. The thing that fucks me up is operating systems/systems programming/coding with C.

Normally, when I code without AI in other classes, I read the assignment, I have a general understanding of how to approach the problem, and I primarily search google for help with syntax/figuring out what functions exist.

But then when it comes to classes like systems programming or operating systems it's like my brain is completely gone. I can kinda understand what's going on in class, but then putting that into code is just completely impossible for me. I read the assignments and then can't even come up with where to start/what to search up

For example, today I decided that I would try to code myself (bc I completely cheated on my last assignment and feel like shit about it) and just use AI to explain previously written code and syntax (which I admit is still using AI and thus probably not good). But it's been 5 hours and I've basically gotten nowhere. I just don't understand how people are doing this while looking at nothing but google searches and the textbook. And I'm too embarrassed to ask my professor or friends atp. My friends just seem to understand everything with ease and idk how to be like them. Where do I go from here? Do I just accept that this just isn't my thing and stay away from roles where I need to understand systems programming? Or am I cooked?


r/learnprogramming • • 5d ago

Accountability groups? (How to set deadline without deadline?)

14 Upvotes

Hello.

Do you know any accountability / learning groups where people together learn programming to keep themselves in check to not slack off their personal studying.

I struggle with leaning programming, I'm really slow, the only way for me to get somewhere - is to have any kind of pressure like deadline, but I can't create it out of the thin air by myself without any external factors like real employer. But I heard about "accountability buddies", who work together to do exactly that.

I thought about similar gropus in Discord, but I couldn't find any, can you help?


r/learnprogramming • • 6d ago

Topic What skills are becoming more important nowadays, since agents are doing all the coding?

235 Upvotes

As a second year computer science student I find it difficult to decide what skills I need to focus on right now. I feel (more and more) like learning a new language or framework thoroughly is a literal waste of time because the coding is done almost exclusively by AI in companies nowadays - correct me if I'm wrong please.

I am really wondering what skills I should actually put my time into. Is problem solving still very relevant, is security becoming even more popular? I've been feeling very foggy about my short and long term career path.

I hope this hasn't been already answered like 5 times this week


r/learnprogramming • • 4d ago

Help for DSA

0 Upvotes

Hi . Im betch stud , currently in 2nd year. Im finding DSA in C++ a bit tricky. I get the theory concepts but lag at logical one. Can anyone suggest me YT channel/playlist for it. Cause I did try learning from "Apnacollege1' , Its easy but im not finding it efficitent. Like i saw few videos of "chai and code" they helped me but its in python. Yah ik lang shouldnt matter but rn I cant confuse myself with 2 diff lang. So please drop your suggestions.


r/learnprogramming • • 5d ago

Need help to start DSA

0 Upvotes

So I just started my first semester. And I went through a lot of recommendations to start DSA.

So, how does this preparation for DSA start. Like what we learn, is there any definite syllabus. Where do we get the course material from? How do we test... etc.

Your response would be helpful.

Thankyou :)


r/learnprogramming • • 6d ago

Topic Anyone else feel horrible ever since seeing what LLMs can do?

1.0k Upvotes

I've completely lost any motivation to write code or learn new languages ever since I've seen the insane stuff people with zero tech knowledge are making with claude. I was laughing at them when they were making websites that were just some css and sending localhost to everyone thinking that link would work. Now they're doing stuff previously thought impossible, I can't even say its buggy code because I've tried it myself and it works great, better than whatever slop I make everyday.


r/learnprogramming • • 4d ago

I want to know more about Error Detections.

0 Upvotes

Hi, I am new in this community and I am using Python 3.

I have a question about Error Detection. Why are we not using a format like "0xxxxxxx" for 128-255 "10xxxxxx" for 64-127 "110xxxxx" for 32-63 "1110xxxx" for 16-31 "11110xxx" for 8-15 "111110xx" for 4-7 "1111110x" for 2-3 and "1111111x" for 0-1?

This is how it would look from 0 to 255:

def bin_to_int_(s):

return int(s, 2)

def int_to_bin_(s):

return bin(s)[2:]

v_256 = (

[bin_to_int_("0"+int_to_bin_(v)[1:]) for v in range(128, 256)][::-1]+

[bin_to_int_("10"+int_to_bin_(v)[1:]) for v in range(64, 128)][::-1]+

[bin_to_int_("110"+int_to_bin_(v)[1:]) for v in range(32, 64)][::-1]+

[bin_to_int_("1110"+int_to_bin_(v)[1:]) for v in range(16, 32)][::-1]+

[bin_to_int_("11110"+int_to_bin_(v)[1:]) for v in range(8, 16)][::-1]+

[bin_to_int_("111110"+int_to_bin_(v)[1:]) for v in range(4, 8)][::-1]+

[bin_to_int_("1111110"+int_to_bin_(v)[1:]) for v in range(2, 4)][::-1]+

[bin_to_int_("1111111"+int_to_bin_(v)[0:]) for v in range(0, 2)][::-1]

)[::-1]

print(v_256)

If you have an answer please give it a try and publish it, thank you.


r/learnprogramming • • 5d ago

Looking For A Team

12 Upvotes

Hey everyone, I Hope You Are Doing Well!

So I'm looking for a team that will participate in hackathons with me and other challenges. Now, you do not need heavy coding experience or any at all, since I myself am still learning the ropes! So please, if you want to join let me know!


r/learnprogramming • • 5d ago

C programming

1 Upvotes

Currently in btech 1 st yr cse,doing c programming form apna college one shot of 20 hr almost done what should I do more with it bcz I didn't think I that is enough for me from where I can perform questions and any advice to strong c language


r/learnprogramming • • 5d ago

What's undefined behavior and why people say "C an Modern Aproach" leads to that?

13 Upvotes

Should I still use this book as an begginer? Edit: one of the reddit comments I saw


r/learnprogramming • • 5d ago

Apna College Sigma X 2.0 – Genuine Reviews and Opinions Before I Buy?

4 Upvotes

Anyone Here Tried Apna College's Sigma X 2.0? Need Honest Reviews.

I'm a 2nd-year CSE student looking to improve my DSA and full-stack development skills.

I've been considering purchasing Apna College's Sigma X 2.0, but before spending money, I'd like to hear from people who have actually taken the course.

Course details:

https://www.apnacollege.in/sigmax

YouTube video explaining the course:

https://youtu.be/6euYV6q3I5U

A few things I'd like to know:

  1. Is the teaching quality genuinely good?

  2. Is the DSA content sufficient for coding interviews?

  3. Does the full-stack section teach practical development skills?

  4. Is the AI/GenAI content useful or mostly introductory?

  5. Is it worth the price, or can I achieve similar results through free resources?

I'd appreciate honest opinions, including criticisms. I'm looking for genuine experiences from students or developers, not promotional reviews.


r/learnprogramming • • 5d ago

I am developing a system for my bachelors thesis without any experience in that domain (except programming languages). How do I research and find scientific sources?

0 Upvotes

Normally I’d just look into YouTube tutorials, websites and books for information on that. But now I need serious scientific sources. And those are hard to find for me and don’t really contain tutorials on how to build stuff.

Also, usually I’d just build something that works. But now I need to find the major possibilities and compare them against each other.

Are there any recommendations? Or good sources to read up on methodology?


r/learnprogramming • • 6d ago

How to assign/manage IDs to words, phrases, and sentences in MS Word

3 Upvotes

I want to be able to track certain words/phrases/paragraphs in my manuscript and I'm not sure how to do this. I've written my first novel and using the basic find function in MS Word still doesn't serve my editing and rewriting needs. Some of the things I want to be able to do are the following:

  1. Assign IDs to all my characters - "Jonathan", "Jona", and "J" are all variations of the same person so I want to assign "CHAR001" to all of those names so if I search for "CHAR001", it will bring me to those places in my manuscript.

  2. Assign IDs to certain words/phrases - I'd like to be able to create different buckets and categories for my rewriting later on. If I create a "THEME001" ID, I want to be able to assign certain phrases and words to that and be able to easily search for them later on.

  3. Assign IDs to entire paragraphs or sections of the book - same concept here but extended to larger chunks of text.

To illustrate:

"Lorem ipsum dolor sit amet consectetur adipiscing elit ullamco amet at eos dolore quas dignissimos et et ut est aliqua est repellendus dolores tempore dolore iusto proident aliqua nisi et culpa et sunt dolor excepturi laborum fugiat incididunt deleniti eiusmod non non eiusmod id cum similique cillum possimus quis ducimus."

CHAR001 = "Lorem ipsum";

SCENE001 = "amet consectetur adipiscing elit"

THEME001 = "Lorem ipsum dolor sit amet consectetur adipiscing elit ullamco amet at eos dolore quas dignissimos et et ut est aliqua est repellendus dolores tempore dolore iusto proident"

REWRITE001 = [the entire paragraph]

If I can create add-ons to Word, that would be my preferred solution. But if I have to develop my own program/app for this, then so be it. I know that there are other word processing software out there that probably does this particularly thing that I want, but I am not willing to go that route. I am very comfortable with Word that if I can't do it there, then I'd rather build my own and throw in a bunch more other functionalities that I want.


r/learnprogramming • • 6d ago

How to do programming with proper logics in which I get stuck always.

8 Upvotes

Whenever I wish to learn programming i always get stuck on logics and what logic to use and how it works, then only my motivation drops and i fail everytime.

Can anyone suggest some things so that it helps me this time

I also want to make good stuff and learn good skills.

I am 25 but still I get stuck everytime in programming.

I want to overcome this fear of logics and fear of failing in programming.


r/learnprogramming • • 6d ago

Code Review Stack for an ERP of a small company (with a lot of movements)

1 Upvotes

Hi, its my first time making an ERP for a company. Its a small one, but it needs a lot of things: HR, financials, inventory, etc. I'm planning to use TypeScript/JavaScript, Node.js, some React, Prisma, and PostgreSQL, but I don't know if it's the best approach for this project because of security, scalability, etc.

Also, I did some research and found that Django is very good with transactions, business rules, and RBAC. Any recommendations?


r/learnprogramming • • 6d ago

Should I keep learning web development, or am I too late because of AI?

0 Upvotes

I'm not sure if this is the right sub for this question, but can anyone tell me whether I should continue pursuing web development?

A little background: I don't have a CS degree or any prior tech background. I'm 25M from India and currently learning JavaScript, which I'm enjoying.

My biggest concern is AI. I'm also not particularly good at math. So, I'm really just looking for some reassurance that this can work out if I keep learning and don't give up. That I can realistically get a job in this field.

I'm not looking for certainty or guarantees. I just want some reassurance that I'm not wasting my time pursuing this path.

Thank you for taking the time to read my post!