Skip to content

Instantly share code, notes, and snippets.

/** \file crc32.cpp
* A number of implementations of a CRC32 algorithm. This program will only work on a CPU with SSE 4.2 support.
*
* Compile with:
*
* $> g++ --std=c++17 crc32.cpp -O3 -fwhole-program
*
* The output is a CSV file showing the timings of the various implementations.
**/
@imxiaobo
imxiaobo / gs.py
Created April 25, 2012 02:53
Extract information from google scholar search.
from tornado import (ioloop, web, httpserver,
httpclient, gen, httputil, escape)
from bs4 import BeautifulSoup
class DefaultHandler(web.RequestHandler):
def get(self):
self.write(
"""
<!DOCTYPE html>
<html>
<head>
@imxiaobo
imxiaobo / Server.scala
Created March 7, 2012 04:53
simple example for scala remote actor with supervision
import scala.actors.Actor._
import scala.actors.remote.RemoteActor._
import scala.concurrent.ops._
import scala.actors.{ Actor, Exit }
object Server extends App {
def f(msg:Any):String = {
println("I received: " + msg)
"Thanks: " + msg
}
@imxiaobo
imxiaobo / .vimrc
Created November 10, 2011 11:41
My .vimrc configuration. Plugins are managed by vundle.vim.
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
@imxiaobo
imxiaobo / node-zookeeper compile err (with node 0.6)
Created November 8, 2011 08:35
node-zookeeper compile err (with node 0.6)
$ npm install
> zookeeper-ddopson@3.3.3-1 preinstall /Users/xiaobo/Documents/Projects/github/node-zookeeper
> node-waf clean || true; node-waf configure build
configure: WARNING: unrecognized options: --without-shared
checking for doxygen... no
checking for perl... /usr/bin/perl
checking for dot... no
checking for a BSD-compatible install... /usr/bin/install -c
Parallels Desktop v6.0
magnet:?xt=urn:btih:a8797b01ae2a2b516e1975cfe5a41863d885a51a&dn=Parallels.Desktop.v6.0.12090.MAC.OSX-HOTiSO&tr=http%3A%2F%2Ftracker.thepiratebay.org%2Fannounce&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.ccc.de%3A80&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80&tr=udp%3A%2F%2Ftracker.istole.it%3A80&tr=http%3A%2F%2Fumunu.com%3A1984%2Fannounce&tr=http%3A%2F%2Fopentracker.umunu.com%2Fannounce&tr=http%3A%2F%2Fexodus.desync.com%3A6969%2Fannounce&tr=http%3A%2F%2Fexodus.desync.com%2Fannounce&tr=http%3A%2F%2Fannounce.torrentsmd.com%3A6969%2Fannounce&tr=http%3A%2F%2Fcpleft.com%3A2710%2Fannounce&tr=http%3A%2F%2F10.rarbg.com%2Fannounce&tr=http%3A%2F%2Ftracker.torrentbay.to%3A6969%2Fannounce
Call of Duty:Black Ops
PS. 在我的Lion上没有声音
magnet:?xt=urn:btih:52e47b41eb8874f00e56c8dd2abb7dc72592de6d&dn=Black%20Ops&tr=http%3A%2F%2Ftracker.publicbt.com%3A80%2Fannounce&tr=http%3A%2F%2Ftracker.openbittorrent.com%3A80%2Fannounce&tr=http%3A%2F%2Finferno.demonoid.com%3A3409%2Fannounce
GTA 4
@imxiaobo
imxiaobo / Doozerd-go-r58.1-compiler-output-lion.log
Created July 25, 2011 11:41
Doozerd compiled error with go r58.1 on Mac OS X Lion
Bo-Xiaos-MacBook-Pro:src xiaobo$ ./all.sh
--- cd pkg/quiet
6g -o _go_.6 quiet.go
rm -f _obj/doozer/quiet.a
gopack grc _obj/doozer/quiet.a _go_.6
cp _obj/doozer/quiet.a "/usr/local/Cellar/go/r58.1/pkg/darwin_amd64/doozer/quiet.a"
--- cd pkg/store
6g -o _go_.6 event.go getter.go glob.go node.go store.go
@imxiaobo
imxiaobo / go-lion-xcode4.1-homebrew-failed.log
Created July 21, 2011 07:25
brew install -v go failed on lion with Xcode 4.1
/usr/local/share/python/hg
==> Cloning http://go.googlecode.com/hg/
Updating /Users/xiaobo/Library/Caches/Homebrew/go--hg
hg pull
pulling from http://go.googlecode.com/hg/
searching for changes
no changes found
hg update
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
==> Checking out revision release.r57.2
@imxiaobo
imxiaobo / RemoteAkka.scala
Created June 8, 2011 09:29 — forked from earldouglas/RemoteAkka.scala
Remotely loads and registers Akka Actor classes at runtime
package com.earldouglas.remoteakka
import akka.actor.Actor
import akka.actor.Actor._
case object Greeting
case class Jar(val bytes: Array[Byte])
case class RegisterRemote(val name: String, val className: String)
object Runner {
class route(object):
"""
decorates RequestHandlers and builds up a list of routables handlers
Tech Notes (or "What the *@# is really happening here?")
--------------------------------------------------------
Everytime @route('...') is called, we instantiate a new route object which
saves off the passed in URI. Then, since it's a decorator, the function is
passed to the route.__call__ method as an argument. We save a reference to