摘要: 新文章移至http://cffile.sinaapp.com/?p=50/** * Snake: a simple game that everyone can enjoy. * * This is an implementation of the classic Game "Snake", in which you control a * serpent roaming around the garden looking for apples. Be careful, though, * because when you catch one, not only wil.. 阅读全文
posted @ 2011-11-01 21:38 cffile 阅读(682) 评论(0) 推荐(0) 编辑
摘要: 1、打开Eclipse,选择菜单File->New->Other,打开新建对话框。选择Android Project后,点击Next按钮。 在打开的对话框中输入以下信息: Project name:helloworld Build Target:选择Android 2.1 Application name:helloworld 应用程序名称,模拟器的程序列表中图标下方显示以及运行时程序标题栏显示 Package name:helloworld.android 遵循Java编程规范,如:rdstop.android.helloworld Create activity:勾选,输入he 阅读全文
posted @ 2011-11-01 21:36 cffile 阅读(861) 评论(0) 推荐(0) 编辑
摘要: 新文章移至http://cffile.sinaapp.com/?p=45 用过手机QQ的基本上都知道,刚启动程序时候会在一个界面停留一会,按任意键的就直接跳过,这就是所谓的闪屏。那么,在Android中怎样实现这样的效果呢? 1、新建一个Android项目,命名为SplashyDemo,结构如下所示: 2、添加资源图片: 首先我们得有闪屏时候显示的图片资源文件,并将图片放在res/drawable目录下,命名为splash.jpg: 这时候会在R类中自动添加资源文件对应的ID,如下所示: 3、编写闪屏的界面布局文件,放在res/layout目... 阅读全文
posted @ 2011-11-01 21:35 cffile 阅读(269) 评论(0) 推荐(0) 编辑
摘要: 新文章移至http://cffile.sinaapp.com/?p=41AndroidManifest.xmlXml代码<?xmlversion="1.0"encoding="utf-8"?><manifestxmlns:android="http://schemas.android.com/apk/res/android"package="com.example.android.notepad"><applicationandroid:icon="@drawable/app 阅读全文
posted @ 2011-11-01 21:34 cffile 阅读(540) 评论(0) 推荐(0) 编辑
摘要: 新文章移至http://cffile.sinaapp.com/?p=39///////////////////////////////////m个球,两个人轮流取,每次至少取x个,最多取y个,取到最后一个者胜,先取者的必胜策略?/**/Bash博弈(Wythoff,Nimm博弈可以去查查)///////////////////////////////////北京五环路有n个公交车站,已知相邻公交站的距离,公交车只能在环上走,求任意两公交站的最短距离(O(n)初始化时间,O(1)查询时间/**/反向距离=总长-正向距离///////////////////////////////////星际争. 阅读全文
posted @ 2011-10-29 17:37 cffile 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 新文章移至http://cffile.sinaapp.com/?p=37奉献给大家 ///////////////////////////////////////////////////////////// 12个球有一个球重量不一样,称三次找出 12个球编号1~12,设不同的球为x,第一次分成3组,每组4个 一、1,2,3,4 = 5,6,7,8则x在9~12中 (一)9=10,则x在11、12中 (1)9=11--> x=12 (2)9>11 or 9<11 --> x=11 (二)9>10,则x在9、10中 (1) 9=11 --> x=10 (2) 阅读全文
posted @ 2011-10-27 15:47 cffile 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 新文章移至 http://cffile.sinaapp.com/?p=352011 IT O1.z 2.h 3.a b 4.s 5.3 6.t 7.m 8.r 9.a c 10.b 11.n 12.q 阅读全文
posted @ 2011-10-27 15:07 cffile 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 新文章移至 http://cffile.sinaapp.com/?p=33如果有两个随机数生成器A,B(生成数都小于输入值)例如n=3;A 000 001 010B 000 001 010两者再随机异或生成的3*3=9个数进行期望计算...计算结果:*** 000 001 010000 000 001 010 001 001 000 011010 010 011 000求期望得到4/3.由于数量庞大 10^9 直接模拟一定超时所以直接计算每一位的 0 1 个数可以简化计算量条件一:在异或中,只要两个位不同0 1或1 0 就能得到1条件二:计算每一位的0 1出现的个数,例如上面,最低位(假设i为 阅读全文
posted @ 2011-06-23 09:31 cffile 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 新文章移至 http://cffile.sinaapp.com/?p=201. 生成 server key :在command命令行输入如下命令: keytool -genkey -alias tomcat -keyalg RSA -keypass changeit -storepass changeit -keystore server.keystore -validity 3600 默认路径在“C:\Documents and Settings\用户名”下面)放到TomcatHOME\下2.将证书导入的JDK的证书信任库中:这步对于Tomcat的SSL配置不是必须,但对于CAS SSO是必 阅读全文
posted @ 2009-09-27 08:56 cffile 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 新文章移至http://cffile.sinaapp.com/?p=30一、mysql1.拷相应的driver.jar到Tomcat5\common\lib下2.更改Tomcat5\conf下的context.xml<Context>节点下加 <Resource name="jdbc/MysqlConnectionPoolTest" auth="Czh" type="javax.sql.DataSource" driverClassName="com.mysql.jdbc.Driver" url= 阅读全文
posted @ 2009-09-05 09:12 cffile 阅读(770) 评论(0) 推荐(0) 编辑
google