自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(18)
  • 资源 (4)
  • 收藏
  • 关注

原创 进程间通信 信号量

有名信号量是全局,只要知道它的名字就可以使用它;无名信号量是局部,只能通过继承才能使用它; 相关函数:头文件:, , int semget(key_t key, int nsems, int semflg);              //创建或取得一个信号量组int semctl(int sem_id, int semnum, int cmd);     //信号量控制函

2012-09-03 09:44:39 1123

原创 C++派生类构造函数调用顺序

#include using namespace std;class A{public:     A()     {          a=0;          cout     }     A(int i)     {          a=i;          cout     }     ~A()     {

2012-08-28 16:12:00 456

原创 友元函数实例

#include using  namespace std;class Cla{public:    Cla(double d = 0)    { dat = d;    }    friend void inDat(Cla &d)    { cin >> d.dat;    }    friend Cla addDat(Cla d1,Cla d

2012-08-27 17:55:35 2266

原创 静态成员函数生命期

块级别的局部静态对象其作用域局部于块,但其生命周期与全局对象相同 ,只是在第一次遇见时分配空间并初始化。具体情况见实例:#include #include using namespace std;int count = 0 ;class myclass{    char cc;public:    myclass(char ch)    { ++co

2012-08-24 10:52:50 603

原创 函数指针实例

#include #include using namespace std;double func1(double x){    cout     return (1/x);}double func2(double x){    cout     return (x*x);}double func3(double x){    cout

2012-08-23 16:34:41 399

原创 int* p 与 int** p的区别

#include using namespace std;int func(int i1,int* pi21,int* &pi22,int &ri3,char* str){    cout     cout << "i1,*pi21,*pi22,ri3,str = " << i1 << " " << *pi21 << " " << *pi22 << " " << ri3

2012-08-23 15:04:29 767

原创 new delete的简单用法

#include using namespace std;int  main(){    struct str    { int a[10000];    };    str* temp;    int count = 0;    cout     for(int i = 0;i     { count++; temp = new str[1

2012-08-23 10:32:26 414

原创 简单排序算法

#include #include void Sort(int A[],int n){    int i = 1;    int ind;    int temp = 0 ;    for(i = 1;i     { ind = i; temp = A[i]; while(ind > 0 && temp  {     A[ind] = A[ind

2012-08-22 10:46:45 365

原创 shell脚本读取配置文件

#!/bin/shpack_install(){  echo "hello"  if [ $3 = "\"y\"" ];then  salt "$2" cmd.run "apt-get install --force-yes -y $1"  1>/dev/null 2>&1  fi}pack="elasticsearch"var=$(awk -F '=' '/\

2012-08-21 17:23:18 1170

转载 waitpid实例

#include #include #include #include #include int main(){        pid_t childpid,a;    int status;    childpid = fork();    printf("childpid = %d\n",childpid);    if ( childpid

2012-08-21 10:23:14 514

转载 线程同步

生产者而消费者的同步问题: #include #include #define BUFFER_SIZE 16 // 缓冲区数量struct prodcons{// 缓冲区相关数据结构    int buffer[BUFFER_SIZE]; /* 实际数据存放的数组*/    pthread_mutex_t lock; /* 互斥体lock 用于对缓冲区的互斥操作

2012-08-20 15:51:32 364

原创 新安装的ubuntu没有终端选项

有些时候新安装的环境没有终端,可以进行如下操作:sudo apt-get install nautilus-open-terminalnautilus -q执行完上述步骤后点右键既有终端选项

2012-07-23 14:50:08 2345

原创 如何在虛擬機上添加硬盤

1。增加前先关闭VM,然后编辑VM属性,增加一个vritual disk(scsi),其实是增加一个虚拟磁盘文件。hard disk2就是我新增加的2。查看目前的磁盘结构[root@mail ~]# fdisk -lDisk /dev/sda: 10.7 GB, 10737418240 bytes255 heads, 63 sectors/track, 1305 cyl

2012-05-02 09:36:39 587

原创 snmp自动发trap的实现

snmp自动发trap /* * Note: this file originally auto-generated by mib2c using *        : mib2c.notify.conf 17838 2009-11-25 20:35:23Z magfr $ */#include #include #include #include #inc

2012-03-28 17:33:13 3899 4

原创 自己创建mib2c.XXX.conf文件

今天在自己创建mib2c.xxx.conf文件的时候遇到了一些问题,所以把它记录下来。首先我想像执行mib2c -c mib2c.mfd.conf xxxTable命令一样可以生成mib file中所有和Table有关的节点,所以我在snmp的文件夹下创建了一个mib2c.xxx.conf的文件(在做这件事之前要确保你有一定的perl语言基础)然后在mib2c.conf直接run我们刚

2012-03-28 17:24:35 1912

原创 snmp mib2c 模板使用

近段时间一直在研究mib2c的使用问题,网上的资料不是很多,也介绍的不全面,希望这篇文章能帮助初学者。对于使用mib2c有很多选择,比如:mib2c.mfd.conf   mib2c.iterate.conf   mib2c.scalar.conf   等模板文件,前两者主要是针对table的,后者是针对scalar,对于我接触的人大部分都用的是iterate和scalar,但是我还是比较

2012-03-22 11:42:50 9374

原创 SNMP TRAP

今天写了一个关于snmp发trap命令的简单代码,仅供参考 #include #include #include #include #include #include #include #include #include #include"snmptrap.h"int snmptrap(trap_msg_s *p_data){ oid

2012-03-01 13:01:10 1217

原创 安装ecplise

最近项目需要,开始使用eclipse开发环境,在安装过程中遇到了一些问题,所以就把今天的学习记录下来,希望能和大家一起分享。 一、              安装JDK1.6               先下载安装JDK1.6              在/usr/local/下,或者/opt下解压jdk-6u26-linux-i586.bin.

2012-02-16 21:14:34 709

ExtJS基础入门

适合初学者掌握EXT的基础教程,最近才看完,感觉收获很大,所以想和大家一起分享……

2011-11-13

自绘BUTTON

本段代码主要是为初学MFC者设计,通俗易懂的例子包您一学就会……

2011-10-08

MFC自绘按钮的实现

此段代码主要实现了按钮的自绘及背景的修改,适合初学者参考……

2011-09-20

MFC 简易计算器

此段代码实现了简单计算器的功能,适合初学者参考……

2011-09-18

空空如也

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

TA关注的人

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