This file contains 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/sh | |
killall server | |
timeout=${timeout:-100} | |
bufsize=16384 | |
for nosessions in 100 1000; do | |
for nothreads in 1 2 3 4; do | |
sleep 5 | |
echo "Bufsize: $bufsize Threads: $nothreads Sessions: $nosessions" |
This file contains 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 <boost/bind.hpp> | |
#include <boost/function.hpp> | |
#include <stdio.h> | |
class Base | |
{ | |
public: | |
virtual void foo() | |
{ | |
printf("Base::foo\n"); |
This file contains 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 <muduo/base/Logging.h> | |
#include <muduo/net/EventLoop.h> | |
#include <muduo/net/InetAddress.h> | |
#include <muduo/net/TcpClient.h> | |
#include <muduo/net/TcpServer.h> | |
#include <boost/bind.hpp> | |
#include <queue> | |
#include <utility> |
This file contains 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
class Linux_0_01 | |
{ | |
int restart_syscall(); //0 | |
int exit(); //1 | |
int fork(); //2 | |
int read(); //3 | |
int write(); //4 | |
int open(); //5 | |
int close(); //6 | |
int waitpid(); //7 |
This file contains 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 <assert.h> | |
#include <stdint.h> | |
#include <algorithm> | |
#include <vector> | |
using namespace std; | |
struct IPrange | |
{ |
This file contains 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 class Main { | |
public final static int kHoles = 228; | |
public final static int kBalls = 60; | |
public static void main(String[] args) { | |
Random r = new Random(); | |
int[] hist = new int[kBalls + 1]; | |
for (int round = 0; round < 1000*1000*10; ++round) { | |
boolean[] holes = new boolean[kHoles+1]; | |
int balls = 0; |
This file contains 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
/* | |
* The Computer Language Benchmarks Game | |
* http://shootout.alioth.debian.org/ | |
* | |
* contributed by Christoph Bauer | |
* modified by bearophile | |
*/ | |
#include <math.h> |
This file contains 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 <algorithm> | |
#include <iterator> | |
#include <vector> | |
#include <boost/unordered_set.hpp> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <sys/time.h> | |
using namespace std; |
This file contains 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 <string> | |
#include <set> | |
#include <vector> | |
#include <iostream> | |
#include <assert.h> | |
#include <stdio.h> | |
using namespace std; | |
typedef vector<string> Dictionary; |
This file contains 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
// FIXME: memory leaks | |
#include <stdio.h> | |
#include <deque> | |
#include <set> | |
struct Node | |
{ | |
int value; | |
Node* parent; |
OlderNewer