Development

共370篇文章。

When you can use a different license?

Development

To quote M. Warner Losh (with permission):

So long as there’s old code, you can’t replace the copyright,unlessthe old code that remains is not protectable by copyright any more(eg, if it is just { and } lines).If you add your own implementation of the 50 lines in question, or move them to a separate file, then you can put your own copyright/license statement on the code you wrote.

阅读全文…:When you can use a different license?(本文约153字,阅读大致需要1分钟)

如何计算不小于给定数的最小的2整数次方幂?

Development

dengxf同学提到的一个问题,想了一下,想到的一个算法:

令xx为已知量,yy为目标量,kk为迭代轮数,

  1. 令y=x−1y=x-1,k=0k=0
  2. 对于yy右移2k2^k位>0> 0的情形,执行下列操作,直到此条件不符合为止:
    y与前述结果相与;kk累进11。
  3. yy累进11。

原理:第(2)步的循环将除最高位的所有0均置位。最后一步(3)修正这一值。

阅读全文…:如何计算不小于给定数的最小的2整数次方幂?(本文约199字,阅读大致需要1分钟)

升级到了trac 0.10

Development

之前zoomq同学说trac-dev版本很好用,不过我总觉得在如此重要的生产系统上玩CURRENT一类的东西是给自己找麻烦,可是trac的发行版本一直都没有出,直到前几天扫描PR,发现宋政隆同学已经提交了一个patch,于是直接升级了。

没听说过trac,专职做开发的同学请自觉面壁一分钟 :P

参与评论:升级到了trac 0.10

我准备杀掉GNU gzip

Development

最近一周FreeBSD发布了多个安全公告,其中有一个gzip的安全问题是Google的人发现的,由于gzip目前已经长期处于无人维护的状态,我认为是时候把这个程序杀掉了。(这次安全更新导致了某些文件无法解压缩)

阅读全文…:我准备杀掉GNU gzip(本文约151字,阅读大致需要1分钟)

Bug fixed in rss.js

Development

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 :-(

参与评论:Bug fixed in rss.js

原来game这这如此重要

Development

以前一直是装FreeBSD最小安装,因为感觉很多东西在服务器上根本用不到;又更有甚者,前几天甚至在考虑进一步精简系统,使其在服务器上安装尽可能少的文件(例如开发工具完全不安装)。结果今天发现了一个之前一直没有注意到的问题:game这个看似没用的distribution其实也还是蛮有用的,比如生成素数表,等等。

阅读全文…:原来game这这如此重要(本文约181字,阅读大致需要1分钟)
搜索文章…(按ESC退出)