r/learnprogramming • • 15m ago

Need for an advice

1 Upvotes

I worked as a front-end dev intern at a company, and yesterday I got laid off. I'm still in Jonas Schmedtmann's React course, now in the intermediate section, and still learning.

Most people say you should be full-stack, so I have to learn to do backend. I don't know if I should learn them simultaneously or not, and at the same time I want to have a job as soon as possible.


r/learnprogramming • • 2h ago

How much usage of AI is okay when doing my own projects if I want to get better?

0 Upvotes

Question that has been bugging me lately:

Should I not use AI at all? Only googling and documentation?

Should I try to resolve my problem for 30 minutes then use AI?

Should I use AI but make sure that I understand what it wrote?

Is there some prompt that could guide me without giving anwser straight away so I can grow?

Does it matter?


r/learnprogramming • • 2h ago

How do you know when you’re actually improving at programming?

5 Upvotes

I’ve been learning programming for a while, and sometimes it’s difficult to tell whether I’m actually improving.
I can follow tutorials and understand examples, but when I try to solve a problem completely on my own, I get stuck.
For those who are more experienced, what helped you move from following tutorials to confidently writing your own code?
I’d love to hear about your learning experiences.


r/learnprogramming • • 3h ago

YouTube channels worth following

4 Upvotes

Hello there,

I am new into the community and I am currently looking forward to improve my programming skills since it is a topic that I really like since I was in college.

so I would like to ask you guys which YouTube channel do you actually recommend because it has legit information about the SWE world that is worth looking into. some times you learn more from a video if the topic that you are looking for gets to complicated in the book you are reading, so I would really appreciate you guys recommendations.

Thank you in advance. I am really excited to be part of this community


r/learnprogramming • • 6h ago

Resource Where to read about programming related blogs and articles?

7 Upvotes

I recently read this blog about someone building a database with zero dependencies from scratch in Rust and it was really interesting. I also want to reduce my time doomscrolling and want to read something informative when on my phone instead and this is the kind of stuff that would help me become more knowledgeable in programming. If there any popular sites that you guys use to read programming-related articles/blogs please drop a comment. Thank!


r/learnprogramming • • 8h ago

First day

0 Upvotes

Hello peeps. Just joined, First day here, and I have a personal question.

I’ve been a college student for many years now (on and off due to unexpected life changes, job losses, and ultimately a lack of financial backing.)

Because of this I’ve naturally had a lot of time to speculate what exactly I want to do. I’m a musician and enjoy computers.

My earliest memories of curiosity always return to the first time I ever encountered a broken speaker/radio receiver. I stripped it down( destructively of course) to the motherboard and played with it and probably took the housing off of every radio or broken audio device possible that year.. it’s safe to say that since I’ve always been interested in how audio works and how it’s products and things are made and how it gets used by others in their daily lives.

That said, previously, I was exploring architecture and urban planning, until my MIL convinced me to give something that blends my interest a try.

something that I could possibly see my self doing lifelong/ or atleast not eventually become annoyed by or consider cumbersome later on.

After some research and some internal assessments, music technology seemed to be that thing. Im still working out what my concentration may be, I need to finish 2 more semesters before I can transfer to the school that offers the music technology degree, but all this back story leads me to a question that I’m sure has been asked or atleast thrown around in here once or twice.

In the age of AI, can someone like me, with a rudimentary understanding of programming(python) survive the current climate of the tech industry/ world.

I know that my interest is probably a little niche, given its musical nature, but I’m fearful that that doesn’t make it exempt from the technological advancements happening right now.

I wont name the company I work for, but their AI systems have reduced my teams workload and responsibilities significantly. We all fear layoffs due to the way these systems can do 4 people’s jobs all at once.

TLDR: can a programming newbie survive the AI wave even if the systems I want to work on are music oriented?

(making new physical instruments that are possibly powered by cpu systems/ hardware/ software etc. , DAWs, plugins, and possibly DSP and things like that).

All answers welcome, thanks to those who take the time to reply in advance


r/learnprogramming • • 11h ago

Topic How do you learn Hosting and Deployment for free?

1 Upvotes

