/r/AskProgramming
Ask questions about programming.
All questions related to programming welcome. Wonder how things work? Have a bug you can't figure out? Just read about something on the news and need more insights? We got you covered! (probably)
You can find out more about our (preliminary) rules in this wiki article. If you have any suggestions please feel free to contact the mod team.
Have a nice time, and remember to always be excellent to each other :)
/r/AskProgramming
Hi there,
I am currently in my final year and next month my final semester will be arrived. Currently I don't have any idea for that. But when I joined college I had a vision to develop something new as an engineer i should make something but now I am having strong skills in python, Java, javascript, MERN Stack and Little bit of AI & ML.
Kindly suggest your idea about developing an real time product within 6 months instead of doing some late time final year project.
2 years ago every post was about how AI will take our jobs, some people said it will, some people said it wouldn't and some said maybe in 10 years.
I'm more it will take JR roles and jobs being outsourced (perhaps for 30 plus years)
Whats your thoughts?
I'm a software dev.
I can write code and solve problems all day long.
I am NOT a creative guy who can come up with a problem encountered by enough people that they'll pay me to write code to make a solution
Is there any website or something that puts idea guys who have funding in touch with guys like me?
Reddit, Tumblr, Discord, and what is now Trust Café provide text formatting such as italic and bold characters but Facebook, Instagram, X, Bluesky, and LinkedIn do not. Not being able to use italics makes some posts and comments awkward, such as those which include titles of books or movies. These platforms have plenty of other sophisticated features —and now even provide AI functions — yet still have no text formatting. Is there some compelling technical advantage to not allowing italics?
How good can the code be?
Hello everyone! I hope you are doing well.
I'm finishing my studies as a web developer and I really can't decide what to pursue.
I understand that it's very subjective because there are many variables that influence it, but my idea is to get general answers. If I had to choose, I would go for Back-End since I have a good level with Java, Spring, and I know how to handle SQL.
Additionally, I would like to dive more into the low-level industry with Assembly/C or Rust. However, this is just an idea.
I'm open to your thoughts!
I’m an aspiring entrepreneur diving into AI-assisted coding. Please ruin my day. 😅
Here’s the deal: I want you to submit questions below that represent foundational knowledge every developer should know when building an app for users. The simpler the question, the more embarrassing it’ll be if I get it wrong—so bring it on!
About me:
Why I’m doing this:
I’ve heard a lot of warnings about "hitting a wall" as a junior developer when building apps. I want to identify areas where my knowledge might be lacking now before they become roadblocks later.
So… what’s a basic question or key concept you think I should know? Or, what’s a common issue I might not be prepared for?
Thanks in advance for your brutal honesty! I’m here to learn.
I'm a beginning programmer, so my knowledge might be limited.
I was looking at some interesting repos on Github and came across an interesting video sharing platform. It looks to me that I can self host my own version of it... I'm just not sure how. I already read the README but it's a little confusing for me. Can anyone help? I would like to put this project on Netlify so me and my friends can use it.
I don't where else to turn to but here, I'm a 17 year old in high school (Self taught developer) who is currently coding in his free time and I usually do most of my mini projects in rust since I really enjoy it. The problem is that I live in a country that is late to trends and I couldn't find any jobs listing Rust. (If you are wondering which country it's Bosnia and Herzegovina) I currently have a plan to leave the country and pursue my dreams as a Software Engineer. But since it's not 100% sure and I don't even know how I will achieve that I came here to ask which Programming language should I focus on? I really enjoy Rust and Golang but I got a lot of suggestions to do NodeJS. With all the AI coming up I don't even know if I should. I know using AI in a business is a bad move but everyone here is so greedy I wouldn't be surprised for most companies to start using AI to save a couple of bucks. I also wanted to go to college especially for Software Engineer but I need projects on GitHub to show my work and I am now in a stage on what language should I do for my future job in-case I stay here in this war torn country. Please can someone help me?
So I'm in a very complicated economic situation in my life rn, I've been becoming a fullstack dev and working on some freelance projects for 3 years and I got scammed in my first "big" freelance job due to not making a contract because this person was recommended by a person I trust.
Dumb thing to do but it is what it is.
After that I started doing some afilliate marketing for some months, but I didn't got a penny yet and the government of my country it's banning what I'm doing in the next months.
So, thing is I need to start programming again, I don't have a degree I'm a self-taught dev and thankfully I'm a fast learner. When I started my journey my idea was to get a blockchain dev job because they had a bigger salaries, my first project was a eth wallet in 2021 and chatgpt didn't exist back then. I need to get a remote job abroad because in my country a Fullstack Jr won't get paid more than 1k a month, one of my friends is a Sr and a PM and it's at 2k a month. Yeah my country sucks.
My question is, do I improve my web3 skills and learn the new things to get a Blockchain Jr Dev job? Or do I keep it simple and try to look for a Fullstack or Frontend (I really enjoy front end work) Jr job? How hard it's to get an entry level blockchain job abroad? And the same question for traditional dev job.
I have been coding for about a year or so now and have always been using a roadmap that I made myself to keep me on track . I’m wondering now if that is what other people do or is it not the best way to learn / stay on track ?
Hi everyone, havent used reddit in forever and this may not be the place but thought this might be worth. Im about to graduate from college with a BS in Cybersecurity and feel like im struggling on finding jobs even on entry level stuff. I feel like I dont really know everything or anything because of how i learn and schooling being all online. I know some basics in AD, python, java, and some experience at this point with pentest tools like wireshark or SETOOLKIT. Does anybody have any places to look or types of searches i could do for positions that would fit me or at least be on more of an entry level? I enjoyed coding alot but classes would change languages so frequently and the ethical hacking side of things has also been interesting but I feel like theres just no positions out there that would accept me where im at. Thanks!
Hi everyone,
I come from a C++ background in game development and am comfortable with most programming languages. While I’m still learning and building my skills in game dev, I’m looking for ways to earn money to support myself.
For example, I’ve been considering web development since it seems to have a lot of demand. If I were to go that route, what framework or technology would you recommend I learn to quickly start freelancing or getting small projects?
I’d also love to hear about other fields or opportunities that might fit my skill set. Ideally, I’m looking for something flexible so I can continue working on game dev in my free time.
Thanks in advance for your advice!
The project is compulsory and I along with 4 of my friends have decided to make a photogrammetry software (a software which will convert photos of an object into a 3d model) which will produce at least a rough 3d model and rough estimation of the dimensions of the object. I am the group leader, and I am the one who came up with this idea, but I am not sure that we will be able to meet the 1-month deadline.
I was thinking to use a generic 720p webcam to take photos and somehow convert it into 3d models (It doesn't have to be perfect, just as long as it gives the general idea and dimensions of the object, its fine). Me and all of my friends only have experience coding in c (basic things such as structures, functions and file handling). We do have 2 of our teachers who can help us a little bit but since they have no experience in 3d modelling they said they won't be of much help. I do have some experience in blender which is the software I was thinking of using.
We want to make the software mostly from scratch (and a lot of help from the internet) and not using any other software that'll do the work for us). Is it possible for 5 guys with this little coding and software developing experience to make this?
I have exams going on for about 2 weeks before a winter break of 1 month (which is when we're making it) so we have time to change our mind.
TLDR: I along with 5 of my friends have 2 weeks to change our project, project is a software which will be using a webcam to take the photos of a small object and converting it into a very rough 3d model in another software (preferably blender), is it possible for 5 guys who know only c (basic structures, functions and file handling, that's all) to complete this project in 1 month?
Hi everyone,
I’m currently developing a kiosk application using JavaFX. The app is used by guests for check-in, making payments (integrating with an EDC), and issuing keys from a key dispenser. While JavaFX has served us well, we’re facing challenges with creating responsive layouts that adapt to different screen sizes and orientations (landscape/portrait).
I’ve been considering switching to a more modern framework that offers:
After researching, I found that frameworks like Flutter could be an option, as it supports desktop apps and cross-platform development. However, I’m concerned about:
Would Flutter or another framework like Electron solutions be better suited for such use cases? Or should I stick to JavaFX and find ways to optimize its responsiveness?
Any advice, experiences, or suggestions would be greatly appreciated!
Hey everyone! I’m currently an assistant manager (unofficial title) at a boba place. Recently, my manager created an Excel sheet for tracking cash on hand, but I decided to take it a step further by writing a Python script to expand it into an automated inventory & cash management system.
I’m updating my resume and wondering if it makes sense to list this job as my only work experience, focusing on the technical skills I used. Would this showcase my abilities effectively?
Any opinions on this would be greatly appreciated!
Ok so I'm working on building a clone of chatgpt and trying to use OpenAl api by creating a secret key.
The problem I'm facing is:- I've generated the secret key, copied it and pasted to my .env file of my folder and using secret key from there. Now when I'm typing any message on my project, the gpt isn't responding (it's showing 500 server side error). Idk what is the problem.
Can someone help me out by identifying what exactly can be the reason for the error and how to overcome it.
Note:-
I'm building the project using MERN and writing code in typescript
The secret key is valid. So no problem with secret key generation.
Hello everyone!
I’m a new researcher, currently delving into topics related to code generation within specific domains. My focus is on utilizing structured languages like JSON to describe domain-specific problems (for instance, CFD), and then generating efficient code such as shader code targeted at Vulkan backends based on these descriptions.
However, I have some questions, as I’m not very familiar with the field of code generation, and my online searches over the past few days haven't yielded any classical papers on the subject for me to read.
My questions are:
I would greatly appreciate any responses or guidance!
Thank you!
I've read that in order for a server to be considered stateless, it must not store any information about the client and sessions are not stateful because the clients information are stored on a server.
My question is, if we decide to store the state on a centralised database where all servers can access the data, does it make the server stateless?
Hello everyone I am 3 yeo experienced frontend developer and I started my masters in computer science and we are gonna learn machine learning so I need to learn and improve myself in python. I know js and i am open to any suggestions or roadmaps when i learn python. I don't want to take notes or watch videos all day bc i cannot learn like that, i am learning by doing things so project advice would be great.
Hi everyone,
I’m working on a problem involving the Banker’s Algorithm, and I’m stuck on determining the smallest value of x for which the system is in a safe state. Here’s the problem setup:
Problem Description:
The system has 4 processes and 5 allocatable resources. The current allocation, maximum needs, and available resources are as follows:
Process | Allocation | Max | Available |
---|---|---|---|
P0 | 1 0 2 1 1 | 1 2 1 3 | 0 0 x 1 2 |
P1 | 2 0 1 1 0 | 2 2 1 0 | |
P2 | 1 1 0 1 0 | 2 1 3 1 0 | |
P3 | 1 1 1 1 0 | 1 2 2 2 1 |
Objective:
What is the smallest value of x such that this is a safe state?
Hints provided:
I’ve calculated the needs matrix and tried different values for x, but I’m not entirely sure how to proceed with finding the exact smallest x that ensures the system remains in a safe state. I’d appreciate if someone could guide me through the steps or point me to resources that explain this process in detail.
Thanks in advance for your help!
What I’ve Tried So Far:
Process | Allocation (A) | Max (M) | Need (M - A) |
---|---|---|---|
P0 | [1,0,2,1,1] | [1,1,2,1,3] | [0,1,0,0,2] |
P1 | [2,0,1,1,0] | [2,2,2,1,0] | [0,2,1,0,0] |
P2 | [1,1,0,1,0] | [2,1,3,1,0] | [1,0,3,0,0] |
P3 | [1,1,1,1,0] | [1,1,2,2,1] | [0,0,1,1,1] |
Now, given the availability vector, we know that R₁=0, R₂=0, R₄=1, R₆=2 are fixed, but we want to determine R₃.
A process can execute if its resource requirements (from the Needs Matrix) are less than or equal to the resources currently available. For each process Pᵢ, we check if:
Need[i][j] ≤ Available [j] ∀j
Where:
− Need[i][j] is the need of process Pᵢ for resource Rⱼ.
− Available [j] is the current availability of resource Rⱼ.
If Need(P₀)=[0,1,0,0,2], then:
- For R₁: 0 ≤ 0 (satisfied)
- For R₂: 1 ≤ 0 (not satisfied, so P₀ cannot run yet),
- For R₃: 0 ≤ x (always satisfied because 0 ≤ x for any x ),
- For R₄: 0 ≤ 1 (satisfied),
- For R₅: 2 ≤ 2 (satisfied).
Since all conditions are not satisfied, do we state that P₀ cannot run? Do we repeat this calculation process for the other P's? But I am not sure how we get to the point of determining the smallest x.
Any help is appreciated!
I’m a junior in college and I cannot code like at all. I use chat gpt on all my assignments, I went into computer science never having coded before but I was fascinated and inlove with the idea of creating something by programming and I want to be able to do it so badly but my school moves so fast that I feel like i never get a chance to learn. I’ve tried following youtube tutorials, I’ve tried several online classes, but for some reason I can never learn. I’ve been too stubborn to drop the major because my parents will kill me, and I also don’t want to drop it because i genuinely want to learn so bad but for some reason it’s like i can’t. I will literally pay someone to walk me step by step and teach me how to code in person if i have to that’s how serious I am. If anyone has any advice or has ever been in a similar position please help. Thank you!
Hello I've recently begun learning HTML and CSS (JavaScript after im done with the other 2) for a web development career, I've always noticed that there a multiple days where I don't feel motivated to learn or code for weeks, is there any advice yall could give me on how I can try to motivate myself and keep going? (Excuse some grammar mistake, English isn't my first language)
Can anyone suggest some good project ideas for using NLP. It's a Master's level project and I've had every topics rejected due to it being not innovative enough. Please help!!!!@!
I'm 57. I'm a software dev that started in 1990.
I love my job.
I have no desire to retire and frankly gave up on the idea when the retirement age was raised in ... what, the late 90s/early 2000s?
The problem is I have no idea how to achieve my goal of doing remote software dev until the brain just doesn't work.
I'm hoping for stories/advice from people here who have done it or know people who have done it.
What did you do? How did you do it?
soo i am coding a simple prank for my friend it will make the screen go a little wild but theres a issue. I am totaly new to all this and I dont know what I can do. Its suppose to cover the entire screen. image: https://imgur.com/a/CHlJb36
import pygame
import random
import time
from ctypes import windll
from screeninfo import get_monitors
def create_overlays():
pygame.init()
# Get all connected monitors
monitors = get_monitors()
overlays = []
for monitor in monitors:
width, height = monitor.width, monitor.height
# Create a fullscreen borderless window for each monitor
window = pygame.display.set_mode((width, height), pygame.NOFRAME)
hwnd = pygame.display.get_wm_info()['window']
# Move window to the correct monitor position
windll.user32.MoveWindow(hwnd, monitor.x, monitor.y, width, height, True)
# Set window as transparent, always on top, and non-interactive
windll.user32.SetWindowLongW(
hwnd,
-20, # GWL_EXSTYLE
windll.user32.GetWindowLongW(hwnd, -20) | 0x80000 | 0x20 | 0x8000000 # WS_EX_LAYERED | WS_EX_TRANSPARENT | WS_EX_NOACTIVATE
)
windll.user32.SetLayeredWindowAttributes(hwnd, 0, 100, 0x2) # Transparency: 100 (adjust alpha if needed)
# Add window and screen overlay to the list
screen = pygame.Surface((width, height), pygame.SRCALPHA) # Create a surface for drawing
overlays.append((window, screen, hwnd))
return overlays
def force_windows_topmost(overlays):
for _, _, hwnd in overlays:
windll.user32.SetWindowPos(
hwnd, -1, 0, 0, 0, 0, 0x0001 | 0x0002 # HWND_TOPMOST | SWP_NOMOVE | SWP_NOSIZE
)
def main():
overlays = create_overlays()
running = True
while running:
# Handle events
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
# Allow exit with Ctrl + Shift + Q
if event.mod & pygame.KMOD_CTRL and event.mod & pygame.KMOD_SHIFT and event.key == pygame.K_q:
running = False
# Generate a random transparent color
random_color = (
random.randint(0, 255),
random.randint(0, 255),
random.randint(0, 255),
random.randint(50, 100) # Transparency
)
# Update overlays on all screens
for window, screen, _ in overlays:
screen.fill(random_color) # Fill the surface with the color
window.blit(screen, (0, 0)) # Blit the surface onto the window
pygame.display.update()
# Keep windows always on top
force_windows_topmost(overlays)
# Control the flashing speed
time.sleep(0.1)
pygame.quit()
if __name__ == "__main__":
main()
I play with C from time to time, and as part of this I've written a BASIC interpreter. In the middle of the main .c file is a big switch statement that runs various functions based on a token (int). This code is rarely more than a single on-screen page.
I'm adding new features and they are all larger than a page. I wrote them as separate functions, but even then they end up representing some major portion of the total file size. They really need to be in a separate file. However, the functions use various bits of internal state and types that should be private, and I would rather not export those, which I would have to do in a normal .h/.c module.
I am curious what the canonical solution is here? Literally every example of modularization I can find has both a .h and a .c. Is it considered bad form to put everything in a .h and include that? Or include a .c directly?
Hello, I would like to create an interactive live tiktok created by a bot. Each step taken by the bot advances a corridor of a block. The bot taps and advances automatically. I'd like the monsters to come as soon as someone sends a gift or a comment. If someone can help me it would be nice knowing that I have no basis in coding. If there are pre-existing elements for this, it would interest me!( take for example alexiacraft777)
I'm using ctypes to create a PROCESS_BASIC_INFORMATION struct to feed to NtQueryInformationProcess(), which has a ULONG_PTR as one of its fields, which is typedef'd as __int64 (the Windows-specific type, not int64_t). Since ctypes only has int64_t (ctypes.c_int64), and Windows expects PROCESS_BASIC_INFORMATION to have a __int64 field, how do I make that happen? Also...does this even matter? I know that they're both 64-bit integers, but I'm worried that giving wrong type could lead to subtle bugs down the line. I don't know enough about how things work at a super low level to feel confident just going with a int64_t.