This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<fstream> | |
#include<iostream> | |
#include<thread> | |
#include<string> | |
#include<cstdio> | |
void write(std::string filename, std::string message){ | |
std::ofstream f; | |
f.open(filename, std::ofstream::out | std::ofstream::app); | |
for (auto i = 0; i < 10; i++) { | |
f << filename << " " << message << std::endl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<fstream> | |
#include<vector> | |
#include<tuple> | |
#include<iostream> | |
#include<string> | |
#include<charconv> | |
#include<map> | |
#include<cmath> | |
#include<set> | |
#include<algorithm> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#include <iostream> | |
#include<utility> | |
#include<algorithm> | |
#include<fstream> | |
#include<thread> | |
#include<functional> | |
#include<array> | |
#include<vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<fstream> | |
#include<string> | |
#include<iostream> | |
#include<vector> | |
std::vector<std::string> split_string(std::string string_input, char delimeter) { | |
std::vector< std::string > split_strings; | |
std::string thing; | |
for (auto a: string_input){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import discord | |
from discord.ext import commands | |
import random | |
description = '''An example bot to showcase the discord.ext.commands extension | |
module. | |
There are a number of utility commands being showcased here.''' | |
bot = commands.Bot(command_prefix='?', description=description) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clang++ -c mat.cpp -o mat.o; | |
clang++ main.cpp mat.o; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import re | |
import msvcrt | |
import time | |
import sys | |
def birthday(string): | |
regex = re.compile("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})$") | |
a = regex.search(string) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from matplotlib import pyplot as plt | |
def generate_generic_kernel(bandwidth, kernel_type): | |
def u(x): return x/bandwidth - 1 # u normalizes the range of the kernel supports between [-1, 1] | |
kernels = { | |
'epanechnikov': lambda x: 3/4 * (1 - u(x)**2), | |
'triangular': lambda x: 1 - np.abs(u(x)), | |
'knn': lambda x: 1/2 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func TestPort(t *testing.T) { | |
s := a.CreateServer("9000") | |
defer s.Close() | |
go func() { | |
for { | |
var buf [512]byte | |
_, addr, _ := s.ReadFromUDP(buf[0:]) | |
s.WriteToUDP([]byte{1, 3, 3, 4, 5, 6, 4, 65, 4, 6, 4, 6, 4, 6, 3, 5, 3, 5, 5}, addr) | |
} | |
}() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package client | |
import ( | |
"fmt" | |
"testing" | |
a "../go_server" | |
) | |
func TestPort(t *testing.T) { |
NewerOlder