<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Direct from Web 2.0</title>
	<atom:link href="http://www.coachwei.com/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://www.coachwei.com/blog</link>
	<description>Coach Wei' thoughts on web 2.0, social computing, enterprise 2.0, collaboration, IT enabled services, dijital life and startups</description>
	<pubDate>Mon, 06 Oct 2008 02:28:09 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Running Toronto Marathon - 9/28/2008</title>
		<link>http://www.coachwei.com/blog/2008/09/30/running-toronto-marathon.html</link>
		<comments>http://www.coachwei.com/blog/2008/09/30/running-toronto-marathon.html#comments</comments>
		<pubDate>Wed, 01 Oct 2008 04:28:13 +0000</pubDate>
		<dc:creator>coachwei</dc:creator>
		
		<category><![CDATA[marathon]]></category>

		<guid isPermaLink="false">http://www.coachwei.com/blog/?p=273</guid>
		<description><![CDATA[A couple of years ago my friend Kaushal Vyas blogged about his first marathon experience. His blog entry started with some quotes from Lance Armstrong on his first marathon:
“the hardest physical thing I have ever done. Even the worst days in the tours, nothing was as hard as that and nothing left me feeling the [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of years ago my friend <a href="http://ahimsa-marg.blogspot.com/2006/12/white-rock-marathon.html">Kaushal Vyas</a> blogged about his first marathon experience. His blog entry started with some quotes from Lance Armstrong on his first marathon:</p>
<p><span style="color: #0000ff;">“the hardest physical thing I have ever done. Even the worst days in the tours, nothing was as hard as that and nothing left me feeling the way I feel now in terms of sheer fatigue and soreness. I think I bit off more than I could chew, I thought the marathon would be easier&#8230;”</span>.</p>
<p>It didn&#8217;t resonate with me at the time. In fact, I didn&#8217;t feel anything besides saying &#8220;wah, cool&#8221;. What I didn&#8217;t know (I&#8217;m sure Kaushal didn&#8217;t know either) is that he planted some seeds in me at the time that would only grow two years later.</p>
<p>In Boston where I live(Kaushal lives in LA), my friend Ying actually has been running marathon many times. I always admired her for such achievements. Every time when she encouraged people to run, I always thought &#8220;nanh, not me&#8221;.</p>
<p>I know myself - I was never a good runner. My body type is not built for running with a BMI of 27. I hated running long distance when I was in middle school. Over the last few years, I did do some running here and there along the river, only because i wanted to take some time to think of things. Further, I&#8217;ve never been able to run for more than 2-3 miles without stopping. 26 miles? It is just way out of my league.</p>
<p>In June 2008, Cliff (of <a href="http://literacybridge.org/">LiteracyBridge</a>, very cool non-profit startup) and I somehow got into talking about marathon. His background is similar to mine (never enjoyed running, never run more than 3 miles, &#8230;) but he did it. What I learned from him is &#8220;a non-runner&#8217;s guide to marathon&#8221;. Yes, that&#8217;s me - a non-runner.</p>
<p>So I dipped my toe into training. Two friends(Ying and Jana) were training for the September 2008 Toronto race. I joined them in the end of June. Normal marathon training takes about 16 weeks. So my time was a little bit short, but I figured that I am not trying to win the first place and I can drop out if it turns out to be too much, so I went for it.</p>
<p><strong>The Training</strong><br />
The training was actually quite enjoyable, because marathon training schedules are all designed to take someone from 3 mile run to 26 miles in a gradual, incremental fashion. Every few weeks, the running mileage increases, but still within the limits of a normal human body. Such increases give a real sense of accomplishment that keeps one going.</p>
<p>I did have challenges almost all the time though. In the first month or so, my calves were very sore that I have to stop running from time to time. I thought my calves were injured. It turned out that it was probably just weak. After a month, the calves problem went away. The I ran into breathing problem, having pains below my right ankle, thigh problems&#8230;. one problem after another one. But nothing was serious to stop the training.</p>
<p><strong>August 31 2008</strong><br />
On August 31 2008(four weeks before the race), I successfully completed a 21 mile run under four hours. I was very tired after the run, but my body felt good. There was no injury or pain. I felt for the first time that I can run marathon. That&#8217;s the time that I actually registered for the race.</p>
<p><strong>September 7 2008</strong></p>
<div  class='alignleft' style="margin:5px;"><img src='http://www.gobros.com/gc/files/mcdavid/425_blk_dt.jpg' alt='' /><br/><b>McDavid Ligament Black 425</b></div>
<p>Three weeks before the race: we were trying to run another 20+ mile run in the morning. I had too much wine the night before and went to bed fairly late (2am?). I didn&#8217;t feel good running. I kept telling my running partners that I &#8220;am very sleepy&#8221; during the run. Bad things happened then. After the 13th mile, I suddenly felt a sharp pain on the outside of my left knee. The pain was so severe that I couldn&#8217;t run anymore. I walked for 5 miles to finish the route. But I wasn&#8217;t too worried, thinking of it as a glitch that will go away if I&#8217;m better rested next time. My running partners told me to take Ibuprofen, and have plenty of rest.</p>
<p><strong>September 17 2008</strong><br />
Typical training schedule ends after a couple of 20+ mile long runs, which would be sufficient to run the marathon. On Sept 17, I decided to do a 14-mile run to see whether my knee has fully recovered. I also put on knee braces for extra support. After ten miles, I felt early signs of knee problem again. I knew it would develop into sharp pains in a couple of miles. With only 10 days to go before the race, I started to worry whether I can run the marathon.</p>
<p>The problem I have is called &#8220;ITBS&#8221; (Iliotibial Band Syndrome), a very common problem for runners. After consulting various sources, I stopped running. Instead, I started taking Ibuprofen, doing ITBS exercises, and swimming every day, hoping to put the problem under control.</p>
<p><strong>September 25 2008</strong></p>
<p>With only three days to go, we went for the last run, a 2.5 mile short run. Both Jana and I didn&#8217;t feel good about our knees after this run. Fortunately we found some good strong knee braces, McDavid&#8217;s Ligament Black 425.  This knee brace is so good that we both gained confidence again. </p>
<p><strong>Racing Day - September 28 2008</strong><br />
Marathon races typically start at 7:30AM, and requires participants to line up one hour before that. Having to get up at 5AM killed me. But being together with so many runners, it was exciting. We crossed the starting line around 7:40AM. The route started at Toronto&#8217;s City Hall, then went down along the waterfront to the east. I felt fine besides being a little bit sleepy. while praying my knee is going to be OK.</p>
<p><a href="http://www.torontowaterfrontmarathon.com/photos/2008/overview/images/039TA092808-Marathon2.jpg"><img src="http://www.torontowaterfrontmarathon.com/photos/2008/overview/images/039TA092808-Marathon2.jpg" alt="" /></a></p>
<p>After about 2-3 kilometers, my left leg started to feel numb, probably because the knee brace was too tight. Having problems this early is obviously bad. I slowed down, completely loosened the belts on the brace. Loosening the belts means taking a big risk in giving up a lot of of knee support. But I had no choice. After another kilometer or so, the worst happened. My knee started hurting. It may soon develop into sharp pains that would stop me from running.</p>
<p>This was not even 5 kilometers yet! I have to face the possibility of dropping out of the race. But not even completing 5 kilometers would be a real shame! While I resisted the idea of dropping out, I knew it would be unlikely that I&#8217;d be able to finish the race today. It was a bitter realization, and all what I could hope for was to run a decent distance worthy of my training.</p>
<p>So I tried to figure out ways that could help me last as far as I could. First of all, I tightened my knee brace belts to delay the knee pain from further development. Secondly, I tried to minimize the usage of my left leg. In fact, my left foot didn&#8217;t touch the ground except for a few toes, basically hopping/limping along by putting most of my weight and forces on my right leg.</p>
<p>With the new strategy, I finished 12 kilometers. Fortunately the knee problem didn&#8217;t seem to develop further. However, the unnatural running position made my body very tired. With 30 more kilos ahead, I knew the impossibility of finishing the run. Mentally I started to prepare for dropping out of the race at half marathon.</p>
<p>At 18th kilometer, half marathon runners were instructed to stay to the left of the road and marathon runners on the right side. 90% runners went to the left side. The right side was actually relatively empty. For some strange reason, I decided to stay on the right side of the road. Not sure what I was thinking at that moment. My right leg was really tired and I had to walk instead of running a few times to give my right leg a break. For the next several kilometers, every kilometer was a struggle. My body was very weak. I was struggling to fight off the idea of dropping out and getting this over.</p>
<p>After 26th kilo, it was as if my training started to kick in. I started to feel some strength coming back into my body. When I crossed 28 kilo, someone cheered &#8220;you&#8217;ve finished 2/3&#8243;. My mental state suddenly changed. At that moment, I realized that I will not drop out and will finish the race.</p>
<p>The rest of the journey was difficult, but nothing insurmountable. The last 1200 meters were actually quite enjoyable (given that so many friendly people were cheering for me). I crossed the finished line, and saw my running partners holding cameras towards me. Exhausted, but felt invincible.</p>
<p><strong>In the End</strong><br />
I finished the run in 5 hour 35 minutes, a lot longer than I hoped for. However, I was thrilled to have finished the race without dropping out considering that I have to run on one leg most of the time and the mental torture associated with it. Self doubt is the worst enemy and I had it with me until I finished the 28 kilo. Yes, a lot of things in life depend on mental strength, rather on the sheer physical strength.</p>
<p><a href="http://www.coachwei.com/wp-content/uploads/2008/10/toronto-marathon1.jpg"><img class="alignleft size-medium wp-image-274" style="margin: 4px;" title="marathon1" src="http://www.coachwei.com/wp-content/uploads/2008/10/toronto-marathon1.jpg" alt="marathon outfit and medal" /></a></p>
<p>Physically, to be honest, I was exhausted after the race. However, I could have run another couple miles though, because in the end, running was just something to do. I hit the wall early - from the 15th to the 25th kilometer. That was the time I was most exhausted, had very little faith in myself and couldn&#8217;t see the light in the end of the tunnel. It was dark as the deepest night even in the end of the 27th kilo. But the moment I turned into the 28th, I knew I got it.</p>
<p>I can see myself run better when someone was cheering for me. My friends, running partners, family and the friendly Toronto people were doing an incredible job at cheering for me. Big thanks!</p>
<p>In retrospect, I wasn&#8217;t totally well prepared. I have yet to develop more strength around my left knee to support running a marathon. Consequences? My left knee still hurts. One of my left toe nails was full of blood. I also discovered my knee brace has cut a half ring into my skin, right behind my knee cap. Nevertheless, it felt really good!</p>
<p>If I can do it, so can you!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coachwei.com/blog/2008/09/30/running-toronto-marathon.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>JavaScript Execution Context, Closure, Eval and &#8220;this&#8221; Keyword</title>
		<link>http://www.coachwei.com/blog/2008/09/13/javascript-execution-context-closure-eval-and-this-keyword.html</link>
		<comments>http://www.coachwei.com/blog/2008/09/13/javascript-execution-context-closure-eval-and-this-keyword.html#comments</comments>
		<pubDate>Sun, 14 Sep 2008 03:36:23 +0000</pubDate>
		<dc:creator>coachwei</dc:creator>
		
		<category><![CDATA[WebDev]]></category>

		<category><![CDATA[activation object]]></category>

		<category><![CDATA[eval]]></category>

		<category><![CDATA[function scope]]></category>

		<category><![CDATA[Javascript closure]]></category>

		<category><![CDATA[Javascript execution context]]></category>

		<category><![CDATA[scope]]></category>

		<category><![CDATA[scope chain]]></category>

		<category><![CDATA[this]]></category>

		<category><![CDATA[variable object]]></category>

		<guid isPermaLink="false">http://www.coachwei.com/blog/?p=272</guid>
		<description><![CDATA[These are a few key concepts of JavaScript language that developers should know: execution context, activation object, variable instantiation, scoping, closure, eval and &#8220;this&#8221; keyword.  Knowing these would help one tremendously in Ajax development. 
For example, when you write an inner function, you know that you can access the local variables defined in the [...]]]></description>
			<content:encoded><![CDATA[<p>These are a few key concepts of JavaScript language that developers should know: execution context, activation object, variable instantiation, scoping, closure, eval and &#8220;this&#8221; keyword.  Knowing these would help one tremendously in Ajax development. </p>
<p>For example, when you write an inner function, you know that you can access the local variables defined in the outer function as if they were defined locally. You can also access the global variables. -Why? How does the host environment resolve such variables?</p>
<p>Another example: When you pass arguments to a function, you can access these arguments as if they were locally defined variables. How does this work?</p>
<p>A slightly more involved example that developers must have seem similar code a lot but may not know the &#8220;why&#8221;:</p>
<pre>
function outerFunc(outerArg){
   var localVar = 100;

   function innerFunc(innerArg){
      localVar+=100;
       return (outerArg +innerArg + localVar);
    }

   return innerFunc;
}

 var globalVar = outerFunc(200);
 alert(globalVar(300));	//this displays 700
 alert(globalVar(300));	//this displays 800
 globalVar = outerFunc(200)
 alert(globalVar(300));  //this displays 700 again
</pre>
<p>Why would the 2nd alert box show 800 (means the value of <code>localVar</code> is retained from the first call) while the third alert displays 700 (the value of <code>localVar</code> is not retained from previous calls)? How does it work?</p>
<ol> <b>Key Concepts</b></p>
<li><strong>Execution Context</strong>:<br />
An execution context is an abstract concept used by the EcmaScript specification and  can be conceived (and even implemented) as a set of objects with properties, though not publicly accessible, that encapsulate the context in which a piece of JavaScript code executes. The JavaScript code would rely on its execution context for things like variable resolution and scoping. </p>
<p>
All JavaScript code executes in an execution context. Global code (code executed inline, normally as a JS file, or HTML page, loads) gets executed in a global execution context (in a browser, the global context is typically the <span class="code">window</span> object), and each invocation of a function (possibly as a constructor) has an associated execution context. Code executed with the <span class="code">eval</span> and <code>setTimeout</code> functions also gets a distinct execution context.
</p>
<p>When a JavaScript function is called,  it enters an execution context. If another function is called (or the same function recursively),  a new execution context is created and execution enters that context for the duration of the function call. When that called function returns,   control returns to the original execution context and the just finished execution context is available for garbage collection except for cases like <strong>closure</strong>. Thus running JavaScript code forms a stack of execution contexts.</li>
<li><strong>Activation Object and Variable Object </strong>:<br />
<OL><br />
<LI>Activation Object:<br />
When an execution context is created, an <b>Activation Object</b> is created. The Activation Object can be considered as a normal JavaScript object with accessible named properties, except that it has no prototype and it cannot be directly referenced by javaScript code.This Activation Object is used for storing context related information such as call arguments and variables, etc. so that they are accessible to the new execution context (see more info on this later in this post).<br />
</LI><br />
<LI>Variable Object  and Variable Instantiation:<br />
ECMA Specification refers to a &#8220;Variable Object&#8221; for variable instantiation.  &#8220;Variable Instantiation&#8221; is a process that takes place when the JavaScript host environment processes a piece of script so that it can be executed but before executing the script. In this process, the JavaScript engine prepares(&#8221;instantiates&#8221;) the local variables, local functions declarations, and arguments to the function call etc. so that these variables are accessible during execution. </p>
<p>The way that variable instantiation works is to instantiate each of the function&#8217;s formal parameters, local variables and inner function declarations as named properties of the Variable Object. In the process, named properties of the Variable object are created for each of the function&#8217;s formal parameters. If arguments to the function call correspond with those parameters,  the values of those arguments are assigned to the properties (otherwise the assigned value is undefined). If there is an inner function declaration,  a function object is created. This function object is assigned a property of the Variable object with name corresponding to the function name used in the function declaration. The last stage of variable instantiation is to create named properties of the Variable object that correspond with all the local variables declared within the function.</p>
<p>The properties created on the Variable object that correspond with declared local variables are initially assigned undefined values during variable instantiation, the actual initialization of local variables does not happen until the evaluation of the corresponding assignment expressions during the execution of the function body code.</p>
<p>However, it is very important to point out that the <b>Activation object is used as the Variable object</b>. Though conceptually they are called out as different objects, they are the same object in reality. This is important as you can see quickly in &#8220;scope and scope chain&#8221; and &#8220;variable resolution&#8221; later on. </p>
<p>It is the fact that the Activation object, with its <code>arguments</code> property, and the Variable object, with named properties corresponding with function local variables, are the same object, that allows the identifier <code>arguments</code> to be treated as if it were a function local variable.</p>
<p></LI></OL></LI><br />
<LI><strong>Scope, Scope Chain and Variable Resolution:</strong><br />
Each execution context has an assigned scope when created. A <b>scope</b> can be thought of as an &#8220;object&#8221; that is associated with a particular execution context (this scope object is actually the Activation Object we mentioned above). A <b>scope chain</b> consists of a list (or chain) of such objects. The scope chain of an execution context is a chain of objects with the current &#8220;scope&#8221; object on the top, the &#8220;scope&#8221; object of the calling execution context as the 2nd object on the top, and so on, with the last &#8220;scope&#8221; object of the chain being that of the global execution context. </p>
<p>What do <code>scope</code> and <code>scope chain</code> do? They are used for <b>variable resolution</b>. When some JavaScript refers to a variable <code>"foo"</code>, the host environment will try to resolve this variable. This resolution process is against the scope chain of the current execution context.  First, it will search to see if there is a variable with the same name in the current scope. This is done by checking to see if the current &#8220;scope&#8221; object has such a named property. Remember that we mentioned Activation Object and Variable Object are the same object, and local variables (including  inner function declarations, and function arguments) are instantiated as named properties of the Variable object during variable instantiation. So if the &#8220;foo&#8221; variable is defined in the local execution context, there must be a property of the Variable object named &#8220;foo&#8221;.   If such a named property is not found, it means this &#8220;foo&#8221; variable is not defined here. The resolution process will now go down the scope chain and check against the 2nd &#8220;scope&#8221; object and so on until such such a named property is found or otherwise an &#8220;undefined&#8221; error happens </p>
<p>(BTW:  Prototype chain is always part of property resolution process and no difference here either. The normal prototype chain lookup process applies when looking for a property with a specific name from a &#8220;scope&#8221; object: If no such property is found on the object itself, the prototype object will be searched. Still not found, the prototype of the prototype object will be searched. Until either the property is found or the end of the prototype chain is reached). </p>
<p>Important to point out: each function object has an internal property called <code>[[scope]]</code> (see more info on this later in this post) that consists of a list (or chain) of objects. This <code>[[scope]]</code> property can not be directly referenced by JavaScript code.  When the function object is created, its internal <code>[[scope]]</code> property is assigned to the execution context in which this function object is created. This execution context has its own scope object and so on. In the end,  the <code>[[scope]]</code> property is associated with a scope chain with the execution context in which the function object is created being on the top. </p>
<p>The scope chain of the execution context of a function call consists of the list referred to by the <code>[[scope]]</code> property of the corresponding function object and the Activation object created for this function call. The activation object is at the front of the chain (or the top of the list).<br />
</LI></p>
<li><strong>Automatic Garbage Collection</strong>:<br />
Yes, automatic garbage collection is not a Java specialty. EcmaScript uses automatic garbage collection too.  If an object becomes un-referable (by having no remaining references to it left accessible to executing code),  it becomes available for garbage collection and will at some future time be destroyed and any resources it consumes freed and returned to the system for re-use.</p>
<p>This would normally be the case upon exiting an execution context.  Any objects created within the exited execution context, including function objects, would no longer be accessible and so would become available for garbage collection. However, <strong>Closure</strong> is the exception. </p>
<li><strong>Closure</strong>:</li>
<p>A closure is an expression (typically a function) that can have free variables together with an environment that binds those variables (that &#8220;closes&#8221; the expression). A closure is formed by returning a function object that was created within an execution context of a function call  and assigning an accessible reference to that inner function.  The accessible reference can be established by directly assigning the returned function object to a global variable, a property of a globally accessible object or an object passed by reference as an argument to the outer function call, etc. </p>
<p>In the code example above, line <span class="code">&#8220;var globalVar = outerFunc(200);&#8221;</span> calls the outer function <code>"outerFunc"</code>. This call returns an inner function object and this returned inner function object is assigned to a global variable called <code>globalVar</code>. As a result, a closure is formed here.
</li>
<li><b>Summary and the Global Execution Context</b>
<p>The key concepts of execution context can be summarized using the following illustrations (assuming the function is named <code>"foo"</code>):</p>
<pre>
   The Execution Context of a call to function "foo":
           . Activation object
           . Variable object
           . Scope chain
</pre>
<p>The <code>[[scope]] </code> property of function object &#8220;foo&#8221; is:</p>
<pre>
    foo.scope:
          = the scope chain of the execution context where "foo" is created
</pre>
<p>Further, the relationship between the above objects are:</p>
<pre>

   The Execution Context of a call to function "foo":
         .Activation object: = Variable object
                 .arguments
                 .local variables
                 .local function declarations
         .Scope chain:
                     = Activation object + foo.scope
</pre>
<p>The global execution context gets some slightly different handling:<br />
1.  As it does not have arguments so it does not need a defined Activation object to refer to them;<br />
2.  The global execution context does need a scope and its scope chain consists of exactly one object, the global object itself (<code>window</code> object).<br />
3.  The global execution context does go through variable instantiation just like any other context;<br />
4.  The global object itself is used as the Variable object, which is why global functions and variables become properties of the global object.
</li>
</ol>
<p><b>How Does A JavaScript Function Get Executed?</b></p>
<p>The JavaScript engine goes through several steps in calling a JavaScript function (say the function is named <code>"foo"</code> for reference purposes): </p>
<ol>
<li>First of all, it creates a new <em> Execution Context</em> for this function call. The creation of an <em>Execution Context</em> follows the following steps:
<ol>
<li>Create an <em>Activation Object</em>;</li>
<li>Create an <em>arguments</em> object with <code>length</code> and <code>callee</code> properties specified. This <code>argument</code> object is an array-like object with integer indexed members corresponding to the arguments passed to the function call, in the order of their appearance. It also has <code>length</code> and <code>callee</code> properties instantiated. Next, a property named <code>"arguments"</code> is created for the Activation Object and a reference to this <code>arguments</code> object is assigned to this property;
</li>
<li>Variable Instantiation: assign local variables, inner function declarations and declared function parameters as such named properties of this <code>Activation Object</code>, with value being &#8220;undefined&#8221; for local variables and non-instantiated function call parameters (more on the values later, and also more on how  functions are instantiated and assigned               <code>[[scope]]</code> property later).
</li>
<li>Assign the <em>&#8220;this&#8221;</em> keyword (more on <code>"this"</code> keyword later);</li>
<li>Assign &#8220;scope&#8221; and &#8220;scope chain&#8221; to this execution context:<br />
          <UL><br />
           <LI>&#8220;scope&#8221; = the Activation Object:</li>
<p>            <LI>&#8220;scope chain&#8221; = the Activation Object + the chain referred to by the <em>[[scope]]</em> property of this function object <em>&#8220;foo&#8221;</em>. </li>
<p>           </UL>
        </li>
</ol>
<p>  Now the execution context of this function call is created and we are ready to call the function.
</li>
<p><LI>Call function &#8220;foo&#8221; and executes its code line by line:<br />
       <UL><br />
            <LI>For each variable that the execution process runs into, resolve it according to the variable resolution rule by looking at the local Activation object first, then the calling execution context&#8217;s Activation object, and so on, until the end of the scope chain which should be the &#8220;Activation Object&#8221; of the global execution context (a side note: for performance reasons, you can see why referencing a global variable using <code>window["variableName"]</code> would be better than using <code>"variableName"</code> directly);<br />
             </LI><br />
            <LI>For each local variable (remember we said earlier that their values are &#8220;undefined&#8221; during variable instantiation), evaluate the variable&#8217;s assignment expression (if there is one) and assigns the result to it (actually, assigns the result to such a named property of the Activation Object);<br />
            </LI><br />
            <LI> If the execution process runs into a function call (let&#8217;s call it function &#8220;foo2&#8243;), a new execution context (let&#8217;s call this &#8220;context foo2&#8243;) is created for this function call. In &#8220;context foo2&#8243;:<br />
                  <OL><br />
                     <LI>a new Activation Object (&#8221;Activation object foo2&#8243;)  is created;</LI><br />
                     <LI>Variable Instantiation is performed(using the Activation object(&#8221;Activation object foo2&#8243;) as Variable object);</LI><br />
                      <LI>The scope chain of &#8220;context foo2&#8243; is (&#8221;Activation object foo2&#8243;+ the scope chain of &#8220;foo&#8221;); </p>
<p>                    <LI>During the variable instantiation for this function call, if a function declaration (let&#8217;s call this function &#8220;foo3&#8243;) is found, a new function object (&#8221;foo3&#8243;) is created. a property named as the declared function&#8217;s name with value being this newly created function object will be added to the Activation object. </p>
<p>                    More importantly to point out, the <code>[[scope]]</code> property of this newly created function object <code>"foo3"</code> is the scope chain of the execution context where the instantiation happens - which is &#8220;context foo2&#8243; in this case. So <code>"foo3.scope"</code> is (&#8221;Activation object foo2&#8243;+ the scope chain of &#8220;foo&#8221;);<br />
                     </LI><br />
                     <LI>Eventually the function is called. Upon returning from this call, execution continues to the next line of function <code>"foo"</code>; </LI><br />
                 </OL><br />
            </LI><br />
            <LI>Finally, this call to function <code>"foo"</code> completes and we return to the callee. At this moment, unless a closure is formed, this execution context is available for garbage collection.<br />
            </LI><br />
       </UL><br />
</LI>
</ol>
<p><b>Function Instantiation</b></p>
<p>In JavaScript, &#8220;functions&#8221; are objects. Depending on how a function is defined, there are three ways to  instantiate a function object:<br />
<OL><br />
<LI><b>from function declaration during variable instantiation:</b><br />
If a function declaration is found during the process of variable instantiation, a function object will be created. The Activation Object will have a property whose name is the name of the function and whose value is the created function object. Further, This created function object will have its <code>[[scope]]</code> property assigned to be the scope chain of the execution context in which this function object is created.<br />
For example, in the following code snippet:</p>
<pre>
       function outerFunc() {
          var var1=10;
          function MyFunc1(){
                 return  var1=var1+1;
           };

          return MyFunc1();
        }

       alert(outerFunc()); //displays "11".
</pre>
<p>When the host environment is going to execute line <code>alert(outerFunc());</code>, in particular, when it is going to call <code>outerFunc()</code>, it will create a new Execution Context for this call (let&#8217;s name this new execution context <em>outerFuncContext1</em> for reference purpose). During the creation of <em>outerFuncContext1</em>, it will instantiate variables.  Both <code>"var1"</code> and <code>"MyFunc1"</code> are instantiated during this variable instantiation. Upon variable instantiation, the Activation Object associated with <em>outerFuncContext1</em> will have a property named <code>"var1"</code> whose value is &#8220;undefined&#8221;, and a property named <code>"MyFunc1"</code> whose value is a function object created here. Further, the <code>[[scope]]</code> property of this function object is assigned to be the scope chain of <em>outerFuncContext1</em>.<br />
</LI><br />
<LI><b>from the evaluation of a function expression during code execution.</b><br />
Consider the following snippet:</p>
<pre>
       function outerFunc() {
          var var1=10;
          var var2=function(){
                 return var1=var1+1;
           };

          return var2();
        }

       alert(outerFunc()); //displays "11".
</pre>
<p>When the host environment is going to call <code>outerFunc()</code>, it will create a new Execution Context for this call (again, let&#8217;s name this execution context <em>outerFuncContext1</em> for reference purpose). During the creation of <em>outerFuncContext1</em>, it will instantiate variables.  Both <code>"var1"</code> and <code>"var2"</code> are created during this variable instantiation. Upon variable instantiation, the Activation Object associated with <em>outerFuncContext1</em> will have a property named <code>"var1"</code> whose value is &#8220;undefined&#8221;, and a property named <code>"var2"</code> whose value is also &#8220;undefined&#8221;. </p>
<p>Then the host environment goes on to execute the call to <code>outerFunc()</code>. During execution, first it will assign <code>10</code> to <code>var1</code>. Then it will evaluate the function expression related to <code>var2</code>. During this evaluation, a function object is created and assigned to variable <code>var2</code>. Further, the <code>[[scope]]</code> property of this function object is assigned to be the scope chain of the execution context in which this function object is created, <em>outerFuncContext1</em>.<br />
</LI><br />
<LI><b>from invoking the <code>Function</code> constructor:</b><br />
In this case, the function&#8217;s <code>[[scope]]</code> property always refers to the scope chain of the global execution context, which contains only one object, the global object. An example is:</p>
<pre>
          var y=100;
          var multiply = new Function("x", "return x * y;");
          alert(10); //displays 1000.
</pre>
<p>In the above example, variable <code>y</code> is being searched in the global context. If there is no global variable named <code>"y"</code>, an error will be thrown.<br />
</LI></p>
<p><LI><b>Summary of function [[scope]]:</b><br />
In summary, every function object has an internal <code>[[scope]]</code> property that refers to a scope chain. This property is very important for figuring out the scope of execution context and thus variable resolution, etc:<br />
<UL><br />
   <LI>If the function object is created from a <code>Function</code> constructor, the <code>[[scope]]</code> property always refers to one object only, the global object. On browsers, it is the <code>"window"</code> object. </LI><br />
  <LI>If the function object is created from either function declaration or function expression evaluation, its <code>[[scope]]</code> property always refers to the scope chain of the execution context in which the function object is created. </LI><br />
</UL></LI></OL></p>
<p><b>The <code>"this"</code> Keyword</b></p>
<p>One of the most powerful JavaScript keywords is <code>"this"</code> and I am sure that every developer has used it many times. However, it is not straightforward to figure out what it points to. </p>
<p><code>"this"</code> is typically assigned an object that it points to during the process of creating a new execution context. If the value assigned refers to an object, then property accessors prefixed with the <code>"this"</code> keyword points to the properties of that object. However, if no object can be assigned to it, then the <code>"this"</code> keyword will point to the global object by default. </p>
<p>The next question is how do we know when/whether an Object will be assigned to <code>"this"</code> and who that Object is. For example, consider the following code:</p>
<pre>
      function redColor() {
                      this.color= 'red';
              }
     alert(redColor.color); //shows "undefined"
     var aa=redColor;
      alert("color="+aa.color); //shows color= undefined
</pre>
<p>What does not &#8220;color&#8221; become a property of <code>"aa"</code>? Further, functions are objects in JavaScript - why wouldn&#8217;t <code>"this"</code> refer to the function object &#8220;redColor&#8221; itself? </p>
<p>The rule to remember is that <code>"this"</code> always refers to the “owner” of the function we&#8217;re executing. In other words, <b>keyword <code>"this"</code> always refers to the object that the containing function is a method of</b>. </p>
<p>In the above example, the function <code>"redColor"</code> is not a method of object <code>"redColor"</code>, so <code>"redColor.color"</code> returns &#8220;undefined&#8221;. Further, function <code>"redColor"</code> is not a method of some object called <code>"aa"</code> either. So <code>"aa.color"</code> also returns &#8220;undefined&#8221;. </p>
<p>However, according to our understanding of how variable instantiation works, <code>"redColor"</code> is instantiated as a property of the global object. The global object has a property called <code>"redColor"</code> and the value of the property is the <code>"redColor"</code> function object. In  the end, <code>"function redColor"</code> is actually a method of the global object. According to the rule above, <code>"this"</code> should be referring to the global object.  </p>
<p>In other words, if we execute function <code>"redColor"</code>, we are actually assigning a &#8220;color&#8221; property to the global object with the value of &#8220;red&#8221;. If you run the following code:</p>
<pre>
	function redColor() {
              this.color = 'red';
      }

         redColor();
	 alert("window.color="+window.color);//shows window.color=red
</pre>
<p>The alert box shows &#8220;window.color=red&#8221;! </p>
<p>If you attach function <code>"redColor"</code> as a method of an object using <code>obj.method=redColor</code> or <code>obj.prototype.methodName=redColor</code>, the keyword <code>"this"</code> will correctly point to our <code>"obj"</code>. However, there is one case that people tend to make mistake, like the following:</p>
<pre>
          &lt;div id=&quot;mydiv&quot; onclick=&quot;redColor();&quot;&gt;This is my div&lt;/div&gt;
</pre

The code above is not able to set a "color" property for the "div" element at an "onclick" event, because <code>"redColor"</code> is still not a method of the &#8220;div&#8221; object. It is being called by a method of the &#8220;div&#8221; object called the <code>"onclick"</code>. As a result, the <code>"this"</code> keywork in the function body of <code>"redColor"</code> is not pointing to the &#8220;div&#8221; object as we hoped. The code below is the right way to achieve the goal of adding a <code>"color"</code> property to the &#8220;div&#8221; Object: 
<pre>
           var div=document.getElementById("mydiv");
           div.onclick=redColor;
</pre>
<p><b>The <code>"eval"</code> and <code>"setTimeout"</code> Functions </b><br />
Function <code>"eval" </code> and <code>"setTimeout"</code> have their own distinct execution context, as mentioned briefly ealier. <code>"setTimeout"</code> always assumes the global execution context. For <code>"eval"</code>, here is the quote from ECMASpecification:<br />
<quote><br />
&#8220;When control enters an execution context for eval code, the previous active execution context, referred to as the calling context, is used to determine the scope chain, the variable object, and the this value. If there is no calling context, then initializing the scope chain, variable instantiation, and determination of the this value are performed just as for global code.</p>
<p>The scope chain is initialized to contain the same objects, in the same order, as the calling context’s<br />
scope chain. This includes objects added to the calling context’s scope chain by with statements and<br />
catch clauses. </p>
<p>Variable instantiation is performed using the calling context’s variable object and using empty<br />
property attributes.</p>
<p>The this value is the same as the this value of the calling context.&#8221;<br />
</quote></p>
<p>In short, you can think of &#8220;eval&#8221; assuming the exact same execution context as the calling code. </p>
<p><OL><b>Further Readings and References </b><br />
<LI>&#8220;Microsoft AJAX Library - JavaScript Execution Context&#8221;, <a href="http://www.exforsys.com/tutorials/microsoft-ajax/javascript-execution-context/1.html">http://www.exforsys.com/tutorials/microsoft-ajax/javascript-execution-context/1.html</a>; (quick note: this doesn&#8217;t really have anything to do with Microsoft Ajax library. Further, &#8220;AJAX&#8221; should be spelled as &#8220;Ajax&#8221;. The &#8220;AJAX&#8221; spelling is so 2005!);<br />
</LI><br />
<LI>&#8220;Javascript Eval Scope Namespace Execution Context&#8221;, <a href="http://adrenalin.wordpress.com/2006/06/12/javascript-eval-scope-namespace-execution-context/">http://adrenalin.wordpress.com/2006/06/12/javascript-eval-scope-namespace-execution-context/<a>;</LI><br />
<LI>&#8220;The Magic Eval&#8221;, <a href="http://nerd.metrocat.org/2005/09/the-magic-eval">http://nerd.metrocat.org/2005/09/the-magic-eval</a>;</LI><br />
<LI>&#8220;The this keyword&#8221;, <a href="http://www.quirksmode.org/js/this.html">http://www.quirksmode.org/js/this.html</a>;</LI><br />
</LI>&#8220;Javascript Closures&#8221;, <a href="http://www.jibbering.com/faq/faq_notes/closures.html">http://www.jibbering.com/faq/faq_notes/closures.html</a>(note: this is a master piece!);</LI><br />
</OL></p>
]]></content:encoded>
			<wfw:commentRss>http://www.coachwei.com/blog/2008/09/13/javascript-execution-context-closure-eval-and-this-keyword.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Ajax-heavy Applications on Google Chrome</title>
		<link>http://www.coachwei.com/blog/2008/09/03/ajax-heavy-application-on-google-chrome.html</link>
		<comments>http://www.coachwei.com/blog/2008/09/03/ajax-heavy-application-on-google-chrome.html#comments</comments>
		<pubDate>Wed, 03 Sep 2008 13:02:35 +0000</pubDate>
		<dc:creator>coachwei</dc:creator>
		
		<category><![CDATA[WebDev]]></category>

		<category><![CDATA[google]]></category>

		<category><![CDATA[Ajax]]></category>

		<category><![CDATA[ajax performance]]></category>

		<category><![CDATA[Chrome]]></category>

		<category><![CDATA[razor profiler]]></category>

		<guid isPermaLink="false">http://www.coachwei.com/blog/?p=271</guid>
		<description><![CDATA[&#8220;This is the best browser so far&#8221; is that I can say after being a Chrome user for one day. 
First of all, I was glad to find out that I haven&#8217;t found Chrome breaking any web application yet, especially Ajax applications. I was a little concerned about this, given that the Chrome cartoons say &#8220;Javascript [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;This is the best browser so far&#8221; is that I can say after being a Chrome user for one day. </p>
<p>First of all, I was glad to find out that I haven&#8217;t found Chrome breaking any web application yet, especially Ajax applications. I was a little concerned about this, given that the Chrome cartoons say &#8220;Javascript runs in its own thread&#8221;, which is different from the threading model today. </p>
<p>For example, <a href="http://www.razorspeed.com">Razor Profiler</a> is a fairly Javascript-heavy web application that I wrote to perform JavaScript profiling and Ajax performance analysis. It includes tens of thousands of lines of JavaScript code on the client side, and employs a lot of &#8220;tricks&#8221; to make a web application deliver similar performance characteristics to native applications. -Razor Profiler works well on Chrome. </p>
<p>I also tried a few applications on <a href="http://www.dojotoolkit.org">Dojo</a>, <a href="http://extjs.com">ExtJS</a> and <a href="http://www.jquery.com">jQuery</a>. All worked well without a glitch. </p>
<p>After the initial concern eliminated, now I was able to see the noticeable performance improvement comparing to any other browsers. I am a constant user and tester of Safari, FireFox and IE. Chrome beats any of them hands down. </p>
<p>a. It is clearly faster and smoother to open browser window, close browser window, navigate to new sites, etc on Chrome than any other browser. Chrome delivers a very smooth browsing experience. </p>
<p>b. For Ajax applications, yes, Ajax code runs much faster on Chrome. For example, <a href="http://www.razorspeed.com">Razor Profiler</a>  needs to serialize collected profile data on the client side. There are a lot of data to serialize, typically creating a few hundred kilo-bytes of JSON stream to the server. This serialization process can easily take 5 to 10 seconds on any other browser. On Chrome, the amount of time is probably half of that. </p>
<p>So overall, Chrome is impressive! It certainly raised the bar. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.coachwei.com/blog/2008/09/03/ajax-heavy-application-on-google-chrome.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>The 64KB Java Language Problem - Lesson Learnd from Using Rhino to Process JavaScript</title>
		<link>http://www.coachwei.com/blog/2008/09/01/the-64kb-java-language-problem-lesso-learnd-from-using-rhino-to-process-javascript.html</link>
		<comments>http://www.coachwei.com/blog/2008/09/01/the-64kb-java-language-problem-lesso-learnd-from-using-rhino-to-process-javascript.html#comments</comments>
		<pubDate>Mon, 01 Sep 2008 17:13:59 +0000</pubDate>
		<dc:creator>coachwei</dc:creator>
		
		<category><![CDATA[Tips]]></category>

		<category><![CDATA[WebDev]]></category>

		<category><![CDATA[64KB JVM limit]]></category>

		<category><![CDATA[Dojo ShrinkSafe]]></category>

		<category><![CDATA[Java language bug]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Rhino]]></category>

		<category><![CDATA[YUI Compressor]]></category>

		<guid isPermaLink="false">http://www.coachwei.com/blog/?p=270</guid>
		<description><![CDATA[This entry documents a few tips related to using Rhino JavaScript Engine to process JavaScript code. If you are using Rhino, you probably won't run into the issues covered in this post during development or even testing. However, you are fairly likely to run into these issues after your system goes live. It would easily result in days or even weeks of soul searching (speaking from my personal experience:-)). Part of the problem seems to be the lack of documentation from the web. The other part of the problem is that the problem is rather a Java language problem(very convoluted).  - Java limits the maximum method size to be 64KB.]]></description>
			<content:encoded><![CDATA[<p>This entry documents a few tips related to using<a title="Rhino JavaScript Engine" href="http://www.mozilla.org/rhino/"> Rhino JavaScript Engine </a>to process JavaScript code. If you are using Rhino, you probably won&#8217;t run into the issues covered in this post during development or even testing. However, you are fairly likely to run into these issues after your system goes live. It would easily result in days or even weeks of soul searching (speaking from my personal experience:-)). Part of the problem seems to be the lack of documentation from the web. The other part of the problem is that the problem is rather a Java language problem(very convoluted). - Java limits the maximum method size to be 64KB.</p>
<p><strong>1. JVM Byte Code Size Limit Problem<br />
</strong></p>
<p>On rare occasions, you will see exceptions like the followings from Rhino when processing JavaScript files:</p>
<p>Exception in thread &#8220;main&#8221; java.lang.<a class="missing wiki" rel="nofollow" href="/wiki/IllegalArgumentException">IllegalArgumentException</a>: out of range index</p>
<blockquote><p>at org.mozilla.classfile.<a class="missing wiki" rel="nofollow" href="/wiki/ClassFileWriter">ClassFileWriter?</a>.add(<a class="missing wiki" rel="nofollow" href="/wiki/ClassFileWriter">ClassFileWriter?</a>.java:541) at org.mozilla.classfile.<a class="missing wiki" rel="nofollow" href="/wiki/ClassFileWriter">ClassFileWriter?</a>.addLoadConstant(<a class="missing wiki" rel="nofollow" href="/wiki/ClassFileWriter">ClassFileWriter?</a>.java:601) at org.mozilla.classfile.<a class="missing wiki" rel="nofollow" href="/wiki/ClassFileWriter">ClassFileWriter?</a>.addPush(<a class="missing wiki" rel="nofollow" href="/wiki/ClassFileWriter">ClassFileWriter?</a>.java:837) at org.mozilla.javascript.optimizer.<a class="missing wiki" rel="nofollow" href="/wiki/BodyCodegen">BodyCodegen?</a>.visitSpecialCall(Codegen.java:2571) at org.mozilla.javascript.optimizer.<a class="missing wiki" rel="nofollow" href="/wiki/BodyCodegen">BodyCodegen?</a>.generateExpression(Codegen.java:1763) at org.mozilla.javascript.optimizer.<a class="missing wiki" rel="nofollow" href="/wiki/BodyCodegen">BodyCodegen?</a>.visitSetProp(Codegen.java:3743) at org.mozilla.javascript.optimizer.<a class="missing wiki" rel="nofollow" href="/wiki/BodyCodegen">BodyCodegen?</a>.generateExpression(Codegen.java:2118) at org.mozilla.javascript.optimizer.<a class="missing wiki" rel="nofollow" href="/wiki/BodyCodegen">BodyCodegen?</a>.generateStatement(Codegen.java:1660) at org.mozilla.javascript.optimizer.<a class="missing wiki" rel="nofollow" href="/wiki/BodyCodegen">BodyCodegen?</a>.generateStatement(Codegen.java:1510) at org.mozilla.javascript.optimizer.<a class="missing wiki" rel="nofollow" href="/wiki/BodyCodegen">BodyCodegen?</a>.generateBodyCode(Codegen.java:1181) at org.mozilla.javascript.optimizer.Codegen.generateCode(Codegen.java:285) at org.mozilla.javascript.optimizer.Codegen.compileToClassFile(Codegen.java:157) at org.mozilla.javascript.optimizer.Codegen.compile(Codegen.java:67) at org.mozilla.javascript.Context.compileImpl(Context.java:2327) at org.mozilla.javascript.Context.compileString(Context.java:1323) at org.mozilla.javascript.Context.compileString(Context.java:1312) at org.mozilla.javascript.tools.shell.Main.loadScriptFromSource(Main.java:500) at org.mozilla.javascript.tools.shell.Main.processFileSecure(Main.java:439) at org.mozilla.javascript.tools.shell.Main.processFile(Main.java:406) at org.mozilla.javascript.tools.shell.Main.processSource(Main.java:397) at org.mozilla.javascript.tools.shell.Main.processFiles(Main.java:181) at org.mozilla.javascript.tools.shell.Main$IProxy.run(Main.java:102) at org.mozilla.javascript.Context.call(Context.java:540) at org.mozilla.javascript.<a class="missing wiki" rel="nofollow" href="/wiki/ContextFactory">ContextFactory?</a>.call(<a class="missing wiki" rel="nofollow" href="/wiki/ContextFactory">ContextFactory?</a>.java:447) at org.mozilla.javascript.tools.shell.Main.exec(Main.java:164) at org.mozilla.javascript.tools.shell.Main.main(Main.java:142)</p></blockquote>
<p>Here are a few posts you can find when you do a web search that are related to this issue (though don&#8217;t seem to offer a solution):</p>
<ul>
<li>http://markmail.org/message/ieuv5bnlddhufmdm#query:java.lang.IllegalArgumentException%3A%20out%20of%20range%20index+page:1+mid:ortmi3uehrzdrhcq+state:results</li>
<li>http://trac.dojotoolkit.org/ticket/2896</li>
</ul>
<p>This can be extremely frustrating. For example, if you are a Dojo ShrinkSafe user, you know ShrinkSafe works because you have used it millions of times on many projects successfully. But on a certain situations, you will run into the above problem. When you search specifically for this ShrinkSafe problem, <a href="http://dojotoolkit.org/node/188">here</a> is the best that I can find:</p>
<p><em>&#8220;While it&#8217;s not recommended that you develop 2MB JS files, it seems that it *does* happen, and it&#8217;s about the time that your files get this large that a project (naturally!) turns to the Dojo compressor. Unfortunantly, the default set of arguments doesn&#8217;t hold up to a file this big, and strange exceptions result. Here is a modified recipe for use with the kinds of files that really, *really* need the Dojo compressor:<br />
java -Xmn100M -Xms500M -Xmx500M -jar custom_rhino.jar -opt -1 -c HUGE.js &gt; smaller.js</em><br />
&#8221;</p>
<p>This is not very helpful in my own experience. First of all, there are tons of reasons that Rhino needs to process big JavaScript files (for example, you want to use Rhino to analyze a bunch of JavaScript files concatenated together). Secondly, very little explanation is given about this command line &#8220;magic&#8221;. Thirdly, this command line &#8220;magic&#8221; seems to be misleading because the problem is not related to JVM memory limit (no need to do<em> -Xms500M -Xmx500M</em> in my experience).</p>
<p>The source of the problem is not your code, not Rhino, but rather a Java language limit. See http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html, section 4.10:</p>
<p>&#8220;<em>The amount of code per non-<code>native</code>, non-<code>abstract</code> method is limited to 65536 bytes by the sizes&#8230;</em>&#8221;</p>
<p>Rhino implemented correctly by sticking to the Java language specification. In fact, you can see the following comments from &lt;code&gt;org.mozilla.classfile.ClassFileWriter&lt;code&gt;:</p>
<p>if (attrLength &gt; 65536) {<br />
// See http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html,<br />
// section 4.10, &#8220;The amount of code per non-native, non-abstract<br />
// method is limited to 65536 bytes&#8230;<br />
throw new ClassFileFormatException(<br />
&#8220;generated bytecode for method exceeds 64K limit.&#8221;);<br />
}</p>
<p>The Dojo ShrinkSafe issue is fundamentally caused by this problem. Any other software that relies on Rhino will have this problem too.</p>
<p><strong>2. So What Is the Solution? </strong></p>
<p>The short answer is, well, there is no solution, if you rely on Rhino to compile JavaScript into Java code. Well, Java code has to subject to the 64KB Java language limit.</p>
<p>If you are in desperate need for a solution, you might try to &#8220;pre-process&#8221; your JavaScript code by breaking apart large JavaScript methods into a bunch of smaller methods, which may yield smaller than 64KB Java byte code for each compiled method. -Thought this approach looks really painful.</p>
<p>However, if you are not using Rhino to compile JavaScript to Java, there are easier ways to get around the problem. Rhino does not have to &#8220;compile JavaScript to Java code&#8221;. You can configure Rhino to run at an &#8220;Interpretive mode&#8221;. Given that there is Java byte code involved at all, this limit naturally does not apply. This is simple to do. It takes one line of code:</p>
<p><code>context.setOptimizationLevel(-1);</code></p>
<p>The above set the Rhino Context object to &#8220;interpreative&#8221; mode. See <a href="http://developer.mozilla.org/en/Rhino_Optimization">Rhino Optimization Level </a>for detailed information.</p>
<p><strong>3. Is it time for us to treat the 64KB JVM limit as a bug, rather that a Java language spec item?</strong></p>
<p>In the world of JavaScript, well, it is not usual to have methods that far exceeds the 64KB limit. For example, it is very common these days for JavaScript libraries to wrap a lot of functions inside one parent function for the sake of encapsulation and scoping. For example, <a href="http://www.jquery.com">jQuery </a>wraps all code inside one function block <em>(function(){&#8230;})(). </em>Other JavaScript libraries like Dojo use similar techniques too. In such situations, it is fairly easy to exceed the 64KB limit when compiled into Java byte code.</p>
<p>For dynamic languages, especially languages that developers tend to nest functions inside functions (&#8221;inner function&#8221;), the 64KB limit seems to be awfully low.</p>
<p>Of course, this problem is not unique to JavaScript developers. For example, JSP developers can easily run into this problem too. See http://forums.sun.com/thread.jspa?threadID=472929&amp;messageID=2296445 for an example.</p>
<p>Interesting enough, bug 4262078 at bugs.sun.com, &#8220;<span>Maximum method size is too small (64Kb)</span>&#8220;, is exactly on this issue. See <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4262078">http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4262078</a>. The bug was submitted in 1999. Nine years later, in 2008, we are still not sure whether this will be fixed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coachwei.com/blog/2008/09/01/the-64kb-java-language-problem-lesso-learnd-from-using-rhino-to-process-javascript.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Razor Profiler - An Automated JavaScript Profiling Tool</title>
		<link>http://www.coachwei.com/blog/2008/08/16/razor-profiler-an-automated-javascript-profiling-tool.html</link>
		<comments>http://www.coachwei.com/blog/2008/08/16/razor-profiler-an-automated-javascript-profiling-tool.html#comments</comments>
		<pubDate>Sun, 17 Aug 2008 02:47:55 +0000</pubDate>
		<dc:creator>coachwei</dc:creator>
		
		<category><![CDATA[WebDev]]></category>

		<category><![CDATA[javascript profiling]]></category>

		<category><![CDATA[razor]]></category>

		<category><![CDATA[razor profiler]]></category>

		<guid isPermaLink="false">http://www.coachwei.com/blog/?p=269</guid>
		<description><![CDATA[
    Razor Profiler
    (beta), an online Ajax profiling tool, is available for public review now at http://www.razorspeed.com.


	
    What Is it?


    Razor Profiler(beta) is a web-based Ajax profiling tool to help web developers understand and analyze the runtime behavior of their JavaScript code in [...]]]></description>
			<content:encoded><![CDATA[<p>
    <a href="http://www.razorspeed.com">Razor Profiler</a><br />
    (beta), an online Ajax profiling tool, is available for public review now at http://www.razorspeed.com.
</p>
<p>
	<br/><br />
    <strong>What Is it?</strong>
</p>
<p>
    <a href="http://www.razorspeed.com">Razor Profiler</a>(beta) is a web-based Ajax profiling tool to help web developers understand and analyze the runtime behavior of their JavaScript code in a cross-browser environment. <a href="http://www.razorspeed.com">Razor Profiler</a><br />
    can be access either <a href="http://www.razorspeed.com">online as a service</a>; or be downloaded to run locally. Some Razor Profiler screen shots are shown below:</p>
<style type="text/css">
            .imageListTable {
                text-align: center;
                margin-left: auto;
                margin-right: auto;
                border-collapse: collapse;
                width: 80%;
            }</p>
</style>
<table class="imageListTable">
<tr>
<td>
                        <a href="http://www.razorspeed.com/media/razorDocs/Files.png" title="'Files' Tab" rel="gallery.screenshots"><img class="screenshotImage" src="http://www.razorspeed.com/media/razorDocs/Files200By130.png" border="0" alt="Files Tab" /></a><br />
                        <br/><br />
                        Files Tab
                    </td>
<td>
          <a href="http://www.razorspeed.com/media/razorDocs/TopCallStacks.png" title="Top Call Stacks" rel="gallery.screenshots"><img class="screenshotImage" src="http://www.razorspeed.com/media/razorDocs/TopCallStacks200By130.png" border="0" alt="Top Call Stacks Image" /></a><br />
            <br/><br />
          Top Call Stacks
    </td>
<td>
                        <a href="http://www.razorspeed.com/media/razorDocs/CallStackVisualization.png" title="Call Stack Visualization" rel="gallery.screenshots"><img class="screenshotImage" src="http://www.razorspeed.com/media/razorDocs/CallStackVisualization200By130.png" border="0" alt="Call Stack Visualization" /></a><br />
                        <br/><br />
                        Call Stack Visualization
                    </td>
</tr>
</table>
<p>
    <br/><br />
    <strong>Why Razor Profiler?</strong>
</p>
<p>
    The amount of JavaScript code on the client side is increasing significantly with the growing popularity of Ajax and Web 2.0.<br />
    Web developers rely on JavaScript heavily these days in order to deliver a richer user experience.<br />
    Including a either home-grown or third party JavaScript library and application specific code, today&#8217;s web applications can easily have several thousand lines of JavaScript code, or even tens of thousands of lines.<br />
    The footprint of client side JavaScript<br />
    can range from  tens of kilobytes to hundreds of kilobytes. This amount of JavaScript can do magic to application functionality and user experience, but they also introduce many questions.
</p>
<p>
    As an application developer:<br />
    <UL><br />
        <LI><br />
            How do you measure the runtime behavior of your code on the vast array of client platform and browser combinations?<br />
        </LI><br />
        <LI><br />
            Do you know why the same code works well on one browser but performs very poorly on a different browser?<br />
        </LI><br />
        <LI><br />
            Do you know whose code is causing problems, yours, or a third party library?<br />
        </LI><br />
        <LI><br />
            Do you know exactly where is the performance bottleneck?<br />
        </LI><br />
    </UL><br />
    If you are a JavaScript library developer, it is even more important for you to understand the runtime behavior of your code since that it will be used by  other developers in many different ways.
</p>
<p>
    However, there is no easy way to obtain the answers to the above questions. It is difficult to study the runtime behavior of Javascript applications in a cross-browser environment:
</p>
<ul>
<li>
        Different browsers (Internet Explorer, FireFox, Safari, etc) have different runtime behaviors. The same code can behave very differently on different browsers;
    </li>
<li>
        Lack of tooling that supports JavaScript debugging and profiling.  JavaScript has evolved from being perceived as a &#8220;toy language&#8221; to be a heavily used mainstream programming language for writing web applications, but JavaScript tooling has not caught up yet;
    </li>
</ul>
<p>
    Razor Profiler aims to help solve this problem. Razor Profiler is JavaScript profiling tool<br />
    that aims to make it really easy for web developers to profile their Ajax code in a cross browser<br />
    environment.
</p>
<p>
    <br/><br />
    <Strong>Razor Profiler Features</Strong>
</p>
<p>
    <a href="http://www.razorspeed.com/index.php/what-is-it/what-is-razor-profiler">Razor Profiler</a><br />
    automates JavaScript profiling:
</p>
<ul>
<li>
        <b>Automation</b>: no application code change required. Razor Profiler automatically collects all the necessary data and presents them to web developers for analysis.
    </li>
<li>
        <b>Runs on any browser</b>: web developers can profile any JavaScript application on any browser. There is nothing to install on the client side.
    </li>
<li>
        <b>Rich lexical analysis</b>: Razor Profiler presents rich lexcial information about the application, such as file information (number, response status, size, mimetype, percentage, etc),<br />
        tokens (size, file, percent, count), and functions (size, file, name&#8230;), etc;
    </li>
<li>
        <b>Profile scenario recording</b>: Razor Profile enables web developers to selectively record the scenarios that they are interested in. Only recorded scenarios will be used in analysis.
    </li>
<li>
        <b>Call stack analysis</b>: for each recorded scenario, Razor Profiler presents all the call stacks in the order of their occurence. For each call stacks,  web developers can drill into it to find out<br />
        the duration of the stack, all the function calls of this stack and the duration of each call.
    </li>
<li>
        <b>Function analysis</b>: For each JavaScript function in the application, Razor Profile presents the number of times it has been invoked, the duration of each invocation, and  the call stacks that invoked this function.
    </li>
<li>
        <b>Data visualization with graphing and charting</b>: Razor Profiler presents  top call stacks, top function calls of each stack, top recorded scenarios, etc. using visual charts and graphs to help web developers<br />
        better understand the runtime behavior of their application. For example, each call stack is visualized as an intuitive Gantt chart.
    </li>
</ul>
<p>some Razor Profiler screen shots are available <a href="http://www.razorspeed.com/index.php/screen-shots">here</a>. </p>
<p>
    <br/><br />
    <strong>How Does Razor Profiler Work?</strong>
</p>
<p><a href="http://www.razorspeed.com/index.php/what-is-it/what-is-razor-profiler">Razor Profiler</a><br />
composes of a server component that runs inside a standard Java EE Servlet engine, and a JavaScript-based client component that runs inside any browser. Once you have Razor server started, you can profile your JavaScript application by entering the start URL of your application into Razor Profiler and run through your test scenarios.<br />
Razor Profiler will automatically record  data and visualize them for your analysis. There is no client side installation, browser configuration change or application code change required.<br />
In order to achieve this, Razor Profiler goes through five  different phases:<br />
<UL><br />
    <LI><br />
        <b>Application retrieval</b>: Once a web developer enters the application start URL into Razor Profiler, Razor Profiler client component (&#8221;the client&#8221;) will send this URL to Razor Profiler server component (&#8221;the server&#8221;).<br />
        The server performs the actually retrieval of this URL. After additional server processing (such as lexical analysis and code injection, see below), the retrieved content is sent to the client side to be displayed in a new browser window. For the developer point of view, the application is launched and running<br />
        in this new browser window.<br />
        <br />
        In this process, Razor Profiler Server is acting like a &#8220;proxy server&#8221;. But it is not really a &#8220;proxy server&#8221; and there is no need for developers to re-configure their browser proxy settings.<br />
    </LI><br />
    <LI><br />
        <b>Lexical analysis</b>:<br />
        Once the server retrieves the application URL, it performs lexical analysis of the returned content by identifying and analyzing JavaScript files, functions, and tokens,etc. The result is sent to the client<br />
        for display.<br />
    </LI><br />
    <LI><br />
        <b>Code injection</b>: Upon lexical analysis of JavaScript code, the server injects &#8220;probe&#8221; code into the application&#8217;s JavaScript sources before returning them to the client. These injected &#8220;probes&#8221; enable<br />
        automatic collection of application runtime data, and saves developers from doing so manually.<br />
    </LI><br />
    <LI><br />
        <b>Runtime data capture</b>: Once the application&#8217;s JavaScript code is running on the client side and as developers run through desired profile scenarios, the injected &#8220;probes&#8221; automcally<br />
        collect all the necessary data to Razor Profiler Client.<br />
    </LI><br />
    <LI><br />
        <b>Data analysis</b>: When the developer finishes recording scenarios and starts data analysis, Razor Profiler client performs analysis of all the collected data and presents the results.<br />
    </LI><br />
</UL></p>
<p>
    <br/><br />
    <strong>How To Get Razor Profiler?</strong>
</p>
<p>
    Just go to <a href="http://www.razorspeed.com" title="RazorSpeed ">http://www.razorspeed.com</a><br />
    and download it. Follow the installation instructions to install Razor Profiler server. Or, you can try it online as  an <a href="http://www.razorspeed.com" title="Razor Profiler Online">online service</a>.<br />
	Feel free to post comments at <a href="http://www.razorspeed.com/index.php/support">Razor Profiler online forum</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.coachwei.com/blog/2008/08/16/razor-profiler-an-automated-javascript-profiling-tool.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>OpenAjax Publishes Future Browser Feature Wish List Results</title>
		<link>http://www.coachwei.com/blog/2008/07/17/openajax-publishes-future-browser-feature-wish-list-results.html</link>
		<comments>http://www.coachwei.com/blog/2008/07/17/openajax-publishes-future-browser-feature-wish-list-results.html#comments</comments>
		<pubDate>Thu, 17 Jul 2008 13:57:32 +0000</pubDate>
		<dc:creator>coachwei</dc:creator>
		
		<category><![CDATA[WebDev]]></category>

		<category><![CDATA[Ajax]]></category>

		<category><![CDATA[Comet]]></category>

		<category><![CDATA[Open Web]]></category>

		<category><![CDATA[OpenAjax]]></category>

		<category><![CDATA[SVG]]></category>

		<guid isPermaLink="false">http://www.coachwei.com/blog/?p=268</guid>
		<description><![CDATA[What does the Ajax community want from future browsers? How are these different requests prioritized? Web developers have done amazing things with Ajax for both Web 1.0 and Web 2.0 applications, but what barriers need to be removed to enable the next generation of browser-based innovations? The future of Ajax runtime environments matters more than [...]]]></description>
			<content:encoded><![CDATA[<p>What does the Ajax community want from future browsers? How are these different requests prioritized? Web developers have done amazing things with Ajax for both Web 1.0 and Web 2.0 applications, but what barriers need to be removed to enable the next generation of browser-based innovations? The future of Ajax runtime environments matters more than ever today.</p>
<p>In late 2007, OpenAjax Alliance formed Runtime Task Force (<a class="external free" title="http://www.openajax.org/member/wiki/Runtime" rel="nofollow" href="http://www.openajax.org/member/wiki/Runtime">http://www.openajax.org/member/wiki/Runtime</a>) to address this community concern. The goal is to collect, articulate, and prioritize key issues from the Ajax community, and communicate them to browser vendors. This will help educate the community in large, help browser vendors better plan for their product roadmap, and help developers better use Ajax.</p>
<p>There are other great rich Web UI technology initiatives such as W3C’s HTML5, CSS3 and SVG. The OpenAjax browser wish list is not intended to compete with these initiatives, but instead complements them by capturing and communicating the views of the web development community (the folks who are “users” of Ajax techniques).</p>
<h2>The Process</h2>
<p>OpenAjax Runtime initiative used a two phased process. A special wiki site &lt;a href=&#8221;<a class="external free" title="http://www.openajax.org/runtime/wiki/Main_Page" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Main_Page">http://www.openajax.org/runtime/wiki/Main_Page</a> <a class="external free" title="http://www.openajax.org/runtime/wiki/Main_Page" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Main_Page">http://www.openajax.org/runtime/wiki/Main_Page</a>] was set up to facilitate communication and collaboration.</p>
<p>In Phase I, OpenAjax Alliance collected an initial list of feature requests. This is largely done by researching blogs, meetings with OpenAjax members and Ajax experts, and interviewing leading Ajax toolkits.</p>
<p>The initial wish list was announced in April 2008 for community review and feedback. A group of industry experts were being actively approached for feedback (see &lt;a href=&#8221;<a class="external free" title="http://www.openajax.org/runtime/wiki/Phase_I_Voting" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Phase_I_Voting">http://www.openajax.org/runtime/wiki/Phase_I_Voting</a>&#8221; title=&#8221;Phase I Voting Phase I Voting wiki page]).</p>
<p>Phase II started in May. The Alliance re-organized the feature lists based on Phase I results. Phase II wish list was put into voting in June. Voting was open to the general community. For each feature request, a voter can vote from 0 to 10 to indicate how strongly the voter feels the need for this request (10 being the most important).</p>
<p>The voting ended on July 13th 2008.</p>
<h2>Feature List Summary</h2>
<p>A total of 55 features were written up by various people in community. These writeups typically cover areas such as what the feature is, background, why the feature is important, possible solutions/recommended approaches for this feature, references, etc.</p>
<p>As a result of community feedback, some features are classified into “InActive”. For Phase II voting, there is a list of 37 active features. The current feature request list is:</p>
<p><strong>Security features</strong></p>
<ul>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/Better_Security_for_Cross-site_Scripts" href="http://www.openajax.org/runtime/wiki/Better_Security_for_Cross-site_Scripts">Better Security for Cross-site Scripts</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/Stronger_Cross-site_Request_Forgery_Protection" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Stronger_Cross-site_Request_Forgery_Protection">Stronger Cross-site Request Forgery Protection</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/Better_IFrames_Better_Sandboxing" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Better_IFrames_Better_Sandboxing">Better IFrames Better Sandboxing</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/Native_JSON_Parsing" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Native_JSON_Parsing">Native JSON Parsing</a></li>
</ul>
<p><a name="Client-server_communications_features"></a><br />
<strong>Client-server communications features</strong></p>
<ul>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/The_Two_HTTP_Connection_Limit_Issue" rel="nofollow" href="http://www.openajax.org/runtime/wiki/The_Two_HTTP_Connection_Limit_Issue">&#8220;The Two HTTP Connection Limit&#8221; Issue</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/Persistent_Connections_Issue" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Persistent_Connections_Issue">&#8220;Persistent Connections&#8221; Issue</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/XHR_Connection_Length_Advice" rel="nofollow" href="http://www.openajax.org/runtime/wiki/XHR_Connection_Length_Advice">XHR Connection Length Advice</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/Synchronous_XHR_Enhancements" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Synchronous_XHR_Enhancements">Synchronous XHR Enhancements</a></li>
</ul>
<p><strong>HTML5/W3C features</strong></p>
<ul>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/2D_Drawing/Vector_Graphics" rel="nofollow" href="http://www.openajax.org/runtime/wiki/2D_Drawing/Vector_Graphics">2D Drawing/Vector Graphics</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/Video_and_Audio" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Video_and_Audio">Video and Audio</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/Offline_Support" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Offline_Support">Offline Support</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/Mutation_Events" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Mutation_Events">Mutation Events</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/XPath_Support" rel="nofollow" href="http://www.openajax.org/runtime/wiki/XPath_Support">XPath Support</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/Component_Model_XBL_HTC" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Component_Model_XBL_HTC">Component Model XBL HTC</a></li>
</ul>
<p><strong>CSS features</strong></p>
<ul>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/Gradient_Fill" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Gradient_Fill">Gradient Fill</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/Blur_Effect" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Blur_Effect">Blur Effect</a></li>
</ul>
<p><a name="Rendering.2Finteraction.2Fevent_handling_features"></a><br />
<strong>Rendering/interaction/event handling features</strong></p>
<ul>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/Rich_Text_Editing" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Rich_Text_Editing">Better Support for Rich Text Editing</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/Better_APIs_Positioning_Styling" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Better_APIs_Positioning_Styling">Better APIs about positioning and styling</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/Better_UI_Layout" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Better_UI_Layout">Better UI Layout Support</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/IE's_overflow:auto_problem" rel="nofollow" href="http://www.openajax.org/runtime/wiki/IE's_overflow:auto_problem">IE 6 and IE 7: &#8220;overflow: auto&#8221; problem</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/Event_Transparency_API" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Event_Transparency_API">Event Transparency API</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/OnOverflow_Event" rel="nofollow" href="http://www.openajax.org/runtime/wiki/OnOverflow_Event">Event notification for &#8220;content overflow&#8221;</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/Drag_Drop_Copy_Paste" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Drag_Drop_Copy_Paste">Drag Drop Copy Paste</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/Override_Back_Button_Event" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Override_Back_Button_Event">Override Back Button Event</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/Browser_Unresponsive_Mode_Enhancements" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Browser_Unresponsive_Mode_Enhancements">Browser &#8220;Unresponsive Mode&#8221; Enhancements</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/Enhanced_support_for_dialogs" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Enhanced_support_for_dialogs">Enhanced support for dialogs</a></li>
</ul>
<p><strong>Performance features</strong></p>
<ul>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/%22Array%22_Operation_Performance" rel="nofollow" href="http://www.openajax.org/runtime/wiki/%22Array%22_Operation_Performance">&#8220;Array&#8221; Operation Performance In All Browsers</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/DOM_Performance" rel="nofollow" href="http://www.openajax.org/runtime/wiki/DOM_Performance">HTML DOM Operation Performance In General </a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/Matching_Element_Against_CSS_Selector" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Matching_Element_Against_CSS_Selector">Matching Element Against CSS Selector </a></li>
</ul>
<p><strong>JavaScript features</strong></p>
<ul>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/IE_%22Array%22_Sub-classing" rel="nofollow" href="http://www.openajax.org/runtime/wiki/IE_%22Array%22_Sub-classing">IE: Array&#8217;s Can&#8217;t Be Usefully Sub-classed</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/JavaScript_Pause_Release" rel="nofollow" href="http://www.openajax.org/runtime/wiki/JavaScript_Pause_Release">JavaScript Coroutine Support (was Pause Release)</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/Threading_Support" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Threading_Support">Threading Support</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/Client_Element_Hash" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Client_Element_Hash">Hashes for DOM elements and associated API</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/Ajax_Toolkit_Caching" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Ajax_Toolkit_Caching">Ajax toolkit caching</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/Animating_Web_Page_Content" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Animating_Web_Page_Content">Animation of web page content </a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/Better_Testing_Support" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Better_Testing_Support">Better testing support</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/CSS_Object_Model" rel="nofollow" href="http://www.openajax.org/runtime/wiki/CSS_Object_Model">CSS Object Model</a></li>
</ul>
<h2>Community Voting Results</h2>
<p>By July 13, when the voting closed, this initiative has turned out to be a bigger success than expected. Given the amount of effort required to read and understand the vast web technology landscape, and the relatively limited time and resources available to the OpenAjax Alliance Runtime participants, we were hoping for 50 or so people to vote, which would be meaningful to establish a rough idea of what&#8217;s most important to the community.</p>
<p>Voting results are available at:</p>
<ul>
<li><a class="external free" title="http://www.openajax.org/runtime/wiki/Feature_Requests_Summary_Page" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Feature_Requests_Summary_Page">http://www.openajax.org/runtime/wiki/Feature_Requests_Summary_Page</a></li>
<li><a class="external free" title="http://www.openajax.org/runtime/wiki/Phase_II_Voting_Summary" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Phase_II_Voting_Summary">http://www.openajax.org/runtime/wiki/Phase_II_Voting_Summary</a></li>
<li><a class="external free" title="http://www.openajax.org/runtime/wiki/Phase_II_Voting_Details" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Phase_II_Voting_Details">http://www.openajax.org/runtime/wiki/Phase_II_Voting_Details</a></li>
</ul>
<p>Here are some quick statistics:</p>
<ul>
<li>222 people participants;</li>
<li>143 people voted;</li>
<li>55 feature request being written up;</li>
<li>Various industry leaders contributed;</li>
<li>A discussion thread spawns on Slashdot with 628 comments (<a class="external text" title="http://tech.slashdot.org/article.pl?sid=08/06/30/1845201" rel="nofollow" href="http://tech.slashdot.org/article.pl?sid=08/06/30/1845201">http://tech.slashdot.org/article.pl? sid=08/06/30/1845201</a>).</li>
</ul>
<h2>The Top Requested Features</h2>
<p>Among all the feature requests, <a class="external text" title="http://www.openajax.org/runtime/wiki/2D_Drawing/Vector_Graphics" rel="nofollow" href="http://www.openajax.org/runtime/wiki/2D_Drawing/Vector_Graphics">2D Drawing/Vector Graphics</a> is clearly the most desired feature by the community. It received most votes (110 people voted for it), and highest total score (842, over 10% higher than the second feature request). The second top feature request is enhanced security for cross-site scripts. The third and fourth were better APIs for scripting and styling and HTML DOM performance.</p>
<p>The following table shows the top 10 features:</p>
<table border="1" cellspacing="1" cellpadding="1">
<tbody>
<tr>
<th>Feature</th>
<th>Total (#Votes x AvgVote)</th>
<th># Votes</th>
<th>Avg Vote (0-10)</th>
</tr>
<tr>
<td><a class="external text" title="http://www.openajax.org/runtime/wiki/2D_Drawing/Vector_Graphics" rel="nofollow" href="http://www.openajax.org/runtime/wiki/2D_Drawing/Vector_Graphics">2D Drawing/Vector Graphics</a></td>
<td style="TEXT-ALIGN: center">842</td>
<td style="TEXT-ALIGN: center">110</td>
<td style="TEXT-ALIGN: center">7.65</td>
</tr>
<tr>
<td><a class="external text" title="http://www.openajax.org/runtime/wiki/Better_Security_for_Cross-site_Scripts" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Better_Security_for_Cross-site_Scripts">Better Security for Cross-site Scripts</a></td>
<td style="TEXT-ALIGN: center">759</td>
<td style="TEXT-ALIGN: center">102</td>
<td style="TEXT-ALIGN: center">7.44</td>
</tr>
<tr>
<td><a class="external text" title="http://www.openajax.org/runtime/wiki/Better_APIs_Positioning_Styling" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Better_APIs_Positioning_Styling">Better APIs about positioning and styling</a></td>
<td style="TEXT-ALIGN: center">748</td>
<td style="TEXT-ALIGN: center">99</td>
<td style="TEXT-ALIGN: center">7.56</td>
</tr>
<tr>
<td><a class="external text" title="http://www.openajax.org/runtime/wiki/DOM_Performance" rel="nofollow" href="http://www.openajax.org/runtime/wiki/DOM_Performance">HTML DOM Operation Performance In General</a></td>
<td style="TEXT-ALIGN: center">742</td>
<td style="TEXT-ALIGN: center">92</td>
<td style="TEXT-ALIGN: center">8.07</td>
</tr>
<tr>
<td><a class="external text" title="http://www.openajax.org/runtime/wiki/Rich_Text_Editing" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Rich_Text_Editing">Better Support for Rich Text Editing</a></td>
<td style="TEXT-ALIGN: center">693</td>
<td style="TEXT-ALIGN: center">102</td>
<td style="TEXT-ALIGN: center">6.79</td>
</tr>
<tr>
<td><a class="external text" title="http://www.openajax.org/runtime/wiki/The_Two_HTTP_Connection_Limit_Issue" rel="nofollow" href="http://www.openajax.org/runtime/wiki/The_Two_HTTP_Connection_Limit_Issue">The Two HTTP Connection Limit Issue</a></td>
<td style="TEXT-ALIGN: center">690</td>
<td style="TEXT-ALIGN: center">98</td>
<td style="TEXT-ALIGN: center">7.04</td>
</tr>
<tr>
<td><a class="external text" title="http://www.openajax.org/runtime/wiki/Better_UI_Layout" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Better_UI_Layout">Better UI Layout Support</a></td>
<td style="TEXT-ALIGN: center">689</td>
<td style="TEXT-ALIGN: center">96</td>
<td style="TEXT-ALIGN: center">7.18</td>
</tr>
<tr>
<td><a class="external text" title="http://www.openajax.org/runtime/wiki/Native_JSON_Parsing" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Native_JSON_Parsing">Native JSON Parsing</a></td>
<td style="TEXT-ALIGN: center">688</td>
<td style="TEXT-ALIGN: center">107</td>
<td style="TEXT-ALIGN: center">6.43</td>
</tr>
<tr>
<td><a class="external text" title="http://www.openajax.org/runtime/wiki/Persistent_Connections_Issue" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Persistent_Connections_Issue">Persistent Connections Issue</a></td>
<td style="TEXT-ALIGN: center">649</td>
<td style="TEXT-ALIGN: center">95</td>
<td style="TEXT-ALIGN: center">6.83</td>
</tr>
<tr>
<td><a class="external text" title="http://www.openajax.org/runtime/wiki/Video_and_Audio" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Video_and_Audio">Video and Audio</a></td>
<td style="TEXT-ALIGN: center">639</td>
<td style="TEXT-ALIGN: center">99</td>
<td style="TEXT-ALIGN: center">6.46</td>
</tr>
</tbody>
</table>
<p>Here are some general themes that emerge from the runtime initiative:<br />
<strong>Graphics</strong><br />
The top vote getter was <a class="external text" title="http://www.openajax.org/runtime/wiki/2D_Drawing/Vector_Graphics" rel="nofollow" href="http://www.openajax.org/runtime/wiki/2D_Drawing/Vector_Graphics">2D Drawing/Vector Graphics</a>. Ajax developers today are achieving astoundingly rich graphics effects through clever techniques leveraging JavaScript, CSS, images, and whatever vector graphics features they can find (usually, SVG, VML and Canvas), but browser differences are a major pain point among Ajax developers. Mozilla, WebKit and Opera support both Canvas and SVG with good interoperability (although Mozilla does not yet support SVG animations). IE is the holdout. The call-to-action is for all browsers, particularly IE, to support both of the industry standards for 2D vector graphics, SVG (the DOM-based standard) and Canvas (the procedural-based standard).<br />
<strong>Security</strong><br />
Web security is an important topic for leading Ajax developers. The second top vote getter was <a class="external text" title="http://www.openajax.org/runtime/wiki/Better_Security_for_Cross-site_Scripts" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Better_Security_for_Cross-site_Scripts">Better Security for Cross-Site Scripts</a> (XSS), but other security requests also receiving high votes, such as <a class="external text" title="http://www.openajax.org/runtime/wiki/Stronger_Cross-site_Request_Forgery_Protection" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Stronger_Cross-site_Request_Forgery_Protection">Strong Cross-Site Request Forgery Protection</a> (which it turns out was the 11th top voter-getter). The perception of the moderators is that it’s not just XSS, but that the community cares about all aspects of ensuring that the Web is secure, and in fact more secure than it is today. Recently, Mozilla has authored a proposal that might help make the Web more secure: <a class="external free" title="http://people.mozilla.com/~bsterne/site-security-policy/" rel="nofollow" href="http://people.mozilla.com/~bsterne/site-security-policy/">http://people.mozilla.com/~bsterne/site-security-policy/</a>. Note that Native JSON Parsing can be considered a security feature because without it Web developers are more inclined to use JavaScript eval() to process JSON data, which might allow for XSS attacks.<br />
<strong>Better low-level CSS and DOM support for layout</strong><br />
Two of the top vote-getters were <a class="external text" title="http://www.openajax.org/runtime/wiki/Better_APIs_Positioning_Styling" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Better_APIs_Positioning_Styling">Better APIs for positioning and styling </a>and <a class="external text" title="http://www.openajax.org/runtime/wiki/Better_UI_Layout" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Better_UI_Layout">Better UI Layout Support</a>. These requests come from the widget developers within Ajax toolkit projects who design Ajax-based UI controls by taking advantage of what the browser gives them, such as DOM, CSS, images, and table layout. They often run into walls, and their jobs could be much easier (and performance much faster) if the browser included a small number of additional (relatively small) features, such as stretchable layout (e.g., flexbox in XUL) and the ability to determine the location and size of objects (and containers) within the page.<br />
<strong>Performance</strong><br />
The top vote-getter in the performance area was <a class="external text" title="http://www.openajax.org/runtime/wiki/DOM_Performance" rel="nofollow" href="http://www.openajax.org/runtime/wiki/DOM_Performance">HTML DOM Performance in General</a>. In discussions over the past year with leading Ajax developers, the moderators believe that the Ajax community wants performance improvements in all aspects of the browser runtime, including DOM, JavaScript, and rendering, but DOM performance was singled out by the community because Ajax toolkit developers have found that DOM access is the top performance barrier today. The key high-level message is keep making the browsers faster, but even blazingly fast JavaScript isn’t going to help if making DOM calls is too slow.<br />
<strong>Rich text editing</strong><br />
Various people in the Ajax community want to move desktop-like document editing into the browser. However, the contributors to this feature request did not outline a detailed strategy for how to accomplish this in future browser. The takeaway is that the Ajax community wants <a class="external text" title="http://www.openajax.org/runtime/wiki/Rich_Text_Editing" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Rich_Text_Editing">Better Support for Rich Text Editing </a>, and hopefully one of the browser teams will push the envelope in this direction and send standards proposals so that the other browsers can also provide this functionality.</p>
<p><strong>Comet (server push)</strong><br />
Two of the top vote-getters were <a class="external text" title="http://www.openajax.org/runtime/wiki/The_Two_HTTP_Connection_Limit_Issue" rel="nofollow" href="http://www.openajax.org/runtime/wiki/The_Two_HTTP_Connection_Limit_Issue">The Two HTTP Connection Limit Issue</a> and <a class="external text" title="http://www.openajax.org/runtime/wiki/Persistent_Connections_Issue" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Persistent_Connections_Issue">Persistent Connections Issue</a>. The underlying requirement is that many Ajax applications, such as dashboards, require an efficient and robust mechanism for having the server send data to the client on an event-driven basis. Today, server push in Ajax is often accomplished using “Comet” techniques such as long-lived HTTP connections, but the Ajax community would prefer if server push was a native browser feature.</p>
<p><strong>Video and Audio</strong><br />
<a class="external text" title="http://www.openajax.org/runtime/wiki/Video_and_Audio" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Video_and_Audio">Video and Audio</a> also receiving strong support, coming in as the 10th-most requested feature.</p>
<h2>New Features (too late for voting)</h2>
<p>Participants identified the following 6 new features, which were added to the wiki too late for the voting process, which means that we were not able to poll the community to determine relative importance versus other features:</p>
<ul>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/ECMA4_JavaScript2" rel="nofollow" href="http://www.openajax.org/runtime/wiki/ECMA4_JavaScript2">ECMA4 JavaScript2</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/Multiple_files_field" rel="nofollow" href="http://www.openajax.org/runtime/wiki/Multiple_files_field">Field to input multiple files</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/File_upload_statistics" rel="nofollow" href="http://www.openajax.org/runtime/wiki/File_upload_statistics">Allow JavaScript access to file upload statistics</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/UserPreferences_Object" rel="nofollow" href="http://www.openajax.org/runtime/wiki/UserPreferences_Object">Allow user finer control over rich content than Javascript On/Off</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/MemoryFootprint" rel="nofollow" href="http://www.openajax.org/runtime/wiki/MemoryFootprint">Memory Footprint</a></li>
<li><a class="external text" title="http://www.openajax.org/runtime/wiki/SemanticTagging" rel="nofollow" href="http://www.openajax.org/runtime/wiki/SemanticTagging">Enforce Semantic Tagging of Data transmittedfrom browser</a></li>
</ul>
<h2>Next Steps</h2>
<p>The next step is to communicate with browser vendors. We have had calls with some of the browser vendors such as Microsoft IE team during Phase I. OpenAjax Alliance will try to get in touch (or continue) the dialog with browser vendors to convey what the community is looking for.</p>
<h2>Conclusion</h2>
<p>Ajax is becoming at core for developing web applications. The stake associated with Ajax runtime environments is higher than ever.</p>
<p>The open community process works. Despite various challenges, the community demonstrated strong interest for a better ecosystem for Ajax going forward.</p>
<p>The list of feature requests makes a lot of sense from the web development community point of view. They range from security, performance, Comet, CSS, etc. Some of them do overlap with features that are being specified by other initiatives such as HTML 5 and SVG. They will empower web developers to deliver much better applications over the web, and significantly enhance the power of the web.</p>
<p>Although we have identified the top 10 feature requests, the browser teams should study the entire list because all features might represent critical requirements or are just great ideas for advancing the Web. It is possible that some of the features that received fewer votes are critical to a particular but important niche or that only a subset of participants are close enough to the bleeding edge to see an impending but critical requirement.</p>
<p>It is worthy of pointing out that “vector graphics” is voted as the top request. It is time for all browser vendors to support standard vector graphics. Vector graphics support is highly scattered today. Open standards such as SVG and Canvas are supported by some browsers but not the others. The community is clearly demanding this feature, putting it even above security and performance.</p>
<h2>Acknowledgement</h2>
<p>The following is a partial list of people whose contributions made significant difference for this initiative:</p>
<p>Alex Russell (Dojo Foundation), Jack Slocum (Ext JS), Joe Walker (DWR), Douglas Crockford (Yahoo), Dylan Schiemann (Dojo and Sitepen), Bertrand Le Roy (Microsoft), Kris Zyp (Sitepen), Andrew Dupont (Prototype), Sam Lie (jQuery), Yehuda Katz (jQuery), Krishna Sankar (Cisco), Brad Neuberg(Google), Greg Wilkins (Webtide).</p>
<p>OpenAjax Runtime Task Force members are: Coach Wei (Chair, Nexaweb), Bertrand Le Roy (Microsoft), Jon Ferraiolo (IBM), Adam Peller (IBM), Haik Sahakian (Fidelity), Ted Goddard (IceSoft), Simone Fabiano (LightStreamer), and Krishna Sankar (Cisco).</p>
<p>Special thanks to Jon Ferraiolo (IBM) for coordinating and implementing the site infrastructure that made this initiative possible.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coachwei.com/blog/2008/07/17/openajax-publishes-future-browser-feature-wish-list-results.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Time to Vote - Ajax Feature Wish List</title>
		<link>http://www.coachwei.com/blog/2008/06/23/ajax-feature-wish-list.html</link>
		<comments>http://www.coachwei.com/blog/2008/06/23/ajax-feature-wish-list.html#comments</comments>
		<pubDate>Mon, 23 Jun 2008 16:14:47 +0000</pubDate>
		<dc:creator>coachwei</dc:creator>
		
		<category><![CDATA[WebDev]]></category>

		<category><![CDATA[Ajax]]></category>

		<category><![CDATA[OpenAjax]]></category>

		<guid isPermaLink="false">http://www.coachwei.com/blog/?p=266</guid>
		<description><![CDATA[What would you like to see in the next generation of browsers? Can you help to make the web a slightly better place than where it is today?
Various people from the Ajax community have put together a good list of feature requests (a total of over 40), collected at OpenAjax Runtime Task Force . Now [...]]]></description>
			<content:encoded><![CDATA[<p>What would you like to see in the next generation of browsers? Can you help to make the web a slightly better place than where it is today?</p>
<p>Various people from the Ajax community have put together a good list of feature requests (a total of over 40), collected at <a href="http://www.openajax.org/runtime/wiki/Main_Page">OpenAjax Runtime Task Force</a> . Now it is time for everyone to cast your vote!</p>
<p>Voting is easy. Just sign up at <a href="http://www.openajax.org/runtime/wiki/Special:Userlogin">OpenAjax Wiki</a> . Then go to<br />
<a href="http://www.openajax.org/runtime/wiki/Phase_II_Voting">the voting page</a> , select the priority number from a dropdown box for features that you care.  -That&#8217;s it. Your results will be calculated and displayed in immediately. Once you select a priority item from the dropdown box, your selection is immediately sent to the server and recorded int the database. A nice use case of the asynchronous feature of Ajax.  Of course, you can always come back and make changes. (Thanks Jon for  making the voting process really easy).</p>
<p>At the moment of this writing, a few people have casted their votes. The current result is below<br />
(you can see the latest result from <a href="http://www.openajax.org/runtime/wiki/Feature_Requests_Summary_Page">this summary page</a> ):</p>
<table border="1" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<th rowspan="2">Feature</th>
<th colspan="3">Phase II Votes</th>
</tr>
<tr>
<th>#Votes</th>
<th>AvgVote (0-10)</th>
<th>Total<br />
(#Votes*AvgVote)</th>
</tr>
<tr>
<td style="background-color: #eeeeff;" colspan="4"><strong>Security features</strong></td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/Better_Security_for_Cross-site_Scripts">Better Security for Cross-site Scripts</a> (7)</td>
<td style="text-align: center;">12</td>
<td style="text-align: center;">7.17</td>
<td style="text-align: center;">86.00</td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/Stronger_Cross-site_Request_Forgery_Protection">Stronger Cross-site Request Forgery Protection</a> (0)</td>
<td style="text-align: center;">11</td>
<td style="text-align: center;">7.27</td>
<td style="text-align: center;">80.00</td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/Better_IFrames_Better_Sandboxing">Better IFrames Better Sandboxing</a> (3)</td>
<td style="text-align: center;">12</td>
<td style="text-align: center;">6.83</td>
<td style="text-align: center;">82.00</td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/Native_JSON_Parsing">Native JSON Parsing</a> (4)</td>
<td style="text-align: center;">11</td>
<td style="text-align: center;">7.45</td>
<td style="text-align: center;">82.00</td>
</tr>
<tr>
<td style="background-color: #eeeeff;" colspan="4"><strong>Client-server communications features</strong></td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/The_Two_HTTP_Connection_Limit_Issue">The Two HTTP Connection Limit Issue</a> (6)</td>
<td style="text-align: center;">12</td>
<td style="text-align: center;">8.92</td>
<td style="text-align: center;">107.00</td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/Persistent_Connections_Issue">Persistent Connections Issue</a> (7)</td>
<td style="text-align: center;">12</td>
<td style="text-align: center;">7.42</td>
<td style="text-align: center;">89.00</td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/XHR_Connection_Length_Advice">XHR Connection Length Advice</a> (1)</td>
<td style="text-align: center;">10</td>
<td style="text-align: center;">4.60</td>
<td style="text-align: center;">46.00</td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/Synchronous_XHR_Enhancements">Synchronous XHR Enhancements</a> (1)</td>
<td style="text-align: center;">10</td>
<td style="text-align: center;">3.60</td>
<td style="text-align: center;">36.00</td>
</tr>
<tr>
<td style="background-color: #eeeeff;" colspan="4"><strong>HTML5/W3C features</strong></td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/2D_Drawing/Vector_Graphics">2D Drawing/Vector Graphics</a> (4)</td>
<td style="text-align: center;">12</td>
<td style="text-align: center;">8.08</td>
<td style="text-align: center;">97.00</td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/Video_and_Audio">Video and Audio</a> (3)</td>
<td style="text-align: center;">11</td>
<td style="text-align: center;">5.45</td>
<td style="text-align: center;">60.00</td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/Offline_Support">Offline Support</a> (7)</td>
<td style="text-align: center;">11</td>
<td style="text-align: center;">6.73</td>
<td style="text-align: center;">74.00</td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/Mutation_Events">Mutation Events</a> (2)</td>
<td style="text-align: center;">11</td>
<td style="text-align: center;">7.00</td>
<td style="text-align: center;">77.00</td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/XPath_Support">XPath Support</a> (0)</td>
<td style="text-align: center;">11</td>
<td style="text-align: center;">3.82</td>
<td style="text-align: center;">42.00</td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/Component_Model_XBL_HTC">Component Model XBL HTC</a> (1)</td>
<td style="text-align: center;">9</td>
<td style="text-align: center;">5.00</td>
<td style="text-align: center;">45.00</td>
</tr>
<tr>
<td style="background-color: #eeeeff;" colspan="4"><strong>CSS features</strong></td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/Gradient_Fill">Gradient Fill</a> (1)</td>
<td style="text-align: center;">12</td>
<td style="text-align: center;">5.58</td>
<td style="text-align: center;">67.00</td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/Blur_Effect">Blur Effect</a> (1)</td>
<td style="text-align: center;">12</td>
<td style="text-align: center;">5.42</td>
<td style="text-align: center;">65.00</td>
</tr>
<tr>
<td style="background-color: #eeeeff;" colspan="4"><strong>Rendering/interaction/event handling features</strong></td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/Rich_Text_Editing">Better Support for Rich Text Editing</a> (5)</td>
<td style="text-align: center;">11</td>
<td style="text-align: center;">6.00</td>
<td style="text-align: center;">66.00</td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/Better_APIs_Positioning_Styling">Better APIs about positioning and styling</a> (3)</td>
<td style="text-align: center;">11</td>
<td style="text-align: center;">7.45</td>
<td style="text-align: center;">82.00</td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/Better_UI_Layout">Better UI Layout Support</a> (2)</td>
<td style="text-align: center;">11</td>
<td style="text-align: center;">6.91</td>
<td style="text-align: center;">76.00</td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/IE%27s_overflow:auto_problem">IE 6 and IE 7: overflow:auto problem</a> (0)</td>
<td style="text-align: center;">9</td>
<td style="text-align: center;">5.56</td>
<td style="text-align: center;">50.00</td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/Event_Transparency_API">Event Transparency API</a> (1)</td>
<td style="text-align: center;">9</td>
<td style="text-align: center;">5.67</td>
<td style="text-align: center;">51.00</td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/OnOverflow_Event">Event notification for content overflow</a> (0)</td>
<td style="text-align: center;">8</td>
<td style="text-align: center;">5.00</td>
<td style="text-align: center;">40.00</td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/Drag_Drop_Copy_Paste">Drag Drop Copy Paste</a> (1)</td>
<td style="text-align: center;">10</td>
<td style="text-align: center;">6.10</td>
<td style="text-align: center;">61.00</td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/Override_Back_Button_Event">Override Back Button Event</a> (1)</td>
<td style="text-align: center;">10</td>
<td style="text-align: center;">4.80</td>
<td style="text-align: center;">48.00</td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/Browser_Unresponsive_Mode_Enhancements">Browser Unresponsive Mode Enhancements</a> (1)</td>
<td style="text-align: center;">10</td>
<td style="text-align: center;">6.90</td>
<td style="text-align: center;">69.00</td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/Enhanced_support_for_dialogs">Enhanced support for dialogs</a> (1)</td>
<td style="text-align: center;">10</td>
<td style="text-align: center;">5.60</td>
<td style="text-align: center;">56.00</td>
</tr>
<tr>
<td style="background-color: #eeeeff;" colspan="4"><strong>Performance features</strong></td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/%22Array%22_Operation_Performance">Array Operation Performance In All Browsers</a> (1)</td>
<td style="text-align: center;">10</td>
<td style="text-align: center;">7.20</td>
<td style="text-align: center;">72.00</td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/DOM_Performance">HTML DOM Operation Performance In General</a> (5)</td>
<td style="text-align: center;">12</td>
<td style="text-align: center;">8.00</td>
<td style="text-align: center;">96.00</td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/Matching_Element_Against_CSS_Selector">Matching Element Against CSS Selector</a> (1)</td>
<td style="text-align: center;">10</td>
<td style="text-align: center;">6.90</td>
<td style="text-align: center;">69.00</td>
</tr>
<tr>
<td style="background-color: #eeeeff;" colspan="4"><strong>JavaScript features</strong></td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/IE_%22Array%22_Sub-classing">IE: Array’s Can’t Be Usefully Sub-classed</a> (2)</td>
<td style="text-align: center;">11</td>
<td style="text-align: center;">5.73</td>
<td style="text-align: center;">63.00</td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/JavaScript_Pause_Release">JavaScript Coroutine Support (was Pause Release)</a> (4)</td>
<td style="text-align: center;">10</td>
<td style="text-align: center;">4.40</td>
<td style="text-align: center;">44.00</td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/Threading_Support">Threading Support</a> (3)</td>
<td style="text-align: center;">11</td>
<td style="text-align: center;">5.27</td>
<td style="text-align: center;">58.00</td>
</tr>
<tr>
<td style="background-color: #eeeeff;" colspan="4"><strong>Other features</strong></td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/Client_Element_Hash">Hashes for DOM elements and associated API</a> (1)</td>
<td style="text-align: center;">8</td>
<td style="text-align: center;">4.00</td>
<td style="text-align: center;">32.00</td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/Ajax_Toolkit_Caching">Ajax toolkit caching</a> (3)</td>
<td style="text-align: center;">10</td>
<td style="text-align: center;">4.80</td>
<td style="text-align: center;">48.00</td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/Animating_Web_Page_Content">Animation of web page content</a> (0)</td>
<td style="text-align: center;">9</td>
<td style="text-align: center;">4.89</td>
<td style="text-align: center;">44.00</td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/Better_Testing_Support">Better testing support</a> (1)</td>
<td style="text-align: center;">11</td>
<td style="text-align: center;">5.73</td>
<td style="text-align: center;">63.00</td>
</tr>
<tr>
<td><a href="http://www.openajax.org/runtime/wiki/CSS_Object_Model">CSS Object Model</a> (1)</td>
<td style="text-align: center;">10</td>
<td style="text-align: center;">4.50</td>
<td style="text-align: center;">45.00</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.coachwei.com/blog/2008/06/23/ajax-feature-wish-list.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Fix for WordPress TinyMCE Editor Problem</title>
		<link>http://www.coachwei.com/blog/2008/06/19/fix-for-wordpress-tinymce-editor-problem.html</link>
		<comments>http://www.coachwei.com/blog/2008/06/19/fix-for-wordpress-tinymce-editor-problem.html#comments</comments>
		<pubDate>Thu, 19 Jun 2008 23:17:02 +0000</pubDate>
		<dc:creator>coachwei</dc:creator>
		
		<category><![CDATA[Tips]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://72.167.202.159/blog/?p=258</guid>
		<description><![CDATA[If the visual editor (TinyMCE) in your newly installed Wordpress is not showing up, this maybe a solution to your problem.
First, Make Sure your visual editor is turned on.  In the Wordpress admin, up in the upper right corner, click on your user name, and then make sure “Use the visual editor when writing” [...]]]></description>
			<content:encoded><![CDATA[<p>If the visual editor (TinyMCE) in your newly installed Wordpress is not showing up, this maybe a solution to your problem.</p>
<li><strong>First, Make Sure your visual editor is turned on</strong>.  In the Wordpress admin, up in the upper right corner, click on your user name, and then make sure “Use the visual editor when writing” is checked.</li>
<li>Open a tab or window in a browser, and go to <code>[your site]/wp-includes/js/tinymce/tiny_mce_config.php</code> - if you <strong>don&#8217;t</strong> get a screen full of garbage and errors here, this post is not for you. You have a different problem.</li>
<li>If you do see a lot of garbage from the above url, it most likely mean that there is a compression related problem with your tinyMCE javascript file. The actual compression is done on the server by a file <code>[wp-includes/js/tinymce/tiny_mce_config.php]</code>. This file will compress the tinymce.js files (over 200kB) using gzip and save the compression result to <code>[wp-content/uploads/js_cache]</code> for future loading).  There are various posts you will see from the web such as:</li>
<p><a href="http://wordpress.org/support/topic/165172"><span style="color: #18536d;">WP 2.5 - WYSIWIG Problem - TinyMCE does not start..</span></a><br />
<a href="http://wordpress.org/support/topic/166212"><span style="color: #2583ad;">2.5 and TinyMCE not working in visual mode</span></a><br />
<a href="http://wordpress.org/support/topic/164990"><span style="color: #2583ad;">Visual Editor Not Working on Upgrade</span></a><br />
<a href="http://wordpress.org/support/topic/165449"><span style="color: #18536d;">2.5 Visual Editor/TinyMCE problems</span></a></p>
<p>These posts suggest you modify <code>[tiny_mce_config.php]</code> to turn compression off as a solution to the problem.</p>
<li>What is most like causing the problem is that <code>[tiny_mc_config.php]</code> is actually working fine doing what it is supposed to do, but the content encoding is not set correctly when sending response to the browser. The browser doesn&#8217;t recognize that the returned content is <code>"gzip" </code>content.</li>
<li>The most likely cause is a configuration issue at your <code>[php.ini]</code> file. Find your <code>php.ini</code> and check to see if <code>zlib.output_compression</code> is set to be &#8220;off&#8221;, make sure<br />
<code> zlib.output_compression = On</code></li>
<p>Restart your apache Http server and reload <code>[your site]/wp-includes/js/tinymce/tiny_mce_config.php</code> in your browser, now you should see regular javascript showing up. Then the visual editor should be working from now on.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coachwei.com/blog/2008/06/19/fix-for-wordpress-tinymce-editor-problem.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>GoogleAppEngine -Not Delivering On the Promise So Far</title>
		<link>http://www.coachwei.com/blog/2008/04/08/googleappengine-not-delivering-on-the-promise-so-far.html</link>
		<comments>http://www.coachwei.com/blog/2008/04/08/googleappengine-not-delivering-on-the-promise-so-far.html#comments</comments>
		<pubDate>Tue, 08 Apr 2008 10:36:54 +0000</pubDate>
		<dc:creator>coachwei</dc:creator>
		
		<category><![CDATA[google]]></category>

		<category><![CDATA[Amazon EC2]]></category>

		<category><![CDATA[Google AppEngine]]></category>

		<guid isPermaLink="false">http://72.167.202.159/blog/googleappengine-not-delivering-on-the-promise-so-far/</guid>
		<description><![CDATA[If you haven&#8217;t heard of it yet, Google launched something called &#8220;Google App Engine&#8220;, a complete stack for deploying and hosting web applications that leverages Google infrastucture for scalability and reliability. It &#8220;sorta&#8221; competes against Amazon&#8217;s EC2.
The &#8220;infrastructure as a service&#8221; trend is fascinating. In general,  I&#8217;ve been studying the best ways to host [...]]]></description>
			<content:encoded><![CDATA[<p>If you haven&#8217;t heard of it yet, Google launched something called &#8220;<a href="http://code.google.com/appengine/">Google App Engine</a>&#8220;, a complete stack for deploying and hosting web applications that leverages Google infrastucture for scalability and reliability. It &#8220;sorta&#8221; competes against Amazon&#8217;s EC2.</p>
<p>The &#8220;infrastructure as a service&#8221; trend is fascinating. In general,  I&#8217;ve been studying the best ways to host and deploy services in a web environment - Amazon EC2 has come up in my mind many times. And of course, Google App Engine certainly caught my attention.</p>
<p>It also caught the attention of our friends at Techcrunch. They built a fairly simple app, deployed it to Google, and <a href="http://www.techcrunch.com/2008/04/07/google-jumps-head-first-into-web-services-with-google-app-engine/">blogged </a>about it. I enjoyed their <a href="http://www.techcrunch.com/2008/04/08/google-to-close-huddlechat/">blog</a>. And then I went to check out the application. Here is what I got:</p>
<p><img src="http://farm4.static.flickr.com/3079/2596356611_20b9bd4ac5.jpg" alt="" /></p>
<p><strong>What? </strong>Well, maybe it&#8217;s just alpha, but it certainly doesn&#8217;t look like high availability at this moment.</p>
<p><em>Update:</em> just saw a posting that reported Google AppEngine has been <a href="http://valleywag.com/377603/google-app-engine-page-already-owned-by-hackers">hacked</a>, via a relatively simply cross-site scripting.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coachwei.com/blog/2008/04/08/googleappengine-not-delivering-on-the-promise-so-far.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Announcing a $50K Venture Fund With Microsoft</title>
		<link>http://www.coachwei.com/blog/2008/04/01/announcing-a-50k-venture-fund-with-microsoft.html</link>
		<comments>http://www.coachwei.com/blog/2008/04/01/announcing-a-50k-venture-fund-with-microsoft.html#comments</comments>
		<pubDate>Tue, 01 Apr 2008 20:41:31 +0000</pubDate>
		<dc:creator>coachwei</dc:creator>
		
		<category><![CDATA[humor]]></category>

		<category><![CDATA[software business model]]></category>

		<category><![CDATA[web 2.0]]></category>

		<category><![CDATA[RazorSpeed]]></category>

		<category><![CDATA[venture capital]]></category>

		<category><![CDATA[web 2.0 fund]]></category>

		<guid isPermaLink="false">http://72.167.202.159/blog/announcing-a-50k-venture-fund-with-microsoft/</guid>
		<description><![CDATA[This is a little premature, but the deal is done. Following the core tenets that I believe this venture fund should operate,  I&#8217;m &#34;un-announcing&#34; a $50K fund with Microsoft here in a web 2.0 way. The official PR/press will follow in the next month or so,  pending the clearance of a few regulatory [...]]]></description>
			<content:encoded><![CDATA[<p>This is a little premature, but the deal is done. Following the core tenets that I believe this venture fund should operate,  I&#8217;m &quot;un-announcing&quot; a $50K fund with Microsoft here in a web 2.0 way. The official PR/press will follow in the next month or so,  pending the clearance of a few regulatory matters.</p>
<p><span style="font-weight: bold;">What Is It:</span> <a href="http://www.razorspeed.com">Razorspeed Partners</a>. <a href="http://www.razorspeed.com">Razorspeed</a> is a new kind of venture fund that focuses on investing in &quot;small and immature ideas&quot;,with locations in US and China only. The limited partner is Microsoft. Going forward, we may open up to allow other corporations to participate.</p>
<p><span style="font-weight: bold;">What Does It Do: </span> Unlike any other venture fund out there, Razorspeed is different:</p>
<ul>
<li><a href="http://www.razorspeed.com">Razorspeed</a> focuses on &quot;small ideas&quot; and &quot;immature ideas&quot;, though we will accept &quot;immature and big ideas&quot; too.</li>
<li><a href="http://www.razorspeed.com">Razorspeed</a> focuses on bright teams that have high hopes, but may not have &quot;experiences&quot;;</li>
<li><a href="http://www.razorspeed.com">Razorspeed</a>&#8217;s main deal flow comes from a semi-annual worldwide startup idea competition. Anyone is welcome to participate. The competition will be hosted by <a href="http://www.razorspeed.com">Razorspeed.com</a> in partnership with Microsoft. We will select 10 teams from each competition and fund these 10 teams;</li>
<li>If a team is selected to be funded by <a href="http://www.razorspeed.com">Razorspeed</a>:
<ul>
<li>The team will be invited to live at one of the two <a href="http://www.razorspeed.com">Razorspeed</a> headquarters (Beijing and Boston) for three months, with all expenses covered;</li>
<li>The team will be invited to an annual BBQ party at Microsoft Chairman Bill Gates&#8217; house;</li>
<li>The team will be given an office space, with all facilities wired and ready to go. In Boston, the initial facility will likely be Tim Rowe&#8217;s Cambridge Innovation Center that <a href="http://www.razorspeed.com">Razorspeed</a> is still negotiating a contract with; In Beijing, the facility will be in Tsinghua R&amp;D center;</li>
<li> The team will be invited to weekly unconferences and bar camps (yes, parties!);</li>
<li> The team will also receive a $50K cash infusion from <a href="http://www.razorspeed.com">Razorspeed</a>;</li>
</ul>
</li>
<li> Best of all, the above <a href="http://www.razorspeed.com">Razorspeed</a> investment and services are provided with <strong>no strings attached</strong> . Yes, no strings attached. In the end of three months, you can simply say &quot;goodbye&quot; and walk away. Actually, saying &quot;goodbye&quot; is not required either. You can simply take what you&#8217;ve done, and walk away. Razorspeed does not claim any ownership in anything you do in this three months period. <a href="http://www.razorspeed.com">Razorspeed</a> does not require you to give up any ownership of your business during this three months.</li>
<li>&quot;No strings attached&#8230;?&quot; So why is <a href="http://www.razorspeed.com">Razorspeed</a> doing this? At the team&#8217;s choice, <a href="http://www.razorspeed.com">Razorspeed</a> can invest further to finance the team. In this phase, <a href="http://www.razorspeed.com">Razorspeed</a> will operate more like a typical venture firm, but this is the team&#8217;s choice. If the team chooses to leave, <a href="http://www.razorspeed.com">Razorspeed</a> holds no hard feelings (but we still hope you say good-bye before you leave);</li>
</ul>
<p><span style="font-weight: bold;">How Does This Relate to Microsoft?<br />
</span> Microsoft is the limited partner currently, In some sense, <a href="http://www.razorspeed.com">Razorspeed</a> is operating as Microsoft&#8217;s venture arm, but without any corporate affiliation. The initial fund size is $100M. At its own discretion, <a href="http://www.razorspeed.com">Razorspeed</a> may raise more from other corporations.</p>
<p>However, <a href="http://www.razorspeed.com">Razorspeed</a> does pay special attention to startup ideas that are related to Silverlight, Windows Live and Software-as-a-service.</p>
<p><span style="font-weight: bold;">Who Are the People at <a href="http://www.razorspeed.com">Razorspeed</a>?<br />
</span> <a href="http://www.razorspeed.com">Razorspeed</a> is managed by three managing partners, including myself. Given that this is an &quot;un-announcement&quot;, I will only announce myself and leave my peers&#8217; fate in their own hands instead.</p>
<p>If you are reading this blog, you probably know who I am. I have been at the technology fore front for the last 10 years, started Ajax/RIA etc many years ago. I am not the top 1% coder, but can code well enough to make a living if needed. I have been CEO, CTO, Engineering and marketing, and have seen a lot of different types of executives.  I started  and helped started a few companies, each of which has raised over $10M financing and is doing really well. My current personal passion is next generation web performance (CDN is a little too old, don&#8217;t you think? We can do better. Akamai is a $5B company, but there are so many things have yet to be explored), social computing and digital life.  If you are into any of these three areas, drop me an email coachwei at alum.mit.edu. For exceptional ideas or ideas that are close to my belief of the next wave of the industry, <a href="http://www.razorspeed.com">Razorspeed</a> can fund outside of the semi-annual competition.</p>
<p><span style="font-weight: bold;">How Did This Happen?</span></p>
<p>Over the years, I have interacted with lots of smart people, startups as well as venture firms. The evolution of the industry has put serious question on some of the existing thinkings and investment model.</p>
<p>Despite the web 2.0 hype and growth of firms like Y-Combinator, the corporate venture investment has not evolved at all. Corporations in general are having a hard time adjusting to the web 2.0 age.</p>
<p>When I brought up this idea to Microsoft executives a year ago during a discussion, apparently this is something they have been thinking about for a while. The industry&#8217;s shifting landscape, ranging from the rise of Google, Facebook, to the rise of RIA and Software-as-a-service, is causing a lot of changes within Microsoft. However, it is time to make some changes to the investment model as well. The $150M investment into Facebook was a bold move. However, I believe <a href="http://www.razorspeed.com">Razorspeed</a> is going to work out better for Microsoft over the long term.</p>
<p><span style="font-weight: bold;">What&#8217;s Next?</span></p>
<p>I&#8217;m excited about doing this with Microsoft, and thrilled at the opportunity of going to Bill Gate&#8217;s BBQ party this summer! The official announcements will come after we clear up a few regulatory matters. Within a year (by 4/1/2009), I&#8217;m sure that  you will  hear a lot of progress. Until the official announcement,  the razor sharp ideas will remain razor sharp.</p>
<p>If you have any questions, you may email me at coachwei at alum.mit.edu.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coachwei.com/blog/2008/04/01/announcing-a-50k-venture-fund-with-microsoft.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Will Rich Internet Become Rich Man&#8217;s Internet?</title>
		<link>http://www.coachwei.com/blog/2008/03/31/will-rich-internet-become-rich-mans-internet.html</link>
		<comments>http://www.coachwei.com/blog/2008/03/31/will-rich-internet-become-rich-mans-internet.html#comments</comments>
		<pubDate>Mon, 31 Mar 2008 21:51:05 +0000</pubDate>
		<dc:creator>coachwei</dc:creator>
		
		<category><![CDATA[web 2.0]]></category>

		<category><![CDATA[Adobe Flex]]></category>

		<category><![CDATA[Ajax]]></category>

		<category><![CDATA[Open Web]]></category>

		<category><![CDATA[Rich Internet Application]]></category>

		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://72.167.202.159/blog/will-rich-internet-become-rich-mans-internet/</guid>
		<description><![CDATA[The Web is one of the most important technological as well as social/cultural developments  in our life. Its global impact is rooted in its openness and its capability to evolve on a democratic basis.
However, I have concerns. I&#8217;m concerned about the significant corporate interests driving towards &#8220;unweb&#8221;. Not to pick on video, but to [...]]]></description>
			<content:encoded><![CDATA[<p>The Web is one of the most important technological as well as social/cultural developments  in our life. Its global impact is rooted in its openness and its capability to evolve on a democratic basis.</p>
<p>However, I have concerns. I&#8217;m concerned about the significant corporate interests driving towards &#8220;unweb&#8221;. Not to pick on video, but to use video as an example. Video, the most recent hotspot on the web, largely relies on Adobe&#8217;s Flash technology. Not that Flash is not good. On the contrast, it is well designed and implemented as a technology. It enabled the possibility of Internet Video and we should be thankful. However, it is a platform controlled by a single entity (Adobe). We should trust our future in the collective will of the society instead of the goodwill of a benevolent dictator. Another example, the area that I&#8217;ve dedicated ten years of my life to, Rich In