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, y = var('x y') | |
T = 7.5 | |
P = [] | |
for A in [-10,..,10]: | |
for B in [-10,..,10]: | |
P.append(implicit_plot(y^2==x^3+A*x+B, (x, -T, T), (y, -T, T))) | |
animate(P) |
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 <Wire.h> | |
#include <VirtualWire.h> | |
#define BMP180_I2C_Adress 0x77 //Usually 0x77 | |
//SCL at A4 | |
//SDA at A5 | |
int DataInPin = 4; //XY-MK-5V | |
int DataOutPin = 5; //XY-FST | |
int LEDsPin = 10; //LEDs strip |
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 <Wire.h> | |
#define BMP180_I2C_Adress 0x77 //Usually 0x77 | |
int p0 = 1013.25; //Pressure at sea level; used to calculate altitude | |
int i = 2; //Pressure precision setting: 0, 1, 2 or 3 (3 is broken right now. will fix.) | |
int AC1; | |
int AC2; | |
int AC3; | |
unsigned int AC4; |
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
# -*- coding: utf-8 -*- | |
import os, platform | |
from tkinter import * | |
from tkinter import filedialog, messagebox | |
from os import walk | |
from tkinter import ttk | |
from time import sleep | |
global pathconfig |
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
k = 27720 | |
llista = [] | |
while (k > 0): | |
if (k % 2 == 1): | |
llista.append("suma") | |
llista.append("dobla") | |
k = k//2 | |
print(llista) |
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 = 1997 #must be prime: defines the field Z/nZ | |
k = 720719 #the point (0, 1) is "multiplied" by k | |
coeff = 23 #coefficient of "x" in the elliptic curve | |
x, y = var('x y') | |
E = EllipticCurve(GF(n),[coeff,1]) | |
llistapunts = [] | |
frames = [] | |
tamany = 40 | |
marc = implicit_plot(x-y^3, (x, 0, n-1), (y, 0, n-1), color = 'white', gridlines = True) | |
tamanyextra = tamany + tamany//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
from random import randrange | |
from math import sqrt | |
def arrelsmod(x, n): | |
q = n-1 | |
e = 0 | |
while (q % 2 == 0): | |
q //= 2 | |
e += 1 | |
while(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 math import sqrt | |
N = 1997 | |
A = 59 | |
B = 23 | |
coords = [] | |
for x in range(N): | |
temp = (pow(x, 3, N) + A*x + B) % N | |
while (temp < 0): | |
temp += N | |
for i in range(N): |
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
void setup(){ | |
size(350, 350); | |
background(255,255,255); | |
textSize(26); | |
} | |
void arrow(int x1, int y1, float x2, float y2) { | |
line(x1, y1, x2, y2); | |
pushMatrix(); | |
translate(x2, y2); | |
float a = atan2(x1-x2, y2-y1); |
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 <vector> | |
#include <cmath> | |
#include <algorithm> | |
using namespace std; | |
struct punt{ | |
int x; | |
int y; | |
int z; | |
}; |