What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-14 21:49:02
discord.js ticket system
const discord = require("discord.js"); module.exports.run = async (bot, message, args) => { // ID from the catogory channel tickets. const categoryId = "644626077704257546"; // Get username var userName = message.... Add solution -
Python 2021-09-13 23:46:01
python make txt file
file = open("text.txt", "w") file.write("Your text goes here") file.close() 'r' open for reading (default) 'w' open for writing, truncating the file first 'x' open for exclusive creation, failing if the file already exists... Add solution -
C# 2021-09-10 12:15:03
10 random numbers unity
void Start(){ //having an int Array of 10 members int [] numbers = new int[10]; //using a string variable to keep record of the used numbers string usedNumbers ="-"; //cycle to get 10 random numbers for (int i = 0 ; i<10; i++) {... Add solution -
SQL 2021-09-10 11:55:03
how to take backup of mysql database using python
#!/usr/bin/python ########################################################### # # This python script is used for mysql database backup # using mysqldump and tar utility. # # Written by : Rahul Kumar # Website: http://tecadmin.net # Created date: De... Add solution -
C++ 2021-09-09 04:29:02
run time calculator c++
#include <iostream> #include <fstream> #include "header.h" #include <queue> #include <bitset> using namespace std; bool checkInputFile(ifstream &input) { //checking if the file is found and opened or not. if (!inp... Add solution -
Python 2021-09-07 00:07:03
how to use str()
#Use str() to convert a non string value into one #Example: VariableToConvert = 1 VariableAsAString = str(VariableToConvert) #We can see that VariableAsAString is a string if we try do to operations on it. #The result of trying an operation it would be: T... Add solution -
Python 2021-09-06 11:13:04
w+ mode in python
r for reading r+ opens for reading and writing (cannot truncate a file) w for writing w+ for writing and reading (can truncate a file) rb for reading a binary file. The file pointer is placed at the beginning of the file. rb+ reading or writing a binary f... Add solution -
Python 2021-08-31 19:30:02
types of dict comprehension
# Dictionary Comprehension Types {j:j*2 for i in range(10)} #using if {j:j*2 for j in range(10) if j%2==0} #using if and {j:j*2 for j in range(10) if j%2==0 and j%3==0} #using if else {j:(j*2 if j%2==0 and j%3==0 else 'invalid' )for j in range(10) } Add solution