- 浏览: 241141 次
- 性别:
- 来自: 北京
-
最新评论
-
hnraysir:
必须登录评论下,谢谢。by elesos.com
分库和分表 -
化蝶自在飞:
命运使然.前生来世都注定了的.
贫穷是罪恶之源 -
Kidwind:
出现这样的错误ViewDoesNotExist at /con ...
django的jsCalendar的widget -
hanyh:
我的项目比较小,就直接写在views.py里面了。你出现的是什 ...
django的jsCalendar的widget -
Kidwind:
请问JsCalendarWidget应该放在哪个位置,我的是放 ...
django的jsCalendar的widget
文章列表
最近用django作点小项目,直接使用doctest,用起来真爽.
注意几点:
1,每个测试用例加注释,最好和对应的Ticket联系起来
2,当前Client工具足够好用
可以通过status_code,context,content来测试自己的view是否正确
3,可以直接查看models的数据,非常方便
4,比unittest的无用代码量少多了
示例代码如下:
有个tribe的app
中间建了一个tests的目录
tribe/tests$ more __init__.py
# coding=UTF-8
from django.contrib.auth.models import U ...
- 2009-11-12 17:57
- 浏览 1693
- 评论(0)
php中为什么有了 __destruct函数后还没有把register_shutdown_function 置为deprecated ?
代码说明一切:
<?php
class T1
{
function __construct()
{
register_shutdown_function(array(&$this, 'shutdown_func'));
}
function shutdown_func() {
$fp = fopen("/tmp/t1.txt", ...
step 1:
apt-get install gitweb ....
step 2:
hanyh@hanyh-laptop:~/workspace/git$ more /etc/gitweb.conf
# path to git projects (<project>.git)
#$projectroot = "/var/cache/git";
$projectroot = "/home/hanyh/workspace/git";
# directory to use for temp files
$git_t ...
- 2009-11-06 10:36
- 浏览 2304
- 评论(0)
Always use the redefinition of the save-method, when ...
* you check given values
* you create directories or files (directly connected to the data model) e.g. I create a new directory for each new Memory
* you are auto-populating fields, like James Bennett explains.
* you do any act ...
- 2009-11-05 16:45
- 浏览 952
- 评论(0)
class CategoryNameRepeated(Exception):
pass
class Category(models.Model):
name = models.CharField(max_length=128)
parent = models.ForeignKey('self', blank=True, null=True, related_name='child_set')
def save(self):
if not self.parent:
if Category. ...
- 2009-11-05 16:26
- 浏览 952
- 评论(0)
class Profile(models.Model):
user = models.ForeignKey(User, unique=True)
address = models.CharField(max_length=255, blank=True)
nickname = models.CharField(max_length=96, blank=True)
signature = models.CharField(max_length=1024, blank=True)
blog = models.CharField(max_lengt ...
- 2009-11-05 16:23
- 浏览 906
- 评论(0)
一,git clone git@xxx.xxx.xx:quark/fouge.git
出现permission denied
解决方式:
1. ssh-keygen -t rsa 会生成两个文件 id_rsa, id_rsa.pub
2. 把id_rsa.pub里的东西添加到git account里的SSH Public Keys。
二,然后输入passpharse,git clone ....
如果git push出现:
warning: You did not specify any refspecs to push, and the current remote
warning ...
- 2009-11-02 10:46
- 浏览 3125
- 评论(0)
如何合适的应对遭遇战?
- 博客分类:
- 学习
设想:你在没有任何准备的情况,老板忽然问你对某件事物的看法?老板开会的时候忽然说有一个领导岗位空缺,请大家马上毛遂自荐,互相PK
我们该如何应对呢?
可惜的是:我从未做过此类准备,今天就给遇上了。
0,理解需求
明白老板目的
理解利益相关方的目的(非常重要)
1,分类
2,逻辑
3,自信
......
- 2009-10-28 23:38
- 浏览 687
- 评论(0)
理解对方的需求并给出如何提供,就是制胜之道:)
如果能够发掘出新的需求,给出更大的诱惑,就更加不错了.....
我们需要借力打力...
- 2009-10-28 17:22
- 浏览 729
- 评论(0)
基本上代码要关心:
时间(CPU)
空间(内存)
IO(磁盘读写&网络)
资源消耗(文件描述符合的消耗,数据库连接符合消耗,各种“锁”的消耗)
有空然后展开
- 2009-10-26 16:58
- 浏览 1023
- 评论(0)
使用工具,简化软件开发
源代码编辑
源代码处理
源代码浏览
源代码生成
版本控制
源代码美化
源代码构建
编译器
链接器
构建工具
测试工具
调试器
分析器
代码检验(动态和静态)
缺陷跟踪
文档工具
项目管理
辅助设计
组件和库
grep
strace
find
diff
sed
awk
python
java
gdb
uml
netbeans..
.......
- 2009-10-26 15:47
- 浏览 916
- 评论(0)
以前编译安装的时候忘记了mod_rewrite
hanyh@hanyh-sina:~/download/httpd-2.2.14/modules/mappers$/opt/apache/bin/apxs -c mod_rewrite.c
/opt/apache/build/libtool --silent --mode=compile gcc -prefer-pic -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -pthread -I/opt/apache/include -I/opt/apache/include -I/opt/apache ...
- 2009-10-22 14:58
- 浏览 954
- 评论(0)
Boot security
=========================================
BIOS
pwd
GRUB
pwd
KERNEL
check the dmesg file
cpu,mem,hardware,kernel version
INIT
1, default run-level to 3 from 5
a. no graphical tcp x windows listeners
b. uses fewer system resources
2, Disabled Ctrl,alt,del -reboot
3, Reduce t ...
- 2009-10-21 22:27
- 浏览 787
- 评论(0)
无论apache,mysql,php都针对具体的需求,拥有自己的控制的库,C在真实的项目中并不原始
- 2009-10-21 15:30
- 浏览 999
- 评论(0)