`
dewei
  • 浏览: 163052 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论
文章列表
痛苦了两周,FTP客户端可以正常使用,但VC++的FTP WinInet Api 报告错误 12003,后来发现windows资源管理器也报这个错误。 联系微软技术等了两周也没有解决掉。 在今天的电话沟通中,突然看到错误问题的截图上显示的是内网IP,我大胆猜测若此处是公网IP则可以正常访问。于是做了求证:   linux下执行以下命令: # echo 42.159.*.* > /etc/pure-ftpd/conf/ForcePassiveIP # service pure-ftpd-mysql restart 再次测试登录,已经正常了。  
查看某文件夹下文件的个数   ls -l |grep "^-"|wc -l 或 find ./company -type f | wc -l   查看某文件夹下文件的个数,包括子文件夹里的。   ls -lR|grep "^-"|wc -l   查看某文件夹下文件夹的个数,包括子文件夹里的。   ls -lR|grep "^d"|wc -l   说明: ls -l   长列表输出该目录下文件信息(注意这里的文件,不同于一般的文件,可能是目录、链接、设备文件等)   grep "^-&qu ...
//包含的头文件 #include <ctime> #include <iostream> #include <iomanip>   /*{{{ 显示100个月前的时间 */ std::time_t now = std::time(NULL); std::tm tm = *std::localtime(&now);//Unix时间戳转成结构 std::cout << "Today is " << std::put_time(&tm, "%Y-%m- ...
需求:在一段HTML里寻找超级链接中(正文文本)域名。   例如HTML内容如下: <div id="bdfs0" class="EC_im EC_fr EC_PP EC_idea1017 "><a id="dfs0" class="EC_t EC_BL" onmousedown="return c({'fm':'im','title':this.innerHTML,'url':this.href,'p1':1})" href="http://www.bai ...
序     真是天下文章一大抄,国内的牛人们在抄国外的开源项目,而小白们就在抄这些牛人的博客。在写这篇文章的时候,上网查了一下,才发现已经有很多牛人用中文翻译了类似的PHP的md5源码。     我从php源码5.2.17中提取并封装的MD5类代码如下: zmd5.h /* 这个类是通用MD5加密 by Dewei 2013-10-21 用法: #include "zmd5.h" std::string out = ZMD5::MD5("你好"); */ #ifndef ZMD5_H #define ZMD5_H ...
使用CURLOPT_NOSIGNAL后必须启用异步DNS,因此需要重新编译libcurl,使其支持c-ares。 curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1L);//禁用掉alarm信号,防止多线程中使用超时崩溃 curl_easy_setopt(curl, CURLOPT_FORBID_REUSE, 1L); //禁掉alarm后会有大量CLOSE_WAIT  -------------------------------------------下面自己编译libcurl支持c-ares下载c-ares:http://c-ares.haxx.s ...
//起因:在某些机器上无法使用GlobalMemoryStatusEx和GlobalMemoryStatus获取到正确的总内存大小 //可使用GetPhysicallyInstalledSystemMemory获取到。 //该函数只支持windows vista/7/8/server 2008/ server 2012 std::string s; s.resize(64); ULONGLONG *ptr_mem = new ULONGLONG; if (GetPhysicallyInstalledSystemMemory(ptr_mem)) { sprintf_s(&am ...
VisualStudio 2010 SP1环境   1、设置string默认编码为utf8,只需要在文件头部加入以下代码 #pragma execution_character_set("utf-8") //默认使用UTF8  2、debug提示窗口显示utf8,打开C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Packages\Debugger\autoexp.dat文件找到第412到413行,原文如下: std::basic_string<char,*>{ previe ...
streamstring在调用str()时,会返回临时的string对象。而因为是临时的对象,所以它在整个表达式结束后将会被析构。 如果需要进一步操作string对象,先把其值赋给一个string变量后再操作。 stringstream ss("012345678901234567890123456789012345678901234567890123456789"); //错误用法 const char* cstr2 = ss.str().c_str(); //正确用法 const string& str2 = ss.str(); const ...
$ echo '<?php phpinfo(); ?>' | php 2>&1 |grep -i ssl   Registered Stream Socket Transports => tcp, udp, unix, udg, ssl, sslv3, sslv2, tlsSSL => YesSSL Version => OpenSSL/0.9.8oSSL Support => enabledSSL => supportedopensslOpenSSL support => enabledOpenSSL Library Ver ...

shell命令运行符号

符号&;&&区别 command1 & command2 & command3     三个命令同时执行 command1; command2; command3     不管前面命令执行成功没有,后面的命令继续执行 command1 && command2             只有前面命令执行成功,后面命令才继续执行   竖线(|)——管道符号 管道符号,是unix功能强大的一个地方,符号是一条竖线:"|",用法: command 1 | command 2 他的功能是把第一个命令command 1执行 ...
本文转自:http://stackoverflow.com/questions/7602271/how-do-i-get-sum-function-in-mysql-to-return-0-if-no-values-are-found  Use IFNULL or COALESCE: SELECT IFNULL(SUM(Column1), 0) AS total FROM... SELECT COALESCE(SUM(Column1), 0) AS total FROM...  The difference between them is that IFNULL is a M ...
sqlite时间函数及时间处理 官方原址:http://www.sqlite.org/lang_datefunc.html   SQLite分页显示:Select * From news order by id desc Limit 10 Offset 10   SQLite 包括以下五个时间函数: date(日期时间字符串, 修正符, 修正符, ……) time(日期时间字符串, 修正符, 修正符, ……) datetime(日期时间字符串, 修正符, 修正符, ……) julianday(日期时间字符串, 修正符, 修正符, ……) strftime(日期时间格 ...
linux下: vim ~/.subversion/config windows下 %APPDATA%\\Subversion\\config 编辑此文件 [auto-props] *.html = svn:keywords=Id Reversion Date Author *.php = svn:keywords=Id Reversion Date Author *.css = svn:keywords=Id Reversion Date Author *.js = svn:keywords=Id Reversion Date Author 并启用auto-prop ...
今天又写了个函数,查找字符串首次出现位置,以此作为记录: /* {{{ 查找字符串首次出现的位置,没有找到返回 -1,两个字符串相等返回 0 在GCC下使用C99: int strpos(const char *haystack,const char *needle, _Bool ignorecase = 0) _Bool ignorecase =1 忽略大小写 时间:2012-08-17 By Dewei */ int strpos(const char *haystack,const char *needle, _Bool ignorecase = 0 ...
Global site tag (gtag.js) - Google Analytics