/r/learnprogramming

Photograph via snooOG

A subreddit for all questions related to programming in any language.

Welcome to LearnProgramming!


New? READ ME FIRST!

Posting guidelines

Frequently asked questions

Subreddit rules

Message the moderators


Asking debugging questions

If you need help debugging, you must include:

  1. A concise but descriptive title.
  2. A good description of the problem.
  3. A minimal, easily runnable, and well-formatted program that illustrates your problem.
  4. The output you expected, and what you got instead. If you got an error, include the full error message.

See debugging question guidelines for more info.

Asking conceptual questions

Many conceptual questions have already been asked and answered. Read our FAQ and search old posts before asking your question. If your question is similar to one in the FAQ, explain how it's different.

See conceptual questions guidelines for more info.

Other guidelines and links

  1. Frequently asked questions
  2. Asking homework questions
  3. Asking for code review
  4. Answering questions
  5. Learning resources
  6. Other communities

Subreddit rules

1. No unprofessional/derogatory speech

  • Follow reddiquette: behave professionally and civilly at all times. Communicate to others the same way you would at your workplace. Disagreement and technical critiques are ok, but personal attacks are not.

Abusive, racist, or derogatory comments are absolutely not tolerated.

See our policies on acceptable speech and conduct for more details.

2. No spam or tasteless self-promotion

In short, your posting history should not be predominantly self-promotional and your resource should be high-quality and complete. Your post should not "feel spammy".

Distinguishing between tasteless and tasteful self-promotion is inherently subjective. When in doubt, message the mods and ask them to review your post.

Self promotion from first time posters without prior participation in the subreddit is explicitly forbidden.

3. No off-topic posts

  • Do not post questions that are completely unrelated to programming, software engineering, and related fields. Tech support and hardware recommendation questions count as "completely unrelated".

Questions that straddle the line between learning programming and learning other tech topics are ok: we don't expect beginners to know how exactly to categorize their question.

See our policies on allowed topics for more details.

4. Do not ask exact duplicates of FAQ questions

  • Do not post questions that are an exact duplicate of something already answered in the FAQ.

If your question is similar to an existing FAQ question, you MUST cite which part of the FAQ you looked at and what exactly you want clarification on.

5. Do not delete posts

  • Do not delete your post! Your problem may be solved, but others who have similar problems in the future could benefit from the solution/discussion in the thread.

Use the "solved" flair instead.

6. No app/website review requests or showcases

  • Do not request reviews for, promote, or showcase some app or website you've written. This is a subreddit for learning programming, not a "critique my project" or "advertise my project" subreddit.

Asking for code reviews is ok as long as you follow the relevant policies. In short, link to only your code and be specific about what you want feedback on. Do not include a link to a final product or to a demo in your post.

7. No rewards

  • You may not ask for or offer payment of any kind (monetary or otherwise) when giving or receiving help.

In particular, it is not appropriate to offer a reward, bounty, or bribe to try and expedite answers to your question, nor is it appropriate to offer to pay somebody to do your work or homework for you.

8. No indirect links

  • All links must link directly to the destination page. Do not use URL shorteners, referral links or click-trackers. Do not link to some intermediary page that contains mostly only a link to the actual page and no additional value.

For example, linking to some tweet or some half-hearted blog post which links to the page is not ok; but linking to a tweet with interesting replies or to a blog post that does some extra analysis is.

Udemy coupon links are ok: the discount adds "additional value".

9. Do not promote illegal or unethical practices

  • Do not ask for help doing anything illegal or unethical. Do not suggest or help somebody do something illegal or unethical.

This includes piracy: asking for or posting links to pirated material is strictly forbidden and can result in an instant and permanent ban.

Trying to circumvent the terms of services of a website also counts as unethical behavior.

10. No complete solutions

  • Do not ask for or post a complete solution to a problem.

When working on a problem, try solving it on your own first and ask for help on specific parts you're stuck with.

If you're helping someone, focus on helping OP make forward progress: link to docs, unblock misconceptions, give examples, teach general techniques, ask leading questions, give hints, but no direct solutions.

