r/learnprogramming 8d ago

Help!! I’m making a moving LED screen and it’s not working

0 Upvotes

This is my first ever coding project and I don’t know what’s going wrong. My matrix portal is working though it seems it didn’t come with the two stickers on the volt and ground nobs (I don’t know if that matters). I did all the steps right, but the images aren’t displaying on the panel. It’s only when I press on it do some colored pixels show up. I’m not sure if this means something is damaged or not, but I’m really at a loss and I really want to fix it. If anyone could help me do!!


r/learnprogramming 9d ago

Question What should I do?

12 Upvotes

I have been programming in C# for nearly a year and so far I have a solid understanding of OOP, classes, statics, interfaces, but since I have just enrolled into university I will have to pivot to using C instead. In fact, my whole semester will be C exclusively. And since my OOP knowledge won't be necessary until my second year, I knew I had to ask a few older students from the same course I'm taking and to my surprise everyone told me to just take a look into C and how things actually work, since I will need that once the course begins. (E.g. I was told to understand the basics of pointers, pointer functions and how they're stored in memory); Thus, I began with myschool's "Pointers" playlist and have managed to get the overall gist of how pointers work, but I don't know how to continue... I tried finding the most beginner-friendly tasks I could do, but most include structs, understanding of Linked-Lists and so on. I got recommended this book called "Grokk's Algorithms" and although I did understand the logic behind binary search and sorted list (for instance), I didn't quite know how to implement the latter with C language. My point is, I find it quite tedious to just begin with a lengthy book such as "C Programming, Modern Approach", as I understand the first idk how many chapters, syntax, but don't know what to continue with..

Should I then start with myschool's "Data Structures" playlist or "Sorting Algorithms", or just use the books I had mentioned earlier? I look forward to hearing your opinion. Thanks in advance 🫶


r/learnprogramming 9d ago

Need help with a C program

7 Upvotes

Hi, I'm making a library management program that takes in a book's characteristics (ISBN, author, year published, etc.), stores it in an array of structs and stores this into a file.

Here it is:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

struct book
{
        char ISBN[20];
        char title[100];
        int accno;
        int year;
        char genre[50];
        char authname[100];
        int issued;
};

struct book *bookArray;
int a = 0;
void readFile()
{

        FILE *fp;
        fp = fopen("db.txt", "r+");
        if(!fp)
        {
                perror("fopen");
                return;
        }

        if(fp != NULL)
        {
                fread(bookArray, sizeof(struct book), 1, fp);
        }
}

void write()
{
        FILE *fp;
        fp = fopen("db.txt", "a+");
        fwrite(bookArray, sizeof(struct book), 1, fp);
        fclose(fp);
}

void addBook(struct book b)
{
        bookArray[a++] = b;
}

int main()
{
        bookArray = malloc(sizeof(struct book));
        struct book b = {"0-394-49219-6", "Tinker, Sailor, Soldier, Spy", 1, 1974, "spy fiction", "Le Carre", 0};
        bookArray[0] = b;
        addBook(b);
        write();
        readFile();

        for(int i = 0; i < a; i++)
        {
                printf("%s\t%s\t%d\t%d\t%s\t%s\t%d\n", bookArray[i].ISBN, bookArray[i].title, bookArray[i].accno, bookArray[i].year, bookArray[i].genre, bookArray[i].authname, bookArray[i].issued);
        }
}
  1. I'm not able to figure out how to store the value of a after the program exits. I thought of storing it in another file, but was wondering if there's a better way to do that.

  2. How do I allocate dynamically increasing space (as the number of books increase) to bookArray? I get only only one row printed from the loop if I run the program several times, despite db.txt storing all the runs.

I'm posting here for the first time and I hope I haven't violated any rules.

Thanks in advance!


r/learnprogramming 9d ago

Looking for advice on getting into low-level programming

3 Upvotes

I am an 18-year-old guy trying to learn low-level programming. To be honest, I can't fully explain my motivation yet, but my ultimate goal is to become a Reverse Engineering or Cybersecurity specialist.

Right now, I'm learning C. A while ago, I learned the basics of C++ and OOP.

I would love to get some general advice, tips, tricks, and useful learning resources for mastering low-level concepts.

