Skip to content

Instantly share code, notes, and snippets.

@haotian-liu
haotian-liu / ucf2xdc.php
Created November 6, 2017 08:08
Simple PHP script to convert UCF constraints to XDC
<h3>Convert UCF to XDC</h3>
<?php
$handle = isset($_POST['handle']) && !empty($_POST['handle']) ? $_POST['handle'] : null;
if ($handle === null) {
echo '
<form method="POST">
<textarea name="handle" rows="20" style="width:90%; max-width: 640px"></textarea>
<br>
@haotian-liu
haotian-liu / PolyMorphCount.cpp
Last active October 8, 2017 05:27
Optimized algorithm.
#include <iostream>
#include "gmp.h"
using namespace std;
uint64_t SimpCalc(int Y, int X) {
auto f = new uint64_t[X + 1];
uint64_t sum;
memset(f, 0, sizeof(uint64_t) * (X + 1));
f[1] = 2;
import scrapy
import pymysql.cursors
import datetime
from tutorial.items import CKCItem
class CKCSpider(scrapy.Spider):
name = "ckc"
allowed_domains = ["ckc.zju.edu.cn"]
start_urls = [
@haotian-liu
haotian-liu / express-company.js
Last active February 19, 2020 09:58
A javascript that can differentiate the express IDs of different express companies
var jsoncom = {
'company': [{
'companyname': '申通快递',
'shortname': '申通',
'tel': '95543',
'url': 'st',
'code': 'shentong',
'hasvali': 0,
'comurl': 'http://www.sto.cn',
'isavailable': '0',