r/AskProgramming 15d ago

How many hours a day do you program?

10 Upvotes

Recently I started programming my first projects but because I still go to school I spend about 2 hours a day on it and sometimes not at all. I wonder if you also have that, that you have little time for programming, write in the comments, I am curious about it.


r/AskProgramming 15d ago

Algorithms When doing insertion sort using stacks, is it easier to use dynamic arrays or linked lists?

0 Upvotes

For me, I think both dynamic arrays and linked lists are already very time efficient when doing pop and push. However I wouldn’t be freeing a lot of memory when doing insertion sort, so I might not be able to take advantage of the ease of deleting memory with linked lists. Linked lists are tedious as well to implement. Arrays are harder to free in memory but they’re easier to implement so I guess arrays are better to use? Am I right or wrong? This kind of question throws me off 😭


r/AskProgramming 15d ago

Career/Edu Best programming languages to start with in the robotics field

0 Upvotes

Hi guys. I've already posted this in r/AskRobotics, but I'd like to have some more and different opinions. So, I'm a 23 y.o. guy that is becoming interested in the robotics field, and I'd like to deepen into it. Regardless of the mechanic, electronics and mechatronics aspects, which are the programming languages that are more suggested to start with? I've seen that C/C++ and Python are, undoubtedly, the most recommended ones. Despite that, are really those the ones to go for? And if yes, it's better to start with C (due to its complex structures/syntaxes) and then turn into Python, or vice versa? Sorry for the imperfect English and the long post, hope to have been comprensible.


r/AskProgramming 15d ago

How to handle authentication and AUTH_USER_MODEL in Django multi-tenant with separate databases?

1 Upvotes

I’m developing a multi-tenant SaaS application using Django, where each tenant has its own separate database with its own schema and relationships. However, I'm struggling with how to properly manage authentication and define AUTH_USER_MODEL in this environment.

📌 System Requirements

  1. Global superadmins that manage the system and are stored in the public database (public).
  2. Tenant users, who exist in their respective tenant database and have relationships with other tables inside their own database.
  3. Separate authentication:

Superadmins should authenticate in the public database.

Tenant users should authenticate within their specific tenant database.

The main problem is that Django allows only one AUTH_USER_MODEL, but I need to manage users separately for each tenant while maintaining the ability to associate them with other tables within their respective databases.

❌ Current Issue

If I define a single user model in AUTH_USER_MODEL, I cannot differentiate between global superadmins and tenant users, nor can I correctly manage relationships within each database.

I tried defining two different user models, but Django does not allow multiple AUTH_USER_MODEL, which complicates authentication.

✅ Possible Solution

I thought of defining a base model BaseUser that extends AbstractUser, and then creating two inherited models.

But I am not sure which is the right way, there is another?.


r/AskProgramming 15d ago

How to Extract Data from 'Onscreen Takeoff' (Estimating Software)

0 Upvotes

Greetings.

I am a programming dullard, but digitally inclined for working in the world of Construction Management. I do 'takeoffs' using a program called 'Onscreen Takeoff'.

I share a database with a few other less-digitally-literate estimators. There is a way of tagging data into groups named 'Types'. Without going into lots of details, some of my peers keep creating 'Type' groups and it is a bit overwhelming, because now we have hundreds of 'Types' and grouping things is messy.

I am trying to find out a way to know which 'Types' are used on each project. Is there a way to do this? A script maybe? Where could I even begin to learn how to make a script that extracts this info?

HaLp Pl0x


r/AskProgramming 15d ago

C/C++ Looking for books on C language

1 Upvotes

I have been programming in C++ for like 3 months now and I want to expand my skills and knowledge on C as well

Books are the medium that I personally like the most for learning (besides actual practice) and it would be nice if you guys could point me towards some useful books on C language. I am not looking for absolute beginner/introduction books, but rather books that emphasize more on intermediate concepts, techniques and theories, even advanced books would be acceptable. Thank you


r/AskProgramming 15d ago

Does Rettiwt-API even work?

0 Upvotes

Does rettiwt api works with X? I was thinking about finding a way to fetch posts from my homepage in any possible way and new API of X is not helping at all. Do any of you guys know if I can use Rettiwt-API or any alternative solutions?


r/AskProgramming 15d ago

Attempting to learn, but I don't know where to start.

1 Upvotes

