Jacky's Development notes

iOS Developer

Sunday, December 25, 2011

搬家了

新家地址:
http://www.jiezhang.me

Tuesday, May 3, 2011

Unity3d code clip : auto height lable and mouse touchable scrolling


var wasScrolling : boolean = false;
var scrollPosition : Vector2;
var longString = "This is a long-ish string This is an sized label. This is an sized label. This is an sized label. This is an sized label. This is an sized label. ";
function OnGUI () {

var rectForDescription : Rect = Rect(100,100,100,100);

GUILayout.BeginArea(rectForDescription);
scrollPosition = GUILayout.BeginScrollView (scrollPosition, GUILayout.Width (100), GUILayout.Height (100));
GUILayout.Label (longString);
GUILayout.EndScrollView ();
GUILayout.EndArea();

if( Event.current.type==EventType.MouseDown && rectForDescription.Contains(Event.current.mousePosition) ) {
wasScrolling = true;
print("down");
}

if( Event.current.type==EventType.MouseDrag && wasScrolling==true ) {
print(Event.current.delta.y);
scrollPosition.y+=Event.current.delta.y;
}

if( Event.current.type==EventType.MouseUp && wasScrolling == true) {
print("end scrolling");
wasScrolling = false;
}


}

Wednesday, March 9, 2011

a temporary solution for PEAR Install with PHP5.3

I met a Bug of PHP(still doesn't fixed yet) about halt_compiler function which caused installing PEAR fail.

php go-pear.phar


This command doesn't work in PHP5.3

To fix(for the time being) it, use this command:

php -ddetect_unicode=0 go-pear.phar

Sunday, October 17, 2010

Project "kana50" has created

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/

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

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/

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:
传入任意数量参数到函数/方法

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.