Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Satoshi Terasaki terasakisatoshi

🏠
Working from home
View GitHub Profile
View two_balls_create_pi.jl
using LinearAlgebra
using Plots
using ProgressMeter: @showprogress
Base.@kwdef mutable struct Ball
x::Float64
v::Float64
r::Float64 = 1.0
m::Float64 = 1.0
View MyDial.toml
[Large]
one = [
"largeone",
"++++++++",
"--------",
]
two = [
"largetwo",
@terasakisatoshi
terasakisatoshi / GhostREPL.jl
Created Nov 16, 2021
Need a ghostwriter for you?
View GhostREPL.jl
using Pkg
using Crayons
function clean(H)
buf = IOBuffer()
for i in 1:H
print(buf, "\x1b[2K") # clear line
print(buf, "\x1b[999D\x1b[$(1)A") # rollback
end
print(buf |> take! |> String)
View FakePTYs.jl
# This file is a part of Julia. License is MIT: https://julialang.org/license
module FakePTYs
if Sys.iswindows()
pushfirst!(LOAD_PATH, Sys.STDLIB)
using Sockets
popfirst!(LOAD_PATH)
end
View channel.jl
using Random
using ProgressMeter
function myproducer(ch::Channel, seed)
Random.seed!(seed)
while true
r = rand()
if r > 0.5
put!(ch, r)
else
@terasakisatoshi
terasakisatoshi / gaussian_process.ipynb
Created Oct 21, 2021
Regression using Gaussian Process
View gaussian_process.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@terasakisatoshi
terasakisatoshi / matrix_sqrt.ipynb
Created Oct 18, 2021
Gauss過程のやつで Cholesky factorization failed を回避する
View matrix_sqrt.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View GeometryRecipes.jl
module GeometryRecipes
using RecipesBase
using StaticArrays:FieldVector
using Random
# types
export Point2D, Point3D, Circle2D, Circle3D
struct Point2D{T} <: FieldVector{2,T}
@terasakisatoshi
terasakisatoshi / goma.json
Created Oct 10, 2021
Ctrl-M to Esc Karabiner-Element
View goma.json
{
"title": "rules for Jupyter on VSCode",
"rules": [
{
"description": "Ctrl-M to Esc",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "m",
@terasakisatoshi
terasakisatoshi / staticarrays_fieldvector.ipynb
Created Oct 3, 2021
StaticArrays.FieldVector in action
View staticarrays_fieldvector.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.