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/interprocess/managed_shared_memory.hpp> | |
#include <boost/interprocess/containers/vector.hpp> | |
#include <boost/interprocess/allocators/allocator.hpp> | |
#include<stdio.h> | |
#include <cstdlib> //std::system | |
//using namespace boost::interprocess; | |
typedef boost::interprocess::allocator<float, boost::interprocess::managed_shared_memory::segment_manager> ShmemAllocator; | |
typedef boost::interprocess::vector<float, ShmemAllocator> DataVector; | |
int main(int argc, char *argv[]) |
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
typedef boost::interprocess::allocator<float, boost::interprocess::managed_shared_memory::segment_manager> ShmemAllocator; | |
typedef boost::interprocess::vector<float, ShmemAllocator> DataVector; | |
DataVector *myvector; | |
void init_myvector() | |
{ | |
struct shm_remove | |
{ | |
shm_remove() { boost::interprocess::shared_memory_object::remove("MySharedMemory"); } | |
~shm_remove(){ boost::interprocess::shared_memory_object::remove("MySharedMemory"); } | |
} remover; |
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
typedef boost::interprocess::allocator<float, boost::interprocess::managed_shared_memory::segment_manager> ShmemAllocator; | |
typedef boost::interprocess::vector<float, ShmemAllocator> DataVector; | |
DataVector *myvector; | |
void init_myvector() | |
{ | |
struct shm_remove | |
{ | |
shm_remove() { boost::interprocess::shared_memory_object::remove("MySharedMemory"); } | |
//~shm_remove(){ boost::interprocess::shared_memory_object::remove("MySharedMemory"); } | |
} remover; |
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
if op == '+': | |
res = first + second |
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
try: | |
some() | |
except: | |
print(":(") | |
exit() |
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 A: | |
def __init__(self, x, y): | |
self.x = x | |
self.y = y | |
def hi(self): | |
print(self.x, self.y) |
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
def f(arg1, arg2='default'): | |
print('arg1', arg1) | |
print('arg2', arg2) | |
f('one', 'two') | |
f('one') | |
f('one', arg2='two') | |
f(arg1='one', arg2='two') |
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
cv::Mat res = cv::Mat::zeros(depth_map.rows, depth_map.cols, depth_map.type()); | |
for(int i = 0; i < depth_map.rows; i++) | |
{ | |
for(int j = 0; j < depth_map.cols; j++) | |
{ | |
res.at<uchar>(i, j) = depth_map.at<uchar>(i, j); | |
} | |
} |
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
cv::Mat res; | |
cv::StereoBM bm(CV_STEREO_BM_NORMALIZED_RESPONSE); | |
bm(left, right, res); | |
//std::cout<<res; | |
std::cout<<"type "<<res.type()<<"\n"; | |
cv::Mat tmp = cv::Mat::zeros(res.rows, res.cols, res.type()); | |
for(int i = 0; i < res.rows; i++) | |
{ | |
for(int j = 0; j < res.cols; j++) | |
{ |
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 Tree: | |
def __init___(self, value): | |
self.left = ..... | |
self.right = ..... | |
self.value = value |
OlderNewer