刚开始代码的实现如下:voidCreateFIFO(){if((mkfifo(FIFOPATH,O_CREAT|O_EXCL|O_RDWR)<0)&&(errno!=EEXIST)){printf(strerror(errno));}}intOpenFIFO(){fd=open(FIFOPATH,O_RDWR|O_NONBLOCK);returnfd;}觉得非常的不优雅,毕竟需要调用两个函数,而且写函数又有一..
分类:
其他好文 时间:
2014-09-08 10:59:37
阅读次数:
499
首先阅读readme文件,要求
To build the source, edit the Make.defines.* file for your system and set WKDIR to the pathname of the tree containing the source code. Then just run "make".
我的系统环境是Linux的,因此修改....
分类:
其他好文 时间:
2014-09-08 09:38:36
阅读次数:
278
如果你的IPTABLES基础知识还不了解,建议先去看看.开始配置我们来配置一个filter表的防火墙.(1)查看本机关于IPTABLES的设置情况[root@tp ~]# iptables -L -nChain INPUT (policy ACCEPT)target prot opt source ...
分类:
系统相关 时间:
2014-09-07 19:45:25
阅读次数:
372
在Ubuntu 12.04以及基于Ubuntu的发行版上安装fcitx小企鹅输入法,并安装Linux版本搜狗输入法。
方法: 提供两种输入法,一种添加PPA安装,第二种直接添加源安装。
下面是第二种直接安装(个人觉得比较方便:)
实现过程:
先 卸载ibus输入法:
sudo apt-get remove ibus
然后
sudo gedit /etc/apt/source...
分类:
其他好文 时间:
2014-09-07 09:50:24
阅读次数:
249
Encoding::UndefinedConversionErrorinProductsController#create"\xFF"fromASCII-8BITtoUTF-8在使用ruby1.9.3做上传照片的时候,报这个错误,解决办法是将控制器里的File.open("#{Rails.root}/app/assets/p_w_picpaths/"+new_name,"w"){|file|file.write(img_data)}换为File.o..
分类:
其他好文 时间:
2014-09-07 03:22:55
阅读次数:
199
/**
* Sets the port of the local Socks5 proxy. Default is 7777. If you set the port to a negative
* value Smack tries the absolute value and all following until it finds an open port.
...
分类:
其他好文 时间:
2014-09-07 03:18:54
阅读次数:
250
/**
* Sets the port of the local Socks5 proxy. Default is 7777. If you set the port to a negative
* value Smack tries the absolute value and all following until it finds an open port.
...
分类:
其他好文 时间:
2014-09-07 03:18:44
阅读次数:
207
1 /* 2 * Copyright (C) 2008 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you ...
分类:
移动开发 时间:
2014-09-07 02:12:44
阅读次数:
311
1.下载spring-framework3.2.7,取其中的lib文件。后缀为jar的是我们必须的文件,doc以及resource后缀分别是文档注释和源代码。在添加jar包的时候可以指定。
2. 创建用户的自定义的libray库。
3导入自定义的包,在导入的过程中可以指定包的source以及docs
4. 完成之后的效果图基本如下...
分类:
编程语言 时间:
2014-09-07 01:08:04
阅读次数:
235
有时候我们需要在dragMoveEvent, dropEvent这样的函数中进行一些判断, 过滤不合法的drag或者是区分不同类型的drag做不同的处理, 比如.代码大致如下:
void Scene::dragMoveEvent(QGraphicsSceneDragDropEvent *event)
{
if(event->source()********)
{...
分类:
其他好文 时间:
2014-09-07 01:07:44
阅读次数:
193