This file contains 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
a=0;b=2;trl = document.getElementsByTagName("tr");for(var i = 0; i < trl.length; i ++){pl = trl[i].getElementsByTagName("input"); if (pl.length==5){pl[parseInt(Math.random()*(b-a))+a].checked=true;}};document.getElementsByTagName("input")[100].click(); |
This file contains 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
Y = (F) -> | |
((x) -> | |
F((y) -> | |
(x(x))(y)))( | |
(x) -> | |
F((y) -> | |
(x(x))(y)) | |
) | |
FactGen = (fact) -> | |
(n) -> |
This file contains 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/sh | |
LAN_IP=`/sbin/ifconfig $1 | grep inet | grep -v inet6 | awk '{print $2}'` | |
WAN_IP=`/sbin/ifconfig $1 | grep inet | grep -v inet6 | awk '{print $2}'` | |
#LAN_IP=59.66.0.0 | |
#WAN_IP=59.66.0.0 # replace with your wan ip | |
# just for Tsinghua's ISATAP router | |
echo $LAN_IP | |
route delete -inet6 default | |
/sbin/ifconfig gif0 tunnel $LAN_IP isatap.tsinghua.edu.cn |
This file contains 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
#!/usr/bin/env ruby | |
require 'algorithms' | |
class TrueClass | |
def to_i | |
1 | |
end | |
end |
This file contains 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
#!/usr/bin/python3.3 | |
import sys | |
import argparse | |
import random | |
import copy | |
parser = argparse.ArgumentParser(description='Sudoku Utility.') | |
parser.add_argument('inStream', metavar='inStream', type=str, nargs='?', help='input stream.') | |
parser.add_argument('outStream', metavar='outStream', type=str, nargs='?', help='output stream.') | |
parser.add_argument('-g', '--generate', action='store_true', help='generate a sudoku other than solve') |
This file contains 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 sys | |
def shiftL(l, s): | |
return l[s:] + l[:s] | |
def getDiff(li, totalLen): | |
if len(li) < 2: | |
raise Exception('toooo short') | |
li.append(totalLen + li[0]) |
This file contains 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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# $File: downloadIITC.py | |
# $Date: Thu Sep 24 11:28:10 2015 +0200 | |
# $Author: Xiaoyu Liu <i[at]vuryleo[dot]com> | |
import requests | |
from bs4 import BeautifulSoup | |
import os |
This file contains 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
/* | |
* $File: c.cc | |
* $Date: Fri Jul 10 15:00:27 2015 +0800 | |
* $Author: Xiaoyu Liu <i[at]vuryleo[dot]com> | |
*/ | |
#include <iostream> | |
#include <memory> | |
#include <vector> | |
#include <map> |
This file contains 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 time | |
import struct | |
from zio import * | |
io = zio(('localhost', 1234)) | |
timeout = 1000 * 1000 | |
buf = 0x0804a10c | |
recv_addr = 0x080489e6 |
This file contains 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
package main | |
import ( | |
"bufio" | |
"errors" | |
"fmt" | |
"io" | |
"os" | |
"strings" | |
) |
NewerOlder