日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
手把手教你寫網(wǎng)絡爬蟲(7):URL去重

本系列:

創(chuàng)新互聯(lián)是一家專注于成都做網(wǎng)站、網(wǎng)站制作、成都外貿(mào)網(wǎng)站建設(shè)雅安移動機房的網(wǎng)絡公司,有著豐富的建站經(jīng)驗和案例。

  • 《手把手教你寫網(wǎng)絡爬蟲(1):網(wǎng)易云音樂歌單》
  • 《手把手教你寫網(wǎng)絡爬蟲(2):迷你爬蟲架構(gòu)》
  • 《手把手教你寫網(wǎng)絡爬蟲(3):開源爬蟲框架對比》
  • 《手把手教你寫網(wǎng)絡爬蟲(4):Scrapy入門》
  • 《手把手教你寫網(wǎng)絡爬蟲(5):PhantomJS實戰(zhàn)》
  • 《手把手教你寫網(wǎng)絡爬蟲(6):分布式爬蟲》

IPv6編碼地址數(shù):2^128(約3.4×10^38)

IPv6是IETF設(shè)計的用于替代現(xiàn)行版本IP協(xié)議(IPv4)的下一代IP協(xié)議,號稱可以為全世界的每一粒沙子編上一個網(wǎng)址。

 
 
 
 
  1. public  boolean put(T object, Funnel funnel, int numHashFunctions, BitArray bits) {  
  2.     long bitSize = bits.bitSize();  
  3.     long hash64 = Hashing.murmur3_128().hashObject(object, funnel).asLong();  
  4.     int hash1 = (int) hash64;  
  5.     int hash2 = (int) (hash64 >>> 32);   
  6.  
  7.     boolean bitsChanged = false;  
  8.     for (int i = 1; i <= numHashFunctions; i++) {  
  9.         int combinedHash = hash1 + (i * hash2);  
  10.         // Flip all the bits if it's negative (guaranteed positive number)  
  11.         if (combinedHash < 0) {  
  12.             combinedHash = ~combinedHash;  
  13.         }  
  14.         bitsChanged |= bits.set(combinedHash % bitSize);  
  15.     }  
  16.     return bitsChanged;  
  17. }  

 
 
 
 
  1. boolean set(long index) {   
  2.     if (!get(index)) {   
  3.         data[(int) (index >>> 6)] |= (1L << index);   
  4.         bitCount++;   
  5.         return true;   
  6.     }   
  7.     return false;   
  8. }     
  9.   
  10. boolean get(long index) {   
  11.     return (data[(int) (index >>> 6)] & (1L << index)) != 0;   
  12. }   

02 先get()一下,看看是不是已經(jīng)置為1。

03 index右移6位就是除以64,說明data是long型的數(shù)組,除以64就定位到了bit所在的數(shù)組下標。1L左移index位,定位到了bit在long中的位置。


新聞名稱:手把手教你寫網(wǎng)絡爬蟲(7):URL去重
鏈接URL:http://m.5511xx.com/article/djcchjp.html