- 博客(71)
- 收藏
- 关注
原创 iOS7新特色
导航栏背景色用barTintColor设置using barTintColorinstead of tintColorto tint a bar’s background.
2013-10-11 14:55:45
727
原创 iOS7TransitionGuide阅读笔记
动态字体iOS 7 introduces Dynamic Type, which makes it easy to display great-looking text in your app. tint colorIn iOS 7, tint color is a property ofUIView. iOS 7 apps
2013-10-10 15:03:12
169
原创 git clone 和 git push
git clone qq@42.121.0.72:/srv/auntgroups.gitgit push qq@42.121.0.72:/srv/auntgroups.git master
2013-07-22 15:17:52
425
原创 时间类微博格式的转换逻辑
是否60秒内 提示:xx秒前是否60分钟内 提示:xx分钟前是否昨天 提示:xx是否大于60分钟且小于24 * 60 分钟 提示:xx小时前是否更多天前
2013-07-04 09:43:00
399
转载 判断是否包含汉字
UTF8编码:汉字占3个字节,英文字符占1个字节NSString *text = @"i'm a 苹果。...";int length = [text length];for (int i=0; i{NSRange range = NSMakeRange(i, 1);NSString *subString = [text substringWithRange:ran
2012-10-10 15:49:04
549
原创 11
UTF8编码:汉字占3个字节,英文字符占1个字节NSString *text = @"i'm a 苹果。...";int length = [text length];for (int i=0; i{NSRange range = NSMakeRange(i, 1);NSString *subString = [text substringWithRange:ran
2012-10-10 15:40:19
111
转载 在iOS中获取AGSMapView的图片
http://www.giser.net/?p=1047在iOS中有时候会需要截取mapview当前的显示内容,用来辅助描述你的地理位置,下面的代码为截图的方法:if (NULL != UIGraphicsBeginImageContextWithOptions)UIGraphicsBeginImageContextWithOptions(self.mapView.fram
2012-09-30 12:53:15
961
转载 ios文件分享
由于最近项目需要读取本地用户的视频..发现无法读取ios设备自带"视频"应用中的视频..很懊恼..4了很多种方法.连assetLibrary都用上了.还不能...国内根本没有..去国外找也没有..最后发现一些看书软件..办公软件有个文件共享功能..只能以后让用户自己添加到文件共享了...不给力的apple..还发现苹果自身的软件在播放视频的时候,如果连续快进或后退..一会就应用就挂
2012-09-28 02:25:15
717
转载 使用sqlite时遇到的错误 read-only
在模拟器上运行没有问题;在真机上报如下错误:Attempt to add read-only file at path file://localhost/var/mobile/Applications/A80208B7-36C8-4CD0-94D9-E3EC57BDA4D6/BookingMeals.app/ShopCar.sqlite read/write. Adding it read
2012-09-25 18:39:55
582
转载 "Format string is not a string literal (potentially insecure)"
"Format string is not a string literal (potentially insecure)"NSLog([NSString stringWithFormat:@"%@", entered]);he compiler wants us to use an NSString constant for the format string (the fi
2012-09-24 10:27:38
368
转载 "Format string is not a string literal (potentially insecure)"
"Format string is not a string literal (potentially insecure)"NSLog([NSString stringWithFormat:@"%@", entered]);he compiler wants us to use an NSString constant for the format string (the
2012-09-22 19:06:24
850
原创 //为cell设背景色
UIView *backgrdView = [[UIViewalloc]initWithFrame:cell.frame]; backgrdView.backgroundColor =RGBCOLOR(244,148,35); cell.backgroundView = backgrdView;或者- (void)tableView:
2012-09-16 20:43:05
416
转载 svn忽略目录
http://blog.sina.com.cn/s/blog_6f066a890100zjzd.html看了上面两篇转载的文章,加上自己的实践总结如下: Request:我有一个工程,工程名为simple,采用maven进行依赖管理,在check in时我不想工程下maven产生的target目录被提交到SVN(包括目录下所有文件和目录本身)。
2012-09-08 17:02:44
3594
转载 linux下django使用imagefield需要的配置
我的环境:centos / Python2.5PIL是python理想的图片处理module,但是想要良好的支持各种图片,还需要检查一下几步,否则会提示:IOError: decoder jpeg not available之类的。第一步:安装zlib png freetype jpeginstall zlib (官方源没有zlib,别想yum了)下载zlib,(zli
2012-08-28 18:03:47
1650
转载 linux解压命令
tar-c: 建立压缩档案-x:解压-t:查看内容-r:向压缩归档文件末尾追加文件-u:更新原压缩包中的文件这五个是独立的命令,压缩解压都要用到其中一个,可以和别的命令连用但只能用其中一个。下面的参数是根据需要在压缩或解压档案时可选的。-z:有gzip属性的-j:有bz2属性的-Z:有compress属性的-v:显示所有过程-O:将文件解开到
2012-08-28 17:48:07
450
原创 xz解压命令——sudo apt-get install unrar p7zip-rar p7zip-full cabextract
sudo apt-get install unrar p7zip-rar p7zip-full cabextract XZ命令解压缩xz这个压缩可能很多都很陌生,不过您可知道xz是绝大数linux默认就带的一个压缩工具。之前xz使用一直很少,所以几乎没有什么提起。我是在下载phpmyadmin的时候看到这种压缩格式的,phpmyadmin压缩包xz格式的居然比7z还要小,这引起我的兴趣
2012-08-28 17:40:29
3978
原创 django国际化时步骤
1.setting.py里language_code = 'zh-cn' //注意减号和小写2.模板文件里加入{% load i18n %} ,相当于引入translate的相关标签3.在app目录下建立目录4.django-admin.py makemessages -l zh_CN5.django-admin.py makemessages -a6.django-a
2012-08-27 15:12:42
822
原创 django国际化时遇到的一个问题
Error: This script should be run from the Django SVN tree or your project or app tree. If you did indeed run it from the SVN checkout or your project or application, maybe you are just missing the con
2012-08-27 10:09:49
924
转载 程序员技术练级攻略
http://coolshell.cn/articles/8088.html月光博客6月12日发表了《写给新手程序员的一封信》,翻译自《An open letter to those who want to start programming》,我的朋友(他在本站的id是Mailper)告诉我,他希望在酷壳上看到一篇更具操作性的文章。因为他也是喜欢编程和技术的家伙,于是,我让他把他
2012-08-26 23:15:17
564
转载 【每日一记】对技术的态度
http://coolshell.cn/articles/8088.htmlBy 陈皓最近人品爆发,图灵社区,InfoQ,51CTO相继对我做了采访,前两天我把InfoQ对我的采访张贴了出来,今天,图灵社区和51CTO对我的采访发布了(图灵的访谈 ,51CTO的访谈),我是一个有技术焦虑症的人,我的经历比较特殊,对大家来说可能也没有什么意思,这两个采都有一些重叠的部分,不过有些
2012-08-26 23:14:30
1105
原创 Django集成已有的数据库和应用[转]
Django最适合于所谓的green-field开发,即从头开始的一个项目,正如你在一块还长着青草的未开垦的土地上从零开始建造一栋建筑一 般。 然而,尽管Django偏爱从头开始的项目,将这个框架和以前遗留的数据库和应用相整合仍然是可能的。 本章就将介绍一些整合的技巧。与遗留数据库整合Django的数据库层从Python代码生成SQL schemas—但是对于遗留数据库,你已经拥有SQ
2012-08-26 00:54:09
5635
原创 keyWindow,[UIApplication sharedApplication]
[touchlocationInView:[[UIApplicationsharedApplication] keyWindow]]keyWindowThe application's key window. (read-only)@property(nonatomic, readonly) UIWindow *keyWindowDi
2012-08-25 23:27:27
2885
原创 [UIApplication sharedApplication] keyWindow]
[touchlocationInView:[[UIApplicationsharedApplication] keyWindow]
2012-08-25 23:26:31
188
原创 UITableView删除行的问题
删除数据源中的对应数据必须在输出行cell之前,不然会崩溃,报错Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of rows in section 0. The number of rows
2012-08-25 00:13:40
3053
原创 django国际化——加提示
Comments for translatorsNew in Django 1.3: Please see the release notesIf you would like to give translators hints about a translatable string, you can add a comment prefixed with the Translator
2012-08-23 17:40:52
463
原创 django国际化——格式化字符串
The strings you pass to _() or ugettext() can take placeholders, specified with Python's standard named-string interpolation syntax. Example:def my_view(request, m, d): output = _('Today i
2012-08-23 17:32:24
597
原创 python的字符串对象有一个join函数,用来连接多个字符串
words = ['Welcome', 'to', 'my', 'site.'] output = _(' '.join(words))
2012-08-23 17:25:23
516
转载 tableview插入,删除,改变cell高度的动画用beginUpdates和endUpdates
Call this method if you want subsequent insertions, deletion, and selection operations (for example, cellForRowAtIndexPath: and indexPathsForVisibleRows) to be animated simultaneously. This group of
2012-08-23 09:51:30
2515
原创 xib文件生成view
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ static NSString *CellIdentifier = @"ProductCatagoryCell"; ProductCatagoryCel
2012-08-22 23:31:00
740
原创 linux 改编码命令——————iconv
Usage: iconv [OPTION...] [FILE...]Convert encoding of given files from one encoding to another. Input/Output format specification: -f, --from-code=NAME encoding of original text -t
2012-08-22 18:09:13
824
原创 ValueError: The database backend does not accept 0 as a value for AutoField.
django工程数据库从sqlite换到mysql,我的做法是直接python manage.py syncdb生成表,然后python manage.py schemamigration --initial order,python manage.py migrate order,结果报了上述错误。问了同事,说我这样直接把应用表生成了的话,就得运行一个south接管的命令。他建议我先把我的应
2012-08-22 13:41:51
2254
转载 mysql编码配置
Ubuntu修改mysql默认编码修改mysql的配置文件,使数据库与服务器操作系统的字符集设置一致。 vi /etc/my.cnf 设置(如果没有发现这个文件,就新建1个) [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock default-ch
2012-08-22 01:12:37
365
原创 No module named mysqldb,数据库换成mysql时发生上述错误
Use one of this commands, depends what os and software do u have and useeasy_install mysql-python (mix os)pip install mysql-python (mix os)apt-get install python-mysqldb (Linux Ubuntu,
2012-08-21 23:25:30
1798
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人