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 me.alexyang.scanner; | |
import java.nio.charset.Charset; | |
import java.util.ArrayList; | |
import org.jboss.netty.util.CharsetUtil; | |
import com.stumbleupon.async.Callback; | |
import com.stumbleupon.async.Deferred; | |
import org.hbase.async.HBaseClient; |
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 | |
import socket | |
import struct | |
from protobuf import IpcConnectionContext_pb2 as IpcConnectionContext | |
from protobuf import RpcPayloadHeader_pb2 as RpcPayloadHeader | |
# --- Connection header --- | |
# Client.writeConnectionHeader() | |
preamble = ( |
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 | |
import os | |
import socket | |
import sys | |
import time | |
ITERATIONS = 4000 | |
TAGS = 50 |
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
// Copyright (C) 2012 Benoit Sigoure | |
// Copyright (C) 2012 StumbleUpon, Inc. | |
// This library is free software: you can redistribute it and/or modify it | |
// under the terms of the GNU Lesser General Public License as published by | |
// the Free Software Foundation, either version 2.1 of the License, or (at your | |
// option) any later version. This program is distributed in the hope that it | |
// will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty | |
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser | |
// General Public License for more details. You should have received a copy | |
// of the GNU Lesser General Public License along with this program. If not, |
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
// Copyright (C) 2012 Benoit Sigoure | |
// This program is free software: you can redistribute it and/or modify it | |
// under the terms of the GNU Lesser General Public License as published by | |
// the Free Software Foundation, either version 3 of the License, or (at your | |
// option) any later version. This program is distributed in the hope that it | |
// will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty | |
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser | |
// General Public License for more details. You should have received a copy | |
// of the GNU Lesser General Public License along with this program. If not, | |
// see <http://www.gnu.org/licenses/>. |
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.util.ArrayList | |
import scala.collection.JavaConversions._ | |
import com.stumbleupon.async.{Callback, Deferred} | |
import org.hbase.async.{HBaseClient, KeyValue, Scanner} | |
import com.twitter.util.{Future, Promise, Return, Throw} | |
/** Converts a Deferred into a Future. */ | |
implicit def futureFromDeferred[A](d: Deferred[A]): Future[A] = { | |
val promise = new Promise[A] | |
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
==> Downloading http://michael.toren.net/code/tcptraceroute/tcptraceroute-1.5beta7.tar.gz | |
File already downloaded in /Users/tsuna/Library/Caches/Homebrew | |
/usr/bin/tar xf /Users/tsuna/Library/Caches/Homebrew/tcptraceroute-1.5beta7.tar.gz | |
==> ./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/tcptraceroute/1.5beta7 --with-libnet=/usr/local --mandir=/usr/local/Cellar/tcptraceroute/1.5beta7/share/man | |
./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/tcptraceroute/1.5beta7 --with-libnet=/usr/local --mandir=/usr/local/Cellar/tcptraceroute/1.5beta7/share/man | |
checking build system type... i686-apple-darwin11.3.0 | |
checking host system type... i686-apple-darwin11.3.0 | |
checking target system type... i686-apple-darwin11.3.0 | |
checking for a BSD-compatible install... /usr/bin/install -c | |
checking whether build environment is sane... yes |
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.PrintWriter; | |
import java.util.Arrays; | |
import java.util.HashSet; | |
import com.stumbleupon.mr.HashIntSet; // OpenJDK's HashSet hacked to use built-in `int' | |
import gnu.trove.set.hash.TIntHashSet; | |
import com.google.caliper.Param; | |
import com.google.caliper.SimpleBenchmark; | |
final class setbench { |
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 com.google.caliper.SimpleBenchmark; | |
interface iface { | |
int foo(); | |
} | |
class base implements iface { | |
public int foo() { | |
return (int) System.nanoTime(); | |
} |
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 | |
# A simple example of a threaded TCP server in Python. | |
# | |
# Copyright (c) 2012 Benoit Sigoure All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are met: | |
# - Redistributions of source code must retain the above copyright notice, | |
# this list of conditions and the following disclaimer. | |
# - Redistributions in binary form must reproduce the above copyright notice, |