装潢模式 我的理解是,装潢模式的作用就是:扩展类的功能但不修改类,也就是依赖倒置原则 用普通白饭和蛋炒饭举个例子 Food是他们都实现了的接口 Rice(白饭)实现了Food接口 蛋炒饭(EggRice)也实现了Food接口,并且持有一个实现了Food接口的对象,也就是普通白饭(EggRice装饰了 ...
分类:
其他好文 时间:
2018-01-04 00:17:43
阅读次数:
167
In a strange planet there are n races. They are completely different as well as their food habits. Each race has a food-eating period. That means the ...
分类:
其他好文 时间:
2018-01-03 17:33:17
阅读次数:
186
Problem Description Although winter is far away, squirrels have to work day and night to save beans. They need plenty of food to get through those lon ...
分类:
其他好文 时间:
2017-12-16 16:02:28
阅读次数:
163
http://acm.hdu.edu.cn/showproblem.php?pid=5445 题意:现在你要为运动会提供食物,总共需要提供P能量的食物,现在有n种食物,每种食物能提供 t 能量,体积为 u ,并且最多能提供 v 的数量。运载食物的卡车有m种,每种能提供 x 的运输空间,运输花费为 y ...
分类:
其他好文 时间:
2017-12-01 11:33:47
阅读次数:
109
1、创建类class People: def __init__(self,name,age): self.name = name self.age = age def eat(self): print("%s is eating food" % self.age) def sing(self): p ...
分类:
其他好文 时间:
2017-11-18 16:00:10
阅读次数:
207
<?php
declare(strict_types=1);//开启强类型模式
classPerson{
publicfunctionsay(){
echo"Helloworld";
echo"\r\n";
}
}
(newPerson())->say();//调用类中存在的方法
(newPerson())->eat(‘food‘);//调用类中不存在的方法调用类中不存在的方法
PHPFatalerror:Unca..
分类:
Web程序 时间:
2017-11-15 22:03:52
阅读次数:
281
One day, Tom traveled to a country named BGM. BGM is a small country, but there are N (N <= 100) towns in it. Each town products one kind of food, the ...
分类:
其他好文 时间:
2017-11-01 14:51:11
阅读次数:
108
^ 表示字符串的开头 $ 表示字符串的结尾 . 表示除了\n之外的任何单个字符 [ ] 表示字符的筛选 如:a[def]b 表示a和b之间只能出现def之间任何一个 | 表示或的意思 如:z|food:只能匹配z或food两个; (z|food):匹配zood或food () 改变运算优先级和提取组 ...
分类:
其他好文 时间:
2017-10-26 22:57:30
阅读次数:
152
#!/usr/bin/python# 字典# 当时学java的时候, 语言基础就学了好久, 然后是各种API, 最后才是集合# 键值对, 可变# 1. 映射操作D = {'food' : 'Spam', 'quantity':4, 'color':'pink'}print(D['food']) # ... ...
分类:
编程语言 时间:
2017-10-21 19:09:03
阅读次数:
220
做项目的时候涉及到了这部分内容,于是查找了一些资料,理清了一些基础的部分知识。 简单来说AngularJS就是通过改变location地址来实现加载不同的页面内容到指定位置 比如: https://www.baidu.com/#/music https://www.baidu.com/#/food ...
分类:
其他好文 时间:
2017-10-15 21:16:03
阅读次数:
133