<?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-1655988936613732025</id><updated>2012-02-16T20:09:14.483-08:00</updated><title type='text'>Inventions?</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://hai-phan.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1655988936613732025/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://hai-phan.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Hai H. Phan</name><uri>http://www.blogger.com/profile/10349520290994483072</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>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1655988936613732025.post-3183255385742771652</id><published>2011-12-19T23:25:00.000-08:00</published><updated>2011-12-19T23:26:10.842-08:00</updated><title type='text'>The Best MVC Framework Ever</title><content type='html'>&lt;pre&gt;package com.kenny.mvc &lt;br /&gt;{&lt;br /&gt; import flash.events.Event;&lt;br /&gt; import flash.utils.Dictionary;&lt;br /&gt; &lt;br /&gt; /**&lt;br /&gt;  * ...&lt;br /&gt;  * @author Hai&lt;br /&gt;  */&lt;br /&gt; public final class Controller &lt;br /&gt; {&lt;br /&gt;  private var _handlers:Object;&lt;br /&gt;  private var _state:State;&lt;br /&gt;  private var _subscribers:Dictionary;&lt;br /&gt;  &lt;br /&gt;  public function Controller() &lt;br /&gt;  {&lt;br /&gt;   _handlers = new Object();&lt;br /&gt;   _state = new State(_notify);&lt;br /&gt;   _subscribers = new Dictionary();&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  public function registerHandler($eventType:String, $handler:Function)&lt;br /&gt;  {&lt;br /&gt;   _handlers[$eventType] = $handler;&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  public function handleEvent($event:Event): Boolean&lt;br /&gt;  {&lt;br /&gt;   if (_handlers.hasOwnProperty($event.type)) return _handlers[$event.type].call(null, $event, _state);&lt;br /&gt;   else return false;&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  public function subscribe($propertyNames:Array, $callback:Function)&lt;br /&gt;  {&lt;br /&gt;   var subscriber:Object = {&lt;br /&gt;    callback: $callback,&lt;br /&gt;    args: $propertyNames&lt;br /&gt;   }&lt;br /&gt;   for each (var name:String in $propertyNames) {&lt;br /&gt;    if (_subscribers[name]) _subscribers[name].push(subscriber);&lt;br /&gt;    else _subscribers[name] = [subscriber];&lt;br /&gt;   }&lt;br /&gt;   _notifySubscriber(subscriber);&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  private function _notify($name:*)&lt;br /&gt;  {&lt;br /&gt;   if (_subscribers[$name]) for each (var subscriber:Object in _subscribers[$name]) _notifySubscriber(subscriber);&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  private function _notifySubscriber($subscriber:Object)&lt;br /&gt;  {&lt;br /&gt;    $subscriber.callback.apply(null, $subscriber.args.map(_getValue));&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  private function _getValue($name:*, ...rest): *&lt;br /&gt;  {&lt;br /&gt;   return _state[$name];&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;import flash.utils.Dictionary;&lt;br /&gt;import flash.utils.flash_proxy;&lt;br /&gt;import flash.utils.Proxy;&lt;br /&gt;&lt;br /&gt;dynamic class State extends Proxy&lt;br /&gt;{&lt;br /&gt; private var _data:Dictionary;&lt;br /&gt; private var _notify:Function;&lt;br /&gt; &lt;br /&gt; public function State($notify:Function)&lt;br /&gt; {&lt;br /&gt;  _data = new Dictionary();&lt;br /&gt;  _notify = $notify;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; override flash_proxy function setProperty($name:*, $value:*): void&lt;br /&gt; {&lt;br /&gt;  if (_data[$name] !== $value) {&lt;br /&gt;   _data[$name] = $value;&lt;br /&gt;   _notify($name);&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; override flash_proxy function getProperty($name:*): *&lt;br /&gt; {&lt;br /&gt;  return _data[$name];&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1655988936613732025-3183255385742771652?l=hai-phan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hai-phan.blogspot.com/feeds/3183255385742771652/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1655988936613732025&amp;postID=3183255385742771652' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1655988936613732025/posts/default/3183255385742771652'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1655988936613732025/posts/default/3183255385742771652'/><link rel='alternate' type='text/html' href='http://hai-phan.blogspot.com/2011/12/best-mvc-framework-ever-written.html' title='The Best MVC Framework Ever'/><author><name>Hai H. Phan</name><uri>http://www.blogger.com/profile/10349520290994483072</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-1655988936613732025.post-733806794298093749</id><published>2011-11-16T11:27:00.000-08:00</published><updated>2011-11-16T11:36:05.582-08:00</updated><title type='text'>PropertyChangeListener for AS3</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&lt;a href="http://4.bp.blogspot.com/--jgnlo7N638/TsQQiKGfm_I/AAAAAAAAACU/m-ib9eOt7RA/s1600/Properties.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="396" src="http://4.bp.blogspot.com/--jgnlo7N638/TsQQiKGfm_I/AAAAAAAAACU/m-ib9eOt7RA/s400/Properties.png" width="400" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1655988936613732025-733806794298093749?l=hai-phan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hai-phan.blogspot.com/feeds/733806794298093749/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1655988936613732025&amp;postID=733806794298093749' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1655988936613732025/posts/default/733806794298093749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1655988936613732025/posts/default/733806794298093749'/><link rel='alternate' type='text/html' href='http://hai-phan.blogspot.com/2011/11/propertychangelistener-for-as3.html' title='PropertyChangeListener for AS3'/><author><name>Hai H. Phan</name><uri>http://www.blogger.com/profile/10349520290994483072</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://4.bp.blogspot.com/--jgnlo7N638/TsQQiKGfm_I/AAAAAAAAACU/m-ib9eOt7RA/s72-c/Properties.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1655988936613732025.post-1911601899869038631</id><published>2008-01-22T01:12:00.000-08:00</published><updated>2008-01-22T01:13:00.347-08:00</updated><title type='text'>Pull-up Sun Shade</title><content type='html'>Automobile interiors often suffer intense heat when parked in the mid-day sun. Sun Shades protect the interior by blocking sun light entering through the windshield. Similarly side window shades blocks a portion of sun light from entering through side and back window. Side and back windows can also be tinted to provide some protection.Currently all sunshades are in the form of removable foldable aluminum foil sheets or nylon meshes. This invention is a type of sunshade that is integrated with the automobile in the form of a pull-up sheet made of any of the above protective material, to be installed right behind the windshield. THe sheet has to be pulled up by a person from the dashboard and hooked to the rearview mirror. The sheet may not be pulled up when the car is turned on.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1655988936613732025-1911601899869038631?l=hai-phan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hai-phan.blogspot.com/feeds/1911601899869038631/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1655988936613732025&amp;postID=1911601899869038631' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1655988936613732025/posts/default/1911601899869038631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1655988936613732025/posts/default/1911601899869038631'/><link rel='alternate' type='text/html' href='http://hai-phan.blogspot.com/2008/01/pull-up-sun-shade.html' title='Pull-up Sun Shade'/><author><name>Hai H. Phan</name><uri>http://www.blogger.com/profile/10349520290994483072</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-1655988936613732025.post-5301932491750322737</id><published>2007-12-26T14:12:00.000-08:00</published><updated>2007-12-26T17:56:38.080-08:00</updated><title type='text'>Aimbot for ZWok</title><content type='html'>&lt;span style="font-size:100%;"&gt;An Aimbot for ZWok can be implemented as a Win32 application that captures keyboard and mouse events using system hooks, and use a set of keyboard mnemonics for calibration as well as aiming.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;Assumption:&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;We make the simplifying assumption that, in ZWok, gravity is constant in all levels and that there is no wind or drag.  The motion of the projectile is given by the following equations:&lt;br /&gt;&lt;br /&gt;x = x&lt;/span&gt;&lt;span style="font-size:100%;"&gt;0 + v0&lt;/span&gt;&lt;span style="font-size:100%;"&gt;t cos(theta)&lt;br /&gt;y = y&lt;/span&gt;&lt;span style="font-size:100%;"&gt;0&lt;/span&gt;&lt;span style="font-size:100%;"&gt; + v&lt;/span&gt;&lt;span style="font-size:100%;"&gt;0t sin(theta) + .5 g t^2&lt;br /&gt;&lt;br /&gt;where (x&lt;/span&gt;&lt;span style="font-size:100%;"&gt;0, y&lt;/span&gt;&lt;span style="font-size:100%;"&gt;0) is the initial position, v&lt;/span&gt;&lt;span style="font-size:100%;"&gt;0 the initial velocity (magnitude only), &lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;theta&lt;/span&gt;&lt;span style="font-size:100%;"&gt; the angle of discharge, and &lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;g&lt;/span&gt;&lt;span style="font-size:100%;"&gt; the gravitational acceleration.  Solving the first equation for &lt;/span&gt;&lt;span style="font-size:100%;"&gt;v0&lt;/span&gt;&lt;span style="font-size:100%;"&gt;t and substituting into the second, we get equation [1]:&lt;br /&gt;&lt;br /&gt;y = &lt;/span&gt;&lt;span style="font-size:100%;"&gt;y&lt;/span&gt;&lt;span style="font-size:100%;"&gt;0&lt;/span&gt;&lt;span style="font-size:100%;"&gt; + (x-x&lt;/span&gt;&lt;span style="font-size:100%;"&gt;0) tan(theta) + .5 (g/v&lt;/span&gt;&lt;span style="font-size:100%;"&gt;0^2) (x-x&lt;/span&gt;&lt;span style="font-size:100%;"&gt;0)^2 / cos(theta)^2&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;Calibration:&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;Calibration is the process of determining the value of &lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;g&lt;/span&gt;&lt;span style="font-size:100%;"&gt; from an actual projectile.  To do that, in ZWok, we shoot a random projectile and capture:&lt;br /&gt;&lt;br /&gt;1. The starting point (x&lt;/span&gt;&lt;span style="font-size:100%;"&gt;0, y&lt;/span&gt;&lt;span style="font-size:100%;"&gt;0)&lt;br /&gt;2. The aim vector (v&lt;/span&gt;&lt;span style="font-size:100%;"&gt;0, &lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;theta&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)&lt;br /&gt;3. A random point on the curve (x&lt;/span&gt;&lt;span style="font-size:100%;"&gt;1, y&lt;/span&gt;&lt;span style="font-size:100%;"&gt;1)&lt;br /&gt;&lt;br /&gt;Substituting the values into the equation [1] and solving for g, we get:&lt;br /&gt;&lt;br /&gt;g = (v&lt;/span&gt;&lt;span style="font-size:100%;"&gt;0^2) * {[2 cos(theta)^2 (y&lt;/span&gt;&lt;span style="font-size:100%;"&gt;1-y&lt;/span&gt;&lt;span style="font-size:100%;"&gt;0) / (x&lt;/span&gt;&lt;span style="font-size:100%;"&gt;1-x&lt;/span&gt;&lt;span style="font-size:100%;"&gt;0)^2] - [sin(2theta) / (x&lt;/span&gt;&lt;span style="font-size:100%;"&gt;1-x&lt;/span&gt;&lt;span style="font-size:100%;"&gt;0)]}&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;Application&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;Now that we have &lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;g&lt;/span&gt;&lt;span style="font-size:100%;"&gt;, we can substitute it back into equation [1], which now can be used to trace the path of a projectile from any starting point and initial velocity.&lt;br /&gt;&lt;br /&gt;Our Aimbot can implement a simple interface with one key combination (for example, CTRL-SHIFT-X) for marking position on the screen.  The first key press will mark the starting position, the second time marks the target.  After that the Aimbot begins tracking the mouse position and computes in real-time the aim vector, using equation [1] to determine how close the projectile comes to hitting the target and display the deviation numerically or using a graphical fill bar.  Advanced bots can even plot out the path on the screen.&lt;br /&gt;&lt;br /&gt;Note that ZWok targets can move.  Aimbot is useful only if you know the target won't move next turn, or if you know where it is moving to.  It is possible to specify another point that the projectile has to pass through, and provide an additional deviation meter for aiming.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1655988936613732025-5301932491750322737?l=hai-phan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hai-phan.blogspot.com/feeds/5301932491750322737/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1655988936613732025&amp;postID=5301932491750322737' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1655988936613732025/posts/default/5301932491750322737'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1655988936613732025/posts/default/5301932491750322737'/><link rel='alternate' type='text/html' href='http://hai-phan.blogspot.com/2007/12/aimbot-for-zwok.html' title='Aimbot for ZWok'/><author><name>Hai H. Phan</name><uri>http://www.blogger.com/profile/10349520290994483072</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>
