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
| tell application "Google Chrome" | |
| set myURL to get URL of active tab of first window | |
| set myTitle to get title of active tab of first window | |
| end tell | |
| tell application "Safari" to add reading list item myURL with title myTitle |
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
| class Katakana2Hiragana { | |
| public static void main(String args[]) { | |
| System.out.println((char)("ガ".charAt(0) - 'ァ' + 'ぁ') == 'が'); | |
| } | |
| } |
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
| [[source]] | |
| url = "https://pypi.python.org/simple" | |
| verify_ssl = true | |
| name = "pypi" | |
| [dev-packages] | |
| [requires] | |
| python_version = "3.6" |
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) |
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
| 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
| #!/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
| 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
| 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
| perl -MRegexp::Assemble::Compressed -le '$r=Regexp::Assemble::Compressed->new; $r->add( "hoge" ); $r->add( "moge" ); print $r->re' |