Skip to content

Instantly share code, notes, and snippets.

Takafumi Arakaki tkf

Block or report user

Report or block tkf

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View transducers.py
from dataclasses import dataclass
from typing import Any
import trio
async def start_cancelable(nursery, async_fn, *args):
async def launcher(task_status):
with trio.CancelScope() as scope:
task_status.started(scope)
View transduction.jl
using Transducers
using Transducers: R_, wrap, Unseen, xform, inner, wrapping, wrap, unwrap
import Transducers: start, next, complete
struct TransductionBuffer
buffer::Vector{Any}
end
Base.iterate(itr::TransductionBuffer, ::Any = nothing) =
if isempty(itr.buffer)
View pr_project.jl
const USAGE = """
julia $PROGRAM_FILE PATH/TO/gen_project.jl REMOTE PROJECT [PROJECT...]
REMOTE
A Git remote repository to be pushed (e.g., origin). It is
assumed to be the same for all PROJECTs.
PROJECT
A path to the Git repository of a Julia package.
"""
View Makefile
JULIA ?= julia
JULIA_CMD = $(JULIA) --color=yes --startup-file=no
instantiate:
$(JULIA_CMD) --project=. -e "using Pkg; Pkg.instantiate()"
View bug.jl
using Test
module SparseXX
const VE = Base.VecElement
struct Vec{N,T}
elts::NTuple{N,T}
end
View index.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View simplemul.jl
function simplemul!((β₁, Y, β₂), α₁, A, α₂, B, α₃)
@assert size(Y, 1) == size(A, 1)
@assert size(Y, 2) == size(B, 2)
@assert size(A, 2) == size(B, 1)
@inbounds for i in 1:size(A, 1), j = 1:size(B, 2)
acc = zero(α₁ * A[i, 1] * α₂ * B[1, j] * α₃ +
α₁ * A[i, 1] * α₂ * B[1, j] * α₃)
for k = 1:size(A, 2)
acc += A[i, k] * α₂ * B[k, j]
end
You can’t perform that action at this time.