<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-20594933</id><updated>2012-01-12T06:55:49.256-05:00</updated><title type='text'>Henry Tseng: Blog</title><subtitle type='html'>Objective-C (iPhone/iTouch), Java (Android), Javascript (nodeJS), Flash/Flex AS3, C++, C# and programming architecture, but also IT and LINUX troubleshooting.  

On this blog, you'll find solutions to different problems, workarounds or hacks and my own thoughts and ideas on programming concepts.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>44</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-20594933.post-3851476707683550995</id><published>2011-11-17T17:14:00.004-05:00</published><updated>2011-12-26T02:20:22.580-05:00</updated><title type='text'>Safari Debug Menu: Changing User Agent, Debugging JavaScript</title><content type='html'>I usually don't use Safari, but here's a great item to note if you need to use it.  You can enable development tools through a preference setting.  Simply open up a terminal window and execute the following:&lt;br /&gt;&lt;pre&gt;defaults write com.apple.safari IncludeDebugMenu 1&lt;/pre&gt;This will enable a new menu in Safari containing controls to change the user agent, disable various functions like javascript or caching, and/or start javascript debugging.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-3851476707683550995?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/3851476707683550995/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=3851476707683550995&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/3851476707683550995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/3851476707683550995'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2011/11/safari-debug-menu-changing-user-agent.html' title='Safari Debug Menu: Changing User Agent, Debugging JavaScript'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-8487462182470226450</id><published>2011-10-04T11:24:00.004-04:00</published><updated>2011-10-27T17:49:18.815-04:00</updated><title type='text'>XAMPP Apache Could Not Bind to Port 80</title><content type='html'>Recently, I had an issue starting up Apache.  My Apache instance runs on a Windows 7 development box and also shares the box with IIS 7.  Immediately I thought that it was IIS and of course that's a valid assumptions but binding IIS to port 81 did not solve the issue.  &lt;br /&gt;&lt;br /&gt;I received the following error while trying to start Apache:&lt;br /&gt;&lt;pre&gt;D:\xampp&gt;apache_start.bat&lt;br /&gt;Diese Eingabeforderung nicht waehrend des Running beenden&lt;br /&gt;Bitte erst bei einem gewollten Shutdown schliessen&lt;br /&gt;Please close this command only for Shutdown&lt;br /&gt;Apache 2 is starting ...&lt;br /&gt;(OS 10013)An attempt was made to access a socket in a way forbidden by its access permissions.  : make_sock: could not bind to address [::]:80&lt;br /&gt;(OS 10013)An attempt was made to access a socket in a way forbidden by its access permissions.  : make_sock: could not bind to address 0.0.0.0:80&lt;br /&gt;no listening sockets available, shutting down&lt;br /&gt;Unable to open logs&lt;br /&gt;&lt;br /&gt;Apache konnte nicht gestartet werden&lt;br /&gt;Apache could not be started&lt;br /&gt;Press any key to continue . . .&lt;br /&gt;D:\xampp&gt;&lt;/pre&gt;&lt;br /&gt;Running a netstat I could see that something called SYSTEM was listening on port 80.  &lt;br /&gt;&lt;pre&gt;D:\canvas\xampp&gt;netstat -aon | findstr :80&lt;br /&gt;  TCP    0.0.0.0:80             0.0.0.0:0              LISTENING       4&lt;/pre&gt;&lt;br /&gt;It turns out that another service called SQL Server Reporting Services (SQLEXPRESS) was causing the conflict.  Stopping the service through Component Services &gt; Services allows you to start Apache on port 80.&lt;br /&gt;&lt;br /&gt;*EDIT&lt;br /&gt;On another machine at work a service called "Web Deployment Agent Service", part of Microsoft's WebMatrix, was also preventing Apache from binding to port 80.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-8487462182470226450?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/8487462182470226450/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=8487462182470226450&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/8487462182470226450'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/8487462182470226450'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2011/10/xampp-apache-could-not-bind-to-port-80.html' title='XAMPP Apache Could Not Bind to Port 80'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-1862419676408373103</id><published>2011-09-03T16:04:00.005-04:00</published><updated>2011-09-03T16:14:29.773-04:00</updated><title type='text'>Scaling Bitmaps In Flash ActionScript 3 (AS3)</title><content type='html'>&lt;div&gt;I was working on composing large Bitmaps and scaling them and noticed an optimization that might have included a bug.  The images I was scaling were pixel snapping and were not smoothed.  This resulted in a choppy tween.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the past avoiding choppy image animations required setting the quality to "best".  Now ActionScript allows granular control of images.  In my project they were embeded as external assets and pulled from a SWF file.  &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;        &lt;p class="p1"&gt;&lt;span class="s1"&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;[Embed(source="assets/about/gfx.jpg"&lt;span class="s1"&gt;)]&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;As of Flash Player version 10.3.183.5, when scaling Bitmaps in Flash smoothing and PixelSnapping are ignored when the scale is equal to 1.  In order to force smooth set the Bitmap to a scale not equal to 1.0.&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;pre&gt;var bitmap:Bitmap = new Bitmap(_bitmapData, 'never', true);&lt;br&gt;bitmap.scaleX = bitmap.scaleY = .99;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-1862419676408373103?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/1862419676408373103/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=1862419676408373103&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/1862419676408373103'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/1862419676408373103'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2011/09/scaling-bitmaps-in-flash-actionscript-3.html' title='Scaling Bitmaps In Flash ActionScript 3 (AS3)'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-1786555987255511940</id><published>2011-01-18T12:58:00.004-05:00</published><updated>2011-01-18T13:19:02.431-05:00</updated><title type='text'>CakePHP Bake mysql.connect Error Running XAMPP</title><content type='html'>I ran into the following error baking with CakePHP.  I was trying to create the cake schema for ACL tables.  &lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;:$ ./cake schema create DbAcl&lt;br /&gt;&lt;br /&gt;Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EST/-5.0/no DST' instead in /htdocs/cake/libs/cache.php on line 570&lt;br /&gt;&lt;br /&gt;Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EST/-5.0/no DST' instead in /htdocs/cake/libs/cache.php on line 570&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Welcome to CakePHP v1.3.6 Console&lt;br /&gt;---------------------------------------------------------------&lt;br /&gt;App : app&lt;br /&gt;Path: /htdocs/app&lt;br /&gt;---------------------------------------------------------------&lt;br /&gt;Cake Schema Shell&lt;br /&gt;---------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;Warning: mysql_connect(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in /htdocs/cake/libs/model/datasources/dbo/dbo_mysql.php on line 552&lt;br /&gt;&lt;br /&gt;Warning: mysql_connect(): No such file or directory in /htdocs/cake/libs/model/datasources/dbo/dbo_mysql.php on line 552&lt;br /&gt;&lt;br /&gt;Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in /htdocs/cake/libs/model/datasources/dbo/dbo_mysql.php on line 558&lt;br /&gt;&lt;br /&gt;Warning: mysql_get_server_info() expects parameter 1 to be resource, boolean given in /htdocs/cake/libs/model/datasources/dbo/dbo_mysql.php on line 566&lt;br /&gt;&lt;br /&gt;Warning: mysql_real_escape_string() expects parameter 2 to be resource, boolean given in /htdocs/cake/libs/model/datasources/dbo/dbo_mysql.php on line 671&lt;br /&gt;&lt;br /&gt;Warning: mysql_real_escape_string() expects parameter 2 to be resource, boolean given in /htdocs/cake/libs/model/datasources/dbo/dbo_mysql.php on line 671&lt;br /&gt;&lt;br /&gt;Warning: mysql_real_escape_string() expects parameter 2 to be resource, boolean given in /htdocs/cake/libs/model/datasources/dbo/dbo_mysql.php on line 671&lt;br /&gt;&lt;br /&gt;Warning: mysql_real_escape_string() expects parameter 2 to be resource, boolean given in /htdocs/cake/libs/model/datasources/dbo/dbo_mysql.php on line 671&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The issue that I didn't realize quick enough was that the CakePHP script wasn't using my XAMPP's PHP executable.  Another instance of PHP was being run since it was located in my $PATH.  &lt;br /&gt;&lt;br /&gt;This can be easily corrected by correcting your $PATH with a quick visit to vi.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-1786555987255511940?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/1786555987255511940/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=1786555987255511940&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/1786555987255511940'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/1786555987255511940'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2011/01/cakephp-bake-mysqlconnect-error-running.html' title='CakePHP Bake mysql.connect Error Running XAMPP'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-1261563220743983072</id><published>2010-11-16T17:58:00.003-05:00</published><updated>2010-11-16T18:03:49.369-05:00</updated><title type='text'>Taking screen captures of websites</title><content type='html'>Here's a great way to programmatically create screen captures of sites.  It uses a python script to access WebKit and generate a PNG.  It would be fairly easy to add some logic to make it crawl a site to show clients.  We had to use this to grab some shots of a site for a routing phase of a pharmaceutical project.  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.paulhammond.org/webkit2png/"&gt;http://www.paulhammond.org/webkit2png/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There is also another program called Paparazzi!  It provides a GUI and allows a little bit of interactivity for clicking through.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://derailer.org/paparazzi/"&gt;http://derailer.org/paparazzi/&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-1261563220743983072?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/1261563220743983072/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=1261563220743983072&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/1261563220743983072'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/1261563220743983072'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2010/11/taking-screen-captures-of-websites.html' title='Taking screen captures of websites'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-7117505058415117869</id><published>2010-09-25T11:30:00.002-04:00</published><updated>2010-09-25T11:34:20.957-04:00</updated><title type='text'>Reformatting XML with TextWrangler Script</title><content type='html'>Here's a great tip for reformatting XML.  I'm reposting this.  I use TextWrangler and use the UNIX Script.  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Use Unix Filters and create the following script to use, &lt;span class="Apple-style-span" &gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Reformat XML.sh&lt;/span&gt;&lt;/span&gt;:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" &gt;#!/bin/sh&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" &gt;xmllint --c14n "$*" | XMLLINT_INDENT=$'\t' xmllint --format -&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Thanks &lt;a href="http://magp.ie/"&gt;Magpie&lt;/a&gt;.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://magp.ie/2010/02/15/format-xml-with-textwrangler/"&gt;http://magp.ie/2010/02/15/format-xml-with-textwrangler/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-7117505058415117869?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/7117505058415117869/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=7117505058415117869&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/7117505058415117869'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/7117505058415117869'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2010/09/reformatting-xml-with-textwrangler.html' title='Reformatting XML with TextWrangler Script'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-4715297312254791265</id><published>2010-09-02T19:37:00.003-04:00</published><updated>2010-09-02T19:55:33.001-04:00</updated><title type='text'>Fixing Font Rendering Issues in Google Chrome for Mac OSX</title><content type='html'>&lt;div&gt;While I'm writing this the Google Chrome browser is still a beta.  But I still want to use it.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So the problem is that I open up Chrome and it runs into a font issue when I'm using fonts installed with my font management software (i.e. - Linotype FontExplorer X, FontAgent Pro, etc...).  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I see the following characters:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;img src="http://www.henrytseng.com/storage/blog/chrome_fonterror/missing_font_a.jpg" /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The problem is that Chrome for Mac OSX is looking for font files at the following location:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;/Library/Fonts/&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Where these font management software programs install fonts to a different location.  To remedy the problem simply change your font folder and Chrome should read the fonts fine.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;img src="http://www.henrytseng.com/storage/blog/chrome_fonterror/prefs.png" /&gt;&lt;div&gt;On FontExplorer X 1.2.3, you can simply open up Preferences and go to the Advanced tab.  Here you can change the location of font files.  Yeah I run it because it's free.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Font Book which is provided by Apple on Leopard and up, seems to install for use with Chrome with out any issues.  But then again, Font Book isn't exactly the best solution for font management when you have six thousand fonts.  &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-4715297312254791265?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/4715297312254791265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=4715297312254791265&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/4715297312254791265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/4715297312254791265'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2010/09/fixing-font-rendering-issues-in-google.html' title='Fixing Font Rendering Issues in Google Chrome for Mac OSX'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-3466457435478109507</id><published>2010-09-01T23:47:00.009-04:00</published><updated>2010-11-12T00:12:03.655-05:00</updated><title type='text'>How to Enable Flash Content Debugger Plugin on Google Chrome Browser for Mac OSX</title><content type='html'>This is applicable to Google Chrome 5.0.375.127 for Mac OSX.  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To enable the Flash Content Debugger Plugin on Google Chrome.  Simple disable the plugin distributed with Chrome.  Of course, you'll also need to install the content debugger version of the plugin as well.  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To disable the plugin distributed with Chrome open  your Preferences and select the tab entitled "Under the Hood":&lt;/div&gt;&lt;img border="0" src="http://www.henrytseng.com/storage/blog/chrome_flash/under_the_hood.png" /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Then open Content Settings:&lt;/div&gt;&lt;img border="0" src="http://www.henrytseng.com/storage/blog/chrome_flash/content_settings.png" /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now click on the link "Disable Individual Plugins":&lt;/div&gt;&lt;img border="0" src="http://www.henrytseng.com/storage/blog/chrome_flash/plugins.png" /&gt;&lt;div&gt;On the plugins page both the plugin distributed with Chrome and the plugin installed from Adobe are listed.  Simply disable the plugin located within the Chrome files at the location:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;/Applications/Google Chrome.app/Contents/Versions/5.0.375.127/Flash Player Plugin for Chrome.plugin&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;On PC the distributed plugin can be disabled by opening the +Details button in the upper right and then disabling the plugin individually.   &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-3466457435478109507?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/3466457435478109507/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=3466457435478109507&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/3466457435478109507'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/3466457435478109507'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2010/09/how-to-enable-flash-content-debugger.html' title='How to Enable Flash Content Debugger Plugin on Google Chrome Browser for Mac OSX'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-8554199390849599972</id><published>2010-04-30T17:22:00.004-04:00</published><updated>2010-04-30T17:30:31.739-04:00</updated><title type='text'>Samba write error in Mac OSX</title><content type='html'>I've been experiencing this write error for a long time.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;img border="0" src="http://www.henrytseng.com/storage/blog/samba-write-access-error/error.png" /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And for the longest time I had no clue where it was occurring until I did some research and found a solution.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here's the entry:&lt;/div&gt;&lt;div&gt;&lt;a href="http://splatdot.com/fixing-snow-leopard-10-6-3-samba-write-access"&gt;http://splatdot.com/fixing-snow-leopard-10-6-3-samba-write-access&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Basically, the solution is to turn off Unix extensions in Samba's &lt;code&gt;smb.conf&lt;/code&gt; configuration file.  Add the following to the &lt;code&gt;[global]&lt;/code&gt; section&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;unix extensions = off&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And restart your samba server.  &lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-8554199390849599972?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/8554199390849599972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=8554199390849599972&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/8554199390849599972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/8554199390849599972'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2010/04/samba-write-error-in-mac-osx.html' title='Samba write error in Mac OSX'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-1959621521500969268</id><published>2010-01-15T16:41:00.003-05:00</published><updated>2010-01-15T16:52:51.784-05:00</updated><title type='text'>Popular Programming Languages for 2010</title><content type='html'>Here's TIOBE's Programming Community index gives an indication of how popular some programming languages are becoming.&lt;br /&gt;&lt;br /&gt;It is certainly surprising to see how fast some languages are rising up.   Not to mention that Apple's Objective-C (which runs on the iPhone) is certainly up and rising at #12 and Google's Go language is right behind it at #13.&lt;br /&gt;&lt;br /&gt;Also Adobe's Flash ActionScript is surprisingly rising the ranks now at #19. &lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.henrytseng.com/storage/blog/tiobe_programming_index.jpg" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-1959621521500969268?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/1959621521500969268/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=1959621521500969268&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/1959621521500969268'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/1959621521500969268'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2010/01/popular-programming-languages-for-2010.html' title='Popular Programming Languages for 2010'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-2003765278782924710</id><published>2009-12-19T11:01:00.008-05:00</published><updated>2009-12-23T17:54:23.433-05:00</updated><title type='text'>Harajuku Lovers Fragrance receives FWA</title><content type='html'>Harajuku Lovers Fragrance receives an FWA Site of the Day award.  Woot woot. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.hlfragrance.com"&gt;http://www.hlfragrance.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src='http://www.henrytseng.com/storage/blog/hl_fwa/Picture-1.jpg'&gt;&lt;br&gt;&lt;br /&gt;&lt;img src='http://www.henrytseng.com/storage/blog/hl_fwa/Picture-2.jpg'&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-2003765278782924710?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/2003765278782924710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=2003765278782924710&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/2003765278782924710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/2003765278782924710'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2009/12/harajuku-lovers-fragrance-receives-fwa.html' title='Harajuku Lovers Fragrance receives FWA'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-1798877404246837707</id><published>2009-11-30T18:12:00.004-05:00</published><updated>2009-11-30T18:13:55.669-05:00</updated><title type='text'>Neat AR Experiments</title><content type='html'>Been working on Augmented Reality (AR) on a few projects and it seems that a number of other people are making great experiments.  Take a look at this from &lt;span style="font-style: italic;"&gt;zero point nine&lt;/span&gt;:&lt;br /&gt;&lt;a href="http://www.zeropointnine.com/blog/augmented-reality-texture-extraction-experiment/"&gt;&lt;br /&gt;http://www.zeropointnine.com/blog/augmented-reality-texture-extraction-experiment/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-1798877404246837707?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/1798877404246837707/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=1798877404246837707&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/1798877404246837707'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/1798877404246837707'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2009/11/neat-ar-experiments.html' title='Neat AR Experiments'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-2933402136252998586</id><published>2009-07-20T22:31:00.006-04:00</published><updated>2009-07-28T16:44:24.441-04:00</updated><title type='text'>Disc Collision - An Open Source AS3 Collision Detection System</title><content type='html'>I whipped up a distance based collision detection system, dubbed Disc Collision.  A very basic model for collision detection, but also very fast in comparison to the vector based hitTest() in the Flash API.  &lt;br /&gt;&lt;br /&gt;Collisions are detected by a request-only model.  The collision detection simply manages a collection of points and distances associated with each point.  So you could easily put this into your a game engine and run an update call to get colliding points.  &lt;br /&gt;&lt;br /&gt;The algorithm is robust and has a few things to optimize.  The collection of points is subdivided into multiple lists according to a spatial grid.  To reduce the amount of work required detection.  Then all of our points are sorted through a BST by distance so that we always know the largest distance to use when selecting grid sections.  &lt;br /&gt;&lt;br /&gt;Hold the red button down below to create objects to test collisions.  &lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" id="Untitled-1" width="552" height="452"&gt;&lt;param name="allowScriptAccess" value="sameDomain"&gt;&lt;param name="allowFullScreen" value="false"&gt;&lt;param name="movie" value="http://henrytseng.com/storage/blog/disccollision_ex1/test_random_points.swf"&gt;&lt;param name="quality" value="high"&gt;&lt;br /&gt;&lt;param name="scale" value="noscale"&gt;&lt;param name="bgcolor" value="#ffffff"&gt;&lt;embed src="http://henrytseng.com/storage/blog/disccollision_ex1/test_random_points.swf" quality="high" bgcolor="#ffffff" scale="noscale" name="Untitled-1" allowscriptaccess="sameDomain" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="552" height="452"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You can get code here:&lt;br /&gt;&lt;a href="http://code.google.com/p/disccollision/"&gt;http://code.google.com/p/disccollision/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-2933402136252998586?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/2933402136252998586/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=2933402136252998586&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/2933402136252998586'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/2933402136252998586'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2009/07/disc-collision-open-source-as3.html' title='Disc Collision - An Open Source AS3 Collision Detection System'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-289312877165432549</id><published>2009-07-11T23:13:00.002-04:00</published><updated>2009-07-11T23:15:23.263-04:00</updated><title type='text'>Invert the colors on your Mac</title><content type='html'>Just found this out, to invert the colors on your Mac hold ctrl-option-command and press 8.  This is really useful if you're staring at white screens all day long your eyes will get tired really quickly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-289312877165432549?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/289312877165432549/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=289312877165432549&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/289312877165432549'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/289312877165432549'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2009/07/invert-colors-on-your-mac.html' title='Invert the colors on your Mac'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-7443352736154526004</id><published>2009-07-02T00:57:00.004-04:00</published><updated>2009-07-02T01:03:32.019-04:00</updated><title type='text'>Motor2 Physics</title><content type='html'>I bought a new Macbook Pro and got it up and running.  Funny how I've been using Mac's for a while now but never owned one myself.  A computer is a computer.  &lt;br /&gt;&lt;br /&gt;I've been playing around with the Motor2 physics engine.  I'm working on some games using it right now.  I'll post and follow up when they're ready.  &lt;br /&gt;&lt;br /&gt;For now check out this new Flash port of the Box2D engine by Eric Catto here:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lab.polygonal.de/motor_physics/"&gt;http://lab.polygonal.de/motor_physics/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I suggest reading the code and using the original Box2D documentation:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.box2d.org/manual.html"&gt;http://www.box2d.org/manual.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Enjoy.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-7443352736154526004?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/7443352736154526004/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=7443352736154526004&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/7443352736154526004'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/7443352736154526004'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2009/07/motor2-physics.html' title='Motor2 Physics'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-4418950474847615059</id><published>2009-06-09T17:08:00.011-04:00</published><updated>2009-06-09T17:36:42.831-04:00</updated><title type='text'>AS3 Visual effects through BitmapData.getPixel()</title><content type='html'>I know lots of other people have created similar effects too.  I just haven't done it myself.  Here's an interesting effect you can get from the BitmapData.getPixel().  &lt;br /&gt;&lt;br /&gt;I'm creating a grid of squares to represent an image captured from the web camera and changing the size of a squares based on the corresponding color value.  &lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" id="Untitled-1" width="420" height="320"&gt;&lt;param name="allowScriptAccess" value="sameDomain"&gt;&lt;param name="allowFullScreen" value="false"&gt;&lt;param name="movie" value="http://www.henrytseng.com/storage/camerasqfun/main.swf"&gt;&lt;param name="quality" value="high"&gt;&lt;br /&gt;&lt;param name="scale" value="noscale"&gt;&lt;param name="bgcolor" value="#ffffff"&gt;&lt;embed src="http://www.henrytseng.com/storage/camerasqfun/main.swf" quality="high" bgcolor="#ffffff" scale="noscale" name="Untitled-1" allowscriptaccess="sameDomain" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="420" height="320"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you don't have a web camera.  No web cam?  &lt;br /&gt;&lt;br /&gt;&lt;img src='http://www.henrytseng.com/storage/camerasqfun/camerasqfun.jpg' border=0 /&gt;&lt;br /&gt;&lt;br /&gt;Here's the &lt;a href='http://www.henrytseng.com/storage/camerasqfun/code.zip'&gt;code&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-4418950474847615059?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/4418950474847615059/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=4418950474847615059&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/4418950474847615059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/4418950474847615059'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2009/06/visual-effects-through.html' title='AS3 Visual effects through BitmapData.getPixel()'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-1112290801474523202</id><published>2009-04-23T10:10:00.007-04:00</published><updated>2009-04-23T10:27:09.067-04:00</updated><title type='text'>How to turn off modsecurity (apache module)</title><content type='html'>I'm running fc10, Fedora 10 Linux.  &lt;br /&gt;&lt;br /&gt;Newly installed server and I'm just interested in doing some development for a web application.  Modsecurity is used for implementing protocol level security, but it is not for everyone.  Using it requires internet security knowledge.  &lt;a href='http://devcentral.f5.com/weblogs/macvittie/archive/2008/07/23/3477.aspx'&gt;Four reasons not to use mod_security&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here's how to turn off modsecurity.  Locate in &lt;code&gt;/etc/httpd/modsecurity.d&lt;/code&gt; the line:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;SecRuleEngine On&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;And for "DetectionOnly" switch this to:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;SecRuleEngine DetectionOnly&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;And of course, restart apache once you are done:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;# service httpd restart&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;It is recommended to run modsecurity in detection only until you are comfortable with writing rule sets.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-1112290801474523202?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/1112290801474523202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=1112290801474523202&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/1112290801474523202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/1112290801474523202'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2009/04/how-to-turn-off-modsecurity-apache.html' title='How to turn off modsecurity (apache module)'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-1448232211647717294</id><published>2009-03-30T12:10:00.005-04:00</published><updated>2009-03-30T12:18:06.430-04:00</updated><title type='text'>Updating Samba on Fedora 8 (fc8)</title><content type='html'>I had some trouble finding this hopefully this will help other people find it easier.   We have a backup server running Fedora 8.  I brought the box back online with a raid 5 and got ready to install samba but ran into some errors.  &lt;br /&gt;&lt;br /&gt;In order to fix a error while installing samba:&lt;br /&gt;&lt;code&gt;# yum install samba-common samba samba-swat&lt;br /&gt;...&lt;br /&gt;Error: Missing Dependency: samba-common = 3.0.26a-6.fc8 is needed by package samba&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;I found an update for yum:&lt;br /&gt;&lt;code&gt;# yum install yum-fastestmirror yum-skip-broken&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Then we can install samba:&lt;br /&gt;&lt;code&gt;# yum update&lt;br /&gt;# yum install samba-common samba samba-swat&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Remember to open up the firewall:&lt;br /&gt;&lt;code&gt;# system-config-firewall-tui&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-1448232211647717294?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/1448232211647717294/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=1448232211647717294&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/1448232211647717294'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/1448232211647717294'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2009/03/updating-samba-on-fedora-8-fc8.html' title='Updating Samba on Fedora 8 (fc8)'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-7422875410250434751</id><published>2009-03-09T17:13:00.020-04:00</published><updated>2009-06-09T17:38:37.665-04:00</updated><title type='text'>AS3 Dynamic Text Wrapping or Flowing Around Objects</title><content type='html'>&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;EDIT:&lt;/span&gt; Take a look here if you are able to use Flash Player 10.  (http://labs.adobe.com/technologies/textlayout/)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The Flash community is still waiting for Adobe to implement dynamic or intelligent text wrapping into Flash.  So meanwhile several programmers are creating their own solutions and work arounds.  &lt;br /&gt;&lt;br /&gt;After thinking about the problem, I did a quick search and I found that &lt;a href="http://dispatchevent.org"&gt;dispatchEvent.org&lt;/a&gt; actually had released a solution very similar to my own inital approach.  So I took a look at their code and made some improves upon based off of their original dynamic text wrapping &lt;a href="http://dispatchevent.org/roger/dynamic-text-wrapping-in-actionscript-3/comment-page-1/"&gt;utility&lt;/a&gt;.  &lt;br /&gt;&lt;br /&gt;The improvements allow text to flow around multiple objects on the left and the right.  It still utilizes &lt;code&gt;BitmapData&lt;/code&gt; and transparent pixels around each slice, but simply manages a linked list of &lt;code&gt;TextFormats&lt;/code&gt; to control the &lt;code&gt;leftMargin&lt;/code&gt;.  In addition, it will also accept a &lt;code&gt;flash.geom.Rectangle&lt;/code&gt; as a bounding box to work in; the motivation for this function is to reduce the computational load.  &lt;br /&gt;&lt;br /&gt;Simply input a list of &lt;code&gt;DisplayObjects&lt;/code&gt; for the &lt;code&gt;$leftList&lt;/code&gt; and the &lt;code&gt;$rightList&lt;/code&gt;.  Here's the function prototype:&lt;br /&gt;&lt;code&gt;public static function bound($field:TextField, $leftList:Array, $rightList:Array, $wrapArea:Rectangle=null, $padding:Number=10):void;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;To utilize it you would make an example call:&lt;br /&gt;&lt;code&gt;TextWrap.bound(tf,[o3,o4],[o1,o2]);&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Where &lt;code&gt;tf&lt;/code&gt; is the TextField which wraps around objects on its left o3 and o4 and warps around objects on its right o1 and o2.  &lt;br /&gt;&lt;div&gt;&lt;object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" id="Untitled-1" align="middle" width="550" height="350"&gt;&lt;param name="allowScriptAccess" value="sameDomain"&gt;&lt;param name="allowFullScreen" value="false"&gt;&lt;param name="movie" value="http://www.henrytseng.com/storage/blog/textwrap/textwrap_test.swf"&gt;&lt;param name="quality" value="high"&gt;&lt;br /&gt;&lt;param name="scale" value="noscale"&gt;&lt;param name="align" value="left"&gt;&lt;param name="bgcolor" value="#ffffff"&gt;&lt;embed src="http://www.henrytseng.com/storage/blog/textwrap/textwrap_test.swf" quality="high" bgcolor="#ffffff" scale="noscale" name="Untitled-1" allowscriptaccess="sameDomain" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="550" height="350"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Here is the &lt;a href="http://www.henrytseng.com/storage/blog/textwrap/TextWrap.as"&gt;code&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Of course, it's not perfect, but it's a starting point.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-7422875410250434751?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/7422875410250434751/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=7422875410250434751&amp;isPopup=true' title='14 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/7422875410250434751'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/7422875410250434751'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2009/03/as3-intelligent-text-wrapping-or.html' title='AS3 Dynamic Text Wrapping or Flowing Around Objects'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-4719451835479370440</id><published>2009-02-25T23:54:00.001-05:00</published><updated>2009-02-25T23:55:31.994-05:00</updated><title type='text'>Removing Passwords Stored in Windows XP</title><content type='html'>Windows XP gives you the ability to store user names and passwords on your local computer so you do not have to enter in your credentials each time you access different sites or resources. Of course this provides some simplicity for users that have to remember more than one user name and password. However, in terms of security, any one who sits down at your computer while you are logged on can then access sites and resources using your cached credentials.&lt;br /&gt;&lt;br /&gt;You can view and remove the stored credentials on your computer using the following steps:&lt;br /&gt;&lt;br /&gt;1. Click Start and select Run.&lt;br /&gt;2. Type in rundll32.exe keymgr.dll, KRShowKeyMgr and Click OK.&lt;br /&gt;3. The Stored User Names and Passwords dialog box will appear.&lt;br /&gt;4. You can remove an entry by selecting it from the list and clicking the Remove button.&lt;br /&gt;5. Click Close.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-4719451835479370440?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/4719451835479370440/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=4719451835479370440&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/4719451835479370440'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/4719451835479370440'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2009/02/removing-passwords-stored-in-windows-xp.html' title='Removing Passwords Stored in Windows XP'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-7274600262663115899</id><published>2009-01-15T12:55:00.011-05:00</published><updated>2009-08-30T20:20:48.586-04:00</updated><title type='text'>Increasing Memory Availability In Eclipse</title><content type='html'>I often work with large projects in Eclipse so I'm frequently using all of the memory allocated to Eclipse.  On MacOS X the configuration file is located here:&lt;br /&gt;&lt;br /&gt;/Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse.ini&lt;br /&gt;&lt;br /&gt;By default the following memory is allocated:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;-Xms40m&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;-Xmx512m&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I've changed this to:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;-Xms256m&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;-Xmx512m&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;...&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-7274600262663115899?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/7274600262663115899/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=7274600262663115899&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/7274600262663115899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/7274600262663115899'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2009/01/increasing-memory-availability-in.html' title='Increasing Memory Availability In Eclipse'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-6292683600637599570</id><published>2008-12-18T11:46:00.004-05:00</published><updated>2009-01-22T18:05:25.871-05:00</updated><title type='text'>Beginner: AS3 XMLList as a Primitive and XML as a Complex Datatypes</title><content type='html'>Using Flex SDK 3.1.0 build 2710&lt;br /&gt;&lt;br /&gt;I'm not sure if this is true across the board after doing a little searching on the web.  It seems that people have had different experiences.  But as far as I'm concerned right now, XML is being handled as a complex datatype and XMLList is being handled as a primitive datatype.&lt;br /&gt;&lt;br /&gt;I'm looking to confirm this though.&lt;br /&gt;&lt;br /&gt;Flash has two types of datatypes: primitives and complex.  Primitives are datatypes such as Strings or Numbers where each type you associate them a new instance is created.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;var abc:String='three wise men';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;var copy:String=abc;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;abc='two plain dogs';&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;trace(abc);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;trace(copy);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This above example associates copies the variable abc into the variable copy so that changes in abc later will no be reflected in copy.&lt;br /&gt;&lt;br /&gt;Complex datatypes, such as Objects, retain references to an original instance stored in memory.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;var dog:Object = {chase:true, likes:'cars'};&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;var cat:Object = {chase:false, likes:'naps'};&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;dog=cat;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;cat.likes='mice';&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;trace(dog.likes);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;trace(cat.likes);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In the above example the variable dog will now reference the same object as the variable cat.  Therefore, changing the string 'likes' to mice will change both dog.likes and cat.likes.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.henrytseng.com/storage/blog/TestXMLList.as"&gt;XML and XMLList example&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-6292683600637599570?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/6292683600637599570/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=6292683600637599570&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/6292683600637599570'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/6292683600637599570'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2008/12/as3-xmllist-as-primitive-and-xml-as.html' title='Beginner: AS3 XMLList as a Primitive and XML as a Complex Datatypes'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-7720124930242362657</id><published>2008-10-06T13:42:00.002-04:00</published><updated>2008-10-07T11:09:32.781-04:00</updated><title type='text'>Conway's Game of Life</title><content type='html'>Here's a neat implementation of Conway's Game of Life using bitmap data filters to run the logic.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;blockquote&gt;"Another way to do the calculations is to use filters which perform all of the calculations that are needed for one step in the Game of Life in a few lines of Actionscript. Filters such as the blur and convolution filters determine the colour of a pixel based on its neighbour’s colours which is exactly the kind of behaviour we need to run the Game of Life calculations. All of the hard work is done behind the scenes, effectively at a lower level which makes the simulation faster.&lt;/blockquote&gt;&lt;/span&gt;&lt;a href="http://www.stdio.co.uk/blog/?cat=4&amp;amp;paged=2"&gt;http://www.stdio.co.uk/blog/?cat=4&amp;amp;paged=2&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This makes me want to write my own version of Conway's Game.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-7720124930242362657?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/7720124930242362657/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=7720124930242362657&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/7720124930242362657'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/7720124930242362657'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2008/10/conways-game-of-life.html' title='Conway&apos;s Game of Life'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-767782958265797906</id><published>2008-07-25T12:43:00.003-04:00</published><updated>2008-07-25T12:47:20.877-04:00</updated><title type='text'>Web Performance Optimizations</title><content type='html'>I appologize for not blogging more, but here's a very helpful posting of web optimization:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://stevesouders.com/hpws/rules.php"&gt;http://stevesouders.com/hpws/rules.php&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;A coworker showed this to me.  In this he talks about things such as making fewer HTTP requests, using content delivery networks and gzipping files.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-767782958265797906?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/767782958265797906/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=767782958265797906&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/767782958265797906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/767782958265797906'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2008/07/web-performance-optimizations.html' title='Web Performance Optimizations'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-4237034275156603034</id><published>2008-07-19T02:30:00.002-04:00</published><updated>2008-07-19T02:34:58.217-04:00</updated><title type='text'>Things You Must Do Before Unloading a SWF File</title><content type='html'>Wow this is really important.  It reads "Danger Will Robinson. Danger!"  The following I found from a friend who referenced Colin Moock in which deactivation of a swf requires the following tasks to be disabled. &lt;br /&gt;&lt;ul&gt;&lt;li&gt;Tell any loaded .swf child assets to disable themselves.&lt;/li&gt;&lt;li&gt;Stop any sounds from playing.&lt;/li&gt;&lt;li&gt;Stop the main timeline, if it is currently playing.&lt;/li&gt;&lt;li&gt;Stop any movie clips that are currently playing.&lt;/li&gt;&lt;li&gt;Close any connected network objects, such as instances of Loader, URLLoader, Socket, XMLSocket, LocalConnection, NetConnections, and NetStream.&lt;/li&gt;&lt;li&gt;Release all references to cameras and microphones.&lt;/li&gt;&lt;li&gt;Unregister all event listeners in the .swf (particularly Event.ENTER_FRAME, and mouse and keyboard listeners)&lt;/li&gt;&lt;li&gt;Stop any currently running intervals (via clearInterval()).&lt;/li&gt;&lt;li&gt;Stop any Timer objects (via the Timer class’s instance method stop()).&lt;/li&gt;&lt;/ul&gt;Not doing so apparently allows the swf to consume resources and not get destroyed.  Go here to read more:&lt;br /&gt;&lt;br /&gt;http://www.moock.org/blog/archives/000279.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-4237034275156603034?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/4237034275156603034/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=4237034275156603034&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/4237034275156603034'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/4237034275156603034'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2008/07/things-you-must-do-before-unloading-swf.html' title='Things You Must Do Before Unloading a SWF File'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-1424044696176881749</id><published>2008-06-23T17:00:00.001-04:00</published><updated>2008-06-23T15:45:15.998-04:00</updated><title type='text'>Beginner: Understanding OOP</title><content type='html'>Okay.  Let talk about programming in general.  First of all let's differentiate between two types: procedural and object-oriented.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What is &lt;/span&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;Procedural Programming&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;?&lt;/span&gt;&lt;br /&gt;Procedural programming is the type of programming is the common and most intuitive method of programming.  The code of a program created using this method is written linearly and is dependent on the order in which each statement of code is written.  This is not to say that object-oriented programming is not also procedural at some level, what we need to identify is that the problem is solved using procedural logic.  This sort of logic is similar to how people thing.&lt;br /&gt;&lt;br /&gt;For example, imagine a clerk at a donut shop:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;First, mix ingredients for dough.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Mold it into a ring.&lt;/li&gt;&lt;li&gt;Bake it golden brown.&lt;/li&gt;&lt;li&gt;Coat it with chocolate.&lt;/li&gt;&lt;li&gt;Sprinkle sugar.  &lt;/li&gt;&lt;/ol&gt;Each of these steps must be performed in this exact order and changing any of these steps may change the entire program.  If you had asked the clerk to make a bagel instead the clerk might be smart enough to see that most of the steps are the same and say substitute the donut dough for bagel dough and add onions and garlic as toppings.  But if you asked the clerk to make a pretzel instead so many steps would have to be rewritten that you might as well not use the same instructions at all.&lt;br /&gt;&lt;br /&gt;Modification of the program also requires a person to first understand all of the steps involved before making any changes to the procedure since often the state of different variables may change during the course of the procedure.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What is &lt;span style="font-style: italic;"&gt;Object-Oriented Programming&lt;/span&gt;?&lt;/span&gt;&lt;br /&gt;So then what now is object-oriented programming, or OOP?  OOP is a method of breaking down problems into individual blocks of logic.  The idea is that the sum of these blocks solves the problem in an elegant yet easy to understand manner.&lt;br /&gt;&lt;br /&gt;When we change the logic in the program, of course depending on what is changed, we are also able to be more flexible in our changes.  Since the code is divided up into blocks we can change certain blocks without affecting the rest of the code.  Also, understanding the big picture of what each of the blocks do allows us to keep track of fewer details in the code and keep the program in general more organized.&lt;br /&gt;&lt;br /&gt;Furthermore, the fact that we have separate blocks of logic allows us to create a &lt;span style="font-style: italic;"&gt;separation of logic&lt;/span&gt; that allows multiple people to work at the same time.  As long as each person understands what to expect from each other, they can easily write code that can communicate.  Smaller problems being solved at the same time means that, in most cases, we are able to solve the whole problem in shorter time, this may be debated of course by many since there is the overhead of assigning tasks and dividing the problem.&lt;br /&gt;&lt;br /&gt;Our same donut shop clerk program might be separated in to groups of tasks.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Dough Tasks:&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;First, mix ingredients for dough.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Mold it into a ring.&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-weight: bold;"&gt;Baking Tasks:&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Bake it golden brown.&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-weight: bold;"&gt;Topping and Seasonings Tasks:&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Coat it with chocolate.&lt;/li&gt;&lt;li&gt;Sprinkle sugar.  &lt;/li&gt;&lt;/ol&gt;&lt;span style="font-weight: bold;"&gt;Main Donut procedure:&lt;br /&gt;&lt;/span&gt;&lt;ol&gt;&lt;li&gt;Dough Tasks&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Baking Tasks&lt;/li&gt;&lt;li&gt;Topping and Seasonings Tasks&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;This way we could have two programmers, one to manage the dough tasks and another to manage the seasoning tasks.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solving Problems Using Design Patterns&lt;br /&gt;&lt;/span&gt;Object-oriented programming's main advantage is being able to solve problems through architecture.  This is a tremendous advantage because we can solve problems based on different "arrangements" of code.  Let's think about this more.&lt;br /&gt;&lt;br /&gt;On the contrary, in procedural programming remember a programmer must first understand all of the code before changes are made, rely heavily on conditional logic and reuse code by copy-and-paste. &lt;br /&gt;&lt;br /&gt;Most programming problems are common reoccurring issues.  The hassle is solving these same problems over and over again when they have very small differences.  OOP allows us to make common solutions.  These common solutions are called &lt;span style="font-style: italic;"&gt;design patterns&lt;/span&gt; and are generally architectural solutions.  The challenge of OOP does not become memorizing procedures and branches but now gracefully applying design patterns and integrating them into your logic.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-1424044696176881749?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/1424044696176881749/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=1424044696176881749&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/1424044696176881749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/1424044696176881749'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2007/11/beginner-understanding-oop.html' title='Beginner: Understanding OOP'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-8523357880627257664</id><published>2008-04-23T23:13:00.033-04:00</published><updated>2008-06-23T21:02:06.414-04:00</updated><title type='text'>Lunch-time Experiments</title><content type='html'>Here's some experiments I had during lunch.  I'm thinking about combining these two projects so to create a module that can retell live drawn stories as they fade away.  Just a concept right now.&lt;br /&gt;&lt;br /&gt;Fades your drawing (click to draw):&lt;br /&gt;&lt;object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" id="Untitled-1" align="middle" width="420" height="350"&gt;&lt;param name="allowScriptAccess" value="sameDomain"&gt;&lt;param name="allowFullScreen" value="false"&gt;&lt;param name="movie" value="http://www.henrytseng.com/storage/lunchtime/faded_sketch.swf"&gt;&lt;param name="quality" value="high"&gt;&lt;br /&gt;&lt;param name="scale" value="noscale"&gt;&lt;param name="align" value="left"&gt;&lt;param name="bgcolor" value="#ffffff"&gt;&lt;embed src="http://www.henrytseng.com/storage/lunchtime/faded_sketch.swf" quality="high" bgcolor="#ffffff" scale="noscale" name="Untitled-1" allowscriptaccess="sameDomain" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" align="left" width="420" height="350"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;Tracks mouse movements; record and playback:&lt;br /&gt;&lt;object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" id="arrows" align="middle" width="420" height="350"&gt;&lt;br /&gt;&lt;param name="allowScriptAccess" value="sameDomain"&gt;&lt;param name="allowFullScreen" value="false"&gt;&lt;param name="movie" value="http://www.henrytseng.com/storage/lunchtime/arrows.swf"&gt;&lt;param name="quality" value="high"&gt;&lt;param name="scale" value="noscale"&gt;&lt;param name="bgcolor" value="#ffffff"&gt; &lt;embed src="http://www.henrytseng.com/storage/lunchtime/arrows.swf" quality="high" scale="noscale" bgcolor="#ffffff" name="arrows" allowscriptaccess="sameDomain" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" align="middle" width="420" height="350"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-8523357880627257664?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/8523357880627257664/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=8523357880627257664&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/8523357880627257664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/8523357880627257664'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2008/04/lunch-time-experiments.html' title='Lunch-time Experiments'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-3855987581649312497</id><published>2008-04-15T11:55:00.002-04:00</published><updated>2008-04-15T12:21:54.670-04:00</updated><title type='text'>Adding Subclipse (SVN) to FlexBuilder 3</title><content type='html'>I'm running FlexBuilder 3 on my computer at work and to install it I needed the subversion plug-in and a few other plug-ins. &lt;br /&gt;&lt;br /&gt;You'll need to add the following :&lt;br /&gt;- Eclipse Java Development Tools&lt;br /&gt;    (from Europa Discovery Site)&lt;br /&gt;- Eclipse Plug-in Development Environment&lt;br /&gt;    (from  Europa Discovery Site)&lt;br /&gt;- Subclipse 1.2.x (Eclipse 3.2+)&lt;br /&gt;    (from http://subclipse.tigris.org/update_1.2.x)&lt;br /&gt;&lt;br /&gt;If it asks you about the Buckminister plug-in uncheck integrations in subclipse.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-3855987581649312497?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/3855987581649312497/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=3855987581649312497&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/3855987581649312497'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/3855987581649312497'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2008/04/adding-subclipse-svn-to-flexbuilder-3.html' title='Adding Subclipse (SVN) to FlexBuilder 3'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-5316793607503484090</id><published>2008-02-29T10:47:00.002-05:00</published><updated>2008-02-29T10:48:10.617-05:00</updated><title type='text'>Nerdy Comics</title><content type='html'>&lt;div style="text-align: left;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/__VN7kmCOoDc/R8gpKDUXRnI/AAAAAAAAAGs/F-WpQX6wFNY/s1600-h/compiler_complaint.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/__VN7kmCOoDc/R8gpKDUXRnI/AAAAAAAAAGs/F-WpQX6wFNY/s400/compiler_complaint.png" alt="" id="BLOGGER_PHOTO_ID_5172429424701163122" border="0" /&gt;&lt;/a&gt;http://xkcd.com/&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Hahahah.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-5316793607503484090?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/5316793607503484090/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=5316793607503484090&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/5316793607503484090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/5316793607503484090'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2008/02/nerdy-comics.html' title='Nerdy Comics'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/__VN7kmCOoDc/R8gpKDUXRnI/AAAAAAAAAGs/F-WpQX6wFNY/s72-c/compiler_complaint.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-6070322500598898741</id><published>2008-02-05T11:19:00.000-05:00</published><updated>2008-02-05T11:25:32.337-05:00</updated><title type='text'>No exclude.xml in Flash AS3</title><content type='html'>I've been working for R/GA for some time and things have been crazy.  The workload has been fairly heavy with little breathing room so I haven't been posting as much. &lt;br /&gt;&lt;br /&gt;Here's some thoughts, by others, on some issues I've run into myself.  I'm working on the Nikeplus project and one of the big issues with this project is the size of the project.  The project has a much longer life than most of the experiential sites I've been working on and requires maintenance as per our client's requests.  This of course creates an immediate issue: things have to be coded fast and slim, which of course means there is much less time to solve problems in elegant ways since old code needs to keep running. &lt;br /&gt;&lt;br /&gt;One of the issues you run into is requiring classes to be kept up-to-date.  In AS2 classes are overwritten when a parent SWF loads a child SWF.  This is because the classes are actually created in the _global space. &lt;br /&gt;&lt;br /&gt;Here's an AS3 solution that I've recently found that's pretty interesting using the bridge pattern:&lt;br /&gt;&lt;a href="http://www.jessewarden.com/2007/09/no-excludexml-in-flash-cs3-for-as3-solution-via-bridge-pattern.html"&gt;http://www.jessewarden.com/2007/09/no-excludexml-in-flash-cs3-for-as3-solution-via-bridge-pattern.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-6070322500598898741?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/6070322500598898741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=6070322500598898741&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/6070322500598898741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/6070322500598898741'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2008/02/no-excludexml-in-flash-as3.html' title='No exclude.xml in Flash AS3'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-6529848896613868123</id><published>2008-01-22T11:10:00.000-05:00</published><updated>2008-01-22T11:11:16.964-05:00</updated><title type='text'>50 Reasons Why AS3 Kicks AS2 Butt</title><content type='html'>Check this out:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.gskinner.com/talks/50reasonsAS3/"&gt;http://www.gskinner.com/talks/50reasonsAS3/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-6529848896613868123?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/6529848896613868123/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=6529848896613868123&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/6529848896613868123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/6529848896613868123'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2008/01/50-reasons-why-as3-kicks-as2-butt.html' title='50 Reasons Why AS3 Kicks AS2 Butt'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-5552004671550466246</id><published>2007-11-01T12:26:00.010-04:00</published><updated>2008-07-03T11:25:47.863-04:00</updated><title type='text'>Emulating 3D Bitmap Transformations (part 2)</title><content type='html'>(correction)&lt;br /&gt;Okay, so the first time I posted this I was definitely not thinking straight at all.  Here's a correction.&lt;br /&gt;&lt;br /&gt;So let's take a look at the math involved:&lt;br /&gt;&lt;br /&gt;In a scale, pixels &lt;span style="font-style: italic;"&gt;(x',y')&lt;/span&gt; are given by the following:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;x' = x * x_scale_factor&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;y' = y * y_scale_factor&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In a skew, pixels &lt;span style="font-style: italic;"&gt;(x",y") &lt;/span&gt;are given by the following:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;x" = y * x_skew_factor&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;y" = x * y_skew_factor&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you remember our image is partly scaled and partly skewed.  &lt;span style="font-style: italic;"&gt;&lt;/span&gt;Remember that the images are divided along the line &lt;span style="font-style: italic;"&gt;f(x)=x&lt;/span&gt; meaning along this line pixels of the skewed picture approach the scaled picture.&lt;br /&gt;&lt;br /&gt;So let's pull out that high school math and we'll find that means that:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;x * x_scale_factor = y&lt;/span&gt;&lt;span style="font-style: italic;"&gt; * x_skew_factor&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;y * y_scale_factor&lt;/span&gt; = &lt;span style="font-style: italic;"&gt;x * y_skew_factor&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;By substituting in the line &lt;span style="font-style: italic;"&gt;y=x&lt;/span&gt; this tells us along the line &lt;span style="font-style: italic;"&gt;y=x&lt;/span&gt; pixels converge when &lt;span style="font-style: italic;"&gt;x_scale_factor = &lt;/span&gt;&lt;span style="font-style: italic;"&gt;x_skew_factor &lt;/span&gt;&lt;span&gt;and &lt;/span&gt;&lt;span style="font-style: italic;"&gt;y_scale_factor&lt;/span&gt; = &lt;span style="font-style: italic;"&gt;y_skew_factor&lt;/span&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-5552004671550466246?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/5552004671550466246/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=5552004671550466246&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/5552004671550466246'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/5552004671550466246'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2007/11/emulating-3d-bitmap-transformations.html' title='Emulating 3D Bitmap Transformations (part 2)'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-5177812886794400158</id><published>2007-10-31T15:37:00.000-04:00</published><updated>2007-10-31T16:20:04.814-04:00</updated><title type='text'>Emulating 3D Bitmap Transformations</title><content type='html'>I've been looking into 3D through Flash and there's a lot of 3D projects going on in the community, but Flash is currently not natively 3D.  Though the new upcoming version of Flash seems very promising.&lt;br /&gt;Before I explain anything credit for this post goes to my friend Steve at &lt;a href="http://labs.bigspaceship.com/blog/"&gt;BSS&lt;/a&gt; who &lt;a href="http://labs.bigspaceship.com/blog/?p=12"&gt;originally&lt;/a&gt; showed me &lt;a href="http://labs.bigspaceship.com/blog/?p=12"&gt;this&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;So my goal was to figure out how &lt;a href="http://www.papervision3d.org/"&gt;Papervision&lt;/a&gt; initially worked.  My first assumption is that people were using the flash.geom.Matrix class to perform perspective transformations on BitmapData, but this is not the case.  The Matrix class in Flash is only able to create affine transformations.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;First let's take a look at affine transformations:&lt;/span&gt;&lt;br /&gt;Affine transformations are transformations where:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Collinearity between points, i.e., three points which lie on a line continue to be collinear after the transformation&lt;/li&gt;&lt;li&gt;Ratios of distances along a line, i.e., for distinct colinear points &lt;span class="texhtml"&gt;&lt;i&gt;p&lt;/i&gt;&lt;sub&gt;1&lt;/sub&gt;,&lt;i&gt;p&lt;/i&gt;&lt;sub&gt;2&lt;/sub&gt;,&lt;i&gt;p&lt;/i&gt;&lt;sub&gt;3&lt;/sub&gt;&lt;/span&gt;, &lt;span class="texhtml"&gt;| | &lt;i&gt;p&lt;/i&gt;&lt;sub&gt;2&lt;/sub&gt; − &lt;i&gt;p&lt;/i&gt;&lt;sub&gt;1&lt;/sub&gt; | | / | | &lt;i&gt;p&lt;/i&gt;&lt;sub&gt;3&lt;/sub&gt; − &lt;i&gt;p&lt;/i&gt;&lt;sub&gt;2&lt;/sub&gt; | |&lt;/span&gt; is preserved&lt;/li&gt;&lt;/ul&gt;This allows us to achieve only an &lt;a href="http://en.wikipedia.org/wiki/Isometric_projection"&gt;isometric projection&lt;/a&gt;.   What we are looking for is to be able to create depth using a &lt;a href="http://en.wikipedia.org/wiki/Perspective_projection"&gt;perspective projection&lt;/a&gt;.   With perspective we need to create a vanishing point which means lines which means parallel lines can converge.   So this is a dilemma.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What We Can Do&lt;/span&gt;&lt;br /&gt;What we can do is approximate 3D transformations by approximating a perspective transformation.   We'll approximate by slicing our 2D image into smaller pieces and performing transformations on those individual pieces.   As a side effect the image may be distorted, but we'll be able to control the distortion if we cut the image into smaller pieces.&lt;br /&gt;&lt;br /&gt;Let's experiment through visually.  Start with a grid image and slice it into two triangles:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.henrytseng.com/storage/envelope/sqquare.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://www.henrytseng.com/storage/envelope/sqquare.jpg" alt="" border="0" /&gt;&lt;/a&gt;Now let's take a look at two particular affine transformations.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.henrytseng.com/storage/envelope/scale.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://www.henrytseng.com/storage/envelope/scale.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.henrytseng.com/storage/envelope/skew.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://www.henrytseng.com/storage/envelope/skew.jpg" alt="" border="0" /&gt;&lt;/a&gt;Notice that the pixels near the line P1P4 do not move very much.  These are a characteristic natures of these two particular transformations, scale and skew.&lt;br /&gt;&lt;br /&gt;So if we take the top portion of the skewed image and the bottom portion of the scale image, it's possible to arrange the image so we're able to move only P4.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.henrytseng.com/storage/envelope/envelope.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://www.henrytseng.com/storage/envelope/envelope.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Therefore, since our pixels near our slice are able to match up, performing transformations on the individual pieces to allow our lines to converge and we are able to approximate perspective transformations with a certain degree of distortion.  For each of the other points we'll simply use the same affine transformations.  In my explanation I've only detailed one corner P4.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Controlling Distortion&lt;/span&gt;&lt;br /&gt;To reduce the amount of distortion we'll simply create more subdivisions, or tessellations, for some given picture.  As the pieces become smaller and smaller the distances between where pixels are and should be become closer and closer.&lt;br /&gt;&lt;br /&gt;Here is an example with draggable corners and smoothing:&lt;br /&gt;&lt;object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="summerMarquee" align="middle" height="261" width="750"&gt;&lt;param name="allowScriptAccess" value="sameDomain"&gt;&lt;param name="movie" value="http://www.henrytseng.com/storage/envelope/envelope.swf"&gt;&lt;param name="quality" value="best"&gt;&lt;param name="scale" value="noscale"&gt;&lt;param name="bgcolor" value="#efefef"&gt;&lt;param name="flashVars" value="mypic=http://www.henrytseng.com/storage/envelope/penguin-pic.jpg"&gt;&lt;embed src="http://www.henrytseng.com/storage/envelope/envelope.swf" quality="best" scale="noscale" bgcolor="#efefef" name="testEnvelope" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="mypic=http://www.henrytseng.com/storage/envelope/penguin-pic.jpg" align="middle" height="500" width="500"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;p&gt;&lt;span style="font-weight: bold;"&gt;Verification Mathematically:&lt;/span&gt;&lt;br /&gt;For those that are interested, we can prove this mathematically because of the way image data is manipulated mathematically by these affine transformations.   I'll talk about this next time for the real nerds.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.henrytseng.com/storage/blog/envelope.zip"&gt;Download the source&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-5177812886794400158?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/5177812886794400158/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=5177812886794400158&amp;isPopup=true' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/5177812886794400158'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/5177812886794400158'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2007/10/emulating-3d-bitmap-transformations.html' title='Emulating 3D Bitmap Transformations'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-8094858093313301566</id><published>2007-10-26T14:03:00.000-04:00</published><updated>2007-10-30T15:58:01.961-04:00</updated><title type='text'>Advanced OOP: Semaphore Follow Up</title><content type='html'>Here's an example of a test of AS3 Semaphore code.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.henrytseng.com/storage/blog/semaphore.zip"&gt;http://www.henrytseng.com/storage/blog/semaphore.zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You can download and use it according to the GNU General Public License as published by&lt;br /&gt;the Free Software Foundation.  Enjoy.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-8094858093313301566?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/8094858093313301566/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=8094858093313301566&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/8094858093313301566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/8094858093313301566'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2007/10/advanced-oop-mutex-follow-up.html' title='Advanced OOP: Semaphore Follow Up'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-6304582041199079672</id><published>2007-10-13T14:21:00.000-04:00</published><updated>2007-10-30T15:57:49.445-04:00</updated><title type='text'>Advanced OOP: Understanding Semaphores</title><content type='html'>One very useful programming algorithm that is very useful in Flash comes from concurrent programming, and is called &lt;a href="http://en.wikipedia.org/wiki/Mutual_exclusion"&gt;mutual exclusion&lt;/a&gt;.  If you've taken classes in operating systems these concepts may be familiar to you.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;About Mutual Exclusion&lt;/span&gt;&lt;br /&gt;Mutual Exclusion is all about common resources and making sure blocks of code that share these resources aren't halted when requests are made.  For example, if we have 2 programs and 2 resources, both of which are required for a specific operation, both programs must take turns using the resources.&lt;br /&gt;&lt;br /&gt;Say program 1 acquires resource 1 the same moment that program 2 acquires resource 2.  Since neither program can complete their operation without the other resource; we have what we call a &lt;a href="http://en.wikipedia.org/wiki/Deadlock"&gt;dead lock&lt;/a&gt;.  This stops the program from running or creates undesired effects.  Without a specific implementation to prevent this situation from occurring we have a &lt;a href="http://en.wikipedia.org/wiki/Race_condition"&gt;race condition&lt;/a&gt; where program 1 and 2 are competing to finish their blocks of code.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What is a Semaphore&lt;/span&gt;&lt;br /&gt;A &lt;a href="http://en.wikipedia.org/wiki/Semaphores"&gt;semaphore&lt;/a&gt; is a classic example of an algorithm used to solve this particular situation.&lt;br /&gt;&lt;br /&gt;Here's code for a semaphore:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class Semaphore extends EventHandler {&lt;br /&gt;// events&lt;br /&gt;public static var ADDED                : String = 'added';            // resource was added&lt;br /&gt;&lt;br /&gt;// used as events and states&lt;br /&gt;public static var LOCKED                : String = 'locked';        // anything locked&lt;br /&gt;public static var UNLOCKED            : String = 'unlocked';        // everything unlocked&lt;br /&gt;&lt;br /&gt;private var _lockHash                    : Object;&lt;br /&gt;private var _state                        : String;            // defaults to unlocked&lt;br /&gt;private var _numLocked                    : Number;&lt;br /&gt;private var _numTotal                    : Number;&lt;br /&gt;&lt;br /&gt;public function Semaphore($state:String) {&lt;br /&gt;  _state=($state) ? $state : UNLOCKED;&lt;br /&gt;  _lockHash={};&lt;br /&gt;  _numLocked=0;&lt;br /&gt;  _numTotal=0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public function lock($name:String):Void {&lt;br /&gt;  // change count&lt;br /&gt;  if(_lockHash[$name]==undefined) _numTotal++;&lt;br /&gt;  if(_lockHash[$name]!=LOCKED) _numLocked++;&lt;br /&gt;&lt;br /&gt;  // lock item&lt;br /&gt;  _lockHash[$name] = LOCKED;&lt;br /&gt;&lt;br /&gt;  // something locked&lt;br /&gt;  if(_state == UNLOCKED) {&lt;br /&gt;      _state=LOCKED;&lt;br /&gt;      dispatchEvent({&lt;br /&gt;          type:         LOCKED,&lt;br /&gt;          target:        this&lt;br /&gt;      });&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public function unlock($name:String):Void {&lt;br /&gt;  // change count&lt;br /&gt;  if(_lockHash[$name]==undefined) _numTotal++;&lt;br /&gt;  if(_lockHash[$name]==LOCKED) _numLocked--;&lt;br /&gt;&lt;br /&gt;  // unlock item&lt;br /&gt;  _lockHash[$name] = UNLOCKED;&lt;br /&gt;&lt;br /&gt;  // everything unlocked&lt;br /&gt;  if(_numLocked==0 &amp;amp;&amp;amp; _state==LOCKED) {&lt;br /&gt;      _state=UNLOCKED;&lt;br /&gt;      dispatchEvent({&lt;br /&gt;          type:        UNLOCKED,&lt;br /&gt;          target:        this&lt;br /&gt;      });&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public function get numLocked():Number { return _numLocked; }&lt;br /&gt;&lt;br /&gt;public function get numTotal():Number { return _numTotal; }&lt;br /&gt;&lt;br /&gt;public function get state():String { return _state; }&lt;br /&gt;&lt;br /&gt;public function remove():Void {&lt;br /&gt;  removeAllEventListeners();&lt;br /&gt;  _lockHash=null;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;                                                         &lt;br /&gt;In this class definition we store locks in a hash called &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;_lockHash&lt;/span&gt;&lt;/span&gt;.  We'll store things when a lock or an unlock is invoked.  We'll also store the number or locks and total locks.  This way we won't have to count all of the locks each time we change their values.&lt;br /&gt;&lt;br /&gt;By default the Semaphore starts in an &lt;span style="font-family:courier new;"&gt;UNLOCKED &lt;/span&gt;state.  If anyone requests a lock when the semaphore is in a &lt;span style="font-family:courier new;"&gt;UNLOCKED &lt;/span&gt;state we'll dispatch a &lt;span style="font-family:courier new;"&gt;LOCK &lt;/span&gt;event to tell everyone and we'll change the state to &lt;span style="font-family:courier new;"&gt;LOCKED&lt;/span&gt;.  When the last lock is released we'll dispatch an &lt;span style="font-family:courier new;"&gt;UNLOCK &lt;/span&gt;event and set the state of the semaphore to &lt;span style="font-family:courier new;"&gt;UNLOCKED&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;And there we have it.  I'll show some more examples when I get a chance.  There's some interesting applications that simplify a lot of programmatic situations.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-6304582041199079672?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/6304582041199079672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=6304582041199079672&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/6304582041199079672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/6304582041199079672'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2007/10/advanced-oop-understanding-semaphores.html' title='Advanced OOP: Understanding Semaphores'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-5393802542824736096</id><published>2007-10-09T12:45:00.000-04:00</published><updated>2007-10-18T16:16:43.198-04:00</updated><title type='text'>Beginner OOP: Observer and Event Delegation Patterns (Part 2)</title><content type='html'>Now remember last time we talked about the observer design pattern.  The observer pattern is very useful because it centralizes information and allows coordination of the interactions between objects.&lt;br /&gt;&lt;br /&gt;But there's more.  Let's see what's behind door number 2.&lt;br /&gt;&lt;br /&gt;The event delegation design pattern is a similar programming strategy.   The difference is that this pattern allows multiple &lt;span style="font-style: italic;"&gt;types of events&lt;/span&gt;.  For example, if we write a program which is able to draw  a piano keyboard, we might create a class to represent a single key on the keyboard.  This single key object might listen to a data model.  Now when our keyboard data model tells us that C# is pressed we're not interested in updating the visuals for every key on our keyboard we're only interested in one key.  With the event delegation pattern we're able to &lt;span style="font-style: italic;"&gt;dispatch&lt;/span&gt; a single specific event that will allow only the objects subscribed to this event to be triggered.&lt;br /&gt;&lt;br /&gt;Let's talk about terminology.  &lt;span style="font-style: italic;"&gt;Delegates&lt;/span&gt; are objects interested in events.  Delegates &lt;span style="font-style: italic;"&gt;listen&lt;/span&gt; to a specific &lt;span&gt;event&lt;/span&gt; fired from a &lt;span style="font-style: italic;"&gt;dispatcher&lt;/span&gt;.   Let's take a look at some simple code to create an event dispatcher.  Our event types are actually represented using strings.&lt;br /&gt;&lt;br /&gt;To draw an analogy between the observer pattern and the event delegation pattern: Dispatchers are like observables, delegates are like observers, and events are like updates.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class EventHandler {&lt;br /&gt;private var _hash:Object;&lt;br /&gt;&lt;br /&gt;public function EventHandler() {  }    &lt;br /&gt;&lt;br /&gt;private function _getListenerIndex($queue:Array, $obj:Object, $listener:String):Number {&lt;br /&gt;  for(var i:Number=$queue.length-1; i&gt;=0 &amp;amp;&amp;amp;$queue; i--) {&lt;br /&gt;  if($queue[i].l == $listener &amp;amp;&amp;amp; $queue[i].o == $obj) return i;&lt;br /&gt;}&lt;br /&gt;   return -1;    // didn't find anything&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public function addEventListener($type:String, $obj:Object, $listener:String, $useCapture:Boolean, $priority:Number, $useWeakReference:Boolean):Void {&lt;br /&gt;  if(_hash===undefined)              _hash={};          &lt;br /&gt;if(_hash[$type]===undefined) _hash[$type]=[];&lt;br /&gt;  var i:Number=_getListenerIndex(_hash[$type], $obj, $listener);  &lt;br /&gt;if(i==-1) {&lt;br /&gt;  _hash[$type].push({o:$obj, l:$listener});&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public function dispatchEvent($event:Object):Boolean {&lt;br /&gt;  if(!hasEventListener($event.type)) return false;  &lt;br /&gt;var queue:Array=_hash[$event.type];  &lt;br /&gt;for(var i:Number=queue.length-1; i&gt;=0 &amp;amp;&amp;queue; i--) {      &lt;br /&gt;  var obj:Object = queue[i].o;      &lt;br /&gt;  var fxn:String = queue[i].l;      &lt;br /&gt;  obj[fxn]($event);&lt;br /&gt;}  &lt;br /&gt;return true;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public function hasEventListener($type:String):Boolean {  &lt;br /&gt;if(_hash[$type]!=null &amp;amp;&amp;amp; _hash[$type].length&gt;0) return true;  &lt;br /&gt;return false;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public function removeEventListener($type:String, $obj:Object, $listener:String, $useCapture:Boolean):Void {&lt;br /&gt;if($type!=undefined &amp;amp;&amp;amp; $listener==undefined) {      &lt;br /&gt;  delete(_hash[$type]);             return;&lt;br /&gt;}  &lt;br /&gt;var i:Number = _getListenerIndex(_hash[$type], $obj, $listener)         if(i!=-1)&lt;br /&gt;_hash[$type].splice(i,1);&lt;br /&gt;}    &lt;br /&gt;&lt;br /&gt;public function removeAllEventListeners():Void { &lt;br /&gt;delete(_hash);     }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In the above code, we have an object, our hash, which acts as an index for our different event types.  Each event type then has a list of delegates.  These delegates have methods which will run in their respective scopes.&lt;br /&gt;&lt;br /&gt;The &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;addEventListener&lt;/span&gt;&lt;/span&gt; function will first locates the event list, then if the delegate is not already on the list, it pushes the delegate to the list.  When the event occurs our &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;dispatchEvent&lt;/span&gt;&lt;/span&gt; function locate the event list and call each delegate on the list notifying them that the event has occurred.  We also include a &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;removeEventListener &lt;/span&gt;&lt;/span&gt;function to remove delegates from events.&lt;br /&gt;&lt;br /&gt;And there we have it.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;After Thought&lt;/span&gt;&lt;br /&gt;Now, you might ask why would anyone want to write a whole new event delegation class.  Aren't there classes written in Flash which accomplish this?  Partly, Flash MX and other provided classes do not run code in their intended functional scopes.  This creates a large problem since event delegation is typically deployed inter-object.  Classes written to satisfy this need are mostly external classes outside of Flash.  Grant Skinner has written a great event class called &lt;a href="http://www.gskinner.com/blog/archives/000027.html"&gt;GDispatcher&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;ActionScript 3.0 now uses a similar event model which allows functions to run in their proper scope.   In addition, most classes in AS3 now inherit from the EventDispatcher class.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-5393802542824736096?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/5393802542824736096/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=5393802542824736096&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/5393802542824736096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/5393802542824736096'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2007/10/beginner-oop-observer-and-event.html' title='Beginner OOP: Observer and Event Delegation Patterns (Part 2)'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-7467336326666463302</id><published>2007-10-08T11:43:00.001-04:00</published><updated>2007-10-18T16:18:07.159-04:00</updated><title type='text'>Beginner OOP: Observer and Event Delegation Patterns (Part 1)</title><content type='html'>I'm going to try to post more frequently.  Apologies, my posting has been scarce by any means.&lt;br /&gt;&lt;br /&gt;This post is for beginner programmers who want to get into object-oriented programming.  Let's talk about design patterns.  As you may know object oriented programming is all about objects, creating definitions of them and planning interactions between them.&lt;br /&gt;&lt;br /&gt;Now design patterns are about common situations encountered in programming.  Implementing them and using them is a common practice for programmers and is the day to day challenge of the object-oriented programmer.  Of course, there's always millions of ways to hack around problems and get around things, but hacking code, producing spaghetti code, always creates problems when further changes are later required.  Structuring good code while it can take more time initially to plan and carefully understand always shortens the amount of time required to later make changes.  Good implementation of design patterns always directly solve problems.&lt;br /&gt;&lt;br /&gt;It is possible to use design patterns wrong and to over-program.  Remember while programming you should account for changes you will later make, but you don't have to program rules for every situation, only the ones you will encounter.  It would be useless to write algorithms for situations that will never occur, all situations should obviously be understood and predetermined as use cases in advance.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The Observer Pattern&lt;/span&gt;&lt;br /&gt;So let's talk about a common design pattern that people use frequently, the observer pattern.&lt;br /&gt;Like I said earlier the observer pattern is all about interaction between your code.  In the observer design pattern you have several objects which require action when a particular piece of data changes value.&lt;br /&gt;&lt;br /&gt;That is you have an object that is &lt;span style="font-style: italic;"&gt;observable&lt;/span&gt; and an object that is your &lt;span style="font-style: italic;"&gt;observer&lt;/span&gt;.  The object that is the center of attention is the observable, this object has data which you are interested in.  When this data changes it sends an &lt;span style="font-style: italic;"&gt;update&lt;/span&gt; call to all of its observers, who then execute the required actions based on this value change in the interested data.&lt;br /&gt;&lt;br /&gt;Code for a simple Observable:&lt;br /&gt;&lt;pre&gt;class Observable {&lt;br /&gt;private var _list      :Array;&lt;br /&gt; private var _data      :String;&lt;br /&gt;&lt;br /&gt; public function Observable() {&lt;br /&gt;    _list=[];&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;     public function register($o:Observer):Void {&lt;br /&gt;            _list.push($o);&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     public function set data($s:String):Void {&lt;br /&gt;            _data = $s;&lt;br /&gt;           _update();&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     public _update():Void {&lt;br /&gt;            var n:int=_list.length;&lt;br /&gt;           for(var i:int=0; i&lt;br /&gt;     }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Code for a simple Observer:&lt;br /&gt;&lt;pre&gt;public class Observer {&lt;br /&gt;     public function Observer() { }&lt;br /&gt;&lt;br /&gt;     public function update($data:Object):Void {&lt;br /&gt;            /* do something exciting! */&lt;br /&gt;     }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now to set these classes up and use them:&lt;br /&gt;&lt;pre&gt;// let's instantiate them&lt;br /&gt;var parent:Observable = new Observable();&lt;br /&gt;var child1:Observer = new Observable();&lt;br /&gt;var child2:Observer = new Observable();&lt;br /&gt;&lt;br /&gt;// let's set it up&lt;br /&gt;parent.register(child1);&lt;br /&gt;parent.register(child2);&lt;br /&gt;&lt;br /&gt;// now let's get the parent to&lt;br /&gt;parent.data = "new data woohoo!";&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Once the parent changes its data all of its children should then change their data.&lt;br /&gt;&lt;br /&gt;This is very useful if you want to create a class to manage your in a class dedicated to being your data model, such as when you use the Model-View-Controller design pattern.&lt;br /&gt;&lt;br /&gt;Next time let's talk about the event delegation design pattern.&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-7467336326666463302?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/7467336326666463302/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=7467336326666463302&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/7467336326666463302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/7467336326666463302'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2007/10/oop.html' title='Beginner OOP: Observer and Event Delegation Patterns (Part 1)'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-1158256496914019089</id><published>2007-09-20T11:35:00.001-04:00</published><updated>2007-09-20T11:42:10.155-04:00</updated><title type='text'>Thoughts on Flash vs. Silverlight</title><content type='html'>&lt;div class="storycontent"&gt;      &lt;p&gt;Here’s an interesting post:&lt;/p&gt; &lt;p&gt;&lt;a href="http://labs.blitzagency.com/?p=381"&gt;http://labs.blitzagency.com/?p=381&lt;/a&gt;&lt;/p&gt; &lt;p&gt;While the article is not all about Silverlight vs Flash it does raise an interesting point about Silverlight’s opensource tendency. It’s important to note that Blitz Agency works directly with Microsoft.&lt;/p&gt; &lt;p&gt;Personally, I feel that the interactive arena doesn’t need more opensource conventions but it needs stronger experiences. We need designs that speak to users and create better experience for users beyond the common web pages found all across the web. The commonality of the Web may some times be its downfall in that so many “experiences” are merely duplicates of each other; this obviously creates a big problem for brand identity.&lt;/p&gt; &lt;p&gt;My own opinion is that I would personally like to see the direction of the industry moving more towards the direction of Adobe AIR (platform independence, richer capability, self updating infrastructure, … of course this list isn’t mutually exclusive). AIR provides a very strong platform for interactive experiences. Creating an appropriate business model and finding out where the platform can be used is where the next steps are. The more immersive and platform independent an experience can be will ultimately allow us to create better tools and interaction with users. More visibility and more involvement can create richer impressions.&lt;/p&gt; &lt;p&gt;People are already watching movie trailers, catching current events, and even paying their bills with their cell phones. Why should we stop there? As someone working in the interactive industry I feel our greatest challenge is creating new breathtaking experiences.&lt;/p&gt;It would be a nice dream. &lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-1158256496914019089?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/1158256496914019089/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=1158256496914019089&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/1158256496914019089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/1158256496914019089'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2007/09/thoughts-on-flash-vs-silverlight.html' title='Thoughts on Flash vs. Silverlight'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-4428088151004726477</id><published>2007-04-01T02:37:00.000-04:00</published><updated>2007-04-01T02:49:00.440-04:00</updated><title type='text'>AS3 Kicks Hiney!</title><content type='html'>I'm working on this new project which will span a year.  So it's apparent we may need to upgrade to AS3 at some point and require code migration from AS2 to AS3.  Big Spaceship works closely with Adobe and we're running with Flash CS3, the next Flash Professional IDE.&lt;br /&gt;&lt;br /&gt;Looks like I've put off learning AS3 long enough.  AS3 blows AS2 out of the water.  The debugging is so much more stricter, the API is cleaner, the code is more powerful, and the possibilities are endless.  There's more on every front.&lt;br /&gt;&lt;br /&gt;Guess I should probably throw in the usual shameless plug, go sign up for a preorder of Flash CS3.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-4428088151004726477?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.adobe.com/products/flash/' title='AS3 Kicks Hiney!'/><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/4428088151004726477/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=4428088151004726477&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/4428088151004726477'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/4428088151004726477'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2007/04/as3-kicks-hiney.html' title='AS3 Kicks Hiney!'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-116301107615556204</id><published>2006-11-08T13:30:00.000-05:00</published><updated>2006-11-08T13:43:44.606-05:00</updated><title type='text'>The best quality Flash</title><content type='html'>Recently stumbled upon a good piece of FYI at &lt;a href="http://www.airtightinteractive.com/news/?p=37"&gt;atitightinteractive.com&lt;/a&gt;.  Quality, by default, is set to quality="high" in Flash.  Setting the quality to "best" is a good allows even higher quality to be used.  Especially for bitmapped images, this quality difference upgrade can get rid of aliasing, jagged edges, when your images are scaled or rotated.&lt;br /&gt;&lt;br /&gt;&amp;lt;object&gt;&lt;br /&gt;    ...&lt;br /&gt;   &amp;lt;param name="quality" value="best"&gt;&lt;br /&gt;   ...&lt;br /&gt;   &amp;lt;embed quality="best"&gt;&lt;br /&gt;&amp;lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-116301107615556204?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.airtightinteractive.com/news/?p=37' title='The best quality Flash'/><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/116301107615556204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=116301107615556204&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/116301107615556204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/116301107615556204'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2006/11/best-quality-flash.html' title='The best quality Flash'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-116224966069935329</id><published>2006-10-30T17:53:00.000-05:00</published><updated>2006-11-01T11:37:36.136-05:00</updated><title type='text'>Using MVC in Flash</title><content type='html'>MVC (Model-View-Controller) is a very useful programming design pattern in Flash development, but as experienced programmers know, its integration varies from implementation to implementation and programmer to programmer especially because the Flash community is such a diverse one of designers who program and developers who design.&lt;br /&gt;&lt;br /&gt;MVC is great in small applications but large application require a programmer to be flexible and practice some ingenuity.  Modified approaches such as including abstraction layers for application specific logic keep the MVC architecture cleaner and leaner.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Basic Concept&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Model &lt;/span&gt;- Creates a programming abstraction for an applications data.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;View&lt;/span&gt; - Inputs/Outputs an application's data.  The model-view interaction allows data to have centralized management.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Controller&lt;/span&gt; - Processes data received from inputs and translates data to allow integration with model.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-116224966069935329?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/116224966069935329/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=116224966069935329&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/116224966069935329'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/116224966069935329'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2006/10/using-mvc-in-flash.html' title='Using MVC in Flash'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-115253971841756707</id><published>2006-07-10T09:47:00.000-04:00</published><updated>2007-10-09T13:47:21.579-04:00</updated><title type='text'>Enter the scene ActionScript 3.</title><content type='html'>&lt;span style="font-style: italic;"&gt;Enter the scene ActionScript 3.&lt;/span&gt;&lt;br /&gt;ActionScript 3 seems to be the talk of the town these days in the Flash community. FlexBuilder 2 and the alpha version of Flash 9 Professional are out and great changes have been made to the ActionScript 3 language including runtime debugging and a host of changes to the ActionScript programming model and the Flash API.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Event Listeners.&lt;/span&gt;&lt;br /&gt;AS3 incorporates a stronger event handling model over the previous AS2. This new event model has been consistently integrated into all of the built in objects in Flash 9 and includes triggers for changing the default behavior for some previously internal events. One of the strongest improvements is the ability to run event listeners in the scope of an object other than the event dispatching object&lt;a href="http://www.gskinner.com/blog/archives/000027.html"&gt;&lt;/a&gt;.  Another strong improvement is the ability to create weakly referenced Listeners, allowing less error prone clean up and better garbage collection.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Regular Expressions.&lt;/span&gt;&lt;br /&gt;Of course another great improvement is the implementation of a regular expression engine.  Regular expressions allow text searching and will enable better validation.  Complex text applications will be much easier to write and more efficient.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;E4X.&lt;/span&gt;&lt;br /&gt;AS3's new method for handling XML, dubbed E4X is much cleaner  as opposed to the previously verbose in the previous approach for handling XML.  E4X's approach is consistent with ActionScript's method for accessing objects and properties.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;External API.&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;AS3 now provides a replacement for the fscommand, an external API in the form of a class called &lt;span style="font-style: italic;"&gt;ExternalInterface&lt;/span&gt;, with which to access the container hosting Flash something previously implemented using a host of solutions varying across browsers, platforms and environments.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Conclusion.&lt;/span&gt;&lt;br /&gt;Overall, I've only graced over the surface of the new Flash API but I am excited.  Good things to come, I can guarentee it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-115253971841756707?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/115253971841756707/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=115253971841756707&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/115253971841756707'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/115253971841756707'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2006/07/enter-scene-actionscript-3.html' title='Enter the scene ActionScript 3.'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-113658873643678369</id><published>2006-01-06T17:48:00.000-05:00</published><updated>2006-11-08T13:53:29.870-05:00</updated><title type='text'>Debian 3.1 Dell d800 Wireless</title><content type='html'>For the  Intel® PRO/Wireless 2200BG Driver for Linux (e.g. - ipw2200).  Add to your &lt;span style=";font-family:courier new;font-size:100%;"  &gt;/etc/apt/sources.list&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;deb http://ftp.us.debian.org/debian/ stable main non-free contrib&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Remember to run the update:&lt;br /&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;# apt-get update&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Add a couple of packages.  I upgraded my kernel to 2.6.8-2 through the Debian package.&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;# apt-get install kernel-headers-2.6.8-2-686&lt;br /&gt;# apt-get install kernel-image-2.6-686&lt;br /&gt;# apt-get install dhcp3-client&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;Set it to watch all interfaces using the keyword "auto".  Set it to watch hotplug devices "all".  Also in &lt;span style="font-family:courier new;"&gt;/etc/network/interfaces&lt;/span&gt; make sure only &lt;span style=";font-family:courier new;font-size:100%;"  &gt;lo&lt;/span&gt; is brought up.&lt;br /&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;# apt-get install ifplugd&lt;br /&gt;&lt;br /&gt;# apt-get install wireless-tools&lt;br /&gt;# apt-get install ipw2200-source&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Put your firmware in &lt;span style="font-family:courier new;"&gt;/usr/local/lib/firmware&lt;/span&gt;.  Grab the firmware from here:&lt;br /&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;http://ipw2200.sourceforge.net/firmware.php&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Extract the ipw2200 driver in &lt;span style="font-family:courier new;"&gt;/usr/src&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;# tar -zxvf ipw2200-source.tar.gz&lt;br /&gt;# cd modules/ipw2200/driver&lt;br /&gt;# make KSRC=/usr/src/kernel-headers-2.6.8-2-686 install&lt;br /&gt;# depmod -a&lt;br /&gt;# modprobe ipw2200&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-113658873643678369?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/113658873643678369/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=113658873643678369&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/113658873643678369'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/113658873643678369'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2006/01/debian-31-dell-d800-wireless.html' title='Debian 3.1 Dell d800 Wireless'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-20594933.post-113650577387627069</id><published>2006-01-05T18:41:00.000-05:00</published><updated>2006-11-08T13:54:16.800-05:00</updated><title type='text'>Debian 3.1 on Dell d800</title><content type='html'>I just got Debian 3.1 Sarge on my Dell d800.  The problem was my wide screen display it just wouldn't take. I had to install the Nvidia drivers and edit the XF86Config-4 file.&lt;br /&gt;&lt;br /&gt;XF86Config-4 (WSXGA laptop screen):&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;Section "Monitor"&lt;br /&gt;   Identifier     "Generic Monitor"&lt;br /&gt;   HorizSync       28.0 - 107.0&lt;br /&gt;   VertRefresh     30.0 - 130.0&lt;br /&gt;   ModeLine       "1680x1050" 147.1 1680 1784 1968 2256 1050 1051 1054 1087 +hsync +vsync&lt;br /&gt;   ModeLine       "1600x1024" 198.8 1600 1712 1888 2176 1024 1027 1030 1075 +hsync +vsync&lt;br /&gt;   ModeLine       "1440x900" 130.0 1440 1452 1572 1896 900 901 904 937 +hsync +vsync&lt;br /&gt;   ModeLine       "960x600" 60.0 960 968 1048 1264 600 601 603 625 +hsync +vsync&lt;br /&gt;   Option         "DPMS"&lt;br /&gt;EndSection&lt;br /&gt;&lt;/span&gt;... And of course ...&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:100%;"&gt;        Modes      "1680x1050" "1600x1024" "1440x900" "800x600" "640x480"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;My d8000 is equipted with the GeForce FX Go5650.  You can get the you can grab the Nvidia driver, &lt;span style=";font-family:courier new;font-size:100%;"  &gt;NVIDIA-Linux-x86-1.0-8178-pkg1.run&lt;/span&gt;, from the Nvidia site.  It's the Linux IA32 driver.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/20594933-113650577387627069?l=henrytseng.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrytseng.blogspot.com/feeds/113650577387627069/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=20594933&amp;postID=113650577387627069&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/113650577387627069'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/20594933/posts/default/113650577387627069'/><link rel='alternate' type='text/html' href='http://henrytseng.blogspot.com/2006/01/debian-31-on-dell-d800.html' title='Debian 3.1 on Dell d800'/><author><name>Henry Tseng</name><uri>http://www.blogger.com/profile/04474043919105140986</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
