如何计算不小于给定数的最小的2整数次方幂?
dengxf同学提到的一个问题,想了一下,想到的一个算法:
令为已知量,为目标量,为迭代轮数,
- 令 ,
- 对于 右移 位 的情形,执行下列操作,直到此条件不符合为止:
y与前述结果相与;累进。 - 累进。
原理:第(2)步的循环将除最高位的所有0均置位。最后一步(3)修正这一值。
共368篇文章。
dengxf同学提到的一个问题,想了一下,想到的一个算法:
令为已知量,为目标量,为迭代轮数,
原理:第(2)步的循环将除最高位的所有0均置位。最后一步(3)修正这一值。
The patch is available at: http://people.freebsd.org/~delphij/for_review/bsd_gzip/. Please note that this is considered experimental and it is preliminary for FreeBSD for now, while I think it is very mature code and has been available on NetBSD for years. Positive and negative feedbacks are all welcome.
最近一周FreeBSD发布了多个安全公告,其中有一个gzip的安全问题是Google的人发现的,由于gzip目前已经长期处于无人维护的状态,我认为是时候把这个程序杀掉了。(这次安全更新导致了某些文件无法解压缩)
今天看到ijliao长辈提到,根据Software Freedom Law Center的说法,明天GIF就是完全自由的了。
It turns out that just doing a substring “invalid” search within the XML DOM’s responseText is silly and I have replaced it with an explicit compare. This is still imperfect, though, but fairly bullet-proof as I added an “invalid” in recent blog which caused the RSS reader to consider the feed itself is invalid :-(
不知道为什么突然吵起来了……以前的NetBSD不是这样的。从邮件列表里面也看不出什么实际的线索,希望这次变动不会给NetBSD带来太不好的影响吧。
以前一直是装FreeBSD最小安装,因为感觉很多东西在服务器上根本用不到;又更有甚者,前几天甚至在考虑进一步精简系统,使其在服务器上安装尽可能少的文件(例如开发工具完全不安装)。结果今天发现了一个之前一直没有注意到的问题:game这个看似没用的distribution其实也还是蛮有用的,比如生成素数表,等等。
之前用Safari访问很多中文网页都有问题,今天端木同学帮忙看了一下,发现是默认语言顺序导致的问题。不过调整之后,Firefox又毛病了……不知道是否应该在里面装个FreeBSD,然后再到FreeBSD里面装个X?:P
less is a very popular command line tool that is distributed with a lot of *nix distributions. Thanks goes to David Wolfskill (our postmaster) who helped the test.
The current plan is to MFC less(1) before 6.2-RELEASE’s freeze, but because the date is near, we may want to change the plan.