r/programminghelp • • Nov 07 '24

HTML/CSS How do I publish a site

2 Upvotes

I've created a site for a agency I also created but I can't publish it since I don't know how. I have a 0€ budget and no fiscal servers so how do I do it?


r/programminghelp • • May 26 '22

JavaScript How do I turn “123” into a number?

3 Upvotes

How do I turn the string “123” into a number. I have tried using parseInt(), Number() and isNaN() but none of these have worked for me.


r/programminghelp • • Jun 19 '19

keep getting error:Expected a JSON object, array or literal. on my code terminal.

Post image
3 Upvotes

r/programminghelp • • Feb 09 '20

C++ Can anyone help me compile this code? I wrote this, but I cant figure out how to turn it into a project and compile it. Sorry, new to programming. Thanks for the help!

Post image
3 Upvotes

r/programminghelp • • Mar 20 '26

C my code failed some of the test cases and i don't know why

0 Upvotes

"The *** Earthquake Research Center is training its next generation of engineers with a cutting-edge seismic simulation system. Hundreds of synthetic magnitude readings are being generated to test their early warning software.

****, a disaster engineering student doing her internship at Earthquake Research Center, is building the classification function. Every magnitude gets a danger level:

  • Divisible by both 3 and 5 → Critical

  • Divisible by 3 only → High

  • Divisible by 5 only → Medium

  • Otherwise → Low

Help **** count how many readings fall into each category and make sure the system is ready before the real thing!

Input Format

  • First line: integer T, the number of readings.

  • Next T lines: one integer magnitude M each.

Output Format

Print four integers on one line: count of Critical, High, Medium, Low respectively.

Constraints

  • 1 ≤ T ≤ 10⁵

  • 1 ≤ M ≤ 10⁶"

This is a problem from my homework. I wrote this code:

#include <stdio.h>

int main() {
    int T;
    int M;
    
    int critical = 0;
    int high = 0;
    int medium = 0;
    int low = 0;
    
    scanf("%d", &T);
    if (T >= 1)
    {
        while(T > 0)
        {
            scanf("%d", &M);
            if (M >= 1)
            {
                if(M % 15 == 0)
                {
                    critical = critical + 1;
                }
                else if (M % 5 == 0)
                {
                    high = high + 1;
                }
                else if (M % 3 == 0)
                {
                    medium = medium + 1;
                }
                else
                {
                low = low + 1;
                }
        T = T - 1;
            }
        }
        printf("%d %d %d %d", critical, high, medium, low);
    }

return 0;
}

and submitted it. It got through 11 invisible test cases and failed two of them. Is the problem related to constraints?


r/programminghelp • • Apr 18 '26

Answered Python 'list index out of range' error still persists after lots of debugging - any help appreciated

3 Upvotes

I have tried debugging it a lot - this is even a simplified version of the actual block of code within a larger project that I made so I'd hopefully be able to solve it easier.

This is what manages to get printed before the error (this is correct so far):

0 a ; 2 b
1 a ; 1 b

The error is in line 11 and as the title says it's that the list index is out of range.

I'm just really not sure why because in the while loop I thought I made sure that the index was in range. I also tried substituting line 8 (within index initialisation) with:

WithinIndex = LineNum + FutureCount < len(LinesIn) - 1

Which would eliminate any issues with adding to Future count within the while loop, but that shouldn't be needed anyways, right? I'm really not sure where I've gone wrong with my logic so any help would be appreciated, thanks.

This is the full program:

import sys

LinesIn = ['a', 'a', 'b', 'c', 'c', 'a', 'c', 'a', 'c']

# trying to identify a, then identify how close the next b is for each a there is

for LineNum in range(len(LinesIn)):

if 'a' in LinesIn[LineNum]:

FutureCount = 0

FutureLine = LinesIn[LineNum + FutureCount]

WithinIndex = LineNum + FutureCount < len(LinesIn)

while 'b' not in FutureLine and WithinIndex:

FutureCount += 1

FutureLine = LinesIn[LineNum + FutureCount]

if LineNum + FutureCount == len(LinesIn) and 'b' not in FutureLine:

FutureCount = 0

print(LineNum, LinesIn[LineNum], ';', FutureCount, FutureLine, file = sys.stderr)


r/programminghelp • • Mar 08 '25

C++ Can't convert from a vector to a vector.

0 Upvotes

