2018年3月6日

摘要: 在系统中,我们经常会遇到这样的需求:将大量(比如几十万、甚至上百万)的对象进行排序,然后只需要取出最Top的前N名作为排行榜的数据,这即是一个TopN算法。常见的解决方案有三种: (1)直接使用List的Sort方法进行处理。 (2)使用排序二叉树进行排序,然后取出前N名。 (3)使用最大堆排序,然 阅读全文
posted @ 2018-03-06 09:32 silence_storm 阅读(8730) 评论(0) 推荐(0) 编辑

2018年3月5日

摘要: from Stack Overflow Here is a similar solution which I think is more efficient in building up the list of %s strings in the SQL: That way you avoid ha 阅读全文
posted @ 2018-03-05 11:57 silence_storm 阅读(241) 评论(0) 推荐(0) 编辑

2018年3月1日

摘要: 由于b站爬虫难度较小(url地址主要通过av定位),我第一的爬虫尝试就选择了b站 以下为初步的尝试。 首先,由于初步统计,b站空视频(已下架或者删除)的比例大概是百分之五十(统计样本基本在前几年的视频中),因此,我觉得使用简单的迭代搜索问题不大(如果为了减少一半的搜索量写大量爬虫逻辑代码比较浪费时间 阅读全文
posted @ 2018-03-01 10:49 silence_storm 阅读(8553) 评论(0) 推荐(0) 编辑

2018年2月2日

摘要: 转载地址:http://python.jobbole.com/86787/ 1.简单的使用 在类的继承中,如果重定义某个方法,该方法会覆盖父类的同名方法,但有时,我们希望能同时实现父类的功能,这时,我们就需要调用父类的方法了,可通过使用 super 来实现,比如: 在上面,Animal 是父类,Do 阅读全文
posted @ 2018-02-02 10:53 silence_storm 阅读(14122) 评论(5) 推荐(2) 编辑

2018年2月1日

摘要: 转载地址:https://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103fac9270762a000/00138683221577998e407bb309542d9b6a68d9276bc3dbe000 在程序运行的过程中, 阅读全文
posted @ 2018-02-01 17:40 silence_storm 阅读(169) 评论(0) 推荐(0) 编辑
 
摘要: 转载地址:https://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103fac9270762a000/001411031239400f7181f65f33a4623bc42276a605debf6000 一 、collect 阅读全文
posted @ 2018-02-01 15:05 silence_storm 阅读(134) 评论(0) 推荐(0) 编辑

2018年1月31日

摘要: 转载地址:http://www.lightxue.com/transforming-code-into-beautiful-idiomatic-python 用了python这么久,逐渐才了解到python语言的独特之处,根据这篇文章,列出了几个以后写代码要注意的点,提醒自己。 本文是Raymond 阅读全文
posted @ 2018-01-31 18:49 silence_storm 阅读(714) 评论(0) 推荐(0) 编辑
 
摘要: 文章转载:https://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3a2e542c000/0014318435599930270c0381a3b44db991cd6d858064ac0000 首先python有一 阅读全文
posted @ 2018-01-31 17:25 silence_storm 阅读(168) 评论(0) 推荐(0) 编辑