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 <unistd.h> | |
#include <mach/mach.h> | |
#include <mach/mach_vm.h> | |
#include <mach/mach_error.h> | |
#include <mach/mach_init.h> | |
#include <mach/mach_types.h> | |
#include <mach/mach_traps.h> | |
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 re | |
def parse_memory_string(mem_str): | |
""" | |
Returns the number of bytes represented by a string ``mem_str`` matching the following | |
regex: :: | |
r'^(0|[1-9][0-9]*) (byte|bytes|KiB|MiB|GiB|TiB)' | |
If ``mem_str`` does not match this regex, then ``None`` is returned. |
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
require('nn') | |
require('nngraph') | |
local m | |
do | |
local x1, x2 = nn.Identity()(), nn.Identity()() | |
local y = nn.Bilinear(2, 2, 2){x1, x2} | |
m = nn.gModule({x1, x2}, {y}) | |
end |
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 sympy import Symbol, init_printing | |
from sympy.solvers import solve | |
from IPython.display import display | |
init_printing() | |
x1 = Symbol('x1') | |
x2 = Symbol('x2') | |
y = Symbol('y') |
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 numpy as np | |
np.set_printoptions(precision=3, linewidth=200) | |
a = np.random.normal(size=(3, 3)) | |
q, _ = np.linalg.qr(a) | |
print(np.matmul(q, q.T)) | |
s = np.fft.fft2(q) | |
print(np.matmul(s, s.conj().T)) |