01 2014 档案

摘要:1 /***************************************** 2 * Name : Vtun 源码详细分析 3 * Version : 3.0.3 4 * Date : Jan. 22, 2014 5 * Author : lucas 6 * Email : lucasysfeng@gmail.com 7 * Blog : http://www.cnblogs.com/lucasysfeng/ 8 * Description : 1.Vtun是一个短小精悍的开源VPN项目, ... 阅读全文
posted @ 2014-01-22 19:55 helloweworld 阅读(5898) 评论(3) 推荐(1)
摘要:Ctrl+1 快速修复(最经典的快捷键,就不用多说了) Ctrl+D: 删除当前行 Ctrl+Alt+↓ 复制当前行到下一行(复制增加) Ctrl+Alt+↑ 复制当前行到上一行(复制增加) Alt+↓ 当前行和下面一行交互位置(特别实用,可以省去先剪切,再粘贴了) Alt+↑ 当前行和上面一行交互位置(同上) Alt+← 前一个编辑的页面 Alt+→ 下一个编辑的页面(当然是针对上面那条来说了)... 阅读全文
posted @ 2014-01-21 15:37 helloweworld 阅读(203) 评论(0) 推荐(0)
摘要:vim的几种模式 1、Normal Mode 普通模式 功能:在这种模式下可以移动光标等。 进入:默认进入vim之后,处于这种模式。在其他模式下狂按ESC后进入此模式。 2、Visual Mode 可视模式 功能:在这种模式下可以选定一些字符、行、多列。 进入:在普通模式下,按v进入。 3、Insert Mode 插入模式 功能:在这种模式下可以编辑输入等。 进入:普通模式下,可以按i、a、o... 阅读全文
posted @ 2014-01-19 14:50 helloweworld 阅读(5789) 评论(0) 推荐(0)
摘要:.(英文句点) 匹配除换行符外的任意1个字符 PS:*指的是前一个匹配项出现0此或多次, 如abc*可以匹配ab、abc、abcc等,即*的前一个匹配项c可以出现0次或多次。 参考:http://www.cnblogs.com/deerchao/archive/2006/08/24/zhengzhe30fengzhongjiaocheng.html 阅读全文
posted @ 2014-01-18 23:18 helloweworld 阅读(413) 评论(0) 推荐(0)
摘要:vim中的四种patternPS:{only Vim supports \m, \M, \v and \V} 建议始终将 'magic' 选项保持在缺省值 - 'magic'。这可以避免移植性的麻烦。要使模式不受该选项值的影响,在模式前面加上 "\m" 或 "\M".pattern和正则之间的关系1. \v模式 (v小写)如在vim中查找字符$,如果使用\v模式,则写作::/\v\$而不是::/\v$即在\v模式下, $ .(句点) * ( { 等都被看作是正则表达式中的特殊字符,要匹配本身,需要加反斜杠\。2. \m模式 阅读全文
posted @ 2014-01-18 23:18 helloweworld 阅读(431) 评论(0) 推荐(0)
摘要:A = [5;3;4;1;7;2][B, C] = sort(A, 'descend') A = 5 3 4 1 7 2 B = 7 5 4 3 2 1 C = 5 1 3 2 6 4 C排序后对应的行号。 阅读全文
posted @ 2014-01-16 15:35 helloweworld 阅读(459) 评论(0) 推荐(0)
摘要:save (FunctionNowFilename('test', '.mat' )); %----------------------filename: FunctionNowFilename.m ----------------------- function [ fname ] = FunctionNowFilename( pre, post )%NOW_FILENAME convert... 阅读全文
posted @ 2014-01-16 15:18 helloweworld 阅读(3050) 评论(1) 推荐(1)
摘要:要设计的函数: 函数名:FunctionTest 输入:InputValueOne, InputValueTwo 输出:ReturnValueOne, ReturnValueTwo 在FunctionTest.m文件中编写如下代码: function [ReturnValueOne ReturnValueTwo] = FunctionTest(InputValueOne, InputValue... 阅读全文
posted @ 2014-01-16 15:15 helloweworld 阅读(1152) 评论(0) 推荐(0)
摘要:ticfor i = 1:1:100endtoc 阅读全文
posted @ 2014-01-16 15:01 helloweworld 阅读(450) 评论(0) 推荐(0)
摘要:矩阵最大值和对应的行列号 找最大元素就是max(max(A)),注意二维矩阵要写两个max 找对应位置用find函数 举个例子: >> A=[1 2 3 ;4 5 6] A = 1 2 3 4 5 6 >> max(max(A)) ans = 6 >> [x y]=find(A==max(max(A))) x = 2 y = 3 >> 找到最大元素是6,对应位置是x=2,y=3,就是第2行,第... 阅读全文
posted @ 2014-01-16 14:57 helloweworld 阅读(3363) 评论(0) 推荐(0)
摘要:画柱状图 矩阵的一列为一组,每一行的颜色相同. %data %1 2%4 5%2 3data = [1,2;4,5;2,3];b = bar(data);ch = get(b,'children');set(gca,'XTickLabel',{'第一行','第二行','第三行'}); %横坐标每行的标号( 1 2、4 5、2 3三行)。legend('第一列','第二列'); 阅读全文
posted @ 2014-01-16 14:50 helloweworld 阅读(3194) 评论(0) 推荐(0)
摘要:求矩阵A某行的和 A = [1,2,3;4,5,6;7,8,9]B=sum(A,2)B(2) A = 1 2 3 4 5 6 7 8 9 B = 6 15 24 ans = 15 阅读全文
posted @ 2014-01-16 14:47 helloweworld 阅读(1145) 评论(0) 推荐(0)
摘要:求矩阵A每行的最大值和该最大值对应的列号 A = [22,1,3,0,2;11,23,43,55,5][maxA,col]=max(A');maxA'col' A = 22 1 3 0 2 11 23 43 55 5 ans = 22 55 ans = 1 4 阅读全文
posted @ 2014-01-16 14:46 helloweworld 阅读(2076) 评论(0) 推荐(0)
摘要:取矩阵A的某一行 A = [22,1,3,0,2;11,23,43,55,5]A(2,:) A = 22 1 3 0 2 11 23 43 55 5 ans = 11 23 43 55 5 阅读全文
posted @ 2014-01-16 14:44 helloweworld 阅读(1589) 评论(0) 推荐(0)
摘要:1.创建bundle路径。 mkdir ~/.vim/bundle 2.clone vundle项目。git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle(第一次clone没创建vundle路径时失败,难道还要创建vundle路径?)3.在.vimrc或/etc/vim/vimrc里添加下面内容。注:如果没有.vi... 阅读全文
posted @ 2014-01-15 15:40 helloweworld 阅读(489) 评论(0) 推荐(0)
摘要://main.cpp#include #include void worker(){ std::cout << "another thread";}int main(){ std::thread t(worker); std::cout << "main thread" << std::endl; t.join(); return 0;}编译:g++ main.cp... 阅读全文
posted @ 2014-01-13 21:25 helloweworld 阅读(223) 评论(0) 推荐(0)
摘要:如查看g++版本 方式一: g++ –version 方式二: dpkg –s g++ 方式三: apt-cache show g++ 阅读全文
posted @ 2014-01-13 21:07 helloweworld 阅读(415) 评论(0) 推荐(0)
摘要:一、传递一个参数。 #include #include using namespace std; void* thr_fn(void* arg){ int i = *(int*)arg; cout #include using namespace std; struct parameter{ char a; int i; float f;}; void* thr_fn(void* ar... 阅读全文
posted @ 2014-01-07 22:58 helloweworld 阅读(4345) 评论(0) 推荐(0)
摘要:Pig Toolbox插件 阅读全文
posted @ 2014-01-06 21:46 helloweworld 阅读(932) 评论(0) 推荐(0)
摘要:a = 1 NaN 2 3 >> a(isnan(a)) = 123 a = 1 123 2 3 >> a = [1 inf 2 3] a = 1 Inf 2 3 >> a(a == inf) = 123 a = 1 123 2 3 阅读全文
posted @ 2014-01-06 21:43 helloweworld 阅读(3538) 评论(0) 推荐(0)