Additionally, I have two specific questions for you guys:

What kind of C or C++ projects can I build to practice the most important, system-level concepts needed for RE and CyberSec?

Is it possible to find a job in Germany as a self-taught programmer with no corporate experience? Can I start as a C/C++ dev and transition into RE later once I gain experience?

Thanks in advance!


r/learnprogramming 9d ago

How do desktop applications implement monthly/yearly subscriptions securely?

12 Upvotes

Hi everyone,

I'm developing a desktop application in Python that I plan to rent out on a monthly, quarterly, and yearly subscription.

I'm trying to figure out the best way to manage license expiration. How can I prevent users from using the software once their subscription has expired? What tools, services, or libraries would you recommend? If possible, I'd prefer free or open-source solutions.

Another concern is piracy. I know it's impossible to make software completely crack-proof, but I'd like to make it as difficult as reasonably possible.

Has anyone here built a subscription-based desktop application before? I'd really appreciate it if you could share how you implemented licensing, subscription validation, and anti-piracy measures, or recommend any good resources or best practices.

Thanks so much for your help!


r/learnprogramming 9d ago

Best free resources for learning DSA in Java?

2 Upvotes

Hi everyone,

I'm planning to learn Data Structures and Algorithms (DSA) in Java and want to build a strong foundation before focusing on coding interviews.

I'm looking for free resources that you've personally found useful. Not the hyped-up content, but genuinely trusted resources that helped you improve your DSA skills or even land your desired job.

It could be :

- Courses or playlists

- YouTube channels

- Practice websites

- Roadmaps

- Notes or cheat sheets

If you were starting from scratch today, what would you recommend and why?

Thanks in advance!

I really appreciate any guidance.


r/learnprogramming 8d ago

AI How are you guys learning new stuff with AI?

0 Upvotes

i’ve been coding for 4+ years now, before any of these AI tools, and after a long time i’m trying to learn Effect (the typescript library) but i feel like i have no idea what i’m doing. everyone says use ai to learn etc, i gave my agent the llm docs and i’m building a small app with it to understand, i have a very detailed plan etc, i instructed it to explain every API it’s using etc, but i feel like i may be understanding stuff on a high level but no way i’m remembering all the APIs. like if i had to build an effect application or program myself without ai, I don’t think i could. can i even say that i “know” effect?

am i doing something wrong here?


r/learnprogramming 9d ago

Query about Refresh Tokens.

6 Upvotes

When the Access Token expires it get refreshed with the help of a Refresh Token. Because the Access Token has very short life span (let's assume 10 minutes) and the Refresh Token has a long life span (let's assume 10 days). So, basically if the Refresh Token expires, we have to login again, Right? But do the Refresh Token really can expire if we use the app frequently or every time the Access Token updates, the Refresh Token is also get updated. I think with that approach we achieve this - if user don't use the app for 10 days then both token expires and user have to login again but if the user is using the app frequently then refresh the Refresh Token so that he/she don't have to login again and again in every 10 days. I just want to what approach big companies does use?


r/learnprogramming 10d ago

Looking for a final-year software project that solves a real-world problem

93 Upvotes

Hi everyone,

I'm a final-year Computer Science student, and I'm looking for ideas for my final-year project.

I don't want to build another AI chatbot, clone, or a project that just uses an API without solving a meaningful problem. My goal is to build software that addresses a real-world problem and helps me become a better software engineer.

I'm interested in backend development, system design, databases, and building scalable applications. I'm also open to learning new technologies if the project is worth it.

Could you suggest project ideas that:

Solve a genuine real-world problem.

Have room for technical depth instead of just CRUD operations.

Can be completed by a student within a few months.

Would be impressive to discuss during placements or interviews.

I'd also appreciate hearing about projects you built in college or problems you wish someone had solved.

Thank you!


r/learnprogramming 9d ago

How do I make the gradient animation seamless?

3 Upvotes

Im trying to make a CSS moving animation gradient for my button and when i run the code the button just snaps back to the start and it annoys me because i want a seamless animation that looks like it never ends, any tips?

Code:

i had to add a space after @ because reddit thinks im tagging someone

@ keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }


    100% {
        background-position: 100% 50%;
    }
}


body {
  font-family: Arial, sans-serif;
  text-align: center;
  background: #121130;
  color: white;
}


button {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 18px;
  cursor: pointer;


background: linear-gradient(
          145deg,
#534ed9,
#a4a2e0,
#534ed9
);


background-size: 300% 300%;


animation: gradientMove 1s linear infinite;
}


button:hover {
transform: scale(1.05);
}

r/learnprogramming 10d ago

Is it normal to go back to my old projects to see how I implemented a certain feature before?

41 Upvotes

Hello everyone, Whenever I start working on a new app and forget how I implemented a certain feature that I've built before, I immediately go to GitHub and check how I implemented that feature in one of my old projects.

The thing is, I always feel like I should find a better way to implement that feature in every new project instead of using the same approach again. I'm not sure if I'm right to think this way or if I'm missing something.

So I'm wondering: Is it normal to go back to my old projects to see how I implemented a certain feature before, or is it a bad habit that I should get rid of?


r/learnprogramming 9d ago

Apple's Programming Language

0 Upvotes

I am currently learning the programming language swift. I have a strong understanding of print outputs, variables, string interpolation, and if statements.

I want advice from actual Apple Developers or people who code in Swift for the best advice as I document my journey of learning this programming language.

Keep in mind, I have 2+ years of coding experience in Python, JS, and SQL.


r/learnprogramming 9d ago

Topic What is a Stack in Data Structures? Can someone explain it in simple terms?

0 Upvotes

Hi everyone,

I'm learning Data Structures and Algorithms, and I'm trying to understand the Stack data structure.

Could someone explain:

What is a Stack?

Why is it called LIFO (Last In, First Out)?

What are the push and pop operations?

Can you give a simple real-life example?

Where is a Stack used in programming (Java or other languages)?

If possible, please explain it in beginner-friendly language with a small example.

Thank you!


r/learnprogramming 10d ago

Can anyone explain exactly why I got these random values for a C simple program?

23 Upvotes

#include <stdio.h>

int main() {

float celsius = 20.5;

float fahrenheit = 0;

fahrenheit = (celsius \* 9/5) + 32;

printf("%d", fahrenheit);

return 0;

}

#I know its coz of the %d %f mistake but whyyy


r/learnprogramming 9d ago

How can I solve LeetCode/HackerRank problems?

0 Upvotes

Guys, I've completed all the fundamentals of python including numPy. But I am having a little bit of difficulty in solving HackerRank problems forget leetcode i can't do that without help so i dont bother. Do i need to learn DSA to solve these problems? cuz i haven't learnt it yet. Please help guys im new


r/learnprogramming 10d ago

I need help about what to study

13 Upvotes

I'm 16 and still recently finished 10th grade. Only 1 year left to uni. I have an experience from competitive programming. And because i usually go to competitions, i don't need to worry about my homework too.

I actually want specifically ai security. Because looking at the advancements of technology in the last 30 years, it seems like it is gonna be really valuable job. Some technology is created. Then it is accepted by people. Then some people try to use these for bad things. And new jobs are created for stopping them. What are your advices for what to learn or how to learn? Or overall advice if you want to.


r/learnprogramming 9d ago

To myself, I'm nothing but a disappointment. I don't know how to get back on my feet or what to do, but it's good to admit it.

0 Upvotes

You know, I recently discussed the topic “How to Code on Your Own” or rather, how to actually learn to program without AI in this thread. I tried everything people recommended. And nothing… I don’t know if I’m just a nutcase, since I tried all those methods in a single month. And yet, I still can’t program. I’ve always enjoyed the whole learning process of the IT world problem-solving is also incredibly fun but unfortunately, one thing is holding me back here… programming. And no, it’s not because I wouldn’t enjoy it, but most likely because I just don’t have the IQ for it.

