This file contains 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
# follow https://www.addictivetips.com/ubuntu-linux-tips/how-to-install-arch-linux/, except: | |
# - use `/dev/sdb` | |
# - let ext4 get 100%, not swap | |
# - ditch grub for systemd-boot, see https://www.addictivetips.com/ubuntu-linux-tips/set-up-systemd-boot-on-arch-linux/ | |
# - in install step swap `xorg-server-utils` for `xorg-apps` -- just in case also install `dialog`, `dhcpcd`, `linux-firmware` and `wpa_supplicant` | |
# also see: https://wiki.archlinux.org/index.php/Installation_guide | |
# bluetooth | |
sudo pacman -S bluez bluez-utils | |
systemctl enable bluetooth |
This file contains 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
// https://github.com/uvadlc/uvadlc_practicals_2019/network/members | |
// paste in JS console to get `git remote add` commands | |
[...document.getElementsByClassName('repo')].splice(1).map(x => { | |
repo = x.children[3].getAttribute('href').substr(1); | |
user = repo.split('/')[0]; | |
return `git remote add ${user} git@github.com:${repo}.git`; | |
}).join('\n') | |
// run that at your repo, then `git pull --all` |
This file contains 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
# Do not modify this file! It was generated by ‘nixos-generate-config’ | |
# and may be overwritten by future invocations. Please make changes | |
# to /etc/nixos/configuration.nix instead. | |
{ config, lib, pkgs, ... }: | |
{ | |
imports = | |
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix> | |
]; |
This file contains 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
# unitaries/gates: input |row>, output |col> | |
half = 1/sqrt(2); | |
X = [0 1; 1 0]; | |
Z = [1 0; 0 -1]; | |
H = half * [1 1; 1 -1]; | |
R = @(phi) [1 0; 0 e^(phi*i)]; | |
T = R(pi/4); | |
function ret = controlled(U) |
This file contains 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
// https://ramdajs.com/docs/dist/ramda.js | |
// convert degrees to radians | |
var deg2rad = (deg) => deg * (Math.PI/180); | |
// calculate distance to my university for a lat-long point using the Haversine formula | |
var dist = R.curry((lat1,lon1,lat2,lon2) => { | |
var R = 6371; // Radius of the earth in km | |
var dLat = deg2rad(lat2-lat1); // deg2rad below | |
var dLon = deg2rad(lon2-lon1); |
This file contains 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
.94...13..............76..2.8..1.....32.........2...6.....5.4.......8..7..63.4..8 | |
............942.8.16.....29........89.6.....14..25......4.......2...8.9..5....7.. | |
.....7....9...1.......45..6....2.....36...41.5.....8.9........4....18....815...32 | |
.5247.....6............8.1.4.......97..95.....2..4..3....8...9......37.6....91... | |
.9.........1..6....6..8..7.3......1.....39.......5...217.4...28.....3....86....57 | |
.....5....2...4.1..3..8..2......84..8..6......9..1.7.5..6......95...3.6...3.....1 | |
5...68..........6..42.5.......8..9....1....4.9.3...62.7....1..9..42....3.8....... | |
.7..21..4....3....6.1.....2.......6...86..7.319.....4..1....2.842.9.............. | |
........1..7.5.3.9..48...2...........3...57....942.........3.....1...4.7.6.278... | |
.....8..3.16.2.9.7.3...46...........9.5...2...2.13...9..3....2..7...5.........4.. |
This file contains 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 java.util.Properties; | |
import javabbob.JNIfgeneric; | |
import javabbob.JNIfgeneric.Params; | |
import org.vu.contest.ContestEvaluation; | |
public class BentCigarFunction implements ContestEvaluation { | |
private static final int EVALS_LIMIT_ = 10000; | |
private static final int bbobid_ = 12; | |
private static final double BASE_ = 9273454.0 D; | |
private JNIfgeneric function_ = null; |
This file contains 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
// let R = import 'ramdajs'; | |
// either install ramda library first or run at https://ramdajs.com/docs/ or https://npm.runkit.com/ramda | |
let prisonersDilemma = (a_coop = true, b_coop = true) => | |
(a_coop && b_coop) ? [-1, -1] : | |
(!a_coop && !b_coop) ? [-2, -2] : | |
(a_coop) ? [-3, 0] : [0, -3]; | |
let niceAgent = () => true; |
This file contains 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
cd retro-contest | |
docker run --rm -v compo-tmp-vol:/root/compo/tmp agent retro-contest-agent | |
cd my-retro | |
http python main.py -e -a greedy -g "CartPole-v0" | |
tensorboard --logdir /tmp/log | |
cd gym-http-api | |
python gym_http_server.py -p 5000 |
This file contains 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
# usage: | |
# cd nix-config | |
# git checkout minimal-local | |
# sudo cp -r ./* /etc/nixos/ | |
# cd ../nixpkgs | |
# git bisect start | |
# git bisect bad master | |
# git bisect good 18.03 | |
# git bisect run bash ../bisect-local.sh | |
# git bisect reset |