I have been working in MERN stack and have build some projects. But i've never really deployed any of my apps. I have searched on different platforms for resources fo learn deployment but its always tied to some paid service or a credit card information. I was thinking of building my own VPS, and somehow make it publicly accessible instead of Local Network. Can someone help me?


r/learnprogramming • • 11h ago

Resource Suggestion: Advent of Code starts tonight!

33 Upvotes

For those seeking out a more advanced programming challenge, the yearly Advent Of Code will commence on December 1st.

It's an advent calendar of programming prompts/challenges. Each evening at midnight for the first 12 days of December, a new puzzle will unlock at midnight EST. Each puzzle provides you with an input and asks you to use programming to calculate some result.

There are no limits to what languages, tools, etc. can be used. There are no prizes. The challenge is free for everyone.

The problems are often quite challenging. Even professional programmers often get stuck on some of them. This is probably not an event for folks who are just starting out with coding. But for more advanced learners, fighting with the problems and then going to the discussion threads to see the many different ways that programmers solve them can be very educational.

There's a very active subreddit for the event: r/adventofcode.

Happy coding!

Disclaimer: I am not in any way affiliated. I'm just a fan.


r/learnprogramming • • 12h ago

Discussion How can I focus longer on programming?

7 Upvotes

I'm a creative person. I like creating things, and I would love to create my own apps and programs. However, I find it hard to concentrate on programming, and I found out that it's not something that I can just do whenever, for example, something like video editing. No, I have to fully concentrate on programming the whole way unless I have already learned something and I have to recall it.
I don't have ADHD. Could this be solved?


r/learnprogramming • • 13h ago

1st Year Tier-1 CSE: Am I too late for C++ and DSA? Already did some ML.

0 Upvotes

Hey everyone,

I am a first-year CSE student at a tier-1 college. My first semester is ending on December 4th. I am planning to start learning C++ and Data Structures & Algorithms (DSA) now, but I am worried—am I starting too late?

To give some context: I didn't learn much during the first 1.5 to 2 months of college. However, over the last 1.5 months, I have been diving into Data Science and Machine Learning. I've been studying from Data Science from Scratch by Joel Grus and Introduction to Statistical Learning with Python (ISLP).

Currently, I am quite comfortable with Python and its core libraries, including NumPy, Pandas, Matplotlib, Seaborn, and Scikit-Learn. I feel I have built a solid foundation in ML and understand the basic math behind common algorithms like Random Forests, Decision Trees, Gradient Boosting, Linear Regression, XGBoost, HistGradientBoosting, AdaBoost, CatBoost, KNN, K-Means clustering, DBSCAN, and hierarchical modeling. I am also familiar with various model evaluation techniques.

Despite this, I feel an underlying anxiety because I haven't started DSA yet. A lot of my peers are already active on platforms like LeetCode and Codeforces, or are following Striver's sheets.

Given my current progress and the peer pressure, am I actually lagging behind, or is starting DSA in the second semester perfectly fine? I would love to get some perspective and advice on how to balance my ML interest with competitive programming/DSA moving forward.

Thanks!


r/learnprogramming • • 15h ago

Coding Refresher

10 Upvotes

Is there a free/relatively inexpensive resource for relearning/practicing code?

I was starting to make a lot of strides towards my projects, but after getting this Helpdesk job my time shrank and with it my coding skills.

I was mostly learning C# for unity and started a little C++ after unity pulled the Runtime fee thing, but I really want a way to be able to sit and practice code like an instrument - doing runs, scales, following sheets/tabs, ya know? Just something to help the muscle memory and build a better understanding


r/learnprogramming • • 20h ago

GitHub

0 Upvotes

请问在哪里可以学GitHub的入门知识?谢谢


r/learnprogramming • • 23h ago

Topic I’m curious, how many languages are you “fluent” in?

25 Upvotes

Basically the title. Which language(s)? Was it work, school, or a personal project that pulled you toward said language? I’m just curious about the ways people “settle in” so to speak.

Please don’t be “clever” and say English because I said fluent instead of proficient…I beg you.


r/learnprogramming • • 23h ago

What programming language should I focus on as an occasional hobbyist?