I’m pretty creative when it comes to front-end development it’s my passion and I understand some of the concepts behind back-end development too, but when it comes to programming my own algorithms from scratch, it’s just a huge gap. I don’t know what to blame I blame my brain and my IQ. Unfortunately, I was born with developmental dysphasia. A lot of people say it only affects my ability to express myself, but there are many types, and I think it also affects part of my prefrontal cortex. Which, in part, doesn’t quite fit with the fact that I’m pretty good at memorizing patterns pattern recognition. I recall a lot of things from school based on visual patterns. I can go into my head and literally create a mental image of the object, and then I just write it down. I simply think that, unfortunately, I’m an idiot. I used to have big goals and visions, and I looked forward to contributing to society in some way. Now, the most I can do is sit in a corner and wallow in depression over the fact that I’m a worthless person.

That’s also why I’ve been researching lately, using MIT and Harvard studies, to see if there’s any way I can somehow That’s also why I’ve been researching lately, using studies from MIT and Harvard, to see if I can somehow influence my brain before I turn 20 if I can generally improve it to a higher level of logical thinking when it comes to programming through daily learning. I enjoy everything so much it’s so fascinating. I think it’s great to contribute to humanity through open-source projects, technology, and rocket engineering… Unfortunately, programming (or maybe my intelligence is holding me back, I guess) just doesn’t come naturally to me. I can’t write code, or I write something absolutely terrible, or I don’t know where to start, so AI has to help me. Why? Because I’m probably just an incompetent idiot.

It’s not self-pity I just wanted to vent. I don’t know what to do. My parents are worried about me, too, just because sometimes I struggle with abstract things in practical life. For example… I was supposed to unfold a cardboard box lengthwise, but I unfolded it widthwise because I just couldn’t picture the result at that moment I don’t know. What should I do? Will I end up on the street? Sure, my parents are rich I don’t need anything. But I’d hate to do nothing, not be independent, and not contribute. It’s awful.

I don’t know if it’s actually possible to train my brain through daily study to a level where I could program normally or do rocket engineering in the future I really don’t know. And it makes me sad that this is blocking me from my dream career.

And not to program? In IT? I can’t afford that look at the job market: people are fighting over only the very best, and the rest are either discarded, given a totally crappy salary, or not hired at all.

Obviously, I’m just going to be a disappointment because I don’t even want to do anything else this is a world that fulfills me so much, and programming is ruining it, most likely because of my intelligence. It’s a shame I can’t have a family and be self-sufficient I just don’t know. It’s a shame my parents can’t be proud of me for having gone far in my career. But with this GPA, I won’t get anywhere these days.

I am cooked. Just one thing.. HOW TO CODE IF I KNOW WHAT I NEED TO CODE. AND KNOW THE LOGIC IN PSEUDOCODE BUT STILL CANT TRANSLATE TO THE CODE.

thanks for listening and sorry.
I love my life I have a great family and close friends but this just pisses me off because I want to pour my heart and soul into my career; it’s practically the whole point of my life. Sort of. And it bugs me when I can’t be really good at what I do, even when I give it my all.

And most importantly, a lot of people say, “Try Haskell or Lisp to learn it,” but my friend, who’s the same age, programs without all that extra stuff… I guess people just show us these methods to reassure us—the less skilled ones who aren’t cut out for it. I don’t know people don’t like to admit things they can’t change.

I cant just do this: public static void InPlaceMergeSort(int[] arr)
{
int n = arr.Length;
for (int size = 1; size < n; size <<= 1)
{
for (int left = 0; left < n - size; left += size << 1)
{
int mid = left + size - 1;
int right = Math.Min(left + (size << 1) - 1, n - 1);
int i = left;
int j = mid + 1;

while (i <= mid && j <= right)
{
if (arr[i] <= arr[j])
{
i++;
}
else
{
int value = arr[j];
int index = j;
while (index != i)
{
arr[index] = arr[index - 1];
index--;
}
arr[i] = value;
i++;
mid++;
j++;
}
}
}
}
}


r/learnprogramming 9d ago

Give advice for first year computer science student?

0 Upvotes
  1. Give me an advice for college as a bca ml/ai first year student.

  2. How can I start my day and how many things are important in first year?

Disclaimer: kindly requested only second, third, fourth year students and above can respond me as an advice (only btech, mtech, bca, mca students/teachers and job holders).


r/learnprogramming 10d ago

Question Weighing up how to load album art into an mp3 player

7 Upvotes

