Skip to content

Instantly share code, notes, and snippets.

View leogao2's full-sized avatar

Leo Gao leogao2

View GitHub Profile
@leogao2
leogao2 / primes.hs
Created September 11, 2019 20:09
Haskell prime numbers (inefficient)
p :: (Integral a) => a -> Bool
p 2 = True
p x = not (any id (map (==0) (map (mod x) (filter p [2..x-1]))))
main = do print (take 10 (filter p [2..]))
@leogao2
leogao2 / gist:eefe1c1ed512559c20c84f9d797b68e1
Created September 14, 2019 17:50
An unmodified sample from 117M, generated with a beam-width of 8, top-k of 2, repetition penalty, and conditioned on the unicorn prompt
In a shocking finding, scientist discovered a herd of unicorns living in a remote, previously unexplored valley, in the Andes Mountains. Even more surprising to the researchers was the fact that the unicorns spoke perfect English.
The study, published in the journal Science Advances, was conducted by researchers from the University of California, San Diego, and the National Science Foundation. The study was funded in part by the U.S. Department of Agriculture's Agricultural Research Service, the National Institutes of Health, the U.K.'s Department of Health and Human Services, and the U-S. Geological Survey.
"This is the first time that unicorns have been found living in the wild," said study co-author Dr. David Siegel, a professor of ecology and evolutionary biology at UC San Diego. "This is a very exciting discovery."
Siegel and his colleagues were able to identify a group of six unicorns that had lived in the valley for more than 100 years. The unicorns were found to have lived in a region known for its
@leogao2
leogao2 / install.bat
Created October 11, 2019 03:46
ex2-env-setup
::::::::::::::::::::::::::::::::::::::::::::
:: Elevate.cmd - Version 4
:: Automatically check & get admin rights
:: see "https://stackoverflow.com/a/12264592/1016343" for description
::::::::::::::::::::::::::::::::::::::::::::
@echo off
CLS
echo AlbertaSat Development Environment Installer v1.0
:init
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
cin.tie(0);
ios_base::sync_with_stdio(false);
}
2551291360
e 1439259634
t 1012599011
a 981259505
o 913144815
i 866503493
n 850043038
r 761576918
s 753454243
l 514807040
2551291360
e 1439259634
t 1012599011
a 981259505
o 913144815
i 866503493
n 850043038
r 761576918
s 753454243
l 514807040
36307962535
e 20011086704
a 14567660520
i 12838481994
o 12414752060
t 12120011826
n 11981140608
r 11551226833
s 10546012964
@leogao2
leogao2 / gist:58a380b2e91cf7bc9bdce0f1d52945ee
Last active July 9, 2020 02:53
all the stuff needed to make cc_net work on ubuntu
sudo apt-get install libboost-all-dev cmake libeigen3-dev liblzma-dev unzip python3.7
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3.7 get-pip.py
echo 'export PATH=$PATH:~/.local/bin' >> ~/.bashrc
import os
import fasttext
import re
lid = fasttext.load_model("lid.176.bin")
def listdir(x):
return [x + '/' + fn for fn in os.listdir(x)]
def id(x):
[5490029, 13334514, 453569, 519492, 3918740, 668961, 4901974, 2960733, 19483022, 788550, 850339, 331931606, 73151963, 317457765, 12125882, 2957116, 5981150, 5076443, 3897974, 3168866, 3562501, 2359686, 2190588, 2259680, 1939043, 33940836, 7585067, 307257, 957452, 988910, 12134151, 761569, 5496196, 2694141, 3056881, 2875867, 1400782, 2111464, 2002002, 1863375, 8560496, 1312361, 2001227, 1856704, 2452760, 1763308, 1373272, 2108467, 696814, 2175566, 5588676, 2117130, 1137245, 1402563, 1482619, 885163, 1046439, 861938, 1685236, 861929, 8703875, 136918, 4131176, 125068, 5569656, 2185363, 2211943, 3318815, 2645116, 1987776, 1823516, 2086784, 3979404, 1386463, 1976802, 1878945, 5280544, 1991245, 3401307, 1699202, 533234, 1719563, 46523496, 15091626, 1777223, 1493551, 1261512, 1993835, 3327451, 1838996, 261678, 578121, 410401, 112476, 187576, 114176, 137108, 165725, 161260, 93809, 111664, 166452, 101629, 109933, 49571, 174499, 154784, 117038, 199557, 176357, 286071, 210636, 291046, 153984, 144760, 194501, 196414, 192