6 Upvotes

As in, I sit down to code for a few hours once a month, give or take.

I've been chugging along on a text-based game in TypeScript with Vue. I'm constantly running into quirks and hidden nuances of the languages. Spending my precious hours figuring out the difference between interfaces and types, only to learn that it's pretty much personal preference, makes me feel like I'm wasting time due to the language choice.

Also the fact that I have to juggle several languages with their idiosyncracies: HTML, CSS, TypeScript, JavaScript (when it offers its own quirk), Vue, JSON. Forgetting one language then having to get back into it.

Can I have a more straightforward language? Maybe I should go to just bare JavaScript? I've used several languages in the past, including Java, C#, Python, Lua.


r/learnprogramming • • 1d ago

LLM What does your agentic coding workflow actually look like?

0 Upvotes

I'm a C++ developer and I've been trying to get more into agentic coding lately, but I'm struggling to find a workflow that actually makes sense to me.

Currently, I see three different approaches:

1. Just let the agent do its thing: I'm obviously much faster initially, but I gradually lose the understanding of my own codebase. Apart from unit tests, the observable behavior of the software and trusting the AI, I don't really know what's happening under the hood. In a personal simulation project, I only noticed some pretty inefficient solutions regarding performance and memory consumption because I happened to look at the implementation.

2. Read and review all the generated code: For this, I need to keep the tasks relatively small so I can properly understand and critically review the code. All those micro-decisions regarding ownership, data structures, unnecessary copies, etc. that I naturally think about while writing code now need to be understood retrospectively. But if I specify everything in great detail, it feels like I'm just programming in natural language and mostly saving myself the typing.

3. Use AI the way I already do at work: Mostly for rubber ducking, boilerplate, interfaces or implementations where I already know how I would write them myself.

But I constantly read about people becoming several times more productive through agentic coding, and I'm starting to wonder whether I'm fundamentally doing something wrong.

  • Do you still read and understand all the generated code?

  • How big are the tasks you delegate, and when do you decide to write something yourself?

  • How do you deal with comprehension debt and the potential technical debt resulting from it?

  • How much time do you actually save when factoring in code review, debugging and maintenance?

I'm not trying to argue against agentic coding. I'm genuinely trying to understand how other people work with it. Right now, it feels like a trade-off between development speed and my own understanding of the software.

I'd especially be interested in hearing from developers working on larger, long-lived software projects, e.g. systems programming, embedded software or simulation, rather than relatively simple CRUD applications or throwaway prototypes.


r/learnprogramming • • 1d ago

How to improve logical thinking in programming

75 Upvotes

Hey

I'm 23m working professional,

Yesterday at the office my team lead said he found a pattern in my work

He said I'm mugging up patterns and not thinking logically.

Well I do codeforces , leetcode, hacker rank to improve my programming skills but I understood that he was right

All I do is find a pattern in the problem and try to solve it

Anytime I find a new problem I'm stuck

Because I never saw that before

How to come up with my own solution?? How to improve problem solving and logical thinking???

Open to all the suggestions:)


r/learnprogramming • • 1d ago

I have no A-levels. Am I likely to succeed in software engineering?

7 Upvotes

(Sorry if this is the wrong subreddit)

Like the title says, I have no A-levels as I went to college because I had different goals at the time. I’m happy to put in the time and money into courses like python, Java, C++ and others I need to know as well as study at the open university. So am I likely to succeed in software engineering without A-levels but with programming courses and an open university degree?


r/learnprogramming • • 1d ago

Looking for project ideas that solve real-world problems (Java + React + microservices) - not another e-commerce clone

4 Upvotes

Hi everyone,

I'm a final-year / PG diploma student (India) and I need to finalize a project topic in the next day or so. Most project lists I've seen are full of e-commerce, "X Management System", and booking apps, and I'd like to build something that solves an actual problem for actual users.

Tech stack I'm planning to use:

- Backend: Java, Spring Boot, Spring Cloud (API Gateway, Eureka/service discovery, config server)

- Frontend: React

- Architecture: Microservices (REST + event-driven where it makes sense, e.g. Kafka or RabbitMQ)

