积累日常生活的点滴,开发过程的心得。

翻译C的返回构造体函数为Delphi的注意事项

很久以前就遇到过返回结构体AVRational的C函数翻译为Delphi之后算出的结果不对。

http://rvelthuis.de/articles/articles-convert.html

原来这是Delphi的编译器的一个问题,我们需要将AVRational返回值映射为Int64就可以了。

TBB和OpenMP的比较

客户要求将一个openmp的代码改成TBB,比较了一下,发现TBB的写法比较复杂,但是效率很高,性能要比OpenMP的好

如何避免关键字冲突,当翻译Objective-C的接口到Delphi的时候

加上&符号在关键字前面可以避免冲突
procedure postNotificationName(notificationName: Pointer; &object: Pointer); cdecl;

系统备份脚本

sudo rsync -azvv /srv/www/ /home/hubdog/backup
tar -zcvf backup_20130601.tar.gz backup

备份数据库
mysqldump -u root -phubdog2425 --all-databases > /home/hubdog/mysql.sql

ios style

C:\Program Files (x86)\Embarcadero\RAD Studio\11.0\bin\ios 目录下

XE4 IDE中无法编辑plist创建Array类型的数据

XE4里面没法编辑plist文件,添加array类型的数据,解决办法是

1.build app
2.直接编辑info.plist
3.run app

UIBackgroundModes

audio

因为info.plist修改后,不会触发ide重新编译,只会因为重新打包签名。

将静态库转换为动态库dylib

比如我要将libGoogleAdmobAds.a转换为相应的dylib
首先要将fat格式的静态库转换为i386的瘦库(Thin library)
http://stackoverflow.com/questions/5352113/how-do-i-turn-a-fat-library-i...

lipo libx.a -thin armv6 -output libx-armv6.a
lipo libx.a -thin armv7 -output libx-armv7.a

然后,执行下面的命令
mkdir obj
cd obj
ar x ../libGoogleAdmobAds-i386.a
cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc"

同步内容