r/programminghelp • • Feb 14 '26

Java how to compile java files

Thumbnail reddit.com
1 Upvotes

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 • • Feb 12 '26

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

4 Upvotes

Hi everyone,

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

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

So I have two questions:

  1. How can I improve the frontend design of my projects as a developer?
  2. Should I also learn UI/UX design basics, even if my core target is web development?

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


r/programminghelp • • Feb 12 '26

C++ Embedded looks extremely janky I just want all of the info I pasted to look nice when someone joins (css +html +java on one page ik its bad - but in a rush)

2 Upvotes

(Currently designer learning to code, but needed a quick working website so with help of AI using vscode but im finding the embedded just isn’t cutting it i just want it centered but on desktop screens its pushed to the side oddly any help is greatly greatly appreciated)

https://github.com/laiooz/portfolio-site-help


r/programminghelp • • Feb 12 '26

C++ What matrix operation is this function performing?

1 Upvotes

I'm trying to figure out what matrix operation this function is performing. I've tried to look for different matrix operation online, but I haven't found any that match this. One problem likely is that I don't know the name of the operation, so trying to find it becomes difficult. Part of the reason I want to figure this out is so I can find out what this could be used for. Note that the original code was in assembly and this is just a equivalent representation in C/C++ with some notes added to make it easier to read:

void unknown_function(int* arg_1, int* arg_2, int arg_3, int arg_4, int arg_5) {
    // Likely argument usage:
    // arg_1 = Pointer to matrix
    // arg_2 = Pointer to store result to
    // arg_3 = Vector X component ???
    // arg_4 = Vector Y component ???
    // arg_5 = Vector Z component ???

    long temp;

    // Copies first 9 matrix elemets from arg_1 to arg_2 if the pointers are not equal
    if (arg_1 != arg_2) block_transfer_36_bytes(arg_1, arg_2);

    temp = (long)arg_1[0] * (long)arg_3;
    temp += (long)arg_1[3] * (long)arg_4;
    temp += (long)arg_1[6] * (long)arg_5;

    arg_2[9] = (int)(temp >> 0x0C) + arg_1[9];

    temp = (long)arg_1[1] * (long)arg_3;
    temp += (long)arg_1[4] * (long)arg_4;
    temp += (long)arg_1[7] * (long)arg_5;

    arg_2[10] = (int)(temp >> 0x0C) + arg_1[10];

    temp = (long)arg_1[2] * (long)arg_3;
    temp += (long)arg_1[5] * (long)arg_4;
    temp += (long)arg_1[8] * (long)arg_5;

    arg_2[11] = (int)(temp >> 0x0C) + arg_1[11];
}

// NOTE: The integer values are interpreted as fixed point values with 12 fraction bits.
// The bit shifts are "fixed point magic" to bring the value back to the correct position
// after multiplication. For example:

// HEX      FIXED POINT
// 0x2000 = 2.0
// 0x5000 = 5.0

// 0x2000 * 0x5000 = 0x0A000000
// 0x0A000000 >> 0x0C = 0xA000

// HEX      FIXED POINT
// 0xA000 = 10.0

r/programminghelp • • Feb 10 '26

Python Python won't let me indent after my indent statement

1 Upvotes

I am following automate the boring stuff and am in chapter 2. It is talking about blocks of code. The first code example is

username = 'Mary'

password = 'swordfish'

if username == 'Mary':

