自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(37)
  • 资源 (3)
  • 收藏
  • 关注

原创 gitHub git Windows下开发环境搭建

安装虚拟机,并配置网络           安装VMware workstations, 并在上面安装Centos系统;           在安装的过程中, 将网络设置成桥接模式, 就可以在虚拟机上直接访问外网(只要主机能够访问            的网站,虚拟机也同样可以访问)            在虚拟机上配置gcc g++编译环境           使用r

2016-01-25 10:02:57 335

转载 git 使用 教程

转自: http://www.admin10000.com/document/5374.html一:Git是什么?  Git是目前世界上最先进的分布式版本控制系统。  二:SVN与Git的最主要的区别?  SVN是集中式版本控制系统,版本库是集中放在中央服务器的,而干活的时候,用的都是自己的电脑,所以首先要从中央服务器哪里得到最新的版本,然后干活,干完后,需要把自己做完

2016-01-22 09:11:47 353

原创 python linux 脚本执行

有两种方式:1、直接使用python *.py执行。其中python可以写成python的绝对路径。使用which python进行查询。2、在文件的头部写上 #!/usr/bin/python ,这个地方使用python的绝对路径,就是上面用which python查询来的结果。然后在外面就可以使用./*.py执行了。代码:ngnsvr12 [** NONE **]/

2015-11-13 11:17:59 486

原创 Python 登录系统

代码:#!/usr/bin/env pythondb = {}#newuser processdef newuser():    prompt = 'login desired: '    while True:        name = raw_input(prompt)        if db.has_key(name):           

2015-11-12 15:26:45 609

原创 Python check passwd

代码:passwdList=['initial']valid = Falsecount = 3while count > 0: #3 times input    input = raw_input("input passwd: ")    #check passwd    for eachpasswd in passwdList:        if input

2015-11-12 14:09:45 437

原创 Python 最大公约数

代码:num = int(raw_input("please input a data: "))count = num/2while count>0:    if num%count == 0:        print count, 'is the largest factor of', num        break;    count -=1运行

2015-11-12 13:55:50 485

原创 Python ping ip

代码:import subprocessimport stringimport osimport syscmd="cmd.exe"type = sys.getfilesystemencoding()#save code errorSection = int(raw_input("please input right IP(example:135.251.148.15

2015-11-12 09:55:13 420

原创 cots 常见问题解答

