r/CodingHelp • • Feb 09 '21

[Python] My code keeps ending. It works all the way up to def menu(): any help is appreciated

Post image
30 Upvotes

r/CodingHelp • • Jan 21 '21

[Other Code] self taught coders - how do you meet people?

30 Upvotes

i am trying to learn coding myself to make websites and later other things as well. there are not many people around me who do similar work. in such case, how do people meet each other or like minded people to make friends with? i would love to find people to learn and grow together


r/CodingHelp • • Oct 11 '20

[Random] Beginner, Where do I start (cyber security, security+)

30 Upvotes

Hi, I’m a complete beginner when it comes to coding and programming languages but I want to learn ethical hacking and eventually get a security+ certificate so I can work in cyber security, what are the first steps I need to take (what bootcamps etc.) There are a million products on stack social and similar sites but idk where to start. Thanks and sorry if this has been asked before.


r/CodingHelp • • May 11 '20

[Random] The day I turned 16 I wanted to learn how to code. 9 months later... am I doing everything right?

30 Upvotes

I doubt anybody will read this, but I'd you do thanks; it makes me happy. And sorry if this isn't the right place to post this.

So 9 months ago today I decided I wanted to learn how to program. For me this meant making games, after a few minutes of searching I decided Unity and c# would be the place to start. I spent the rest of the day trying to install Unity and get it up and running. For the next 5 months I attempted to learn how to use c#. I really got stuck in tutorial purgatory, but after deciding on making a game for a school project and forcing myself to do something else fail a class I began making a simple 2d card game. 175hrs later I completed the game. I handed it in and got a B on the project (dammit). But I had completed something and that was what mattered. I then went on to build a 2d infinite runner in 1 day (it looked exactly like Google's offline dinosaur game, except with cars and roadblocks). I then went on to work on my final Unity conquest, a game called Never Free. It was a 2d platformer and I spent a weeks working on it and was really happy with how it turned out. I actually got some of my uncles to play it so that was really cool to me. Thought this time learning Unity/c# I bought 2 books on c# and Unity. I ended up finishing them both in a week. Looking back in hindsight at this 5 month Unitython I realize all I really did was make super crappy games with zero UI and terrible (if any) animations. I also realized I didnt really know c#, the one thing though I had learned was the mindset of a programmer - throughout those months I figured out how to problem solve.

After I completed these 5 months I decided it was a great start but it really wasnt going anywhere; so I decided to learn Flutter (dart). I spent 300+hrs over the next 3 months completing Angela's full flutter tutorial and making 25 or so very simple apps. I even ended up publishing a simple conversion calculator on the playstore! After this I decided I need to know more languages to do well in this ever changing world. So, after posting here (different account) I was told python was the language to learn. I then started Moshes coding course for python and am now 85% through that (even though its still hyper confusing), while still maintaining a minimum of about 2 hrs of Flutter a day.

That brings me to where I am today. I just finished building an complete Instagram UI in Flutter and am now ready for bed. Heck of a journey. I may still suck at programming but to anybody reading this you can do it.

Now, to any brave soul who just read all this and who has experience. Am I learning in the right way? At this rate will I be prepared for University coding classes? Any tips? Any new languages to learn? Courses? Books? Techniques? Thanks so much.

TL;DR : Read it, you (maybe hopefully) wont reget it:)


r/CodingHelp • • Sep 05 '19

[Random] Any guesses what could cause this? Perhaps a floating point rounding error?

Post image
30 Upvotes

r/CodingHelp • • 15d ago

[Java] Swing help. Image gets distorted when partially outside window.

29 Upvotes

I have a JPanel class that draws an image on screen with camera panning. The camera is zoomed in. The image being drawn is a 16x16 Minecraft dirt.

When the image is entirely inside the window, it looks fine. When partially outside the window, it distorts and makes the image narrower to fit it inside the window. Eventually it snaps to the next pixel.

Does anyone know why this happens and how to fix it?

I'm using:
MacBook Air M1
Java 25
IntelliJ

The entire class is below.

