- 博客(17)
- 收藏
- 关注
原创 ubuntu如何启动和暂停rabbitmq-server
启动invoke-rc.d rabbitmq-server start暂停invoke-rc.d rabbitmq-server stop
2017-07-31 14:48:03 3148
原创 如何在ubuntu设置和查看环境变量
设置环境变量例: export RABBITMQ_CONFIG_FILE=/etc/rabbitmq/rabbitmq.configenv
2017-07-31 14:22:51 13048
原创 c++随机数简单用法
附上简单例子#include <ctime>#include <iostream>#include <cstdlib>using namespace std;int main() { srand(time(0)); int num; for(int i=0; i<10; i++){ num=rand() % 5;...
2017-07-30 20:52:34 237
原创 linux下c++sleep函数
sleep() 秒级usleep() 微秒级#include <iostream>using namespace std; #include <unistd.h>int main(){ while(1) { cout << "hello" << endl; //sleep(1); usleep(100000)
2017-07-30 19:38:04 80545 4
原创 c++ STL vector如何删除
#include <iostream>using namespace std;#include <vector>int main(){ std::vector<int> a = {1, 2, 3, 4}; for(auto i = a.begin(); i != a.end(); ) if(*i == 3) i = a.erase(i); else
2017-07-30 19:22:53 351
原创 c++switch的基本用法
switch只能接受整型和字符型:整型:#include <iostream>using namespace std;int main(void){ int a; while(true) { cin >> a; switch(a) { case 1: cout << "hi" << endl; break;
2017-07-30 15:08:38 61421 14
原创 linux下c++如何输入不回显且输入不用回车
参考链接下面代码实现的是输入一个小写字母只能看到大写字母#include <stdio.h>#include <termios.h> #include <unistd.h> #include <iostream>using namespace std;int main(void){ char c; static struct termi
2017-07-30 13:28:32 3205
原创 c++STL pair的基本用法
本文提供构造pair的三种简单方法的例子#include <iostream>using namespace std;int main() { pair<int, int> a; a.first = 0; a.second = 1; pair<int, int> b(1, 2); pair<int, int> c; c = make_pair(2,3); cout
2017-07-30 13:18:11 320
原创 python多线程 简单例子
多线程, 简单的理解就是让我们可以同时做多件事情, 以下为简单例子.import threadingdef first(): print("do one thing")def second(): print("do another thing")threads = []t1 = threading.Thread(target = first)threads.append(t1)t2
2017-07-29 19:08:49 235
原创 c++11多线程以及上锁的简单例子
多线程, 简单的理解就是让我们可以同时做多件事情, 以下为简单例子.#include <iostream>#include <thread>using namespace std;void first() { cout << "do one thing" << endl;} void second() { cout << "do another thing" <<
2017-07-29 19:05:30 1834
原创 linux下如何解决socket的error: [Errno 98] Address already in use
提供一个简单粗暴的方法: 在命令行输入: ps -fA | grep python将得到几行含类似 这样用户名 25041 25038 0 18:52 pts/4 . . . . 的数据输入命令 kill -9 25041 可以中断连接 对每一行数据都执行相同操作, 后面的数字即该行数据的第一个数字然后就不会报错了…不过这只是个临时的简单粗暴的方法…
2017-07-29 18:59:41 2603
原创 如何在sublime中去掉复制代码而产生的序号
1.点击左下角按钮, 选择Replace2.点击正则表达式按钮 3.在 Find What 输入正则表达式 ^\s*\d+ 4.点击右边的Replace All完成!
2017-07-29 14:26:12 1676 1
原创 linux如何在sublime中输入中文
githubgit clone https://github.com/lyfeyaj/sublime-text-imfix.gitcd sublime-text-imfix./sublime-imfix完成
2017-07-29 14:16:36 541
原创 用Python Socket进行简单的电脑间通信
服务端代码import socket s = socket.socket() host = socket.gethostname() port = 8080 s.bind((host, port)) s.listen(5) while True: c, addr =
2017-07-28 19:09:47 4750
原创 linux下rabbitmq SimpleAmqpClient客户端的使用的简单例子
本文将提供一个使用rabbitmq SimpleAmqpClient客户端的简单的例子编译方法
2017-07-28 19:00:19 4116
原创 linux下安装c++ rabbitmq客户端SimpleAmqpClient
linux下安装SimpleAmqpClient(注:本文以 github为基础,并加以说明,额 …就是菜鸟教程)安装boost-1.47.0下载官网 在官网找到适合的版本下载即可 打开目录后./bootstrap.sh./bjam大概需要运行5-10分钟安装rabbitmq-cgithub地址git clone https://github.com/alanxz/rabbitmq-c
2017-07-25 14:47:55 3605 2
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人