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 math import sqrt, log10 | |
from scipy.io import loadmat | |
from sklearn.linear_model import LinearRegression | |
from matplotlib import pyplot as plt | |
import seaborn as sns | |
""" | |
This code can be found on GitHub using the link below | |
https://git.io/vH2um |
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
natures = { | |
"Adamant": | |
{"increased": "Attack", | |
"decreased": "Sp. Atk"}, | |
"Bashful": | |
{"increased": None, | |
"decreased": None}, | |
"Bold": | |
{"increased": "Defense", | |
"decreased": "Attack"}, |
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 main | |
import ( | |
"bytes" | |
"fmt" | |
"strconv" | |
"sync" | |
) | |
type Matrix struct { |
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 matrix | |
import "math" | |
func Pad(m Matrix) Matrix { | |
println("old width", m.width) | |
newDim := int(math.Pow(2, float64(int(math.Log2(float64(m.width-1))+1)))) | |
println(newDim, "dab") | |
retMat := Empty(newDim, newDim) | |
for i := range retMat.values { |
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 main | |
import "fmt" | |
func main() { | |
fmt.Println("This is some sample code") | |
} |
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 main | |
import( | |
"fmt" | |
"log" | |
"golang.org/x/crypto/ssh/terminal" | |
"bufio" | |
"os" | |
"bytes" | |
) |
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<iostream> | |
struct GameOfLife { | |
static const int xdim = 10, ydim = 10; | |
bool grid[xdim][ydim]; | |
int turns; | |
int getNeighbors(int x, int y) { | |
if (x == 0) { // Left edge | |
if (y == 0) // Top Left Corner | |
return grid[0][1] + grid[1][1] + grid[1][0]; | |
if (y > 0 && y < ydim-1) // Left Edge |
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) { |
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
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 | |
} |
OlderNewer