- 博客(269)
- 资源 (45)
- 收藏
- 关注
原创 ftrace内核跟踪
待续参考:https://www.cnblogs.com/danxi/p/6417828.htmlhttps://www.jianshu.com/p/99e127973abe
2020-05-22 10:39:34
195
原创 单元测试googletest gmock
一:Mock C code对于c code,gcc 提供了编译链接选项:-Wl,-wrap比如gcc编译时加入链接选项 -Wl,--wrap,malloc,那么函数调用malloc的时候会调用自定义的__wrap_malloc,而原来的malloc会以__real_malloc进行调用。所以程序需要定义一个__wrap_malloc,比如:void* __wrap_malloc(siz...
2019-10-24 19:59:05
4749
原创 C语言函数指针与NULL
C语言中,函数指针和普通指针类似,如果定义了一个函数指针,比如int (*fun)(int a,int b); 那么函数指针fun将默认初始化为NULL。注意:1)函数指针不是函数声明,不要混淆。2)C中函数名可以隐式转换为函数指针,但是C++中非静态成员函数无法隐式转换, 因此在C/C++中获取函数指针时最好统一用取地址符&:即函数指针 = &函数名。...
2019-10-20 13:46:21
3028
转载 Approaching (Almost) Any Machine Learning Problem
原文:http://blog.kaggle.com/2016/07/21/approaching-almost-any-machine-learning-problem-abhishek-thakur/Abhishek Thakur, a Kaggle Grandmaster, originally published this posthereon July 18th, 2016 and...
2019-03-26 20:03:58
2591
转载 GPU太贵无从下手?大神教你省钱又省心
原文:https://www.itcodemonkey.com/article/8227.html来自:AI前线(微信号:ai-front),作策划编辑:Vincent,作者:Tim Dettmers,译者:核子可乐、Debra,编辑:Debra,原文链接导读:深度学习是一类对计算资源有着高度要求的领域,而 GPU 的选择将从根本上决定你的深度学习体验。如果没有 GPU,你...
2019-03-26 19:50:00
985
1
原创 openssl 1.1.1 build, 上层应用option选项及openssl s_client 用法
【build】./Configure linux-x86_64 --prefix=/usr shared如果想提供zlib压缩,那么可以加zlib参数:./Configure linux-x86_64 --prefix=/usr shared zlibmakemake install如果报错BIO_f_zlib找不到,那么查看一下libcrypto.so.1.1,libcr...
2019-03-14 17:56:45
2312
原创 时间序列分析 - python实现
python的statsmodels模块(http://www.statsmodels.org/dev/tsa.html)提供了时间序列分析相关的内容:acf() 计算自相关 statsmodels.tsa.stattools.acfplt_acf() 画自相关系数 statsmodels.graphic...
2019-03-13 20:01:17
3540
原创 时间序列分析 - ARMA/ARIMA参数估计及模型预测
整体处理流程如下: 【平稳化处理】根据ADF单位根检验看序列是否平稳,对于非平稳序列可以进行差分,对数等等。对于得到的平稳序列需要检测是否为白噪声,如果是就没有必要再分析了。【白噪声检验】1)由于白噪声序列期望为0,方差固定。因此会在y=0上下小幅波动,比如:2...
2019-03-13 20:00:12
31810
原创 时间序列分析 - ARMA, ARIMA, SARIMA
【目标数据】ARMA: 针对弱平稳/宽平稳时间序列分析ARIMA: 针对非平稳非周期性时间序列分析SARIMA: 针对非平稳周期性时间序列分析。【自协方差与自相关系数】时间序列在t时刻记作Xt,在s时刻记作Xs,那么这两个时刻对应的时间序列的自协方差的计算公式为:假设时间间隔t-s=k, 并且假设时间序列的均值为常数u, 那么上述公式可以写成自相关系数的表...
2019-03-06 17:19:26
9886
3
原创 python性能分析工具
1)cProfilecProfile可以嵌入到python代码中执行,比如:import cProfilecProfile.run('foo()', 'foo.out')查看结果需要pstats模块,比如:import pstatsp = pstats.Stats('foo.out')p.print_stats()pstats还可以排序, 以及打印排名靠前的记录。比如...
2019-03-06 09:56:58
3175
原创 python debug
1) logging模块2)打印当前调用堆栈(非Exception堆栈)import inspectprint inspect.stack()3)打印exception异常堆栈traceback
2019-03-05 15:23:16
1334
原创 时间序列分析 - 移动平均SMA, EMA(EWMA) 之python
pandas:pandas.DataFrame.rollingpandas.DataFrame.ewmpandas.DataFrame.mean其中rolling可以指定窗口类型win_type,比如boxcar, boxcar, triang, blackman, hanning, bartlett以hanning window为例,其窗口形状为钟型,曲线函数为:...
2019-03-01 16:38:47
22262
转载 时间序列分析 - 移动平均SMA, WMA, EMA(EWMA) 之理论公式
原文:https://zh.wikipedia.org/w/index.php?title=%E7%A7%BB%E5%8B%95%E5%B9%B3%E5%9D%87&variant=zh-cn#_note-0移动平均(英语:moving average,MA),又称“移动平均线”简称均线,是技术分析中一种分析时间序列数据的工具。最常见的是利用股价、回报或交易量等变数计算出移动平均。...
2019-03-01 16:29:07
22374
原创 char*, char[], 字符串初始化之内存布局
先上一段C代码:#include <stdio.h>int a_test = 66;char glob_str_array[] = "Global Heglo String Array!";char *glob_str_pointer = "Global Hegxlo String Pointer!";main(){ a_test = 88; co...
2019-02-27 15:32:07
3963
原创 js定时器
关于setTimeout与setInterval的介绍:https://javascript.info/settimeout-setinterval 语法:setTimeout(func|code, delay[, arg1, arg2...])setInterval(func|code, delay[, arg1, arg2...])第一个参数一般是callback函...
2019-02-15 17:28:23
1315
原创 Kibana中对ElasticSearch Query查询用法
以下操作都是在kibana的Dev Tools中进行。1. 日期range筛选基本用法:GET /my_index/_search{ "query": {"bool": {"must": [{"match_phrase":{"Service":{"query":"service-001"}}},{"match_phrase
2019-02-12 19:46:06
6700
原创 javascript操作json
1. json中拼接js变量,比如在js中拼接"str1"和变量x:{"str1":"'+x+'"}; 2. json对象与字符串转换JSON.parse()用于从字符串中解析出json对象,比如:var str='{"age":"30","name":"jim"}'经 JSON.parse(str) 得到:Object: age:"
2019-02-12 19:30:58
375
转载 C内嵌AT&T汇编 - X86
原文:https://blog.csdn.net/littlehedgehog/article/details/2259665https://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html内核代码绝大部分使用C 语言编写,只有一小部分使用汇编语言编写,例如与特定体系结构相关的代码和对性能影响很大的代码。GCC提供了内嵌汇...
2019-01-16 10:37:03
1007
原创 CAS原子操作以及Pthread Futex
维基百科给出的CAS定义:In computer science, compare-and-swap (CAS) is an atomic instruction used in multithreading to achieve synchronization. It compares the contents of a memory location with a given value ...
2019-01-11 11:52:27
1035
转载 SystemV与Posix IPC对比
原文:https://www.tutorialspoint.com/inter_process_communication/inter_process_communication_system_v_posix.htmImplement POSIX Semaphore APIs using System V Semaphores APIs:https://www.ibm.com/deve...
2019-01-11 11:45:59
915
原创 Pthread 线程调度
设置以下关于调度策略之前应该首先通过pthread_attr_setinheritsched设置PTHREAD_EXPLICIT_SCHED.1) Scheduling Scopehttp://man7.org/linux/man-pages/man3/pthread_attr_setscope.3.html通过pthread_attr_setscope()可以设置线程的资源竞争范围,包...
2019-01-11 11:37:31
2193
原创 多线程虚假唤醒 Spurious wakeup
问题描述:线程在等待signal信号时,即使等待的条件变量并没有变化,线程仍然可能被唤醒。解决的办法是设置一个while循环,检测条件变量是否真正改变了,如果没有就继续wait维基百科里的描述:Spurious wakeup describes a complication in the use of condition variables as provided by certain ...
2019-01-11 11:22:29
630
原创 linux signal回调函数
void my_signal_handler(int sig){ printf("Received signal %d, quiting\n", sig); exit(1);}// set up signal handlersignal(SIGINT, my_signal_handler);signal(SIGQUIT, my_signal_handler);...
2019-01-10 17:13:27
1565
原创 SystemV IPC信号量
semgethttp://man7.org/linux/man-pages/man2/semget.2.htmlsemctlhttp://man7.org/linux/man-pages/man2/semctl.2.htmlsemophttp://man7.org/linux/man-pages/man2/semop.2.htmlftokhttp://man7.org/...
2019-01-10 13:19:12
334
原创 pthread相关函数
pthread_createhttp://man7.org/linux/man-pages/man3/pthread_create.3.htmlpthread_exithttp://man7.org/linux/man-pages/man3/pthread_exit.3.htmlpthread_joinhttp://man7.org/linux/man-pages/man3/p...
2019-01-07 10:47:42
1774
原创 chmod, fchmod修改文件权限
#include <sys/stat.h>int chmod(const char *path, mode_t mode);int fchmod(int fd, mode_t mode);示例:fp = fopen("/home/b001/file01", "w");/* change permissions to 644 */ if (fchmod...
2019-01-07 10:28:54
1600
原创 SystemV IPC 共享内存
shmgethttp://man7.org/linux/man-pages/man2/shmget.2.htmlshmathttp://man7.org/linux/man-pages/man2/shmat.2.htmlshmctlhttp://man7.org/linux/man-pages/man2/shmctl.2.htmlshmdthttp://man7.org/li...
2019-01-04 10:35:27
432
原创 pipe/FIFO IPC
pipe与FIFO功能类似,都是单向通信。管道两端必须都open以后才可以通信,否则先open的一端默认阻塞。pipe作为无名管道,仅用于近亲进程,例如父子进程,同一个进程内的线程等等。FIFO作为有名管道,可用于两个独立进程的通信。介绍如下:http://man7.org/linux/man-pages/man7/pipe.7.htmlpipehttp://man7.or...
2019-01-03 17:17:08
472
原创 Python3.5安装tkinter
系统环境:CentOS 6.7 64bit1) yum -y install tkinter tcl-devel tk-devel安装完以后的库以及头文件为:[root@localhost lib]# ll /usr/lib64/libtk*lrwxrwxrwx. 1 root root 11 Dec 12 06:28 /usr/lib64/libtk.so -> l...
2018-12-12 14:57:36
3975
原创 scikit-learn常用接口
1)roc_auc_score 获取AUC score用法:from sklearn import metricsauc = metrics.roc_auc_score(y_true, y_score)常见问题:Data is not binary and pos_label is not specified原因:y_true必须是0 1 array,如果不是0,1可以有两种...
2018-10-27 10:45:21
732
原创 jupyter安装配置(Virtualbox运行)
python3 -m pip install --upgrade pippython3 -m pip install jupyter运行:jupyter notebook如果jupyter是运行在virtualbox虚拟机里面,那么可以设置virtualbox允许主机访问:由于virtualbox设置成了NAT网络连接,因此需要通过端口转发的方式,允许宿主机器访问。jupyter...
2018-10-19 14:55:14
3167
gcc依赖文件gmp4.3.2+mpfr2.4.2+mpc0.8.1
2018-10-18
scikit-learn 0.17安装包for python3.5 win32
2016-11-18
graphite0.9.9相关安装包
2014-11-09
cas-server-webapp
2013-12-08
spring MVC 初始启动blocking queue
2013-07-31
spring mvc restful service
2013-07-30
springMVC+mybatis+jpetstore工程源码
2013-05-13
mondrian xmla配置需要的jar
2013-04-22
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