This file contains hidden or 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
#include <sys/syscall.h> | |
#include <sys/types.h> | |
#include <pthread.h> | |
#include <unistd.h> | |
#include <errno.h> | |
#include <cstdio> | |
#ifndef CPU_SETSIZE | |
#define CPU_SETSIZE 1024 |
This file contains hidden or 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
#!/bin/bash | |
sudo add-apt-repository -y ppa:git-core/ppa | |
sudo apt-get update | |
sudo apt-get install git -y |
This file contains hidden or 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
# NOTE: If you are using Ubuntu Precise or Debian Wheezy, you might want to read about running Node.js >= 4.x on older distros. | |
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash - | |
sudo apt-get install -y nodejs | |
# Alternatively, for Node.js v6: | |
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - | |
sudo apt-get install -y nodejs |
This file contains hidden or 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
! | |
! Swap Caps_Lock and Control_L | |
! | |
remove Lock = Caps_Lock | |
remove Control = Contol_L | |
keysym Control_L = Caps_Lock | |
keysym Caps_Lock = Control_L | |
add Lock = Caps_Lock | |
add Control = Control_L |
This file contains hidden or 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
#!/bin/bash | |
sudo add-apt-repository -y ppa:ubuntu-elisp | |
sudo apt-get update | |
sudo apt-get install vim-athena emacs-snapshot git -y | |
git clone https://github.com/syl20bnr/spacemacs ~/.emacs.d | |
curl https://j.mp/spf13-vim3 -L > spf13-vim.sh && sh spf13-vim.sh | |
git clone https://github.com/YuMS/vimrc.git ~/GitHub/vimrc/ | |
cd ~/GitHub/vimrc | |
bash setup.sh & | |
emacs & |
This file contains hidden or 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 logging | |
import gym | |
from SimulatedAnnealing import SimulatedAnnealingAgent | |
def main(): | |
logger = logging.getLogger() | |
logger.setLevel(logging.DEBUG) | |
env = gym.make('CartPole-v0') |
This file contains hidden or 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
function retryUntilSuccess(promiseFunc, args, timeout = 1000, retry = -1) { | |
return new Promise((resolve, reject) => { | |
const tryForTimes = (attempts) => { | |
promiseFunc(...args).then((result) => { | |
resolve(result); | |
}).catch((err) => { | |
if (attempts === 0) { | |
reject(err); | |
} else { | |
setTimeout(() => tryForTimes(attempts - 1), timeout); |