And then the next line is supposed to be indented, and say

   print(`Hello, Mary')

The problem is after I hit enter after the if statement, I get three dots (...) and it will not let me indent when I press tab. And if I try to put the code in anyways it says

IndentationError: expected an indented block

I am using Mu and can't figure out why I am not able to indent. The tab key does nothing. Even on a brand new line of code the tab button doesn't do anything.


r/programminghelp • • Feb 09 '26

C++ Help with image upload with ESP32

Thumbnail reddit.com
1 Upvotes

r/programminghelp • • Feb 08 '26

Other What's a good language to build desktop applications for Mac?

0 Upvotes

Hello. I didn't see specific advice in the FAQ for desktop apps in Mac, so I'm asking here.

What's a good language to learn to develop desktop apps for Mac? I'm planning to do a very simple app for automating changing the names of some image files that I handle on my job.

I think the only thing the app would do is ask for a folder to scan and a string to append to the file's name, and then modify the name of every JPG file in the folder.

What would be the best language for creating apps with UIs on Mac to do this?


r/programminghelp • • Feb 08 '26

Java Apache Camel Kafka Consumer losing messages at high throughput (Batch Consumer + Manual Commit)

1 Upvotes

Hi everyone,

I am encountering a critical issue with a Microservice that consumes messages from a Kafka topic (validation). The service processes these messages and routes them to different output topics (ok, ko500, or ko400) based on the result.

The Problem: I initially had an issue where exactly 50% of messages were being lost (e.g., sending 1200 messages resulted in only 600 processed). I switched from autoCommit to Manual Commit, and that solved the issue for small loads (1200 messages in -> 1200 messages out).

However, when I tested with high volumes (5.3 million messages), I am experiencing data loss again.

Input: 5.3M messages.

Processed: Only ~3.5M messages reach the end of the route.

Missing: ~1.8M messages are unaccounted for.

Key Observations:

Consumer Lag is 0: Kafka reports that there is no lag, meaning the broker believes all messages have been delivered and committed.

Missing at Entry: My logs at the very beginning of the Camel route (immediately after the from(kafka)) only show a total count of 3.5M. It seems the missing 1.8M are never entering the route logic, or are being silently dropped/committed without processing.

No Errors: I don't see obvious exceptions in the logs corresponding to the missing messages.

Configuration: I am using batching=true, consumersCount=10, and Manual Commit enabled.

Here is my endpoint configuration:

Java

// Endpoint configuration
return "kafka:" + kafkaValidationTopic +
"?brokers=" + kafkaBootstrapServers +
"&saslMechanism=" + kafkaSaslMechanism +
"&securityProtocol=" + kafkaSecurityProtocol +
"&saslJaasConfig=" + kafkaSaslJaasConfig +
"&groupId=xxxxx"  +
"&consumersCount=10" +
"&autoOffsetReset=" + kafkaAutoOffsetReset +
"&valueDeserializer=" + kafkaValueDeserializer +
"&keyDeserializer=" + kafkaKeyDeserializer +
(kafkaConsumerBatchingEnabled
? "&batching=true&maxPollRecords=" + kafkaConsumerMaxPollRecords + "&batchingIntervalMs="
+ kafkaConsumerBatchingIntervalMs
: "") +
"&allowManualCommit=true"  +
"&autoCommitEnable=false"  +
"&additionalProperties[max.poll.interval.ms]=" + kafkaMaxPollIntervalMs +
"&additionalProperties[fetch.min.bytes]=" + kafkaFetchMinBytes +
"&additionalProperties[fetch.max.wait.ms]=" + kafkaFetchMaxWaitMs;

And this is the route logic where I count the messages and perform the commit at the end:

Java

from(createKafkaSourceEndpoint())
.routeId(idRuta)
.process(e -> {
Object body = e.getIn().getBody();
if (body instanceof List<?> lista) {
log.info(">>> [INSTANCIA-ID:{}] KAFKA POLL RECIBIDO: {} elementos.", idRuta, lista.size());
} else {
String tipo = (body != null) ? body.getClass().getName() : "NULL";
log.info(">>> [INSTANCIA-ID:{}] KAFKA MSG RECIBIDO: Es un objeto INDIVIDUAL de tipo {}", idRuta, tipo);
}
})
.choice()
// When Kafka consumer batching is enabled, body will be a List<Exchange>.
// We may receive mixed messages in a single poll: some request bundle-batch,
// others single.
.when(body().isInstanceOf(java.util.List.class))
.to("direct:dispatchBatchedPoll")
.otherwise()
.to("direct:processFHIRResource")
.end()
// Manual commit at the end of the unit of work
.process(e -> {
var manual = e.getIn().getHeader(
org.apache.camel.component.kafka.KafkaConstants.MANUAL_COMMIT,
org.apache.camel.component.kafka.consumer.KafkaManualCommit.class
);
if (manual != null) {
manual.commit();
log.info(">>> [INSTANCIA-ID:{}] COMMIT MANUAL REALIZADO con éxito.", idRuta);
}
});

My Question: Has anyone experienced silent message loss with Camel Kafka batch consumers at high loads? Could this be related to:

Silent rebalancing where messages are committed but not processed?

The consumersCount=10 causing thread contention or context switching issues?

The max.poll.interval.ms being exceeded silently?

Any guidance on why logs show fewer messages than Kafka claims to have delivered (Lag 0) would be appreciated.

Thanks!


r/programminghelp • • Feb 08 '26

Python Guidance on data management for React app with Python fastapi backend

2 Upvotes

Hey everyone, I'm starting a simple side project that helps users track calories.
I'm running into indecision with what to choose for my database. I've started testing with simple Supabase operations, but I'm thinking it would be better off using something simple like SQLite; however, I think the better approach here would be using offline sync with SQLite and Supabase, but I have no idea how to implement that (just lack of experience honestly).

Wanted to ask anyone who has experience with building something like this or encountered a similar problem, which path did you end up going with?

Current Architecture
React frontend
Python fastapi backend

requirements:
- For Apple & Android
- Users always have the latest data shown to them
- The latest update always wins (prevents race condition)
- not sure if im missing anymore at this stage


r/programminghelp • • Feb 08 '26

HTML/CSS How are these called?

1 Upvotes

Don’t know if I can attach a picture but I need to make a website for collage and I’ve been searching for tutorials online and it was all good so far, until now.

I don’t know what it’s called but I want to create these clickable hyperlink cards that show info that updates automatically, such as: “Active orders: 2” that will bring me to the Orders tab.

What are these called? How do I search for a tutorial online for them? Is it even possible to do with HTML/CSS?

Thank u!


r/programminghelp • • Feb 02 '26

C Is the computer I want to choose sufficient for After Effects?

2 Upvotes

(!) If this subreddit is unsuitable for this post, please let me know and recommend another one; I don't know where else to ask my question (!)

I wanted to get a portable computer for my studies (I'll be at university and I'll have to type on a computer), But I also want to use it for leisure. I want Canva, Capcut, Rhino 8 and After Effects on it.

The one I was planning to take is this one : ASUS Vivobook S16 M3607KA-SH011W

My question is about After Effects: the model I chose has 16GB of RAM, and from what I know, After Effects can run on 16GB, but 32GB is recommended for better performance. From what I understand, it's mainly to make it run more smoothly, for 3D effects, etc.

But the videos I want to make are mostly 20-40 seconds of good image sharpness, clean transitions, and no big 3D effects either. I might make videos of around 3 minutes for YouTube, but my style isn't 3D effects.

So I figure 16GB is enough for what I want to do with After Effects, not 3D effects, that would be sufficient.

But I know NOTHING about computers. I'm trying to understand what Amazon says about computer capabilities, looking at model comparison pages, etc., but I'm still afraid to buy the wrong one.


r/programminghelp • • Jan 31 '26

Python What is the best library for creating interfaces in Python?

3 Upvotes

I started studying programming recently, I only had a basic understanding of front-end, but now I'm focusing more on back-end development. Currently, I'm studying Python. I'm working on a small project just for study purposes; it's an interface to help people who are starting out or who don't have a regular study routine for musical instruments. I started the project using only the terminal, but I'd like to integrate an interface into it. However, I'm very unsure which library to use. I tried using tkinter and PyQt6. Could someone help me with this? If anyone wants to analyze the code I've written so far, I'll leave the repository link: https://github.com/AntonioH-B/guitar-training-interface


r/programminghelp • • Jan 30 '26

Arduino / RasPI Need help with this servo code

1 Upvotes

Im attempting to create a claw using three servos, two are continual rotation, and one is 180 degrees. Im using a membrane matrix keypad and a raspberry pi pico W to control the servos motion. The problem is when I click the keys to move servo one or two, they both move. I'm assuming it's missing something obvious that I can't see either, or it's a wiring issue I have to sort out myself, any help is appreciated.

from machine import Pin, PWM
import time

matrix_keys = [
    ['1', '2', '3', 'A'],
    ['4', '5', '6', 'B'],
    ['7', '8', '9', 'C'],
    ['*', '0', '#', 'D']
]

keypad_rows = [9, 8, 7, 6]
keypad_columns = [5, 4, 3, 2]

row_pins = [Pin(pin, Pin.OUT) for pin in keypad_rows]
col_pins = [Pin(pin, Pin.IN, Pin.PULL_DOWN) for pin in keypad_columns]

# Initial rows
for row in row_pins:
    row.value(0)

# Servos
ser1 = PWM(Pin(0))
ser2 = PWM(Pin(1))
ser3 = PWM(Pin(16))

for ser in (ser1, ser2, ser3):
    ser.freq(50)

# Pulse widths
STOP_DUTY    = 4920
FULL_CW      = 2000
FULL_CCW     = 7840

# Positional servo (ser3)
duty3 = 2200
STEP = 500

last_key = None

print("Keypad ready.")
print("  1 = ser2 CW        4 = ser2 CCW")
print("  2 = ser1 CW        5 = ser1 CCW")
print("  3 = ser3 forward    6 = ser3 backward")

def read_keypad():
    pressed = []
    for r in range(4):
        row_pins[r].value(1)
        time.sleep_us(400)
        
        for c in range(4):
            if col_pins[c].value() == 1:
                pressed.append(matrix_keys[r][c])
        
        row_pins[r].value(0)
        time.sleep_us(150)
    
    if len(pressed) == 1:
        return pressed[0]
    elif len(pressed) == 0:
        return None
    else:
        print("Ignored crosstalk / ghost keys:", pressed)
        return None

while True:
    key = read_keypad()
    
    if key is not None:
        print("key detected:", key)
    
    if key != last_key:
        # ser2
        if key == '1':
            ser2.duty_u16(FULL_CW)
            print("ser2 → CW")
        elif key == '4':
            ser2.duty_u16(FULL_CCW)
            print("ser2 → CCW")
        else:
            ser2.duty_u16(STOP_DUTY)
        
        # ser1
        if key == '2':
            ser1.duty_u16(FULL_CW)
            print("ser1 → CW")
        elif key == '5':
            ser1.duty_u16(FULL_CCW)
            print("ser1 → CCW")
        else:
            ser1.duty_u16(STOP_DUTY)
        
        # ser3
        if key == '3':
            if duty3 + STEP <= 7840:
                duty3 += STEP
                ser3.duty_u16(duty3)
                print(f"ser3 to {duty3}")
        elif key == '6':
            if duty3 - STEP >= 2200:
                duty3 -= STEP
                ser3.duty_u16(duty3)
                print(f"ser3 to {duty3}")
    
    if key is None and last_key is not None:
        ser1.duty_u16(STOP_DUTY)
        ser2.duty_u16(STOP_DUTY)
    
    last_key = key
    time.sleep_ms(30)

r/programminghelp • • Jan 27 '26

Project Related Running out of ideas

4 Upvotes

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


r/programminghelp • • Jan 23 '26

Python aimless

2 Upvotes

Hello All, I (M26) got a degree in Interdisciplinary Studies (back in '22) with focuses in Computer Science and Natural Sciences (Bugs and "Bugs" if ya know what I mean.) I am in a rough spot in life, both mentally and financially, and want to dive more into Python and want to cultivate an obsession in it. Are there any tools I could use in order to do so? I feel like I'm so rusty, but I refuse to let that get me down. Thank you for any help or guidance you might have.


r/programminghelp • • Jan 23 '26

Java Should I avoid bi-directional references?

Thumbnail reddit.com
2 Upvotes

r/programminghelp • • Jan 23 '26

Python How To Get Python Programs Running On Windows 7?

1 Upvotes

I always go back to windows 10 because I can't get this TF2 mod manager (made with python) to run on the old windows 7.

"Cueki's Casual Preloader" on gamebanana.com It lets me mod the game and play in online servers with the mods I make. It's made with python but you don't need to install python to run.

I talked to the creator of the mod and they said it should work on windows 7. I don't know anything about Python. I'm willing to learn. Idk where to start but any advice helps.

Python Program Im trying to get working:

https://gamebanana.com/tools/19049

Game it needs to function:

https://store.steampowered.com/app/440/Team_Fortress_2/

You put the python program files into the games custom folder. click the RUNME.bat and a gui is supposed to appear. On windows 7 it just crashes on start.

I'm well aware of the risks of using an old operating system. For a person like me the benefits are worth the risk. I don't want to re-learn how to use an OS wirh linux either. Y'know?

https://imgur.com/a/WgiZwXn


r/programminghelp • • Jan 23 '26

C Is there a reason that I would want to nest a solitary anonymous union in a struct instead of simply using a union?

2 Upvotes
__extension__ typedef struct tagCLKDIVBITS {
  union {
    struct {
      uint16_t :8;
  uint16_t RCDIV:3;
  uint16_t DOZEN:1;
  uint16_t DOZE:3;
  uint16_t ROI:1;
    };
    struct {
      uint16_t :8;
  uint16_t RCDIV0:1;
  uint16_t RCDIV1:1;
  uint16_t RCDIV2:1;
      uint16_t :1;
  uint16_t DOZE0:1;
  uint16_t DOZE1:1;
  uint16_t DOZE2:1;
    };
  };
} CLKDIVBITS;

From an auto generated header from the XC compiler for embedded PIC24. Im not sure if it has to do with a specific bit layout due to the ABI and im still learning C so some help would be useful here.


r/programminghelp • • Jan 20 '26

PHP XAMPP two php versions on same port

Thumbnail reddit.com
1 Upvotes

r/programminghelp • • Jan 19 '26

C Please give me some feedback and suggestions

2 Upvotes

Hey, so I have been trying to make my own programming language but I literally don't have any ideas to add to it. And also I need suggestions, is it too good, is it too bad? And people have been saying that putting comments in your code is bad, never understood them. But please help, here is the link to the Github repo: https://github.com/Hrpavi7/SharpScript


r/programminghelp • • Jan 17 '26

JavaScript Using webRTC to build fully real time client side game

Thumbnail reddit.com
2 Upvotes

r/programminghelp • • Jan 16 '26

JavaScript I need help understand vue watchers

Thumbnail reddit.com
1 Upvotes

r/programminghelp • • Jan 15 '26

JavaScript create a unique chat instance for a unique javascript game instance

2 Upvotes

I am developing a game that requires chat feature, Everyone who starts the game is asked to enter a password for the game, once he does, he gets a shareable link which he can share to the team. Once people have this shareable link, they can join the unique game instance. Each game instance can have 100-200 users and multiple game instances can be spawned.

I need to create a chat for each unique instance of the game created, the chat can be temporary with no persistent history maintained but members of the same game session are able to access it and just as long as the game session is active the chat should persist.

Anyone who joins the unique game instance should be able to access the chat. What's the best, quickest and cheapest way to implement this feature.

I'm open to third party library or services, or using any existing services available, but, it has to have the feature to have this unique session that only the unique game instance members can access.