题意:经典Nim游戏博弈,给你n堆牌,每堆a[i]张,每次能从一堆中取出任一张(不能为0),最后不能取者为输
问先手有几种取法保证他最后能获胜。
思路:让Nim_sum=0(a[1]^a[2]…………^a[n]=0)时则输,利用这个定理,对于第i堆a[i],除了第i堆,其它的
Nim_sum=k,如果a[i]>k,则先手从第i堆可以取a[i]-k张牌,让a[i]=k,最后a[i]^k...
分类:
编程语言 时间:
2014-05-07 06:13:32
阅读次数:
428
WebService之CXF注解
1、具体错误如下
五月 04, 2014 11:29:28 下午 org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean buildServiceFromClass
信息: Creating Service {http://service.you.com/}IServiceSer...
分类:
Web程序 时间:
2014-05-07 05:43:28
阅读次数:
444
WebService之CXF注解
1、具体报错如下
五月 04, 2014 11:24:12 下午 org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean buildServiceFromClass
信息: Creating Service {http://service.you.com/}IServiceSer...
分类:
Web程序 时间:
2014-05-07 04:08:52
阅读次数:
630
WebService之CXF注解
1、具体报错如下
usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { -help | start | stop }
2014-5-4 22:42:12 org.apache.catalina.core.AprLifecycleL...
分类:
Web程序 时间:
2014-05-07 03:33:05
阅读次数:
630
spring框架中多数据源创建加载并且实现动态切换的配置实例代码,代码下载地址:http://www.zuidaima.com/share/1774074130205696.htm...
分类:
编程语言 时间:
2014-05-07 03:18:33
阅读次数:
442
【关键的错误信息】: TransactionException: Transaction not successfully started 和一个
doCommit
从该关键字看,是使用Hibernate事务管理器(而不是Spring,下面详细log的绿色字体)处理事务的commit时抛出的,
【具体解决】:
//下面的代码段会报错
Session sessio...
分类:
系统相关 时间:
2014-05-06 22:44:10
阅读次数:
628
情况是这样的:web工程采用了ssh框架,dao和service都是通过annotation方式注入的,工程运行正常。后来把service和dao打成jar放在工程的lib目录下,问题来了,配置没改动,结果就是不能自动注入dao和service。但是如果把dao和service在spring配置文件中通过xml文件配置,这些component能找到。
搜索了一把,发现这个问题比较...
分类:
编程语言 时间:
2014-05-06 19:33:09
阅读次数:
437
packagecom.lavasoft.ntv.web.common;
importcom.github.cage.Cage;
importcom.github.cage.IGenerator;
importorg.springframework.beans.factory.annotation.Autowired;
importorg.springframework.beans.factory.annotation.Qualifier;
importorg.springframework.stereotyp..
分类:
编程语言 时间:
2014-05-06 17:38:55
阅读次数:
753
官方的色调单一,随机色也不随机,黑不拉几的,很难看。为此做了扩展实现,并整合了springmvc,生成的验证码漂亮多了。官网:http://code.google.com/p/patchca/官方效果:下面是我整合到spring并修扩展后的效果:packagecom.lavasoft.ntv.web;
importorg.patchca.color.ColorF..
分类:
编程语言 时间:
2014-05-06 16:21:28
阅读次数:
571
flex是不能直接访问数据库的,所以可以采用服务的形式进行调用数据,HTTPService、WebServices是比较常用的两种方法,因为接触WebService比较多所以给出其调用方法。importmx.controls.Alert;
importmx.events.FlexEvent;
importmx.rpc.events.ResultEvent;
importmx.rpc.event..
分类:
Web程序 时间:
2014-05-06 16:11:59
阅读次数:
382