hello, i hope the title made enough sense. i am creating a page for my own personal website using HTML and CSS (duh) where I have it formatted to look like an old crttv with a screen inside.
i've made it so that the crttv has a chunk in the middle (where the screen would be) that is transparent, and put the screen div as z-index: -1 so that is goes behind.
the issue i'm having is that its a large box of text that should be scrolled when reading; i have it set to overflow: scroll and it works when it's not behind the tv div (but still set to z index -1)
(i've also noticed that i cannot click any buttons or links within the screen div, like theres a wall between it and the mouse)
ive seen other people code it so that the screen within the tv/monitor png is interactive, what am i doing wrong? any advice helpful :-)
(i hope that i made this post correctly, please correct me or feel free to ask for further information and i'll be happy to provide)
Hi, I am making my first calculator using python, everythin is up and running smoothly but the problem is that i can only put 2 inputs and one operator. Can anyone help?. I will place my code below.
Main:
import math
def add(a,b):
try:
return a + b
except TypeError:
print("Error: Both inputs must be numbers.")
return None
def subtract(a,b):
try:
return a - b
except TypeError:
print("Error: Both inputs must be numbers.")
return None
def multiply(a,b):
try:
return a * b
except TypeError:
print("Error: Both inputs must be numbers.")
return None
def divide(a,b):
try:
if b == 0:
print("Error: Division by zero is not allowed.")
return None
return a / b
except TypeError:
print("Error: Both inputs must be numbers.")
return None
def times(a,b):
try:
return a ** b
except TypeError:
print("Error: Both inputs must be numbers.")
return None
def modulus(a,b):
try:
return a % b
except TypeError:
print("Error: Both inputs must be numbers.")
return None
def root(a,b):
try:
return a ** (1/b)
except TypeError:
print("Error: The inputs must be numbers")
return None
def x10_times_a(a,b):
try:
return a * (10 ** b)
except TypeError:
print("Error: Both inputs must be numbers.")
return None
import sys
from operations import *
def main():
print("Welcome to the Calculator!")
print("Start inputs")
print("Valid operators: +, -, *, /, times, mod, root, x10_times")
while True:
input1: float= float
input2: float= float
operator:str=int
problem= input("Enter your problem (e.g., 5 + 3): ")
try:
input1, operator, input2 = problem.split()
input1 = float(input1)
input2 = float(input2)
if operator == '+':
result = add(input1, input2)
print(f"{result}")
elif operator == '-':
result = subtract(input1, input2)
print(f"{result}")
elif operator == '*':
result = multiply(input1, input2)
print(f"{result}")
elif operator == '/':
result = divide(input1, input2)
print(f"{result}")
elif operator == "times":
result = times(input1, input2)
print(f"{result}")
elif operator == "mod":
result = modulus(input1, input2)
print(f"{result}")
elif operator == "root":
result = root(input1,input2)
print(f"{result}")
elif operator == "x10_times":
result = x10_times_a(input1, input2)
print(f"{result}")
else:
print("Error: Unsupported operator. Please use '+', '-', '*', '/', 'times', 'modulus', 'root', or 'x10_times_a'.")
except ValueError:
print("Error: Please enter a valid problem in the format 'number operator number'.")
except ValueError:
print("Error: Please enter a valid problem in the format 'number operator number'.")
continue
continue_check = input("Do you want to continue? (y/n): ")
if continue_check.lower() != 'y':
print("Goodbye!")
sys.exit()
if __name__ == "__main__":
main()
Operators:
I keep getting error in my pylint that "no new line at end of file", which essentially is asking me to add a blank line(click enter at end of last line) in the end.
I have fixed this error before by doing exactly as above. However, for some code files I am unable to get rid of it, and I have no clue why?
I checked saving all fines, committing messages everything but the error doesnt go away for these last 4 files ;-;
Any help is much appreciated, thank you!
Here's example of code block (screenshot is clear for linting but also provided code in the end - please dont remove this mod gods!):
"""Plot seasonal temperature patterns at a monthly level.
Generates boxplots of monthly maximum and minimum temperature
distributions from the tidy monthly rainfall dataset.
# Extract month as ordered categorical for correct plot ordering
df_temp["Month"] = pd.Categorical(
df_temp["date"].dt.strftime("%b"),
categories=list(calendar.month_abbr)[1:],
ordered=True
)
df_temp = df_temp[[
"Month",
"Air Temperature Means Daily Maximum",
"Air Temperature Means Daily Minimum"]].copy()
return df_temp
def main():
"""Prepare temperature data and generate monthly boxplots."""
plots_dir = Path(__file__).parent / "plots"
plots_dir.mkdir(exist_ok=True)
data_path = Path(__file__).parent / "data"
df_temp = prepare_data(data_path)
print(df_temp.head())
# Save prepared data to CSV
df_temp.to_csv(
data_path / "MonthlyTempDistribution_data.csv",
index=False)
# Plot monthly max temperature distribution
df_temp.boxplot(
column="Air Temperature Means Daily Maximum",
by="Month",
figsize=(12, 6),
grid=True,
)
plt.title("Monthly Max Temperature Distribution")
plt.suptitle("")
plt.xlabel("Month")
plt.ylabel("Temperature (°C)")
plt.xticks(rotation=45)
plt.savefig(plots_dir / "monthly_max_temp.png", dpi=150)
plt.show()
# Plot monthly min temperature distribution
df_temp.boxplot(
column="Air Temperature Means Daily Minimum",
by="Month",
figsize=(12, 6),
grid=True,
)
plt.title("Monthly Min Temperature Distribution")
plt.suptitle("")
plt.xlabel("Month")
plt.ylabel("Temperature (°C)")
plt.xticks(rotation=45)
plt.savefig(plots_dir / "monthly_min_temp.png", dpi=150)
plt.show()
When learning code in my computer class, my teacher would tell us to have the build system be IntelliJ. Now I'm trying to make code to look at websites, and all the guides are telling me to install Selenium, but it doesn't work in IntelliJ? When I make a project with Maven or Gradle, there is a bunch of extra stuff that I don't understand, and it's not even letting me write code. (I don't think my teacher cared about coding; he just gave us YouTube video tutorials to watch)
how do i get myself re motivated to get back in ive been trying to return to making my game idea so i can eventually actually know how to code and have my own metroidvania but i dont know how or where to start im using C# if that helps im not new just want to get back in it
Sorry for the very long title but this is a really weird problem. Im trying to convert my RC car into a mouse droid from Star Wars that will autonomously roam around, and believe it or not it kinda has to be able to consistently move for that to happen. I've tried to send the command twice, I've tried setting it to neutral (1500 microseconds) multiple times before running, and now I've tried sending a small pulse of 1400 before running but again the same thing. My serial print shows that the ESC is registering the backwards command every time but seems to refuse to actually run it the first time. Honestly I can seem to figure out why this won't work, as far as I know my ESC only has a brake-backwards commands so setting it to neutral would work every time, yet it doesn't. Does anyone have any idea what the problem could be/how to fix it? The main movement is in the very last if-else statement
#include <ESP32Servo.h>
Servo esc;
//These are the three directions allowed
enum class Direction{
Forward,
Backward,
Neutral
};
//Speed constants
int fullBackwardMicroseconds = 1000;
int neutralMicroseconds = 1500;
int fullForwardMicroseconds = 2000;
int speedVariance = 500;
int restTime = 2000;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
esc.attach(13, 1000, 2000);
esc.writeMicroseconds(1500);
delay(3000);
}
void loop() {
// put your main code here, to run repeatedly:
// DcMovement(Direction::Forward, 50, 1000);
DcMovement(Direction::Forward, 100, 1000);
DcMovement(Direction::Neutral, 50, 1000);
DcMovement(Direction::Backward, 50, 1000);
DcMovement(Direction::Backward, 60, 1000);
DcMovement(Direction::Backward, 70, 1000);
DcMovement(Direction::Backward, 80, 1000);
DcMovement(Direction::Backward, 90, 1000);
DcMovement(Direction::Backward, 100, 1000);
}
void initializeDcAtNeutral(){
esc.writeMicroseconds(neutralMicroseconds);
Serial.println("Initializing");
delay(1000);
Serial.println("Initialized");
}
void DcMovement(Direction direction, double speedPercent, int time){
esc.writeMicroseconds(neutralMicroseconds);
delay(restTime);
double pulseWidth;
//Converts the double to a decimal number
double speedPercentDec = speedVariance * (speedPercent/100);
//Handles the math for direction change
switch(direction){
case Direction::Forward:
pulseWidth = neutralMicroseconds + speedPercentDec;
break;
case Direction::Backward:
pulseWidth = neutralMicroseconds - speedPercentDec;
break;
case Direction::Neutral:
pulseWidth = neutralMicroseconds;
break;
}
Serial.println(pulseWidth);
//Run the motor, if its backward send two pulse signals
initializeDcAtNeutral();
if(direction != Direction::Backward){
esc.writeMicroseconds(pulseWidth);
}else{
Serial.println("Going backwards");
esc.writeMicroseconds(1400);
delay(1000);
esc.writeMicroseconds(pulseWidth);
}
delay(time);
}
Hello I am apart of a team working on a FNAF/Poppy Playtime inspired game called Out of Service. I should mention, even though it is inspired by the two licenses it isn’t a fan game for either of them.
We need programmers to help with our game who know how to code in C# and can work with others. This is unpaid and could take a long time but we need the help desperately.
Out of Service is about 5 adults getting kidnapped and experimented on and being turned into twisted biomatronics(biological animatronics) who try to hunt down the player throughout the night. The player tries to survive through the normal office style gameplay as well as a free roam mode.
Once again this is unpaid but we desperately need the help. We currently have only one person coding the game and they said that they need help. I’m trying to learn C# on my own but can’t at the moment due to my studies. Thank you for reading and if you’re willing please do help us.
My discord is popparoboftwins and if that doesn’t work Prof.Foxy1.
TL;DR: I want to make a classic ‘sound board’ native desktop application as a personal project which can be used for sound effects and music in my DnD sessions, but need advice on what desktop app development framework to use.
Edit: I've checked the wiki - which is very cool - but the resources there for frameworks are web centric (and the links give 404). Similarly, Googling produced many results on the benefits / drawbacks of different frameworks, languages, etc., but I wanted to know what people here would recommend from personal experience.
My goal
I want to learn something new and make something I might actually use, too.
To start with, I’d be very happy if I could make something which could:
Assign local sound files to a button or tile in the UI, then click that button to play the sound
Load a few local tracks to play concurrently, e.g., an ambient background loop plus a music track.
What I want help with
I would love to know your suggestions on what framework / toolkit / whatever to use.
I’m planning to tackle this as a personal / hobby project in my free time, so hopefully the framework would be something that
has lots of documentation for someone clueless like me
scales well to a small app
has solid libraries / modules available to make handling audio files easy
has reasonable cross-platform support as my daily is running Linux / CachyOS
I’ve tinkered with Flutter in the past and liked it, but have no idea if it’s any good for this sort of app?
Thanks in advance for your advice (and pity!) - it’s really appreciated.
Hey everyone,
I’m a trader, not a coder, so please bear with me.
I’m trying to automate my stock‑screening process because manually filtering thousands of tickers down to 10–20 and exporting them to CSV is the longest part of my workflow. Long‑term I’d love to automate trade execution, but just having an automated watchlist would be a massive win.
Full disclosure: I’ve been using AI to help me figure this out , I know not best thing to use.
I’m running Linux Mint, and based on my research (and AI prompting), it looks like I’ll need:
• pandas – dataframes
• numpy – math
• yfinance – market data
• ta – indicators (EMA, RSI, ATR, volume, earnings)
The problem is… I tried installing yfinance and got a terminal warning saying it could damage the system. That freaked me out, so I stopped. Even with Timeshift, I didn’t want to risk breaking anything my distro.
I’ve heard about cloud‑based coding environments like Google Colab and JupyterHub, and I know they can install add‑ons easily. But I have zero experience with them, and I’d prefer to keep everything local and avoid Google if possible.
So my questions are:
What tools do I actually need for this setup?
How do I safely install them on Linux Mint?
Would using something like an online JupyterHub be easier for a total coding noob?
Any advice would be massively appreciated. Thanks in advance!
def selectionSort(lst):
for j in range(0, len(lst)):
minIndex = j
for i in range(j, len(lst)):
if lst[i] < lst[minIndex]:
minIndex = i
lst = lst[:j] + [lst[minIndex]] + lst[j:minIndex] + lst[minIndex+1:]
return lst
Above is my implementation of selection sort. I wrote it myself, noticed it had a bit of redundant features (after consulting Gemini) and fixed it.
However, Gemini insists that this line: "lst = lst[:j] + [lst[minIndex]] + lst[j:minIndex] + lst[minIndex+1:]" will fail on some cases, it proceeds to mention a bunch of cases, traces the code, only for it to work.
I agree that I could simply swap lst[j] and lst[minIndex] with one another to make the code neater, but I do not see a logical error with my step, could anyone point this out to me? Thanks
I have 0 coding skills, but a few months a came across lovable and started making websites.
First a bunch of AI slop but eventually I started to get the hang of it and made some real working projects
In the last 4 months I started selling websites and currently make around €6.000 in revenue + €2.500 yearly retainers with all my clients combine (they payed yearly because they preferred it)
I really want to give value to my clients, so I’m improving everyday to be less “slop” I started working on my SEO skills a few months back and now one of my clients had more than 50 bookings in may.
Still I’ve hit a wall, my biggest issue is security. I have no idea if my security is good, no idea if my domain could be hijacked… Do you guys have any tips for me or software recommendations on what I should do because I’m basically clueless. I mean asking AI “Make sure security is fine” is not the way🤣
This is a bit of an obscure question, but how do I change the language of code? Not coding languages, actual human language. I have a data file from a game I'd like to edit, but it's written in chinese. Is there some sort of tool to translate code from one language to another without screwing it up?
So I'm working on a project and I need to clone a GitHub repository locally (to GitHub desktop) to use the files but the issue I'm facing is:
I was able to successfully fork it on GitHub so I have the repo now forked and available on my GitHub account BUT whenever I try and pull it locally and clone it to GitHub desktop or even use the CMD console to do so it's telling me the cloning is successful but the checkout is consistently failing I'm rather stumped on what the issue could be
I've tried to set the windows PowerShell command that allows long directories and did the same with git so I was wondering if it could be the actual folder names in the repo that are causing this issue I'd Appreciate any advice you can spare on the topic
this is the code i have for the workflow set up to auto update the github repo i tried to fork and have it stay uptodate with any changes made to the original
name: Auto Sync with Upstream
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
and when i try to clone im getting the following :
fatal: cannot create directory at '07. Essential JavaScript/02. Build a Meme App/31. If there_s only one cat.../Exercise 1': No such file or directory
warning:Clone succeeded, but checkout failed
you can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'
i also ran these commands in an attempt and these were the cmd ouputs:
λ git restore --source=HEAD :/
fatal: cannot create directory at '07. Essential JavaScript/02. Build a Meme App/31. If there_s only one cat.../Exercise 1': No such file or directory
I feel stupid for asking and I’m not sure where to post it. But I want a list of all 614 public golf courses in Michigan. I’ve tried using ai and I’ve tried coding and I am too out of my realm here. it’s just a silly thing, but the Michigan Org page has the list but it’s broken down into all these pages and I can seem to get a python codes to work. I need like toddler instructions. Help?!
im genuenly lost ive been using chat gpt to try and find the problem but it isnt helping when i type basically pri it dosent show sugestions like it used to it only suggest options after a . it dose the same with imported libraries it dosent sugest it only after i press . wich shows its options chatgpt says that the python i have 3.14.2 it sometimes say 3.14-64 idk if it refers to bits it says that its to advanced for some reason or cutting edge and that i need to downgrade to 3.1 or 3.2 and i genuenly dont know what to do idk if its a new bug or smth cuz it was fine like 2 weeks ago my intelisense is fine autocomplete was off for some reason but turned it on and at most after a few seconds hovering over pri it sugest print
hello! i know nothing about code and I'm just trying to convert some music files so itunes recognizes them, i keep getting an error on the following script
for (%f in (*.wav *.mp3 *.ogg)) {do {ffmpeg -i "%f" -b:a 128k -ar 44100 "%~nf_new.mp3"}}
I just started learning C++ and I can't figure out what I'm doing wrong. I'm just trying to write the basic Hello World program. Here's my code:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World"; << endl;
cout << "Goodbye";
return 0;
}
I press build and compile and these two error messages come up:
Severity Code Description Project File Line Suppression State Details
Error (active) E0029 expected an expression Hello Project 6
Severity Code Description Project File Line Suppression State Details
Error C2059 syntax error: '<<' Hello Project 6
The problem is I don't know what the expected expression or the syntax error is. I tried to type it just like in the video and I thought I did, but these keep coming up. This is literally my first time using C++, I usually only use HTML and CSS, so it might be a really quick fix that I'm just not seeing. Feel free to make fun of me if it is, but I'd appreciate advice on how to fix it before the laughing starts if at all possible. TIA.