自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 SSL - Simple of MD5/SHA

 -- sample of md5 --#include #include #include #include void printHex(unsigned char *hex, int length){ for (int i = 0; i < length; i++) printf("%02x", hex[i]); printf

2010-01-29 14:13:00 1848

原创 SSL - Simple of RSA

RSA属于不对称加密算法特点: 加密和解密使用完全不同又完全匹配的一对公钥和私钥-- RSA密钥产生RSA * RSA_generate_key(int bits, unsigned long e, void (*callback) (int,int,void *),void *cb_arg);-- RSA加密和解密int RSA_pub

2010-01-29 12:36:00 3288

原创 SSL - Simple of DES

 DES属于对称加密算法特点: 加密和解密使用相同的密钥This is a simple c program of SSL DES encrypt/decrypt.  /** * OPEN SSL Guide * http://www.openssl.org/docs/crypto/des.html

2010-01-29 12:31:00 1426

原创 C++ - 重载函数属性

 #include class A{public:        virtual void foo1() { printf("in A::foo1()/n"); }private:        virtual void foo2() { printf("in A::foo2()/n"); }}; // class B 继承 class A, 但是他改写

2010-01-22 11:42:00 854

原创 算法 - 反转一个单链表

/****************************************************/ ** This is sample program to reverse a point list ** ****************************************************/*********************************

2010-01-22 11:06:00 830

原创 C++ - 操作符重载

-- + -- 1. 作为成员重载class MyClass{public:    MyClass operator + (const MyClass & d) cons;     friend MyClass operator+(const MyClass& a1,const MyClass& a2);}; #######关于返回值类型的讨论#######

2010-01-20 14:47:00 627

转载 FW: SSH端口转发

 http://www.linuxeden.com/html/security/20091105/69003.html  ssh -g -L :: 转发本地端口到远端端口:, 中间经过转发

2010-01-14 15:59:00 720

原创 Usage sample of SSL

This is a sample how client and server to communicate over SSL. -- 1. server.c --/* * ++ * FACILITY: * *      Simplest SSL Server * * ABSTRACT: * *      This is an example of a S

2010-01-14 09:55:00 1018

原创 为Tomcat6.0配置HTTPS

TOMCAT_HOME=C:/Program Files/Apache Software Foundation/Tomcat 6.0JDK_HOME=C:/Program Files/Java/jdk1.5.0_11   -- Step 1: generate a key file -- C:/Program Files/Apache Software Foundati

2010-01-13 11:41:00 1209

原创 Usage sample of unix pipe

-- 无名管道 #include int pipe(int fd[2]) #无名管道通常不用在进程间通信。  -- 命名管道 #include #include int mkfifo(const char * pathname, mode_t mode)

2010-01-11 14:39:00 710

原创 Usage sample of unix Message Queues

 #include  int msgctl(int msqid, int cmd, struct msqid_ds *buf);int msgget(key_t key, int msgflg);int msgrcv(int msqid, void *msg_ptr, size_t msg_sz, long int msgtype, int msgflg);int

2010-01-11 14:26:00 690

原创 Usage sample of unix signal to handle function call with a timeout value.

Suppose a function "fun" can be blocked, and the its caller hope it will be returned back if "fun" is running too much long; in other words, "fun()" can be overwritten with "fun(int timeout)"  #

2010-01-10 15:12:00 825

原创 Usage sample of unix mutex and conditional

 pthread_mutex_initpthread_mutex_destroypthread_mutex_tpthread_mutex_lockpthread_mutex_unlockpthread_mutex_trylock  pthread_cond_t _cond;retVal = pthread_cond_ini

2010-01-10 14:16:00 788

原创 Usage sample of unix semaphore

There are two types of semaphore on unix system: -- System V信号量(命名信号量) #include int semctl(int sem_id, int sem_num, int command, ...);int semget(key_t key, int num_sems, int sem_flags);i

2010-01-10 14:04:00 948

原创 Usage simple of shared memory

 -- create a shared memory#: cat create.C#include #include #include using namespace std;int main(){    int shmid;    key_t key=0x1234;    //if((shmid=shmget(key,32,0666|IPC

2010-01-08 15:34:00 651

原创 ACE - Timer Management

-- ACE 自定义的代码例子 -- #include "ace/Reactor.h"#include "ace/Service_Config.h"#include "ace/OS_main.h"class Timeout_Handler : public ACE_Event_Handler{public:  Timeout_Handler (void)  

2010-01-07 10:49:00 933

原创 vim - 多窗口操作

$ vi -o file1.txt file2.txt   # 水平分割$ vi -O file1.txt file2.txt   # 垂直分割:split                         # 把当前文件水平分割:split another-file      # 把当前窗口水平分割, 并装入another-file:vsplit another-file 

2010-01-06 16:57:00 3015

转载 English

All right, then. Enjoy yourself. Thats what your twenties are for. Your thirties are to learn the lessons, your forties are to pay for the drinks.  

2010-01-06 14:40:00 722

原创 C++ - 动态调用共享库函数

1. 需求. 我们需要调用一个函数 std::string getValue(int index) 这个函数定义在库t1.so里面  2. t1.so #:cat t1.C#include extern "C"std::string getValue(int index){        switch(index)    

2010-01-05 17:10:00 2235

空空如也

空空如也

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

TA关注的人

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