- 博客(27)
- 资源 (16)
- 收藏
- 关注
转载 linux 安装中文输入法方法
1)http://www.2cto.com/os/201207/144189.html2)http://wiki.ubuntu.org.cn/IBus
2013-12-15 13:23:26 1113
转载 linux root权限获取
http://www.cnblogs.com/wuxinrui/archive/2011/03/26/1996565.html在终端中输入:sudo passwd root Enter new UNIX password: (在这输入你的密码)Retype new UNIX password: (确定你输入的密码)passwd: password updated suc
2013-12-15 13:22:27 3452
转载 vim 安装 指令 快捷键
http://blog.csdn.net/huanghe423/article/details/70054591. 真机环境下,窗口模式与命令行模式的切换窗口模式----->命令行模式 Ctrl+Alt+F(n), 其中n为1到6之间的任意整数。命令行模式----->窗口模式 Ctrl+Alt+F(7)。2. Vmware虚拟机环境下,窗口模式与命令行模式的切换Vmware虚拟
2013-12-15 13:21:23 2850
转载 指针和引用的主要区别
1.解释指针和引用的主要区别。 使用引用(reference)和指针(pointer)都可间接访问另一个值,但它们之间存在两个重要区别:(1)引用总是指向某个确定对象(事实上,引用就是该对象癿别名),定义引用时没有进行初始化会出现编译错误;(2) 赋值行为上存在差异:给引用赋值修改的是该引用所关联癿对象的值,而不是使该引用不另一个对象关联。引用一经初
2013-12-14 10:23:20 1289
原创 STL_Sequence_大小写英文字母和数字进栈输出显示
#include #include //return结果不因机器环境改变#include //控制输出格式#include #include using namespace std;int main(int argc,char *argv[]){ list Alphabet; vector Number; //小写和大写字母进栈 for(char c =
2013-12-12 18:36:02 1696
原创 STL_Sequence_StringList
#include #include //修改地方#include #include using namespace std;int main(){ list lvec; //修改地方 string str; //将读入string对象存储在list对象中 cout << "Enter some strings(Ctrl+Z to end):"
2013-12-12 18:10:08 960
原创 STL_Sequence_StringVector
#include #include #include #include using namespace std;int main(){ vector svec; string str; //将读入string对象存储在vector对象中 cout << "Enter some strings(Ctrl+Z to end):" << endl; while (cin>>
2013-12-12 18:08:34 1079
原创 STL_Sequence_Vector
#include #include #include #include //return 数值不因机器环境而变using namespace std;vector::iterator findint(vector::iterator beg, vector::iterator end, in
2013-12-12 18:06:27 1154
原创 python OS-目录遍历-异常处理
1.---OS操作---linux下创建多级目录:mkdir -p a/b/c/d[user1@localhost Desktop]$ cd ~[user1@localhost ~]$ lsa2.t Desktop Downloads Music Pictures replace.py test.txta.t Documents
2013-12-10 16:46:40 3149
原创 python 文件替换
#/usr/bin/python#coding:utf8#文件内容替换练习#1.把a.t中的hello替换为csvt,并保存到文件a2.t中。#2.把a.t中的hello替换为csvt,并保存到原文件中去。#problem1:fp1 = file("a.t","r")fp2 = file("a2.t","w")for s in fp1.readlines(): fp2.w
2013-12-10 16:44:07 1789
原创 python 文件查找
#/usr/bin/python#coding:utf8#problem1:find file#cat a.t#hello world#hello hello world#统计文件a.t中hello的个数import refp = file("a.t","r")#count = 0for s in fp.readlines(): li = re.findall("hel
2013-12-10 16:42:45 1432
原创 python 文件对象方法
[user1@localhost ~]$ pythonPython 2.6.6 (r266:84292, Jul 10 2013, 22:48:45) [GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2Type "help", "copyright", "credits" or "license" for more information.>>
2013-12-10 16:38:31 1796
原创 python 文件读写
[user1@localhost ~]$ lsDesktop Downloads new.txt Pictures Templates test.txt~Documents Music new.txt~ Public test.txt Videos[user1@localhost ~]$ pythonPython 2.6.6 (r266:84292,
2013-12-10 16:37:10 1480
原创 python 文件打开和关闭
[user1@localhost ~]$ lsDesktop Downloads Pictures Templates test.txt~Documents Music Public test.txt Videos[user1@localhost ~]$ cat test.txtwww.cvst.neti am a python leaner.hell
2013-12-10 16:36:13 3982
原创 python 浅拷贝和深拷贝
1.所谓浅拷贝只是对引用的拷贝(只拷贝父对象)2.所谓深拷贝就是对对象的资源进行拷贝user1@ubuntu:~$ pythonPython 2.7.3 (default, Sep 26 2013, 20:03:06) [GCC 4.6.3] on linux2Type "help", "copyright", "credits" or "license" for m
2013-12-08 15:43:11 1090
原创 python 正则表达式之二
使用正则表达式 --re模块提供了一个正则表达式引擎的接口,可以让你讲REstring编译成对象并用它们来进行匹配 --编译正则表达式 #!python >>>import re >>>p = re.compile('ab*') >>>print p --re.compile()也接受可选的标志参数
2013-12-08 15:39:05 1382
原创 python 正则表达式之一
正则表达式(或RE)是一个小型高度专业化的编程语言,它内嵌于python中,并通过re模块实现。--可以为想要匹配的相应字符串集指定规则--该字符串集可能包含英文语句、e-mail地址、命令或者任何你想搞定的信息--可以问诸如“这个字符串匹配该模式么?”或“在这个字符串中是否有部分匹配该模式?”--你也可以使用RE以各种方式修改或者切割字符串1)正则表达式模块被编译成一
2013-12-08 15:35:40 1236
转载 ubuntu 12.04的vim配置
ubuntu12.04中使用的vim的版本不支持像语法高亮和文件类型检测等配置第一步:#sudo apt-get install vimvim默认的配置使用起来还不能让人满意,还需要自己配置默认配置文件是:/etc/vim/vimrc我们可以在家目录下建立自己的配置文件切换到家目录第二步:cd ~touch .vimrc (以.开头的为隐藏文
2013-12-02 20:26:15 1144
原创 python 模块和包
1.模块 模块是python组织代码的基本方式。python的脚本都是以.py为扩展名保存的文本文件。一个脚本可以单独运行,也可以导入另一个脚本中运行。当脚本被导入运行时,我们将其称为模块。 模块名与脚本的文件名相同!例如我们编写一个cal.py的脚本,则可以在另外一个脚本中用import cal语句来导入它进行相关运算操作。user1@ubuntu:~$ cd csvtpy/
2013-12-02 18:42:21 3160
原创 python 内建函数
abs(): 绝对值 max(): 最大值 min(): 最小值 len(): 序列(字符串、元组和列表)的长度 divmod(): 两个数的商和余数>>> divmod(5,2)(2, 1)>>> divmod(2,5)(0, 2) pow(): 幂次操作 round(): 转换为有一定精度的小数 callable():
2013-12-02 18:37:00 1229
原创 python switch函数
python并没有提供switch语句!python可以通过字典实现switch语句的功能。 1)首先,定义一个字典; 2)其次,调用字典的get()获取相应的表达式。#!/usr/bin/python#coding:utf8from __future__ import division#使除非操作自动识别小数结果def jia(x,y): return x+yd
2013-12-02 18:29:42 4600
原创 python lambda函数
lambda:匿名函数lambda函数是一种快速定义单行的最小函数,从Lisp借用而来,可以用在任何函数的地方。lambd语句中,冒号前是参数,可以有多个以逗号分开的参数;冒号后面是返回值。lambda语句构建的其实是一个函数对象.>>> g = lambda x,y:x+y>>> g at 0x23556e0>reduce为逐次操作list里的每一项,接收的参数为两个,最
2013-12-02 18:28:06 1209
原创 python 函数多实参处理
向函数传元组和字典:f(*t) 和 f(**d) 处理多余实参:f(x,*args,**kargs)user1@ubuntu:~$ pythonPython 2.7.3 (default, Sep 26 2013, 20:03:06) [GCC 4.6.3] on linux2Type "help", "copyright", "credits" or "license" for
2013-12-02 18:24:11 1720
原创 python return语句
函数返回值: 1)函数被调用后会返回一个指定的值 2)函数调用后默认返回None 3)return返回值 4)返回值可以是任意类型 5)return执行后,函数终止 6)区分返回值和打印user1@ubuntu:~$ pythonPython 2.7.3 (default, Sep 26 2013,
2013-12-02 18:21:31 5390
原创 python函数全局变量和局部变量
#!/usr/bin/python#coding:utf8x = 'i am global var'#全局变量def fun(): x = 100 #局部变量 global y #强制声明全局变量 y = 200 print xfun() #局部变量 x=100print x #全局变量
2013-12-02 18:20:06 4453
原创 python函数形参和实参
#!/usr/bin/python#coding:utf8 #中文输入方式1#coding=utf8 #中文输入方式2#encoding:utf8 #中文输入方式3#encoding=utf8 #中文输入方式4#-*- coding:utf8 -*-#中文输入方式5print '*'*35print "实现输入两个变量的比较功能:"def fun(x,y):#
2013-12-02 18:16:43 5517
Source code of OpenCV By Example
2017-03-28
OpenCV By Example (OpenCV3)
2016-02-02
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人