上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 303 下一页
摘要: 题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=3003&rd=5858 比较简单。代码如下:#include #include #include #include using namespace std;#define Rate(win, i) ( (double)(win) / (double)(i) * 100)#define PRECISE 0.000001class WinningRecord{public: vector getBestAndWorst(string games);};ve 阅读全文
posted @ 2013-07-08 14:13 xinyuyuanm 阅读(207) 评论(0) 推荐(0) 编辑
摘要: MainActivity如下:package cn.testfinish;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;/** * Demo描述: * 覆写Activity的finish()方法 * 一般情况下当调用finish()方法时,会调用onDestroy() * 当覆写了Activity的finish()方法后,在执行finish() * 阅读全文
posted @ 2013-07-08 14:10 xinyuyuanm 阅读(436) 评论(0) 推荐(0) 编辑
摘要: 题目地址:http://poj.org/problem?id=2046 一道搜索状态压缩的题目,关键是怎样hash。 AC代码:#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std;typedef long long LL;const int N=2222222;const LL II=1000000007;const in 阅读全文
posted @ 2013-07-08 14:09 xinyuyuanm 阅读(262) 评论(0) 推荐(0) 编辑
摘要: mWebView.getSettings().setUserAgentString(mWebView.getSettings().getUserAgentString()+"SESSIONID="+"123456"); 阅读全文
posted @ 2013-07-08 14:07 xinyuyuanm 阅读(352) 评论(0) 推荐(0) 编辑
摘要: The 3n + 1 problemProblem Description Problems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this problem you will be analyzing a property of an algorithm whose classification is not known for all possible inputs. Consi... 阅读全文
posted @ 2013-07-08 14:05 xinyuyuanm 阅读(306) 评论(0) 推荐(0) 编辑
摘要: adb shell dumpsys meminfo 包名比如:adb shell dumpsys meminfo cn.com.test 阅读全文
posted @ 2013-07-08 14:03 xinyuyuanm 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 传送门☞Android兵器谱☞转载请注明☞http://blog.csdn.net/leverage_1229 架构代码部分主要的包结构是Backing、Entity、Dao、Service这四个部分。这四个部分的名称比较明确,很好的划分了层次内容。其中Backing是JSF中的backingbean,处理表现层。Service是业务层,实现业务操作。Entity与Dao是属于持久层。Entity是hibernate中ORM的数据持久化类,是一些普通的POJO,与数据库表一一映射,entity下有hibernate的hbm文件,表示数据库表与实体的映射关系。Dao是直接与数据库操作的内... 阅读全文
posted @ 2013-07-08 14:01 xinyuyuanm 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 最近做了五子棋,记录下自己完成五子棋的人机对战的思路。 首先,思路是这样的:每当人手动下一颗棋子(黑子)的时候,应当遍历它周围棋子的情况,并赋予周围棋子一定的权值,当在机器要下棋子(白子)守护之前,会遍历整个棋盘的权值情况(棋盘的权值存在一个二维数组中),从中找出权值最大的点坐标,并下子(白子)。 这样的话,问题就集中在两个方面了,一个是:如何遍历黑子周围的棋子情况?另一个是:如何设定权值? 首先,是设定权值。这个没有固定的设定方案,可以先试着设定,然后,尝试效果后(主要是白子的攻防情况是否合理),再调整。 以下是我的设定方案: 接着,是相对困难的部分,就是如何遍... 阅读全文
posted @ 2013-07-08 13:59 xinyuyuanm 阅读(4103) 评论(0) 推荐(0) 编辑
摘要: 传送门☞Android兵器谱☞转载请注明☞http://blog.csdn.net/leverage_1229 由于本框架使用的是JSF+Spring+Hibernate的架构,因此WEB-INF路径下几个配置文件web.xml以及applicationContext.xml、faces-config.xml是比较重要的。Web.xml定义了使用的框架faces-config.xml定义了JSF页面的backingbean以及跳转关系,而applicationContext.xml定义了bean的依赖关系,即使用依赖注入的功能。 针对每个表的操作,框架提供了从表现层业务层到持久... 阅读全文
posted @ 2013-07-08 13:57 xinyuyuanm 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 在前面调用系统ContentProvider实现了管理联系人和多媒体内容,而有的时候,我们需要自己定义ContentProvider供别人使用,下面我们实现一个简单的自定义ContentProvider,实现对数据库的增、删、改、查功能,为了方便阅读,数据仍是手动写死的,实际中应该根据业务需求从其他地方动态获取,代码如下:主界面:package com.lovo.studentmanagesystem;import com.lovo.provider.Student;import android.app.Activity;import android.content.ContentUris;i 阅读全文
posted @ 2013-07-08 13:55 xinyuyuanm 阅读(274) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 303 下一页