AS3 Smooth Loaded Bitmaps

Oct, 29 -- Categories: Actionscript

//create a new loader object and put it on the stage
var slideLoader:Loader=new Loader();
this.addChild(slideLoader);

//load picture into loader object
slideLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, scaleContentForPicture);
slideLoader.load(new URLRequest(“images/tree.jpg”));

//smooth it once loaded
function scaleContentForPicture() {
var smoother_bm=Bitmap(slideLoader.content);
smoother_bm.smoothing=true;
}

PHP alpha numeric only strings

Oct, 17 -- Categories: PHP

$str = “@ % * alpha numeric 0 – 9 only _ – +@_#()()++”;
$str = preg_replace(‘/[^A-Za-z0-9]/’, ”, $str);

echo $str;
returns alphanumeric09only

PHP Short tags

Oct, 10 -- Categories: Apache, Linux, PHP

enable by setting the flag in .htaccess

php_flag short_open_tag on

Open php.ini ( /etc/php.ini or /usr/local/etc/php.ini), enter:
# vi php.ini

Set short_open_tag to On:
short_open_tag = On

Save and close the file. Restart webserver:
# service httpd restart
or
# /etc/init.d/httpd graceful