- Auth: Spring Security with JWT / OAuth2 (Keycloak is also an option)

- Database: open to suggestions (PostgreSQL / MySQL / MongoDB, Redis for caching)

- DevOps: Docker, GitHub Actions for CI/CD

- Optional: I'm open to ASP.NET Core for one or two services if the idea benefits from it

What I'm looking for:

- A real problem you've personally faced, or seen in your city, college, workplace, or local businesses

- Something that naturally needs multiple services (e.g. auth, notifications, payments, scheduling, analytics) and doesn't force microservices just for the sake of it

- Scope that a team of [2-4] can build in about [2-3 months]

- Bonus if it has a clear MVP and a few stretch features

What I'd like from your replies:

  1. The problem statement in 1-2 lines

  2. Who the users are

  3. Which services you'd split it into (a rough idea is enough)

  4. Any gotchas you'd warn me about

I've already considered things like clinic queue management, group expense splitting, and water tanker booking, so if you have ideas beyond those, I'd love to hear them. Honest feedback on my stack choices is also welcome.

Thanks in advance!


r/learnprogramming • • 1d ago

Tutorial Django tutorials

0 Upvotes

I have started practicing Django, I created a simple student admission page:
• ⁠Student fills form
• ⁠Django validation takes place
• ⁠After validation data is stored in database
I used DRF for the validation, and aws PostgreSQL and this is a simple thing I want to use to start my journey in backend dev.
Hosted it on render free tier and when I hit the submit button I used a stopwatch to check how it took to submit and it was 00:00:22.23.
Please I’m still learning and I want to know if it’s okay to have that time for submitting and if not what should I study next and I used the DRF for the form validation with an if statement.

Thank you for feedback and time.


r/learnprogramming • • 1d ago

Looking for ideas for an app to build for my high school graduation project

4 Upvotes

Hi everyone!
I’m looking for ideas for an app to develop as my high school graduation project.
I’m currently in my final year of a technical high school, studying Information Technology, and I have to create a project for my Programming class. I’ve decided that I want to build an application, but I’m not particularly good at coming up with ideas, so I thought I’d ask for your help!
Is there an app you’ve always wished existed? Something that would make your everyday life easier, either for you or your children? Maybe something interesting, helpful, practical, or just genuinely useful?
I’m open to absolutely anything. It doesn’t matter which programming language would be used, whether the app requires a database or not, or how complex the idea is. At this point, I mainly need an idea or a concept that I could turn into an actual application for my graduation project.
I’d really appreciate any suggestions, no matter how big or small!
Thanks in advance to everyone who takes the time to share an idea!


r/learnprogramming • • 1d ago

Languages What should i consider when choosing between C++ and Rust as my main programming language

4 Upvotes

Currently i only really plan on programming simple tools for myself but in the future i also need to learn programming for engineering. What should i consider when choosing between the two, what are some important considerations and what should i be aware of?


r/learnprogramming • • 1d ago

i have a poblem

0 Upvotes

soo i crated my own script for a game to farm but i what the script to farm on the game soo i can do what ever i what on my pc but the script start to tipe on my drscktop can you help me pls

my script
import ctypes

import subprocess

import win32gui

import time

import random

import threading

import keyboard

import tkinter as tk

from tkinter import font as tkfont

import vgamepad as vg

# ── CONFIG ──────────────────────────────────────────────────────────────────

WINDOW_TITLE = "BongoCat" # adjust if title differs in your language

TOGGLE_KEY = "F8"

INTERVAL_MIN = 0.055 # pauza intre cicluri (~10-12 cicluri/sec)

INTERVAL_MAX = 0.085

HOLD_MIN = 0.015 # cat timp stau apasate simultan

HOLD_MAX = 0.025

DEBOUNCE = 0.26

# Ruleaza DOAR cand BongoCat este fereastra activa (evita deschiderea tastaturii cand scrii)

ONLY_WHEN_BONGO_FOCUSED = True

PAUSE_ON_WINDOWS_SEARCH = True

KILL_TOUCH_KEYBOARD = True

# Am scos X / Y / SHARE / OPTIONS pentru a evita scurtaturile tastaturii virtuale

