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 | |
def taylor_asin(x): | |
return x + (x**3)/6 + 3*(x**5)/40 | |
def pade_sin(x): | |
return (166320*x - 22260*x**3 + 551*x**5)/(166320 + 5460*x**2 + 75*x**4) | |
def pade_cos(x): | |
return (15120 - 6900*x**2 + 313*x**4)/(15120 + 660*x**2 + 13*x**4) |
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 | |
def fastmul(u, m, u_order, phi_order=None): | |
q = np.imag(u) | |
if phi_order == 1: | |
phi = q | |
elif phi_order == 3: | |
phi = q + q**3/6 | |
elif phi_order == 5: | |
phi = q + q**3/6 + 3*q**5/40 |
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 vapoursynth as vs | |
core = vs.get_core() | |
ret = core.imwri.Read('jpg-50/%04d.jpg', firstnum=1, alpha=False) | |
ret = core.fmtc.matrix (clip=ret, mat="601", col_fam=vs.YUV, bits=16) | |
ret = core.fmtc.resample (clip=ret, css="444") | |
input = core.fmtc.bitdepth (clip=ret, bits=8) | |
superF1 = core.fft3dfilter.FFT3DFilter(input,sigma=100.5, bt=5, bw=32, bh=32, ow=16, oh=16, sharpen=0.1) |
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
addpath /home/dmitry/caffe/matlab | |
addpath /home/dmitry/caf | |
addpath /home/dmitry/caf/TVGP.v2.0/ | |
%model = '/home/dmitry/caffe/models/bvlc_reference_caffenet/deploy.prototxt'; | |
%weights = '/home/dmitry/caffe/models/bvlc_reference_caffenet/bvlc_reference_caffenet.caffemodel'; | |
model = '/home/dmitry/caffe/models/bvlc_googlenet/deploy.prototxt'; | |
weights = '/home/dmitry/caffe/models/bvlc_googlenet/bvlc_googlenet.caffemodel'; |
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 libc; | |
[T] | |
Z?(#T) { | |
var t = libc.getchar(); | |
var z = libc.fopen("/etc/passwd","r"); | |
libc.putchar(t); | |
libc.fclose(z); | |
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
#include "thinCore.h" | |
#define _USE_MATH_DEFINES | |
#include <math.h> | |
#include <stdio.h> | |
#include <iostream> | |
#include <fstream> | |
#include <assert.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
MatchResultPtr matchInvoke(OverloadPtr overload, | |
ObjectPtr callable, | |
llvm::ArrayRef<TypePtr> argsKey) | |
{ | |
initializePatterns(overload); | |
PatternReseter reseter(overload); | |
if (!unifyPatternObj(overload->callablePattern, callable)) | |
return new MatchCallableError(overload->target, callable); |
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 initializeLambda(LambdaPtr x, EnvPtr env) | |
{ | |
assert(!x->initialized); | |
x->initialized = true; | |
string lname = lambdaName(x); | |
llvm::SmallString<128> buf; | |
llvm::raw_svector_ostream ostr(buf); |
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
[lib-clay/printing/lambdas] | |
Failure: out.txt mismatch | |
Diff-Stdout: | |
--- out.txt | |
+++ stdout | |
@@ -1,8 +1,8 @@ | |
(x -> x) | |
-(x -> x + a) | |
+Lambda[(x -> x + a), Tuple[Pointer[Int32]]]([0x7fff4d1fe0ec]) |
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 core.values; | |
import vectors; | |
import sequences; | |
import sequences.operators; | |
import algorithms; | |
define fmap(f, a); | |
functor?(A) = CallDefined(fmap, f, A); | |
[S when Sequence?(S)] |