Skip to content

Instantly share code, notes, and snippets.

View bee-san's full-sized avatar
🌻
Tending to my plants

Autumn (Bee) bee-san

🌻
Tending to my plants
View GitHub Profile
from socket import *
serverPort = 12008 # large port number as not to interfer, still lower than 2^16-1
serverName = 'hostname'
serverSocket = socket(AF_INET, SOCK_STREAM)
# Makes it so it uses IPV4 and TCP
serverSocket.bind(('', serverPort))
# binds socket to server
serverSocket.listen(1)
N = 100:10:10000;
% creates a vector for N, the different values for the number of steps
error = zeros(size(N));
% creates an array to store the error in
for i=1:length(N)
S = planetsolve(1, 2, 1, N(i));
error(i) = abs(S(end) - 1);
end
% calculates modulus of R(2pi) - 1 for every value of N in vector above
@bee-san
bee-san / rainbow.py
Created December 30, 2015 22:54
Rainbow.py
#!/usr/bin/env python
import unicornhat as unicorn
import time, math, colorsys, random
print("Displaying the rainbows")
unicorn.brightness(0.3)
speed = 0.03
@bee-san
bee-san / meme.py
Last active October 7, 2017 20:22
a = input("") ; a = [int(x) for x in input().split()] ; H, B, L = [int(x) for i in a]
try:
L = float(input("Enter your length here: "));B = float(input("Enter your breadth here "));H = float(input("Enter height here "))
print((((2 * H) * (L + B) + (L * B) * 1.06 ) / (L*B)))
except:
while True:
print(1)
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
import tensorflow as tf
x = tf.placeholder(tf.float32, [None, 784])
def make_Dictionary(train_dir):
# where train_dir is the directory of the emails
emails = [os.path.join(train_dir,f) for f in os.listdir(train_dir)]
all_words = []
for mail in emails:
with open(mail) as m:
for i, line in enumerate(m):
if i == 2: # Body of email is only 3rd line of text file
words = line.split()
all_words += words
def make_Dictionary(train_dir):
# where train_dir is the directory of the emails
emails = [os.path.join(train_dir,f) for f in os.listdir(train_dir)]
all_words = []
for mail in emails:
with open(mail) as m:
for i, line in enumerate(m):
if i == 2: # Body of email is only 3rd line of text file
words = line.split()
all_words += words