1. 如何手动更改板子类型和槽位号?            需要更改虚拟机的appl.xml的appid和type,以及/etc/rc.local的tipc-config -addr。        步骤:        a. 登录虚拟机;        b. cd /opt/v7510/share/inputs                [root@vmm04-18

2015-11-12 09:44:40 511

原创 shell中嵌套使用expect 实例

#!/bin/shusername=hailonxiecho $#i=1###参数都放在数组a中for args in $@do    a[i]=$args    i=($i+1)done###参数的数量numbernumber=${#a[@]}###获取要传的文件filename=${a[1]}###分别处理各个参数

2015-09-29 15:00:03 4506

原创 守护进程 linux 实例

代码:#include #include #include #include #include #include #include void init_daemon(void){    int pid;    int i;    //first process    if (pid=fork())    {        exit(0

2015-08-20 15:55:56 235

原创 linux shell strace 使用 实例

代码:// 打印helloworld 代码ngnsvr9 [** NONE **]/home/xionghailong/shell $ cat main.c//main.c#include int main(){        printf("Hello world!\n");}编译:ngnsvr9 [** NONE **]/home/x

2015-08-18 11:03:35 440

原创 linux 进程间通信 signal() 函数

使用signal()函数捕捉信号 进行处理代码:ngnsvr9 [** NONE **]/home/xionghailong/example $ cat signal.c #include #include #include void my_func(int sign_no){        if (sign_no == SIGINT)        {

2015-08-12 14:36:27 328

原创 linux 进程间通信 信号量

实例中首先使用fork() 创建一个子进程, 在父进程调用kill() 之前, 在子进程中使用raise() 向自身发送SIGSTOP信号,是子进程暂停。接下来使用kill()向子进程发送信号代码:ngnsvr9 [** NONE **]/home/xionghailong/example $ cat kill_raise.c #include #include #in

2015-08-12 14:02:08 265

原创 linux 文件操作 --copy_file

代码:ngnsvr9 [** NONE **]/home/xionghailong/example $ cat copy_file.c #include #include #include #include #include #include #define BUFFER_SIZE 1024#define SRC_FILE_NAME "src_file"

2015-08-11 12:34:25 1043

原创 linux driver 简单实例

#include #include #include static int __init hellokernel_init(void){    printk(KERN_INFO "hello kernel!\n");    return 0;}static void __exit hellokernel_exit(void){    printk(K

2015-07-28 13:31:07 613

原创 设计模式---职责链模式 实例

代码如下:#include #include using namespace std;class manager{    protected:        manager *m_manager;        string m_name;    public:        manager(manager *n_manager, s

2015-07-03 13:25:21 351

原创 设计模式----单例模式 实例

代码:#include  using namespace std;template  class Singleton  {  public:      static T* instance()      {          if( !t_ )                     {              t_ = new T()

2015-07-01 13:49:51 305

原创 设计模式---备忘录模式 实例

代码:#include  #include  using namespace std;//保存要备忘的状态class Memento {  private:      string state;    public:        Memento()      {          state = "";      }     Mem

2015-06-26 09:59:51 530

原创 设计模式----适配器模式 实例

代码如下:#include #include using namespace std;class player{    public:            virtual void attack() = 0;        virtual void defense() = 0;};class forwards : public pl

2015-06-25 13:18:02 317 1

原创 设计模式----状态模式 实例

代码:#include       using namespace std;    class Work;    /*状态接口State*/  class State  {  public:      virtual void WriteProgram(Work *w) = 0;  };    //工作类  class Work  

2015-06-23 14:02:38 364

原创 设计模式----观察者模式 实例

代码:#include  #include  using namespace std;  class Account;//Observer抽象类,用作接口  class Observer  {  protected:    Account *account;  public:    Observer(Account *account):acc

2015-06-11 13:34:26 303

原创 设计模式---建造者模式 实例

代码:#include using namespace std;class builder    {  public:      virtual void buildPartA() = 0;      virtual void buildPartB() = 0;      };  //builder1class builder1 : public b

2015-05-29 13:57:42 391

原创 设计模式---外观模式 实例

代码:#include using namespace std;class stock{    public:        virtual void sell() = 0;        virtual void buy() = 0;};class stock1 : public stock{    public:        void

2015-05-28 12:55:55 523

原创 设计模式---模板模式 实例

代码:#include #include using namespace std;class abstractClass{    public:        void commonQuest1()        {            cout            cout            cout            cout

2015-05-27 14:45:15 298

原创 设计模式----模型模式 实例

代码:#include #include using namespace std;class object{    public:    object(){}    virtual ~object(){}    virtual object* clone() = 0;};class resume : public object{

2015-05-22 15:51:32 297

转载 设计模式 --- 工厂模式 实例

软件领域中的设计模式为开发人员提供了一种使用专家设计经验的有效途径。设计模式中运用了面向对象编程语言的重要特性:封装、继承、多态,真正领悟设计模式的精髓是可能一个漫长的过程,需要大量实践经验的积累。最近看设计模式的书,对于每个模式,用C++写了个小例子,加深一下理解。主要参考《大话设计模式》和《设计模式:可复用面向对象软件的基础》两本书。本文介绍工厂模式的实现。       工厂模式属于创建型

2015-05-19 16:16:49 282

原创 设计模式---代理模式 实例

#include #include using namespace std;class schoolGirl{    private:        string m_name;    public:        schoolGirl(string girl_name):m_name(girl_name){}        string getname

2015-05-19 12:56:03 259

原创 设计模式---装饰模式 实例

#include #include using namespace std;class Phone{public:    Phone() {}    virtual ~Phone() {}    virtual void ShowDecorate() {} };class iPhone:public Phone{private:   

2015-05-19 10:25:07 295

原创 设计模式---策略模式 实例

策略模式将算法封装到一个类里面,通过组合的方式将具体算法的实现在组合对象中实现,再通过委托的方式将抽象接口的实现委托给组合对象实现将算法的逻辑抽象接口封装到一个类中,再通过委托的方式将具体的算法实现委托给具体的策略类来实现。代码实例:#include using namespace std;基类:class cashSuper{    pub

2015-05-14 14:21:29 291

原创 设计模式--简单工厂模式 实例

main.cpp: #include  #include using namespace std;#include "operation.h"#include "operationAdd.h"#include "operationSub.h"#include "operationMul.h"#include "operationDiv.h"#inclu

2015-05-08 13:17:29 379

原创 c++ 随机数产生

在c++中,有两个函数,一个用于设置随机种子,一个用种子产生随机数;void srand( int seed)  产生随机种子int rand() 产生随机数一般使用srand,一般将time函数返回值作为参数。代码:#include#include#includeusing namespace std;int main(){        srand(

2015-01-21 15:29:50 713

原创 字符串 操作

先上代码:ngnsvr9 [** NONE **]/home/xionghailong/c++/string $ cat string.cpp#include #include using namespace std;int main(){        string input;        int i=0;        int cat_find = 0;

2015-01-21 14:56:38 237

原创 数组 传入 函数

1, 函数调用数组时,只需要使用数组名字     int value[8];     sum_arr(value);2, 声明该函数    int sum_arr(int value[ ]);3, 对于多维数组比较特殊,要指定除首个之外的每个维度的大小    int sum_array( int value[ ][ 8]); 数组提供的内存大小是固定的,在编写程序的

2015-01-19 10:58:51 1273 2

原创 C++ 文件操作

代码:ngnsvr9 [** NONE **]/home/xionghailong/c++/file/local_file $ cat local.cpp#include #include #include using namespace std;int main(){        //同时可以读写        fstream file ("score.tx

2015-01-14 16:11:05 320

原创 C++ 文件读取与写入

先上一个简单的例子:代码ngnsvr9 [** NONE **]/home/xionghailong/c++/file $ cat file.cpp#include #include using namespace std;int main(){        ifstream file_reader ("file.txt");        if (! fil

2015-01-13 15:12:13 395

原创 子类父类 构造函数和析构函数的执行顺序

探讨这一块的内容,理论就不在叙述了,以例子进行说明:代码:ngnsvr9 [** NONE **]/home/xionghailong/c++/boy $ lsboy.cpp  boy.cpp.bakngnsvr9 [** NONE **]/home/xionghailong/c++/boy $ cat boy.cpp#includeusing namespace std;

2015-01-13 10:04:51 1232

原创 程序分解以及Makefile 编写

开始时程序:ngnsvr9 [** NONE **]/home/xionghailong/c++ $ cat orig.cpp#includeusing namespace std;struct Node{        Node *p_next;        int value;};Node* addNode (Node* p_list, int

2015-01-09 14:56:10 432

lua openresty

openresty 后端服务器 高并发 高可靠性 lua 高扩展性 快捷搭建

2018-07-31

计算广告 程序化营销

计算广告 程序化营销 互联网 算法 信息流 banner 个性化精准投放

2018-07-31

深入理解c++11

学习c++11 首选书籍,细致讲解c++11 的新特性以及使用方法。

2018-05-14

空空如也

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

TA关注的人

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