See our guidelines on offering help for more details.

11. Don't ask to ask.

  • Ask your questions right here in the open subreddit. Show what you have tried and tell us exactly where you got stuck.

We want to keep all discussion inside the open subreddit so that more people can chime in and help as well as benefit from the help given.

We also do not encourage help via DM for the same reasons - that more people can benefit

12. Low Effort Questions

  • Do not ask easily googleable questions or questions that are covered in the documentation.

This subreddit is not a proxy for documentation or google.

We do require effort and demonstration of effort.

This includes "how do I?" questions

13. No AI (chatGPT etc.) generated messages/comments. No questions about chatGPT/AI generated code.

  • Such posts/comments will be removed without warning and the poster of ai generated content will be instantly banned.

/r/learnprogramming

4,142,861 Subscribers

3

Career Advice Needed: Data Analysis/Data Science vs. Web Development Path

Hi everyone! I’m in a bit of a dilemma and would love some advice on which career path to focus on. Here’s my background and goals:

Background: I come from a non-CS background (Bachelor in Finance) but have taken a few CS courses. I’m starting a Master’s in Computer Science this spring, which will require a lot of time and effort, especially with courses outside my comfort zone.

Current Skills & Learning:

  • Learned Python and Java through the University of Helsinki’s MOOC.
  • Currently doing Dataquest for Data Science.
  • Using Khan Academy to build up my math skills.
  • Reading math books on Linear Algebra

Goals: I’m deciding between two main paths:

  • Data Analysis/Data Science: I’d start with data analysis using Power BI and SQL, then transition to Data Science/Machine Learning with Python. This path would involve time-intensive coursework in my master’s program and extra study with resources like Introduction to Statistical Learning.

  • Web Development: I’m considering using The Odin Project as a structured guide. Eventually, I’d like to transition into web app development, which also has a significant learning curve but feels very project-focused and directly applicable.

Given my master’s commitments, I can’t pursue both paths as each requires extensive time investment. Even during the Master, there is a ML path and a regular CS path and I will have to make a choice.

I’d appreciate any thoughts, especially if you’ve had to make a similar decision. Thanks in advance!

0 Comments
2024/10/31
05:05 UTC

2

android studio compile error

https://github.com/geneforgedshaper/hellspeak whys it bitchin at me and what do i do about it?

-----------------------------------------------------------------------------------------------------------------

2 issues were found when checking AAR metadata:

  1. Dependency 'androidx.core:core-ktx:1.15.0' requires libraries and applications that

depend on it to compile against version 35 or later of the

Android APIs.

:app is currently compiled against android-34.

Also, the maximum recommended compile SDK version for Android Gradle

plugin 8.5.1 is 34.

Recommended action: Update this project's version of the Android Gradle

plugin to one that supports 35, then update this project to use

compileSdk of at least 35.

Note that updating a library or application's compileSdk (which

allows newer APIs to be used) can be done separately from updating

targetSdk (which opts the app in to new runtime behavior) and

minSdk (which determines which devices the app can be installed

on).

  1. Dependency 'androidx.core:core:1.15.0' requires libraries and applications that

depend on it to compile against version 35 or later of the

Android APIs.

:app is currently compiled against android-34.

Also, the maximum recommended compile SDK version for Android Gradle

plugin 8.5.1 is 34.

Recommended action: Update this project's version of the Android Gradle

plugin to one that supports 35, then update this project to use

compileSdk of at least 35.

Note that updating a library or application's compileSdk (which

allows newer APIs to be used) can be done separately from updating

targetSdk (which opts the app in to new runtime behavior) and

minSdk (which determines which devices the app can be installed

on).

2 Comments
2024/10/31
05:01 UTC

2

What are some useful python or java tips as a beginner who’s gonna go into cs next year

I still not sure what type of sector I’m leaning towards but there’s a lot out there

0 Comments
2024/10/31
04:52 UTC

1

