2013年12月8日

inet_ntop(), inet_pton() inet_ntoa(), inet_aton(), inet_addr, htons(), htonl(), ntohs(), ntohl() struct hostent ,struct sockaddr_in

摘要: http://xuxiaozhao163.blog.163.com/blog/static/3793592200810182506818/#include const char *inet_ntop(int af, const void *src,char *dst, socklen_t size);int inet_pton(int af, const char *src, void *dst);Example// IPv4 demo of inet_ntop() and inet_pton()struct sockaddr_in sa;char str[INET_ADDRSTRLEN];/ 阅读全文

posted @ 2013-12-08 15:36 anfflee 阅读(1135) 评论(0) 推荐(0) 编辑

2013年12月5日

gethostbyname尽量少用

摘要: Unix/Linux下的gethostbyname函数常用来向DNS查询一个域名的IP地址。 由于DNS的递归查询,常常会发生gethostbyname函数在查询一个域名时严重超时。而该函数又不能像connect和read等函数那样通过setsockopt或者select函数那样设置超时时间,因此常常成为程序的瓶颈。有人提出一种解决办法是用alarm设置定时信号,如果超时就用setjmp和longjmp跳过gethostbyname函数(这种方式我没有试过,不知道具体效果如何)。 在多线程下面,gethostbyname会一个更严重的问题,就是如果有一个线程的gethostbyname发生阻塞 阅读全文

posted @ 2013-12-05 23:32 anfflee 阅读(1750) 评论(0) 推荐(0) 编辑

2013年9月5日

log4net

摘要: http://www.cnblogs.com/wangsaiming/archive/2013/01/11/2856253.html 阅读全文

posted @ 2013-09-05 17:06 anfflee 阅读(97) 评论(0) 推荐(0) 编辑

2013年9月2日

session 和 cookie的区别

摘要: 1.session数据存储在服务器端,客户端只得到一个session id;cookie存储在客户端,服务器端也能知道其数据,因此 session比cookie更安全;2.session依赖cookie,session id被转化成特定的cookie,或者说session id存储在cookie里,也可以设置不存在cookie中,我们叫做session cookie,以区别persistent cookies,也就是我们通常所说的cookie,注意session cookie是存储于浏览器内存中的,并不是写到硬盘上的;3.在客户端session id的是否使用coockie存储需要根据实际情况 阅读全文

posted @ 2013-09-02 12:01 anfflee 阅读(156) 评论(0) 推荐(0) 编辑

2013年8月23日

Android短信拦截

摘要: http://www.cnblogs.com/GarfieldTom/archive/2012/08/25/2655609.html 阅读全文

posted @ 2013-08-23 20:19 anfflee 阅读(126) 评论(0) 推荐(0) 编辑

遍历Map的四种方法

摘要: public static void main(String[] args) {Map map = new HashMap();map.put("1", "value1");map.put("2", "value2");map.put("3", "value3");//第一种:普遍使用,二次取值System.out.println("通过Map.keySet遍历key和value:");for (String key : map.keySet()) {Sy 阅读全文

posted @ 2013-08-23 15:16 anfflee 阅读(141) 评论(0) 推荐(0) 编辑

2013年8月19日

android 内部存储

摘要: 重要数据存储在不宜删除修改的内部http://blog.csdn.net/hudashi/article/details/8037076 阅读全文

posted @ 2013-08-19 15:58 anfflee 阅读(102) 评论(0) 推荐(0) 编辑

2013年8月12日

Android获取Root权限

摘要: Android获取Root权限http://jingyan.baidu.com/article/870c6fc3d5afa1b03fe4bea4.htmlandroid superuser.apk 管理root权限原理分析http://blog.csdn.net/dairyman000/article/details/8072029how to get root access and execute commands in your Android application ?http://hi.baidu.com/justtmiss/item/c629f7c6ff628367f6c95d1aa 阅读全文

posted @ 2013-08-12 17:49 anfflee 阅读(205) 评论(0) 推荐(0) 编辑

2013年8月1日

常见android手机分辨率(xxhdpi,xhdpi)

摘要: 手机常见分辨率:4:3VGA 640*480 (Video Graphics Array)QVGA 320*240 (Quarter VGA)HVGA 480*320 (Half-size VGA)SVGA 800*600 (Super VGA)5:3WVGA 800*480 (Wide VGA)16:9FWVGA 854*480 (Full Wide VGA)HD 1920*1080 High DefinitionQHD 960*540720p 1280*720 标清1080p 1920*1080 高清手机:iphone 4/4s 960*640 (3:2)iphone5 1136*640小 阅读全文

posted @ 2013-08-01 10:08 anfflee 阅读(881) 评论(0) 推荐(0) 编辑

2013年7月31日

How to achieve the boot, clear cache, kill the process, floating windows single double-click to distinguish, with source

摘要: 程序退出时删除cachehttp://stackoverflow.com/questions/8326852/how-to-delete-cache-folder-of-appHow to boot, clear cache, kill the process, floating windows single double-click to distinguish, with source codeFirst, the start-upMany mobile phone software with boot, sometimes let the software start-up will b 阅读全文

posted @ 2013-07-31 16:07 anfflee 阅读(740) 评论(0) 推荐(0) 编辑

导航