r/CodingHelp • • 3h ago

[Java] why is this returning read only once i get to the enter name stage

3 Upvotes
import java.util.Scanner;

public class main
{

    public static void main(String[] args) {

        Scanner kboard = new Scanner(System.
in
);

        System.
out
.println("Press 1 to enter lottery numbers or 2 to enter name: ");


        if (kboard.nextInt() == 1) {

            System.
out
.println("Enter your lottery numbers");

            int lotteryNumbers = kboard.nextInt();
        } else {
            System.
out
.println("Please enter your name: ");

            String name = kboard.nextLine();
        }


    }}

r/CodingHelp • • 7h ago

[Javascript] как переписывать автоматически код с одного ЯП на другой ЯП?

Thumbnail
1 Upvotes

r/CodingHelp • • 1d ago

[Request Coders] making buttons lead to other websites

4 Upvotes

I have no experience in coding so apologies if this is a very simple task. i have a chrome extension that makes my landing page fallout themed and the "fast travel" section has dedicated buttons already assigned to websites. I wanted to know how to make it so that i can change these websites to others because I dont use them. any help is appreciated thanks!


r/CodingHelp • • 15h ago

[Other Code] How do I get Antigravity to match a reference UI instead of repeatedly generating a completely different design?

0 Upvotes
AI genrated UI
this UI i wanna atchive

I'm building a dashboard using Google Antigravity and AI-assisted coding, but I'm struggling to get the UI to look the way I want.

The blue UI is my AI-generated design, while the other screenshot is the design I actually want to achieve.

I've tried multiple approaches:

  • Asking ChatGPT and other AI tools to improve my prompts.
  • Giving Antigravity detailed UI/UX instructions.
  • Using the reference screenshot and asking it to recreate the design.
  • Refining the prompts repeatedly to get a more professional, polished result.

Unfortunately, the results still don't match the reference. Sometimes the AI makes unnecessary changes, changes the overall layout, or produces something that looks worse than the original.

My goal isn't to redesign the entire dashboard from scratch. I want to preserve my existing functionality and make the UI closely match the reference, including its layout, spacing, typography, colors, component sizing, alignment, and overall visual hierarchy.

I'm looking for advice from developers who have successfully used Antigravity or similar AI coding agents for this kind of work.

My questions:

  1. What's the most effective workflow for recreating a UI from a reference screenshot using an AI coding agent?
  2. Should I use a different prompting strategy, provide multiple screenshots, or break the work into smaller components?
  3. How can I make the AI follow the reference closely instead of inventing its own design decisions?
  4. Are there any tools, workflows, or techniques that consistently produce better results than simply writing longer prompts?

I'd especially appreciate practical advice from people who have actually solved this problem, rather than generic advice to write more detailed prompts.

Thanks!


r/CodingHelp • • 1d ago

[How to] How can I achieve this scrolling effect in react?

1 Upvotes

I want to achieve an effect like this - https://genshin.hoyoverse.com/en/

Basically, I have multiple sections in my site, and I want to make sure a user scrolls exactly where I want them to. Right now, I use this -

.snapContainer {
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    overflow-x: hidden;
}


.section {
    height: 100vh;
    width: 100vw;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    align-items: center;
    justify-content: center;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}.snapContainer {
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    overflow-x: hidden;
}


