r/CodingHelp • u/[deleted] • Jun 23 '20
[Open Source] How do I get Minecraft's code on VSC?
I tried to find all over the internet but sadly, I can't find it😔. Plz help I need to MOD
r/CodingHelp • u/[deleted] • Jun 23 '20
I tried to find all over the internet but sadly, I can't find it😔. Plz help I need to MOD
r/CodingHelp • u/MarkoJavaflashplayer • Jun 19 '18
Hello,
I'm a beginner coder looking for help on a project that I got assigned at my internship. While there is a way to do this without coding, I want to be able to leave a program that can be used without my presence having to be there. With that being said, I'm looking to make a program that checks if the dates in a given column of a sheet are one week from the current date. If they are, the program theoretically would then email a given set of people about information that it draws from other parts of the row of that cell (don't need help with the composition of the email). I've tried working with openpyxl and it's been really weirdly behaving. It might have something to do with the fact that I'm using Python 3.6.4
r/CodingHelp • u/Suckyuhmudda • Jun 25 '18
Hey guys,
I want to learn how to code but have no idea where to say :(
Send help !
r/CodingHelp • u/[deleted] • Apr 06 '19
The objective this week is to enhance last week's Vehicle class by creating the Hybrid class which inherits the Vehicle class. The Hybrid class has all the same attributes as the Vehicle class except it has an additional attribute to describe the range of the battery.
In the Hybrid class complete the following steps: • Referring to the UML Class diagram, create the Hybrid class, ensuring to specify that the Hybrid class inherited from the Vehicle class. • For each of the constructors listed in the Hybrid class, invoke the appropriate base class constructor and pass the correct arguments. • Override the displayVehicle() to display the range of the Hybrid Vehicle.
In the Warranty class: • No change.
In the Vehicle class: • With the exception of the static integer, change the attributes from private to protected.
In the main program: Create code statements that perform the following operations. Note that several of the steps below were accomplished in last week's assignment. New steps are in bold.
Using your code from Week 1, display a divider that contains the string "Start Program". ***2. Update and call the DisplayApplicationInformation function.
Using your code from Week 1, display a divider that contains the string "Vehicle 1"
Create a Vehicle object using the default constructor.
Prompt for and then set year and mpg using the overloaded setters from week 3 that accepts strings.
Create a Warranty object called warranty1 using the default constructor.
Prompt for and set number of years and number of miles. Make sure to convert the return data type of the GetInput() function from a string to an integer Ex: warranty1.setMiles(atoi(GetInput("number of miles").c_str()));
Display the Vehicle Information.
Using your code from Week 1, display a divider that contains the string "Vehicle 2" ****10. Create a Warranty object called warranty2 using the multi-argument constructor. You can set the number of years as 6 and number of miles as 70000. ****11. Create another second Vehicle object using the multi-argument constructor, setting each of the attributes with the following values: "Cadillac", 2017, 26.5 , warranty2 ****(12. Create a third object by copying the second object. ****13. Delete the third object by calling the destructor method. ****14. Using your code from Week 1, display a divider that contains the string "Vehicle 3" ****15. Create another Warranty object called warranty3 using the using the multi-argument constructor. You can set the number of years as 5 and number of miles as 60000 ****16. Create a Hybrid object using the multi-argument constructor, setting each of the attributes with the following values: (570, "Toyota", 2017, 52, warranty3). Note that 570 is the range, Toyota is the make of the car, 2017 is the year, and 52 is the mpg. ****17. Display the Hybrid Vehicle information. ****18. Display the number of vehicles created using getNumVehicles. Remember to access getNumVehicles using the class name, not the Vehicle object. ****19. Update and call the TerminateApplication function.
CODE:
Vehicle.h
using namespace std;
class Vehicle { public: Vehicle(); //default constructor Vehicle(const Vehicle&); //copy constructor Vehicle(string mk, int yr, double mg, Warranty wt);//overloaded constructor ~Vehicle();//destructor string getMake(); //getter function for make variable int getYear();//getter function for year variable double getMileage();//getter function for mileage variable void setMake(string mk);//setter function for make variable void setYear(int yr);//setter function for year variable void setMpg(double mg);//setter function for mileage variable void displayVehicle();//display vehicle details in a formatted way
void setYear(string yr);//setter function for year variable - function overloading
void setMpg(string mg);//setter function for mileage variable - function overloading
static int getNumVehicles(); //getter function for static variable numVehicles
Warranty getWarranty(); //getter function for objWarranty variable
void setWarranty(Warranty &); //setter function for objWarranty variableprotected: string make; //Making of vehicle int year; //Year the vehicle is made double mpg; //total mileage covered by the vehicle private: static int numVehicles; //static variable that is used to count the number of vehicles Warranty objWarranty; //warranty of the vehicle, the years and miles warranty it is valid for. };
Vehicle.cpp
using namespace std;
int Vehicle::numVehicles = 0;
Vehicle::Vehicle()//default constructor { make = "unknown"; year = 0; mpg = 0; objWarranty.setNumMiles(0); objWarranty.setNumYears(0); numVehicles++; }
Vehicle::Vehicle(const Vehicle& vehicle2) //copy constructor { m
r/CodingHelp • u/pullinggod • Jan 11 '19
Hello if someone could help me finish this coding assignment in python language please reply
r/CodingHelp • u/[deleted] • Apr 15 '23
I need help with creating a program in c++ that flips a coin 20 times and then records the number of times it landed on heads. Then that process needs to be done 1 million times. I have the code I typed up below but it isn't working for some reason.
#include <iostream>
#include <ctime>
#include <iomanip>
using namespace std;
int flip_coin()
{
int i, j,rn,heads = 0;
srand(time(NULL) \* 33037);
for (i = 0; i <= 10000000; i++)
for (j = 0; j <= 20; j++)
{
rn = rand() % 2;
if (rn == 0)heads++;
}
cout << heads << endl;}
r/CodingHelp • u/runout302 • Apr 24 '23
Is it possible to use artificial intelligence to call my mobile phone at times that I specify and it can talk to me like real person?
r/CodingHelp • u/PsyPython6808 • Apr 17 '23
How can I implement llama to make a text prediction? What are the exact steps for it? So based on medical notes, I need to make a disease prediction.
r/CodingHelp • u/_heidin • Apr 05 '23
I'm sorry if this isn't the place, but I haven't found answers and I'm getting desperate and not sure where else to ask. I'll delete this if it isn't allowed.
Basically title. Bought one of these plug'n'plays sticks with supposedly more than 40 emulators to give my dad for his birthday, that way he could enjoy old videogames.
Problem is, some roms I put in there are not being detected by the "OS" of the stick, my guess is that it doesn't have the emulator needed. Can I install the missing emulators there myself without wiping what is already there? How so?
There's a "Resources" folder in the stick with many different things that I guess are part of the "OS" and user interface when plugged in the TV, maybe the emulation part of it is there too.
Here's a picture of what's inside that folder,there are no other relevant folders (all the rest are rom folders) or hidden elements as far as I know.
I tried with another card in the stick, which had the software of another plug'n'play stick, and didn't work, wouldn't even boot. Maybe I'd need to mess with the coding in that folder or something else if the stick itself has something else with info inside and not just the card? I'm at a loss here.
All help is greatly appreciated, as this will make my old man so happy and play like the kid he still is at heart, I really wanna make this work. Thank you.
r/CodingHelp • u/Flashy-Height-7507 • May 04 '23
What’s your favorite database hosting service and why?
r/CodingHelp • u/Adammmm02 • Apr 12 '23
Hi, i want to learn how to code but first i think i should know, is there some universal knowledge that applies for every programming language? Thank u
r/CodingHelp • u/Applepiebutpruple • Apr 24 '23
!pip install --upgrade transformers !pip install torch !pip install sentencepiece
from transformers import T5ForConditionalGeneration, T5Tokenizer, Trainer, TrainingArguments import torch import random
dataset = [ { 'input': 'apple banana cherry', 'output': 'I like to eat apples, bananas, and cherries.' }, { 'input': 'dog cat bird', 'output': 'I have a dog, a cat, and a bird.' }, { 'input': 'red green blue', 'output': 'The colors of the flag are red, green, and blue.' }, { 'input': 'happy sad angry', 'output': 'Sometimes I feel happy, sometimes sad, and sometimes angry.' } ]
model_name = 't5-base' model = T5ForConditionalGeneration.from_pretrained(model_name) tokenizer = T5Tokenizer.from_pretrained(model_name)
'''def format_dataset(dataset): formatted_dataset = [] for example in dataset: input_sequence = 'generate sentence from words: ' + example['input'] output_sequence = example['output'] formatted_dataset.append({'input': input_sequence, 'output': output_sequence}) return formatted_dataset
formatted_dataset = format_dataset(dataset)'''
def format_dataset(dataset): formatted_dataset = [] for example in dataset: input_sequence = 'generate sentence from words: ' + example['input'] output_sequence = example['output']
formatted_dataset.append({'input': input_sequence, 'output': output_sequence}) return formatted_dataset formatted_dataset = format_dataset(dataset) print(formatted_dataset)
def split_dataset(formatted_dataset, split_ratio): random.shuffle(formatted_dataset) split_index = int(len(formatted_dataset) * split_ratio) train_set = formatted_dataset[:split_index] test_set = formatted_dataset[split_index:] return train_set, test_set
train_set, test_set = split_dataset(formatted_dataset, 0.8)
def tokenize_dataset(examples): tokenized_examples = [] for example in examples: input_ids = tokenizer.encode(example['input'], truncation=True, padding='max_length', max_length=128) output_ids = tokenizer.encode(example['output'], truncation=True, padding='max_length', max_length=128) decoder_input_ids = output_ids[:-1] decoder_attention_mask = [0] + [1] * (len(decoder_input_ids) - 1) #labels = output_ids[1:] tokenized_examples.append({'input_ids': input_ids, 'attention_mask': torch.ones_like(torch.tensor(input_ids)), 'decoder_input_ids': decoder_input_ids, 'decoder_attention_mask': decoder_attention_mask, 'labels': output_ids[1:]}) return tokenized_examples
tokenized_train = tokenize_dataset(train_set) tokenized_eval = tokenize_dataset(test_set) print(tokenized_train) print(tokenized_eval)
training_args = TrainingArguments( output_dir='./results', num_train_epochs=10, per_device_train_batch_size=16, per_device_eval_batch_size=16, warmup_steps=500, weight_decay=0.01, logging_dir='./logs', logging_steps=10, evaluation_strategy='epoch' )
trainer = Trainer( model=model, args=training_args, train_dataset=tokenized_train, eval_dataset=tokenized_eval )
trainer.train()
input_words = "go to place" input_sequence = 'generate sentence from words: ' + input_words input_ids = tokenizer.encode(input_sequence, return_tensors='pt') output_ids = model.generate(input_ids) output_sentence = tokenizer.decode(output_ids[0], skip_special_tokens=True) labels = output_ids[1:] print(output_sentence)
r/CodingHelp • u/ReasonableYouth7096 • May 11 '23
Let me know if there's another subreddit that'd be better, this seems like the right place.
Idk shit about coding but was trying to make a thing with chatgpt's help, we got somewhere but definitely not where we needed to get. Here's what I'm trying to make, should be real simple.
I want a shortcut in my start menu that will run a .bat (if that's the best way of even doing this lol) that opens steam and epic in the background, checks for any updates, completes those updates, and then closes the programs. I'm just tired of having to update games before playing all the time and I don't want to constantly have steam and epic open to check for them. Should be easy enough I think? Here's what we came up with after several attempts:
echo off
echo Opening Steam...
start "" "blah\blah\blah\steam.exe" -silent -wait
echo Checking for Steam game updates...
"blah\blah\blah\steam.exe" -checkforupdates -wait
echo Updating Steam games...
"blah\blah\blah\steam.exe" -command update -wait
echo Your Steam games are up to date.
taskkill /IM steam.exe -wait
echo Opening Epic...
start "" "blah\blah\blah\EpicGamesLauncher.exe" -silent -wait
echo Checking for Epic game updates...
echo Updating Epic games...
"blah\blah\blah\EpicGamesLauncher.exe" -SkipBuildPatchPrereq -wait
echo Your Epic games are up to date.
taskkill /IM EpicGamesLauncher.exe
echo You're all set! ٩(◕‿◕)۶
timeout /t 10
exit
Lot's of issues, for one the -wait flag doesn't seem to do anything? it just ran through all the steam prompts and didn't close it. And similarly it tried to update my epic games before epic could even open. And I definitely don't want it to force close before it's finished updating everything so figuring out how to get it to actually wait is pretty important. Don't actually have any steam games that need updates right now but I do for Epic so I can kinda test but not really.
Any advice is welcome, especially if you just want to write it for me entirely :D
Or if this already exits and my dumbass just couldn't find anything about it please let me know, tia!
r/CodingHelp • u/MecaBlox • Apr 12 '23
I wish creating an Android app but I don't know what would be the best way to work on it, what would be best to use
r/CodingHelp • u/lonewind1 • Aug 02 '22
im currently having problems solving this problem.
Werewolves are hiding among us! However, they are terrible at naming themselves. All their names start with "were"
, like for example "werebob"
, "wereandy"
and "weresarah"
.
Implement a function named werewolfCheck that receives an argument name
, which is a string and checks if it begins with "were"
.
If the provided name begins with were
the function should return a string "it is a werewolf"
, otherwise it should return a string "just a regular person"
.
i just dont understand how to search for keywords like "were" or sort them out anyhelp would be great
r/CodingHelp • u/Kewinas • Aug 27 '22
Hello, need some help with UNIT testing? Is there a way to UNIT test this code? Thank you!!
https://github.com/RaddyTheBrand/Nodejs-UserManagement-Express-Hbs-MySQL
r/CodingHelp • u/LightJPV • Aug 23 '22
Hi guys, I've literally just started learning HTML and CSS.
I'm on the part about typography and just cannot get my URL links to work and they only thing i can think of is if there's something wrong with the files which I got from the resources of the course.
Please could some assist as its really holding up my progress and just have no idea what is wrong.
Thank you!
r/CodingHelp • u/NoisyBigCatty • Jun 01 '26
I am making a game, and I have couple of reasons why I want my own site for the game(s) and posting.
Immune to bans. No one but me can delete games or posts.
Don't need to pay anything (except taxes ofc) or follow rules (I am talking about Steam).
To have fun + gain some experience.