09 2012 档案

摘要:出自:http://www.blogjava.net/conans/articles/331384.html方便自己查阅。publicclassHashAlgorithms{/***加法hash**@paramkey*字符串*@paramprime*一个质数*@returnhash结果*/publicstaticintadditiveHash(Stringkey,intprime){inthash,i;for(hash=key.length(),i=0;i<key.length();i++)hash+=key.charAt(i);return(hash%prime);}/***旋转has 阅读全文
posted @ 2012-09-24 16:05 doo 阅读(2052) 评论(0) 推荐(1)
摘要:引用原文:http://www.cnblogs.com/xyz168/archive/2011/11/11/2245718.html本节的主要内容:1、通过代理类的方式调用服务操作。2、通过通道的方式调用服务操作。3、代码下载一、通过代理类的方式调用服务操作(两种方式添加代理类)1.手动编写代理类,如下:客户端契约:View Code 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 using System.ServiceModel; 7 na.. 阅读全文
posted @ 2012-09-19 17:16 doo 阅读(331) 评论(0) 推荐(0)
摘要:public class BloomFilter { //种子个数 private int _seedcount ; //内存大小,单位bits private int _memsize; //不同哈希函数的种子,一般应取质数 private static List<int> seeds = new List<int>{ 5, 37, 73, 31, 17, 47, 67, 29, 13, 19, 89, 43, 7, 53, 41, 61, 23, 71, 11, 79, 83, 59, 97 }; private BitArray bits; //哈希函数对象 pr 阅读全文
posted @ 2012-09-18 11:02 doo 阅读(201) 评论(0) 推荐(0)
摘要:布隆过滤器的原理就不介绍了,到网上搜搜会找到的。这里说一下最佳的选取参数。P是需要的误差率,n是读取的数据条数。系统首先要计算需要的内存大小m bits:再由m,n得到hash function的个数:如果误差率在万分之一,n是一亿条,则需要19亿比特内存,13个hash函数。下面是我参考别人的布隆过滤器,修改的。。进攻参考。。public class BloomFilter { // BitArray 初始分配2^29个bit private static int DEFAULT_SIZE = 1 << 30; //不同哈希函数的种子,一般应取质数 private static 阅读全文
posted @ 2012-09-13 15:57 doo 阅读(253) 评论(0) 推荐(0)
摘要:javascript里面<script type="text/javascript"> var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_initializeRequest(downloadfile);//触发函数 function downloadfile(filepath) { var iframe = document.createElement("iframe"); iframe.src = "GenerateFile.aspx?filepath 阅读全文
posted @ 2012-09-04 17:44 doo 阅读(16725) 评论(0) 推荐(0)