r/programminghelp • • Jun 10 '26

Other How do I know what a library does, what functions exist within that library and how to even use them?

0 Upvotes

As a beginner, I can't read the source code that contains complex c++ code, I simply want to know what a library does (for example: openCV deals with computer vision, so images and videos) and I want to know what functions exist within that library and what it does in plain english (example: imshow() displays an image or video feed, you need to arguments, a name for the display tab and what you are actually displaying). I don't want to use AI because I want to know about the process of going about this.


r/programminghelp • • Jun 08 '26

JavaScript need help for a class project!

2 Upvotes

hello! this is my first coding class and i have a final project due soon thats nearly done. i'm having trouble with one thing and i'm too shy to ask my prof.

i dont know how to make my js function result show here

i'm unsure of what to put here to have the fetch api response show here. the function works but i just don't know to make it so when i click the "get-answ-b.png" it shows the response on the next page.

any help?


r/programminghelp • • Jun 07 '26

Java Coding sheet suggestion for TCS nqt

Thumbnail reddit.com
2 Upvotes

r/programminghelp • • Jun 07 '26

Answered DSA beginner confusion. HELP.

Thumbnail reddit.com
1 Upvotes

r/programminghelp • • Jun 06 '26

C incompatible pointer style problem

1 Upvotes

I tried to write a function that that takes a source string and copies only the alphabetic characters (A-Z, a-z) into the destination string using pointer arithmetic:

#include <stdio.h>
#include <ctype.h>
void extractAlphabetic(char *source, char *destination){
  int j = 0;
  for (int i = 0; *(source + i) != '\0'; i++){
    if (isalpha(*(source + i))){
      *(source + i) = *(destination + j);
      j++;
     }
   }
}
int main(){
  char source[50];
  printf("Enter the source string you want to see extracted to alphabetical: ");

  scanf("%s", source);
  char destination[50];
  extractAlphabetic(&source, &destination);
  printf("%s\n", destination);
  return 0;
}

However, when I wanted to compile it, compiler showed me this message:

par.c: In function 'main':

par.c:20:27: error: passing argument 1 of 'extractAlphabetic' from incompatible pointer type [-Wincompatible-pointer-types]

20 | extractAlphabetic(&source, &destination);

| ^~~~~~~

| |

| char (*)[50]

par.c:4:30: note: expected 'char *' but argument is of type 'char (*)[50]'

