Skip to content

Instantly share code, notes, and snippets.

Your goal is to create an HTML5 website that is pixel-accurate as the screenshot @Space-Jam.png . You can use the image files in the `img` folder. To achieve pixel-level reproduction, first write auxiliary programs to measure the pixel locations of the objects on this page. Then use your measurements to create the page. Consider using feature detection/matching with per-object (x, y) offsets and a global scale factor shared by all objects as the free parameters. Consider using RANSAC for robust estimation. After obtaining an initial estimation, crop the image of each object and use local sparse optical flow for refinement. Use JPG format for visual inspection of intermediate results. Your webpage should be able to scale with the window size.
@jia-kai
jia-kai / modify_vcxproj_itemdef.py
Created September 5, 2016 13:26
Modify vcxproj files programmatically
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import bs4
import argparse
import re
import os
class VcxprojModifier:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# $File: cart.py
# $Date: Sun Aug 28 23:00:26 2016 +0800
# $Author: jiakai <[email protected]>
import gym
import numpy as np
import operator
@jia-kai
jia-kai / c14auto
Last active August 29, 2015 14:05
c++14 auto type deduction
#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;
#!/bin/bash -e
# $File: setup-ipv6.sh
# $Date: Fri Mar 07 13:00:05 2014 +0800
# $Author: jiakai <[email protected]>
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'