自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(34)
  • 收藏
  • 关注

原创 Javascript变量和属性的区别

变量和属性在javascript中的区别在很多文章中都说变量其实就是属性,但是它们之间有一定的区别,例如:在全局作用域下,var a = "hello";b = "hello";从字面上看,它们的区别是一个前面加了var,一个没有;它们的相同点都是全局的;那么a称之为变量,只不过它是全局变量;b称之为属性,它是window对象的属性,因为在全局作用域下,浏览器默

2016-01-27 15:54:00 3124 4

原创 Jquery一些有用的但是不是经常使用的方法和属性

下面总结一些Jquery中非常有用的但是不是经常使用的方法和属性:1. closest()定义和用法closest() 方法获得匹配选择器的第一个祖先元素,从当前元素开始沿 DOM 树向上。如$("li.level-1").closest("ul"): 表示首先找到li标签的class为level-1的元素,再次找匹配选择器(“ul”)的第一个祖先元素。所以它会返回

2016-01-27 09:15:31 407

原创 CSS一些不常用但是有用的属性

下面总结CSS一些不常用但是非常有用的属性:1. CSS text-indent 属性text-indent 属性规定文本块中首行文本的缩进。将段落的第一行缩进 50 像素:p { text-indent:50px; }持续的更新中。。。

2016-01-26 16:57:16 390

原创 浏览器和服务器证书信任概念理解

关于浏览器和服务器之间证书信任的问题证书分为两种:一种是证书,一种是根证书;证书是指颁发者信任被颁发者,根证书是被颁发者信任颁发者。让我们举例来更详细的分析这两种证书的区别:1. 如颁发证书的机构CSDN可以颁发这两种证书。2. 当CSDN把证书颁给小李,说明小李是被CSDN所信任的;3. 当CSDN把根证书颁给大李,说明大李是信任CSDN机构的;4. 那么小李和大李彼此信

2016-01-26 12:30:01 3137

原创 javascript自定义事件和方法的区别

