Skip to content

Instantly share code, notes, and snippets.

View cocoatomo's full-sized avatar
🐧
Translating

cocoatomo cocoatomo

🐧
Translating
View GitHub Profile
@cocoatomo
cocoatomo / venv_git_ps1.sh
Last active July 27, 2019 11:55
git-prompt.sh + venv
# prompt
## wget https://raw.github.com/git/git/master/contrib/completion/git-prompt.sh -O "${HOME}/.local/share/git-prompt.sh"
if [ -f "${HOME}/.local/share/git-prompt.sh" ]; then
source "${HOME}/.local/share/git-prompt.sh"
fi
PROMPT_COMMAND='venv_git_ps1 "[\u@\h \W]" "\\\$ "'
GIT_PS1_SHOWDIRTYSTATE=true
GIT_PS1_SHOWCOLORHINTS=true
@cocoatomo
cocoatomo / gist:f01e58347882342bf6c63fb2df197a68
Last active October 13, 2017 23:56
『夏休みの自由工作:TensorFlowでじゃんけんマシンを作る』の数学的な誤りについて
『夏休みの自由工作:TensorFlowでじゃんけんマシンを作る』[1]
(原文は "My summer project: a rock-paper-scissors machine built on TensorFlow" [2])
という記事を見付けた。
最近、ディープラーニングを少しずつ勉強しているので、興味を引かれ読んでみた。
[1] https://cloudplatform-jp.googleblog.com/2017/10/my-summer-project-a-rock-paper-scissors-machine-built-on-tensorflow.html
[2] https://cloud.google.com/blog/big-data/2017/10/my-summer-project-a-rock-paper-scissors-machine-built-on-tensorflow#step-5-create-a-linear-model
扱っている題材やそこで使われている各技術要素は面白く、読んでいて飽きなかった。
ディープラーニングの理論的内容も、パーセプトロンというちょうど先日勉強したばかりの内容で記憶に新しく、理解の確認になった。
@cocoatomo
cocoatomo / MuseMember.hs
Last active December 20, 2016 15:38 — forked from aiya000/MuseMember.hs
import Data.Monoid
data Muse = HanayoKoizumi | RinHoshizora | MakiNishikino
| UmiSonoda | KotoriMinami | HonokaKosaka
| EliAyase | NicoYazawa | NozomiTojo
deriving (Eq, Ord, Enum, Show)
next :: Muse -> Muse
next HanayoKoizumi = RinHoshizora
next RinHoshizora = MakiNishikino
@cocoatomo
cocoatomo / gist:d4688463b47769c8a209901f8c28206e
Created December 1, 2016 00:49
Errors on building mesos on macOS Sierra
In file included from ../../src/appc/spec.cpp:17:
In file included from ../../3rdparty/stout/include/stout/os.hpp:63:
In file included from ../../3rdparty/stout/include/stout/os/su.hpp:23:
../../3rdparty/stout/include/stout/os/posix/su.hpp:241:9: error: 'syscall' is deprecated: first deprecated in macOS 10.12 - syscall(2) is unsupported; please
switch to a supported interface. For SYS_kdebug_trace use kdebug_signpost(). [-Werror,-Wdeprecated-declarations]
if (::syscall(SYS_initgroups, ngroups, _gids, uid.get()) == -1) {
^
/usr/include/unistd.h:733:6: note: 'syscall' has been explicitly marked deprecated here
int syscall(int, ...);
^
diff -uwr /usr/local/texlive/2016/texmf-dist/scripts/jfontmaps/kanji-config-updmap.pl /usr/local/texlive/2014/texmf-dist/scripts/jfontmaps/kanji-config-updmap.pl
--- /usr/local/texlive/2016/texmf-dist/scripts/jfontmaps/kanji-config-updmap.pl 2015-10-03 07:14:02.000000000 +0900
+++ /usr/local/texlive/2014/texmf-dist/scripts/jfontmaps/kanji-config-updmap.pl 2014-03-01 11:36:46.000000000 +0900
@@ -1,19 +1,20 @@
#!/usr/bin/env perl
# kanji-config-updmap: setup Japanese font embedding
-# Version 20151002.0
+# Version 20140301.0
#
# formerly known as updmap-setup-kanji
@cocoatomo
cocoatomo / gist:a32ac7f425ebf45619b8943e9c842c21
Last active June 9, 2016 00:16
kanji-config-updmap(-sys)
$ sudo kanji-config-updmap status
updmap: updmap: unknown option `--showoption'. Try updmap --help for help.
Cannot find status of current kanjiEmbed setting via updmap --showoption!
$ sudo kanji-config-updmap-sys status
updmap: updmap: unknown option `--sys'. Try updmap --help for help.
Cannot find status of current kanjiEmbed setting via updmap --showoption!
$ updmap --version
updmap version 1107552857.
package co.coatomo.math.categorical.typeclass.functor;
import java.util.function.Function;
interface FailedFunctor<A> {
<F extends FailedFunctor, B> F<B> map(Function<A, B> morphism);
}
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Target(ElementType.TYPE)
@interface Functor {
@Target(ElementType.METHOD)
@interface Map {}
}
@cocoatomo
cocoatomo / hello.py
Created November 12, 2013 15:33
the first greeting to the world
print('Hello, world!')
@cocoatomo
cocoatomo / exercise3.66.scm
Last active December 22, 2015 01:48
Exercise 3.66 in SICP
; Exercise 3.66
(define (index i j)
(if (= i j)
(- (expt 2 (+ i 1)) 2)
(- (* (expt 2 i) (+ (* 2 (- j i)) 1)) 2)))
(map
(lambda (p)
(let ((i (- (car p) 1))