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
Tested on CIMS energon3 server, 8 cores. The code is in branch mutex_test. | |
CPU Time (by std::clock()) | |
========================== | |
+ RWLock | |
Running Concurrent(Producer): Running time: 2.01 | |
PASSED | |
Running Concurrent(Consumer): Running time: 0.96 | |
PASSED |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-latest.js"></script> | |
</head> | |
<body> | |
<div id="images"> | |
</div> | |
<script> |
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
setlocal tabstop=4 | |
setlocal softtabstop=4 | |
setlocal shiftwidth=4 | |
setlocal textwidth=80 | |
setlocal smarttab | |
setlocal expandtab |
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 <iostream> | |
#include <iomanip> | |
#include <sstream> | |
using namespace std; | |
int main() { | |
std::string str = "2.492089450701739E62"; | |
double d; |
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
if ( typeof(tests) != "object" ) | |
tests = []; | |
// generate a grid map from (x1, y1) to (x2, y2)` | |
function generateGridMap(collection, x1, y1, x2, y2) { | |
for( var i = x1; i < ( x2 + 1); i++) { | |
for(var j = y1; j < (y2 + 1); j++) { | |
collection.insert({loc: [i, j]}); | |
} |
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 re | |
import pprint | |
import math | |
foo = """ | |
field #0['loc']: [BinData(128, 611325C000000000), BinData(128, 611325FFFFFFFFFF)], [BinData(128, 6113274000000000), BinData(128, 6113277FFFFFFFFF)], [BinData(128, 611327C000000000), BinData(128, 611327FFFFFFFFFF)], [BinData(128, 61132D0000000000), BinData(128, 61132DFFFFFFFFFF)], [BinData(128, 61132F0000000000), BinData(128, 61132FFFFFFFFFFF)], [BinData(128, 6113300000000000), BinData(128, 611333FFFFFFFFFF)], [BinData(128, 6113340000000000), BinData(128, 611334FFFFFFFFFF)], [BinData(128, 6113360000000000), BinData(128, 611336FFFFFFFFFF)], [BinData(128, 6113380000000000), BinData(128, 61133BFFFFFFFFFF)], [BinData(128, 61133C0000000000), BinData(128, 61133CFFFFFFFFFF)], [BinData(128, 61133E0000000000), BinData(128, 61133EFFFFFFFFFF)], [BinData(128, 6113854000000000), BinData(128, 6113857FFFFFFFFF)], [BinData(128, 611385C000000000), BinData(128, 611385FFFFFFFFFF)], [BinData(128, 6113900000000000), BinData(128, 611390FFFFFFFFFF)], [BinData(128, 6113910000000000), Bin |
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
from __future__ import print_function | |
from sets import Set | |
import sys | |
import re | |
import subprocess | |
def get_allowed_cases(): | |
allowed_cases = [] | |
for arg in sys.argv[1:]: | |
if "-" in arg: |
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
['/Users/syzhou/10gen/support/scripts/parse_gdb_output_osx.py', 'debugger_mongod_89735.clean.log'] | |
All threads: 60 | |
Unique threads: 34 | |
1 times thread #13: tid = 0x268a1b3, 0x00007fffbd2c5bf2 libsystem_kernel.dylib`__psynch_cvwait + 10, name = 'WTCheckpointThread' | |
frame #0: 0x00007fffbd2c5bf2 libsystem_kernel.dylib`__psynch_cvwait + 10 | |
frame #1: 0x00007fffbd3b17fa libsystem_pthread.dylib`_pthread_cond_wait + 712 | |
frame #2: 0x00007fffbbd33572 libc++.1.dylib`std::__1::condition_variable::__do_timed_wait(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::time_point<std::__1::chrono::system_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >) + 126 | |
frame #3: 0x000000010f5d50e4 mongod`std::__1::cv_status std::__1::condition_variable::wait_for<long long, std::__1::ratio<1l, 1l> >(this=0x00007fd06a553200, __lk=0x000070000cfd1d78, __d=0x000070000cfd1b60) + 148 at __mutex_base:388 | |
frame #4: 0x000000010f5d496d mongod`mongo::WiredTigerKVEngine::WiredTigerCheckpoi |
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
set print static-members off | |
set print pretty on | |
set pagination off | |
python | |
import os, sys, glob | |
pp = glob.glob("/opt/mongodbtoolchain/v3/share/gcc-*/python/libstdcxx/v6/printers.py") | |
printers = pp[0] | |
path = os.path.dirname(os.path.dirname(os.path.dirname(printers))) | |
sys.path.insert(0, path) |
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 jinja2 | |
templateLoader = jinja2.FileSystemLoader(searchpath="./") | |
templateEnv = jinja2.Environment(loader=templateLoader, extensions=["jinja2.ext.loopcontrols"]) | |
TEMPLATE_FILE = "template.yml.j2" | |
template = templateEnv.get_template(TEMPLATE_FILE) | |
threads = [1, 16, 32, 64, 128, 256, 512, 768, 1024] | |
s = template.render(threads = threads, total_phase = len(threads) * 8) |