2016年5月27日

pgrep 匹配长度限制

摘要: 今天遇到了一个奇怪的问题,有一个程序明明已经跑起来了,可是pgrep确查不到进程id,google之后找到了答案,权且记录在下: pgrep 如果通过进程名称匹配,只能匹配到前15个字符,更深层次的原因待探究,等不忙的时候细细研究吧。这个链接给出了一个方向,供参考http://askubuntu.c 阅读全文

posted @ 2016-05-27 11:10 Wrench 阅读(580) 评论(0) 推荐(0) 编辑

2015年9月17日

MySQL入门资料汇总(linux系统)

摘要: 今天是第一次接触MySQL,并希望通过c++连接MySQL,一天的搜索下来,获益良多。这里只是罗列一些教程的链接,以备不时之需。1、安装部分:sudo apt-get install mysql-server sudo apt-get install mysql-client ... 阅读全文

posted @ 2015-09-17 17:36 Wrench 阅读(167) 评论(0) 推荐(0) 编辑

2015年9月1日

Linux下g++编译与使用静态库和动态库(仅命令)

摘要: 生成静态库:ar c[rv] libtarget.a src1.o src2.o ...生成动态库:g++ -shared -fPIC src1.o src2.o -o libtarget.so使用静态库:g++main.cpplibsrc.a-o target使用动态库:g++main.cpp-L... 阅读全文

posted @ 2015-09-01 15:19 Wrench 阅读(1263) 评论(0) 推荐(0) 编辑

2015年8月21日

Shell算数运算

摘要: 转载自:Linux Shell 算数运算Bash shell 的算术运算有四种方式:1:使用 expr 外部程式加法 r=`expr 4 + 5`echo $r注意! '4' '+' '5' 这三者之间要有空白r=`expr 4 * 5` #错误乘法 r=`expr 4 \* 5`2:使用 $(( ... 阅读全文

posted @ 2015-08-21 16:51 Wrench 阅读(161) 评论(0) 推荐(0) 编辑

2015年8月12日

(转载)解决/usr/bin/ld: cannot find -lxxx 问题

摘要: 原文地址 解决/usr/bin/ld: cannot find -lxxx 问题问题:在linux环境编译应用程式或lib的sourcecode时常常会出现如下的错误讯息:/usr/bin/ld: cannot find -lxxx这些讯息会随着编译不同类型的source code 而有不同的结果出... 阅读全文

posted @ 2015-08-12 11:22 Wrench 阅读(179) 评论(0) 推荐(0) 编辑

2015年8月6日

(转)C语言中的EOF和feof()

摘要: 今天遇到了feof()判断文件结束多输出一行的问题,在网上看到一篇写得比较好的文章,转过来(誊写一遍)加深印象。原文地址:http://blog.csdn.net/flyyyri/article/details/5084981 1、EOF是标准库中的宏定义,#define EOF -1,在32位... 阅读全文

posted @ 2015-08-06 23:23 Wrench 阅读(1244) 评论(0) 推荐(0) 编辑

2015年8月4日

204 Count Primes

摘要: Description:Count the number of prime numbers less than a non-negative number,n.Credits:Special thanks to@mithmattfor adding this problem and creatin... 阅读全文

posted @ 2015-08-04 23:40 Wrench 阅读(199) 评论(0) 推荐(0) 编辑

2015年8月3日

228 Summary Range

摘要: //额外声明:我发现不必把做的每一道题都在博客里更新,今后将更新我认为比较有意思的题目Descroption:Given a sorted integer array without duplicates, return the summary of its ranges.For example, ... 阅读全文

posted @ 2015-08-03 23:47 Wrench 阅读(151) 评论(0) 推荐(0) 编辑

2015年8月2日

235 Lowest Common Ancestor of a Binary Search Tree

摘要: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to thedefinition of LCA on Wikipedia... 阅读全文

posted @ 2015-08-02 16:59 Wrench 阅读(175) 评论(0) 推荐(0) 编辑

242 Valid Anagram

摘要: Description:Given two stringssandt, write a function to determine iftis an anagram ofs.For example,s= "anagram",t= "nagaram", return true.s= "rat",t= ... 阅读全文

posted @ 2015-08-02 13:48 Wrench 阅读(126) 评论(0) 推荐(0) 编辑

导航