I'm getting frustrated because my classmates are using ChatGPT to work faster and tackle more complex tasks.

As the title says, I'm getting frustrated because I spend a lot of time researching and trying to find good solutions while coding. It's taking me forever to complete just one feature. Meanwhile, my classmates are using ChatGPT to tackle more complex stuff, and when I ask them to explain how they're doing it, they can’t be bothered to explain.

For example, I have a group project with multiple developers, and I know one of them is actively using ChatGPT. They end up with a mix of code that works, or they'll ask the teacher if their approach is good, then rewrite line for line the ChatGPT-generated code in their IDE and claim they did it themselves and getting good marks because of it.

I am also using it but when I am stuck on key concept I don't fully understand, like keyword in c#

I don't get it, and it's starting to frustrate me. Am I shooting myself in the foot for not using AI to help solve every single problem?

2 Comments
2024/10/30
22:50 UTC

2

Stuck on Decoding QR Code Data – Encoding Bits Don’t Match Expected Format

Hi everyone,

I’m working on a QR code decoding project from scratch without using libraries, and I’m really stuck on reading the encoding bits correctly. I’ve followed every step I can think of, but the results are just not making sense, so I thought I’d reach out here to see if anyone has any ideas.

Here’s where I’m at:

  1. Zigzag Ordering: I’ve read the bit string in the correct “zigzag” order, so I know I’m reading the bits in the proper sequence.
  2. Masking Visualized: I have a tool that helps me visualize the QR code before and after applying the mask, and I’ve manually verified that the masking is indeed applied correctly. So, I’m confident that my bit data is accurate.
  3. Expected Encoding Bits: Based on Wikipedia’s documentation, the first four bits should represent the encoding type, and they should match one of these values:
    • 0001 for Numeric encoding (10 bits per 3 digits)
    • 0010 for Alphanumeric encoding (11 bits per 2 characters)
    • 0100 for Byte encoding (8 bits per character)
    • 1000 for Kanji encoding (13 bits per character)

The problem? I’m getting sequences of four bits that don’t match any of these encoding types. The results almost feel “random” across multiple test QR images. I’ve triple-checked my masking, ordering, and starting position, so I’m at a loss for what could be causing this.

The QR code I'm putting is one I generated online containing only a few numbers to test the "numeric" encoding type and yet, upon reading the bits, I get: 1101 which obviously does not match any pattern listed above. Does anybody know what could be going on? (EDIT: Actually I just realized I can't put images on the post so you'll have to take my word for it)

0 Comments
2024/10/31
04:11 UTC

5

What should I learn next ?

Hello I am learning Web development. I already learn html css and quite a bit about modern javascript And I am learning react right now. I was wondering what should I learn next ?should I dive into more about Next js and typescript become a frontend developer or invest in learning backend language like node js and become full stack developer.I know nothing about backend so I am little scared .

3 Comments
2024/10/31
04:01 UTC

1

Am I being to reliant on AI? (this is not about AI taking jobs i promise)

Don't worry, this post isn't about AI taking jobs or anything like that. For the past year, I've been learning web development and building side projects. Obviously, when doing these things, you need to look up how to do certain things like authentication or React context hooks—things you might not know off the dome. However, in my building process, I've been turning to AI to learn how to do things like write API calls or implement a Context hook to give my web apps structure.

My question is: is it bad to learn this way? I think I could write an API call from scratch at this point, but Context is something I don’t think I could do from memory or implement without looking things up. I always make sure I fully understand the code I use in my projects, but since models like Claude 3.5 Sonnet can quickly generate examples I can analyze and adapt (like using Supabase for auth, for example), it’s a lot easier than scanning through StackOverflow or other forums and docs.

I guess I just struggle to feel like a "real" programmer if I’m not working through forums to learn how to do something. I’m curious if using AI this way is something I should refrain from. Thanks!

1 Comment
2024/10/31
03:58 UTC

1

Array Help

import numpy as np
mat = np.arange(1,26).reshape(5,5)
list = []
column = 0
for i in range(len(mat)):
    sum = 0
    if column < 5:
        sum+=mat[i][column]
        column+=1
    else:
        list.append(sum)
        column = 0
