posted @ 2014-04-30 11:52
04 2014 档案
摘要:Scrapy是基于python的开源爬虫框架,使用起来也比较方便。具体的官网档:http://doc.scrapy.org/en/latest/ 之前以为了解python就可以直接爬网站了,原来还要了解HTML,XML的基本协议,在了解基础以后,在了解下xpath的基础上,再使用正则表达式(p...
阅读全文
摘要:My first Heading My first paragraph. 与 之间的文本描述网页 与 之间的文本是可见的页面内容 与 之间的文本被显示为标题 与 之间的文本被显示为段落第二个例子:My first Heading My second Heading My first para...
阅读全文
posted @ 2014-04-29 11:52
摘要:#coding=utf-8class data: def __init__(self): #构造函数 self.name='1234' def pp(self): print self.nameclass data2(data): #data2 继承 d...
阅读全文
posted @ 2014-04-25 21:04
摘要:#coding=utf-8import reimport urllibdef getHtml(url): #获取url对应得源码 page = urllib.urlopen(url) html = page.read() return htmldef getImg(html): #...
阅读全文
posted @ 2014-04-25 19:06
摘要:大致流程是,创建一个窗口,在里面添加精灵(背景,小鸟,地板,水管),然后设置物理世界(小鸟的为受重力影响的,其他的精灵不受重力影响),然后在设置碰撞时的情况(小鸟与地板,水管相撞的话,就game over),再设置鼠标的点击事件(点击一次小鸟就上升一段距离)。主类中的变量方法:class HelloWorld : public cocos2d::CCLayer,public b2ContactListener{public: cocos2d::CCSize screenSize;// cocos2d::CCSprite *bird; b2World * world; ...
阅读全文
posted @ 2014-04-10 17:20
摘要:单例模式,故名思意是只有单个实例对象的类。所以要控制构造函数,赋值函数的使用。注意对类静态对象赋予初值的方法。#includeusing namespace std;class CSingleton{ //其他成员public: static CSingleton* GetInstance() { if ( m_pInstance == NULL ) //判断是否第一次调用 m_pInstance = new CSingleton(); return m_pInstance; } ~CSingleton(){ ...
阅读全文
posted @ 2014-04-08 19:12