未知格式怎末分离stream (ffmpeg -i xxx.ts -map 0:a:0 -c copy -copy_unknown -f data raw.bin)ffprobe -select_streams -show_packets -show_frames
unique_ptr #include <memory>#include <iostream>#include <vector>typedef struct xx { int len; std::unique_ptr<char[]> data;}XX;////std::unique_ptr<char[]> chars(new char[1024]);typedef std::unique_ptr<XX> P_esdata;...
std:array 2. char buffer[] 与 vector<char> 互转buffer --> vector<char>vector<char> vec(buffer, buffer+sizeof(buffer)/sizeof(buffer[0]-1)); //will assign length charvec.assign(buffer, buffer+sizeof(buffer)/sizeof(buffer[0])-1); //will assign leng
stringstream 当作buffer 来用 https://www.apiref.com/cpp-zh/cpp/io/basic_stringstream.htmlvoid strtest2(){ char s[22] = "aabbccddeeff"; char d[22] = { 0 }; int xx; stringstream x; // std::cout << "Hello World!"; printf("%d ", x.tellp()); print...
你要的多线程内存池 GNU 帮你写好了 #include <iostream>#include <ext/mt_allocator.h>typedef __gnu_cxx::__mt_alloc<int> allocator_type;int main(){ std::cout << "dddd"; allocator_type att; allocator_type::pointer p1 = att.allocate(128); allocator_typ...
链接选项Bsymbolic 问题描述回归正题,前段时间项目开发中,实现了一个动态库,封装了一些方法。然后基于这个动态库,实现了一个应用程序。应用程序中含有全局变量A,动态库中也含有全局变量A,当我调用动态库中函数后,发现应用程序的A发生了变化!!!O,My God!对于我这种还没在Linux下做过开发的人来说,一头雾水。。。。。。 于是我尝试着,将A中的变量名称改为B,这样问题也就没有了~~~原因应用程序进行链接的...
gcc -Wl,--wrap,malloc 替换系统函数 GNU链接器就提供了一个好用的方法:–wrap=symbol函数名为“__wrap_symbol”,且称其为包装函数,“symbol”是一个函数名,大致执行过程是这样的:当调用“symbol”函数时,如果“symbol”函数未定义的话就会调用“__wrap_symbol”函数;“__real_symbol”也是个相关的函数,当其只声明不定义的话,我们对其的调用将调用真正的“symbol”函...
kthread/waitqueue/tasklet/set_bit •Softirq是中断下半部的处理方式(可以在不同cpu上同时运行)•tasklet是基于softirq实现的,使用比softirq简单.不能在不同cpu上同时运行,但是不同cpu可以运行不同的tasklet.•vk_tasklet_init (&pstDecObj->stDecTasklet ,pstDecObj->pfnHandleDecodeDone, (unsigned l
python 使用opencv 把视频 分割成图片 #--coding:utf-8--import cv2#图像路径名字错误不提示im=cv2.imread("timg.jpg",cv2.IMREAD_GRAYSCALE)cv2.imwrite('res.jpg',im)'''cap=cv2.VideoCapture("1EF5013E37956E7EF2D5F935B6107F34.mp4")while True:
python 使用 imagehash 和 distance 相似图片识别 #--coding:utf-8--from PIL import Imageimport imagehashimport distancefunct_hash=imagehash.phashpil_im=Image.open(r"timg.jpg")stepx=64stepy=64print pil_im.sizeoneitem=[]res_box=[]'''d
hook glibc 我们知道,Linux的用C库的都是glibc,有一个叫libc.so.6的文件,这是几乎所有Linux下命令的动态链接中,其中有标准C的各种函数,默认情况下,linux所编译的程序中对标准C函数的链接,都是通过动态链接方式来链接libc.so.6这个函数库的。这也意味着我们在通过我们注入的.so来实现函数覆盖劫持之后需要从libc.so.6中取得原本的正常函数,让程序继续正常执行正常程序m
记录一次 linux kernel bug [2017-07-28 12:07:43:423][160290.942415] ------------[ cut here ]------------[2017-07-28 12:07:43:423][160290.947109] kernel BUG at fs/ext4/mballoc.c:3728![2017-07-28 12:07:43:423][160290.9518
nltk_data 离线安装 windows 默认搜索路径 Searched in: - 'C:\\Users\\xa00010/nltk_data' - 'C:\ltk_data' - 'D:\ltk_data' - 'E:\ltk_data' - 'C:\\Python27\ltk_data' - 'C:\\Python27\\lib\l
使用静态busybox 性能提升, 确一直coredump 的问题 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/arm/include/asm/processor.h?id=acfdd4b1f7590d02e9bae3b73bdbbc4a31b05d38经分析需要kernel 打patch
python requests 库 跳过ssl 验证 # -*- coding: utf-8 -*-import requestsimport sysreload(sys)sys.setdefaultencoding('utf-8')#import ssl#ssl._create_default_https_context = ssl._create_unverified_contextproxy_handler = {'http':
使用valgrind 检查内存 泄露 等问题 export VALGRIND_LIB=/data/build.so/lib/valgrind/cd /data/build.so/bin./valgrind --tool=massif--threshold=0.000001 --time-unit=B --trace-children=yes --time-unit=B--trace-children-skip=*pangu,SCLR*
记录一次系统调用慢的 分析过程 收到问题jira描述• • [EM] 0131559] [工厂适应性问题]执行shell命令,系统反应慢• 分析发现调用系统system函数执行命令的时间过长,每条命令执行约250ms。对比其它平台只需要
使用facebook infer 进行代码审查 http://fbinfer.com/docs/getting-started.htmlhttp://fbinfer.com/docs/hello-world.html
使用trace-compass 分析 lttng 抓取的结果 2. http://archive.eclipse.org/tracecompass/doc/org.eclipse.tracecompass.doc.user/Trace-Compass-Main-Features.html 此工具可以直接下载3. trace-compass-3.0.0-20170614-1849-win32.win32.x86_64