This file contains hidden or 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
0x1b4655326a78363fEE23b268D010499203641b47 |
This file contains hidden or 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
#include <pthread.h> | |
#include <stdlib.h> | |
#define MAX_THREADS 512 | |
void *compute_pi (void *); | |
//.... | |
int main() { | |
//... | |
pthread_t p_threads[MAX_THREADS]; | |
pthread_attr_t attr; | |
pthread_attr_init (&attr); |
This file contains hidden or 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 Cache::Memcached::GetParser; | |
use strict; | |
use warnings; | |
use integer; | |
use Errno qw( EINPROGRESS EWOULDBLOCK EISCONN ); | |
use constant DEST => 0; # destination hashref we're writing into | |
use constant NSLEN => 1; # length of namespace to ignore on keys | |
use constant ON_ITEM => 2; |
This file contains hidden or 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 java.io.Serializable; | |
import java.util.BitSet; | |
import java.util.Random; | |
//MD5算法最为基础来构造哈希函数 | |
/* | |
*for (int i = 0; i < funNum; i++){ | |
* //输入URL地址拼接上Hash函数的编号 | |
* String input = url+i.toString(); | |
* //散列值取MD5摘要的后64位与比特向量大小的的余数 |
This file contains hidden or 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 httplib2,time,re | |
from BeautifulSoup import BeautifulSoup | |
SCRAPING_CONN = httplib2.Http(".cache") | |
SCRAPING_DOMAIN_RE = re.compile("\w+:/*(?P<domain>[a-zA-Z0-9.]*)/") | |
SCRAPING_DOMAINS = {} | |
SCRAPING_CACHE_FOR = 60 * 15 # cache for 15 minutes | |
SCRAPING_REQUEST_STAGGER = 1100 # in milliseconds | |
SCRAPING_CACHE = {} | |
def fetch(url,method="GET"): |
This file contains hidden or 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/python | |
#coding=utf-8 | |
from bs4 import BeautifulSoup | |
import sys, re | |
import urllib, urllib2 | |
import xml.etree.ElementTree as ET | |
import webbrowser | |
#import codes, Queue, threading, time | |
def spider(net): |