2016年10月11日

python字符串转整形异常

摘要: python字符串转整形异常 问题 在使用int("xx")转化字符串为整形时,如果字符串是float形式,这样转化会异常 解决: 先转化为浮点型,在转化为整形 实例: 阅读全文

posted @ 2016-10-11 10:32 ZhYQ_note 阅读(1653) 评论(0) 推荐(0) 编辑

2016年10月10日

python:UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)

摘要: ``` # 将默认编码设为utf-8 # 否则会报错: # UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128) import sys reload(sys) sys.setdefaultencoding('utf-8') ``` 阅读全文

posted @ 2016-10-10 16:40 ZhYQ_note 阅读(247) 评论(0) 推荐(0) 编辑

2016年10月9日

mac和xcode快捷键

摘要: xcode快捷键 |用途 | 快捷键 | |: | :| | 局部折叠 | Command+Alt+Left/Right| | 全局折叠 | Shift+Command+Alt+Left/Right | |选择到文件开头 | Shift Home | | 选择到文件结尾 | Shift End | 阅读全文

posted @ 2016-10-09 14:55 ZhYQ_note 阅读(193) 评论(0) 推荐(0) 编辑

mac mysql 使用注意事项

摘要: mac mysql 使用注意事项 1、安装 直接通过下载官网上的dmg安装包进行安装,mysql-5.5.49-osx10.8-x86_64(我的安装文件) ,安装完成后在系统偏好设置里面有mysql选项,我们可以通过这个启动和停止mysql服务器,默认安装在了 /usr/local/mysql 目录 2、启动 通过系统偏好设置启动项启动 通过/usr/local/mysql/... 阅读全文

posted @ 2016-10-09 14:04 ZhYQ_note 阅读(699) 评论(0) 推荐(0) 编辑

3D中的相机 - 投影矩阵和视图矩阵

摘要: 3D中的相机 - 投影矩阵和视图矩阵 3d游戏中,一般通过相机的设置来计算投影矩阵和视图矩阵,比如untiy和cocos,一般情况下我们不用关注如何计算, 可以直接在可视化的编辑器中调整参数就可以了,但是了解下总是好的。 具体计算可以参考: 可以参考现在cocos2dx的代码中的Camera源码,里面有根据相机的设置(位置等)计算上面两个矩阵的代码。 也可以参考下面这个,github上面一个项目... 阅读全文

posted @ 2016-10-09 13:56 ZhYQ_note 阅读(750) 评论(0) 推荐(0) 编辑

cocos Uniforms值的赋值

摘要: cocos Uniforms值的赋值 举个void Renderer::drawBatchedTriangles()的渲染: //Start drawing verties in batch for(const auto& cmd : _batchedCommands) { auto newMaterialID = cmd->getMaterialID(); ... 阅读全文

posted @ 2016-10-09 13:50 ZhYQ_note 阅读(252) 评论(0) 推荐(0) 编辑

attempt to call method 'getDataString' (a nil value)

摘要: 错误: LUA ERROR: [string "/Users/staff/Documents/cocos-quick/merge/cocos-quick/player/quick/welcome/src/player.lua"]:223: attempt to call method 'getDataString' (a nil value) 在合并cocos和quick的时候,在EventC... 阅读全文

posted @ 2016-10-09 13:47 ZhYQ_note 阅读(541) 评论(0) 推荐(0) 编辑

2016年10月8日

cocos执行tolua/genbindings.py文件,错误搜集:

摘要: 1、PYTHON_BIN not defined, use current python.这个不是错误 2、llvm toolchain not found!path: /Users/staff/Documents/worksoft/android-ndk-r10e/toolchains/llvm- 阅读全文

posted @ 2016-10-08 18:48 ZhYQ_note 阅读(3445) 评论(0) 推荐(0) 编辑

2016年9月30日

player: 初始化分析

摘要: //1、 //cocos 程序开始运行时执行的函数 bool AppDelegate::applicationDidFinishLaunching() { // initialize director auto director = Director::getInstance(); director->setProjection(Director::Projection:... 阅读全文

posted @ 2016-09-30 17:04 ZhYQ_note 阅读(412) 评论(0) 推荐(0) 编辑

2016年9月29日

quick player运行分析

