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
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)
@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]})
@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 main
import (
"encoding/csv"
"image/color"
"os"
"sort"
"strconv"
"gonum.org/v1/plot"
@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)
@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.