.section {
    height: 100vh;
    width: 100vw;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    align-items: center;
    justify-content: center;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

This works, but I want to know how they did it (The proper, non-buggy way). Thanks!


r/CodingHelp • • 5d ago

[Random] Need help deciding a website to use

0 Upvotes

What is the best site to use to build full stack website codes of my own. What website is best to be able to build and test all my code in one place


r/CodingHelp • • 6d ago

[CSS] I can’t figure out what I’ve done wrong

1 Upvotes

So I recently made a website for a buddy’s streaming career. It’s a basic linktree more or less. My issue is that when I run a test I cannot see the links. I tap the area they should be and they work but they don’t appear. What could I have done wrong


r/CodingHelp • • 7d ago

[Random] Need brutal and honest feedback for my website

1 Upvotes

I made a personal website - kalerkaler and I'm looking to find freelance work with it, could you please tell me what needs to changed in order to make the best user experience. I already know it doesn't work on mobile landscape. Edit - fixed the link, its not a flashbang no more


r/CodingHelp • • 10d ago

[How to] Is it possible to connect a blind box style twitch widget to an external website or app

2 Upvotes

I’m streaming on twitch and have recently seen blind box widgets on other peoples streams where chatters can “open blind boxes” to collect key ring charms or trading cards. I was wondering if it were possible to create a twitch widget where the results of the blind box pull could be kept in a library externally on an app or website for individual chatters.

I don’t personally code- but my friends in comp sci are really enthused by the idea as a group passion project where they code and I produce the art and animations. Their skill level is that of 3rd yr comp sci students.

Before I get everyone’s hopes up- is it doable at all??


r/CodingHelp • • 10d ago

[Javascript] Learn Javascript from scratch | Code With Kislay

Thumbnail
1 Upvotes

r/CodingHelp • • 13d ago

[Random] Should I try to learn coding again?

8 Upvotes

Hello everyone. I used to learn Python/C#/Java at superficial level build some little apps that made simple things.

But after a while I start to struggle while doing slightly more difficult things like making a sudoku generator it take me months to built it but after I couldn't made it so I kinda grew cold and drop it.

Should I start again with ai mostly taking over job possibilities felt like less? Any advice?


r/CodingHelp • • 13d ago

[Javascript] I don’t understand the use of immutable variable

3 Upvotes

I’m learning react right now for a web design project and immutable variables are being brought up. I don’t understand why you would want a variable that can’t vary, how do things like a counter work if variables can’t change?


r/CodingHelp • • 14d ago

[Python] How should an LLM represent and edit long-form video? Trying to understand how Cardboard does it

1 Upvotes

i've been experimenting with agentic video editing and trying to understand where the engineering bottlenecks actually are.

i started looking into this after experimenting with cardboard's desktop app, where different ai models can be used for editing. rather than trying to understand the product itself, i wanted to work backwards and think about how i'd architect something similar.

what makes this interesting to me is that video seems fundamentally different from the normal llm workflow that produces text or code.

with code, the model works with a relatively discrete representation. a prompt becomes code, the code goes through a compiler, and you get an output.

with video, the model has to reason over a continuous, multimodal and temporal medium. raw footage has to be understood visually and aurally, relevant parts retrieved, the model has to reason over time and make editing decisions, and those decisions become a timeline that gets rendered.

for example, imagine giving an agent 30 minutes of raw footage and asking:

"make a 30-second product ad. find the strongest hook, remove dead time, use the best product shots, keep the pacing fast, add captions and end with a cta."

before making a single edit, the system needs to determine what's actually happening in the footage, what is being said, where specific actions occur, which shots are useful, which are redundant, and how different moments relate temporally.

i've been looking at this from the implementation side and i'm currently thinking about the following architecture.

  1. video representation

you can't realistically send an entire 30-minute video to an llm every time it needs to make an editing decision.

my initial assumption is that the footage needs to be indexed first using some combination of:

transcripts with timestamps scene and shot boundaries sampled keyframes visual embeddings audio features detected objects and actions shot descriptions semantic metadata

then the reasoning model retrieves the relevant sections.

for example, "find the shot where the person picks up the black headphones and looks at the camera" could work like this: the text query goes through semantic retrieval, which returns candidate timestamps, those candidates get verified visually, and one clip is selected.

i've looked at video embeddings and multimodal models for this, but i'm not sure where the optimal boundary is between preprocessing and model reasoning.

2.timeline representation

once the model finds the relevant footage, it still needs to construct an actual edit.

for example: "use 00:14 to 00:18 as the opening shot, cut to 00:32 to 00:35, then return to 00:19 to 00:22."

that requires maintaining a representation of the current timeline and applying operations against it.

the obvious approach is to expose low-level operations such as insert, trim, split, move, crop, change speed and add text.

but i'm wondering if a higher-level abstraction makes more sense:

find_best_hook remove_dead_air create_intro build_product_sequence add_captions

the second approach seems more suitable for an agent, but it also means the editor has to handle a lot more complexity behind each operation.

evaluation is probably the hardest part

this is where video seems particularly different from coding.

code can usually be tested against objective criteria.

video can be completely valid technically and still be a terrible edit.

a timeline can render successfully, have perfect synchronization and valid captions, but still have poor pacing, a weak hook or a confusing narrative.

so i'm currently thinking that a serious system might need an iterative loop. the agent generates an edit, renders a preview, evaluates it with a multimodal model, identifies the weak sections, modifies the timeline, and renders again.

i've been looking at ffmpeg, remotion, moviepy, opentimelineio, video embeddings, multimodal models and mcp or tool calling as potential building blocks, but i haven't settled on what the cleanest architecture would be.

the pipeline i'm currently considering starts with video indexing, then retrieval, then a reasoning model that issues editing actions onto a timeline, followed by rendering, evaluation and iteration. that is different from a setup where a prompt goes to a video generation model and a video comes out.

i'm interested in whether this mental model is fundamentally wrong.

questions for people who've worked on this"

if you had to represent hours of raw video for an llm, what would you choose: sampled frames with embeddings, structured scene and shot metadata, transcript, or some combination? where would you draw the boundary between preprocessing and model reasoning?

would you expose low-level timeline operations to the model, or build a higher-level video-editing abstraction? how would you prevent the abstraction from becoming too restrictive while still keeping the model from making brittle timeline operations?

how would you design the evaluation loop for subjective quality? what information would you give a model so it can distinguish a technically valid edit from an actually good edit and identify which part of the timeline needs to change?

i've already spent some time researching and prototyping around the components above, so i'm mainly looking for architectural criticism from people who've worked with video processing, nles, multimodal models or agent systems.

tldr: i'm trying to understand how systems like cardboard let llms reason over real footage and turn that into actual edits. the hard part seems to be video representation, retrieval, timeline operations and evaluating whether an edit is actually good. looking for architectural perspectives on how you'd build this from scratch.


r/CodingHelp • • 16d ago

[Python] Why I am unable to save a user with its groups despite both having Ids

2 Upvotes

I am hacking with django and I am attemping to use services for my Business Logic. For creating a User I am developing my own service:

``` from app_auth.models import User from django.contrib.auth.models import Group

from django.db import transaction

class UserService:

@transaction.atomic
def create(self,
           username: str,
           email: str,
           first_name: str,
           last_name: str,
           groups: list[Group],
           bio: str | None = None) -> User:

    user = User.objects.create_user(
        username=username,
        first_name=first_name,
        last_name=last_name,
        email=email,
        bio=bio, #TODO: XSS Sanitize
    )

    print("USER ID: "+str(user.id))

    for group in groups:
        print("GROUP ID: "+str(group.pk))

    user.groups.set(groups)

    user.save()
    return user

```

That uses the following model:

``` from django.db import models from django.contrib.auth.models import AbstractUser

Create your models here.

class User(AbstractUser): bio = models.TextField(blank=True, null=True)

def __str__(self):
    return self.first_name+' '+self.last_name

```

But when I try to save it I get:

"<User: XXXX XXXX>" needs to have a value for field "id" before this many-to-many relationship can be used.

Despite the debug print giving me that both groups and users alike have ids:

USER ID: 4 GROUP ID: 4

I am trying for days and LLMs halucinate on this issue.

The way I trigger this save is via a AdminModel:

``` from django.contrib import admin from django.core.exceptions import ValidationError from django.apps import apps

from app_auth.models import User from app_auth.services.group_service import GroupService from app_auth.services.save.user import UserService from app_auth.forms import UserForm

Register your models here.

@admin.register(User) class AdminUser(admin.ModelAdmin):

form = UserForm
change_form_template = "admin/register_user.html"

list_display = ("username", "email", "first_name", "last_name")

def save_model(self, request, obj: User, form, change):

    # Check whether current user can manage roles
    groups = form.cleaned_data.get("groups")
    if not self.__group_service.user_can_manage_groups(request.user, set(groups)):
        raise ValidationError(
            "You do not have permission to manage these groups."
        )

    groups = self.__group_service.get_groups(groups)

    if change:
        self.__user_service.update(
            user=obj,
            username=form.cleaned_data["username"],
            email=form.cleaned_data["email"],
            first_name=form.cleaned_data["first_name"],
            last_name=form.cleaned_data["last_name"],
            roles=groups
        )

        return

    self.__user_service.create(
        username=form.cleaned_data["username"],
        email=form.cleaned_data["email"],
        first_name=form.cleaned_data["first_name"],
        last_name=form.cleaned_data["last_name"],
        groups=groups
    )

    print("After Save")

```

Using a custom form:

``` from app_auth.models import User from django import forms

class UserForm(forms.ModelForm): def init(self, args, *kwargs): super().init(args, *kwargs)

class Meta:
    model = User
    fields = ["username","email","first_name", "last_name", "groups","bio"]

```


r/CodingHelp • • 16d ago

[SQL] coding for kids help scratch python etc

3 Upvotes

child is 11 and wants to do more with coding and earn a side gig

he currently does scratch , super mario maker on nintendo

we got told he needs to learn python but not sure which websites

also he's interested in designing game apps for iOs

thanks


r/CodingHelp • • 16d ago

[Request Coders] I want a programing buddy so we can help motivate each other

21 Upvotes

I don't care if you have a PhD or you code for fun; I just want to have someone who can code with me or just hang out and talk to keep me focused because I get distracted constantly. I'm no master, but I'm working on my associate's and am pretty out of steam.

I don't care about gender, age, or race, just someone who is chill and respectful. I'm happy to code with you or just watch, and we can chat on Discord or something. I'm also willing to hang out and do something else if you're burnt out or stressed.

I'm 19m btw


r/CodingHelp • • 17d ago

[Python] Need Help Understanding 'For Loop' in Pseudocode For Class Project

2 Upvotes

I'm in an Intro to Computer Science class and am doing our current project which is to make a text based game where you and a computer keep on adding numbers from 1-10 and the winner is decided by who reaches 100 first.

We did this project before already but now we're redoing it by changing all of it to be definitions and then they want us to add a 'for loop' into it as well. The problem is, is that the for loop makes no sense to me, at least from a gameplay stand point. From my understanding, all its doing is adding +1 to the total whenever the computer goes?

I was just hoping if someone could help me decipher this, thanks!

#This is the psuedocode#

Import random

FUNCTION 1: DISPLAY RULES
Declare Function display_rules
Say "Let's play a game of 100!"
Say "In a game of 100 we start with a total of 0"
Say "and we take turns adding from 1-10 to that total."
Say "Whoever reaches 100 first wins."
Say "Ready?"

FUNCTION 2: PLAY GAME
Declare Function play_game
Set play to 1
Call display_rules

While play is 1
Set total to 0
Ask "Who goes first? (1 = you, 2 = computer): "
Read turn

While total is less than 100

If turn is 1 (player's turn)
Ask "Number you want to add (1-10): "
Read playerNum

If playerNum is between 1 and 10
AND total + playerNum is less than or equal to 100
Add playerNum to total
Say "You added [playerNum], total is now [total]"
Set turn to 2
Else
Say "Enter a number from 1-10 without exceeding 100."

Else If turn is 2 (computer's turn)
If total is less than 90
Set computerNum to a random number from 1 to 10
Else
Set computerNum to 100 - total

FOR LOOP
For num from 0 to computerNum - 1
Add 1 to total
End For

Say "I added [computerNum], total is now [total]"
Set turn to 1

Else
Say "Choose 1 or 2."
Ask "Who goes first? "
Read turn

End While

CHECK WHO WINS
If turn is 2
Say "You win!"
Else
Say "Bummer, You lose!"

ASK TO PLAY AGAIN
Ask "Play again? (1 = yes, 2 = no): "
Read play

End While

FUNCTION 3: MAIN MENU
Declare Function menu
While True
Show the menu
Say "Menu:"
Say "1. Display Rules"
Say "2. Play Game"
Say "3. Exit"

Ask "Enter your choice (1, 2, or 3): "
Read choice

If choice is 1
Call display_rules
Else If choice is 2
Call play_game
Else If choice is 3
Say "Thanks for playing! Goodbye!"
Break the loop
Else
Say "Invalid choice. Please enter 1, 2, or 3."

End While

START PROGRAM
Call menu


r/CodingHelp • • 17d ago

Which one? Web/app developer or Roblox game development which is better for side hustle

0 Upvotes

I'm starting from zero and want to build a long-term income from development. I have limited money.

I'm choosing between two paths:

App development: Mac or web apps. Higher profit per sale, but I'd need to learn Swift or web development and find a niche problem to solve.

Game development: Roblox or indie games. Easier to launch, but I've read that most games earn very little and platforms take a big cut.

I plan to use AI to speed up the learning and the building.

My question: If you were starting from zero today, would you pick app development or game development to make money, and why? If you've done either, how long did it take to earn your first dollar?


r/CodingHelp • • 17d ago

[Other Code] Class instance while running the code

1 Upvotes

I started actually writing code with OOP yesterday (using Dart... In case it is necessary to mention) and there's a thing that kept bothering me as I scrolled through their page and watched the tutorial. Everytime they gave a class example, they created an instance themselves and never based on the code running.

Imagine a system to simulate a store's stock. There'll be items going in and out, that shouldn't be inserted by the programmer, so there must be a way to do that "dynamically".

I'm aware that this might be me simply missing something from OOP classes, but I want to see what other coders have to say about that.

Any help would be welcome. Thank You


r/CodingHelp • • 18d ago

[Other Code] This Sucks… Alot. Please Help.

0 Upvotes

Hello everyone. Gather round', gather round' and listen to my tale. So I'm trying to code an incremental game for laptop, computer, and mobile, but's it's been s really huge pain in my sore little keister. Everything confuses me, and I only know a little bit of coding. I'm currently using a simple coding website kind of similar to Scratch (I forgot the name, I'll check later.) on my laptop. On top of that, I keep getting demotivated really quickly and tired, telling myself I'll work on it tomorrow but never do. Please help!… Thank you!!


r/CodingHelp • • 20d ago

Audio Detection Mic Detection Feature Help for a Piano app

Thumbnail
2 Upvotes

r/CodingHelp • • 23d ago

[How to] Is it possible to save a steam game on a disk?

2 Upvotes

Let me preface this with a "I understand if this is a misuse of this community and will not be mad if mods delete this post" but I honestly don't know where else to ask this (Would be very happy with a suggestion tho) and a "I do not plan to do what I've described because I don't even know the first things about programming"

So basically my idea is, what if you download a game from Steam, copy only the game files onto some external memory (such as a disk/flashdrive) and then try to download the game and play it on another pc.

Would that even work coding wise? Or do Steam games have some sort of dependency on it? I'd assume they do to prevent this exact thing from happening (since what's preventing somebody from doing this over and over and selling physical copies of the games or something) and because whenever I open a game from it, it automatically opens.

I guess I'm generally curious about if such a dependency exists and if there is a way to sever it and do what I described anyway. Again not planning to do this, just curious about what connective tissue exists between Steam and the games from it.

And once again, will not be mad if this post gets nuked by mods. Go ahead and smite me if ya have to 👍


r/CodingHelp • • 27d ago

[How to] struggling with api calls in automating appointment booking

5 Upvotes

Hello all

I've been out of the game some 5 years now and my knowledge is rusty, so be kind

I'm having a lot of difficulty booking a certain appointment. Slots for this appointment are released daily at 5pm and are booked out within seconds, so I'm trying to write a script to automate this process.

The site is laid out as such:

  1. login page: enter your login details and hit enter
  2. landing page after login: first page, lists a series of options of what operations are possible ("make a booking", "check existing booking", "log out", etc)
  3. services page: after clicking "make a booking", a table is laid out with the types of appointments available to book, with a 'BOOK' button alongside

At this point is the bottleneck. The user has to wait until PRECISELY 5pm to click this button, which of course every other person is similarly waiting to do. The site often goes down and requests time out. I have succeeded in passing this point twice, using a combination of using ctrl+click rapid-fire to open lots of new tabs, and using up to 5 devices to hit this button in sync.

  • Upon failure, a popup window opens saying 'all slots booked'.
  • Upon success, the user is rerouted to a new page and asked to enter more details and documents. The user is not forewarned to have these documents on hand, and some internal timer seems to be running which is not exposed to the user which times out the session. The two times I have gotten through to this page I have not been prepared with documents and/or arbitrarily timed out

my plan has one of two approaches. I could either:

  • write a script that automates the specific API calls in sequence to secure a booking, running through Postman with either JS or C#
    • pros
      • Wouldnt have to deal with a web driver
      • cleaner shorter code
      • can run on a cron job easier
      • less moving parts to go wrong
      • I have slightly more experience with JS and C# than I do with python
      • maybe can sidestep doing any captchas?
    • cons
      • Using info I'm pulling from devtools in my browser, I cannot recreate even the first API call to return the doc for the login page, im simply getting 400 and 403 errors
      • I dont know enough about the process of building programs that make these type of calls to a web server's front end
      • i'd have to reinstall all the .NET bullshit
  • write a script that uses python's selenium package to create an instance of a web browser to click through the right steps for me, utilising the driver's powerful built in methods to handle things like cookies and the api calls themselves
    • pros
      • python is easier to get to grips with at a surface level, and I shouldnt need to go too complex for this
      • easy to test
      • can utilise selenium's webdriver package to simulate an actual user making these clicks and inputs
      • easier to map the steps of moving from one webpage to another by opening devtools and finding the right DOM element, and then feeding the values into my script. I can then use stuff like find_element(...).click() to navigate through the page
    • cons
      • I need to know the shape of the DOM to isolate the right elements to click through, and I dont know what the DOM looks like if I succeed in getting past the BOOK button
      • selenium drivers will doubtless trigger captchas which they cannot surpass. I've triggered captchas on this site after logging in more than 2 times in 10 minutes

I know that it is possible to automate this, as there are companies offering their automation services for high fees to obtain a booking of the soonest possible appointment at time of booking

im tearing my hair out here and I'm looking essentially for help understanding the API calls I need to make, or how to obtain the DOM of a page I've never made it to


r/CodingHelp • • 29d ago

[C#] Struggling to transition from understanding code to building it

11 Upvotes

Hey everyone,

I’m currently studying Computer Science and hitting a bit of a wall that I’m hoping to get some advice on.

My main issue right now is that when I look at C# code or follow along in lectures, I can understand what the code is doing. But when I sit down at a blank editor and try to build something from scratch,especially with Object-Oriented Programming (OOP) concepts,I just freeze up and don't know how to translate my thoughts into actual code.

On top of that, I have ADHD, so keeping focus and structuring my practice when I'm stuck can be pretty challenging. I really want to take this seriously and build a genuinely strong foundation in software development, but I'm not entirely sure how to train my brain to bridge that gap between reading code and actually constructing it.

If anyone has dealt with the blank editor hurdle, struggled with OOP logic, or found focus strategies for coding with ADHD, I would really appreciate any advice, study habits, or learning methods that worked for you.

Thanks for taking the time to read.


r/CodingHelp • • Sep 22 '26

[Python] Help me improve this small GitHub automation project

3 Upvotes

I created a small Python script that automatically makes a commit every 4 hours on GitHub, mainly as an experiment with Python automation and GitHub Actions.

🔗 Project: https://github.com/almuapull/auto-incrementation.git

I’d like to take this little project further and make it more useful rather than keeping it as a simple automation script.

I’m looking for developers who could help me improve it, suggest new features, optimize the workflow, or simply share ideas and feedback.

If you’re interested, feel free to check out the repository, open an issue, or submit a pull request.

Any contribution or idea is welcome! 👨🏽‍💻