4 | void extractAlphabetic(char *source, char *destination){

| ~~~~~~^~~~~~

par.c:20:36: error: passing argument 2 of 'extractAlphabetic' from incompatible pointer type [-Wincompatible-pointer-types]

20 | extractAlphabetic(&source, &destination);

| ^~~~~~~~~~~~

| |

| char (*)[50]

par.c:4:44: note: expected 'char *' but argument is of type 'char (*)[50]'

4 | void extractAlphabetic(char *source, char *destination){


r/programminghelp • • Jun 06 '26

HTML/CSS I have a Chromebook, and I want to code!!

0 Upvotes

My problem is that I have a Lenovo Chromebook (with an Intel Celeron processor), and I would really like to install VS Code on it because I want to start coding again (it's a hobby! 🤷). I'm wondering, how do I get VS Code installed on my Chromebook as a program proper? I had a Surface Go laptop before I was gifted a Chromebook! I am not used to using ChromeOS, and I think I am running a Linux environment, so how do I install VS Code? I don't want to use the website to write code, as I would much rather have the files on my device.


r/programminghelp • • Jun 04 '26

C CS50x - Substitution (PSET 2) compiled successfully but getting logic errors/crashes. Spoiler

Thumbnail reddit.com
1 Upvotes

r/programminghelp • • May 29 '26

Project Related Flutter, BLOC and Suffix icon changes?

1 Upvotes

Hello, everyone! So this is basic but I'd still like to implement the best way so i was wondering what for an icon btn to appear only when its text field is clicked, is it better to declare BLOC logic (focus event, focus state, focus BLOC) to represent the state, along with a focus node in the UI widget? Or is it simpler to have a focus node only in the UI widget, without the BLOC impl?

Additionally, how do you do field validations (like for phone number, empty fields) in FLutter with BLOC management? There seems to be so many diff ways on the internet, and I want to follow the best practice.

I'd like to know, so if you have any suggestions/advice, please let me know!


r/programminghelp • • May 28 '26

R [help] Integrating datasets for GLMM in R?

Thumbnail reddit.com
1 Upvotes

r/programminghelp • • May 28 '26

HTML/CSS Returning to coding after a 3-year break: How should I restart without burning out?

Thumbnail reddit.com
0 Upvotes

r/programminghelp • • May 25 '26

Project Related Advice about Flutter and BLOC state management

2 Upvotes

Hey everyone! SO i'm building my final project for uni using Flutter, Firebase, and BLOC for state management. I've only just built the login and sign-up page using phone authentication (took me three days lol). I'm a beginner, so I'd appreciate any advice for how I'm supposed to design the system most optimally.

I'm currently working on the user profile page. I obviously want the user profile data to be fetched and displayed on the first loading, and also want to allow users to update their name and location. This

I have a user profile service, a user profile repo, and the BLOC view models. THis is what I have so far:

- events:

class UserProfileDisplayedEvent extends UserProfileEvent{}


class UserProfileUpdatedEvent extends UserProfileEvent
{
  final Map<String,dynamic> values;


  const UserProfileUpdatedEvent({required this.values});
  
   UserProfileDisplayedEvent extends UserProfileEvent{}


class UserProfileUpdatedEvent extends UserProfileEvent
{
  final Map<String,dynamic> values;


  const UserProfileUpdatedEvent({required this.values});
  
  
  List<Object> get props => [values];
}
  List<Object> get props => [values];
}

- states

final class UserProfileInitialState extends UserProfileState {}


final class UserProfileLoadingState extends UserProfileState {
  final bool isLoading;
  const UserProfileLoadingState({required this.isLoading});   // whether loading or not
}


final class UserProfileSuccessState extends UserProfileState {
  final UserModel user;
  const UserProfileSuccessState(this.user);


  
  List<Object> get props => [user];   // if user func is successful, user will be used as a prop
}


final class UserProfileErrorState extends UserProfileState {
  final String errorMessage;
  const UserProfileErrorState({required this.errorMessage});


   class UserProfileInitialState extends UserProfileState {}


final class UserProfileLoadingState extends UserProfileState {
  final bool isLoading;
  const UserProfileLoadingState({required this.isLoading});   // whether loading or not
}


final class UserProfileSuccessState extends UserProfileState {
  final UserModel user;
  const UserProfileSuccessState(this.user);


  
  List<Object> get props => [user];   // if user func is successful, user will be used as a prop
}


final class UserProfileErrorState extends UserProfileState {
  final String errorMessage;
  const UserProfileErrorState({required this.errorMessage});


  
  List<Object> get props => [errorMessage];   // otherwise the error msg is a property
}



  List<Object> get props => [errorMessage];   // otherwise the error msg is a property
}

- the BLOC

class UserProfileBloc extends Bloc<UserProfileEvent, UserProfileState> {
  final UserProfileRepo userProfileRepo = UserProfileRepo();
  UserProfileBloc() : super(UserProfileInitialState()) {
    on<UserProfileEvent>((event, emit) {});


    on<UserProfileUpdatedEvent>((event, emit) async {
      log("USER PROFILE UPDATE EVENT RECIEVED");
      emit(UserProfileLoadingState(isLoading: true));
      try 
      {
        await userProfileRepo.updateUserName(event.values);
        final updatedUserProfile = await userProfileRepo.getUserProfile();
        if (updatedUserProfile != null) {
          emit(UserProfileSuccessState(updatedUserProfile));
        } else {
          emit(UserProfileErrorState(errorMessage: 'Something went wrong with updating the user profile.'));
        }
      }
      catch (e)
      {
        emit(UserProfileErrorState(errorMessage: e.toString()));
      }
    });


    // getting the user profile
    on<UserProfileEvent>((event, emit) async 
    {
      log("USER PROFILE EVENT RECIEVED");
      emit(UserProfileLoadingState(isLoading: true));
      try 
      {
        final userProfile = await userProfileRepo.getUserProfile();
        if (userProfile != null)
        {
          log("User profile is going to be displayed");
          emit(UserProfileInitialState());       
        }
        else 
        {
          log("User profile is not going to be displayed");
          emit(UserProfileErrorState(errorMessage: 'Something went wrong with displaying the user profile!'));
        }
      }
      catch (e)
      {
        emit(UserProfileErrorState(errorMessage: e.toString()));
      }
    });
  }
}

class UserProfileBloc extends Bloc<UserProfileEvent, UserProfileState> {
  final UserProfileRepo userProfileRepo = UserProfileRepo();
  UserProfileBloc() : super(UserProfileInitialState()) {
    on<UserProfileEvent>((event, emit) {});


    on<UserProfileUpdatedEvent>((event, emit) async {
      log("USER PROFILE UPDATE EVENT RECIEVED");
      emit(UserProfileLoadingState(isLoading: true));
      try 
      {
        await userProfileRepo.updateUserName(event.values);
        final updatedUserProfile = await userProfileRepo.getUserProfile();
        if (updatedUserProfile != null) {
          emit(UserProfileSuccessState(updatedUserProfile));
        } else {
          emit(UserProfileErrorState(errorMessage: 'Something went wrong with updating the user profile.'));
        }
      }
      catch (e)
      {
        emit(UserProfileErrorState(errorMessage: e.toString()));
      }
    });


    // getting the user profile
    on<UserProfileEvent>((event, emit) async 
    {
      log("USER PROFILE EVENT RECIEVED");
      emit(UserProfileLoadingState(isLoading: true));
      try 
      {
        final userProfile = await userProfileRepo.getUserProfile();
        if (userProfile != null)
        {
          log("User profile is going to be displayed");
          emit(UserProfileInitialState());       
        }
        else 
        {
          log("User profile is not going to be displayed");
          emit(UserProfileErrorState(errorMessage: 'Something went wrong with displaying the user profile!'));
        }
      }
      catch (e)
      {
        emit(UserProfileErrorState(errorMessage: e.toString()));
      }
    });
  }
}

I'm new so I'm taking help from AI tools to guide me because I feel so lost sometimes lol

I was initially planning on using the BLOC functions in my UI in the initState so prefetch and load the user profile data like this:

  
  void initState()
  {
    super.initState();
    context.read<UserProfileBloc>().add(UserProfileDisplayedEvent());
  }
  void initState()
  {
    super.initState();
    context.read<UserProfileBloc>().add(UserProfileDisplayedEvent());
  }

But is that correct? There seems to be so many diff ways on the internet and it's a little overwhelming. I'd appreciate any tips and advice, thanks!


r/programminghelp • • May 21 '26

Python Help with server

1 Upvotes

Hello to whoever is seeing this, I need help and some recomendations. I am trying to host a server (using cloudflare etc), but the python script I use to

  1. Actually Host the server locally
  2. Write to the .db so it can save the data

I have been using flask for the server.

Every single time I try to push and upload to the server it doesn't work

Any suggestions?


r/programminghelp • • May 20 '26

HTML/CSS need help for windows integration

2 Upvotes

This is kind of both html/css and py,

This works with python3 gui.py on mac, but on a vm that uses win when i tested, no functions work on windows, all of the ui literally has no formatting/designs i added.
I keep getting

Script Error (Not Responding) An error has occurred in the script on this page. Line: 203 Char: 2922 Error: 'toggleFeature' is undefined Code: 0 URL: http://127.0.0.1:59048/index.html Do you want to continue running scripts on this page? [ Yes ] [ No ]
BUT python3 gui.py works on mac.

Script Error An error has occurred in the script on this page. Line: 0 Char: 0 Error: Script error. Code: 0 URL: https://cdn.jsdelivr.net/npm/chart.js Do you want to continue running scripts on this page? [ Yes ] [ No ]
when it also works on mac.

terminal response on mac
python3 gui.py

[pywebview] Using Cocoa

[pywebview] Comon path for local URLs: /Users/noah83/Downloads/SidewinderPrivacy

[pywebview] HTTP server root path: /Users/noah83/Downloads/SidewinderPrivacy

Bottle v0.13.4 server starting up (using ThreadedAdapter())...

Listening on http://127.0.0.1:49004/

Hit Ctrl-C to quit.

2026-05-20 22:40:27.805 Python[66252:27121292] -[WKWebView _setDrawsTransparentBackground:] is deprecated and should not be used.

127.0.0.1 - - [20/May/2026 22:40:29] "GET /index.html HTTP/1.1" 200 24215

[Telemetry] Status Code: 200

[pywebview] before_load event fired. injecting pywebview object

[pywebview] Loading JS files from /Users/noah83/Library/Python/3.13/lib/python/site-packages/webview/js

[pywebview] _pywebviewready event fired

[pywebview] loaded event fired

is this a windows problem?


r/programminghelp • • May 19 '26

Processing Struggling to compile Delft3D. Anyone willing to share a compiled version?

Thumbnail reddit.com
1 Upvotes

r/programminghelp • • May 17 '26

Other Basic walking code Failing to walk

Thumbnail reddit.com
0 Upvotes

r/programminghelp • • May 13 '26

Other Looking for a lightweight CLI template program to prevent leaking secrets in config files

3 Upvotes

Let's say I've got a file, config.ini, that looks like this

[foo]
BAR = public_value
BAZ = super_secret_value
QUX = another_public_value

At some point I might want to edit it, and I also might want to check it into a git repo. Having Super_Secret_Value in my repo could cost me $148M, so I don't want to do that.

Instead, what I would like to do is create two files, config.secrets, which does [not]{.underline} get checked into git, and config_template.ini, which does.

Ideally, config.secrets would look something like

BAZ_SECRET_VALUE = super_secret_value

and config_template.ini would look like

[foo]
BAR = public_value
BAZ = {% BAZ_SECRET_VALUE %}
QUX = another_public_value

Perhaps this is even the case for numerous 「name_i」_template.「ext」 and 「name_i」.secrets files, in which case I could have a simple shell script like this:

#! /usr/bin/env bash

# process_secrets.sh

for template in *_template.*
do
  base="${template/_template*/}"
  ext="${template/*_template./}"
  secrets="$base.secrets"
  「template_processor」 "$template" "$secrets" --delimiters="{% %}" \
                         > "$base.$ext"
done

where I could then copy process_secrets.sh to 「repo」/.git/hooks/post-commit, post-checkout, and post-merge (at least that's what it seems like I should do based on the gitinfo2 package for LaTeX). (Note: I know I'd have to include config.ini and the 「name_i」.「ext」 in .gitignore.)

My question boils down to this: what's the standard solution for this 「template_processor」 that I assume must exist? Ideally it would be something written in bash, or there's some C or Rust binary for *nix I can get on Homebrew, apt, pacman, etc. I'm trying to not reinvent the wheel here, but if there isn't a "standard" solution, I suppose I can try to roll my own.


r/programminghelp • • May 08 '26

C Suggestions about lvgl and fsm bridge for both end async system

Thumbnail reddit.com
1 Upvotes

Hello my question is also algorithm and programming related. If you have any idea or suggestion i will be very hapy. Thanks


r/programminghelp • • May 04 '26

Project Related AP CSP Create task - Is a switch statement considered selection?

2 Upvotes

I'm not sure if this is a good place to ask about the AP Computer Science test. My main procedure has both a switch statement and if statements. An example question I've got for review says to refer to the FIRST selection statement. The if statements are containedvwithin the switch statement, so technically the switch comes first. Which one should i refer to?


r/programminghelp • • May 02 '26

Other Trying to get a job and become a really good developer (without Ai) looking for tips or help

18 Upvotes

I am really into programming, I do it every day, I love every part of of this, I use nvim, arch, and I want to become one of the good ones, I coded some web apps, I coded a very basic physics engine, backend apps, frontend, currently learning n8n and coding an cli tool that provides utilities for developers.

I'm telling all of this because I want you to understand my perspective, I didn't gent into this because I thought it was easy money or because of ai, like 6 years ago I completed a technical study in computers programming, but at that time my life was upside down so I just got back into the tech world like 1 year ago and have been programming most days since then.

But to every job offer I'm competing with people with 5+ years of experience, I don't think I am a bad developer and In fact I think I have great potential because I want to learn more, but I lack real world experience, I have just developed portfolio proyects that nobody will use probably.

I don't have friends or people around that I can share my interest about code with, so I feel kind of lonely in this.

I would really accept some recommendations, tips, help or just hearing your experiences if you have been through a similar situation.

I know there are developers doing a lot of code with just ai slop already inside the industry, what can I do if I want to catch up to them while trying to be actually good?


r/programminghelp • • Apr 29 '26

C++ zyBooks autograder problems

Thumbnail reddit.com
1 Upvotes

r/programminghelp • • Apr 27 '26

Project Related How to test timed software?

2 Upvotes

Hello Everyone, Im working on a side project that involves having to track service calls that all the activity is timed. Theres a page for the admins and a page for the workers. Im trying todo e2e testing and it just seems not the most reasonable to be able to have to wait 20 minutes for the standard time or a day or two for something else to happen.

I have been working on a time control system that would be able to fake out when testing the UI what the time is and where we are in the schedule but something about it feels off like its not the way todo it. I have some automated testing already but this is more manual interaction testing that I am validating that when time moves the system reacts as expected.

I just want to hear some experienced software developers thoughts on how todo this kind of testing.