r/programminghelp • • Jan 12 '20

C Help me understand something

5 Upvotes

Hey,

I'm pretty new to programming and I have this program that someone in my class wrote, it takes a string and removes all the numbers from it.

It is working just fine and I can understand all of the code (pretty much) except for the "str -- + 1" part, can someone please explain to me what it actually do?

Thank you


r/programminghelp • • Dec 31 '19

Python Getting images from a PDF

5 Upvotes

Hi, I'm trying to extract images from a PDF using minecart.

This is the code i have-

I am getting an index out of range error on the second to last line. There is an image on the first page of the pdf.

What's wrong?

import minecart  
pdffile = open('test.pdf', 'rb')
doc = minecart.Document(pdffile)  
page = doc.get_page(0) 
for page in doc.iter_pages():     
    im = page.images[0].as_pil() # requires pillow     
    display(im)

r/programminghelp • • Oct 09 '19

Other Bit of a different request. But can someone explain this question to me? I really just can’t understand it for the life of me. Thanks all :)

Post image
5 Upvotes

r/programminghelp • • Aug 01 '19

Bored, will refactor/unit test your Java class for free!

5 Upvotes
  • Please send don't send a huge file or a whole project. I am thinking I can do like 1-2 files with a couple hundred lines of code or less, at most.

  • Will post results here, so others can discuss comments/questions (and probably in my github), you should be OK with that.


r/programminghelp • • Jul 22 '19

Can anyone help me get started with this project? This is the only page of instructions (java netbeans)

Post image
5 Upvotes

r/programminghelp • • Jun 14 '19

Axis Vertical not found how do I fix this?

Post image
5 Upvotes

r/programminghelp • • Apr 22 '19

😞Help !!

5 Upvotes

I want to start programming , I need e serial of programming language and a suggestion of where to start ....


r/programminghelp • • Mar 27 '19

I am trying make a program that asks name and password. The name part works properly, however, If i enter any password it says access granted even though i have mentioned the password.

Post image
5 Upvotes

r/programminghelp • • Feb 18 '19

I don't really understand GitHub. Is it possible to get this Neural Network Automatic Anime-Sketch Coloring Tool working locally, and if so, how?

5 Upvotes

This project looks amazing, but they took the website demo of it offline due to inadequate hosting funds. Is there a way to still use it in the meantime?

This is it: https://github.com/lllyasviel/style2paints

It's freaking cool. Is there a way to actually get it working locally? It seems extremely complex.


r/programminghelp • • Nov 15 '18

When installing Python packages, what is "pip" and how do you use it?

5 Upvotes

Note: I went to r/explainlikeimfive first because I need that kind of answer, but the bot redirected me here since it's about programming. Please do not assume I know anything other than what I say I know. Thank you.

I was self-taught Python and generally have a good feel for how to use the language itself. However, whenever I want to install a package, I have no idea how to do it. The tutorials jump straight into typing commands into the command prompt, which I have absolutely no idea how to use, including switching directories. I've looked up tutorials for the tutorials, but they still go over my head. If I want to install package X, how do I get it, and how do I use pip to install it (pretending I've never heard of command prompt)?

I currently have Python 3.4 on Windows 10.


r/programminghelp • • Nov 03 '18

Help with points in a plane

5 Upvotes

Hello, i'm trying to code a method to calculate the maximun number of points in a plane that can "communicate" at a maximum distance D using JAVA.

Each point will be an object, and they will have two int representing the x and y coordinates in the plane.

I discovered that if you choose any point in the plane, you can determine a circle of radius D and center in the chosen point, where all the points within the circle can communicate with the chosen point.

After that, alliterations can be used to determine all the communications of each point in the plane at a distance D and find what is the highest number of communications between all the points.

The problem is that doing this last calculation represents a great calculation time for the program.

My question is; Is there any other way to do it?

Or if you can give me any suggestions on how I intend to code it.


r/programminghelp • • Oct 07 '18

I have a Java assignment and I'm so confused. Any help would be great.

5 Upvotes

I'm in my first semester of aeronautical engineering and have to do a computing module. We're just doing simple java but I'm not understanding it that well. I now have an assignment to complete and don't really know what to do. This is what I've done so far. I'm trying to adapt another piece of code but don't really understand and believe I'm probably getting things wrong. Any help would be great. Thanks!


r/programminghelp • • Aug 31 '18

How to monitor database updates in real-time for ~10k unique "ID's" via web sockets?

5 Upvotes

I'm not looking for a coding level help, but on a higher level.