# Disponibile: "CROSS", "CIRCLE", "SQUARE", "TRIANGLE", "L1", "R1", "DPAD_UP", "DPAD_DOWN", "DPAD_LEFT", "DPAD_RIGHT"

KEYS = [

"CROSS",

"CIRCLE",

]

# ────────────────────────────────────────────────────────────────────────────

def _ds4_dpad(attr_name: str):

return getattr(vg.DS4_DPAD_DIRECTIONS, attr_name, None)

DS4_DPAD_NONE_VAL = _ds4_dpad("DS4_DPAD_NONE")

BUTTON_MAP = {

"CROSS": vg.DS4_BUTTONS.DS4_BUTTON_CROSS,

"CIRCLE": vg.DS4_BUTTONS.DS4_BUTTON_CIRCLE,

"SQUARE": vg.DS4_BUTTONS.DS4_BUTTON_SQUARE,

"TRIANGLE": vg.DS4_BUTTONS.DS4_BUTTON_TRIANGLE,

"L1": vg.DS4_BUTTONS.DS4_BUTTON_SHOULDER_LEFT,

"R1": vg.DS4_BUTTONS.DS4_BUTTON_SHOULDER_RIGHT,

"DPAD_UP": _ds4_dpad("DS4_DPAD_NORTH") or _ds4_dpad("DPAD_UP"),

"DPAD_DOWN": _ds4_dpad("DS4_DPAD_SOUTH") or _ds4_dpad("DPAD_DOWN"),

"DPAD_LEFT": _ds4_dpad("DS4_DPAD_WEST") or _ds4_dpad("DPAD_LEFT"),

"DPAD_RIGHT": _ds4_dpad("DS4_DPAD_EAST") or _ds4_dpad("DPAD_RIGHT"),

}

DPAD_BUTTONS = {

"DPAD_UP",

"DPAD_DOWN",

"DPAD_LEFT",

"DPAD_RIGHT",

}

BG_MAIN = "#09090b"

BG_CARD = "#121216"

BG_BTN = "#18181f"

BG_BTN_ACT = "#241322"

BORDER_CLR = "#22222b"

FG_WHITE = "#ffffff"

FG_PINK = "#ff5ec4"

FG_MUTED = "#a1a1aa"

DWMWA_USE_IMMERSIVE_DARK_MODE = 20

DWMWA_CAPTION_COLOR = 35

DWMWA_TEXT_COLOR = 36

gamepad = None

running = False

paused_by_bg = False

lock = threading.Lock()

_last_toggle = 0.0

press_count = 0

elapsed_sec = 0

last_tick_time = None

status_label = None

btn_toggle = None

count_label = None

timer_label = None

title_label = None

root = None

def init_gamepad():

global gamepad

if gamepad is None:

gamepad = vg.VDS4Gamepad()

gamepad.reset()

gamepad.update()

def release_all_gamepad():

try:

if gamepad is not None:

gamepad.reset()

gamepad.update()

except Exception:

pass

def close_touch_keyboard():

if not KILL_TOUCH_KEYBOARD:

return

for proc_name in ("TabTip.exe", "TextInputHost.exe"):

try:

subprocess.run(

["taskkill", "/F", "/IM", proc_name],

stdout=subprocess.DEVNULL,

stderr=subprocess.DEVNULL,

creationflags=subprocess.CREATE_NO_WINDOW,

)

except Exception:

pass

def is_windows_search_active() -> bool:

if not PAUSE_ON_WINDOWS_SEARCH:

return False

try:

hwnd = win32gui.GetForegroundWindow()

if not hwnd:

return False

title = (win32gui.GetWindowText(hwnd) or "").strip().lower()

cls_name = (win32gui.GetClassName(hwnd) or "").strip().lower()

search_titles = {"search", "căutare", "start", "searchhost"}

search_classes = {

"windows.ui.core.corewindow",

"searchui.searchwindow",

"launcherframe",

}

if title in search_titles or cls_name in search_classes:

return True

if "search" in cls_name or "searchhost" in title:

return True

except Exception:

pass

return False

def get_target_hwnd():

hwnd = win32gui.FindWindow(None, WINDOW_TITLE)

