Author Archives: tunpishuang

About tunpishuang

just 4 fun·····

关于apache Alias斜杠/的实验

Alias /icons/ "D:/wamp/bin/apache/Apache2.2.17/icons/" 访问http://localhost/icons/正常,访问http://localhost/icons 404 Alias /icons "D:/wamp/bin/apache/Apache2.2.17/icons" 访问http://localhost/icons自动加上后面的/,正常。 Alias /icons "D:/wamp/bin/apache/Apache2.2.17/icons/" 访问http://localhost/icons自动加上后面的/,正常。 Alias /icons/ "D:/wamp/bin/apache/Apache2.2.17/icons" 访问http://localhost/icons/xx.gif,404,访问http://localhost/icons 404 Not Found。 所以结论是Alias后面的虚拟路径后面不要加多余的/,后面的文件系统路径加不加/就随便你了。

Tagged | Leave a comment

vs2005 未能完成操作。未指定的错误

具体解决过程是这样的:         1、先把.vcproj 文件剪切到其他地方         2、打开.sln,报错-》点“确定”-》再点“确定”         3、把 .vcproj 文件 放回来,在vs2008右边的“解决方案”处右键 重新加载,就可以了。

Tagged | Leave a comment

VC编译curl 7.19.0

打开curl-7.19.0\vc6curl.dsw F7编译。报错: D:\win32dev\curl-7.19.0\lib\ldap.c(49) : fatal error C1189: #error :  Your Platform SDK is NOT sufficient for LDAP support! Update your Platform SDK, or disable LDAP LDAP support! 如果不需要编译出来的libcurl.lib支持LDAP,在VC菜单Project->Settings->c/c++->Preprocessor definitions加上:CURL_DISABLE_LDAP 在vc2005下一切正常。无需添加这个CURL_DISABLE_LDAP。 用nmake编译curl 7.24.0 D:\dev\curl-7.24.0\winbuild>nmake /f Makefile.vc mode=static VC=6 USE_SSPI=no US E_IPV6=no … Continue reading

Tagged , | Leave a comment

WSAETIMEDOUT&WSAECONNREFUSED

WSAETIMEDOUT 10060   Connection timed out. A connection attempt failed because the connected party did not properly respond after a period of time, or the established connection failed because the connected host has failed to respond. WSAECONNREFUSED 10061   Connection … Continue reading

Tagged , , | Leave a comment

Google Maps JavaScript API v3 dblclick双击事件冒泡

After registering e.g. a dblclick handler on a Rectangle, how do I  prevent that event from triggering another handler as well (e.g. map  zoom)?  google.maps.event.addListener(area, ‘dblclick’, function(event) { // do something, but don’t zoom in! }); 在地图上双击后会触发zoom in。 那么如何停止触发zoom in呢,可以让MapOptions对象的disableDoubleClickZoom设置为true。 … Continue reading

Tagged | Leave a comment

feedsky种子换地址了

http://feed.feedsky.com/it_trans 转到 http://feed.feedsky.com/techguru 因为更容易记住,并且feedsky手动ping完全没有效果,说的是几分钟内生效,但是等了一下午还是没反应。我只是想删除应该加密的日志而已。但是feedburner立刻就ping完就生效了。并且我有一个07年新建的feed种子现在尽然无法管理了,点击直接返回【我的feed】页面。太奇怪了。太无语了。已经反馈给feedsky。很多订阅的it_trans的朋友,我表示抱歉。这次估计你们在feed reader里面也看不到了,因为我先斩后奏已经转到了techguru。算是重新开始一段新的旅程吧。 最后,两个feed地址: http://feeds.feedburner.com/techgurucn (墙外) http://feed.feedsky.com/techguru (墙内) update(2012.01.06) 两个(fb/fs)的feed种子都删除了,还是用tunps.com/feed吧

Tagged | Leave a comment

reading 2011.11

程序员们 不要想一辈子靠技术混饭吃(很多转载,自己搜) 天朝人民实用技术知识大全 (怎么坐飞机,怎么坐月子…太tmd的实用了) 《看客》第117期:山城“贫民窟” 《看客》第116期:人在“堵”途 Using libcurl with SSH support in Visual Studio 2008 Using libcurl in Visual Studio 将中文版VC转换为英文版的方法 什么是far、near关键字? 科索沃战争 Easter Eggs in Captain America 南斯拉夫 《看客》第111期:“犹太方舟”以色列

Tagged | Leave a comment

warning C4018: “<”: 有符号/无符号不匹配

一般是int和unsigned比较的时候报错。转为一致的数据类型即可。 比如 int sent = 0; while (sent<strlen(query)) { //…. } strlen的返回值是size_t,也就是unsigned。而sent为int。将sent改为unsigned。

Tagged | Leave a comment

转换字符串为16进制int /转换json \uXXXX码为可识别的中文 [C语言]

#include <stdio.h> int i; char *str1 = “cdef”; sscanf(str1,”%x”,&i); printf(“%x\n”,i); str1是需要转换成16进制int型的字符串。最后将”cdef”转为0xcdef。有些人问这个有什么鸟用呢。其实总所周知javascript object notation表示cjk字符串的形式是:\uXXXX,XX都是0~15(0~F)的数字。使用如下代码: DWORD dwNum; WCHAR str[10]={0}; char str2[10]={0}; str[0] = 0x751f;//生 str[1] = 0x65e5;//日 str[2] = 0x5feb;//快 str[3] = 0x4e50;//乐 str[4] = 0×0001;// dwNum = WideCharToMultiByte(CP_OEMCP,0,(LPCWSTR)str,-1,NULL,0,NULL,FALSE); WideCharToMultiByte (CP_OEMCP,0,(LPCWSTR)str,-1,str2,dwNum,NULL,FALSE); printf(“%s”,str2); … Continue reading

Tagged , , | Leave a comment

ckeditor for wordpress 3.6.2.1 HTML转义bug

blogging的时候添加代码喜欢用<pre>标签,然后c代码里面有很多的#include <stdio.h>之类的头文件引用。在wysiwyg模式下输入<>后html模式下应该转义成&lt;和&gt;,但是这个bug直接转成了<>,当再切换到wysiwyg的时候,#include <stdio.h>已经变成了#include <stdio.h></stdio.h>。因为把<stdio.h>当成了一个html tag。This bug has been reported a week ago in this post. michal_cksource (the author of ckeditor) said bug has been fixed, but it will be available in next release.:(只能忍忍了,现在暂时用KindEditor.Everything is just fine.

Tagged | Leave a comment