I've been learning iPhone developing recently.
Finally I created a iPhone App and submitted it to to App store(still waiting to review).
And I decide make this iPhone App project Opensource:
http://code.google.com/p/kana50/
iOS Developer
Sunday, October 17, 2010
How to fix PROCEDURE can't return a result set in the given context
CLIENT_MULTI_RESULTS enables the client program to process multiple results. This option must be enabled if you execute CALL statements for stored procedures that produce result sets. Otherwise, such procedures result in an error Error 1312 (0A000): PROCEDURE proc_name can't return a result set in the given context.
http://dev.mysql.com/doc/refman/5.0/en/c-api-multiple-queries.html
http://dev.mysql.com/doc/refman/5.0/en/c-api-multiple-queries.html
Tags:
mysql
Sunday, July 11, 2010
eMule one-click AddOn, a new project is created
It's a firefox add-on that I made recently, just because I'm tried to copy/paste a ed2k link from a window to another windows if you have used eMule web interface to remotely control your eMule client.
Project home:
http://code.google.com/p/emule-oneclick-add-on/
Mozilla Add-On install:
https://addons.mozilla.org/en-US/firefox/addon/195536/
Project home:
http://code.google.com/p/emule-oneclick-add-on/
Mozilla Add-On install:
https://addons.mozilla.org/en-US/firefox/addon/195536/
Tags:
add-on,
ed2k,
emule,
firefox,
javascript,
mozilla,
web interface
Sunday, May 23, 2010
Reading note of 'Real world flash game development'
Chapter 3:
A Quick Review of the Planning Steps
● One- to two-sentence description
● Game screen wireframe and fl ow
● List of game mechanics
● List of assets (art, animation, sound, video, and copy)
● Technical requirements
● UML class diagrams
Chapter 4:
传入任意数量参数到函数/方法
Getter/Setter
to be Continued.
A Quick Review of the Planning Steps
● One- to two-sentence description
● Game screen wireframe and fl ow
● List of game mechanics
● List of assets (art, animation, sound, video, and copy)
● Technical requirements
● UML class diagrams
Chapter 4:
传入任意数量参数到函数/方法
function myFunction (… params):void {
for (var i:int = 0; I < params.length; i + + ) {
if (!(params[i] is DisplayObject)) {
throw new ArgumentError( “ Only DisplayObjects can be used in myFunction. ” );
}
}
}
Getter/Setter
package {
public class MyClass {
protected var _maxNameLength:int = 8;
protected var _name:String;
protected var _lives:int = 3;
public function get name():String {
return _name;
}
public function set name(value:String):void {
name = value.substr(0,maxNameLength);
}
public function get lives():int {
return _lives;
}
}
}
//OUTSIDE CLASS
var myInstance:MyClass = new MyClass();
myInstance .name = “ CHRISTOPHER ” ;
trace (myInstance.name); //OUTPUTS “ CHRISTOP ” ;
trace (myInstance.lives); //OUTPUTS 3;
myInstance .lives = 10; //THROWS ERROR
to be Continued.
Tuesday, April 6, 2010
Using Beyond compare3 as Git diff tool under Cygwin
在Cygwin下使用Beyond compare3(BC3)作用Git的diff工具
分两步走~
step 1.
create new .sh file as Git's diff warpper.
** please notice here, you need specially make a full path of $2, since BC3 will not find your tmp file under Cygwin path. **
** 注意这里的两个路径,第二个是本地文件,因为是相对路径,BC3可以找到,但第一个是绝对路径指向/tmp/xxx,所以我们要特别指定在windows下的真实路径,而不是cygwin的路径,所以我加上了d:/programs/cygwin。
step 2.
Add this line to .bashrc and run it to configure your Git gloabl variable.
Now you can try git diff whatever your file.
分两步走~
step 1.
create new .sh file as Git's diff warpper.
#!/bin/sh
/cygdrive/c/Program\ Files\ \(x86\)/Beyond\ Compare\ 3/BCompare.exe "d:/programs/cygwin$2" "$5"
** please notice here, you need specially make a full path of $2, since BC3 will not find your tmp file under Cygwin path. **
** 注意这里的两个路径,第二个是本地文件,因为是相对路径,BC3可以找到,但第一个是绝对路径指向/tmp/xxx,所以我们要特别指定在windows下的真实路径,而不是cygwin的路径,所以我加上了d:/programs/cygwin。
step 2.
Add this line to .bashrc and run it to configure your Git gloabl variable.
git config --global diff.external /home/z33/git-diff-wrapper.sh
Now you can try git diff whatever your file.
Thursday, March 11, 2010
Wordpress hack tips - Add tags to static pages
I did a lot of wordpress plugin jobs recently. But sometimes clients are not satisfied with what plugins can do. for example there is a client of mine want add tags to any static pages, just like wordpress posts did.
Actually it's very easy to do this(as well as to create a plugin for this).
just paste following lines to page_attributes_meta_bos function in meta-boxes.php:
Actually it's very easy to do this(as well as to create a plugin for this).
just paste following lines to page_attributes_meta_bos function in meta-boxes.php:
<h5>Tags</h5>
<div>
<input type="text" name="tags_input" class="tags-input" id="tags-input" size="30" tabindex="3" value="<?php echo get_tags_to_edit( $post->ID ); ?>" />
</div>
Tuesday, March 2, 2010
The most easy way to install geoip php extension note
在网上找了一堆安装geo ip模块的方法,各种方法都很麻烦。现在本尊(无量牛逼最三三尊)来整理一个最简单的安装方法如下。
1.install GEOIP C Library
http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.4.6.tar.gz
./configure
make
sudo make install
2.Install GEOIP PHP Extension
sudo pecl install geoip
3.Following message from step2, for example:
Build process completed successfully
Installing '/usr/local/lib/php/20060613/geoip.so'
install ok: channel://pecl.php.net/geoip-1.0.7
configuration option "php_ini" is not set to php.ini location
You should add "extension=geoip.so" to php.ini
4.Install GeoIP database
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
gzip -d GeoIP.dat.gz
sudo cp GeoIP.dat /usr/local/share/GeoIP/
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
sudo cp GeoLiteCity.dat /usr/local/share/GeoIP/GeoLiteCity.dat
sudo mv /usr/local/share/GeoIP/GeoLiteCity.dat /usr/local/share/GeoIP/GeoIPCity.dat
5.test
<?php print_r(geoip_record_by_name('125.63.166.38'));
1.install GEOIP C Library
http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.4.6.tar.gz
./configure
make
sudo make install
2.Install GEOIP PHP Extension
sudo pecl install geoip
3.Following message from step2, for example:
Build process completed successfully
Installing '/usr/local/lib/php/20060613/geoip.so'
install ok: channel://pecl.php.net/geoip-1.0.7
configuration option "php_ini" is not set to php.ini location
You should add "extension=geoip.so" to php.ini
4.Install GeoIP database
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
gzip -d GeoIP.dat.gz
sudo cp GeoIP.dat /usr/local/share/GeoIP/
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
sudo cp GeoLiteCity.dat /usr/local/share/GeoIP/GeoLiteCity.dat
sudo mv /usr/local/share/GeoIP/GeoLiteCity.dat /usr/local/share/GeoIP/GeoIPCity.dat
5.test
<?php print_r(geoip_record_by_name('125.63.166.38'));
Sunday, February 7, 2010
这两天遇到的某些国内discuz论坛输出的RSS问题解决。
主要遇到了两个问题。
1.GBK编码问题
如果RSS输出是gbk编码,Zend_Feed可以处理(不过会有些警告)。而Simplepie则全部处理成乱码了。
解决这个问题只能是把gbk当成gb2312来处理。
2.半个汉字,或非gb2312内的字符在第一或最后一个的时候,CDATA标签无法识别(Zend_Feed和SimplePie都不行)。
解决办法就是在CDATA与字符之间加一个空格。
1.GBK编码问题
如果RSS输出是gbk编码,Zend_Feed可以处理(不过会有些警告)。而Simplepie则全部处理成乱码了。
解决这个问题只能是把gbk当成gb2312来处理。
$content = str_replace('encoding="gbk"', 'encoding="gb2312"', $content);2.半个汉字,或非gb2312内的字符在第一或最后一个的时候,CDATA标签无法识别(Zend_Feed和SimplePie都不行)。
解决办法就是在CDATA与字符之间加一个空格。
$content = preg_replace('/\]\]\>/', ' ]]>', $content);
$content = preg_replace('/\<\!\[CDATA\[/', '<