I have a database containing millions of status values, each associated with a unique id, among other things.

I want to monitor these unique ID's (up to about ~10k at a time) and check it's status in the database. If the status changes, then I want to send that change over a web socket to update a client. Say the ID is a long and the status is a String.

How is something like this normally done in the real world without causing problems in the database?

How can you efficiently query 10k id's from a few million efficiently?

Is it as straight forward as a service that periodically queries the db for updates?

What's the real world situation for something like this as part of a critical system?

I can limit the number of clients to 10 or 20, but Ideally I'd like a few hundred. And each of those web sockets should be able to query a different batch of id's.

I'm not looking for a complete solution, I just want to know where I need to look to read what I need to consider when building this. What's the most efficient way to query the db, how to decide data limits, common mistakes to watch out for, etc....


r/programminghelp • • May 17 '18

Two programs that do the same thing with very different execution times

5 Upvotes

I have written the same (well, I think they are the same) program in both Java and Python:

Java:

public static void main(String[] args){
    int i = 1;
    while (true){
        if (factor(i)){
            break;
        }
        i++;
    }
    System.out.println(i);
}
public static boolean factor(int n){
    for (int i = 2; i <= 20; i++){
        if (n%i!=0){
            return false;
        }
    }
    return true;
}

Python:

def main():
    i = 1
    while True:
    	    if factor(i):
		    break
	    i+=1
    print(i)

def factor(n):
    for i in range(2,21):
	if n%i!=0:
		return False
    return True

The Java program runs in less than a second, and the Python version runs in 107 seconds. What is the reason for this difference? I was under the impression that Python is generally faster than Java.


r/programminghelp • • Aug 02 '26

Answered Algorithms

4 Upvotes

I am beginners in DSA please tell me that Algorithms code is remember or not


r/programminghelp • • Apr 25 '26

React Facing some issues with starting Expo.

4 Upvotes

ConfigError: The expected package.json path: /Users/XxXxX/package.json does not exist

I've installed brew and watchman as per the instructions so far.

Any suggestions?


r/programminghelp • • Feb 12 '26

HTML/CSS How can I improve the UI/UX of my web development projects as a beginner?

4 Upvotes

Hi everyone,

I’m currently learning web development, and while working on projects, I often feel that my UI/UX and frontend design don’t look very good.

I understand that UI/UX design is usually a separate skill handled by designers. My main goal is to become a web developer, so I’m not very interested in going deep into the design field. However, I still want my projects to look clean, user-friendly, and smooth.

So I have two questions:

  1. How can I improve the frontend design of my projects as a developer?

  2. Should I also learn UI/UX design basics, even if my core target is web development?

Any advice, resources, or practical tips would be really helpful.
Thanks in advance! 🙏


r/programminghelp • • Jan 27 '26

Project Related Running out of ideas

4 Upvotes

hello nice people. I’m a 3rd year CSE student. we have been asked to do a mini project which should have hardware + software (kind of like an IoT project). I had 2 ideas but both were rejected due to the difficulties in hardware implementation. so I want to know, do you guys have any ideas? we have to submit this project to conferences in March and it should be a unique idea (it can be existing but it should address the gaps - that’s the only way it’s allowed). please help me, I would forever be grateful.


r/programminghelp • • Jan 03 '26

JavaScript Any good way in JavaScript to store a rendered image on the client side?

4 Upvotes

