Skip to content

Instantly share code, notes, and snippets.

View legokichi's full-sized avatar
😇
neary heaven

Legokichi Duckscallion legokichi

😇
neary heaven
View GitHub Profile
@legokichi
legokichi / normalforms.md
Created July 27, 2020 08:04 — forked from qnighy/normalforms.md
いろいろな標準形

Jordan標準形 (Jordan normal form)

K:代数閉体, V:有限次元のK-線形空間, f : V → V 線形写像のとき、Vの基底を上手く選ぶと表現行列がJordanブロックを対角線上に並べた行列になる。

この標準形はJordanブロックの順列を除いて一意である。

計算方法1: 固有方程式を解き固有値を得る。(A-λI)x=0となるxを探す。(A-λI)y=xとなるyを探す。これを止まるまで繰り返すことで基底の一部が得られる。別の固有ベクトルや別の固有値に対しても同様のことを行う。

有理標準形 (Frobenius normal form)

@legokichi
legokichi / 1.md
Created January 31, 2020 22:31 — forked from ssig33/1.md
tweetdeck スクレイピング

Twitter のストリーミング API が滅亡した今、 tweetdeck をスクレイピング(?)するのが一番簡単に twitter の更新情報をリアルタイムに取得する方法だと思います。

ここではその方法を説明します。

1. puppeteer

puppeteer は極めて強力なソフトウェアで、本物の Chrome を使って簡単に Web サイトの操作を自動化したりスクレイピングしたりできます。

今回のような用途で特筆すべき点は、 puppeteer は Web アプリケーションの Ajax リクエストのレスポンスを横取りできる点です。以下に例を示します

Rust/Haskell: Higher-Kinded Types (HKT)

A higher kinded type is a concept that reifies a type constructor as an actual type.

A type constructor can be thought of in these analogies:

  • like a function in the type universe
  • as a type with a "hole" in it

Rust/Haskell: Higher-Kinded Types (HKT)

A higher kinded type is a concept that reifies a type constructor as an actual type.

A type constructor can be thought of in these analogies:

  • like a function in the type universe
  • as a type with a "hole" in it
@legokichi
legokichi / rust-patterns.md
Created January 10, 2020 20:11 — forked from qnighy/rust-patterns.md
Rustのパターンっぽいやつメモ

パターンとはその言語が抽象化できなかった敗北の歴史である。 しかしどんなに優れた言語であってもあらゆる繰り返しに勝てるわけではない。 人は必ずメタ繰り返しを欲するからだ。 そしてそれはRustも例外ではない。

ここでは、OOPでも知られているパターンよりも、Rustに特有のパターンを思いつく限りまとめてみた。名前は適当。

  • crate splitting
    • でかいcrateを分割して、見通しを良くする・再コンパイルの分量を削減する・並列コンパイルを可能にする
  • 親玉crate(全てにdependする)と殿crate(全てにdependされる)があることが多いので、だいたい束みたいな形になる。
@legokichi
legokichi / mqtt.rst
Created November 20, 2019 05:39 — forked from voluntas/mqtt.rst
MQTT とはなんだったのか

MQTT とはなんだったのか

更新:2017-05-09
作者:@voluntas
バージョン:3.14
URL:http://voluntas.github.io/

MQTT をググって調べた人向け

@legokichi
legokichi / async_await_cancellation.md
Created October 28, 2019 07:43 — forked from Matthias247/async_await_cancellation.md
Async/Await - The challenges besides syntax - Cancellation

Async/Await - The challenges besides syntax - Cancellation

This is the second article in a series of articles around Rusts new async/await feature. The first article about interfaces can be found here.

In this part of the series we want to a look at a mechanism which behaves very different in Rust than in all other languages which feature async/await support. This mechanism is Cancellation.

@legokichi
legokichi / 0_raft.md
Created October 17, 2019 03:34 — forked from sile/0_raft.md
Raft(分散合意アルゴリズム)について
@legokichi
legokichi / Algebra.purs
Created September 22, 2019 13:01 — forked from LukaJCB/Algebra.purs
Alternative Tagless Final encoding in PureScript
module Algebra where
import Prelude
import Control.Monad.Eff (Eff)
import Data.Maybe (Maybe(..))
newtype ConsoleAlg f = ConsoleAlg
{ printLn :: String -> f Unit
, readLn :: f String