Skip to content

Instantly share code, notes, and snippets.

View dsouzadyn's full-sized avatar
♟️
Am I just a pwn ;)

Dylan Dsouza dsouzadyn

♟️
Am I just a pwn ;)
View GitHub Profile
import pandas as pd
import numpy as np
from sklearn.datasets import make_friedman2
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.gaussian_process.kernels import DotProduct, WhiteKernel
df = pd.read_csv('./data.csv')[:200]
X = np.atleast_2d(pd.to_numeric(df['Ephemeris time']))
y = np.atleast_2d(pd.to_numeric(df['x1']))
import java.util.Scanner;
public class CaesarCipher
{
public static final String ALPHABET = "abcdefghijklmnopqrstuvwxyz";
public static String encrypt(String plainText, int shiftKey)
{
plainText = plainText.toLowerCase();
String cipherText = "";
#include <stdio.h>
int main() {
printf("Hello World!");
return 0;
}
@dsouzadyn
dsouzadyn / take_a_break.py
Created June 27, 2017 07:11
Udacity mini
import webbrowser
import time
def main():
total_breaks = input('Type in the number of breaks: ')
fav_video = raw_input('Paste your favorite video link here: ')
break_count = 0
print 'Program started at ' + time.ctime()
while break_count < total_breaks:
#include <bits/stdc++.h>
#define gc getchar_unlocked
using namespace std;
void scanint(unsigned long &x)
{
register unsigned long c = gc();
x = 0;
for(;(c<48 || c>57);c = gc());
for(;c>47 && c<58;c = gc()) {x = (x<<1) + (x<<3) + c - 48;}
}
@dsouzadyn
dsouzadyn / not_sieve.cc
Created May 26, 2017 08:35
Calculate primes between 'n' and 'm'. Such that n - m = 100000
#include <iostream>
#include <cmath>
#include <vector>
using namespace std;
int main(int argc, char const *argv[])
{
bool flag;
int T;
from .datasets.zoo.data_zoo import *
import tensorflow as tf
n_inputs = 16
n_hidden_1 = 512
n_hidden_2 = 256
n_classes = 7
data = get_zoo_data()
features = data['f']
import unittest
from complex import Complex
class ClockTest(unittest.TestCase):
# Test creating a complex number
def test_creating_complex_one(self):
self.assertEqual('58.00-1.00i', str(Complex(58, -1)))
def test_creating_complex_two(self):
import unittest
from complex import Complex
class ClockTest(unittest.TestCase):
# Test creating a complex number
def test_creating_complex_one(self):
self.assertEqual('58.00-1.00i', str(Complex(58, -1)))
def test_creating_complex_two(self):
class Complex:
def __init__(self, a = 0, b = 0):
self.a = a
self.b = b
def __repr__(self):
if self.b >= 0:
return '{:0.2f}+{:0.2f}i'.format(self.a, self.b)
else:
return '{:0.2f}-{:0.2f}i'.format(self.a, abs(self.b))