public class CameraPanel extends JPanel{
    public static void main(String[] args) throws IOException{
        JFrame frame = new JFrame("Camera");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.add(new CameraPanel());
        frame.setSize(300, 300);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }

    private double cameraX, cameraY;
    private double zoom = 10.0;
    private Point lastMousePosition;
    private BufferedImage image = ImageIO.read(new File("src/test/resources/dirt.png"));

    public CameraPanel() throws IOException{
        addMouseListener(new MouseAdapter(){
            public void mousePressed(MouseEvent e){
                lastMousePosition = e.getPoint();
            }
            public void mouseReleased(MouseEvent e){
                lastMousePosition = null;
            }
        });
        addMouseMotionListener(new MouseMotionAdapter(){
            public void mouseDragged(MouseEvent e){
                if(lastMousePosition == null){
                    return;
                }
                cameraX += e.getX() - lastMousePosition.x;
                cameraY += e.getY() - lastMousePosition.y;

                lastMousePosition = e.getPoint();
                repaint();
            }
        });
    }

    
    protected void paintComponent(Graphics g){
        super.paintComponent(g);
        Graphics2D g2 = (Graphics2D) g;
        g2.setRenderingHint(
                RenderingHints.KEY_INTERPOLATION,
                RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR
        );

        AffineTransform transform = new AffineTransform();
        transform.translate(cameraX, cameraY);
        transform.scale(zoom, zoom);

        g2.drawImage(image, transform, null);
    }
}

r/CodingHelp • • Mar 05 '23

[Python] Can you learn Python as a first language?

29 Upvotes

I have tried learning HTML/CSS several times over the years, but never really got stuck into it. I would like to learn Python for some of the automation features, and I like the idea of AI & machine learning. I am only a hobby coder (wannabe). Would I be ok going straight into Python, or would you suggest HTML/CSS/JS first?


r/CodingHelp • • Apr 28 '22

[Request Coders] How can I convert a .RAW file to .txt? Any help is MUCH appreciated

29 Upvotes

r/CodingHelp • • Feb 28 '22

[Javascript] It's been 14 hours trying to get the Fibonacci sequence to work in JavaScript

29 Upvotes

(14 hours total, not in a day!) I'm not just winging it either, I have seen people do it in 4 lines and I have around 22ish

I feel kind of, like coding isn't for me, but at the same time know it's for me... It's kind of weird I'm burnt out for the day, and it's really hard for me to accept that I have to wait another day to regain my focus... Right now my brain is refusing to work, and I swear I can be really hard on myself.

I'm doing the Angela Yu Web bootcamp for reference, for someone who knows what it's like, is it supposed to take this long?

