Skip to content

Instantly share code, notes, and snippets.

View Kuo-TingKai's full-sized avatar
🏠
Working from home

Kuo Ting-Kai Kuo-TingKai

🏠
Working from home
View GitHub Profile
@chrissimpkins
chrissimpkins / ast2text.py
Created January 14, 2020 21:44 — forked from kylehowells/ast2text.py
Extract the plain text from markdown, for plain text search.
import commonmark
with open('test.md', 'r') as myfile:
text = myfile.read()
parser = commonmark.Parser()
ast = parser.parse(text)
# Returns the text from markdown, stripped of the markdown syntax itself
def ast2text(astNode):
@primaryobjects
primaryobjects / ghc-2019.md
Last active January 7, 2020 09:14
GHC19: Quantum Computing @ Grace Hopper Conference 2019

Quantum Computing @ Grace Hopper Conference 2019 GHC19

I had recently attended the Grace Hopper 2019 conference in Orlando, and had the opportunity to speak with researchers from IBMQ and Qiskit about the current state of quantum computing. Although, I did not get a chance to obtain a ticket to IBMQ's Universal Studios event at The Wizarding World of Harry Potter (the line was extremely long!), I still wanted to share some of the topics surrounding the emerging tech of quantum computing.

I spoke with Cihan Kurter, Research Scientist at IBM Watson, after her presentation titled, "Near-Term Applications of Quantum Computers", and asked, how exactly does the mysterious IBMQ qubit work?

IBMQ Quantum Computer

How does a qubit work?

@cerebrate
cerebrate / README.md
Last active February 6, 2025 00:37
Recompile your WSL2 kernel - support for snaps, apparmor, lxc, etc.

WARNING

THIS GIST IS EXTREMELY OBSOLETE. DO NOT FOLLOW THESE INSTRUCTIONS. SERIOUSLY.

IF YOU IGNORE THE ABOVE WARNING, YOU AGREE IN ADVANCE THAT YOU DIDN'T GET THESE INSTRUCTIONS FROM ME, THAT I WARNED YOU, AND THAT I RESERVE THE RIGHT TO POINT AND LAUGH MOCKINGLY IF AND WHEN SOMETHING BREAKS HORRIBLY.

I'll do a write-up of current custom-kernel procedures over on Random Bytes ( https://randombytes.substack.com/ ) one day soon.

NOTE

@kailaix
kailaix / wave.jl
Last active July 28, 2022 11:05
Example of 1D Wave Equation with Absorbing Boundary Condition
# solve 1D wave equation with ABC
using PyPlot
using Plots
using LinearAlgebra
N = 100
x = LinRange(-1.,1.,N+1)
Δx = x[2]-x[1]
NT = 200
@rmnshelest
rmnshelest / hott.md
Created November 27, 2018 20:02
Homotopy type theory in Python

https://abooij.github.io/wiwikwlhott/

  • univalence axiom
  • higher inductive types

"Both ideas are impossible to capture directly in classical set-theoretic foundations, but when combined in homotopy type theory, they permit an entirely new kind of "logic of homotopy types"." p13

invariance, homotopy

univalence foundations

@jw3126
jw3126 / so3.jl
Created October 5, 2018 12:51
Haar Measure of distance Ball SO(3)
# https://math.stackexchange.com/questions/1049788/haar-measure-of-an-angle-distance-ball-in-so3
using StatsBase
using LinearAlgebra
using StatPlots
using Plots
using Rotations
function sample_angles(N)
map(1:N) do _
@ArdWar
ArdWar / pen.m
Created October 12, 2016 13:23
WoWs Penetration calc
clear all; clc
% SHELL CONSTANTS %
C = 0.5561613; % PENETRATION
a = 9.81; % GRAVITY
T_0 = 288; % TEMPERATURE AT SEA LEVEL
L = 0.0065; % TEMPERATURE LAPSE RATE
p_0 = 101325; % PRESSURE AT SEA LEVEL
R = 8.31447; % UNIV GAS CONSTANT
M = 0.0289644; % MOLAR MASS OF AIR
@delta2323
delta2323 / brownian_bridge.py
Created March 13, 2016 11:23
Brownian Bridge sample code
#!/usr/bin/env python
import numpy
import six
from matplotlib import pyplot
seed = 0
N = 100
M = 10
@StuartGordonReid
StuartGordonReid / ApproximateEntropy.py
Last active April 7, 2024 11:19
Python implementation of the Approximate Entropy cryptographic test for randomness
def approximate_entropy(self, bin_data: str, pattern_length=10):
"""
Note that this description is taken from the NIST documentation [1]
[1] http://csrc.nist.gov/publications/nistpubs/800-22-rev1a/SP800-22rev1a.pdf
As with the Serial test of Section 2.11, the focus of this test is the frequency of all possible overlapping
m-bit patterns across the entire sequence. The purpose of the test is to compare the frequency of overlapping
blocks of two consecutive/adjacent lengths (m and m+1) against the expected result for a random sequence.
:param bin_data: a binary string
@StuartGordonReid
StuartGordonReid / BinaryMatrix.py
Created August 25, 2015 15:59
A Python class for computing the rank of a binary matrix. This is used by the Binary Matrix Rank cryptographic test for randomness
class BinaryMatrix:
def __init__(self, matrix, rows, cols):
"""
This class contains the algorithm specified in the NIST suite for computing the **binary rank** of a matrix.
:param matrix: the matrix we want to compute the rank for
:param rows: the number of rows
:param cols: the number of columns
:return: a BinaryMatrix object
"""
self.M = rows