- 浏览: 237467 次
- 性别:
- 来自: 北京
最新评论
-
hnraysir:
必须登录评论下,谢谢。by elesos.com
分库和分表 -
化蝶自在飞:
命运使然.前生来世都注定了的.
贫穷是罪恶之源 -
Kidwind:
出现这样的错误ViewDoesNotExist at /con ...
django的jsCalendar的widget -
hanyh:
我的项目比较小,就直接写在views.py里面了。你出现的是什 ...
django的jsCalendar的widget -
Kidwind:
请问JsCalendarWidget应该放在哪个位置,我的是放 ...
django的jsCalendar的widget
文章列表
昨天下午快下班的时候,部门助理找我谈话,说现在部门改组,你原来所在的部门已经解散,你现在想去的部门的头说你不符合要求,看你怎么办?让我感到很突然,不爽加不服气,五味混杂。但整体上还算平静,因为我对自己 ...
- 2009-07-21 13:23
- 浏览 6244
- 评论(37)
下了linuxCBT需要转换为iso好挂载
sudo apt-get install bchunk
然后便是用bchunk转换:
bchunk -v LinuxCBT.Debian.Edition-CD1.bin LinuxCBT.Debian.Edition-CD1.cue LinuxCBT.Debian.Edition-CD1.iso
- 2009-07-20 15:06
- 浏览 1154
- 评论(0)
设计联系人表的时候,设想用uid和cid作联合索引,把uid放在前面,提高用uid查询的速度(clustered index),结果在实际查询中发现:
1,建表的时候根本不能把`uid`放在key的前面,必须放在后面 PRIMARY key(`cid`,`uid`)
如果这样的话,把Uid作为联合主键一点意义没有,最初的“为了查询而优化”的设计全是拍脑袋的决定!!
mysql> explain select * from contact where uid=1234567890;
+----+-------------+---------+------+---------------+ ...
- 2009-07-20 11:22
- 浏览 1291
- 评论(0)
--
-- 建存储过程
--
--
DROP PROCEDURE IF EXISTS `p_del_group`;
delimiter //
CREATE PROCEDURE p_del_group
(IN p_uid BIGINT,p_gid BIGINT)
BEGIN
DELETE FROM `contact_group` where `uid`=p_uid and `gid`=p_gid;
DELETE FROM `group` where `uid`=p_uid and `gid`=p_gid;
END;
//
delimiter ;
把命令直接粘贴到 ...
- 2009-07-16 17:21
- 浏览 1404
- 评论(0)
http://www.mysqlperformanceblog.com/2007/03/13/to-uuid-or-not-to-uuid/
一直以为pk用uuid比较好(从用hibernate来的),该文章给出来另外一种看法,值得认真读,注意看评论。
- 2009-07-16 14:26
- 浏览 1788
- 评论(0)
一,分类
Rotational(ceasar)轮转
transposition(xor)移位
symmetric(DES,Blowfish..)对称
Asymmetric(RSA,Diffie...)---->Used for signatures and key distribution
(public key && private key)
Hash
sha1(),md5(),mhash...---->Used for in signature and validation
二,例子
敏感数据要加密
常规数据要验证
常见的问题并不是出在算法上面
安全 ...
- 2009-07-14 15:30
- 浏览 935
- 评论(0)
step1:下载0.3
http://t3.dotgnu.info/blog/tags/inclued/
tar -xvzf inclued-0.3.tgz
cd inclued
phpize && ./configure && make && make install
修改php.ini
restart apache2
extension=inclued.so
inclued.enabled=1
inclued.dumpdir=/tmp
访问后在/tmp目录下有inclued...
php gen ...
- 2009-07-14 14:50
- 浏览 2279
- 评论(0)
cvs -d :pserver:cvsread@cvs.xdebug.org:/repository login
# passwd = srmread
cvs -d :pserver:cvsread@cvs.xdebug.org:/repository co -d vld vle
cd vld
./configure && make && make install
php -dextension=vld.so -dvld.active=1 script.php
能够看到编译后的OPCODE
执行:
php -dextension=vld ...
- 2009-07-14 14:31
- 浏览 1745
- 评论(0)
@login_required
def issue_list(request):
s = -1
if request.GET.has_key('status'):
s = int(request.GET.get('status'))
issues = Issue.objects.filter(status=s).order_by('-create_date')
return object_list(
request,
queryset=issues,
template ...
- 2009-07-13 21:33
- 浏览 927
- 评论(0)
awk -F"," 'ttl += $2 {print $2}' r1.csv | sort -n > t
awk -F"," ' { ttl += $2; }END { print ttl }' r1.csv
- 2009-07-07 14:05
- 浏览 1028
- 评论(0)
def issue_save(request):
action = "/jira/issue/s/"
user = request.user
data = request.POST.copy()
id = request.POST.get('id')
if id != '' and int(id)>0:
o = Issue.objects.get(pk=int(id))
u = IssueForm(data,instance=o)
else:
data['iss ...
- 2009-07-07 10:35
- 浏览 1117
- 评论(0)
要在form中输入时间
class JsCalendarWidget(forms.TextInput):
class Media:
js = (
settings.MEDIA_URL+"js/jscalendar/calendar_stripped.js",
settings.MEDIA_URL+"js/jscalendar.setup.js",
settings.MEDIA_URL+"js/jscalendar/calend ...
- 2009-07-02 10:47
- 浏览 1819
- 评论(3)
¬∃k ∈ [2, n) : n ≡ 0 mod k
方法一
def is_prime(n):
k = 2
while k < n:
if n % k == 0:
return False
k += 1
return True
方法二
def is_prime(n):
return len(filter(lambda k:n%k ==0 for k in range(2,n)))==0
def primes(m):
return filter(is_pr ...
- 2009-06-05 11:47
- 浏览 974
- 评论(0)
参见了:http://www.iteye.com/topic/341893
想把内置的Group当作部门来用,增加两个部门电话和email字段,如下
class ProfileGroupBase(type):
def __new__(cls, name, bases, attrs):
module = attrs.pop('__module__')
parents = [b for b in bases if isinstance(b, ProfileGroupBase)]
if parents:
fi ...