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
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) |
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
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 |
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
#!/usr/bin/env python | |
import unicornhat as unicorn | |
import time, math, colorsys, random | |
print("Displaying the rainbows") | |
unicorn.brightness(0.3) | |
speed = 0.03 |
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
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) | |
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
from tensorflow.examples.tutorials.mnist import input_data | |
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) |
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
from tensorflow.examples.tutorials.mnist import input_data | |
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) |
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 tensorflow as tf |
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
x = tf.placeholder(tf.float32, [None, 784]) |
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
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 |
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
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 |