一:首先看一下自定义事件和方法的实现方式1. Javascript的自定义事件:通常我们定义自定义事件的方法为:a. 定义 : this.MyClick = null;b.触发事件:在需要触发此事件的时候执行if(this.MyClick ){ //判断是否有定义,是防止其他模块没有注册此事件,导致调用Myclick()的时候出现exception    thi

2016-01-26 11:14:09 831 1

转载 解决了Could not get lock /var/cache/apt/archives/lock

在ubuntu apt-get upgrade的时候,遇到:E: Could not get lock /var/cache/apt/archives/lock – open (11 Resource temporarily unavailable)E: Unable

2011-09-06 18:51:28 2992

原创 Linux: Password for '(null)' GNOME keyring

If you input the svn + path, It will be happenedPassword for '(null)' GNOME keyringGenerally, this situation occured in changing the i

2011-09-06 14:18:47 1025

转载 Debian 参考手册

http://qref.sourceforge.net/Debian/reference/ch-tips.zh-cn.html

2011-08-03 14:08:25 424

原创 linux shell中内置命令总结中

Linux建立文件的命令:1. vim test.c 打开并保存退出,就相当于建立一个文件2. touch test.c :建立一个文件,当这个文件存在时,touch表示把此文件同步到最新的更新时间,这个特性会在编译等阶段,尤其是不改变文件内容时很有用3. echo

2011-08-01 14:22:59 1297 1

翻译 linux set 命令的应用

The following example redirects the standard output into a file by using the > operator. By default, if the file already exists, then it wil

2011-07-27 14:06:32 876

原创 GTest编译以及实例分析

GTest编译方法:1. Google test 代码下载svn下载:svn checkout http://googletest.googlecode.com/svn/trunk/ gtest-svn例如你把你的代码放在/usr/src/gtest-svn 2. GTest静态

2011-07-19 18:38:37 5087

原创 strlen和sizeof的区别

Strlen和sizeof有两个重要的区别:1. strlen计算字符串的长度时是不包含null byte; sizof计算字符串长度时是包含null byte的;2. 使用strlen会调用系统调用,sizeof在编译的时候就已经计算出相应的长度了。

2011-07-18 16:45:28 401

原创 Errno错误信息处理

Errno is a global variable, if you want to print the errno message about open error, and check why the error is happened.but the errno is an

2011-07-11 13:54:24 856

翻译 关于fork,exec,waitpid以及fgets换行替换为null的说明

The following example is from the apue sourecode,but it is a very good example for understanding the fork,exec,waitpid concept ,especially f

2011-07-11 11:25:53 705

转载 APUE源码编译

APUE2源码在Fedora14下的编译 最近重温APUE,附源码编译指南一份:1. 源码获取从APUE的官网下载源码;2. WKDIR修改编辑源码解压生成的apue.2e文件夹下的Make.defines.linux修改WKDIR=/home/sar/apue.2e为你的apu

2011-07-11 09:59:57 661

原创 Linux删除svn保存的密码和用户名

~/.subversion/auth/svn.simple/1233……把相关的username 下你自己的用户名和passwd下你自己的密码删掉,下次再对svn操作时就会让你重新输用户名和密码了。

2011-06-30 11:03:00 4192

原创 wc命令应用

wc:print newline,word,and byte counts for each filewc vera.txt : line num word num byte numwc –l vera.txt: line numset $(wc vera.txt)echo $1: line numecho $2: word numecho $3: byte numecho $4: vera.txt

2011-06-02 08:45:00 713

原创 shell find:查找文件的运用

<br />看起来似乎比较复杂:<br /><br />find .  /( -name “_*“  -or  -newer while2 /)  -type  f  -print<br /> <br />在当前目录下查找(名字以_为开始的文件或者是比while2文件更新的文件)文件,而且是文件。<br />-type f  : 指定为文件<br />-type d:指定为目录<br />-name “文件名”<br /> <br />find .  -name “_*“ -newer while2  -t

2011-05-31 08:45:00 20638

原创 grep:文件中查找字符串的运用

<br />You use find to search your system for files, but you use grep to search files for strings<br />grep [options] PATTERN [FILES]<br />If no filenames are given, it searches standard input.<br /> <br />$ grep  e$ words2.txt :在文件words2.txt中查找以e结尾的字符串<br

2011-05-31 08:40:00 937

原创 #define 宏函数的运用

<br />Write a format string to special file through the #define function and ##__VA_ARGS__ parameter.<br />The following list is a example of writing a format log to ./log file.<br /> <br />#include <stdio.h>#include <string.h>#define FormatLog(forma

2011-05-26 12:59:00 680

原创 Windows下查看Linux的共享文件

Ubuntu 下配置samba实现文件夹共享一. Install the samba:sudo apt-get insall sambasudo apt-get install smbfs二. Create the share directory:mkdir /home/phinecos/sharesodu chmod 777 /home/phinecos/share三. Create Samba config file:1. Bak the config filesudo cp /etc/samba/sm

2011-05-23 20:25:00 400

翻译 Shell中管道Pipes的运用

You can connect processes using the pipe operator ( | ). In Linux, unlike in MS-DOS, processes connected by pipes can run simultaneously and are automatically rescheduled as data flows between them. As a simple example, you could use the sort command to so

2011-05-20 14:01:00 472

翻译 Shell 重定向Redirection的应用

Other useful command:1.       nm –list symbols from object files2.       ar crv libfoo.a bill.o foo.ogcc –o hello hello.c libfoo.aor gcc –o hello hello.c –L. –lfooRedirect:Redirecting output: $ls –al > output.txt (if output.txt exist: overwriting the outpu

2011-05-20 14:00:00 508

原创 grep summary

It’s often convenient to use the grep command to search header files for particular definitions and func-tion prototypes. Suppose you need to know the name of the #defines used for returning the exit statusfrom a program. Simply change to the /usr/include

2011-05-18 19:11:00 248

原创 gcc compile option -D -U

You can use the gcc compile option -D -U to compile the soure code debug toggle:such as:/* hello.c */#include #ifdef YesDebugchar* str = "Yes, this is a macro.";#elsechar* str = "No, there is no macro.";#endifint main(){printf("%s/n",

2011-05-16 13:04:00 901

原创 Distinguish the specify code in different OS

To distinguish the OS: you can use the preprocessor: __linux__ and _WIN32 , thay sare known to the compiler. The source code example is:#ifdef __linux__   // Linux Includes Here#endif #ifdef _WIN32 || _WIN64   // Windows Includes Here #endif I'll address t

2011-05-16 12:53:00 340

原创 Vi learning

1. Vim --Linux IDE-some of usually shortcut if you look the source code.%跳转到配对的括号去[[跳转到代码块的开头去(但要求代码块中'{'必须单独占一行)gD跳转到局部变量的定义处''跳转到光标上次停靠的地方, 是两个', 而不是一个"mx设置书签,x只能是a-z的26个字母`x跳转到书签处("`"是1左边的键)>增加缩进,"x>"表示增加以下x行的缩进%跳转到配对的括号去[[跳转到代码块的开头去(但要求代码块中'{'必须单独占一行)g

2011-05-12 09:58:00 387

原创 Return value about System("command")

<br />System函数:<br />是由fork、execve和waitpid三个系统调用实现的。<br />例如执行:system("ls /tm") --返回值为256<br />所以如果execve出错,则直接调用_exit(256),所以变量ret的值等于256.<br />在system函数执行时,会启动一个子进程运行shell,然后通过将ls /tm作为参数传给shell,如果shell命令运行有错,就调用exit XXX作为system的返回值返回,而XXX是system函数的返回值,而

2011-05-11 14:32:00 502

原创 String data type: printf & cout output differently

Why is the output string irrecognizable by printf(%s)?for example:#include usingnamespace std;int main(){char mywords[6] = "hello";string mystring = mywords;cout printf("mystring : %s/n", mystring); //errorreturn 0;}Printf is a C function, it is not suppor

2011-05-11 11:11:00 284

原创 Debug 'The System cannot Execute the specified program' message

<br />If you have a program from other friends,but when you try to open it , it says "The System cannot Execute the specified program'"<br /> <br />The solution  is doing so:<br /><br />Go to this folder:<br />C:/Windows/WinSxS<br /><br />Search for the fo

2011-05-11 10:30:00 450

原创 Delete the .svn directory recursively

<br />Command:<br /> <br />Use the following command to delete the .svn or other file or directory recursively:<br />#find . -type d -name ".svn" |xargs rm -rf<br /> <br /> 

2011-05-11 10:20:00 429

原创 Fork and exit process

int fork()One process can create another process that is child process through fork(). fork() is called once but return twice. The different of twice return is returned 0 by child process but child ID by parent process.   The child process is the copy of t

2011-05-10 13:51:00 425

原创 Awk print the process ID

<br />Take the specify pidName to get the  correspondings Pid in /proc:<br />And redirect to the PidFile in current directory.<br /> <br />ps -e | grep pidName| awk /'{ print $1 }/' > ./PidFile

2011-05-10 11:08:00 320

原创 Ubuntu terminal maximum setting

<br />When you want to open the terminal maximum in Unbuntu, execute the following command:<br /><br /># sudo vi /usr/share/vte/termcap/xterm <br />finding...<br />:co#80:it#8:li#24:/<br /> <br />the 80 is height,24 is width, so you can set the ideal size

2011-05-09 09:22:00 351

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除