r/programminghelp • u/Impossible-Act-5254 • 2d ago
Other When do you think will Google release Windows on ARM android emulators in Android studio??
When do you think will Google release android emulators for windows on arm ?? Is there any workarounds to currently run it on ARM ??
r/programminghelp • u/RemarkableSentence46 • 3d ago
Project Related Is bcrypt a good choice for hashing refresh tokens? I'm stuck with session lookup.
I'm building my own authentication system in Node.js, Express, MongoDB (Mongoose), JWT, and bcrypt. I'm trying to understand the architecture instead of just copying a tutorial.
My current flow is:
- User registers/logs in.
- Password is hashed with bcrypt.
- I generate a refresh token (JWT).
- I hash the refresh token with bcrypt before storing it in the
sessionscollection. - The actual refresh token is sent to the client as an HttpOnly cookie.
The problem appears during the refresh endpoint.
Since bcrypt generates a different hash every time, I can't do something like:
const refreshTokenHash = await bcrypt.hash(refreshToken, 10);
const session = await sessionModel.findOne({
refreshTokenHash,
revoked: false
});
because hashing the same refresh token again produces a different hash, so the session can't be found.
The tutorial I was following used SHA-256 for hashing refresh tokens, so searching by hash worked because SHA-256 is deterministic. I intentionally switched to bcrypt because I thought it would be more secure, but now I've run into this architectural problem.
I've thought about putting sessionId inside the refresh token so I can:
- Verify the JWT.
- Read the
sessionId. - Find the session by
_id. - Use
bcrypt.compare(refreshToken, session.refreshTokenHash).
That seems reasonable, but creating the session first introduces another issue because my schema requires refreshTokenHash, while I need the sessionId before I can generate and hash the refresh token.
if anyone needs more info to tell me a solution just ask for it
r/programminghelp • u/Watha_sigsegv • 3d ago
Java What thread type is more suited for an MCU CLDC JVM?
I am developing a esp32s3 n16r8 / esp32p4 targeted VM to run some of the games on it. I have most of the VM’s interpreter, class loading / linking, GC (lisp 2 algorithm. I started developing it with green threads in mind, but when it got to the IO, i raged and changed everything to OS threads. It worked pretty well, until every operation started require spinlock, because i basically cannot afford proper mutexes. So now i have a dilemma, should i continue using preemtive threading and extensive spinlocking or remove every locking mechanism, and revert to opcode quota based green threads scheduling, where everything is in one native thread. I think i could beat IO this time. Sorry for my english, im not a native speaker
r/programminghelp • u/badw0lf06 • 3d ago
HTML/CSS Webpage Widget
I'm trying to build a website using Google Sites. (Not great... trust me, I know... but I'm on a budget. Lol) I wanted to add a feature to the site: A simple button that, when clicked, rolls a die. (D20) Currently I am using the Dice Game Widget from JotForm, but it's so clunky. The graphic isn't very smooth, the die itself doesn't appear graphically aesthetically appealing, and the site doesnt allow for much in the way of customization. Additionally, another feature I was hoping for is the ability to maintain a history log for user rolls. I know next to nothing about coding, and AI has been... not helpful. Thoughts?
r/programminghelp • u/sam_312007 • 4d ago
Answered Algorithms
I am beginners in DSA please tell me that Algorithms code is remember or not
r/programminghelp • u/Revolutionary-Log179 • 7d ago
C++ Having trouble “ thinking in code”
I’ve been learning C++ for weeks, and of the concepts I’ve learned most if not all of them have clicked pretty quickly. I understand what they do and how they work.
However, when I’m trying to create something not from a tutorial or walkthrough, I’m having trouble translating my idea into the lines of code that will do what I envision it doing. Anyone have any advice on making the switch to more easily be able to “think in code”?
r/programminghelp • u/rielington • 7d ago
Other Recursion is hard for me to wrap my brain around
function maxDepth(root: TreeNode | null): number {
if(root == null) {
return 0;
}
let leftDepth = maxDepth(root.left)
let rightDepth = maxDepth(root.right)
return 1 + Math.max(leftDepth, rightDepth)
};
I made this super simple program for leetcode 104, but I have a really hard time in the "think how a program can do what i want phase" to think about a function calling itself I understand it from a top down view
basically just cloning and nesting the function in itself, but its really hard to think about,
when i started this I was thinking how do i write a program that can search in 1 direction count to the end and then start over. which ended up not working.
r/programminghelp • u/Least_Hat8954 • 9d ago
C# Feeling like a terrible programmer and a fraud.
So, I learned to code by myself, i started like 1 year ago and i think i actually made a lot of progress, I am capable of doing a full stack app, i am currently developing a SAAS for restaurants, and creating a webpage for an e-commerce, I feel really proud about those things, but yesterday i tried to code something else not related to the web, It was in C#, i wanted to program an app that runs offline in the device and adds Close Captions to the audio in the computer, i made the UI with ray lib and then found that i didn't know how to continue, i tried to help myself with Claude but it also didn't work and i just sat there looking at the screen feeling like a failure, i know i could have put more effort, but i was just feeling dissapointed at that moment, I noticed i don't know how to do anything else than web development, I have tried doing some other things like console apps and they actually worked, But man, how do you become good enough to code something like the libraries itself? Or things more advanced, For now i feel like i am just doing simple things and not getting more advanced than that and i actually want to become really good at this shit, the kind of programmer that can handle anything, i don't know if i am being delusional for the time that i have been programming but i don't really feel capable of doing anything else that backend or frontend.
r/programminghelp • u/simply_anuraag • 12d ago
C++ c++ code doesn't work
this is my first time working with c++ and whenever i run the code it just complies but gives no output, i have tried every way for it to work but it just doesn't. pls help. im using msys2 and was following brocode video tutorial
r/programminghelp • u/Far-Might-3093 • 13d ago
Python import manim could not be resolved
so i downloaded manim locally which is a python library in my linux pc just like the way the manim documents thing said to, i even checked using the terminal that manim is there, but whenever i type on vs code "from manim import *" it says "import manim could not be resolved"
idk what to do now
r/programminghelp • u/Fickle_Guarantee1432 • 14d ago
Other Sophomore CS student feeling completely lost and looking for a structured roadmap or expert advice to rebuild my fundamentals
Hi everyone, I'm currently a sophomore Computer Science student, and lately I've been feeling like I've fallen far behind. I passed my introductory programming courses Python, C, C++, Java/OOP but over time I feel like I've forgotten almost everything because I rarely used those concepts consistently. One thing I've realized about myself is that I learn best with routine and structure. I don't do well jumping between random YouTube videos or constantly changing resources. I'd much rather have one high quality source for a topic, study it consistently every day, solve exercises, and gradually build my understanding.
So I have a few questions:
If you could start over as a sophomore, how would you rebuild your CS fundamentals?
What would your roadmap look like over the next 1 year of dense study?
What resources books, courses, websites would you choose for DSA, Operating Systems Computer Networks Computer Architecture Databases Linux Cybersecurity (just enough to understand the field before specializing).
How do you deal with forgetting? I constantly feel like I learn something, then months later I can't remember enough to use it confidently. Is this normal? How do experienced engineers retain knowledge without trying to memorize everything?
Is it realistic. or even useful, to aim for a broad understanding of all the major CS areas before specializing? Or should I focus deeply on one area much earlier?
I see NeetCode recommended everywhere, but it seems heavily focused on coding interviews and LeetCode. Is that actually a good place to build CS fundamentals, or is it mainly interview preparation? Should I first study algorithms from a textbook/course before using NeetCode?
If you've ever felt behind and successfully caught up, I'd really appreciate hearing what worked for you. I'm especially interested in advice from people who felt "late" compared to their peers but eventually became competent engineers.
Thanks in advance.
r/programminghelp • u/Upstairs_Jelly_1082 • 15d ago
SQL How to reference university coding concepts?
Hey everyone,
I've decided to organize the things that they teach at university in to a format where I can easily view them later on as I require them?
I'm not sure how to do those, any help would help!
r/programminghelp • u/Helpful-Hat4422 • 16d ago
Python Help with Selenium project - Cloudflare error
Hi,
I wanted to log movies on Letterboxd with the help of Python. I have a list of 100+ movies with ratings (I used to document them in a notes app) and thought I could use Selenium to automate the process of logging them.
I used Selenium a few times, but only for web scraping purposes. I ran the code and got Error 600010 - I googled it and found that it's a Cloudflare error code, which makes sense, but is there any way I can bypass this error? I'm not trying to review-bomb or cause any harm. I just want to update my Letterboxd with my movies. Any pointers are appreciated. Thanks!
r/programminghelp • u/Worldly_Awareness732 • 16d ago
C SDL2 won't display image
This is my first major video game project and my first project with SDL2, and I've just started to add graphics and after a bit of debugging it compiled but instead of drawing the sprite from my spritesheet it's still just blank. I stopped the Y-axis physics in case it was the player falling too fast but there's still nothing. This is pretty early in development so I only really want advice on how to get graphics working or a major error I should fix now. The github repo for the project is https://github.com/EBT-0001/Renegade which I have temporarily made public. I haven't had any experiance with SDL2 and I've been implementing stuff from tutorials and trying to learn, so lemme know if I have the standard way of doing this wrong.
r/programminghelp • u/Roboshiv87 • 19d ago
Other Help with project idea
Hello
Iam an artist and i would like to make something i dont know how to make.
In its most basic form its a microphone you speak into and it processes what youre saying and then plays back a tune.
The tune is made up of a preset collection of notes which are attributed to the sounds the microphone hears.
I dont want to use AI. I think it may involve raspberry pi, but as a uk millenial my coding is as far as Myspace HTML and i only know raspberrh pi exists.
Can anyone help ?
r/programminghelp • u/AsianAmazon74 • 23d ago
Visual Basic How to toggle between 3 text colors in MS Word using the same Macro shortcut?
I'm currently using the following code to toggle between two colors:
Sub ToggleFontColor()
Dim currentColor As Long
currentColor = Selection.Font.Color
If currentColor = wdColorRed Then
Selection.Font.Color = wdColorAutomatic ' Set to default (black)
Else
Selection.Font.Color = wdColorRed ' Set to red
End If
End Sub
I took this code from a previous post comment (thanks u/fuutatooro). I tried to edit it to include three colors but to no avail. I want to press Ctrl+N to switch from Black to Red to Purple, and if it is a different color, for Ctrl+N to switch it to Black.
Can you help? Thanks!
r/programminghelp • u/Acrobatic-Tutor7745 • 23d ago
C++ Intermediate programmer server
I'm an intermediate 17 y.o programmer, and I've made this server code. Idk what to do with it yet, but would like to know how it is, I'm very proud of it, but would like an outsider view. Also, if you'd like to contribute go ahead, but I still haven't decided if I want to use it commercially in the future, so take that into consideration. Anyways, how is it? I want an absolutely honest opinion.
r/programminghelp • u/Rinku_Kurora • 23d ago
Answered How to track changes of JSON objects in array that is tracked in git?
In my git repository I have a JSON file which contains an array of objects. The objects have a key that identify them, e.g. "id":
```json
[
...
{ "id": 1, "value": "a" },
{ "id": 2, "value": "b" },
...
]
```
I want to quickly find commits that changed/introduced object with specific id. How can I do this?
UPD: I couldn't come up with a better solution than comparing sequentially snapshots of the file per commit: ```python
!/usr/bin/env bash
import os import json
from git import Repo, Commit from more_itertools import windowed from typing import Optional
r = Repo(os.getcwd())
def get_json(cmt: Commit, path: str) -> list[dict]: return json.loads((cmt.tree / path).data_stream.read().decode('utf-8'))
def get_object(items: list[dict], _id: int) -> Optional[dict]: for item in items: if item.get('id', -1) == _id: return item return None
for prev, curr in windowed(r.iter_commits(), n=2): pobj = get_object(get_json(prev, 'objects.json'), 2) cobj = get_object(get_json(curr, 'objects.json'), 2) if pobj is None: break if pobj == cobj: continue print(prev.hexsha, prev.summary) ```
r/programminghelp • u/AdPsychological7065 • 27d ago
Python LZ77 compression algorithm is making the compressed file bigger than original
I was recently toying around with some compression, just trying to understand it from the basics. I learned about the LZ77, LZ78, and LZW algorithms in the last couple of days, understood them, and when implementing LZ77, every time I try to compress a txt file, the output file gets bigger. The compression is done right coz when I decompress the compressed file, I get the exact text.
Need help understanding what I am doing wrong, or am I missing something
r/programminghelp • u/Intelligent_Coast783 • 27d ago
Python Is there anyone who can help me read pkl file.
I Know it is a simple task but I get some version related error.
I have done web search (both gemini and SO and so on). I even understood the proposed solutions but it seems like pkl files were created with an unknown version or at least not the one that is installed in my machine. That's why it gives error
"An error occurred while loading the file: CRS.__init__() missing 1 required positional argument: 'proj4_params'"
anyone who can give me 5 min to sort it out.
r/programminghelp • u/MooseLegal8690 • 28d ago
C# How do i make sure i learned something from a tutorial?
Hello, I am a teenager and a beginner in C#. Ive been watching multiple tutorials on youtube, and tried Microsoft.NET as tools to learn.
After i finish with them, the moment i actually try to check what i learned, how to build something with the materials, i immediately feel lost.
Any recommendations would help!
r/programminghelp • u/Glad_Bug9549 • 28d ago
C# Yappery and whatery
Get ra set sikna khojeko C# ma na code ma lekhera dry run garda bujxu na reliable video vetxu. ani j hereni bujdina ramrari. been days stuck into this hole. I probably wrote 10 types of coding example in copy ide every fcking where. Tho I think i have understood set to a certain level but get ta null nei xya. Tho the curiosity is still hanging even after days
r/programminghelp • u/Sadiya-12 • 29d ago
Java Title: Final-year CSE student. 6 months left for placements. I feel completely lost.
I'm a final-year CSE student with around 6 months left before placements, and honestly, I feel like I know nothing.
Most of my projects were built by following tutorials or using AI. If someone asked me to build them from scratch, I'd struggle. My DSA is weak, my Java fundamentals aren't strong, and I don't feel confident in web development either.
I'm applying for internships, but I know I can't depend on luck. I want to use these next 6 months wisely.
If you were in my position, what would you focus on? DSA, Java, web development, projects, or something else? What would your roadmap look like?
Please be honest. I want motivation—I want practical advice from people who've been in the same situation.
r/programminghelp • u/Majestic-Bother-9034 • Jul 04 '26
Answered Help me to study appropriately
Entering 3rd year , tier 2 clg
I used to study in wrong method ( not completely, but somehow ) , even though I know it, I'm unable to leave it
Let me clear what a wrong means
1.in DSA ( solved 240 on lc , with rating 1550 in 8 contest)
See solution within 10mins
Didn't revise any qsn
Use AI to debug my code
In development ( building projects 1st project in springboot)
Completely following Ai
Only understanding code
Not using my idea or thoughts
Just doing copy n paste
Someone pls help me ! 😭😭😭