PHP Coding Standard and 50+ Programming SkillsHo Kim
?
1. How and Why to write good code?
2. Coding standard based on ZendFramework and real world practise.
3. PHP programming skills from daily coding.
4. Some security tips
5. Some optimization tips
PHP Coding Standard and 50+ Programming SkillsHo Kim
?
1. How and Why to write good code?
2. Coding standard based on ZendFramework and real world practise.
3. PHP programming skills from daily coding.
4. Some security tips
5. Some optimization tips
9. Flash/ActionScript 3内存管理机制
? 内存释放--编码规则
flash.utils .Dictionary 类的使用
public function Dictionary(weakKeys:Boolean = false)
指示Dictionary 对象在对象键上使用 “弱”引用
var _MyObj:Object = new Object();
var _myDict:Dictionary = new Dictionary(true);
_myDict[_myObj] = new MovieClip();
_myObject = null // 移除_myObject
由于Dictionary 的对象键的弱引用性。故可以将一些复杂的对象
用作Dictionary 的对象键,来设置复杂对象的弱引用性。
10. Flash/ActionScript 3内存管理机制
? 内存释放--编码规则
package com.gskinner.utils {
import flash.utils.Dictionary;
public class WeakReference {
private var dictionary:Dictionary;
public function WeakReference(p_object:Object) {
dictionary = new Dictionary(true);
dictionary[p_object] = null;
}
public function get():Object {
for (var n:Object in dictionary) { return n; }
return null;
}
}
}
11. Flash/ActionScript 3内存管理机制
? 内存释放--编码规则
public class WeakReference extends Sprite{
private var _timer:Timer = new Timer(5000, 0);
private var _sound:Sound = new Sound();
private var _channel:SoundChannel;
private var _complete:Boolean = true;
public function WeakReference() {
_timer.addEventListener(Timer Event.TIMER, showMemory, false, 0, true);
_timer.start();
testSound();
}
private function showMemory(evt:TimerEvent = null):void{
var _date:Date = new Date();
trace("current time : " + _date.toLocaleString() + " " +
System.totalMemory / (1000 * 1000) + "MB");
_date = null;
if (true == _complete) testSound();
}