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
/* | |
This is for https://github.com/nkallen/querulous/issues/24 | |
I must be doing something wrong but I can't see what. In my loadtests it's pretty apparent | |
that new MySQL connections are always created all the time and are never re-used, so my app | |
then runs out of FD. | |
*/ | |
package whatever | |
import java.sql.ResultSet |
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
#!/bin/bash | |
# Copyright (c) 2010, 2011 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, | |
# this list of conditions and the following disclaimer in the documentation | |
# and/or other materials provided with the distribution. |
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
public static void main(String[] args) throws Exception { | |
Socket echoSocket = null; | |
PrintWriter out = null; | |
String host = null; | |
int port = 0; | |
while (true) { | |
try { |
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, |
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
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
==> 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.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
// 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
// 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, |