代码改变世界

阅读排行榜

HttpURLConnection模拟浏览器+网络数据抓取

2012-04-28 13:16 by javaspring, 517 阅读, 收藏,
摘要: /** *网页抓取方法 * @param urlString 要抓取的url地址 * @param charset 网页编码方式 * @param timeout 超时时间 * @return 抓取的网页内容\ * //http://blog.csdn.net/yjflinchong * @throws IOException 抓取异常 */ public static String GetWebContent(String urlString, final String charset, int timeout) throws IOException { if (urlString == . 阅读全文

tomcat 并发连接数+增大线程池

2012-08-20 14:38 by javaspring, 515 阅读, 收藏,
摘要: 最近服务器容易死掉,就寻找增大并发线程池的设置。。。在tomcat配置文件server.xml中的<Connector ... />配置中,和连接数相关的参数有: maxThreads : 最大线程数默认200minProcessors:最小空闲连接线程数,用于提高系统处理性能,默认值为10 maxProcessors:最大连接线程数,即:并发处理的最大请求数,默认值为75 acceptCount:允许的最大连接数,应大于等于maxProcessors,默认值为100enableLookups:是否反查域名,取值为:true或false。为了提高处理能力,应设置为false con 阅读全文

杭电2841 容斥定理求1到n之间和x互质的数的总数

2012-02-25 11:18 by javaspring, 511 阅读, 收藏,
摘要: 第一次写容斥定理,完全不懂啊,,,弱爆了。。。。。话说这道题最后就是判断横坐标和纵坐标两个值是否互质,如果互质则可以看到,否则看不到。题目:Visible TreesTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 593Accepted Submission(s): 225Problem DescriptionThere are many trees forming a m * n grid, the grid starts from... 阅读全文

Dojo—ajax框架实战

2012-08-25 08:08 by javaspring, 503 阅读, 收藏,
摘要: xhrGet 是 XHR 框架中最重要的函数,使用频率也最高。使用它即可以请求服务器上的静态文本资源如 txt、xml 等,也可以获取动态页面 php、jsp、asp 等,只要从服务器返回的是字符数据流即可。除了 xhrGet,Dojo 的 XHR 框架还包含 xhrPost,rawXhrPost,xhrPut,rawXhrPut,xhrDelete 。这几个函数与 xhrGet 类似,使用方法和参数都可以参考 xhrGet 。区别在于他们的 HTTP 请求类型,xhrPost 发送的是 Post 请求,xhrPut 发送的是 Put 请求,xhrDelete 发生的是 Delete 请求。下 阅读全文

Android Notifition的使用方法

2012-05-02 22:39 by javaspring, 502 阅读, 收藏,
摘要: Notification n=new Notification(R.drawable.ic_launcher,"hello world",System.currentTimeMillis());这是创建一个Notification 的对象,的一个参数是图标,显示在顶部,第二个参数是提示的类容,第三个参数是什么时候提示。PendingIntent pi=PendingIntent.getActivity(this, 0, new Intent(this,TestActivity.class), PendingIntent.FLAG_UPDATE_CURRENT);第一个参数是 阅读全文
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 126 下一页