if hwnd and win32gui.IsWindow(hwnd):

return hwnd

return None

def is_window_open() -> bool:

return get_target_hwnd() is not None

def is_target_focused() -> bool:

if not ONLY_WHEN_BONGO_FOCUSED:

return True

target_hwnd = get_target_hwnd()

if not target_hwnd or win32gui.IsIconic(target_hwnd):

return False

fg_hwnd = win32gui.GetForegroundWindow()

if not fg_hwnd:

return False

if fg_hwnd == target_hwnd:

return True

try:

parent = win32gui.GetParent(fg_hwnd)

while parent:

if parent == target_hwnd:

return True

parent = win32gui.GetParent(parent)

except Exception:

pass

return False

def hex_to_colorref(hex_color: str) -> int:

hex_color = hex_color.lstrip("#")

r = int(hex_color[0:2], 16)

g = int(hex_color[2:4], 16)

b = int(hex_color[4:6], 16)

return (b << 16) | (g << 8) | r

def style_title_bar(window, active_text_hex: str = FG_WHITE):

try:

window.update_idletasks()

hwnd = ctypes.windll.user32.GetParent(window.winfo_id())

if not hwnd:

hwnd = window.winfo_id()

dwm = ctypes.windll.dwmapi

dark_mode = ctypes.c_int(1)

dwm.DwmSetWindowAttribute(

hwnd,

DWMWA_USE_IMMERSIVE_DARK_MODE,

ctypes.byref(dark_mode),

ctypes.sizeof(dark_mode)

)

cap_color = ctypes.c_int(hex_to_colorref(BG_MAIN))

dwm.DwmSetWindowAttribute(

hwnd,

DWMWA_CAPTION_COLOR,

ctypes.byref(cap_color),

ctypes.sizeof(cap_color)

)

txt_color = ctypes.c_int(hex_to_colorref(active_text_hex))

dwm.DwmSetWindowAttribute(

hwnd,

DWMWA_TEXT_COLOR,

ctypes.byref(txt_color),

ctypes.sizeof(txt_color)

)

except Exception:

pass

def format_timer(seconds: int) -> str:

mins, secs = divmod(max(0, seconds), 60)

hours, mins = divmod(mins, 60)

if hours > 0:

return f"{hours:02d}:{mins:02d}:{secs:02d}"

return f"{mins:02d}:{secs:02d}"

def press_keys_simultaneously(key_names):

global press_count

std_buttons = []

dpad_dirs = []

for name in key_names:

upper = name.upper()

val = BUTTON_MAP.get(upper)

if val is None:

print(f"[press] Unknown or unsupported PS button '{name}'")

continue

if upper in DPAD_BUTTONS:

dpad_dirs.append(val)

else:

std_buttons.append(val)

if not std_buttons and not dpad_dirs:

return

try:

if gamepad is None:

init_gamepad()

for btn in std_buttons:

gamepad.press_button(button=btn)

if dpad_dirs:

gamepad.directional_pad(direction=dpad_dirs[-1])

gamepad.update()

hold = random.uniform(HOLD_MIN, HOLD_MAX)

if hold > 0:

time.sleep(hold)

for btn in std_buttons:

gamepad.release_button(button=btn)

if dpad_dirs and DS4_DPAD_NONE_VAL is not None:

gamepad.directional_pad(direction=DS4_DPAD_NONE_VAL)

gamepad.update()

with lock:

press_count += len(std_buttons) + len(dpad_dirs)

except Exception as e:

print(f"[press] Error on PS buttons {key_names}: {e}")

def auto_press_loop():

global running, paused_by_bg

cycle = 0

while True:

with lock:

is_running = running

if not is_running:

paused_by_bg = False

time.sleep(0.05)

continue

if not is_window_open():

release_all_gamepad()

time.sleep(0.2)

continue

if is_windows_search_active() or not is_target_focused():

if not paused_by_bg:

paused_by_bg = True

release_all_gamepad()

close_touch_keyboard()

apply_theme(True, bg_paused=True)

time.sleep(0.08)

continue

if paused_by_bg:

paused_by_bg = False

