I hereby claim:
- I am tehrengruber on github.
- I am tehrengruber (https://keybase.io/tehrengruber) on keybase.
- I have a public key whose fingerprint is 675A 2D63 6334 66F9 E5E6 BDD1 D07E 4BB3 AF4C 76E3
To claim this, I am signing this object:
# open a subtitle file (typically srt format) from src, shift the time by Δt and write it to dest | |
Δt = Dates.Second(0) | |
src = "" | |
dest = "" | |
subs = readall(src); | |
new_subs = replace(subs, r"(\d+):(\d+):(\d+),(\d+)", | |
(match) -> begin | |
time_point = DateTime(match, "H:M:S,s")-Δt | |
@sprintf "%02d:%02d:%02d,%03d" Dates.hour(time_point) Dates.minute(time_point) Dates.second(time_point) Dates.millisecond(time_point) |
#include <type_traits> | |
#include <dune/common/fvector.hh> | |
#include <dune/common/fmatrix.hh> | |
#include <Eigen/Dense> | |
namespace NPDE15 { | |
template <class T1, class T2, class Enable = void> | |
struct Convert{}; | |
/* |
A=rand(20) | |
[A[ceil(step*i)+1:floor(step*(i+1)-0.1)+1] for i=0:parts-1, step=length(A)/parts] |
I hereby claim:
To claim this, I am signing this object:
# given some code | |
code = """ | |
for(int i=0; i<10; ++i) { | |
a=2 | |
} | |
""" | |
# turn code into an array of tokens | |
# write a function tokenize(code) using https://www.lysator.liu.se/c/ANSI-C-grammar-y.html | |
# and https://github.com/iamed2/PyLexYacc.jl that allows you to do this |
immutable Bla{A} | |
end | |
a() = Bla{3*2} | |
@code_warntype a() |
template<typename T, typename Arch, typename DomainDescriptor, typename Order> | |
void export(py::class_<gridtools::ghex::structured::regular::field_descriptor<T, Arch, DomainDescriptor, Order>>> cls) { | |
// add bindings to cls | |
// ... | |
} | |
using orders = gridtools::meta::list<int_tuple_constant<0, 1, 2>, int_tuple_constant<2, 1, 0>>; | |
GHEX_PYBIND11_EXPORT_TYPE(gridtools::ghex::structured::regular::field_descriptor, | |
ghex4py::type_list::architecture_types, |
@stencil | |
def flux_x(phi): | |
return flux(phi[I - 1], phi) | |
@stencil | |
def flux_y(phi): | |
return flux(phi[J - 1], phi) | |
@stencil | |
def step(phi, fx, fy, dx, dy, dt): |
def laplacian(grid: Grid, f: Field[I, J, K, Matrix[3, 3, dtype]]): | |
def stencil((i, j, k), m): | |
return l2_norm(m @ [1, 2, 3]) | |
#def stencil(i, j, k, val): | |
# if (i, j, k) in grid[(I, J, K), "interior"]: | |
# return -4*f[i, j, k]+f[i-1, j, k]+f[i+1, j, k]+f[i, j-1, k]+f[i, j+1, k] | |
# else: | |
... | |
#return Field(f.domain, stencil) |