This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding:utf-8 vi:ts=4:noexpandtab | |
# Simple RTSP server. Run as-is or with a command-line to replace the default pipeline | |
import time | |
import sys | |
import abc | |
import numpy as np | |
import typing as typ | |
from fractions import Fraction |
This file contains hidden or 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 constraint import Problem | |
problem = Problem() | |
problem.addVariable('x', range(1, 10)) | |
problem.addVariable('y', range(1, 10)) | |
problem.addVariable('z', range(1, 10)) | |
def constraintCheck(x, y, z): |
This file contains hidden or 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
p cnf 3 3 | |
1 -2 3 0 | |
1 2 -3 0 | |
-1 -2 3 0 |
This file contains hidden or 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 numpy as np | |
# ECC addition in R | |
def eccContAddition(Px, Py, Qx, Qy, a, b): | |
if np.isclose([Px], [Qx])[0]: | |
m = (3.*Px**2.+a)/(2.*Py) | |
else: | |
m = (Py-Qy)/(Px-Qx) | |
Rx = m**2 - Px - Qx |
This file contains hidden or 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
/* Sample Code for connecting to the V3 Secure API via Node | |
* | |
* With thanks to xiaojay of Niffler Wallet: | |
* https://github.com/grinfans/Niffler/blob/gw3/src/shared/walletv3.js | |
* | |
*/ | |
const http = require('http'); | |
const crypto = require('crypto'); |
This file contains hidden or 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 matplotlib.pyplot as plt | |
def plotQubit(angles, refrel, refimag, resrel, resimag, title, x_axis, filename, url=''): | |
fig, ax = plt.subplots(1, 1, constrained_layout=True) | |
ax.set_title(title) | |
x_axis += '\n' + url | |
ax.set_xlabel(x_axis) | |
ax.set_ylabel('phase') |


This file contains hidden or 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 Crypto.Cipher import AES | |
from getpass import getpass | |
ciphertext = None | |
with open('ciphertext3.txt', 'r') as file: | |
ciphertext = bytes.fromhex(file.read()) | |
password = getpass('Password: ') | |
key = bytes(password, 'ascii') | |
key = key + b'\x00'*(16-len(key)) |