Giter VIP home page Giter VIP logo

spider_project's People

Contributors

don98 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

spider_project's Issues

关于使用Bloom Filter 进行网页去重的问题

关于使用Bloom Filter 进行网页去重的问题

将一条URL进行hash算法投射到一个128位的Bitset上面,然后对此方法进行一定优化之后,使用三个hash算法分别算出三个不重叠的值,投影到三个不同的位置,如此可以降低碰撞然后被误判的概率。。
我的问题就是,加入出现了某种状况,比如

URLa投影到1、2、3三个位置,URLb投影到4、5、6三个位置,URLc投影到7、8、9三个位置,问题来了,如果此时第四个URLd进来了,进行hash算法进行转化之后,发现正好URLd算出的三个值分别投影到了1、4、7上面,而在Bitset上面是使用1、0来表示是否存在的状态的,那么在这种情况出现的时候,URLd会被当作已经获取过的URL而被抛弃,可实际上URLd和之前的都不一样,有没有办法可以减少这种误判呢?

当然,上面的值可能比较凑巧,但不可否认有这种情况的出现,在这种情况之下比预想的万分之一的误判率要高上非常的多,这个是算法本身设计的缺陷还是我有什么地方没有考虑周全引起的呢?

关于爬虫抓取相关数据然后保存时的编码问题

相关网站的编码是utf-8的,然后在print的时候也没有问题,但是在写入json的时候,无论我改不改encode的编码,改成什么编码,都写入不了中文字符,对这个问题感觉很迷,有的时候莫名其妙就好了,有的时候怎么改都不行。。。用的系统是win10,python3.6.2
下图:输出的图没有问题
输出的图
代码:

1519607656 1

写入json之后:
1519607638 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.