Skip to content

Instantly share code, notes, and snippets.

Avatar

Kai Jia jia-kai

  • MIT
  • Cambridge
View GitHub Profile
@jia-kai
jia-kai / modify_vcxproj_itemdef.py
Created Sep 5, 2016
Modify vcxproj files programmatically
View modify_vcxproj_itemdef.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import bs4
import argparse
import re
import os
class VcxprojModifier:
View naive-cross-entropy-for-CartPole-v0.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# $File: cart.py
# $Date: Sun Aug 28 23:00:26 2016 +0800
# $Author: jiakai <jia.kai66@gmail.com>
import gym
import numpy as np
import operator
@jia-kai
jia-kai / c14auto
Last active Aug 29, 2015
c++14 auto type deduction
View c14auto
#include <iostream>
auto second_f(auto a, auto b) {
return b;
}
int main() {
auto second_l = [](auto a, auto b) {return b;};
std::cout << second_f(0u, -1) << std::endl;
std::cout << second_l(0u, -1) << std::endl;
View setup ipv6
#!/bin/bash -e
# $File: setup-ipv6.sh
# $Date: Fri Mar 07 13:00:05 2014 +0800
# $Author: jiakai <jia.kai66@gmail.com>
PREFIX='2402:f000:1:1501:200:5efe'
ADDR_LOCAL=$(ip r g 8.8.8.8 | grep src | awk '{print $7}')
ADDR_OUT=$(curl ifconfig.me)
ADDR_REMOTE='166.111.21.1'
You can’t perform that action at this time.