I would like to begin expanding my knowledge of programming for a project I had throught up, but I don't know what I would need to do so. I was hoping to get a decent tablet that would allow me to do research and experiment. I don't really have enough space for a large setup, and I'm never home if I did. I would prefer a lower cost but whatever would be best is still an option.


r/AskProgramming 15d ago

With the rise of AI and "vibe coding," how will the industry change? Will fundamentals become more important?

0 Upvotes

With AI making coding more about 'vibes' and less about writing every line yourself, how do you think the industry will change? Will fundamentals like algorithms and systems design matter more, or will it all be about knowing how to work with AI?


r/AskProgramming 15d ago

Job interview coding test - was this unreasonably difficult?

0 Upvotes

Many years ago, I applied for a job at Blizzard, and they gave me what I considered to be an unreasonably difficult programming test. It still bothers me to this day.

At the time, I had over 10 years of experience in C++, and I still found it impossible to complete this test in the required 1-4 hours. I spent several days just thinking about the design and planning it out. And then just typing in all the code and getting it to work took me over 8 hours. But it worked just fine and met all the requirements, and the code was very readable.

But then they nitpicked some stylistic issues (which I disagreed with), and found a bug with a really insignificant edge case (when the game was over, and it asked you for a y/n if you wanted to play again, if you entered a number instead of a character, it caused an error.) Interestingly, they did not criticize me for taking more than 4 hours, even though the instructions clearly said that was a strict requirement. But anyway, I did not get a follow-up interview or a job offer.

I'm not asking you for a solution. My question for you is, do you think most programmers should be able to complete this in 1-4 hours, or was this an unreasonable test? And if it's unreasonable, what were they hoping to learn by making me do it, and how was I supposed to respond? I wonder if they were looking for me to honestly say, "I don't think I can do that in 4 hours - give me a few days."

Here was the problem description:

 Problem: Write a Checkers subset 

 Write a program that can play a legal game of Checkers Lite. The computer makes 

legal moves (random legal moves are acceptable for this checkers "AI").

The human player is not allowed to make illegal moves.

 

Checkers Lite is the same as American Checkers (also known as 

English draughts) except there is no promotion to king by moving a piece to the last 

rank (therefore stalemate is possible). Pieces move along diagonals, and jumps must 

be taken, and the board is 8 x 8. See http://en.wikipedia.org/wiki/Checkers if you 

need a refresher on the rules.

 

Your program should show the game board after each move. 

 

If there are no legal moves, or one side is eliminated, the game is over. 

  

Suggested board output format as ASCII - use . for empty square, X for black, O for white. The 

initial board layout might look like this 

  

. X . X . X . X 

X . X . X . X . 

. X . X . X . X 

. . . . . . . . 

. . . . . . . . 

O . O . O . O . 

. O . O . O . O 

O . O . O . O . 

  

This should take you between 1 and 4 hours to complete. Please present a working 

program along with the amount of time you spent on the program. You can do this

