Dr.Android
HEXLee · 共 84 篇文章
树莓派3连接ps4无线手柄
retroPi镜像刷完后,首现需要下载编译一个ps4手柄驱动,然后在开始配置手柄。 /opt/retropi/configs/all/retropi.confg 可以培植使用遥感控制方向 参考地址: http://blog.petrockblock.com/forums/topic/tutorial-retropie-with-dualshock-4-and-bluetooth/ http://blog.petrockblock.com/forums/topic/dual-shock-4/#post-112640
Assertion failure: thing, at...gc/Marking.cpp:112
遇到个jsb的bug,全公司的人整整折腾了2天!! 描述: 下面代码,在GC后,程序崩溃,错误log输出如下: Assertion failure: thing, at /Users/james/Project/Spidermonkey/js/src/gc/Marking.cpp:112 代码: var FightActionAttack = cc.Class.extend({ init: function (attacker) { var self = this; attacker.getAnimation().play("normalAttack"); attacker.getAnima…
2014-04-15 22:04 · 评论(0)
cocos2d-x luabinding/jsbinding 报错的解决方案
Errors in parsing headers: 1. <severity = Fatal, location = <SourceLocation file '/Users/guanghui/cocos2d-x/cocos/base/CCDataVisitor.h', line 29, column 10>, details = "'string' file not found"> 解决办法: 使用ndk r9b,因为r9c里已经没有gcc 4.7的头文件了
2014-02-18 09:57 · cocos2dx · 评论(0)
jackson 创建json文件的几种方式
1. 直接使用JsonGenerator File jsonFile = new File(System.getProperty("java.io.tmpdir"), "TestJson.json"); JsonGenerator jsonGenerator = jsonFactory.createGenerator( jsonFile, JsonEncoding.UTF8); jsonGenerator.writeStartObject(); jsonGenerator.writeNumberField("ANumberFiledKey", 123456); jsonGenerator.w…
2013-12-06 15:27 · 评论(0)
xsd中如何重复一个pattern
在XSD中,需要定义一个安装路径的数据类型,要求如下: 1. 使用斜线/分割路径,路径开头不能有斜线"/",路径中间不允许有空格,路径末尾可以有斜线, 形如: xxx/yy.yy/zz_zz/ 解决办法: 1. 因为路径可能很长,但是他有规律,即我们首相匹配最短的一段,抽象出正则表达式: [^/\s](a-zA-Z0-9_.]+[/]? 2. 使用xsd中的xsd:pattern来定义一个验证表达式,并且可以重复1中得正则式去做验证。 匹配最短路径的正则式我们已经写出来了,那么如何在xsd中重复使用这个式子去循环匹配后面的路径呢? 通过查找网上资料发现,在xsd中可以这么写,通过小括号把正则…
2013-12-03 11:37 · xsd 正则表达式 · 评论(0)
Inno Setup procedure 的写法举例
procedure InheritBoundsRect(ASource, ATarget: TControl); begin { This is comment line } ATarget.Left := ASource.Left; ATarget.Top := ASource.Top; ATarget.Width := ASource.Width; ATarget.Height := ASource.Height; end; 作用: 把Asource的一些属性赋给ATarget
2013-11-27 10:24 · 评论(0)
使用DS-5进行android cocos2d-x c++代码可视化调试
需要下载arm的DS-5IDE,配置过程见附件
2013-08-06 15:50 · 开发工具 android · 评论(0)
Ack 中的filtertype
The ack manual says: −−ignore−file=FILTERTYPE:FILTERARGS Ignore files matching FILTERTYPE:FILTERARGS. The filters are specified identically to file type filters as seen in "Defining your own types". Defining your own types ack allows you to define your own types in addition to the predefined types.…
2013-07-16 15:26 · 评论(0)
android apk包签名和align
签名: 执行下面这句 jarsigner.exe -verbose -keystore myapp.keystore -signedjar app_signed.apk app_unsigned.apk android123.keystore 就可以生成签名的apk文件,这里输入文件app_unsigned.apk,最终生成app_signed.apk为Android签名后的APK执行文件。下面提示输入的密码和keytool输入的一样就行了, zipalign 签名之后,用zipalign(压缩对齐)优化你的APK文件。未签名的apk不能使用,也不能优化。签名之后的apk谷歌推荐使用zipa…
2013-05-17 10:35 · android · 评论(0)
解决ubuntu13.04登陆后键盘不能使用的问题
郁闷! 原来是Slow Keys被莫名的打开了,只要关闭它就好了: System Settings --> Universal Access -> Typing -> Slow Keys -> OFF 参考: https://answers.launchpad.net/ubuntu/+question/1924
2013-05-15 18:11 · 评论(0)
使用vim插件clang_complete做coco2d-x代码提示
在VIM插件中,clang_complete是一个基于clang的C/C++代码提示插件,通过clang分析头文件,可以实时做精准的代码提示。 根据clang_complete自带的插件说明文档,我们知道可以在工程根目录配置.clang_complete文件指定源代码头文件目录。 在cocos2dx中,以HelloCpp/为例,我们假设工程根目录为cocos2d-x/samples/Cpp/HelloCpp/Classes,那么我们在该目录下新建一个.clang_complete文件,并在文件中填写如下内容,假设你要进行android开发: -I.. \ -I../Classes \ -I.…
2013-05-12 16:33 · 评论(2)
linbpng 开启neon指令优化
libpng version: 1.6.1 Ref: http://mortoray.com/2012/08/21/android-ndk-cross-compile-setup-libpng-and-freetype/ ----------------------------------------------------------------------------------------- export PLATFORM_PREFIX=/tmp/opt/android-ext # armv5 export NDK_PLATFORM=android-5 # armv7 export N…
2013-04-10 18:35 · 开发工具 Shell · 评论(0)
grep 查找文件名含有中文汉字的文件
网站目录下包含大量html文件和子目录,其中有不少文件和目录的名称中含有中文汉字。 现希望能用shell脚本罗列出所有名称中含有中文的文件和目录,并统计一下总数。 兄弟姐妹们,这个应该怎么搞?真心求解答 find . -type f | grep -P -r "[\x80-\xFF]" | cat | wc -l
2013-03-02 09:53 · 开发工具 Shell · 评论(0)
gsed debug工具
可以打印出sed脚本在执行过程中的pattern区域和当前执行命令的信息 http://aurelio.net/projects/sedsed/ 1.txt: aa bb cc cc 截图:
2013-01-27 00:27 · 开发工具 Shell · 评论(0)
gsed 字符串转大小写转换
echo palsec | gsed 's/\(.*\)/\U\1/' http://nixcraft.com/shell-scripting/15862-sed-convert-text-lower-upper-case.html http://www.gnu.org/software/sed/manual/sed.html#Execution-Cycle
2013-01-27 00:24 · 评论(0)