Skip to content

Instantly share code, notes, and snippets.

7shi 7shi

Block or report user

Report or block 7shi

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
@7shi
7shi / katex.html
Created Feb 5, 2020
[はてなブログ] KaTeXのテスト
View katex.html
MathJax では [tex:c=\pm\sqrt{a^ 2+b^ 2}] です。
KaTeX では $c=\pm\sqrt{a^ 2+b^ 2}$ です。
<table><tr align="center"><th>MathJax</th><th>KaTeX</th></tr>
<tr>
<td><div align="center">[tex:\displaystyle{x=\frac{-b±\sqrt{b^2-4ac}}{2a}}]</div></td>
<td><div class="math-render">x=\frac{-b±\sqrt{b^2-4ac}}{2a}</div></td>
</tr><tr>
<td><div align="center">[tex:\displaystyle{f(x)=\frac1{\sqrt{2πσ^2}}\exp\left(-\frac{(x-μ)^2}{2σ^2}\right)}]</div></td>
<td><div class="math-render">f(x)=\frac1{\sqrt{2πσ^2}}\exp\left(-\frac{(x-μ)^2}{2σ^2}\right)</div></td>
@7shi
7shi / speech.html
Last active Feb 22, 2020
[はてなブログ] Speech Synthesis API のテンプレート
View speech.html
# 動作確認
音声の再生は環境に依存します。以下に選択肢が出ない言語は再生できません。
<span><style>
.voicelist { width: 100%; }
.speak {
border: solid 1px #767676;
border-radius: 3px;
background: #efefef;
@7shi
7shi / toki2kana.js
Last active Feb 5, 2020
[JavaScript] toki pona to kana converter
View toki2kana.js
// CC0 http://creativecommons.org/publicdomain/zero/1.0/
function convKana(c, v, pre, table) {
let ret = Object.create(pre);
let cc = c.split(" ");
for (let i = 0; i < cc.length; ++i) {
let ks = table[cc[i]].split(" ");
for (let j = 0; j < v.length; ++j) {
ret[cc[i] + v.charAt(j)] = ks[j];
}
@7shi
7shi / OctonionGamma.ipynb
Last active Jan 24, 2020
[Jupyter] generate gamma matrices by octonions
View OctonionGamma.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@7shi
7shi / ClifTensor.fsx
Last active Jan 7, 2020
[F#] Tensor product decomposition of Clifford algebra
View ClifTensor.fsx
let memoize (f: 'k -> 'v) =
let cache = System.Collections.Generic.Dictionary<'k, 'v>()
fun a ->
let b, v = cache.TryGetValue a
if b then v else
let ret = f a
cache.[a] <- ret
ret
let curry f = fun a b -> f(a, b)
@7shi
7shi / ClifEven.fsx
Last active Jan 16, 2020
[F#] Clifford even subalgebra
View ClifEven.fsx
let memoize (f: 'k -> 'v) =
let cache = System.Collections.Generic.Dictionary<'k, 'v>()
fun a ->
let b, v = cache.TryGetValue a
if b then v else
let ret = f a
cache.[a] <- ret
ret
let curry f = fun a b -> f(a, b)
@7shi
7shi / 1.fs
Created Oct 15, 2019
[F#] Fable + KaTeX
View 1.fs
open System
open Fable.Core
open Fable.Core.JsInterop
open Browser.Types
open Browser
// ref. https://medium.com/@zaid.naom/f-interop-with-javascript-in-fable-the-complete-guide-ccc5b896a59f
[<Emit("convert($0, $1)")>]
let render output (input:string): unit = jsNative
@7shi
7shi / 1.fs
Last active Oct 15, 2019
[F#] Fable + MathJax
View 1.fs
open System
open Fable.Core
open Fable.Core.JsInterop
open Browser.Types
open Browser
// ref. https://medium.com/@zaid.naom/f-interop-with-javascript-in-fable-the-complete-guide-ccc5b896a59f
[<Emit("convert($0, $1)")>]
let render output (input:string): unit = jsNative
@7shi
7shi / Bessel.ipynb
Last active Sep 24, 2018
Reverse Bessel Polynomial
View Bessel.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@7shi
7shi / Harmony.ipynb
Last active Aug 16, 2018
調和微分形式とスカラーポテンシャル
View Harmony.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.