2014年4月4日

每天学一点linux:date,cal日期和时间的命令

摘要: 显示日期与时间的命令:date显示日历的命令:cal1.直接在终端输入date,显示当前日期和时间,包括年月日,时分秒[cx@Cking Desktop]$ date Fri Apr 4 20:40:53 CST 20142.设置显示格式: 按2014/04/04格式显示: [cx@Cking Desktop]$ date +%Y/%m/%d 2014/04/04 只显示时分: [cx@Cking Desktop]$ date +%H:%M 20:473.显示日历的命令:cal 在终端直接输入cal,显示当前月份:[cx@Cking Desktop]$ cal A... 阅读全文

posted @ 2014-04-04 20:54 敖天 阅读(388) 评论(0) 推荐(0) 编辑

每天学一点linux:LANG

摘要: 1.显示目前所支持的言语: []#echo $LANG zn_CH.UTF-8 #意思是说,目前的语言是(LANG)是zn_CH.UTF-82.修改语言: 假如原来的语言是中文zn_CH.UTF-8,改为英文,在终端输入:LANG=en_US (注意等号前后没有空格符) 阅读全文

posted @ 2014-04-04 20:20 敖天 阅读(304) 评论(0) 推荐(0) 编辑

每天学一点linux:echo的用法

摘要: 在终端输入man echo,可以看到echo的一些用法:ECHO(1) User Commands ECHO(1)NAME echo - display a line of textSYNOPSIS echo [SHORT-OPTION]... [STRING]... echo LONG-OPTIONDESCRIPTION Echo the STRING(s) to standard output. -n do not output the trailing newline -e enable interpretation of backslash escapes -E disable int 阅读全文

posted @ 2014-04-04 20:14 敖天 阅读(422) 评论(0) 推荐(0) 编辑

每天学一点c++:#if #ifdef #ifndef #elif #else #endif的用法

摘要: #if, #ifdef, #ifndef, #else, #elif, #endif的用法: 这些命令可以让编译器进行简单的逻辑控制,当一个文件被编译时,你可以用这些命令去决定某些代码的去留, 这些命令式条件编译的命令。常见的条件编译的三种形式: ①第一种形式: #ifdefined(或者是ifdef) [#else ] #endif②第二种形式: #if!defined(或者是ifndef) [#else ] #endif③第三种形式: #ifdef… [#elif…] [#elif…] #else… #end... 阅读全文

posted @ 2014-04-04 19:20 敖天 阅读(15717) 评论(0) 推荐(2) 编辑

每天学一点linux:在CENTOS linux下安装MPEG-1 Layer 3 (MP3)解码器

摘要: 安装了centos6.5,打开音乐时,提示没有安装MPEG-1 Layer 3 (MP3)解码器,于是在网上搜索MPEG-1 Layer 3 (MP3),找到解决方法,安装第三方源(32位的):http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm安装完源之后再用播放器播放音频然后搜索,等待就行了。 阅读全文

posted @ 2014-04-04 19:11 敖天 阅读(889) 评论(0) 推荐(0) 编辑

2014年4月2日

每天学一点linux:wget的用法

摘要: wget用来从互联网上下载东西的,wget http://mirror.centos.org/centos/6.5/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm指定下载路径:用-P 比如指定下载到/home/cx下wget -P /home/cx http://mirror.centos.org/centos/6.5/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm 阅读全文

posted @ 2014-04-02 00:41 敖天 阅读(218) 评论(0) 推荐(0) 编辑

2014年3月31日

每天学一点c++:##

摘要: ##连接前后的内容,使之成为一个整体示例:#include #include using namespace std;#define concatenate(x) x ## yint main(){ string xy ="Hello,World!"; cout << concatenate(x,y) <<endl; return 0;}cout << concatenate(x,y) <<endl;等同于cout << xy <<endl; 阅读全文

posted @ 2014-03-31 16:49 敖天 阅读(170) 评论(0) 推荐(0) 编辑

每天学一点c++:#

摘要: #是预处理宏#define使用的,#使#后的第一个参数返回一个带双引号的字符串示例:#include using namespace std;#define toString(s) # sint main(){ cout << toString(Hello World!) <<endl; return 0;}cout << toString(Hello World!) <<endl;可以看做是cout << "Hello World!" <<endl;输出Hello World! 阅读全文

posted @ 2014-03-31 16:31 敖天 阅读(208) 评论(0) 推荐(0) 编辑

每天学一点c++:c++命名空间

摘要: 在c语言中,当程序达到一定的规模之后,会遇到的一个问题是我们“用完”了函数名和标识符。当然,并非真的用完了,只是简单的想出一个有意义的新名称不太容易了。在C++中,有预防这种冲突的机制:namespace关键字。只要标识符定义在不同的空间中,就不会产生冲突。如果要使用某个命名空间中的声明或定义,就用关键字using,比如using namespace std;定义一个命名空间:namespace MyNamespace{ //Declarations声明序列}使用命名空间:不使用using指令,这个命名空间的所有名字都需要被完全限定:#includeint main(){ st... 阅读全文

posted @ 2014-03-31 09:53 敖天 阅读(218) 评论(0) 推荐(0) 编辑

2014年3月30日

每天学一点c++:c++常用的头文件介绍

摘要: c++常用的头文件:#include//STL通用算法#include//STL位集容器#include //包含的宏和信息用于添加有助于程序调试的诊断。#include//字符处理#include//定义错误码#include//定义本地化函数#include//定义数学函数#include//复数类#include//定义输入/输出函数#include//定义杂项函数及内存分配函数#include//字符串处理#include //定义关于时间的函数#include//宽字符处理及输入/输出#include//宽字符分类#include//STL双端队列容器#includ... 阅读全文

posted @ 2014-03-30 23:37 敖天 阅读(541) 评论(0) 推荐(0) 编辑

导航