Skip to content

Instantly share code, notes, and snippets.

View advancedxy's full-sized avatar
:octocat:

advancedxy

:octocat:
View GitHub Profile
2.0.0.0/7
4.0.0.0/6
8.0.0.0/7
11.0.0.0/8
12.0.0.0/7
15.0.0.0/8
16.0.0.0/5
24.0.0.0/7
26.0.0.0/8
28.0.0.0/6
@advancedxy
advancedxy / shua.js
Created May 5, 2014 02:29
喜刷刷
box = $("div.m-chatform .edit textarea")
btn = $("div.m-chatform .btn")
var txt = ''
lines = []
function init() {
var xhr = new XMLHttpRequest()
xhr.open("GET", "http://10.240.138.100/tmp/tang.txt", true)
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && xhr.status == 200) {
public class HeightedQuickUnionUF {
private int[] id; // id[i] = parent of i
private int[] height; // sz[i] = number of objects in subtree rooted at i
private int count; // number of components
// Create an empty union find data structure with N isolated sets.
public HeightedQuickUnionUF(int N) {
count = N;
id = new int[N];
height = new int[N];
@advancedxy
advancedxy / mongodb.conf
Created December 8, 2013 13:06
logrotate config file for mongodb
/path/to/configsvr/config.log{
weekly
rotate 9
compress
size 100M
sharedscripts
create
postrotate
/bin/kill -SIGUSR1 `cat /path/to/configsvr/mongd.lock 2> /dev/null` 2> /dev/null || true
/bin/find /path/to/configsvr/ -type f -size 0 -regextype sed -regex ".*\.log\.[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}T[0-9]\{2\}-[0-9]\{2\}-[0-9]\{2\}" -delete 2> /dev/null