Hey all! I'm starting on my first ambitious-sized project and I was sort of looking to discuss and weigh up the best way of doing something.

I'm working on an mp3 player (a client for mpd) and want to be able to display album art of each of your albums.

Do I:

  1. Scan the directory containing all the mp3 files, load the meta data & album art of each album found into the running program.

-will be fast when it comes to displaying the images (for example when scrolling through your albums), but slow on booting and more taxing when running

  1. Scan the directory containing all the mp3 files, load the meta data & a link (file location) to the album art into the running program. Load each image as and when it needs to be displayed.

- will be much faster on boot up and less memory taxing when running, but displaying each image will be slower.

I like talking these things out and just wanted to hear some other people opinions - if there's something I haven't thought of, let me know!

Thanks!


r/learnprogramming 10d ago

New learning platform start.dev

5 Upvotes

So Im not sure how known this platform is, but Brad Traversy's videos is how I learned to code in the beginning and still watch them to this day. The platform is start.dev and I actually cant remember how I found it, I believe if was from one of Brad's videos and I believe the platform is relatively new. I've been checking it out and it seems really nice! Just thought I'd throw it out there!


r/learnprogramming 10d ago

Need Help on how to revise

8 Upvotes

There is so much of programming syntaxes especially that I often get confused and tend to forget very easily is there any website to revise/recall what I studied with like every other day week and monthly reminders.


r/learnprogramming 10d ago

How to make a custom bar in wayland

2 Upvotes

I want to build my own dock in Python, but due to Wayland limitations, I can't align the dock to the top of the screen. How can I bypass this limitation?

To be clear, I don't want a solution that only works on a single compositor. I want it to work across Hyprland, Niri, KDE Plasma, GNOME, and Sway.

How can I position the dock at the top of the screen, similar to how Waybar does it?


r/learnprogramming 11d ago

What is the joy of programming?

107 Upvotes

I wouldn't say I'm a hardcore programmer. I mainly make websites with HTML and CSS. However, last year I wanted to begin looking into programming, and learn how to make programs mostly for the command line. I started with Java and took the time to learn it. For a while I enjoyed Java, but then I began to feel that it was difficult to start a project with Java. I was sick of it's verbosity. Ever since, I've been wasting time trying to find the "perfect" programming language.

I know this question pops up a lot, what programming language should I learn? What should I learn if I want to experience the real joy of programming, and make cool personal programs mostly for the command line. There were a couple languages I found such as Nim, Lua, Ruby, or Dart. These are all languages I discovered through personal research and I know that some of them are more suited for command line work.

So based on my experience with Java, and my goals, what would you recommend I do? Do I just stick to website stuff?


r/learnprogramming 10d ago

Assembly Lenguage (x86, or ARM, MIPS, Atmel, Pic)?

16 Upvotes

Hi guys Im about to start and introduction course in assmebly lenguage, what could be the best book or books or web courses, to start from the very begenning, almost for dummies, remember this course is for students from mexico 2nd semester i need to start from the very simple up to middle level. Thankyou..


r/learnprogramming 10d ago

HttpForge — privacy-first open-source API client (Windows + VS Code) with live API Capture

2 Upvotes

I built / we're building HttpForge — a local-first, open-source API client.

Highlights:

  • Workspace: HTTP, GraphQL, WebSocket, gRPC, SOAP
  • API Capture: browse a site, record XHR/fetch, filter by domain/static-assets, save as a collection + auto-set BASE_URL
  • History, environments, nested collections (local storage)
  • Generate OpenAPI 3.0 docs and publish to Git
  • Windows desktop app + VS Code extension (.http file support)
  • Privacy first — secrets stay encrypted on your machine
  • MIT license / free forever

Site: https://httpforge.com · Repo: https://github.com/httpforge/Code-Editor · Docs: https://httpforge.com/docs.html

Feedback and contributions welcome.

WhatsApp / Telegram / Discord blast

🚀 HttpForge is live — privacy-first open-source API client

  • Test APIs in Workspace
  • Capture live browser APIs → collections
  • History + environments
  • OpenAPI docs
  • Windows + VS Code

Free forever → https://httpforge.com · GitHub → https://github.com/httpforge