`
hanyh
  • 浏览: 228844 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表
最近用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 ...
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 ...
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 ...
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. ...
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 ...
一,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 ...
设想:你在没有任何准备的情况,老板忽然问你对某件事物的看法?老板开会的时候忽然说有一个领导岗位空缺,请大家马上毛遂自荐,互相PK 我们该如何应对呢? 可惜的是:我从未做过此类准备,今天就给遇上了。 0,理解需求    明白老板目的    理解利益相关方的目的(非常重要) 1,分类 2,逻辑 3,自信 ......

理解对方的需求

理解对方的需求并给出如何提供,就是制胜之道:) 如果能够发掘出新的需求,给出更大的诱惑,就更加不错了..... 我们需要借力打力...
基本上代码要关心: 时间(CPU) 空间(内存) IO(磁盘读写&网络) 资源消耗(文件描述符合的消耗,数据库连接符合消耗,各种“锁”的消耗) 有空然后展开
使用工具,简化软件开发 源代码编辑 源代码处理 源代码浏览 源代码生成 版本控制 源代码美化 源代码构建 编译器 链接器 构建工具 测试工具 调试器 分析器 代码检验(动态和静态) 缺陷跟踪 文档工具 项目管理 辅助设计 组件和库 grep strace find diff sed awk python java gdb uml netbeans.. .......
以前编译安装的时候忘记了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 ...
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 ...
如果自己编译安装不知道啥配置在那里,在这里面找
无论apache,mysql,php都针对具体的需求,拥有自己的控制的库,C在真实的项目中并不原始
Global site tag (gtag.js) - Google Analytics