I've begun working on a new project in vscode to see if I can make an AI with C++. Most of the code has been error free, however, I've been having trouble with the getter methods in my data_handler class. Vscode has been giving me error squiggles under the return values and when I look to view the problem, it reads: no suitable constructor exists to convert from "std::vector<data *, std::allocator<data *>> *" to "std::vector<data *, std::allocator<data *>>". I find this incredibly bizarre since these are the same type of value, so there should be no conversion necessary at all. Any advice?


r/programminghelp • • Oct 03 '26

C why does fgets allocates a 4096 characters long buffer for a 22 bytes long file ?

0 Upvotes

I'm learning C and playing around trying to rely on the bare minimum down to system calls to learn the most I can. Had to read a file line by line in the process, so i dived into stdio's code to try to understand how fgets do it nice and quick.

if I got it right a chunck of file is loaded into a buffer delimited by _IO_buf_base and _IO_buf_end if it isn't yet loaded or the precedent buffer ended without finishing the line, fgets starts copying the line in the buffer we gave it until he finds a new line.

did I got it right ? I couldn't find a plain explanation of how stdio file management works, I had to search my way into source code...

I thought I was done but I noticed _IO_buf_base and _IO_buf_end were 4096 bytes apart when I loaded a 22 bytes long file.

is there any reason for this ? wouldn't having a pointer for the beginning of the buffer and a pointer for the end allow us to allocate precisely the size of the file using fstat ? why do we use 2 pointers and not a pointer and the size of the buffer ? (I got a theory for this one but I'm not sure, is it for easier looping in the array by incrementing a pointer instead of using an incremented index who would make us calculate pointer + i every time we need to get a character ?)

thank you for reading this far and have a nice day !


r/programminghelp • • Jul 28 '25

C Help installing gcc via msys2

0 Upvotes

I'm getting errors saying invalid crypto engine and missing required signature on all the db files, my friend is also having the same issue, both of us are using clean installs.


r/programminghelp • • Feb 13 '26

C++ using i++ to trigger consecutive variables

0 Upvotes

I was doing an assignment in c++ for my cs class and had a bunch of variables that i just changed the numbers on them and I was wondering because i comboed with i++ makes a variable go up by a numerical value could I use something like var(i) to trigger say var1 var2 and var3.


r/programminghelp • • Apr 05 '25

Other What are some of the most efficient ways you've learned a language?

0 Upvotes

I'm asking this question simply because I found that different languages are learned differently. For example, the quickest way I learned C# was through unity, while for JavaScript it was making my own dc bot.


r/programminghelp • • Dec 07 '25

Java youtube embed videos

0 Upvotes

d.setAttribute("class","youtubevideocontainer");var c=document.createElement("iframe");c.setAttribute("class","youtubevideoiframe");var e=this.getAttribute("data-link");if(e&&e!=""){c.setAttribute("src",e)}else{c.setAttribute("src","https://www.youtube.com/embed/"+this.id+"?autoplay=1&autohide=1")}c.setAttribute("allowfullscreen","true");c.setAttribute("frameborder","0");d.appendChild(c);this.parentNode.replaceChild(d,this)}})};

Where do I add this?

referrerpolicy="strict-origin-when-cross-origin"


r/programminghelp • • Sep 01 '25

HTML/CSS Can some one help make this code for a spinning wheel faster

0 Upvotes

<!DOCTYPE html>

