This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module RPolish where | |
| import Data.Char | |
| import Data.Maybe | |
| calc :: IO () | |
| calc = do | |
| putStr "> " | |
| line <- getLine | |
| if not (head line == '0') | |
| then do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| set rsa_key="/path/to/id_rsa" | |
| set user="your_username" | |
| set ip="vnc_server_ip_address" | |
| set dest="%user%@%ip%" | |
| set run_vnc_option="-autokill" | |
| set run_vnc="vncserver %run_vnc_option%" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash -e | |
| SSH_CONFIG=~/.ssh/config | |
| # ポートは適当 | |
| MONITOR_PORT=58626 | |
| _monitor_port_inc() { MONITOR_PORT="$(expr ${MONITOR_PORT} + 1)"; } | |
| _is_local_forward() { [ $(echo "${1}" | egrep "^(\d)+:(\d|\.)+:(\d)+$") ]; } | |
| _is_dynamic_forward() { [ $(echo "${1}" | egrep "^(\d)+$") ]; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| perl -MRegexp::Assemble::Compressed -le '$r=Regexp::Assemble::Compressed->new; $r->add( "hoge" ); $r->add( "moge" ); print $r->re' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| eval $(curl -s http://www.unicode.org/Public/6.0.0/ucd/EmojiSources.txt | awk -F";" ' BEGIN { printf "perl -MRegexp::Assemble::Compressed -le \047$r=Regexp::Assemble::Compressed->new; " } { if ($1 !~ /^#/ && $1 ~ /^[0-9A-Fa-f]+$/) printf "$r->add( \"" $1 "\" ); " } END { printf "print $r->re\047\n" } ') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def repeat(n): | |
| def _repeat(f, *args): | |
| [ f(*args) for i in xrange(n)] | |
| return _repeat | |
| def _print(text): | |
| print text | |
| repeat(10)(_print, "hoge") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # encoding: utf-8 | |
| import sys | |
| indent = [" ", " "] | |
| def t(n): | |
| return "".join(indent[:n]) | |
| l = "\"" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| # data | |
| x = ["Brown", "promises", "free"] | |
| y = ["Noun", "Verb", "Adj"] | |
| # suppose the probabilities | |
| p_x_y = [[0.3, 0.2, 0.5], [0.3, 0.4, 0.1], [0.4, 0.4, 0.4]] # p(x_t, y_t) | |
| p_y_y = [[0.4, 0.7, 0.5], [0.5, 0.1, 0.2], [0.1, 0.2, 0.3]] # p(y_t, y_t-1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @font-face { | |
| font-family: 'Fira Code'; | |
| src: url("https://cdn.rawgit.com/dunovank/jupyter-themes/1e851888/jupyterthemes/fonts/monospace/firacode/firacode.otf") format("opentype"); | |
| } | |
| .CodeMirror { | |
| font-family: 'Fira Code'; | |
| font-variant-ligatures: initial; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import urllib.request | |
| import os | |
| import html | |
| def save(path, content): | |
| with open(path, "w") as file: | |
| file.write(content) |
OlderNewer