日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

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

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷(xiāo)解決方案
手把手教你寫(xiě)網(wǎng)絡(luò)爬蟲(chóng)(7):URL去重

本系列:

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

  • 《手把手教你寫(xiě)網(wǎng)絡(luò)爬蟲(chóng)(1):網(wǎng)易云音樂(lè)歌單》
  • 《手把手教你寫(xiě)網(wǎng)絡(luò)爬蟲(chóng)(2):迷你爬蟲(chóng)架構(gòu)》
  • 《手把手教你寫(xiě)網(wǎng)絡(luò)爬蟲(chóng)(3):開(kāi)源爬蟲(chóng)框架對(duì)比》
  • 《手把手教你寫(xiě)網(wǎng)絡(luò)爬蟲(chóng)(4):Scrapy入門(mén)》
  • 《手把手教你寫(xiě)網(wǎng)絡(luò)爬蟲(chóng)(5):PhantomJS實(shí)戰(zhàn)》
  • 《手把手教你寫(xiě)網(wǎng)絡(luò)爬蟲(chóng)(6):分布式爬蟲(chóng)》

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

IPv6是IETF設(shè)計(jì)的用于替代現(xiàn)行版本IP協(xié)議(IPv4)的下一代IP協(xié)議,號(hào)稱可以為全世界的每一粒沙子編上一個(gè)網(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,說(shuō)明data是long型的數(shù)組,除以64就定位到了bit所在的數(shù)組下標(biāo)。1L左移index位,定位到了bit在long中的位置。


網(wǎng)頁(yè)題目:手把手教你寫(xiě)網(wǎng)絡(luò)爬蟲(chóng)(7):URL去重
文章來(lái)源:http://www.dlmjj.cn/article/djcchjp.html