Skip to content

Instantly share code, notes, and snippets.

View rhaps0dy's full-sized avatar
💭
solving AI alignment

Adrià Garriga-Alonso rhaps0dy

💭
solving AI alignment
View GitHub Profile
@rhaps0dy
rhaps0dy / latexsub.el
Created October 12, 2020 14:58
LaTeX -> unicode substitution as used in Julia
;;; packages.el --- latexsub layer packages file for Spacemacs.
;;
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
;;
;; Author: Adrià Garriga Alonso <adria@k9>
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
@rhaps0dy
rhaps0dy / natural_variational_distribution.py
Created July 9, 2020 20:12
Natural variational distribution + tests
#!/usr/bin/env python3
import abc
import torch
from gpytorch.distributions import MultivariateNormal
from gpytorch.lazy import CholLazyTensor
from gpytorch.variational._variational_distribution import \
_VariationalDistribution
@rhaps0dy
rhaps0dy / article13-cat.txt
Created September 10, 2018 14:44
Letters for MEPs
No al Filtre d'Internet de l'Article 13: Protegeixi els meus drets
Estimat diputat al parlament europeu [recipient last name will go here],
Li escric com a científic de la informació, i com a ciutadà de Catalunya que està preocupat pel futur de l'Internet. Considero que l'Internet ha de continuar tenint un caràcter obert, que ens permeti a mi i a les properes generacions fer ús les nostres llibertats fonamentals de compartir i gaudir de la informació en línia, cosa que sembla estar seriosament amenaçada.
La nostra llibertat es veu amenaçada pel llenguatge perillós i poc clar de l'Article 13 de la Directiva sobre Drets d'Autor, tant la versió proposta per la Comissió Europea com l'informe adaptat per la Comissió JURI. Presumptament, l'Article 13 té com a intenció protegir els creadors. A la pràctica, aquesta proposta implica la creació d'un sistema d'algoritmes per a decidir quines parts de text, àudio, vídeo, continguts compartits o imatges (fins i tot els mems) es permetran en línia.
Em preocupen les bar
@rhaps0dy
rhaps0dy / a.txt
Created February 2, 2018 12:45
Images for Spacemacs issue
fdsf
@rhaps0dy
rhaps0dy / cartpole.xml
Created December 23, 2017 08:13
Bullet CartPole simulation files
<mujoco model="inverted pendulum">
<compiler inertiafromgeom="true"/>
<default>
<joint pos="0 0 0" armature="0" damping="0" frictionloss="0" limited="true"/>
<geom pos="0 0 0" contype="0" conaffinity="0" friction="0 0 0"
rgba="0.7 0.7 0 1"/>
<tendon/>
<motor ctrlrange="-1 1" ctrllimited="true"/>
</default>
<option gravity="0 0 -9.81" integrator="RK4" timestep="0.02"/>
@rhaps0dy
rhaps0dy / howto.md
Last active December 11, 2016 12:43
Vote for a charity in Project Awesome

#How to use this?

  1. Go to a charity's page, such as the AMF or the GFI.

  2. Click. one of the videos and vote, normally. This is so you complete the captcha thing.

  3. Go back to the charity page.

  4. Open the browser console.

@rhaps0dy
rhaps0dy / quine.c
Created December 17, 2015 00:23
Quine in C
#include<stdio.h>
void f(char*b){while(*b){if(*b=='"'||*b=='\\')putchar('\\');if(*b=='\n') printf("\\n"),b++; else putchar(*b++);}}
void g(char *c){printf("%s", c); putchar('"'); f(c); printf("\");}\n");}
int main(){g("#include<stdio.h>\nvoid f(char*b){while(*b){if(*b=='\"'||*b=='\\\\')putchar('\\\\');if(*b=='\\n') printf(\"\\\\n\"),b++; else putchar(*b++);}}\nvoid g(char *c){printf(\"%s\", c); putchar('\"'); f(c); printf(\"\\\");}\\n\");}\nint main(){g(");}
@rhaps0dy
rhaps0dy / char-rnn-tf.py
Created November 21, 2015 18:37
NaNoGenMo character-based RNN, based on Karpathy's blog and code.
#!/usr/bin/env python2
import tensorflow as tf
import numpy as np
import time
# Hyperparameters
learning_rate = 1e-1
n_hidden = 100
seq_length = 25
n_show = 2500 // seq_length
(setv test
(let [[a 5]
[b 7]]
(print a b)))
(print (type test))
@rhaps0dy
rhaps0dy / xmonad.hs
Created February 18, 2015 22:27
xmonad configuration with XFCE
import XMonad
import XMonad.Config.Xfce
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.SetWMName
import qualified Data.Map as M
import qualified XMonad.StackSet as W