Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| sudo apt install libxpm-dev libgif-dev gnutls-bin | |
| ./configure --with-nativecomp --with-mailutils --with-json --with-modules --with-harfbuzz --with-threads --with-included-regex --with-zlib --with-cairo --with-dbus --with-gpm --with-native-image-api --with-rsvg-2 --with-rsvg --with-imagemagick --with-jpeg --with-png --with-png --without-toolkit-scroll-bars --without-makeinfo --with-gnutls=ifavailable | |
| make NATIVE_FULL_AOT=1 -j$(nproc) |
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
| package main | |
| import ( | |
| "encoding/csv" | |
| "image/color" | |
| "os" | |
| "sort" | |
| "strconv" | |
| "gonum.org/v1/plot" |
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
| package main | |
| import ( | |
| "fmt" | |
| . "gorgonia.org/tensor" | |
| ) | |
| func main() { | |
| xs := []int{1, 2, 6, 8} |
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 pandas as pd | |
| import numpy as np | |
| fitnotesFile = "..." | |
| strongLiftsFile = "..." | |
| mfpFile = "..." | |
| fn = pd.read_csv(fitnotesFile) | |
| fn = fn.rename(columns={'Weight (kgs)': 'Weight'}) # cleanup names | |
| grp = fn.groupby(['Date','Exercise']).agg({'Weight':[np.sum, np.mean], 'Reps': [np.sum, np.mean], 'Exercise': [np.size]}) |
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 math | |
| class Monad(object): | |
| __slots__=['value'] | |
| def bind(self, f): | |
| if type(self) is List and type(self.value) is list: | |
| return self._bind(f) | |
| elif type(self) is Value and type(self.value) is list: | |
| # transform it into a List(Value) |
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
| from bs4 import BeautifulSoup | |
| import requests | |
| r = requests.get('http://www.ecma-international.org/ecma-262/5.1/') | |
| soup = BeautifulSoup(r.text) | |
| sections = ('sec-A.1', 'sec-A.2', 'sec-A.3', 'sec-A.4', 'sec-A.5') | |
| appendix = [] | |
| for s in sections: |
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
| from bs4 import BeautifulSoup | |
| import requests | |
| r = requests.get('http://golang.org/ref/spec') | |
| soup = BeautifulSoup(r.text) | |
| bnf = soup.find_all('pre', class_='ebnf') | |
| bnftxt = [x.get_text() for x in bnf] | |
| bnftxt = ''.join(bnftxt) |
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
| .LFB0: | |
| pushq %rbp | |
| movq %rsp, %rbp | |
| subq $64, %rsp | |
| movl %edi, -180(%rbp) | |
| movq %rdx, -160(%rbp) | |
| movq %rcx, -152(%rbp) | |
| movq %r8, -144(%rbp) | |
| movq %r9, -136(%rbp) | |
| testb %al, %al |
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
| # Sorry for using Python 2.7 | |
| from ctypes import * | |
| import os, sys | |
| argv = int(sys.argv[1]) | |
| argv2 = int(sys.argv[2]) | |
| PROT_NONE = 0x0 | |
| PROT_READ = 0x1 | |
| PROT_WRITE = 0x2 |
NewerOlder