delphij's Chaos

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.

阅读全文… ( 本文约 156 字,阅读大致需要 1 分钟 )

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

Development

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

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

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

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

阅读全文… ( 本文约 199 字,阅读大致需要 1 分钟 )

trac的ticket notification

Development

半作弊条性质。

找到trac环境目录。

进入其下的conf,揪出trac.ini
编辑,找到下面的段落替换为类似的内容

[notification]
always_notify_owner = true
smtp_always_cc = !!你的邮件列表名字!!
smtp_password = !!密码!!
smtp_enabled = yes
smtp_replyto = !!回复给谁?通常是管理员或留空!!
smtp_port = 25
always_notify_reporter = yes
smtp_server = !!邮件服务器名字!!
smtp_from = !!邮件以谁的身份发出?通常是trac管理员!!
smtp_user = !!登录邮件服务器的用户名!!

阅读全文… ( 本文约 223 字,阅读大致需要 1 分钟 )

少年先锋队队歌 zz

Shared Chaos

今天突发奇想找到的。

我们是共产主义接班人,
继承革命先辈光荣传统,
爱祖国,爱人民,
鲜艳的红领巾飘扬在前胸。
不怕困难,不怕牺牲,顽强学习,
坚决斗争,向着胜利勇敢前进,
向着胜利勇敢前进,前进,
向着胜利勇敢前进,
我们是共产主义接班人。

阅读全文… ( 本文约 215 字,阅读大致需要 1 分钟 )