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
unsigned status = 0; | |
while(true) | |
{ | |
status = _xbegin(); | |
if(status == _XBEGIN_STARTED) | |
{ | |
//Transaction code | |
bool success = transaction_func(); | |
if(success) | |
{ |
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
int A[10]; | |
int max=0; | |
int len=1; | |
for(int i=0;i<10;i++) { | |
if(A[i]<A[i+1]){ | |
len++; | |
} | |
else{ | |
if(len>max) | |
max=len; |
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
template <typename Value> | |
int BStree<Value>:: | |
deep(node<Value> *root,Value target){ | |
if(root->value==target) { | |
return 1; | |
} | |
else { | |
if(root->left!=0) { | |
return (1+deep(root->left,target)); | |
} |
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
package cmysqlclient; | |
import java.io.*; | |
import java.net.*; | |
import java.nio.ByteBuffer; | |
public class Client { | |
/** | |
* @param args | |
*/ |
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
/* | |
* m_executor.h | |
* | |
* Created on: 2014-8-30 | |
* Author: casa | |
*/ | |
#ifndef M_EXECUTOR_H_ | |
#define M_EXECUTOR_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
class Expression { | |
public: | |
Expression(); | |
virtual ~Expression(); | |
virtual void* eval()=0; | |
virtual void initilize()=0; | |
public: | |
data_type return_type; |
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
Claims用户使用文档 | |
撰写人:张磊 审校:余楷 日期:2014年7月 | |
新建用户Claims用户,用于运行Claims系统,Claims采用HDFS作为分布式文件系统,依赖于boost第三方C++库,以及C++并发库和gtest测试库。 | |
环境准备:64位机器,centos操作系统6.3以上版本,gcc-g++版本4.4.6以上。 | |
0, 新建用户 | |
取三台集群构建集群: | |
node1(10.11.1.190) | |
node2(10.11.1.191) | |
node3(10.11.1.192) | |
于三台机器上新建用户claims: |
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
[casa@casa Claims]$ | |
[casa@casa Claims]$ python find_big_files.py 10000000 | |
75272661 07e48446cba9e361da25caf1d7092fecfc6e8751 claimsserver | |
59548372 4cf8a5339aee9237e4e7a90df7caa62b4b97fde6 LogicalQueryPlan/Test/libtest.a | |
45682216 8c4adde64813479933bb345a53b351664df148e2 BlockStreamIterator/ParallelBlockStreamIterator/Test/libtest.a | |
41734688 e660f0cfaa6160458fd1473b7028dce27ff35436 BlockStreamIterator/ParallelBlockStreamIterator/libparallelblockstreamiterator.a | |
35140192 f8d2368bb4684e963b1164a193e00b2ad05eee1c BlockStreamIterator/Serialization/libserialization.a | |
34917770 eeb52fb18dbe3fb3cdcf1467865a5a1745eb6920 Executor/libexecutor.a | |
29792324 54415fcc70e9c549db39a335cd3a9c3e86f7885b Test/libtest.a | |
25060158 3b40c48d29ba65b5623c22a1a46098aa1a918588 Parsetree/libparsetree.a |
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
#!/usr/bin/env python | |
import os, sys | |
def getOutput(cmd): | |
return os.popen(cmd).read() | |
if (len(sys.argv) <> 2): | |
print "usage: %s size_in_bytes" % sys.argv[0] | |
else: |
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 <iostream> | |
using namespace std; | |
template <class Obj> | |
class Counter { | |
template <class T> | |
friend class SmartPtr; | |
Obj *ptr; | |
int count; |
NewerOlder