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 <boost/noncopyable.hpp> | |
| #include <pthread.h> | |
| #include <stdlib.h> | |
| // a superfluous check for pedantic people | |
| inline void CHECK_SUCCESS(int ret) | |
| { | |
| if (ret != 0) | |
| { | |
| abort(); |
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
| 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 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 <assert.h> | |
| #include <array> | |
| #include <functional> | |
| #include <numeric> | |
| template<typename T, int N> | |
| class MultiArrayBase | |
| { | |
| public: | |
| MultiArrayBase(T* data, const std::array<int, N>& dim) |
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
| // answer to http://weibo.com/1915548291/z2UtyzuvQ | |
| // see also http://www.cnblogs.com/baiyanhuang/archive/2012/11/11/2764914.html | |
| #include <boost/bind.hpp> | |
| #include <boost/function.hpp> | |
| #include <boost/noncopyable.hpp> | |
| #include <boost/ptr_container/ptr_vector.hpp> | |
| #include <fstream> | |
| #include <iostream> |
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/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 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
| #user nobody; | |
| worker_processes 4; | |
| events { | |
| worker_connections 10240; | |
| } | |
| http { | |
| include mime.types; | |
| default_type application/octet-stream; |
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 <set> | |
| #include <stdio.h> | |
| #include <sys/time.h> | |
| double now() | |
| { | |
| struct timeval tv; | |
| gettimeofday(&tv, NULL); | |
| return tv.tv_sec + tv.tv_usec / 1000000.0; |
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 <vector> | |
| #include <assert.h> | |
| #include <stdio.h> | |
| #include <stdint.h> | |
| #include <stdlib.h> | |
| typedef int32_t Score; | |
| typedef int32_t UserId; | |
| typedef int32_t Rank; | |
| const Score kInvalidScore = -1; |
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 <algorithm> | |
| #include <atomic> | |
| #include <thread> | |
| #include <vector> | |
| #include <assert.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <strings.h> | |
| #include <sys/time.h> |
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.lang.reflect.Field; | |
| import java.util.ArrayList; | |
| import java.util.Arrays; | |
| import JaCoP.constraints.Alldifferent; | |
| import JaCoP.constraints.Distance; | |
| import JaCoP.constraints.XeqC; | |
| import JaCoP.constraints.XeqY; | |
| import JaCoP.constraints.XplusCeqZ; | |
| import JaCoP.core.Domain; |
NewerOlder