Skip to content

Instantly share code, notes, and snippets.


Ahmed Fasih fasiha

Block or report user

Report or block fasiha

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View halfwidth-fullwidth-small-katakana.txt
fasiha / frequencies.json
Created Oct 18, 2019
Mecab-IPADIC "-O yomi" output of a bunch of Japanese subtitle files, and associated character frequencies (kanji that MeCab couldn't understand deleted). I can't figure out how to get "yomi"-style output out of UNIDIC.
View frequencies.json
[" ",158830],
fasiha /
Created Aug 29, 2019
How to zero-pad nicely symmetric vectors for FFT, so FFT of real symmetric inputs is (to machine precision) real
def Fsympad(h, m=None, inputOriginMiddle=True):
if inputOriginMiddle:
h = fft.ifftshift(np.array(h))
h = np.array(h)
if not m:
return fft.fftshift(fft.fft(h))
n = h.size
assert m >= n
# odd-length case: just insert zeros
View index.html
<meta charset="UTF-8">
<script src="plotly-1.48.1.min.js"></script>
Source: <a href=""><code>ghcn/daily/by_year</code></a>.
Background: <a href="">Global Historical Climate Network Daily -
<div id="tester" style="width:100%;height:90%;"></div>
const yearlyRaw = `1763,3379.2,730
fasiha /
Created May 9, 2019
Excerpt from Aaron Brown’s “Red-Blooded Risk: The Secret History of Wall Street” (chapter 10) on gold money, paper money, and derivatives

To start a business with precious metal money, you need to have or to find an investor with enough precious metal to buy all the assets you need to start generating cash sales. To start a business with paper money, you need to find a bank willing to supply you with pieces of paper. Neither you nor the bank need have any net worth, although in practice banks tend to maintain net worth equal to a fraction of the loans they make. Even so, the amount of capital required to start the business with paper money lent by a bank is much less than the total value of the assets required. What is essential is that the bank’s lending standards are low enough to approve your loan, but high enough to make its paper money acceptable enough to acquire the assets you need.

To start a business with derivative money, you identify all assets you require and all products you will deliver in the future. Of course, there is uncertainty around these things, especially the amount and quality of products you will deliver. You don’t hav

View gist:53797924cafb5dbca69eeadcebe76312
# Put new words in a CSV with this format
# 表層形,左文脈ID,右文脈ID,コスト,品詞,品詞細分類1,品詞細分類2,品詞細分類3,活用形,活用型,原形,読み,発音
# surface_form,left_context_id,right_context_id,cost,part_of_speech,pos_division_1,pos_division_2,pos_division_3,inflection_type,inflection_style,lemma,reading,pronunciation
$ echo "fasihsignal,-1,-1,100,名詞,一般,*,*,*,*,fasihsignal,ファシシグナル,ファシシグナル" > a.csv
# Then use mecab-dict-index to compile the csv into a .dic file, based on an existing mecab dictionary file
$ /usr/local/Cellar/mecab/0.996/libexec/mecab/mecab-dict-index -d/usr/local/Cellar/mecab/0.996/lib/mecab/dic/ipadic/ -u a.dic -f utf8 -t utf8 a.csv
# The use it
$ mecab -ua.dic
fasiha /
Last active Apr 27, 2019
Aaron Brown on risk and sleep deprivation

Aaron Brown, on Chat with Traders episode 149, on risk and sleep deprivation.

The other half of risk. In poker at first you can just play quantitatively. You know the numbers, you know the probabilities. At low levels you collected money just by probability. But as you get higher and higher and you start to get some of the best players in the country, you realize there’s a whole other level you gotta get and it’s all done by your unconscious brain. You can’t calculate it, you gotta feel it, and you gotta train your unconscious brain to play poker. It’s a powerful computer up there … but it doesn’t know how to play poker. And your conscious brain is very weak, can’t multiply two three digit numbers together which a computer can do easily. So your conscious brain is relegated tasks like coming up with advertising jingles and wondering which celebrity marriages are in trouble while your unconscious brain handles heartbeat and respiration and whether you’

fasiha /
Last active Feb 3, 2019
Several four-player hands of hold ’em via


Player 1

Percents rf sf qu fh fl st tr 2p pa hi
9c10c = hi <1 <1 <1 2 6 9 4 22 41 16
10c 9c× 5h Kc 6d = hi 0×0 <1×<1 0×<1 0×2 4×<1 3×5 1×4 8×21 47×47 36×21
10c 9c× 5h Kc 6d 6s = pa 0×0 0×0 0×<1 0×6 0×0 0×2 4×9 26×42 70×42 0×0
10c 9c× 5h Kc 6d 6s Jc = pa ×0 ×0 ×<1 ×3 ×0 ×0 ×7 ×39 ×52 ×0
fasiha / Ebisu-Java-Bare.ipynb
Created Nov 11, 2018
Very barebones Java implementation of Ebisu
View Ebisu-Java-Bare.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.