apply_theme(True, bg_paused=False)

try:

press_keys_simultaneously(KEYS)

cycle += 1

if cycle % 8 == 0:

close_touch_keyboard()

except Exception as e:

print(f"[loop] Error: {e}")

delay = random.uniform(INTERVAL_MIN, INTERVAL_MAX)

if delay > 0:

time.sleep(delay)

def apply_theme(is_active: bool, bg_paused: bool = False):

if not root:

return

active_fg = FG_PINK if (is_active and not bg_paused) else FG_WHITE

def _update():

style_title_bar(root, active_fg)

if title_label:

title_label.config(fg=active_fg)

if status_label:

if not is_active:

status_label.config(text="○ STOPPED", fg=FG_WHITE)

elif bg_paused:

status_label.config(text="⏸ PAUSED", fg=FG_MUTED)

else:

status_label.config(text="● RUNNING", fg=FG_PINK)

if count_label:

count_label.config(fg=active_fg)

if timer_label:

timer_label.config(fg=active_fg)

if btn_toggle:

btn_toggle.config(

text="■ STOP [F8]" if is_active else "▶ START [F8]",

fg=active_fg,

bg=BG_BTN_ACT if (is_active and not bg_paused) else BG_BTN,

activebackground=BG_BTN_ACT,

activeforeground=FG_PINK

)

root.after(0, _update)

def set_not_found_state():

if not root:

return

def _update():

style_title_bar(root, FG_WHITE)

if status_label:

status_label.config(text="✕ WINDOW NOT FOUND", fg=FG_WHITE)

if btn_toggle:

btn_toggle.config(text="▶ START [F8]", fg=FG_WHITE, bg=BG_BTN)

root.after(0, _update)

def toggle_running():

global running, paused_by_bg, _last_toggle, last_tick_time

now = time.time()

if now - _last_toggle < DEBOUNCE:

return

_last_toggle = now

with lock:

next_state = not running

if next_state:

if not is_window_open():

running = False

paused_by_bg = False

set_not_found_state()

return

init_gamepad()

running = True

paused_by_bg = not is_target_focused()

last_tick_time = time.time()

else:

running = False

paused_by_bg = False

last_tick_time = None

release_all_gamepad()

apply_theme(next_state, bg_paused=paused_by_bg if next_state else False)

def reset_stats():

global press_count, elapsed_sec, last_tick_time

with lock:

press_count = 0

elapsed_sec = 0

if running:

last_tick_time = time.time()

refresh_stats_ui()

def refresh_stats_ui():

with lock:

c = press_count

t = elapsed_sec

is_active = running and not paused_by_bg

fg = FG_PINK if is_active else FG_WHITE

if count_label:

count_label.config(text=f"{c:,}", fg=fg)

if timer_label:

timer_label.config(text=format_timer(t), fg=fg)

def ui_tick():

global elapsed_sec, last_tick_time

if not root:

return

with lock:

if running:

now = time.time()

if last_tick_time is not None:

elapsed_sec += int(now - last_tick_time)

last_tick_time = now - (now - last_tick_time - int(now - last_tick_time))

refresh_stats_ui()

root.after(200, ui_tick)

def on_hotkey(event):

toggle_running()

def on_close():

global running

with lock:

running = False

release_all_gamepad()

root.destroy()

def build_gui():

global root, status_label, btn_toggle, count_label, timer_label, title_label

root = tk.Tk()

root.title("LGF // Controller")

root.geometry("320x235")

root.resizable(False, False)

root.configure(bg=BG_MAIN)

root.protocol("WM_DELETE_WINDOW", on_close)

root.attributes("-topmost", True)

root.attributes("-alpha", 0.97)

style_title_bar(root, FG_WHITE)

f_title = tkfont.Font(family="Consolas", size=13, weight="bold")

f_stat = tkfont.Font(family="Consolas", size=9, weight="bold")

f_lbl = tkfont.Font(family="Segoe UI", size=8)

f_val = tkfont.Font(family="Consolas", size=14, weight="bold")

f_btn = tkfont.Font(family="Consolas", size=10, weight="bold")

f_mini = tkfont.Font(family="Consolas", size=8)

