/r/programminghelp
This is a place where you can get help with programming related issues, without judgement.
Ask your embarrassing/noobish programming questions here, and don't get insulted for it.
Violating any will result in punishment so you should probably go check them out.
/r/programminghelp
I have been trying to set up a local blockchain on my Windows PC using Docker and blockchain tech like Geth, or Ganache. Sadly it all failed multiple times now am stuck. All I am trying to do is set up a local blockchain with at least 5 nodes that use Proof of Authority as the consensus algorithm. PLEASE HELP!
I'm trying to start a stream from the API but I'm getting the following error:
Error creating test live stream: <HttpError 400 when requesting https://youtube.googleapis.com/youtube/v3/liveStreams?part=snippet%2Ccdn&alt=json returned "Resolution is required". Details: "[{'message': 'Resolution is required', 'domain': 'youtube.liveStream', 'reason': 'resolutionRequired', 'extendedHelp': 'https://developers.google.com/youtube/v3/live/docs/liveStreams/insert#request_body'}]">
This is the relevant potion of my code: def create_test_livestream(service, title, stream_key): # Removed description try: stream_request_body = { 'snippet': { 'title': title + " Test Stream", }, 'cdn': { 'ingestionInfo': { 'ingestionStream': { 'streamId': stream_key, 'videoResolution': '720p', } } } } stream_response = service.liveStreams().insert( part='snippet,cdn', body=stream_request_body ).execute()
print(f"Test Live stream created: {stream_response['id']}")
return stream_response['id']
except Exception as e:
print(f"Error creating test live stream: {e}")
return None
if name == 'main': youtube = get_authenticated_service(SCOPES) title = "Test2"
stream_key = "my stream key goes here"
stream_id = create_test_livestream(youtube, title, stream_key)
if stream_id:
print(f"Test stream created successfully: {stream_id}")
else:
print("Test stream creation failed.")
I'm streaming from OBS and I've confirmed that the stream output is 720 30fps @ 1500kps This matches what the key was set to. I've also tried stream keys that don't have a set resolution but still get the same error. Any idea on how to get past this error I would be greatful.
# Flask app initialization
app = Flask(__name__)
CORS(app, resources={r"/*": {"origins": "*"}})
@app.route("/")
def home():
return render_template('index.html')
@app.route('/api/cypher', methods=['POST'])
# Run Flask App
if __name__ == "__main__":
app.run(debug=False)
I have deployed my app, on local it runs well while on deployment responds with 404
Emulating an Android Pixel 9 Pro API 35 in Flutter (Dart)
I want to debug the network traffic of my android phone. However, even though I am sending out requests and receiving responses using the inbuilt dart http library, the Network inspector isnt showing anything. Couldn't find anything about this online.
I want to adjust the sidebars and set a default that is applied for every new project. How can i do this?
I know a bit of Java and have done basic things with spring boot and angular as well as sql databases. I’m just curious what skills would I need to possess for a real career with Java. I have a degree in computer networking and am working on my comptia a+ but I doubt these would be very helpful.
Hi, i´m looking to try a voice-to-text feature on a future project and I´m looking for an API that i could try for free.
does anyone know / have experience with any?
Hello,
For a digital print, I must provide a file in csv format. I currently have my image in svg format (for reference, it's a qr code) but I can't seem to convert it. I tried to extract the geometric data (rectangles, lines, etc.) or other slightly wonky things but I don't really know how to do it correctly. Is there a way to convert my file or can I generate an image directly in csv format? I've been trying since last Thursday and I don't have much time left so I'm coming here as a last resort.
ps: I use python.
ps 2: I'm not a programmer so maybe there is a really simple way to do it and i'm not aware.
Thanks for your help
Can anyone compile this github repo into a standalone .exe file? https://github.com/faradey8951/AudioDataInterface I've spent 3 hours to compile it and no luck. I will be very thankful if someone compiles it and sends the .exe
Note: I am NOT a programmer, i am just trying to mod cookie clicker
Long story short: i need my code to sell 5 buildings simultaneously to activate a buff. the more buildings i sell, the better.
The problem with my code right now is that the game only registers the first building sold for the buff.
Original Code:
function activateGodzamok(){
var buildingList = [2,3,4,5];
l('storeBulkBuy').click();
l('storeBulk1').click();
for( var theBuilding in buildingList ){
var numCurrentBuilding = Game.ObjectsById[buildingList[theBuilding]].amount;
Game.ObjectsById[buildingList[theBuilding]].sell(numCurrentBuilding);
Game.ObjectsById[buildingList[theBuilding]].buy(numCurrentBuilding);
}
}
Rewritten Code (i tried to isolate the buying and selling... it still didnt work):
function activateGodzamok(){
var buildingList = [2,3,4,5];
if(Game.hasGod('ruin')){
var zero = Game.ObjectsById[0].amount;
var twoo = Game.ObjectsById[2].amount;
var thre = Game.ObjectsById[3].amount;
var four = Game.ObjectsById[4].amount;
var five = Game.ObjectsById[5].amount;
l('storeBulkSell').click();
l('storeBulkMax').click();
Game.ObjectsById[0].buy();
Game.ObjectsById[2].buy();
Game.ObjectsById[3].buy();
Game.ObjectsById[4].buy();
Game.ObjectsById[5].buy();
// rebuy all buildings
l('storeBulkBuy').click();
l('storeBulk1').click();
Game.ObjectsById[0].buy(zero);
Game.ObjectsById[2].buy(twoo);
Game.ObjectsById[3].buy(thre);
Game.ObjectsById[4].buy(four);
Game.ObjectsById[5].buy(five);
}
}
Hello I am using android studio (dolphin Sept 2022) and I keep getting this error on my new projects. My first project runs fine but whenever I make a new one I get this error. I've already tried deleting the Gradle file but I keep getting the same issue. If anyone has any answers I would appreciate it a lot.
Is this even real computer science? it probably is, i recognize the value of making a map of your code through a flow chart, but who the hell designed these? its come to a point where i genuinely dont know if these are fully meant to be read like a toddler is trying to design a map or if i was just taught poorly
Warnier's, Chapin's. Jackson's. Bertini's Tabourier's and "Action" Flowcharts
Hell, i cant even find any accounts for these methods aside from whatever my college is smoking. is this even a real thing or is my professor smoking a fat one and calling it a day? genuine help here on how i could possibly understand these flowcharts, specifically Tabouriers.
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
Hi everyone!
I’m currently developing an app that includes a meal recommendation engine. The idea is to start by collecting user preferences during onboarding, such as:
Using this initial input, I want to recommend meals/recipes that match their tastes and help them plan a meal calendar.
I’m looking for guidance to validate my approach and design the algorithm effectively. Here’s the plan so far:
I already have a database of recipes to work with, but I’d appreciate any advice or suggestions on:
Any resources, examples, or feedback would be immensely helpful. Thanks in advance!
Hey guys, im working on an iMessages app and am having trouble uploading to TestFlight. I keep getting the below error. Does anyone know what I need to do? This is my first app ive made so im struggling a bit. thank you
ITMS-90546: Missing asset catalog - Your app is missing the asset catalog file in “test.app”. For details, visit: https://developer.apple.com/documentation/xcode/managing-assets-with-asset-catalogs.
age = input("how old are u")
if age == 15:
print("Wow, me too!!")
elif age<15:
print("lil bro")
else:
print("That's a cool age!")
Hello,
I'm encountering an issue with the API Server integration in my Sulfuric framework. When I call the app.sendJson(data, status_code="200 OK") method, the response is not sent, and the client receives an ERR_EMPTY_RESPONSE error.
Steps to Reproduce:
Start the Sulfuric API server.
Call the app.sendJson method within a route handler.
Observe the response in the client (browser or HTTP client).
Expected Behavior:
The method should send a JSON response with the provided data and status code.
Actual Behavior:
The client receives an ERR_EMPTY_RESPONSE error.
Additional Information:
Sulfuric version:1.0
Python version: 3.12
Any relevant code snippets or logs:
@app.on(method="GET", path="/data")
async def get_data(req, res):
await res.sendJson({"message": "Hello, World!"}, status_code="200 OK")
Can anyone help me resolve this issue?
Thank you!
I am having this problem where programming has consumed my life. At some point a few years ago I stopped enjoying games. I no longer go out with friends. Any time I try to do anything I think to myself that I am wasting my time and I should be coding.
I work a factory job and want a way out so bad, so I chose to do what I used to love and program. My goal was to create something to sustain me financially.
Now, after I get off work I spend all my time in my chair. I script and program for hours on end until I can't stay awake. I throw trash on the floor because cleaning is a time waste.
At first I thought it was me just being dedicated to my goal but now I realize im screwed. Nothing feels good anymore. I must program. Nothing else matters.
What can I do to stop programming and spend some time relaxing, gaming, or talking with friends again?
Hi, I have a problem with the terminal and PowerShell. When I run terminal it says:
"The shell cannot be started. A failure occurred during initialization:
Inicjator typów zgłosił wyjątek dla typu 'System.Net.ServicePointManager'.
(This means: "The type initializer for 'System.Net.ServicePointManager' threw an exception.")
[process exited with code 4294901760 (0xffff0000)]
You can now close this terminal with Ctrl+D, or press Enter to restart."
And I cannot type any command here. Then there's similar with PowerShell, when I run it appears for a milisecond and disappears. I tried installing the latest PowerShell version (7, I think) and when I run it, it works normally, but "Windows PowerShell" does not. I tried to solve it in different ways, by restarting my pc, by typing numerous commands in cmd, by "reapiring" it in control panel etc. Nothing worked.
So, I am asking for your help with it. I use both of these very ralely, but I think I shouldn't ignore it. Feel free for asking for more detailed information if needed. Thank you so much!
Sorry for all language mistakes, but English isn't my first language
Also I'm writing it here, because I don't know where else to post this
As the title suggests, I am having issues getting my web app onto the internet. I am using a linux pc to host the web app through the user of docker files. Then I use a cloudflare tunnel to connect it to my domain. However, I have been having alot of issues sometimes the website might load but other times I would get Bad Gateway which would either instantly go away or it wouldn't until I restarted the server. I have also been having issues with my Dockerfile particularly with my frontend in which any changes I make doesnt get rebuilt even if I use 'docker-compose build --no-cache'. SO essientially the website is very dodgy and I have no clue what I am doing.
I am using js for the backend and react for the frontend. Im not sure what parts of code to show on here but I believe it has to do with the way my Dockerfiles are set up.
If you guys have any tips or suggestions I would really appreciate that.
The question is:
Given is a list containing the numbers 1, 2, ..., n in some order. Your task is to simulate the process in which the numbers are collected from the list in ascending order. In each round, the list is scanned from left to right, and the next numbers to be collected are gathered. The process ends when all numbers have been collected.
For example, when the list is [2,1,4,7,5,3,6,8], the rounds are as follows:
Round 1: [1]
Round 2: [2,3]
Round 3: [4,5,6]
Round 4: [7,8]
I have a few questions how to start. I am doing this in Python. Is it a good idea to collect the numbers in a set()? Or do this with the help of a stack? Thankful for any help
Sorry, my english grammar is not very good but i tried as possible to write this post understandable.
Hello and I am currently working on my new version of my programming language and after learning a lot of Parser. But I am here to ask how do I implement multiple variable assignment because the current variable assignment expression only take 1 identifier.
expr : IDENTIFIER ASSIGN expr
I want both variable assignment and object attribute editing. So I was thinking it would be like this:
expr : expr_list ASSIGN expr_list
expr_list : expr (COMMA expr)*
But I don't know how to implement like "am i just get the list of expressions by the way?" I just need some help about implementing multiple variable assignment.
I don't think this post would be all what I trying to ask so if there is something wrong please ask me to fix it!
So i have a nwjs game that i like, but i want to put it back into a html format. Running just the index.html within the game files results in errors. How should i go about doing this?
Hello everyone, hope you guys are doing well. I'm trying to create a Django based web application for a school for their time table creation.
The user will input courses, with the main important fields being
So for example, a school typically runs from 9 AM to 3 PM, with 9:45 AM to 10:00 AM being blocked for recess, 11:30 AM to 12 PM being blocked off for lunch, and 1:40 PM to 2:15 PM also being blocked off for lunch (these blocked times will be inputted by the user). So, this leaves us slots for classes to be this value
DAILY_SLOTS = [ "9:00-9:45", "10:00-10:45", "10:45-11:30", "12:10-12:55", "12:55-1:40", "2:15-3:00"]
Considering all courses are 45 minutes, I would now like to calculate the different schedules while ensuring these constraints:
Now I want to generate the different types of schedules that can be created throughout the time spans that include all the different grades, so it will display something like
---------------| Grade 1 | Grade 2 | Grade 3 | Grade 4 | Grade 5 | Grade 6 | Grade 7 | Grade 8
9AM-9:45AM | Math by Alexander | Science By Ola | etc
10AM-10:45AM | Biology by Ola | Math by Alexander | etc
Does anyone have any idea how I can do this or have any python code that I can make this work? It's not a easy task, didn't know what I was getting myself into haha. Thank you!
Hey guys, I am studying Biomedical Engineering, and for my final project me along with a few classmates are being asked to build a niche device to improve someones quality of life. My group has decided on creating a device which is capable of detecting and anticipate when someone is having a panic attack (This device is specifically for serious/frequent patients suffering from anxiety). Our plan is to have this device that looks like a belt, and is wrapped around the chest allowing to track heart rate, breathing patterns with the help of some sensors. Our professor has challenged us to have this device smart learning to be able to predict anxiety attacks from occuring before they start which im not sure how to program something for that. Also, if you guys have any other ideas we could add to this feel free to comment. We are still in the planning phase and I wanted to see what other peoples thoughts on this is. Thanks for the help
Hey, so I haven't made a website in yearssss and I need one now that allows visitors to submit a short anecdote and have them be displayed on the website. However, I don't want the visitors to have to make an account or register any type of information, I want it to stay anonymous and easy to do, otherwise people won't submit anything.
I was advised to use http requests, but that it would require me to get a host or use my own laptop (not very secure). And website builders are unlikely to let me have people submit "comments" without an account.
I haven't programmed in ages and I'm not sure which route I should take from here.
Any help is appreciated!
Extra info: This is for an art exhibition in a small gallery for 10 days. There will be a QR code next to my piece for the visitors to access the website. I probably won't leave the website up after the exhibition is finished.
Hey there,
I am currently working on a small project of my own, a 3D Börde-Shooter to be exact and I am currently trying to learn bevy, the game engine based on rust.
The problem is: I have literally no possibility to learn it except by others helping me. Short explanation why:
(I mean, there is one... For scratch)
So, if anybody has the patience and is willing to help me a little and maybe teach me step by step a few basics of programming with bevy, I would be grateful.
I already tried my luck on r/bevy, I got a lot of downboted tho, just for not already knowing the language. And I got declined by a few other subreddits as well, since it's against their rules, to not ask for a specific problem.
I am not sure, if this type of question is allowed here, so if not, let me know and I'll just delete this post.
I appreciate all incoming help!
Hi all, first time using CodeForces and i'm having trouble submitting my code. I'm working on this problem: https://codeforces.com/problemset/problem/1/A and my code works on my machine but causes an integer overflow on the server when I submit. here is my current code:
#include <stdio.h>
int n;
int m;
int a;
long result = 1;
//given: n,m,a all positive integers
int main(){
scanf("%d %d %d", &n, &m, &a);
if(n % a == 0){ //integer division rounds down
result *= n/a;
} else {
result *= (n/a + 1); //fix it here
}
if(m % a == 0){ //same as n
result *= m/a;
} else {
result *= (m/a + 1);
}
//i think my problem is here with printing the long int
printf("%ld", result);
return 0;
}
On my computer, the input: "1000000000 1000000000 1"
results in "1000000000000000000".
But the automated checker returns:
Test: #9, time: 15 ms., memory: 0 KB, exit code: 0, checker exit code: 1, verdict: WRONG_ANSWERInput
1000000000 1000000000 1
Output
-1486618624
Answer
1000000000000000000
Checker Log
wrong answer 1st numbers differ - expected: '1000000000000000000', found: '-1486618624'
It works for the first 8 tests with small numbers, but fails on the 9th. I'm using gcc 11.4.0 on Ubuntu, 64 bit.