首页 > 其他
设计模式(9) 装饰器模式(DECORATOR)
问题聚焦: 有时候,希望某个类增加新功能的时候,往往会生成一个子类。 但是,这种方式有时候略显臃肿,其次,这种方法是静态的,不够灵活。 因此,针对这种给对象动态添加功能的需求,大牛们给出了本节的装饰器模式。...
分类:其他   时间:2014-02-05 01:42:11    收藏:0  评论:0  赞:0  阅读:338
topcoder srm607 div2
250pt: 题目: Problem Statement   Andrew drew a bunch of points on a sheet of graph paper. You are given the coordinates of these points in two vector s: X and Y. That is, for eac...
分类:其他   时间:2014-02-05 00:38:51    收藏:0  评论:0  赞:0  阅读:375
USACO Sorting a Three-Valued Sequence
Sorting a Three-Valued Sequence  IOI'96 - Day 2 Sorting is one of the most frequently performed computational tasks. Consider the special sorting problem in which the records to be sorted have at ...
分类:其他   时间:2014-02-05 01:37:11    收藏:0  评论:0  赞:0  阅读:426
设计模式之简单工厂模式
所谓简单工厂模式其实就是把一些类进行包装,封装在一起,用到哪一个类的时候在实例化哪一个类。举个简单的例子就像家中的电视机,电视机上面有很多按钮,其中有菜单,有调节屏幕明亮程度的,有调节音量大小的。这些每一个按钮都会完成一个功能,而将这些封装起来的就是电视机,利用函数,通过参数的不同而返回不同的实例化对象。用代码表示则如下: //功能选择类 ClassFunctionChoice { Publi...
分类:其他   时间:2014-02-05 00:45:31    收藏:0  评论:0  赞:0  阅读:338
在mybatis中遇到奇怪的问题
用mybatis执行 SQL 语句,没有用参数绑定: update t_user set name='demo' where id=1 竟然报错: Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: 'f4a8ce9f-8546-43ad-9133-9f...
分类:其他   时间:2014-02-05 01:36:21    收藏:0  评论:0  赞:0  阅读:388
UiButton操作
UIButton继承自UIView,虽然界面上的组件都继承自UIView,如果这个组件拥有丰富的事件那么肯定就要继承自UiView的一个子类UIControl,那么像UILable、UIImage这些轻量级组件都没有继承这个类,所以他们拥有的事件操作很少。 初始化一个Button -(void) initWithRedBlock{     //初始化块    ...
分类:其他   时间:2014-02-05 00:44:41    收藏:0  评论:0  赞:0  阅读:426
POJ 2486 经典树形dp
Apple Tree Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 6654   Accepted: 2197 Description Wshxzt is a lovely girl. She likes apple very much. One day HX tak...
分类:其他   时间:2014-02-05 00:53:51    收藏:0  评论:0  赞:0  阅读:366
欧几里得算法
x*a=1(mod n) , 转换成x*a + n * y  = 1的形式,进行求解即可 // File Name: 1092.cpp // Author: bo_jwolf // Created Time: 2014年02月04日 星期二 15时30分26秒 #include #include #include #include #include #include #include #inc...
分类:其他   时间:2014-02-05 00:43:51    收藏:0  评论:0  赞:0  阅读:373
USACO Ordered Fractions
就是法雷数列。。。 Ordered Fractions Consider the set of all reduced fractions between 0 and 1 inclusive with denominators less than or equal to N. Here is the set when N = 5: 0/1 1/5 1/4 1/3 2/5 1/2...
分类:其他   时间:2014-02-05 00:57:11    收藏:0  评论:0  赞:0  阅读:352
UML—交互图
一,交互图   交互图用来描述系统中的对象是如何进行相互作用的。即一组对象是如何进行消息传递的。   交互图可用两种方式描述: 强调消息的时间顺序。 强调发送和接受消息的对象的结构组织。  交互图包括:        顺序图:强调消息的事件顺序 合作图:强调对象之间的交互关系 二,顺序图 1,什么是顺序图?   顺序...
分类:其他   时间:2014-02-05 00:56:21    收藏:0  评论:0  赞:0  阅读:441
vector的简单用法
vector是C++中容器的一种,与普通的数组相比,它可以动态的增长,而且还有封装了用于顺序表的操作的方法。 使用vector定义了容器之后,如果定义了容器的大小,则可以在大小范围之内直接使用数组的方式进行访问。 #include #include using namespace std; int main() { vector a(10); for(int i=0;i<10;i++)...
分类:其他   时间:2014-02-05 01:03:51    收藏:0  评论:0  赞:0  阅读:355
UML之用例图
1、用例图简介     在UML实践中,用例图(Usecasediagrams)就是软件外部特性描述的视图,是以用户的角度、以一种可视化的方式来描述软件产品的需求,分析软件的功能和行为;用例图强调系统“是什么”。 2、用例图设计三要素   参与者(Actor)、用例(UseCase)、关系。      (1)、参与者(Actor)                表示与你的应...
分类:其他   时间:2014-02-05 01:15:31    收藏:0  评论:0  赞:0  阅读:385
USACO Healthy Holsteins
Healthy Holsteins Burch & Kolstad Farmer John prides himself on having the healthiest dairy cows in the world. He knows the vitamin content for one scoop of each feed type and the minimum daily vi...
分类:其他   时间:2014-02-05 00:55:32    收藏:0  评论:0  赞:0  阅读:341
POJ 1947 经典树形背包
Rebuilding Roads Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 8479   Accepted: 3795 Description The cows have reconstructed Farmer John's farm, with its N b...
分类:其他   时间:2014-02-05 01:35:31    收藏:0  评论:0  赞:0  阅读:373
Codeforces Round #200 (Div. 1)
题目链接 代码链接 A: 串联一个电阻:(a+b)/b 并联一个电阻:a/(a+b) 那么a>=b时连续串联a/b个,a 那么只要修改一下欧几里得就可以了 gcd(a,b):  return b==0 ? 0 : a/b+gcd(b,a%b) B: 目标状态是'++...++',能发现偶数个'+'或者偶数个'-'连在一起时,是可以随便转化的('++++' -> '----...
分类:其他   时间:2014-02-05 01:32:11    收藏:0  评论:0  赞:0  阅读:290
玩转Tomcat高级篇
本文示例Tomcat版本:Tomcat 7.0 1、查看Tomcat性能状态(简洁版)  步骤一:打开Tomcat安装目录(假设是D:\Program Files\Apache Software Foundation\Tomcat 7.0 )  --> conf目录 --> 打开 tomcat-users.xml文件,配置如下: ...
分类:其他   时间:2014-02-05 01:14:41    收藏:0  评论:0  赞:0  阅读:452
链表剖析之单链表剖析(二)
代码依旧用c#的写的增加了修改删除合并的方法,我会坚持写下去,如有不对 之处希望大家斧正,注释写的比较详细。有什么问题欢迎留言。 链表节点类 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace...
分类:其他   时间:2014-02-05 00:43:01    收藏:0  评论:0  赞:0  阅读:441
15个热门的编程趋势及15个逐步走向衰落的编程方向(上)
本文来源于我在InfoQ中文站原创的文章,原文地址是:http://www.infoq.com/cn/news/2014/02/15-hot-programming-trendsPeter Wayner是InfoWorld的一名特约编辑,也是一个多产的作家。除了InfoWorld之外,他还经常为纽约时报和连线杂志撰写文章。近日,Peter撰写了一篇文章,谈到了未来15个热门的编程趋势以及15个逐步...
分类:其他   时间:2014-02-05 00:54:41    收藏:0  评论:0  赞:0  阅读:381
15个热门的编程趋势及15个逐步走向衰落的编程方向(下)
本文来源于我在InfoQ中文站原创的文章,原文地址是:http://www.infoq.com/cn/news/2014/02/15-hot-programming-trends-2Peter Wayner是InfoWorld的一名特约编辑,也是一个多产的作家。除了InfoWorld之外,他还经常为纽约时报和连线杂志撰写文章。近日,Peter撰写了一篇文章,谈到了未来15个热门的编程趋势以及15个...
分类:其他   时间:2014-02-05 01:21:21    收藏:0  评论:0  赞:0  阅读:389
uva 10003- Cutting Sticks (记忆化搜索)
Cutting Sticks  You have to cut a wood stick into pieces. The most affordable company, The Analog Cutting Machinery, Inc. (ACM), charges money according to the length of the stick being cut...
分类:其他   时间:2014-02-05 01:18:01    收藏:0  评论:0  赞:0  阅读:470
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!