Skip to content

Instantly share code, notes, and snippets.

View linmx0130's full-sized avatar
🐶
wow

Mengxiao Lin linmx0130

🐶
wow
View GitHub Profile
@linmx0130
linmx0130 / cbojserver.sh
Created May 22, 2012 13:13
the script to start cbojserver as a daemon under CentOS/RHEL
#!/bin/bash
#
# /etc/init.d/cbojserver
#
# Starts the cboj daemon to support a powerful online judger system
#
# chkconfig 345 28 72
# description: Support online judge system, listen the request and judge.
# processname: ctserver ctester
@linmx0130
linmx0130 / persistent_point_tree.cpp
Created May 31, 2012 13:20
Persistent Point Tree
/* Sweetdumplings<linmx0130@163.com>
This file is in public domain.
*/
#include <cstdio>
#include <cstring>
#define SIZE 500000
#define TREESIZE 4000
struct Node{
int sl,sr,data; //for data
int l,r; //for pointer
@linmx0130
linmx0130 / gist:3384042
Created August 18, 2012 02:41
return how many lines changed with git
git diff |grep "\(^+[^+]\|^-[^-]\)" |wc -l
@linmx0130
linmx0130 / dataunpak.cpp
Created August 21, 2012 09:15
USACO Data Getter - if the zip file is wrong, this program will help you to get get the data
#include <cstdio>
#include <string>
#define PRONAME "fishing"
char buf[1024];
std::string newfilename;
std::string int2string(int d)
{
std::string ret;
while (d)
{
@linmx0130
linmx0130 / testtime.c
Last active December 12, 2015 02:18
Only for testtime...
#include <stdio.h>
int main()
{
int i,j;
float k=10000;
for (i=1;i<=50000;++i)
{
for (j=1;j<=50000;++j)
{
k=k+5.4;
@linmx0130
linmx0130 / poj1698.cpp
Last active December 17, 2015 10:48
POJ 1698
#include <cstdio>
#include <cstdlib>
#include <cstring>
#define MAXN 1000
#define MAXM 20005
#define oo 0x7fffffff
struct eList
{
int tot,NowHead[MAXN],Head[MAXN],Pre[MAXM],V[MAXM],U[MAXM],Cap[MAXM];
void AddEdge(int a,int b,int c)
@linmx0130
linmx0130 / gist:5757995
Created June 11, 2013 15:45
Create click event with for (Wrong version)
for (var i=1 ;i<=8;i+=1)
{
$("#Player"+i).click(function(){setMeToTwo(i);});
}
@linmx0130
linmx0130 / gist:5758015
Created June 11, 2013 15:47
Create click event with for (Wrong version 2)
for (var i=1 ;i<=8;i+=1)
{
$("#Player"+i).click(setMeToTwo(i););
}
@linmx0130
linmx0130 / gist:5758060
Created June 11, 2013 15:52
Create click event with for (Correct version)
var Creator=function (number)
{
$("#Player"+number).click(function(){setMeToTwo(number);});
}
for (var i=1 ;i<=8;i+=1)
{
Creator(i);
}
@linmx0130
linmx0130 / gist:5758172
Last active December 18, 2015 08:59
Create some click events without for...
$("#Player1").click(function(){setMeToTwo(1);});
$("#Player2").click(function(){setMeToTwo(2);});
$("#Player3").click(function(){setMeToTwo(3);});
$("#Player4").click(function(){setMeToTwo(4);});
//...