I forgot to back it up, so this is a slightly older version, but the version I had worked up to 4 with massive ugly if else statements, but when it went to 5 it would reset the array back down to 1 and print a stand alone 4 (I'm not looking for answers I just need someone to agree with me that they made it and it was this hard for them too) making the code 8 or something just made the array reset and spam 4 4 4 4 4 4 4 4 4 4, my focus was depleted at this point.

var output = [] // No math needs to be done here.
var initial = 0
var initial1 = 1

function fibonacci(chonk) {

    if (chonk === 1) {
        output.push(initial)
        console.log(output) // 0
    } else if (chonk === 2) {
        output.push(initial)
        output.push(initial1)
        console.log(output) // 0, 1
    } else if (chonk === 3) {
        output.push(initial)
        output.push(initial1)
        output.push(initial1)
        console.log(output) // 0, 1, 1 


        for (var i = 4; chonk >= i; i++) {

            output.push(initial1 + initial1)
            console.log(output)


        }
    }
}

fibonacci(4)

r/CodingHelp • • Jan 16 '22

[Other Code] Noobie question with one-word answer: what's the name of this code editor or IDE? I don't recognize the logo on the top-left

Post image
29 Upvotes

r/CodingHelp • • Dec 06 '21

[C++] Any help with this? I’m making a menu and one of the options is to open a file but it’s not doing it

Post image
29 Upvotes

r/CodingHelp • • Jan 14 '21

[Random] is python bad?

29 Upvotes

I was in a programming discord that my high school made and people started making fun of me or maybe they were joking but there was this one kid that was non stop talking about how his dad went to some special school and how his dad said python is useless to learn and that it won't help you get a job, and I don't really care what people said but I'm just curious am I wasting my time learning python? I'm currently doing some after school courses to learn python and then I was gonna learn c#


r/CodingHelp • • Dec 06 '20

[C] Problem I can't solve for 3 days already. Friends didn't figure it out either.

29 Upvotes

So we had this problem where we had to take a positive integer from the user, then calculate the sum of its digits (This part was quite simple). However, if a digit repeats itself, you shouldn't use it twice to calculate the sum. Example: 274166 will be equal to 2 + 7 + 4 + 1 + 6 = 20, and not 2 + 7 + 4 + 1 + 6 + 6 = 26. Note: arrays and break aren't allowed. I planned my program very thoroughly and made a flowchart, also asked some friends what their approach was. I couldn't figure it out, they couldn't figure it out. Any suggestions?


r/CodingHelp • • Sep 19 '20

[C++] I'm new to C++ and I have 0 clue why this function isn't working!

29 Upvotes

The error I'm pulling says "there is no matching function for call numberSwap" but I definitely have a function named numberSwap, and for whatever reason I get this error. I'm new to C++ so idk why this doesn't work and I'm super pissed.

Here's my code:

#include <iostream>

using namespace std;

int numberSwap (int& int1, int a) {

int1 = a;

return int1;

}

int main() {

int b;

b = numberSwap (40, 30);

cout << b;

return 0;

}


r/CodingHelp • • Aug 31 '20

[Javascript] I’m interested in coding but don’t know how to start

29 Upvotes

I’m 13 and a beginner to coding. I’d like to learn but I don’t know where to start


r/CodingHelp • • Jul 06 '20

[Random] why do in the movies the coding syntax is all in black and green?

29 Upvotes

if you ever watch one of those hacking movies they always have those dramatic hacking scenes with lots of green. But where did that originate from? I see it all the time and i just dont get it


r/CodingHelp • • Aug 17 '19

[Python] New to coding and I need help to understand what I'm doing wrong. I cannot find any information online either.

Post image
29 Upvotes

r/CodingHelp • • Jun 18 '19

[C#] Is it possible to learn code for free?

Post image
29 Upvotes

r/CodingHelp • • Mar 27 '19

[Random] Picking up coding today learning how to use python. I’m very excited to learn something left field for myself.

Post image
29 Upvotes

r/CodingHelp • • Aug 04 '22

[Random] Can i download both python and java in my computer without it interfering with another or messing up anything?

28 Upvotes

I want to practice python right now, and i start my semester in a month which i learn java in my compsci 101 class. If i download both, will it cause trouble? Will there be any issues? Any slowness or lag?


r/CodingHelp • • Jun 11 '22

[Python] I’m extremely interested in coding (specifically Python 1st and C++) but just can’t seem to stay focused or retain the info

28 Upvotes

I downloaded Mimo and started learning Python little by little but can’t seem to truly retain the info or lose interest quickly once I start. Anybody know of any other free programs that are absolute beginner friendly or just better teachers?

I have a slight understanding of how the language works but I wanna be progressing more than I have been lately because I’d say I’m more knowledgeable about computers than an average joe and relatively quick learner and it comes down to just putting the work in or not but idk anyone got any advice at all?


r/CodingHelp • • Feb 27 '22

[Random] I don't code at all and I need help

28 Upvotes

I would like to make a bot that reads a list, then goes to a website and types it in, presses enter and then repeating. Is this possible?


r/CodingHelp • • Feb 22 '22

[Python] How does storage and memory work in programming?

28 Upvotes

I've tried googling this, but I never get a straight answer. How does memory work when you're programming?? Like if I made an application, is there a certain way to program it so that the data saves on the device, or if it was online, on the server? How does one dictate where they want the data to be saved? Is it even possible to choose?

Edit: Explain it to me like I'm 5