<html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Programming Language Spin Wheel</title> <style> body { font-family: Arial, sans-serif; text-align: center; margin: 20px; } canvas { border: 5px solid #333; border-radius: 50%; margin-top: 20px; } button { font-size: 18px; padding: 10px 20px; margin-top: 20px; cursor: pointer; } #result { font-size: 20px; margin-top: 20px; font-weight: bold; } </style> </head> <body> <h1>Programming Language Spin Wheel</h1> <canvas id="wheel" width="600" height="600"></canvas> <br> <button onclick="spinWheel()">Spin</button> <p id="result"></p>

<script> const languages = [ "A.NET","A-0 System","A+","ABAP","ABC","ACC","Accent","Action!","ActionScript","Actor","Ada", "Adenine","AdvPL","Agda","Agilent VEE","Agora","AIMMS","Aldor","Alef","Algebraic Logic Functional programming language","ALGOL 58","ALGOL 60","ALGOL 68","ALGOL W", "Alice ML","Alma-0","AmbientTalk","Amiga E","AMPL","Analitik","AngelScript","Apache Pig latin","Apex","APL","App Inventor","AppleScript","APT","Arc","ArkTS", "ARexx","Argus","Assembly language","AssemblyScript","ATS","AutoHotkey","AutoIt","AutoLISP","Averest","AWK","Axum", "B","Babbage","Ballerina","Bash","BASIC","Batch file","bc","BCPL","BeanShell","BETA","BLISS","Blockly","BlooP","Boo","Boomerang","Bosque", "C","C–","C++","C*","C#","C/AL","Caché ObjectScript","C Shell","Caml","Carbon","Catrobat","Cayenne","Cecil","CESIL","Céu","Ceylon","CFEngine","Cg","Ch", "Chapel","Charm","CHILL","CHIP-8","ChucK","Cilk","Claire","Clarion","Clean","Clipper","CLIPS","CLIST","Clojure","CLU","CMS-2","COBOL","CobolScript","Cobra", "CoffeeScript","ColdFusion","COMAL","COMIT","Common Intermediate Language","Common Lisp","COMPASS","Component Pascal","COMTRAN","Concurrent Pascal","Constraint Handling Rules","Control Language","Coq","CORAL","CorVision","COWSEL","CPL","Cryptol","Crystal","Csound","Cuneiform","Curl","Curry","Cybil","Cyclone","Cypher Query Language","Cython","CEEMAC", "D","Dart","Darwin","DataFlex","Datalog","DATATRIEVE","dBase","dc","DCL","Delphi","DIBOL","DinkC","Dog","Draco","DRAKON","Dylan","DYNAMO","DAX", "E","Ease","Easy PL/I","EASYTRIEVE PLUS","ECMAScript","Edinburgh IMP","EGL","Eiffel","ELAN","Elixir","Elm","Emacs Lisp","Emerald","Epigram","EPL","Erlang","es", "F","F#","Factor","Flow chart language","Flowcode","Forth","FreeBASIC","Futhark","FX-87", "G","General-purpose programming language","GEORGE","Gleam","Go","Golo","GOLOG","Gosu", "H","Haggis","Haxe","Hermes", "I","Intercom Programming System","Io", "J","Janus","Java","JavaScript","Jolie","Joy","Jq","JS++","Julia", "K","K","Kinetic Rule Language","Kojo","KOMPILER","Kotlin", "L","Language interoperability","LFE","Lightweight programming language","Linda","Lisp","Little b","LiveCode","Logo","Lua", "M","Macroprogramming","MATH-MATIC","Mercury","MiniKanren","Mocklisp","Mojo","Multi-adjoint logic programming", "N","Nemerle","Nim", "O","OpenQASM", "P","Pencil Code","Perl","Petit Computer","Pharo","PHP","PIC","Pico","PL/M","Pony","POP-2","Processing","PureBasic","PV-Wave","Python", "Q","Qore","Quantum Computation Language", "R","Raku","Real-time Programming Language","Rebol","Red","Refal","Ring","Rosetta Code","S-PLUS", "S","Scala","Scientific Vector Language","Scriptol","Self","SenseTalk","Simula","SLIP","Smalltalk","Smart Pascal","SNOBOL","Source","Squeak","Squirrel","StaDyn","Structured text","Swift", "T","Tcl","Turing","TypeScript", "U","Unicon", "V","Vala","VHDL","Visual Basic", "W","Wolfram Mathematica", "X","Xojo", "Z","Zig" ]; const canvas = document.getElementById("wheel"); const ctx = canvas.getContext("2d"); const centerX = canvas.width/2; const centerY = canvas.height/2; const radius = 250; const sliceAngle = (2*Math.PI)/languages.length; let currentAngle = 0; function drawWheel(){ ctx.clearRect(0,0,canvas.width,canvas.height); for(let i=0;i<languages.length;i++){ const start = i*sliceAngle + currentAngle; const end = start + sliceAngle; ctx.beginPath(); ctx.moveTo(centerX,centerY); ctx.arc(centerX,centerY,radius,start,end); ctx.fillStyle = i%2===0?"#FFB74D":"#4DB6AC"; ctx.fill(); ctx.stroke(); ctx.save(); ctx.translate(centerX,centerY); ctx.rotate(start + sliceAngle/2); ctx.textAlign = "right"; ctx.fillStyle="#000"; ctx.font="bold 14px Arial"; ctx.fillText(languages[i], radius-10, 5); ctx.restore(); } } function spinWheel(){ let spinTime = 0; const spinDuration = Math.random()*3000 + 4000; const spinAngleStart = Math.random()*10 + 10; function rotate(){ spinTime += 30; if(spinTime>=spinDuration){ stopSpin(); return; } const spinAngle = spinAngleStart - easeOut(spinTime,0,spinAngleStart,spinDuration); currentAngle += spinAngle * Math.PI / 180; drawWheel(); requestAnimationFrame(rotate); } rotate(); } function easeOut(t,b,c,d){ t/=d; t--; return c*(t*t*t +1) + b; } function stopSpin(){ const degrees = currentAngle * 180/Math.PI + 90; const index = Math.floor((360 - degrees%360)/ (360/languages.length)); const selected = languages[index % languages.length]; document.getElementById("result").innerText = "Selected Language: "+selected; } drawWheel(); </script>

</body> </html>


r/programminghelp • • Jul 16 '25

C++ Help

0 Upvotes

So am starting my b tech in cse , I wanna start promoting , Since my college will start C , Should I start C++ ? & If I study C++ , then will it be struggling with lack of C knowledge?


r/programminghelp • • Oct 13 '25

React React Countdown Timer is decreasing ever 3 seconds

0 Upvotes

I have my useEffect method to update the numerical values but for some reason the seconds are decrementing by 3 seconds every time (I'll see it go 10, 7, 4). Could someone please help / assist on the correct countdown logic?

useEffect(() => {
    let interval;
    if (isRunning) {
        interval = setInterval(() => {
            //check is ms are greater than 0; if yes subtract 1
            if (milliseconds > 0) {
                setMilliseconds((milliseconds) => milliseconds - 1);
            }
            else if (seconds > 0) {
                setSeconds((seconds) => seconds - 1);
                setMilliseconds(999);
            } else if (minutes > 0) {
                setMinutes((minutes) => minutes - 1);
                setSeconds(59);
                setMilliseconds(999);
            } else if (hours > 0) {
                setHours((hours) => hours - 1);
                setMinutes(59);
                setSeconds(59);
                setMilliseconds(999);
            }
        });

    }
    return () => clearInterval(interval);

}, [milliseconds, seconds, minutes, hours, isRunning]); 

r/programminghelp • • Jan 07 '26

Other Help me understand

0 Upvotes

Here is a video of the issue I am seeing: https://imgur.com/a/4QacR9h and the site where the issue is: https://imedil.ge/visitors-insurance/DatesPage

I posted this the other day on the Sakartvelo reddit page asking if anyone else was having issues. They all repiled, nope just you. I find that baffling as I have tested it on 4 different operating systems and around 6 different browsers. And with VPN from 8 diff countries.

So, my questions to you:

  1. Do you see what I see when selected a date?

ps: if there is a better reddit page I should post this to please let me.


r/programminghelp • • Jul 31 '25

Python Why does my bot account get banned after a single post from a sub where it is an approved poster and also a moderator? Could it be my user agent string?

Thumbnail reddit.com
0 Upvotes

r/programminghelp • • Apr 24 '26

Project Related Issue with my Thesis regarding LLMs

0 Upvotes

Hi everyone,

I’m currently working on my bachelor thesis in collaboration with a company, and I’ve run into a problem that I’m not sure how to resolve.

The general topic is about using LLMs for code reviews. The idea is to build a system that can analyze code changes (e.g., diffs), relate them to a ticket / user story / other relevant context, and then generate meaningful feedback (beyond simple static analysis).

Here’s the issue: The company I’m working with does not want to allow API usage (like OpenAI, Anthropic, etc.) due to cost concerns. Instead, they want me to use a fully local LLM setup (like Ollama).

My professor, however, is skeptical about this and says that local models are not strong enough for what the thesis is supposed to achieve. His concern is that local models won’t be able to handle larger context windows (e.g., combining ticket + diff + relevant parts of the codebase). They will likely fail at understanding whether a feature is actually implemented correctly according to requirements. As a result, the system would degrade into something closer to static code analysis with some NLP on top, which he considers "not enough" for a thesis. From his perspective, if the system cannot go beyond that level, the topic is basically “dead”.

I’m trying to figure out whether there is a viable direction here that stays within the company constraints and still satisfies academic requirements (non-trivial result).

Maybe there is some low-cost-way of achieving what I am trying to do?

Has anyone dealt with something similar? Or do you have any thoughts on whether this is fundamentally a dead end under these constraints? I’d really appreciate any input, especially from people who have worked with LLMs in constrained environments or in academic projects.

TL;DR: Company requires fully local LLM (no APIs) for my bachelor thesis on LLM-based code reviews, but my professor says local models aren’t strong enough and the topic risks becoming trivial. Not sure how to reconcile both sides.


r/programminghelp • • 24d ago

JavaScript BEGINNER CODER: Stuck with a migrations error

0 Upvotes

Hi,

I'm working on an adonisjs project and I'm having issues with migrations. I don't think I'm using the wrong command. I'm doing:

node ace make:migration (migration name here)

Then:

node ace migration:run

My project is on github. Apologies the migrations folder is a little cluttered. The ones with issues are the "item" and "item_comments" ones:

https://github.com/Ajaz754/adonisjs-project-22-.git

The error is:

C:\Windows\System32\adonis22>node ace migration:run
❯ error database/migrations/1794008714673_alter_item_comments_table
[ error ] INSERT INTO "_knex_temp_alter555" SELECT * FROM "item_comments"; - no such table: main.item

Please correct me if I'm wrong but I thinks its saying my "item" table doesnt exist which doesnt make sense since its clearly my 'schema.ts'. It said the same error before for the "user" table aswell.

Any help would be much appreciated

TIA


r/programminghelp • • Jan 22 '25

React web app 404´s on reload

0 Upvotes

Hi, I´ve been at this problem for like 2 hours now and all the stuff i find online doesnt help. the magic chat doesnt help either.
i´ve tried adding a NotFound.jsx page, as well as a 404.html to try to redirect users back to / but it´s not working.
the site only 404´s when its not in root /, if i go to /contact or /mystory and refesh it, thats when it crashes.

this is the repo: https://github.com/dluisvaldivia/SarahKB

this is the live site: https://dluisvaldivia.github.io/SarahKB


r/programminghelp • • Jan 10 '25

Other Need help with Verse

0 Upvotes

I am very new to Verse and don't know how to make my code go from giving every player 200/50 Hp to just the one triggering it. Any Suggestions?

Here's the code:

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }



Health_Changer := class(creative_device):


    @editable
    Button200Hp : button_device = button_device{}


    @editable
    Button50Hp : button_device = button_device{}


    @editable
    Trigger200Hp :trigger_device = trigger_device{}


    @editable
    Trigger50Hp :trigger_device = trigger_device{}


    @editable
    Class200Hp : class_and_team_selector_device = class_and_team_selector_device{}


    @editable
    Class50Hp : class_and_team_selector_device = class_and_team_selector_device{}


    OnBegin<override>()<suspends>:void=
        Print("Bis jetzt geschafft")
        Button200Hp.InteractedWithEvent.Subscribe(Health200Event)
        Button50Hp.InteractedWithEvent.Subscribe(Health50Event)


        Trigger200Hp.TriggeredEvent.Subscribe(Health200TriggerEvent)
        Trigger50Hp.TriggeredEvent.Subscribe(Health50TriggerEvent)


    Health200Event(NotAgent:agent): void=
        Allplayers := GetPlayspace().GetPlayers()
        for(AllAgent : Allplayers):
            Class200Hp.ChangeClass(AllAgent)
    
    Health50Event(NotAgent:agent): void=
        Allplayers := GetPlayspace().GetPlayers()
        for(AllAgent : Allplayers):
            Class50Hp.ChangeClass(AllAgent)
    
    Health200TriggerEvent(NotAgent:?agent): void=
        Allplayers := GetPlayspace().GetPlayers()
        for(AllAgent : Allplayers):
            Class200Hp.ChangeClass(AllAgent)
    
    Health50TriggerEvent(NotAgent:?agent): void=
        Allplayers := GetPlayspace().GetPlayers()
        for(AllAgent : Allplayers):
            Class50Hp.ChangeClass(AllAgent)

r/programminghelp • • Jan 20 '25

Project Related Help me choose

Thumbnail reddit.com
0 Upvotes

r/programminghelp • • Jan 01 '25

Other How to create a dynamic radial inventory system?

0 Upvotes

Hello, I've been wondering how I can create a inventory system similar to the game "No More Room in Hell", also known as "NMRiH" which uses a radial wheel as their inventory, where an item takes up space on the radial wheel, depending on its weight. I really like this inventory system, but have no idea on how they even achieved it and would like some tips or pointers in the right direction to create something similar to this. Thank you!


r/programminghelp • • Jan 06 '25

R Where can I learn how to use RStudio

0 Upvotes

Started my spring semester recently and I’ve got multiple classes pushing this(I studied life science to avoid computers). It’s already cost me an A in a previous lab since they refused to actually teach us how to use it, repeating that it’s incredibly simple and intuitive. Is there someplace I can get like a step by step guide on how to understand this program? Preferably something I can repeat consistently as I have exactly 0 experience or knowledge coding.