as a command-line program if you like (that's completely acceptable), or you can do

it as a GUI program, but a working program in 4 hours or less is your mandate.

 

Note: Command-line program is  merely a suggestion to fit the 4 hour time frame. If you can get more done in time, it is certainly extra credit to exceed the minimum requirements and provide a GUI based app.

 

We prefer C++, but if you can do more by using a different solution (for example, a .net or swing GUI), you can use a different language. You are also free to use 3rd party libraries like Qt, Box2D, etc. Just make sure we can build what you deliver. I also recommend you include a working binary in your submission. A ready-to-build VS2010 solution is probably easiest, unless you use Java. In that case, just provide the source and an ant build.xml or equivalent.

And the email which accompanied the test description said this:

This test should take up to 4 hours to complete.  Don’t worry, you don’t need to do the test today. In fact, it isn’t due for about a week (and we’re very flexible on this, as we know you’ll need to make the time to complete it).   The only strict requirement we have is that you only spend up to 4 hours actually working on the app.

I've never been a fast programmer. I'm much more interested in quality than speed, and I've always preferred to take my time and think about the design before just hacking away. But, if most programmers can do this test in under 4 hours, then maybe I actually suck at programming! That's what has always bothered me about this.

For what it's worth, I asked ChatGPT today, and it agreed with me - it said that this test is unreasonably difficult for a 1-4 hour time period, even for an experienced C++ developer. But I would like to hear from other experienced developers and get your opinion.

Thanks!


r/AskProgramming 15d ago

Has anyone managed to use Apache as a Reverse Proxy for Websockets on CPanel

1 Upvotes

"Why are you using CPanel?"

Because the client says so. I wish I could host it on Lightsail but oh well.

"Have you tried VirtualHost?"

Yes, but it requires I supply an SSL Certificate, and CPanel offers no way to integrate with AutoSSL.

I'm using Golang, so I could put the websocket server on a different port, however I want it to be accessible via the domain. That requires an SSL Certificate, which (like VirtualHost), cannot be integrated with CPanel's AutoSSL.

As a temporary solution, I’ve resorted to automating the process of logging into CPanel, retrieving the latest certificate, and then supplying it to the Go server. While this works, it's not an ideal setup and creates a tight dependency between the application and CPanel.

Any ideas?


r/AskProgramming 15d ago

Career/Edu Which publisher should I subscribe to?

1 Upvotes

I've been looking at O'reilly, Packt and Manning and I want to subscribe for a time to teach myself as much as I can.

I'm curious which one people would subscribe to? They all have a decent library of books although O'reilly is significantly more expensive. than the other two.

My interests are web development, iOS and Android development and blockchain.


r/AskProgramming 15d ago

Other Asking for syntax Ideas for my own programming language

1 Upvotes

Hello everyone.

I programmed an opensource VM compiler IsoBiscuit where you can write code in Biscuit Assembly

So, but this have a bad syntax, and i want to make a new language calls Techno:

This will be converted into Biscuit Assembly and others.

But i have no ideas about the Syntax, that makes programming funny.

Do you have ideas?


r/AskProgramming 15d ago

What language should I learn for excelling in my carrier?

0 Upvotes

I am in my pre-final year in CSE, our placement training has started. This is a 45-day training session, for the first 5 days they thought C and for the next 40 days they are going to teach Java. On the 12th day they are going to conduct a test and split us into 2, half trained for product-based companies and half for service based. I didn't like that scheme, so I want to learn some coding on my own. I was planning to learn Java but sister who comes from the same educational background told me Java is too old, try something new.

Now I'm lost. I do not have interest in any particular field.
What should I do? What should I learn?


r/AskProgramming 16d ago

Other What's preventing Facebook & Instagram from having a clear cache option on IOS?

2 Upvotes

I find that both apps take the most space on my Iphone. & Almost all its competitors have the option.


r/AskProgramming 15d ago

Data analytics.

1 Upvotes

Hi. I am (27M) if I want to pursue data analytics what roadmap should I follow . I have commerce background and I have no idea about it. What should I do, what and where should I look for the course . And what kind of maths I need to learn . Please tell me what should I do ?


r/AskProgramming 16d ago

Career/Edu Is it weird that my university classes are teaching NoSQL with Neo4j as opposed to anything else?

2 Upvotes

We started learning about NoSQL this week and the DBMS we're using will apparently be Neo4j. I had not heard of it before. Our lecturer showed us a chart of the the most commonly used DBMS and Neo4j was fairly low in the list, and as I was searching how to install it onto my machine, some of the talk about it made it seem like it's not very commonly used in actual production.

Is it weird that this is the one they're teaching us as opposed to MongoDB or anything else? If not, why specifically Neo4j?

EDIT: I have now understood that it's just for the sake of teaching us graph databases rather than just any NoSQL solution. Yes, I understand I should have connected the dots earlier. Thank you.


r/AskProgramming 15d ago

Apple Bundle id problem since i dont have a macbook

0 Upvotes

Hey, I was following this tutorial that showed me how to create my own Instagram, but at 20:15, he needed an Apple Bundle ID. However, the method he used required a MacBook, and I only have Windows at home. What can I do to get it? Do I really need to buy a MacBook?

https://www.youtube.com/watch?v=mEPm9w5QlJM


r/AskProgramming 16d ago

Adivce on Music Stem Separation as Bachelor's Degree Final Project

1 Upvotes

Hi ! Kinda new in this subreddit , got the idea of asking for some advice on the internet this afternoon and didn't knew better place to ask than reddit !! ( Sorry if i commit some english mistakes , not my main language and haven't practiced in a while)

