摘要:原文:http://blog.jobbole.com/61732/所有的程序都需要某种形式的日志记录建立在它们之上,以便我们可以观察到它正在做什么。这尤其在程序出错时就显得非常重要。一个优秀的程序员和一个糟糕的程序员之间的一个不同之处是一个优秀的程序员会增加日志或其他工具以便在程序失败时方便调试。当...
阅读全文
摘要:http://www.cppblog.com/vczh/archive/2014/07/15/207658.html靠谱的代码和DRY上次有人来要求我写一篇文章谈谈什么代码才是好代码,是谁我已经忘记了,好像是AutoHotkey还是啥的专栏的作者。撇开那些奇怪的条款不谈,靠谱的 代码有一个共同的特点...
阅读全文
摘要:import base64f = open("m1.jpg", "rb")res = f.read()s = base64.b64encode(res)f = open("hello.txt","w")f.write(s)
阅读全文
摘要:AlertView.h#import @interface AlertView : UIView@property (strong, nonatomic) UILabel *messageLabel;@endAlertView.m#import "AlertView.h"@interface Ale...
阅读全文
摘要:BookStoreCell.h#import @interface BookStoreCell : UITableViewCell@property (strong, nonatomic) UIImageView *bookImageView;@property (strong, nonatomic...
阅读全文
摘要:Core Data是ORM框架,很像.NET框架中的EntityFramework。使用的基本步骤是:在项目属性里引入CoreData.framework (标准库)在项目中新建DataModel (生成*.xcdatamodeld文件)在DataModel里创建Entity为Entity生成头文件...
阅读全文
摘要:NSXMLParser是标准库类Book.xml 金庸 sfdgasidfhasdfb --> hello,world i'm lishujun sdfsdfs\ aaaasdfsdf ...
阅读全文
摘要:定义:@interface ViewController (){ UIActivityIndicatorView *testActivityIndicator;}实例化,开始旋转:-(void) showWaitStatus{ NSLog(@"wait..."); testActi...
阅读全文
摘要:代码:@interface HttpProcessor : NSObject { NSMutableData *buffer;}@property BOOL finished;@property (strong, nonatomic) NSString *html;@end@implement...
阅读全文
摘要:代码:#import void request(NSString *urlString){ NSLog(@"BEGIN"); // make request object NSURL *url = [[NSURL alloc]initWithString:urlString]; ...
阅读全文
摘要:代码:#import void parseJSON(NSString *text){ NSError *error = nil; NSData *data = [text dataUsingEncoding:NSUTF8StringEncoding]; NSArray *array...
阅读全文
摘要:代码:#import "MainViewController.h"@interface MainViewController ()@end@implementation MainViewController- (void)viewDidLoad{ [super viewDidLoad]; ...
阅读全文