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 RPi.GPIO as GPIO | |
import datetime as dt | |
class motor(): | |
x = 0 | |
v = 0.87654321 | |
def __init__(self): | |
GPIO.setmode(GPIO.BOARD) | |
GPIO.setup(7, GPIO.OUT, initial=GPIO.HIGH) | |
GPIO.setup(11, GPIO.OUT, initial=GPIO.HIGH) |
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 <chrono> | |
#include <math.h> | |
using namespace std; | |
bool isPrime(int n){ | |
for (int i = 1; ++i <= floor(sqrt(n));){ | |
if (n % i == 0) return false; | |
} | |
return 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
function get_single_template() { | |
$object = get_queried_object(); | |
$id = get_queried_object_id(); | |
$templates = array(); | |
if ( $object ) | |
$templates[] = "single-{$object->post_type}.php"; | |
if ( $id ) | |
$templates[] = "single-$id.php"; |
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 <functional> | |
#include <math.h> | |
using namespace std; | |
double integrate(function<double(const double x)> f, double a, double b, int n) | |
{ | |
double h = (b-a)/n; | |
double s = f(a)+f(b); | |
for(int i=1; i<n; i+=2) |
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 collatz(x): | |
max_x = 0 | |
n = 0 | |
while True: | |
if max_x < x: | |
max_x = x; | |
if x == 1: | |
break |
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 collatzw(x): | |
n = 0 | |
coll = open('collatz/plots/cplot_'+str(x)+'.dat','w') | |
coll.write(' 0 0 \n') | |
while True: | |
if x == 1: | |
break | |
else: | |
n += 1 |