iOS GridView 算法
分享 一段 iOS 中 gridView 实现的算法. /* x0 x1 x2 x3 +-------+-------+-------+ y3 | | ...
解决 iOS6 中 tableview 背景设置问题
iOS6 之前版本给 tableview 设置背景只需如下: self.tableView.backgroundColor = [UIColor redColor]; iOS6 却无效。 然后,查...
解决 zbar 扫瞄中文 乱码问题
self.twoDimString = symbol.data; //编解码问题 if ([self.twoDimString canBeConvertedToEncoding:NSS...
__bridge,__bridge_retained和__bridge_transfer的意思,区别与使用
使用ARC能帮我们减轻不少内存管理方面的负担,尤其是对用惯了Java的程序员来说。但是像我这种Java基础本身就不牢固,做了两年的iOS已经习惯手动管理内存的半吊子,使用ARC还是经常碰壁。 最近碰到...
ubuntu11.04 安装 snmp
sudo apt-get install snmp snmpd vim /etc/snmp/snmpd.conf 1.将原有“agentAddress udp:127.0.0.1:161”改为: ...
objective-c abort() 与 exit() 函数的区别
exit()函数 调用exit会让用户感觉程序崩溃了,不会有按Home键返回时的平滑过渡和动画效果;另外,使用exit可能会丢失数据,因为调用exit并不会调用- applicationWillTer...
Django Rest FrameWork (一)序列化
建立一个新的 Django 开发环境: 使用 virtualenv 创建一个新的虚拟环境。 mkdir ~/env/ virtualenv ~/env/tutorial source ~/env/...
Django Sitemap 应用实例
sitemap 主要是描述了网站的结构, 使得搜索引擎更容易的理解网站得内容。 具体 sitemap 生成可以参考 sietmaps.org Django sitemap 的建立: 在 settin...
rabbitMQ 添加 vhost
为 rabbitMQ 添加 vhost 和 user rabbitmqctl add_vhost /myhost # 添加 vhost rabbitmqctl add_user me me123 #...
iOS开发之 自定义NSLog
1、如何自定义NSLog呢? 直接在工程的XXX_Prefix.pch中加入以下语句(就相当于在全局中定义了) define NSLog NSLog(@"#%s##%d#",strrchr(FILE,...
How to connect mongoengine ReplicaSet
After mongoengine 0.6 release, it has support RelicaSet connection For exapmle: from mongoengine imp...
django Text common tools
做下笔记, Django 中的一些文本处理工具. 觉得挺有用的:) get_text_list(items, last_word='or') from django.utils.text import...
兩條重要的 iptable 命令(懂得。。。)
大陆程序员技能必备 iptables -I FORWARD -p tcp --syn -i ppp+ -j TCPMSS --set-mss 1410 iptables --table nat --a...
(转载)高可用性的 LAMP 搭建
文章很老了。不过感觉很不错。 mark下同时也分享给大家 https://help.ubuntu.com/community/HighlyAvailableLAMP...
Python 设计模式 decorator
Decorators: Another common way to alter the way a function behaves is to “decorate” it with another ...
django+gunicorn+nginx 配置
折腾了好久 apache+wsgi 不知道为什么一直在 memory leak 在失去了改源码的激情中, 只能通过换服务的方式解决了. 借鉴 instagram 的典型架构使用 django + gu...
修改Ubuntu 时区配置
方法一: 直接修改 /etc/timezone 文件 echo "Asia/Shanghai" > /etc/timezone 方法二: 使用 dpkg-reconfig...
化学品查询 apps 上线了
化学品查询 apps 正式上线....审核了将近 2 周 下载链接. http://itunes.apple.com/cn/app/wu-jing- shu-ju-ku/id518583101?l=e...
算法中时间复杂度分析
求函数 1!+2!+....+n! 列出两种算法比较性能 方法一: int fact1(int n) { int i, j, temp, s; s = 0; for (i=1; i&...
图片等比缩放 (Python 语言描述)
图片等比缩放: w = float( originWidth ) #原始宽度 h = float( originheight ) #原始高度 boxW...