Skip to content

Instantly share code, notes, and snippets.


Mice Super ekd123

View GitHub Profile

Keybase proof

I hereby claim:

  • I am ekd123 on github.
  • I am ekd123 ( on keybase.
  • I have a public key whose fingerprint is EB9B 2ABA 008A B0C5 5590 A315 9BE0 1CF3 26ED A05F

To claim this, I am signing this object:

ekd123 /
Created October 2, 2014 14:38
a Rational class implementation which corresponds to Algs4 1.2.16
public class Rational {
private long n;
private long d;
public Rational (long numerator, long denominator) {
n = numerator;
d = denominator;
public long gcd(long p, long q) {
if (q == 0) return p;
long r = p % q;
ekd123 / 地圖.tcl
Last active August 29, 2015 13:56
View 地圖.tcl
#!/usr/bin/env tcl
package require Tk
package require http
set universes [encoding convertfrom utf-8 [http::data [http::geturl]]]
set universe {}
set lastIDs {}
wm title . "地圖"
ttk::combobox .switcher -values [dict keys $universes] -state readonly
ekd123 / 發圖.tcl
Last active December 24, 2015 21:09
View 發圖.tcl
package require Tk
package require tkdnd
pack [ttk::label .drop -text "拖放到此處"] -fill both -expand 1
pack [ttk::button .browse -text "或選擇文件" -command chooseFileToUpload]
tkdnd::drop_target register .drop *
bind .drop <<Drop>> {
upload %D
ekd123 / 全角到半角.tcl
Last active December 24, 2015 19:19
View 全角到半角.tcl
pack [text .input] -fill both -expand 1
pack [ttk::button .start -text "開始" -command {
set contents [.input get 1.0 end]
.input delete 1.0 {end -1c}
.input insert 1.0 [join [lmap char [split $contents {}] {
switch -exact -- $char {
a {return -level 0 a}
b {return -level 0 b}
c {return -level 0 c}
d {return -level 0 d}
ekd123 / stopwatch.tcl
Last active December 24, 2015 13:49
View stopwatch.tcl
set seconds {}
set timetext 00:00:00
set id {}
ttk::label .time -textvariable timetext -font {Arial 32}
ttk::button .reset -text 清零 -command reset
ttk::button .start -text 計時 -command {
set seconds -1
ekd123 / 提取文本中的漢字.tcl
Created August 28, 2013 07:12
提取文本中的漢字,不包含標點。支持所有Unicode標準區和擴展 AB 區。
View 提取文本中的漢字.tcl
#!/usr/bin/env tclsh
package require Tk
pack [ttk::label .l1 -text "在下面的框中輸入要檢查的文本"] -fill x
pack [text .input] -fill both -expand 1
pack [ttk::label .l2 -text "結果"] -fill x
pack [text .output] -fill both -expand 1
pack [ttk::button .start -text "開始" -command startFind] -side right
proc charIsChinese {ch} {
ekd123 / cl-xmppgame.lisp
Created August 11, 2013 16:41
My CL-XMPPGAME rc file
View cl-xmppgame.lisp
(setf cl-xmppgame:*domain* "")
(setf cl-xmppgame:*username* "bot")
(setf cl-xmppgame:*password* "your password here")
(require :drakma)
(require :cl-json)
(require :bordeaux-threads)
ekd123 /
Last active December 19, 2015 13:40
Install fpack for 64bit Fedora users
echo Installing NekoVM for 64-bit users
wget -O /tmp/nekovm.rpm
yum localinstall /tmp/nekovm.rpm
unlink /tmp/nekovm.rpm
echo Installing fpack
wget -O /tmp/fpack.n
nekotools boot /tmp/fpack.n
mv /tmp/fpack /usr/bin/fpack