- 博客(26)
- 资源 (10)
- 收藏
- 关注
原创 HTML解析---IMDB简介抓取
今天做了个IMDB简介抓取,用的是HTML解析,不是用提供的API做的,以前用javascript做过一个。第一次用HTML解析,可以说是从一窍不通到了略知一二。用了hpple开源的解析库。新版和旧版有不少出入,绕了很多弯路,才找到了点门道。效果图:就一个方法- (IBAction)searchIMDB:(id)sender { [[self plot]
2012-12-29 20:50:23 2919
转载 hpple参考代码
已截取cocoachina为例子主要代码如下#define WebSite @"http://www.cocoachina.com/bbs/simple/?f5.html"//NSStringEncoding encode = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000);//NSData
2012-12-29 00:16:07 787
原创 imdb抓取预研草稿
搜索栏:http://207.171.166.140/find?q=good&s=tt 搜标题为“good”的 http://207.171.166.140/find?q=good&s=ep 搜标题为“good”的剧集1.年份//h1/span2.名称 年份//h13.首页简介//p[@itemprop="des
2012-12-28 21:48:11 815
原创 新版hpple使用注意点
1.使用searchWithXPathQuery:代替search:2.content发生变化,原来的程序要做修改原来for (TFHppleElement *element in elements) { NSString *strs = [elemen content]; NSLog(@"cc: %@", strs);
2012-12-28 20:25:48 969
转载 XPath 语法
http://www.w3school.com.cn/xpath/xpath_syntax.aspXPath 使用路径表达式来选取 XML 文档中的节点或节点集。节点是通过沿着路径 (path) 或者步 (steps) 来选取的。XML 实例文档我们将在下面的例子中使用这个 XML 文档。 Harry Potter 29.99 Le
2012-12-28 17:33:19 552
转载 Multiple Windows with Core Data
The majority of Core Data sample code is for either single-window applications or single-document-window applications. There are, however, times when an application or document requires more than one
2012-12-27 21:13:33 1382
原创 sqlite3用法详解草稿
使用的过程根据使用的函数大致分为如下几个过程:sqlite3_open()sqlite3_prepare()sqlite3_step()sqlite3_column()sqlite3_finalize()sqlite3_close()这几个过程是概念上的说法,而不完全是程序运行的过程,如sqlite3_column()表示的是对查询获得一行里面的数据的列的各个操作统称,实际上在sqli
2012-12-26 22:30:00 22938 2
转载 如何学习Objective-C
1.请先把C语言基础学好;2.看《Programming in Objective-C 2.0》,不要看《Objective-C 2.0程序设计》;3.看《Cocoa Design Patterns》和《Cocoa Programming Developer's Handbook》,不要因为他们很难而我们自己是初学者所以就不看;4.是的,你需要一台Mac,如果你真的打算好好学Objec
2012-12-21 21:01:38 1676 1
转载 手工构建 Mac OS APP (一)
手工构建 Mac OS APP (一)Table of Contents手工建立 Mac OS APP?main 函数中的故事最简结构 app 程序的简单结构 做点事情 略进一步带主菜单的 app 状态栏菜单 手工调试 再进一步? Aout Me 手工建立 Mac OS APP?Mac OS App 开发并不复杂,XCode 提供
2012-12-18 23:47:14 1884
转载 关于Cocoa的窗口创建调用-一个nib包含两个窗口
近期在研究cocoa的窗口关系,发现之前写过的一片文章在描述一个nib文件包含两个或者两个以上的窗口时如何实现的文章,写的不清楚,并且很多概念上存在模糊的地方,通过近段时间的调测和学习,对于这部分可以说理解又深刻了一些,因此,在这里从新补充和完善一些概念。1、关于nib当中的窗口,对象的理解。对于nib来说,你可以简单的理解为rc,但是这一点还不够,其实nib是可以包含对象的,这句话的
2012-12-17 23:33:33 2642
转载 xml和NSTableView的一些备注
今天在项目中遇到的问题:在获取字典中的地址和文件名字了,并且进行拼接过后,转换成NSURL的时候NSURL的值为空. NSString*strUrl =[NSStringstringWithFormat:@"%@%@",[rowdic objectForKey:@"DownloadURL"],[rowdic objectForKey:@"Filename"]];输出str
2012-12-17 23:32:37 1376
转载 在Mac Cocoa程序里使用多个xib,实现多个窗口切换
标签:多窗口NSWindowControllerCocoa转载自http://bhlzlx.blog.51cto.com/3389283/966035在编写cocoa程序的时候需要多个窗口切换的时候就出现问题了,一个xib里如果有多个窗口那么,就不容易管理了,一般情况下可以创建单独的xib用来存放窗口。每一个窗口需要有一个单独的NSWindowController来控制,这
2012-12-17 22:52:06 3304
原创 TVrage检索程序 [上]
根据TVrage的API 搞了个检索的Demon。http://services.tvrage.com/info.php?page=main更新了部分代码,修复检索多个单词不响应,改变搜索方案为输入完整后Enter才执行。下面是核心部分代码- (NSArray *)fetchTVShowWithTitle:(NSString *)title WithError:(NSE
2012-12-15 18:12:00 703
原创 单向链表操作(产生,删除,插入以及查询)
//// main.m// leap//// Created by Mamong on 12-11-26.// Copyright (c) 2012年 Mamong. All rights reserved.//#include//#include//#define NULL 0#define LEN sizeof(DAT)typedef struct studen
2012-12-12 23:29:45 765
原创 算法:将数组中的整数进行排列,奇数在左边,偶数在右边
将数组中的整数进行排列,奇数在左边,偶数在右边应用快速排序算法的划分算法的思想,先从数组左侧寻找,遇到奇数,则左侧索引l加1,遇到偶数,就将其放入到临时空间x。然后再从右边寻找,遇到偶数,右侧索引r减1,遇到奇数,就将其放入到左侧搜到的偶数的位置,并把临时空间的奇数放入该位置。直到左右索引相遇,则排列结束。该算法有一个不足的地方,就是每次都会从最左边和最右边开始找。可以做些改进。
2012-12-07 18:15:12 5174
转载 NSString 常用方法总结
NSString 常用方法总结+(id)stringWithContentsOfFile:path encoding:enc err创建一个新字符串并将其设置为 path 指定文件的内容,使用字符编码 enc,在err 上返回错误+(id)stringWithContentsOfURL:url encoding:enc err创建一个新字符串并将其设置为 u
2012-12-04 14:15:53 2650
转载 objective-c基本数据类型之输出格式符
基本数据类型1. int输出格式符:%i, %d, %o %x, 2. float输出格式符:%f, %e, %g3. double输出格式符:%f, %e, %g 4. char输出格式符:%c限定符:1. longlong int: %lilong double: %Lf形成long int通过在数字后
2012-12-04 14:13:29 7093
转载 iOS开发24:使用SQLite3存储和读取数据
SQLite3是嵌入在iOS中的关系型数据库,对于存储大规模的数据很有效。SQLite3使得不必将每个对象都加到内存中。基本操作:(1)打开或者创建数据库sqlite3 *database;int result = sqlite3_open("/path/databaseFile", &database);如果/path/databaseFile不存在,则创建它,否则打开它。
2012-12-04 14:10:39 3001
转载 [Cocoa]深入浅出 Cocoa 之 Bonjour 网络编程
深入浅出 Cocoa 之 Bonjour 网络编程罗朝辉(http://blog.csdn.net/kesalin/)CC许可,转载请注明出处本文高度参考自 Tutorial: Networking and Bonjour on iPhone,在那个帖子里 iphone 版本的代码采用的是 MIT 开源协议,所以本例子中的 Mac 版本亦采用 MIT 开源协议。E文较好的童
2012-12-03 22:55:27 1009
转载 Tutorial: Networking and Bonjour on iPhone
Tutorial: Networking and Bonjour on iPhoneby Peter Bakhyryevon 20. May, 2009 in Resources,Tips, Tutorials TweetThere are plenty of different places to get a mobile application designed
2012-12-03 22:54:06 1688 1
转载 iOS 培训大纲
第一专题:C语言编程基础主要内容:深入学习C语言编程基础知识,熟练掌握C语言的指针,内存管理,数据结构,为下一步学习Object-C做好知识储备。第二专题 :从C语言到Object-C ∗ 主要内容:object-C的基础语法以及编程要点第三专题 Object-C和Cocoa框架 主要内容:学习Cocoa框架( Graphics,widget,Audio,Network
2012-12-02 23:27:16 2233
原创 Mac&iOS Socket 相关备忘
struct sockaddr { unsigned short sa_family; /* address family, AF_xxx */ char sa_data[14]; /* 14 bytes of protocol address */ }; sa_family是地址家族,一般都是“AF_xxx”的形式。通常大多用的是都是AF_INET,代表TCP/IP协议族
2012-12-02 21:35:32 1646
转载 iPhone Network Programming
iPhone Network ProgrammingLearn how to communicate with a server using TCP/IP and how to build a simple chat application.by Wei-Meng LeeWei-Meng Lee is a Microsoft MVP and founder
2012-12-02 17:07:00 1116
转载 accept和recvfrom和gerpeername中__保存远程主机的地址信息,所以必须在使用前,必须初始化地址长度len
在Linux网络编程中,使用到地址长度的有::#include #include int bind(int sockfd,struct sockaddr *my_addr,socket_t addrlen); 注意:: my_addr是自己的网络地址,参看网络地址的实现。//SOCK_STEAM中的Server自己的地址和SOCK_DGR
2012-12-02 16:45:42 1186
转载 Mac&iOS Socket
注:文档中设计涉及的代码也都在本人github目录下,分别为socketServer和socketClient.对应着各个分支。一.Socket简介在UNIX系统中,万物皆文件(Everything is a file)。所有的IO操作都可以看作对文件的IO操作,都遵循着这样的操作模式:打开 -> 读/写 -> 关闭,打开操作(如open函数)获取“文件”使用权,返回文件描述符
2012-12-02 16:21:40 2710 2
转载 理解Cocoa的委托 数据源和控制器
有关于Controller(控制器)的说明我把它摘录在下面:A controller object acts as a coordinator or as an intermediary between one or more view objects and one or more model objects. In the Model-View-Controller design pa
2012-12-02 15:10:12 651
[cnswift.org翻译]最新swift 5.5中文翻译
2021-08-24
[cnswift.org翻译]最新swift 5.3中文翻译
2021-04-06
[cnswift.org翻译]最新swift 5.1中文翻译
2019-07-07
ARKit by Tutorials, 2nd Edition
2019-05-21
[cnswift.org翻译]最新swift 5中文翻译
2019-03-09
Apress.Beginning.Machine.Learning.in.iOS.CoreML.Framework
2019-02-22
[cnswift.org翻译]最新swift 4.2 alpha中文翻译
2018-08-06
iOS Programming: The Big Nerd Ranch Guide (4th Edition) (Big Nerd Ranch Guides)
2014-03-04
iOS 7 App Development Essential
2013-11-27
Effective Objective-C 2.0
2013-11-27
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人