for-in和for-of 1. for-in循环实际是为循环”enumerable“对象而设计的,是用来循环带有字符串key的对象的。 使用for in会遍历数组所有的可枚举属性,包括原型。所以for in更适合遍历对象,不要使用for in遍历数组。 2. for-of可用于循环数组value值 ...
分类:
其他好文 时间:
2017-08-29 19:47:57
阅读次数:
300
Problem E. What a Ridiculous Election Description In country Light Tower, a presidential election is going on. There are two candidates, Mr. X1 and Mr ...
分类:
其他好文 时间:
2017-08-29 10:10:21
阅读次数:
477
1. 为查询缓存优化你的查询 大多数的MySQL服务器都开启了查询缓存。这是提高性最有效的方法之一,而且这是被MySQL的数据库引擎处理的。当有很多相同的查询被执行了多次的时候,这些查询结果会被放到一个缓存中,这样,后续的相同的查询就不用操作表而直接访问缓存结果了。这里最主要的问题是,对于程序员来说 ...
分类:
数据库 时间:
2017-08-28 23:57:50
阅读次数:
287
In the country of ALPC , Xiaoqian is a very famous mathematician. She is immersed in calculate, and she want to use the minimum number of coins in eve ...
分类:
其他好文 时间:
2017-08-27 11:54:42
阅读次数:
236
Proud Merchants Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 6981 Accepted Submission(s): 291 ...
分类:
其他好文 时间:
2017-08-26 15:58:07
阅读次数:
165
本文将通过演示告诉你:MySQL中派生表(Derived Table)是什么?以及MySQL对它的优化。 Background 有如下一张表: 例如,如果首先考虑选择人口超过10,000人的城市,然后选择那些位于德国的城市,那么可以写这个SQL: 使用 EXPLAIN 命令查看执行计划: 注意:my ...
分类:
数据库 时间:
2017-08-24 21:36:47
阅读次数:
336
Conscription Time Limit: 1000MS Memory Limit: 65536K Description Windy has a country, and he wants to build an army to protect his country. He has pic ...
分类:
其他好文 时间:
2017-08-24 20:13:22
阅读次数:
251
The merchant Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 5055 Accepted: 1740 Description There are N cities in a country, and there is ...
分类:
其他好文 时间:
2017-08-23 18:22:31
阅读次数:
178
1.例子:创建一个继承自活动记录类的类 Country, 把它放在 models/Country.php 文件,去代表和读取 country 表的数据。 这个 Country 类继承自 yii\db\ActiveRecord。你不用在里面写任何代码。 只需要像现在这样,Yii 就能根据类名去猜测对应 ...
分类:
数据库 时间:
2017-08-21 20:33:17
阅读次数:
179