I have a Mandelbrot set rendering tool that runs on my website (http://weirdly.net/webtoys/mandelbrot/). It works ok, but one thing that I'm looking to optimise is the rendering of thumbnail images.

It has an option to save any rendering you create, which stores all of the info that's used to render the image in localStorage and creates a thumbnail that you can later click on to load it back up.

The problem I'm running into is the loading time for those thumbnails. When the page loads it runs through rendering them. Each one takes a fraction of a second, but once you have enough, you end up waiting a significant amount of time for them to finish.

I can think of a couple of solutions, but neither is great. I could base64 encode the thumbnails and throw them into localStorage, but that would be far too much data for the available space. I could have it upload thumbnails to the server, ready to grab on page load, but that's more potential bandwidth and storage than I want to spend.

Is there any way to cache those images in the browser? That would be ideal.

Any other ideas?

If you want to look at the code, it can be found on my GitHub account at https://github.com/jacobEwing/webtoys/tree/main/mandelbrot, or as previously mentioned, on my site.


r/programminghelp • • Dec 22 '25

Python Trouble thinking outside the box with programming or just thinking in general.

4 Upvotes

I’ve noticed this problem for a while were even though I’ve learned a good bit of the fundamentals with a computer language and then during projects when I look for answers to things I’ve been stumped on for hours, and then when I lookup an answer to whatever it is I was trying to do. In my mind I say, “Wow, I just simply didn’t even think of that or know that was possible”. And it happens so much, despite me knowing at least the fundamentals. Is this common with programming, how do I stop this or atleast have it happen less and less?


r/programminghelp • • Dec 19 '25

Other Dumb Question: How can I build the Atom Code editor? (I have a fork and I wanna try and do some stuff but I'm not sure how to build it)

4 Upvotes

I'm on Windows 11 BTW and have VS 2022. I think I downloaded some runtime for compiling windows apps on my system as well.


r/programminghelp • • Sep 25 '25

Project Related How do I avoid hogging the Wikidata Query Service when making SPARQL queries?

4 Upvotes

I am solving a growing problem and intend to submit the website running my JavaScript code to r/InternetIsBeautiful, and you can imagine a lot of traffic will probably come from lurkers, bots, and other viewers through there. Recently, however, I was testing searches when I got an error letting me know the service load is full and to try again later.

Before the creative parts of the site come in (for rule 1 of that sub), which I don't want to leak early, I need to get the official website. The following below is the only format for any SPARQL query my JavaScript code ever sends and only when a button meant to generate the creative part is pressed in HTML, with the only potential difference being the numbers after Q. All input is validated for proper formatting using /^Q[0-9]+$/ (not using \d because the internationalising of numeral systems can screw up things should Wikidata be compromised). The button cannot be accidentally pressed twice while another query like this is still processing in the same tab:

SELECT ?website WHERE {
    wd:Q95 wdt:P856 ?website .
}

Considering I and any others using the query service accidentally overloaded the servers with only several searches, a huge subreddit like that definitely would, preventing important researchers outside the forum from using resources they need. SPARQL was chosen because it respects the "official website" property having a "single best value," although I am accounting for constraint violations by getting the URLs from the entire list (usually returns 0 or 1 anyway). I have thought of setting a LIMIT 1 to the query, but it still has to query the entire database to find the correct entry, and also thought of batching them up on a server and sending them all at once, but at scale, it can take minutes when people's attention spans are in seconds.

How do I fix this? If one person can accidentally overload the traffic, some people may do it on purpose or because traffic is so large! The main Wikidata API is working fine, though.


r/programminghelp • • Sep 08 '25

C# Question for the seniors ...

4 Upvotes

Tldr; I have no clue what I'm doing.

Today was my first day working as a software engineer. I'm still a student now starting my 3rd year with almost no real hands on experience.

My first day was basically a simulation of a client describing specs so I can build the software. It's an internal HR app for the company to use that has to be (re)written in C# and Blazor with MSSQL database, since the old version is really outdated.

I have to say it was pretty overwhelming, since I haven't used the technologies before. It seems like a mountain of work and I don't really know how to start climbing it?

I feel like vibecoding it will take me longer than actually building this from scratch by myself, but I feel like there will be so many time consuiming problems I won't understand and won't even know where to actually look for an answer since I'm so new to this. The impostor syndrome kicked in real hard today ngl.

Tommorrow is an in-office day so I will do my best to communicate as much as possible with my mentor on how to proceed. The company seems to like me though, I just hope I am able to keep up.


r/programminghelp • • Aug 09 '25

Other Book / resource recommendations that get into the practical side of building scalable app infrastructure

4 Upvotes

Hi, I'm going to be working with a team to develop a replacement, more-scalable web app for their startup. Coding what they need isn't a problem - but where I probably need to do some learning is in setting everything up on the infrastructure side of things. I.e. how can I actually do things like set up a CDN, have auto-scaling read-versions of the app, caching, background jobs etc. I'm not looking for books/ resources on building high-level design diagrams but more things that get into the weeds of actually how to do it. I've worked on multiple projects that do all this stuff before, but I've always worked with a DevOps team and so I have limited knowledge of how to actually implement it myself. The above is obviously a very paired down list of requirements but in essence the application will operate in multiple countries and will be expected to scale to approximately 75,000 users; aside from that it's pretty simple from an application standpoint. I'm considering two angles, 1. sub-contract someone that's a dedicated DevOps engineer; or ideally, 2. Do it myself until I get to a point where I need additional support. Does anyone have any book / resource recommendations that could help get me started? Thanks in advance!

TLDR; looking for book/ resource recommendations for designing AND ACTUALLY BUILDING infrastructure for an ~75,000 user, multinational application.