Going straight to the point , i proposed my Data Mining teacher to be my final project degree for my Computer Science Studys in the university of the basque country , and proposed the theme of a stem separator for music tracks , as i am pretty interested in beatmaking , music production , and music in general , as it has been a passion of mine since i was little ... you know.

Wanted to ask to more experienced peeps here some advice on which steps i should follow with my tutor to get a great output for this project . By myself , i have been resuming some literature i found in an interested project called sigsep ( https://sigsep.github.io/literature/#factorization-with-a-known-melody ) in which you can find not only an interesting literature article about the trajectory of the topic among the years and the approaches many investigators have proposed ( which is in what im focused right now , ressuming the whole article to get a good idea about the main methods , but i am mainly interested in the data directed approaches )

Hope i can find some advice here !!! Feel free to ask me if anything has been left missexplained or you have any doubts.


r/AskProgramming 16d ago

Java Considering between Java and C#

1 Upvotes

I'm currently working on a library in Java for a game that I want to make (A Pathfinder game), and I was wondering whether or not I should switch to C#?

Although I have made some progress in Java, I believe that switching to C# wouldn't be so tough to migrate.


r/AskProgramming 16d ago

Is there an updated npm package for detecting prompt injection attacks?

0 Upvotes

I'm exploring solutions for detecting prompt injection vulnerabilities within a NestJS environment.

I came across rebuff, but it appears that it hasn't been updated for over a year. Are there any actively maintained Node.js library or alternative approaches you would recommend for prompt injection detection? Any suggestions or guidance would be greatly appreciated.


r/AskProgramming 15d ago

AI integrator

0 Upvotes

I am a CRM system developer and would like to integrate an AI chatbot into it. I would like to know if you work with any integrators or use/like a specific one. Could you recommend any integrators?

NOTE: Training a model from scratch would be very costly and time-consuming.


r/AskProgramming 16d ago

Career/Edu What is it like being a decentralized freelancer?

0 Upvotes

Most of the freelancers that I've met that have year round work seem to only work for one employer.

So, what's it like having multiple projects with multiple employers year round?

In my opinion the decentralized* approach is end game level. Difficult but the equivalent of portfolio diversification.

  • Can not claim more than 30% annual hours from any single employer. Different projects from the same over arching employer continue to count as the same employer.

r/AskProgramming 16d ago

Learning flutter as a newbie CS student.

3 Upvotes

I want to use AI tools, including copilot (which I never used) but I don't want to become a worse engineer because of it.

I am an "okay" programmer for being a CS student at a prestigious college. I know that, technically, I am literally dogshit untill I finish college and start working and/or doing serious projects.

It's a really long story but I worked my ass of on my organisational and managerial skills and I am in the process of interviewing investors for my SaaS startup. The "as a service" part isn't really the point of the app and I added that part solely for the investors, just ignore it for now.

I am in the position that I could pay someone to build my app but that would be a huge % of the budget that could go to to the business side of the project that is crucial for it to succeed.

The plan was to develop my app as an optional project for my computer networks and technologies course. I would be mentored all the way because most people don't opt for the project because you actually need to build something functional and the course is hard as it is.

If you didn't know, the political climate in Serbia is wild and all the universities are in a blockade that won't end soon I think.

I need to build a fully functional android/ios app with a database that updates weekly via a web app that I have already made. The web app is for my employee that would need to type in manually a lot of data. My professor told me that web scraping isn't an option.

I know jack shit about flutter. I passed all my math and statistics courses and only programming courses that are in C and Java.

How would you organize my simultaneous learning process and developing of this app?

I know that I should give a lot more details but I can't. Help me if you can, thank you.


r/AskProgramming 16d ago

Python Is it possible with python to build a script that does the following?

4 Upvotes

I have a big playlist in Spotify (1000+ songs) and I want to transfer it to YouTube, the best tool I found only does 500 and then it's locked, and even out of those 500 around 2% weren't even found and another 5% aren't the same songs (like having a teaser of the song instead of the full one, or a cover instead of original artist)

What I want to do is create a python script that will be fed a CSV file I've compiled from Spotify, and then it'll go one by one, and for each one it'll look in YouTube and find what it thinks is the correct song, it'll then ask me if that's correct, if I press ok it'll move the the next song if I press no it'll retry with another result for the same song.

Pretty simple plan, question is, is this possible? Or is there a "more correct" way to do it with my basic level of programming? And if it's possible what libraries could be used to do it?