2010年8月28日
摘要: A color reduction is a mapping from a set of discrete colors to a smaller one. The solution to this problem requires that you perform just such a mapping in a standard twenty-four bit RGB color space. The input consists of a target set of sixteen RGB color values, and a collection of arbitrary RGB colors to be mapped to their closest color in the target set. For our purposes, an RGB color is defined as an ordered triple (R,G,B) where each value of the triple is an integer from 0 to 255. The dist 阅读全文
posted @ 2010-08-28 23:55 步碎酒散花醉 阅读(354) 评论(3) 推荐(0)
摘要: Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。 阅读全文
posted @ 2010-08-28 03:13 步碎酒散花醉 阅读(375) 评论(0) 推荐(0)
2010年8月27日
摘要: Bob and Alice started to use a brand-new encoding scheme. Surprisingly it is not a Public Key Cryptosystem, but their encoding and decoding is based on secret keys. They chose the secret key at their last meeting in Philadelphia on February 16th, 1996. They chose as a secret key a sequence of n distinct integers, a1 ; . . .; an, greater than zero and less or equal to n. The encoding is based on the following principle. The message is written down below the key, so that characters in the message 阅读全文
posted @ 2010-08-27 00:43 步碎酒散花醉 阅读(454) 评论(6) 推荐(0)
2010年8月26日
摘要: Marsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the marbles. This would be easy if all the marbles had the same value, because then they could just split the collection in half. But unfortunately, some of the marbles are larger, or more beautiful than others. So, Marsha and Bill start by assigning a value, a natural number between one and six, to each marble. Now they want to divide the marbles so that each of 阅读全文
posted @ 2010-08-26 18:38 步碎酒散花醉 阅读(509) 评论(0) 推荐(0)
2010年8月10日
摘要: 四月份购入富士S200EXR一台,最近媒体狂炒雪花门,很郁闷,自己测试了下,证明了雪花的存在性。上图: 2010/8/9 晚11点左右进行的测试,环境温度大约30℃(南京...楼内房间外,特别热...),开机5分钟内拍片300+后进行测试。RAW格式直出,转Jpg,分辨率5216×4216,用的Dead Pixel Test进行热噪点统计。从结果看,雪花是存在的(在>10s的曝光... 阅读全文
posted @ 2010-08-10 15:26 步碎酒散花醉 阅读(1051) 评论(0) 推荐(0)
2010年7月15日
摘要: 模拟微软首页的Slide效果 http://www.microsoft.com/en/us/default.aspx写了一个jquery插件[代码]里面有用到另外一个hover延时插件 jquery.hoverIntent。html代码:[代码]规则是:用ul li建立框架 其中第偶数个li为缩略内容 第奇数个li为展开内容。li里必须也只能套一个div,里面放显示的内容(这里显示的是图片)。必要... 阅读全文
posted @ 2010-07-15 20:50 步碎酒散花醉 阅读(1581) 评论(2) 推荐(2)
2010年6月4日
摘要: 做自己的js组件倒是没怎么想过,只是有时候为了方便,对一些第三方的库进行了封装,方便使用。比如:...  ASP.Net利用WebService做Ajax交互,XML格式数据传输,采用Javascript SoapClient类库[http://www.guru4.net/articoli/javascript-soap-client/]。  SoapClient能用SOAP协议进行通信,并对返回... 阅读全文
posted @ 2010-06-04 15:00 步碎酒散花醉 阅读(1904) 评论(0) 推荐(0)
2010年5月18日
摘要: const const_cast 编译器优化 阅读全文
posted @ 2010-05-18 20:20 步碎酒散花醉 阅读(1670) 评论(1) 推荐(2)
2010年5月17日
摘要: 生产者与消费者问题 这个问题是一个标准的、著名的同时性编程问题的集合:一个有限缓冲区和两类线程,它们是生产者和消费者,生产者把产品放入缓冲区,相反消费者便是从缓冲区中拿走产品。 生产者在缓冲区满时必须等待,直到缓冲区有空间才继续生产。消费者在缓冲区空时必须等待,直到缓冲区中有产品才能继续读取。 在这个问题上主要考虑的是:缓冲区满或缓冲区空以及竞争条件。 阅读全文
posted @ 2010-05-17 22:54 步碎酒散花醉 阅读(3274) 评论(0) 推荐(0)
2010年4月25日
摘要: 顺丰速递的速度果然还是很快的,昨天晚上9点深圳发的货今天下午就拿到了。相机也不错,虽然我是个菜鸟...  S200EXR,港行,内地是S205EXR。2500RMB...说明书是英文的,勉强看啊看过去,了解了下一些比较高级的功能,比较喜欢那个强化主体对焦模式,可以拍出背景虚化的效果,传说中的六芒星的效果还没有拍出来...我菜...  14.3倍光学变焦+1200w像素+1/1.6 Super CC... 阅读全文
posted @ 2010-04-25 23:38 步碎酒散花醉 阅读(568) 评论(0) 推荐(0)