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 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'])) |
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 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 = ""; |
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 <stdio.h> | |
int main() { | |
printf("Hello World!"); | |
return 0; | |
} |
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 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: |
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 <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;} | |
} |
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> | |
#include <cmath> | |
#include <vector> | |
using namespace std; | |
int main(int argc, char const *argv[]) | |
{ | |
bool flag; | |
int 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
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'] |
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 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): |
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 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): |
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
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)) |
NewerOlder