Skip to content

Instantly share code, notes, and snippets.

View codeboy101's full-sized avatar

Tushar codeboy101

View GitHub Profile
nameserver 127.0.0.53
sudo add-apt-repository ppa:embrosyn/cinnamon
sudo apt update && sudo apt install cinnamon
import numpy as np
def qr_decomposition(A):
if A.shape[0] != A.shape[1]:
return -1
U = [0 for i in range(A.shape[0])]
E = U
"""get columns"""
sudo rmmod i2c_hid
sudo modprobe i2c_hid
def smash_yogi(limit):
k = 0
current = 0
line_limit = limit
while line_limit > 0:
# check how many numbers printed vs maximum allowed for printing
if current < line_limit:
# we want all numbers of a sequence on the same line
print(limit+k, end=' ')
current += 1
import numpy as np
def gram_schmidt(vectors):
q1 = vectors[0]/np.linalg.norm(vectors[0])
result = [q1]
for b in vectors[1:]:
comp = b + rm_dupl_projctns(b, result)
result.append(comp/np.linalg.norm(comp))
return np.concatenate(result, axis=1)
import numpy as np
import pandas as pd
def normalize(data):
return data/data.mean()
def predict(x, weights):
hypothesis = np.dot(x, weights)
return hypothesis
from string import ascii_lowercase
code = {
'a':'b', 'b':'c', 'c':'d', 'd':'e', 'e':'f', 'f':'g', 'g': 'h', 'h': 'i', 'i': 'j', 'j': 'k', 'k' : 'l', 'l' : 'm',
'm' :'n', 'n' :'o', 'o': 'p', 'p':'q', 'q' : 'r', 'r': 's', 's': 't', 't' : 'u', 'u':'v', 'v': 'w', 'w':'x',
'x' : 'y', 'y' : 'z', 'z' : 'a', ' ': ' '
}
allowedchars = ascii_lowercase + ' '
def changer(a,b):
from string import ascii_lowercase
code = {
'a':'b', 'b':'c', 'c':'d', 'd':'e', 'e':'f', 'f':'g', 'g': 'h', 'h': 'i', 'i': 'j', 'j': 'k', 'k' : 'l', 'l' : 'm',
'm' :'n', 'n' :'o', 'o': 'p', 'p':'q', 'q' : 'r', 'r': 's', 's': 't', 't' : 'u', 'u':'v', 'v': 'w', 'w':'x',
'x' : 'y', 'y' : 'z', 'z' : 'a', ' ': ' '
}
allowedchars = ascii_lowercase + ' '
def changer(a,b):