Skip to content

Instantly share code, notes, and snippets.

View chewxy's full-sized avatar
💭
Test Status. Do not upvote

Chewxy chewxy

💭
Test Status. Do not upvote
View GitHub Profile
@chewxy
chewxy / v0.10.0svg.svg
Last active January 1, 2021 21:10
Gorgonia data types dependencies
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chewxy
chewxy / gist:9f4c45a5177b675e2af9bcc7bd4a0c45
Created November 3, 2020 11:17
compiling the latest emacs
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)
package main
import (
"encoding/csv"
"image/color"
"os"
"sort"
"strconv"
"gonum.org/v1/plot"
@chewxy
chewxy / getGolangEBNF.py
Created September 3, 2014 03:43
Gets the EBNF of the Golang spec at https://golang.org/ref/spec
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)
@chewxy
chewxy / test_sparse.go
Created December 30, 2017 02:10
Sparse tensors in Gorgonia
package main
import (
"fmt"
. "gorgonia.org/tensor"
)
func main() {
xs := []int{1, 2, 6, 8}
package pointerTagging
import (
"testing"
)
func BenchmarkInitializingInterface(b *testing.B) {
for i := 0; i < b.N; i++ {
initializingConventional()
}
package pointerTagging
import (
"unsafe"
"math/rand"
"time"
)
type vector struct {
x int
@chewxy
chewxy / gist:7885712
Created December 10, 2013 04:26
Pointer Tagging in Go
package main
import (
"fmt"
"github.com/chewxy/gogogadget"
"unsafe"
)
func main() {
var x int64 = 1234
@chewxy
chewxy / mungeall.py
Created November 26, 2015 05:39
Munges stuff from FitNotes, StrongLifts and MyFitnessPal
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]})
import bisect
import csv
import datetime
survivalFile = open('Survival_lang_no_title.csv')
reader = csv.reader(survivalFile)
reader.next() # pop the first row
minutes = []
langDict = {}