print(list)

#I'm trying to get the sum of all the columns into one list, and I think this
#logically works. Why is the list coming back as empty in the output?
3 Comments
2024/10/31
03:39 UTC

3

[Announcement] Chrome extension for productivity

Hi there, I am pleased to share the Chrome extension I created. If you like to save articles or any links to read them later and save quotes in highlighter you will love this extension. It's free.

https://chromewebstore.google.com/detail/link-later/gpehbbegbcpjmipphokcmfhkchhcpfam

1 Comment
2024/10/31
02:57 UTC

7

Learning Programming while studying CS in University (Having to work with multiple languages at the same time)

Hello. I have been programming for a few months and I am also studying CS in uni. The language that I use to build most of my side projects is C, since it is the first language I properly learned and because I was told it is a good way to understand how the computer works, how memory works, etc.

However, since I am also doing university, I have CS courses that use different languages like Java and Python. I have been told that when you are still in that beginner phase, you should just stick with one language, but I cannot really do this when uni has me solving problems in multiple.

Is it fine if I am using all these languages at the same time (C for my personal projects, whichever languages courses have me doing for school work)? Or will it be detrimental to my progress

3 Comments
2024/10/31
02:25 UTC

0

What are good sources to learn about LLM?

r/artificialintellegence did not allow this .

Say someone has computer programming experience, a basic ML course, linear math, zero knowledge of LLMs, I took a coursera course in ML long ago using Octave (rather than Python libraries) and included all the usual methods up to recommender systems.

If I wanted to understand current LLMs at least on a superficial level, what are some good courses? Maybe there are short Udemy courses and later longer Courseara courses if those are still good choices.

0 Comments
2024/10/31
01:05 UTC

1

Introduction to Python Programming from Georgia Tech on edx.

With the free access course, you only get access to non graded activities. And with the $180 certificate, you get access to ALL course activities. Has anyone taken this class before and is paying worth it?

0 Comments
2024/10/31
00:59 UTC

2

Trying to code pacman in python on CMU CS Academy. What am I doing wrong?

Anyone have experience with CMU CS Academy coding?

Graphics are obviously not finished yet, but I am trying to get the movement of pacman down, specifically getting him to repeatedly open and close his mouth. Right now I am focusing only on the left key. Its movement to the left seems to work well when I press the left key, but I can’t get the mouth to repeatedly open/close! What is the problem with my code??

For reference it is a 400x400 canvas

Click here to interact with the game I have created thus far (not much of a game yet lol). Try hitting the left key to see how it is malfunctioning:

https://academy.cs.cmu.edu/sharing/tomatoDog2951

Here are all relevant lines of code:

(btw, as you may know, CS Academy does not allow the use of making a variable “global” so I found a way around that by making a bunch of labels, and altering their “value” property as needed, whether it be a string or number of boolean)

x1 = Label('', 200, 200)
x1.visible = False
y1 = Label('', 200, 200)
y1.visible = False
x2 = Label('', 200, 200)
x2.visible = False
y2 = Label('', 200, 200)
y2.visible = False
x3 = Label('', 200, 200)
x3.visible = False
y3 = Label('', 200, 200)
y3.visible = False

pacman = Group(
    Circle(200, 275, 10, fill='yellow'),
    )

mouth = Group()

mouthDirection = Label('', 200, 200)
mouthDirection.visible = False

gameStarted = Label("False", 200, 200)
gameStarted.visible = False

lastKey = Label('', 200, 50)
lastKey.visible = False

