Django Dict sorted in templates

Django's template is not support Dict sort :( I have write a new filter that support Dict sort in te...

UIViewAnimation 默认四个效果笔记

UIView Animation 默认四效果 UIViewAnimationCurveEaseInOut // 开头结尾慢中间快 UIViewAnimationCurveEaseIn // 先慢...

2012-02-09

trim 一个 NSString

trim NSString NSString * string = @"\n \t\t hello string \t\n \n\n"; NSString * trimed =...

NSURL 处理 urlString 中的中文

解决 NSURL 不能直接处理中文方法: NSString * query = [NSString stringWithString:@"http://www.google.com/?q=苹...

2012-01-31

二维码,条形码扫描项目 ( iPhone )

前几天,给 以前一个同事 写了一个 二维码 条形码 扫描的 apps 主要功能有这些 扫描 二维码,条形码 生成 二维码 通过 邮件 微薄分享 结果 存储到本地, 并且可以删除 项目代码如下 ...

2012-01-17

fabric deploy Servers

use fabric deploy guoku online servers first: install fabric $sudo easy_install fabric or $sudo pip...

2012-01-12

Python 自定义一个 异常

有时候,我们会遇到 系统自带的 异常不够用. Python 提供了自定义异常类型 代码如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18...

2012-01-12

Mac OS lion set Python2.6 by defualt

今天升级完 iMac 到 lion. Python 变成 2.7 了 由于 开发环境是 2.6 所以 只能 降级咯 :) echo "export VERSIONER_PYTHON_VERS...

2012-01-06

hash_ring 源码分析(Python)

consistent hash 算法论文: http://www8.org/w8-papers/2a- webserver/caching/paper2.html 源代码下载: hash_ring-1...

2011-12-30

Python bisect 模块简介

最近在看 hash_ring 的实现代码. 看到 一个 python 模块 bisect 不明白 什么 意思: 于是 就 google 了下 Python 中的bisect用于操作排序的数组,比如...

2011-12-30

折腾 Django solr

最近,又回到老本行了. 呵呵 iOS 折腾好, 开始折腾 python . 话说, 我在微博上 发起山寨一个 pinterset 需要多少时间. 那么 solr 也是 pinterset 搜索的 一项...

2011-12-26

Django sending email via Gmail

在 Django setting.py 配置 EMAIL_USE_TLS = True EMAIL_HOST = 'smtp.gmail.com' EMAIL_HOST_USER = ...

2011-12-24

Django calender tags

在 Django 利用 tags 生成 calender Hoho calender.html 模版: {% for dayname in daynames %}{% endfor %} {% for...

2011-12-22

MongoDB Replica Sets

配置 MongoDB Replica Sets 步骤: 启动 MongDB: mkdir -p /data/db{1,2,3}/ /opt/mongodb/bin/mongod --maxConns ...

2011-12-17

Ubuntu Server 10.04 disable ipv6

Ubuntu disable ipv6 cat << EOF >> /etc/sysctl.conf #disable ipv6 net.ipv6.conf.all.disab...

2011-11-22

iOS MD5 的 category

贡献一个 iOS 的 MD5 category // // NSString+MD5.h // // Created by 谢 家欣 on 11-11-7. // #import #import...

2011-11-07

两个在 iOS5 中 navigationbar 的 category

UINavigationBar+background #import @interface UINavigationBar (Background) - (void)setNavgationBarB...

2011-11-05

iOS5 设置 NavgationBar and toolbar 背景

在 iOS5 SDK 中原来设置 NavgationBar 背景的方法不能用了. // disabeld in iOS5 @implementation UINavigationBar (Navgat...

2011-10-19

Custom UINavigationBar/UIToolBar background image (转帖)

原文来自: http://thesdkblog.com/2011/05/custom-uinavigationbaruitoolbar- background-image/ 虽然给 UINavgati...

2011-10-15

NavigationController backButton 改名

更改 NavigationController backButton 的名字 在父类viewController中如下设置: UIBarButtonItem *backbutton = [[UIBar...

2011-10-01