/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 everyone !
I'm trying to learn assembly language 8086 but I couldn't find a good recource of it or any good tutorial, If you have any good one please share it.
What would you all recommend for reading material to learn on my own. I’m in the beginning of this journey and know the basics of Lua. I have the reference manual for Lua to read through but was hoping maybe there were some well regarded additions. Anything for learning C and C++ would also be appreciated. I want to learn these for game dev if that matters for people’s answers.
I started learning programming at 16 after finding a book on web development. Even though I didn’t have a computer back then, I read it anyway. Later that year, when I got my first computer, I found HTML really fun to learn.
Since then, I’ve learned a lot, mostly from YouTube. My tech stack includes: React, Next.js, Express, Node.js,Redux, Zustand, Recoil,TypeScript, Astro.js, ShadCN,PostgreSQL, MongoDB, Prisma, Drizzle, SQL, Supabase, Firebase,Docker
I also tried React Native and found it quite similar to React for the web (though I might be wrong since I only tried it briefly).
Right now, I’m in my 2nd year of BCA, mainly doing it for the degree since the course doesn’t teach much that’s useful.
I’m not sure what to focus on next. Some suggest DevOps, while others recommend diving deeper into how frameworks work under the hood.
What do you guys think? Should I explore DevOps or focus on understanding the internals of the tools I use? Or is there another direction worth considering?
Hello there
I want to learn about building browsers and especially Chromium-based browsers. What i'm looking for it what's the process of it (Just fork chromium and start modifying?) and what technologies and languages that I should be familiar with before I go on such a project?
My main purpose is to create a browser with a personalised search engine and some integrated applications that you can access from the browser
I also want to know the ability of having it cross OSs (MacOS, Windows)
Edit: The browser we’re building will be specific to a country, with a search engine focused on websites from that country. It’ll also have apps that provide services for the people living there.
I noticed there are Oracle certificates for Java for around USD 250, this is very expensive for me right now, I don't want to spend such money unless it will be relevant to get a job, do you guys have an opnion if I should do this, or maybe a cheaper certificate from another company ?
OK guys I need some help. I am a developer on a kubernetes based microservice cloud platform, that ist basically a Data warehouse with analytics.
We are currently using OpenSearch as a data backbone which is not entierly suited to our use case. We now want to Switch to a OLAP database, which is isnt anything controversial and very good IMO.
The currently propes architecture involves duckdb databases in kubernetes RWX volumes that are shared accross different Services. Each customer organization gets its own DB inside a volume.
As far as my understanding goes this is a terrible decision. DuckDB doesn't support multiple simultaneous writes from different processes. So as soon as two containers write to the same DB it goes boom 💥.
Even though we can probably implement some kind of locking mechanism, I think this system is incredibly fragile. Especially to human error when a dev just doenst think about checking for locks before writing to the DB.
I am a proponent of using a OLAP DBMS instead.
What do u guys think? Is this a reasonable architecture?
I am an undergrad IT student and this is my first reddit post ever, so bare with me. I'm starting my 6th sem of third year of uni, and I've missed the timing on joining cs clubs and competitions. I am learning Web development- I have learnt the basics frontend:- html,css, tailwind CSS,bootstrap, javascript and backend-node,express,monogodb bits of php and sql Currently learning:- React then would learn next js I feel like I have wasted a lot of time in the start as I was not so consistent with it and used to forget about the parts and start again from scratch. Made some basic projects of frontend only UI clones of websites like Netflix, Twitter.Now, What I'm desperate for, is a real experience.
I don't know what I will do feels like like time is slipping away and I will not get any internship and experience which in turn will affect me when I search for jobs. While everyone beside me is getting ahead and farther away from me.
If you have pointers or advice, I'm all ears. Thanks
My background is in cloud/infrastructure so some of the concepts in this area are new to me but I do have experience in adjacent areas.
In short, I’m trying to understand if oauth/oidc is overkill for us, given that we’re a creating a system composed entirely of 1st party applications. If it is overkill, I’d like to understand what the alternatives are.
The requirements for this platform are quite straightforward - we’d like to leverage Microsoft Entra as an IDP to relieve ourselves of some of the implementation details of managing users (i.e., passwords). We also need to be able to implement fine-grained access control.
I believe that oauth 2.0 was mainly designed for the use case of a 3rd party client connecting to a resource server and therefore requiring consent of the resource owner. Because of this, all clients and all resource servers have to be registered with the authorization server and have their scopes published. Moreover, on each client, one needs to establish the consents needed from the user using the published scopes of the resource server. Also, in Entra, you need to assign users to all apps involved (and optionally some roles if you want RBAC).
The above seems cumbersome/pointless for a few reasons. For one, we may have several resource servers in the future - managing this ever-growing list of consents and scopes will be difficult. Two, the client is a first party application that is already trusted so the consent process seems a bit redundant. Moreover, this client will be serving as a front-end for the entire platform, so it’s likely all scopes will be just full-access anyway. Of note, the client in this case will be a SPA.
It also appears that oauth doesn’t help us achieve fine grained access control. While it’s true that you can assign roles to users in the authorization server, and those claims are accessible in the access tokens, RBAC does not achieve fine-grained access controls itself. We will require another authorization solution like OpenFGA that supports ReBAC to achieve more sophisticated authz capabilities.
For these reasons, I am starting to doubt the need for oauth/oidc, but this is where my knowledge falls short. What other industry accepted practices are there in terms of authn/authz for first party micro services? Is there a simpler way to allow Entra to simply be an IDP, have my users login to it, but then make all authorization decisions via a ReBac tool, thus removing the need to register/manage all applications/scopes/grants in oauth? If so, how exactly does this work from a user flow perspective (user-agent, client, micro service N)?
Thanks!
Hey all. I am currently working on development of an app, and I am curious about what the best option for AI integration should be. I want the app to be free, but one of the main functions of the app uses an AI query. I’m currently using an OpenAI GPT, but my concern is that I’ll constantly have to refresh the tokens, and spend money in the upkeep of the app.
I understand it’s pretty cheap, but it’s just the principal of the thing for me, and in the case that the app were to somehow get really popular, that could be a needless expense.
next year im going to college and wanted to make 5-10$ a day. i have 2 years of experience in game dev but i quit because it will too much time and effort. ik web dev is also not simple but i think i can just get into short commisions building simple websites taking me 2-3 hours a day.
I work in a large org and I am making some improvements to repos on Github (python). I use VSCode as my editor and I am now to begin testing using Postgres
Does anyone know of any good material like YouTube videos / websites for support on this as I am a beginner and not tested this way before.
Any tips or tricks you have yourself as well would be appreciated! I have Postgres installed on my device and set up connected to port 5432
EDIT:
We have created a data viewer and I have added endpoints for new features, I am now going to start testing the new endpoint working with the postgres database and a repo within github.
I don't really have any experience with Postgres so just looking for any training material that could relate to this subject.
Howzit, everyone. I am working on an ASP.NET Core API and noticed something odd in the project that has me scratching my head.
For context, the API was developed by the company I work for, and so the examples I show below are only a representation of the code in the API.
Below, the variable currentDate
is declared to the value returned from GetCurrentDateTime
.
public class Example
{
private readonly IDateTimeProvider _dateTimeProvider;
public Example(IDateTimeProvider dateTimeProvider)
{
_dateTimeProvider = dateTimeProvider;
}
public void ExampleMethod()
{
DateTime currentDate = _dateTimeProvider.GetCurrentDateTime();
// ... other code
}
}
Now, my thought is: Why not just use DateTime.Now
? My best guess was that GetCurrentDateTime
performed a specific operation needed, however, that is not the case:
public class DateTimeProvider : IDateTimeProvider
{
public DateTime GetCurrentDateTime()
{
return DateTime.Now;
}
}
It is worth noting that GetCurrentDateTime
is the only method in DateTimeProvider
. I can't think of a good reason for this implementation. What makes this confusing is that it was implemented by one of our senior devs who is respected as a good developer.
Is there a good reason to do this? Or is it unnecessary?
Hey all,
I am quite new when it comes to deploying resources on a virtual machine. I’m sure that I’ll rephrase this question in the future as it’s gonna be a bit chaotic
I’m struggling with the idea of what I should do in order to take full advantage of all the resources that a cloud virtual machine (Ubuntu) has to offer.
In particular I’m thinking of developing a web application using Python by either using Django or FastAPI.
I’ve seen some tutorials which use virtual environments while other use Docker. What are the advantages the one over the other. While Docker seems like an extra layer of complexity, I can run several Docker containers and use Nginx as a load balancer to distribute the traffic among them (based on the number of cores). But would that make sense as several threads can spin up (they can’t take advantage of the num of cores,right)??
Is docker compose a good option for prod?
What is your opinion of using Nginx + Gunicron with the diff frameworks Django / FastAPI (wgsi/ asgi)
If you have any good tutorials/ resources feel free to share them here.
Quite a broad question, right?
I have been asked to build a delivery management software for a company that sells food products, and then does home delivery of those products.
What would the best open source software platform be for this?
I’m thinking either MedusaJS, or OpenCart?
I’ve looked at Medusa js, they have a pretty solid start right out of the box with a working frontend and admen panel.
Any thoughts?
So I have a vibrating usb back massager from an old chair and I had the idea to have it vibrate whenever I take damage in a game. I was wondering if this is at all possible and if it is how hard would it be to implement.
I am brainstorming a project I plan on starting this weekend in which I seek to write a program that can match survey benchmarks to job titles.
Basically, I want to feed it a list of job titles as well as a list of survey benchmarks (also job titles, seldom the same), and I want it to provide the closest matches for each along with a confidence interval.
My first thought was going with a sort of cosine similarity-based method (assigning scores to strings and matching the strings with the closest score). But then I thought perhaps semantic indexing is required, given job titles can lack a single syntactic commonality (I.e., Physician ≠ Doctor ≠ M.D).
So I’m leaning towards a hybrid approach, using cosine similarity tied to some sort of higher dimension kernel that maintains a semantic feel for each job title.
The survey benchmarks also all come with job descriptions, so the cosine variable can draw on the semantic values being composed from the descriptions.
Not sure if this makes sense, but I’m looking for ideas on efficient ways to achieve the goal I’m looking for? Any Libraries/distros you can recommend I look more into?
Additional Requirements:
Libraries I’m Considering:
Is the only way(or best way) to do this using the cloud (aws s3) ? back in the day how did they do it? did they actually just buy the hardware and do it themselves?
1 in 7 people has sleep apnea. CPAP is the gold standard treatment. Machines can log a lot of data to an SD card, which can help patients fine tune their therapy. Typically people put that card into a computer which mounts it as a drive.
I'm working on code to read that data. One thing I need to do is recognize whether a drive is a valid CPAP log. There will be specific files and folders if so, so my code looks for them.
The problem is I'm using File.Exists() which works great, and I can debug the tests on my laptop, but they fail on the build server.
How can I refactor this in a better way?
I almost managed to create a bot to fish in World of Warcraft. It even finds the bobber, but when it gets to it, it clicks right away and doesn’t wait for the fish to bite. I’m still learning programming, and this is helping me learn a lot.
import pyautogui
import time
# Function to check if WoW is in focus
def wow_is_in_focus():
try:
active_window = pyautogui.getActiveWindow()
if active_window is not None and "World of Warcraft" in active_window.title:
return True
except Exception as e:
print(f"Error while checking active window: {e}")
return False
# Function to safely stop the script
def stop_script():
print("Script stopped by user.")
sys.exit()
# Image file name of the buoy
buoy_image = "boia.png"
print("Waiting for WoW to be in focus...")
while not wow_is_in_focus():
time.sleep(2)
print("WoW detected! Continuing...")
try:
while True:
# Search for the buoy image on the screen
print(f"Searching for the '{buoy_image}' image on the screen...")
buoy_position = pyautogui.locateOnScreen(buoy_image, confidence=0.8)
if buoy_position is not None:
# Calculate the center of the buoy image
center_x = buoy_position.left + (buoy_position.width / 2)
center_y = buoy_position.top + (buoy_position.height / 2)
print(f"Buoy found at position: ({center_x}, {center_y})")
print("Waiting for the fish to bite...")
# Wait until the buoy starts to submerge (representing the fish biting)
initial_color = pyautogui.pixel(center_x, center_y)
while True:
current_color = pyautogui.pixel(center_x, center_y)
# Check if the buoy color has changed (indicating that the fish has bitten)
if current_color != initial_color:
print("Fish caught! Right-clicking to reel in the fish...")
pyautogui.rightClick(center_x, center_y)
print(f"Right-click performed at: ({center_x}, {center_y})")
time.sleep(1)
# Perform the double right-click to cast the line again
pyautogui.rightClick(center_x, center_y)
pyautogui.rightClick(center_x, center_y)
print("Double right-click to cast the line again.")
break # Break the loop to repeat the process
time.sleep(0.1)
else:
print("Buoy image not found. Trying again...")
time.sleep(2)
except KeyboardInterrupt:
stop_script()
The biggest source of imposter syndrome for me is that I don't know literally all aspects of building and deploying an app. For example, I've never released a side project with authentication and authorization. I'd love to deploy one of my .NET APIs, but all the examples/trainings I've found have either been really basic or unclear when it comes to authentication and authorization, so I'm really not sure how else to learn besides being on the job.
Is this something that will go against me in the interview process, or is it more important to know the languages and principles? It seems like this would already be set up at most places (besides maybe startups), but I'm paranoid that this sort of thing is holding me back.
I have a system that handles appointments. It sends reminder texts to those who have scheduled appointments and I want to implement a feature that will allow those people to reply "C" to confirm their appointment.
I'm realizing there is lots of complexity to this. What if the person has multiple appointments booked? What if there are several other texts from my system to this person between the confirm text and their "C" reply? Etc.
Obviously this has been implemented before because I see it all over the place in the real world. Is there any standard for this? My system of course has access to the text history with the person.
Hi everyone,
I want to build some software but don’t have good ideas right now. So I’m curious—what problems do you face in your daily work? Maybe some tasks take too much time or you think there’s something missing that would make your job easier.
It can be small or big, anything that could help make work smoother.
An actual program I write, a spreadsheet, or something else?
The hope would be to plug numbers in and see how it affects the output.
https://docs.appimage.org/
https://appimage.org/
Making appimages is to difficult for me. Would it be possible to create an ai able to produce appimages? Are there ais which already can do it?
Making appimages has structures. But it appears that each program you want to turn into an appimage has its particularities that makes the task less trivial. If this subreddit is not the place to ask my question, can you tell which subreddit would be the right one? Thanks.
I thinking going with c#. Thinking im gonna use it for games (godot) and apps. But i realized i can do the same things if i substitute gamedev with gdscript, which i am sort of familiar with. Also python is easier to leaen due to synthax and has a larger userbase. Which language would you pick? Edit : failed to mention that the only turnoff for python (for me) would be performance, but it would also help my with Raspberry pis.
I know there are lots of APIs but they are either restrictive on access (amazon) or there is no api (momox). So if you have any ideas, I'd love to hear from you!
Does anyone know of an online simulator for the STM32F411CE that can compile code from STM32CubeIDE? I tried Wokwi, but it doesn't work correctly.
I have to make a app/project for my final year of High School on this theme, I like the idea of making some form of game but i'm not sure if i should. BTW i'm using Delphi 10 so i cant do some crazy graphic stuff
I am looking for a secondary laptop for on-the-go coding. I am a computer science ( game dev pathway) major. I have a desktop I use full-time but I am doing some light traveling this year and spending more time at the library. I still plan on using my desktop for most of my coursework and personal projects. Does anyone have suggestions for decent laptops for the task? I'd like to stay under 1k budget-wise. Thanks in advance!
I just want to know what kind of projects other people are working on. I saw one guy trying to create his own operating system, which I think is cool. So, what are you guys working on?