def onKeyPress(key):
    mouthDirection.value = "closing"
    if key == 'left':
        if gameStarted.value == "True":
            if lastKey.value == 'right':
                pacman.rotateAngle = 180
                mouth.rotateAngle = 180
            if lastKey.value == 'up':
                pacman.rotateAngle = 270
                mouth.rotateAngle = 270
            if lastKey.value == 'down':
                pacman.rotateAngle = 90
                mouth.rotateAngle = 90
        else:
            x1.value = 200
            y1.value = 275
            x2.value = 190
            y2.value = 282
            x3.value = 190
            y3.value = 268
            triangle = Polygon(x1.value, y1.value, x2.value, y2.value, x3.value, y3.value, fill='black')
            mouth.add(triangle)
            gameStarted.value = "True"
        mouth.centerX = pacman.centerX - 5
        lastKey.value = 'left'

def onStep():
    if gameStarted.value == "True":
        if lastKey.value == 'left':
            pacman.centerX-=1
            mouth.centerX-=1
            x1.value = pacman.centerX
            x2.value = pacman.centerX - 10
            x3.value = pacman.centerX - 10
            for triangle in mouth.children:
                if mouthDirection.value == "closing":
                    triangle.pointList = [[x1.value,y1.value],[x2.value,y2.value+1],[x3.value,y3.value-1]]
                    y2.value += 1
                    y3.value -= 1
                    if y2.value == y3.value:
                        mouthDirection.value = "opening"
                if mouthDirection.value == "opening":
                    triangle.pointList = [[x1.value,y1.value],[x2.value,y2.value-1],[x3.value,y3.value+1]]
                    y2.value -= 1
                    y3.value += 1
                    if y2.value == y3.value:
                        mouthDirection.value = "closing"

And here is some documentation of how CS Academy coding + graphics work:

https://academy.cs.cmu.edu/docs

Sorry for the chaotic post. If there is another subreddit I should post this in, let me know.

0 Comments
2024/10/31
00:55 UTC

1

Unit testing, how to do it properly?

I write some code in a service. I then write a unit test for that specific function. It lives in the test project for the rest of the time the project is used.

The test are really specific. Find an item in the database. Do something with the item.

Should it be able to run the same test over and over again?

If in a month I needed to run the test again I would change values in the test to something current and try it again.

I don’t know if this is the right way we should be doing this or not.

2 Comments
2024/10/31
00:30 UTC

0

Discord JS BOT Template

Hello Everyone!

I'm excited to announce the release of my very first Discord.js bot template! I would love for you to take a look at the code and share your thoughts. Your feedback is invaluable, and if you find it helpful, please consider leaving a star on the repository. Thank you for your support!

https://github.com/NoSkill33/DiscordJS-Bot-Template

1 Comment
2024/10/30
23:34 UTC

3

Is Electron a good choice for adding a front-end to my python programs?

Hi everyone! My main programming language is Python, and I've developed a lot of applications with it, but none with a visual interface. I’d like to start creating something with a GUI.

I learned about Electron from asking GPT as a modern way to build Windows applications, and it even gave me a Discord example. However, I’m not sure if Electron is the right framework to start with for visual interfaces. I also don’t know if it's practical to use Python alongside JavaScript and TypeScript in Electron. I only know the basics of JavaScript, and I’m not ready to commit to learning it in depth.

Would Electron be a good choice for this kind of project, or is there a better alternative for someone with my background?

15 Comments
2024/10/30
23:25 UTC

20

Cousera warning, Your not allowed to ask why your being scammed on the reddit, or any question about overcharging. And support does nothing about overcharging.

So I got charged twice per month for 1 monthly fee. The machine learning specialisation.

Forget that , running a website that tells users they aren't subscribed when they are , then charges them twice for the same thing , is a designed scam / completely incompetent.

Forget the reddit is censored, and you cant even post "overcharged" without it being blocked.

Forget they use dark patterns to prevent speaking to a human for 30 minutes.

Here I am told, After uncovering their double charge scam, "Its a different version" , but its not, its an identical product a monthly fee to access the whole specialisation.

And this scammer, yes the thing coursera refuses you to say. Has scammed me, refused my $144, I've now spent 2 hours, chasing $144. Instead of working my contract.

Forget every time I've done a course with them in the last decade , they have double charged me.

This time, it was definitely caused by me signing up twice for the same course in two days. I remember signing up once btw. ONCE.