摘要: mac应用从AppController.mm源文件的applicationDidFinishLaunching函数启动: 1 1、 2 - (void)applicationDidFinishLaunching:(NSNotification *)aNotification 3 { 4 [self installUncaughtExceptionHandler]; 5... 阅读全文

posted @ 2016-09-29 12:24 ZhYQ_note 阅读(680) 评论(0) 推荐(0) 编辑

2016年9月28日

quick: setup_mac.sh分析

摘要: //quick: setup_mac.sh分析 //quick: setup_mac.sh分析#!/bin/bash //获取并打印根目录QUICK_V3_ROOTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"BASENAME=`bas 阅读全文

posted @ 2016-09-28 12:22 ZhYQ_note 阅读(580) 评论(0) 推荐(0) 编辑

2016年9月27日

cocos: 链接错误: _lz_adler32 in liblibquickmac.a

摘要: 错误: Undefined symbols for architecture x86_64: "_adler32", referenced from: _lz_adler32 in liblibquickmac.a(lua_zlib.o) _png_icc_set_sRGB in libcocos2 阅读全文

posted @ 2016-09-27 18:57 ZhYQ_note 阅读(749) 评论(0) 推荐(0) 编辑

编译错误: file not found with angled include use quotes instead #include <lualib.h> 和 #include "lualib.h"

摘要: http://stackoverflow.com/questions/17465902/use-of-external-c-headers-in-objective-c 问题: 7down votefavorite 6 6 In my iOS project I need to use an ext 阅读全文

posted @ 2016-09-27 15:01 ZhYQ_note 阅读(9685) 评论(0) 推荐(1) 编辑

xcode7: Undefined symbols for architecture i386: "_iconv_open", referenced from:

摘要: 在整合cocos和quick时,出现这个错误,我按照以前的方法 link binary with libraries 中add libiconv.2.dylib ,发现已经没有了这个库。 网上找了一下,找到一个: 问题: I use libxml to save game data. in orde 阅读全文

posted @ 2016-09-27 10:30 ZhYQ_note 阅读(1252) 评论(0) 推荐(0) 编辑

2016年9月26日

js 创建xml元素

摘要: function createXML(pathData) { var xmlDOM = createXMLDOM(); //参考:http://iceworldvip.blog.51cto.com/5438460/1341677 if (xmlDOM) { var data = xmlDOM.cre 阅读全文

posted @ 2016-09-26 13:33 ZhYQ_note 阅读(3165) 评论(0) 推荐(0) 编辑

2016年9月23日

html: button样式 css生成器

摘要: 网址:http://www.bestcssbuttongenerator.com/#/28 阅读全文

posted @ 2016-09-23 19:38 ZhYQ_note 阅读(709) 评论(0) 推荐(0) 编辑

TypeError: BlobBuilder is not a constructor

摘要: 今天在chrome浏览器中这样使用时,出线错误TypeError: BlobBuilder is not a constructor。 解决: 原文地址:http://stackoverflow.com/questions/15293694/blob-constructor-browser-comp 阅读全文

posted @ 2016-09-23 19:27 ZhYQ_note 阅读(2371) 评论(0) 推荐(0) 编辑

web: 屏蔽button元素的空格键和enter响应

摘要: 用tab键可以在各种元素之间切换焦点,然后键盘上的空格和enter按键触发click事件,我这里不想要这种效果。 所以我需要屏蔽这两个按键。 阅读全文

posted @ 2016-09-23 19:01 ZhYQ_note 阅读(369) 评论(0) 推荐(0) 编辑

2016年9月22日

html 选择本地图片,显示选择的图片

摘要: 主要用的是html5的文件系统部分: 参考: https://developer.mozilla.org/zh-CN/docs/Using_files_from_web_applications http://hushicai.com/2014/03/29/html5-du-qu-ben-di-we 阅读全文

posted @ 2016-09-22 19:24 ZhYQ_note 阅读(2651) 评论(0) 推荐(0) 编辑

2016年9月13日

cocos Uniforms值的赋值

摘要: cocos Uniforms值的赋值 举个void Renderer::drawBatchedTriangles()的渲染: //Start drawing verties in batch for(const auto& cmd : _batchedCommands) { auto newMaterialID = cmd->getMaterialID(); if(_lastMaterialID... 阅读全文

posted @ 2016-09-13 20:08 ZhYQ_note 阅读(651) 评论(0) 推荐(0) 编辑

导航