There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may have prerequisites, for example to take course 0 you have t ...
分类:
其他好文 时间:
2016-11-27 00:13:08
阅读次数:
174
There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may have prerequisites, for example to take course 0 you have t ...
分类:
其他好文 时间:
2016-11-26 23:29:37
阅读次数:
215
In the "100 game," two players take turns adding, to a running total, any integer from 1..10. The player who first causes the running total to reach o ...
TODO:从数据库中随机抽取一条记录1.最直接,最粗暴的方法先计算记录的总数,然后选择一个从0到记录总数之间的随机数n,利用skip跳过n条记录,这是效率低下的的方法,首先的记录总数,在用skip会很耗时间;2.那么有什么办法能够提供效率呢,方法就是给每条记录添加一个0-1的随..
分类:
数据库 时间:
2016-11-24 21:54:17
阅读次数:
146
TODO:数据库优化之分页 本文的例子是以MongoDB数据库为准,其它数据库各位也可以举一反三进行优化。 在MongoDB中分页使用 a.skip(n)跳过前n个匹配的文档; b.limit(m)返回m个结果,要是匹配的结果不到m个,则返回匹配数据量的结果,m是指定上限数量,而不是下限数量; c. ...
分类:
数据库 时间:
2016-11-23 23:54:29
阅读次数:
308
Skip links are an extremely helpful navigation pattern for keyboard and screen reader users, since they let you skip past sections of content. Learn h ...
分类:
Web程序 时间:
2016-11-22 17:00:56
阅读次数:
234
1.修改配置文件 vim /etc/my.cnf 在[mysqld]节点添加 skip-grant-tables 2.重启mysql 3.用空密码进入 mysql -uroot 执行 update mysql.user set authentication_string=password('123' ...
分类:
数据库 时间:
2016-11-22 02:09:25
阅读次数:
233
现在MySQL5.7之后新增了很多功能,其中最明显的就是密码增强的配置。安装完MySQL5.7之后默认是没有用户名密码的。/etc/init.d/mysqldstopmysqld_safe--skip-grant-tables&如果此时不想被远程连接:mysqld_safe--skip-grant-tables--skip-networking&然后就可以无密码登..
分类:
数据库 时间:
2016-11-19 18:31:10
阅读次数:
278
在丢失root密码的时候,可以这样 要先停掉 mysql服务 mysqld_safe --skip-grant-tables& mysql -u root mysql mysql> UPDATE user SET password=PASSWORD("new password") WHERE use ...
分类:
数据库 时间:
2016-11-19 07:55:58
阅读次数:
164
292. Nim Game You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remo ...
分类:
其他好文 时间:
2016-11-16 22:07:10
阅读次数:
241