Hi ***,

This is *** from the Coursera team. Thank you for reaching out about your billing concerns. I’ve checked your account and found that the issue arose because you were subscribed to two different versions of the "Machine Learning" Specialization.

I’m happy to inform you that both subscriptions have been successfully canceled, so you won’t be charged for them in the future. If you have any further questions or need assistance, please don’t hesitate to let me know.

To view this case, visit My Support Cases.

***
Coursera Support Team
Get Support: Help Center | Learner Community | Chat Support*| My Support Cases
*Available for paid learners

**Update

I've since confirmed, The second charge was due to them cancelling the course, and forcing me to pay again to access it, Then charging me for 2 months for a "cancelled" subscription, they reactivated on their own. Without notifying me. (scam) No wonder they need reddit censorship.

5 Comments
2024/10/30
23:23 UTC

4

Ideal pathway for an upcoming programmer/developer?

I am at a stagnant point in my life. pre covid I took up a diploma web dev course and learn javascript and some python to be a full stack developer.

I did not get any jobs for 2 years of searching in my area of Vancouver, Canada.

My question regarding the path to take, Should I go back to school to get a bachelor degree in computer science and specialize in say mobile development or network security?

Or should I try to work on my skills (which I've been neglecting for the past year) and look into get more work experience with volunteer or something like Fiverr?

10 Comments
2024/10/30
22:37 UTC

0

CoT Prompt engineering for LLMs

Im trying to apply CoT prompting to get best results in a specific domain to enhance LLMs, to implement that is right to store the prompt in a python var then send it to the gpt ? Is this how it’s done?

1 Comment
2024/10/30
21:59 UTC

0

General advice for starting out!

Hi guys - I am just coming to the end of my industrial engineering degree which taught me a lot of general stuff but nothing really specific. As I start my masters next year I will have a lot more time and want to start working on some projects to see what I really enjoy.

One if my modules recently was Information Systems which I loved. The main project we did was designing and building an asp.net website for managing data in various departments for a made up company. The main component was the relational database design and development but I really enjoyed the query processing and development in Visual Basic (I have prev experience with).

Now, I would really like to create my own site from scratch to expand my skills. I also have a speaker rental business I have been running for a couple of years with friends so would like to build a system for storing data and the ability to generate invoices and track salaries etc etc. More challenging to me though will be setting up all the cloud services required to run it. I also would like to keep the cost of this as low as possible as I am mostly learning and although I think the IS is important… it may not be essential to the business rn.

It would be amazing to get some general points to where I can learn and get up and running with setting up instances, environments to use and other tips for starting out. I really don’t want to delve too deep into the details, but learn enough to gain a lot of experience from this. Ultimately- I want to focus on building the relational-database and the site and would like to do it relatively quickly.

Thank you !

1 Comment
2024/10/30
21:10 UTC

0

Should I learn python

I am a front end web developer with little knowledge of backend so just wanted to ask should I learn python.Like I see so many full stack website/apps using python and I can't apply to these jobs because they use python in backend ( those are mostly full stack jobs) . Should I learn python and also if anyone of you have ever migrated from web dev to ml can you tell me if it is good choice to learn ml/ai ,will it give me a job and how much time do I have to dedicate to learn the ml/ai upto the level where I can apply for jobs.Also does masters/PhD matters for getting into this field as I see many post saying that getting into ml/ai/robotics is difficult without getting higher education

5 Comments
2024/10/30
20:48 UTC

0

How do you get back into learning your self-paced online courses after taking time off?

As the title suggests, I need some guidance on getting back into the groove of things in my learning journey. The course I was going through is very project based and I feel like that's the best way to learn. However, unlike a college class, you don't have a professor or TA you can talk to. Although some courses you see might have some kind of support area, help and/or guidance is limited at best.

In my case (if it matters, I am going through a Tim Corey course), I finished building a Battleship clone app for the console. After that, however, life started to happen and I couldn't easily focus on that for several months. So I took an extended break. I know the simple answer is to simply DO IT like Shia LeBeouf, but it's not that simple for me. I'm concerned that due to taking several months off, I may have lost some fundamental knowledge like OOP things. I have practice projects to refer to, but I guess I'm just concerned that due to my break, I can't easily implement/build things on my own anymore.

I guess to get to the meat of the question, I'm wondering if I should consider completely starting over from scratch on the course to be safe, or maybe review OOP concepts in some smaller way? If it matters, for example, the topics I'm thinking of are class types, how to instantiate them, using namespaces, etc.

I would appreciate any feedback from anyone. I don't have anyone to talk to IRL about my goals like this. Thanks, everyone.

P.S: I guess I could rattle this on to my gf, but she's a nurse and doesn't fully get then IT/CS world. But then again, I wish I could just talk with someone. I wish I had a mentor or someone to hear my life story or something and maybe they might have better insight. Idk, man.

1 Comment
2024/10/30
20:46 UTC

0

My fizz wont buzz on leetcode

I saw some comment about fizzbuzz being an easy problem, looked at the problem on leetcode and gave it a try, haven't really messed with programming for a few years, never was very good at it.

When I run this in python visualizer it returns the answer perfectly but not on leetcode. What am I doing wrong here?

https://imgur.com/a/Rfx86FN

I was gonna include the python visualizer link too but its very long.

Here's the code

answer = []
class Solution(object):
    def fizzBuzz(self, n):
        for i in range(1, n+1):
            if i % 3 == 0:
                if i % 5 == 0:
                    answer.append("FizzBuzz")
                else:
                    answer.append("Fizz")
            elif i % 5 == 0:
                answer.append("Buzz")
            else:
                answer.append(str(i))
        return(answer)

heres the output when I try it with n=15 on python visualizer

['1', '2', 'Fizz', '4', 'Buzz', 'Fizz', '7', '8', 'Fizz', 'Buzz', '11', 'Fizz', '13', '14', 'FizzBuzz']
10 Comments
2024/10/30
20:30 UTC

1

Js, function ignoring await and if statement

Hi all, im creating my own website game, im learning programming as my hobby (for now), cut to the case. I created function whose task it is to unlock one button after 3 uses of another (any) buttons. The problem is it should unlock after full execution of those other buttons wich is to select ability, chose target then decrease count to unlock. Rn it works before selecting target so i can just click 3x (it’s unlocked after 3 usage of other skills) and it unlocks, without finishing selecting target. To prevent such thing i have „isAbilityInUse” this prevents stacking, so if you click normal attack 3 times without selecting target (lets assume it deals 10 dmg) it will do 10dmg not 30dmg Second thing to prevent this is await, function that unlock that locked skill is waiting for another function to finish. I will take Normal Attack to the example. Click normal attack, now selecting target shows up and its waiting until finish selection then runs rest of the code. From here function unlocking should work after all this but it seems it works even if normal attack is not finished so the result is unlocking button that is blocked I hope i described it well since my English is around b1/2 level

2 Comments
2024/10/30
20:26 UTC

2

Beginner questions about building AI capabilities into existing software

We're looking to build some AI capabilities into our software, and I'm hoping that someone can answer a few questions or point me in the right direction for answering my questions. I've tried researching this on my own but Google searches haven't returned the answers I'm looking for.

Background: We have some use case ideas for using gen AI in our software, but have some high-level questions about doing that:

  1. How are other software tools handling this? Are they using proprietary LLMs (like OpenAI) and just making API calls every time? Or, do they use open source LLMs on premise?
  2. If they're just making API calls, how do you handle data privacy? I know many of our clients won't like having their data shared with a third party.
  3. How do you manage usage costs? I've looked into how that's calculated, and it appears to be able to get out of hand very quickly.
  4. How do you avoid getting locked into a specific LLM or LLM version?

Sorry for the basic questions, I'm just trying to wrap my head around this. If anyone can answer these or just point me in the right direction for finding my own answers, that would be much appreciated!

3 Comments
2024/10/30
20:06 UTC

1

Projects

I am at an intermediate level, if i want to do projects that I can actually put on my resume for internships, how should I start? I was wondering also if I should consider bought courses also to help me in the projects, such as through udemy? I do not mind paying, but i want to know if this is a good approach?

3 Comments
2024/10/30
19:35 UTC

1

How should I proceed?

Greetings! I started with the CS50 Python Course some 8-10 weeks ago and I had a ton of fun with it. It was my first real introduction to programming and solving the problems was just satisfying. So satisfying that I decided, since my recent experiences and impressions as a working student at a hr-consulting-firm were just boring and showed the image of a braindead and depressing future, to pursue a career in sotware development. So I got myself an apprenticeship for next year in fall at a big tech company. (Hopefully) lucky me, I guess. Now, after talking to the guys at my future company, I know that Python will not be part of at least my early years of being a software developer, since they mostly use C and Java at the entry level jobs. Also some experience with SQL will come in handy. Now I am thinking about switching to the Odin Project, since it contains Lessons and projects on Java and SQL and I have time until september next year. I was wondering wether some of you could recommend it or may have better proposals and options to look into

0 Comments
2024/10/30
19:30 UTC

3

Is Programming/Coding Right for Me? Need Advice.

Hello, I have been working on The Odin Project for around 8 months now. I am 23. (Web Dev Course) I am going through a computer science section right now working with hash maps and binary trees. I hate doing this stuff. I try to work on it for 2 hours everyday, and since I have hit the comp sci section I avoid working like the plague.

However, I have had loads of fun and fulfillment working on my own personal projects earlier on. I built sort of an RPG game that plays like Darkest Dungeon, and I started working on a D&D Beyond clone(ish) that I got stuck on because I don't know any backend yet. Also worked on a OneNote clone, that looks EXACTLY like OneNote just doesn't function like it yet.

The D&D Beyond clone is really my dream project, and I want to work on it but I need to learn how to set up the backend because the whole thing depends on accounts and log-in type stuff. I could skip a bunch of lessons and just learn backend, but I really feel like thats just a bad idea. I want to try to push and go through it linearly, but maybe that is stupid and I should just learn my own way.

I think I just absolutely despise working on anything that isn't related to something I actually care about. So these lessons where they want me to make some small app to learn about concept I just end up not doing that and implementing it into my game or something instead. I just don't care about hash maps until I absolutely need it, does that make sense?

I get discouraged when I see others online that are literally in LOVE and are fascinated by hash maps, or whatever low level comp-sci thing. I just cannot relate to that at all. But I enjoy making things with it. (when it works lol) And I guess you could say that I am more of a visual person? All of my apps are UI heavy and I love good UI and the challenge of making optimal UI.

Anyway, kind of a two-pronged question I guess.

  1. Given the info above, is coding right for me? If so, should I keep pursuing full stack, or go more toward UI or something.

  2. Should I stay on course with learning the Odin Project or should I go wherever my interests/needs for my projects lead me and just learn whatever I need to learn to get it done?

7 Comments
2024/10/30
19:28 UTC

2

Help with College Courses

Hi everyone, I hope you all are doing well. I am an Electrical Engineering Sophomore and I am yet to take two foundational programming courses "Data Structures and Algorithms" and "Object Oriented Programming" in a few semesters time. I put them off for a bit because i barely managed to pass a 100 level programming course called "Algorithmic Problem Solving" AKA "Programming Fundementals". I figured it is not my forte. However i do enjoy coding a lot when i DO know what is happening. Any leads on how to self-teach/self-improve? If i can do this well enough i might even consider a CS Minor then. Thank you for your time :D

0 Comments
2024/10/30
18:55 UTC

0

Help in developing an inventory system for a local shop

Hello, I'm still an amateur in programming, i know the basic or SQL and Java/python and C++ programming languages and some data structures. However i need guide on how to deploy the inventory system for either an ios or android smartphone? What are the resources i need?

Thanks you any help kind redditors.

2 Comments
2024/10/30
18:29 UTC

Back To Top