I hereby claim:
- I am domdomegg on github.
- I am domdomegg (https://keybase.io/domdomegg) on keybase.
- I have a public key ASDW50zFSWLKsWYdrYRvl4WLpXC_Q6wU9mw0hr1q5FxCbAo
To claim this, I am signing this object:
#!/bin/bash | |
# Installs switchaudio.sh in current directory | |
# Tested on Ubuntu 20.04.1 LTS with GNOME 3.36.3 and X11 | |
# Uninstall is manual: delete the script file and remove the shortcut from the keyboard shortcut preferences | |
set -e | |
curl -s https://gist.githubusercontent.com/domdomegg/ebef7b1808e1cca7879517c83a46ea9c/raw/8a408d85d0270841787186bacfa2d72c700aca61/switchaudiooutput.sh --output switchaudio.sh | |
chmod +x switchaudio.sh |
I hereby claim:
To claim this, I am signing this object:
const input = { | |
learningRate: 0.1, | |
discountFactor: 0.95, | |
initialQ: {}, | |
moves: [ | |
{ start: 's17', action: 'right', reward: 0, finish: 's18' }, | |
{ start: 's18', action: 'up', reward: 10, finish: 's14' }, | |
{ start: 's14', action: 'right', reward: -4, finish: 's15' }, | |
{ start: 's23', action: 'up', reward: 0, finish: 's18' }, | |
{ start: 's18', action: 'up', reward: 0, finish: 's13' }, |
// Simple (probably buggy) simualtor for the Martingale betting strategy on a casino wheel | |
// Slightly dodgy coding, bashed out quickly in 10 mins to prove a flatmate wrong... | |
const randomWin = () => { | |
return Math.random() < 0.49; | |
} | |
let stats = { | |
counter: 0, | |
wins: 0, |
These programs use Starling's public API to print out details of and lock all the cards of an account holder
You'll want to run these something like:
ACCESS_TOKEN=youraccesstokenhere python example.py
If using the sandbox API, like:
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/socket.h> | |
#include <sys/types.h> | |
#include <arpa/inet.h> | |
#include <netdb.h> | |
int main(int argc, char* argv[]) { | |
// Create an internet socket |
// Pretty abstract - basically this is for when: | |
// there's a bunch of things you can get with a query selector | |
// which you can map to and endpoint url | |
// and then want to call the endpoint for each thing | |
// this is the code for you... and by you I probably mean future Adam 👋 | |
// Designed to run in the Google Chrome console | |
// Set these parameters 🔧 | |
// These are example values for deleting all topics on uk pcpartpicker |
# You can view me at https://gist.github.com/domdomegg/2783028abcfcf7bed5ef50cb1cea361b | |
# You can run me at https://repl.it/@domdomegg/cs260-cw1-q2 | |
TEST_RUNS = 5 | |
TEST_N = 1000 | |
TEST_MAX = 5000 # TEST_MIN will be -TEST_MAX | |
import numpy as np | |
import time | |
def efficient_iterative(a): |