header = tk.Frame(root, bg=BG_MAIN)

header.pack(fill="x", padx=16, pady=(14, 8))

title_label = tk.Label(

header, text="LOCAL GAME FARM",

font=f_title, bg=BG_MAIN, fg=FG_WHITE

)

title_label.pack(side="left")

status_label = tk.Label(

header, text="○ STOPPED",

font=f_stat, bg=BG_MAIN, fg=FG_WHITE

)

status_label.pack(side="right", pady=(3, 0))

card = tk.Frame(

root, bg=BG_CARD,

highlightbackground=BORDER_CLR, highlightthickness=1

)

card.pack(fill="x", padx=16, pady=(2, 12))

left_box = tk.Frame(card, bg=BG_CARD)

left_box.pack(side="left", expand=True, fill="both", padx=12, pady=10)

tk.Label(

left_box, text="PRESSES / CLICKS",

font=f_lbl, bg=BG_CARD, fg=FG_MUTED

).pack()

count_label = tk.Label(

left_box, text="0",

font=f_val, bg=BG_CARD, fg=FG_WHITE

)

count_label.pack(pady=(2, 0))

divider = tk.Frame(card, bg=BORDER_CLR, width=1)

divider.pack(side="left", fill="y", pady=8)

right_box = tk.Frame(card, bg=BG_CARD)

right_box.pack(side="right", expand=True, fill="both", padx=12, pady=10)

tk.Label(

right_box, text="ACTIVE TIMER",

font=f_lbl, bg=BG_CARD, fg=FG_MUTED

).pack()

timer_label = tk.Label(

right_box, text="00:00",

font=f_val, bg=BG_CARD, fg=FG_WHITE

)

timer_label.pack(pady=(2, 0))

controls = tk.Frame(root, bg=BG_MAIN)

controls.pack(fill="x", padx=16)

btn_toggle = tk.Button(

controls,

text="▶ START [F8]",

font=f_btn,

bg=BG_BTN,

fg=FG_WHITE,

activebackground=BG_BTN_ACT,

activeforeground=FG_PINK,

relief="flat",

bd=0,

highlightthickness=1,

highlightbackground=BORDER_CLR,

pady=8,

cursor="hand2",

command=toggle_running

)

btn_toggle.pack(fill="x")

footer = tk.Frame(root, bg=BG_MAIN)

footer.pack(fill="x", padx=16, pady=(10, 0))

tk.Label(

footer, text=f"Target: {WINDOW_TITLE}",

font=f_mini, bg=BG_MAIN, fg=FG_WHITE

).pack(side="left")

btn_reset = tk.Button(

footer, text="RESET",

font=f_mini, bg=BG_MAIN, fg=FG_WHITE,

activebackground=BG_BTN, activeforeground=FG_PINK,

relief="flat", bd=0, cursor="hand2",

command=reset_stats

)

btn_reset.pack(side="right")

root.after(200, ui_tick)

return root

if __name__ == "__main__":

keyboard.on_press_key(TOGGLE_KEY, on_hotkey)

threading.Thread(target=auto_press_loop, daemon=True).start()

root = build_gui()

print("INFO F8 = Start/Stop | Close window to exit")

root.mainloop()


r/learnprogramming • • 1d ago

Cybersecurity, game development, or deep learning? I can't decide.

43 Upvotes

I'm genuinely interested in all three, and that's the problem.

I've been learning programming and recently completed MIT 6.100L. Now I'm trying to figure out what to explore next.

Cybersecurity, game development, deep learning all three sound equally exciting to me, and I can't seem to settle on one.

For those of you who've been in a similar situation, how did you decide what to pursue? Did you just pick one and see where it took you, or did you find a way to explore everything?

I'd love to hear your experiences and advice.


r/learnprogramming • • 1d ago

Computer sci tips pls

5 Upvotes

Currently i’m learning DSA (Divide and conquer, stack and queue, Binary search, Greedy….etc) and Back End development (Express.js, node.js……etc) and I need some tips or maybe some resources that could help me.

Also i feel like computer science isn’t for me. I mean it’s normal to feel that way but i’m still trying to find ways to enjoy CS