Invalid URL /blog/_archives/2008/page/2
Direct from Web 2.0

Running Toronto Marathon - 9/28/2008

September 30, 2008 – 9:28 pm by coachwei

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 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...”. It didn't resonate with me at the time. In fact, I didn't feel anything besides saying "wah, cool". What I didn't know (I'm sure Kaushal didn't know either) is that he planted some seeds in me at the time that would only grow two years later. In Boston where I live(Kaushal lives in LA), my friend Ying actually has been running marathon many times. I always admired her for ...more »

JavaScript Execution Context, Closure, Eval and “this” Keyword

September 13, 2008 – 8:36 pm by coachwei

These are a few key concepts of JavaScript language that developers should know: execution context, activation object, variable instantiation, scoping, closure, eval and "this" 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 outer function as if they were defined locally. You can also access the global variables. -Why? How does the host environment resolve such variables? 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? A slightly more involved example that developers must have seem similar code a lot but may not know the "why": function outerFunc(outerArg){ var localVar = 100; function innerFunc(innerArg){ localVar+=100; return (outerArg +innerArg + localVar); ...more »

Ajax-heavy Applications on Google Chrome

September 3, 2008 – 6:02 am by coachwei

"This is the best browser so far" 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't found Chrome breaking any web application yet, especially Ajax applications. I was a little concerned about this, given that the Chrome cartoons say "Javascript runs in its own thread", which is different from the threading model today.  For example, Razor Profiler 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 "tricks" to make a web application deliver similar performance characteristics to native applications. -Razor Profiler works well on Chrome.  I also tried a few applications on Dojo, ExtJS and jQuery. All worked well without a glitch.  After the initial concern eliminated, now I was able to ...more »

The 64KB Java Language Problem - Lesson Learnd from Using Rhino to Process JavaScript

September 1, 2008 – 10:13 am by coachwei

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. 1. JVM Byte Code Size Limit Problem On rare occasions, you will see exceptions like the followings from Rhino when processing JavaScript files: Exception in thread "main" java.lang.IllegalArgumentException: out of range index at org.mozilla.classfile.ClassFileWriter?.add(ClassFileWriter?.java:541) at org.mozilla.classfile.ClassFileWriter?.addLoadConstant(ClassFileWriter?.java:601) at org.mozilla.classfile.ClassFileWriter?.addPush(ClassFileWriter?.java:837) at org.mozilla.javascript.optimizer.BodyCodegen?.visitSpecialCall(Codegen.java:2571) at org.mozilla.javascript.optimizer.BodyCodegen?.generateExpression(Codegen.java:1763) at org.mozilla.javascript.optimizer.BodyCodegen?.visitSetProp(Codegen.java:3743) ...more »

Razor Profiler - An Automated JavaScript Profiling Tool

August 16, 2008 – 7:47 pm by coachwei

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 a cross-browser environment. Razor Profiler can be access either online as a service; or be downloaded to run locally. Some Razor Profiler screen shots are shown below: .imageListTable { text-align: center; margin-left: auto; ...more »

OpenAjax Publishes Future Browser Feature Wish List Results

July 17, 2008 – 6:57 am by coachwei

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. In late 2007, OpenAjax Alliance formed Runtime Task Force (http://www.openajax.org/member/wiki/Runtime) 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. 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 ...more »

Time to Vote - Ajax Feature Wish List

June 23, 2008 – 9:14 am by coachwei

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 it is time for everyone to cast your vote! Voting is easy. Just sign up at OpenAjax Wiki . Then go to the voting page , select the priority number from a dropdown box for features that you care. -That'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 ...more »

Fix for WordPress TinyMCE Editor Problem

June 19, 2008 – 5:17 pm by coachwei

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” is checked. Open a tab or window in a browser, and go to [your site]/wp-includes/js/tinymce/tiny_mce_config.php - if you don't get a screen full of garbage and errors here, this post is not for you. You have a different problem. 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 [wp-includes/js/tinymce/tiny_mce_config.php]. This file will compress the tinymce.js files (over 200kB) using gzip and save the compression result to [wp-content/uploads/js_cache] ...more »

GoogleAppEngine -Not Delivering On the Promise So Far

April 8, 2008 – 3:36 am by coachwei

If you haven't heard of it yet, Google launched something called "Google App Engine", a complete stack for deploying and hosting web applications that leverages Google infrastucture for scalability and reliability. It "sorta" competes against Amazon's EC2. The "infrastructure as a service" trend is fascinating. In general, I'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. It also caught the attention of our friends at Techcrunch. They built a fairly simple app, deployed it to Google, and blogged about it. I enjoyed their blog. And then I went to check out the application. Here is what I got: What? Well, maybe it's just alpha, but it certainly doesn't look like high availability at this moment. Update: just saw a posting that reported Google AppEngine has been ...more »

Announcing a $50K Venture Fund With Microsoft

April 1, 2008 – 2:41 pm by coachwei

This is a little premature, but the deal is done. Following the core tenets that I believe this venture fund should operate, I'm "un-announcing" 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. What Is It: Razorspeed Partners. Razorspeed is a new kind of venture fund that focuses on investing in "small and immature ideas",with locations in US and China only. The limited partner is Microsoft. Going forward, we may open up to allow other corporations to participate. What Does It Do: Unlike any other venture fund out there, Razorspeed is different: Razorspeed focuses on "small ideas" and "immature ideas", though we will accept "immature and big ideas" too. Razorspeed focuses on bright teams that have high hopes, but may not have "experiences"; Razorspeed's main deal flow comes from a semi-annual ...more »

Will Rich Internet Become Rich Man’s Internet?

March 31, 2008 – 3:51 pm by coachwei

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'm concerned about the significant corporate interests driving towards "unweb". Not to pick on video, but to use video as an example. Video, the most recent hotspot on the web, largely relies on Adobe'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've dedicated ten years of my life to, Rich Internet ...more »

OpenAjax F2F Meeting at NYC

March 24, 2008 – 4:22 pm by coachwei

The F2F meeting of OpenAjax Alliance at NYC on March 21st worked out really well in my oppinion. As a result of the last F2F meeting in October 2007, we formed a new task force called "Runtime Advocacy Task Force" at OpenAjax. The goal of Runtime Task Force is to collect a "wish list" from the Ajax community, get the communities involved, have active dialogs and engage browser vendors, with the goal of fixing the issues that have bugged down Ajax developers and help build a better web. So far we've collected a list of 29 issues(http://www.openajax.org/runtime/wiki/Main_Page), of which we hope to open up to the general public for review/comments/voting. The discussions around Ajax Runtime wish list (http://www.openajax.org/runtime/wiki/Main_Page) were fantastic. Douglas Crockford from Yahoo, Jon Ferraiolo (IBM and OpenAjax), Howard Weingram(Tibco), Gideon Lee(OpenSpot), Dylan Schiemann,(Sitepen and Dojo), Alex Russell (Dojo), Bertrand Roy (Microsoft), Yehuda Katz(jQuery) etc all contributed great deal to the ...more »

Possible Solutions to Web Security Issues

March 11, 2008 – 8:05 pm by coachwei

The “Same Origin Policy” is at the core of browser’s security model. Under the “Same Origin Policy”, a web resource can only interact with another web resource if and only if both resources are from the same origin. However, “Cross site scripting” and “cookie” both brings security challenges in this security model. “Cross site scripting” However, there is a notable exception to this rule. The “Same Origin Policy” does not apply to scripts and thus enables something typically called “cross site scripting (XSS)”. With XSS, a web page from one origin can contain a script element from a different origin. More importantly, this “foreign script” element has full access to everything else on this web page. Namely, the cross-domain script runs with the same authority as scripts from the originating domain. As a result, XSS can be intentionally or unintentionally exploited for security breaches. “Cookie” All browsers support “cookie” which ...more »

A Study of Ajax Performance Issues

January 22, 2008 – 11:28 am by coachwei

Introduction: Ajax application performance largely depends on the performance of JavaScript execution and browser DOM operations. I've heard various people saying various things about Ajax performance. Some people say JavaScript is just too slow. Some people say that the problem is not JavaScript but rather Browser DOM being too slow. Some people would then argue that browser DOM operations are fine. The problem is Internet Explorer that is unbelievably slow. What is the reality? Having heard enough but haven’t seen enough data to clearly justify one argument against the other ones, I decided to take some time and do some study in this area. The Study: Using the work produced by Robert Buffone at http://www.rockstarapps.com and a 2GB RAM/1.66GHz Dual CPU Windows XP machine, a JavaScript performance study is conducted. The results are shown in Appendix 1 : 1. Vertically, in each column, Appendix 1 shows how a ...more »

The Common Culture Root of Web 2.0 and Barack Obama

January 8, 2008 – 7:39 pm by coachwei

What is the reason for this Obama phenomenon? Why is it happening right now, at this moment of history? Is it because of his eloquent speeches? Is it because people in this country are so tired of the current reality that they want to depart from it as far as possible? Is it because of some of the strategic mistakes that Hillary made? As a web 2.0 guy who blogs on “Direct from Web 2.0” , I did not see this coming. In fact, my preferences are Mitt Romney from the republican side (maybe McCain too) and Hillary Clinton from the democrat side. I think the three of them (Mitt Romney, John McCain and Hillary Clinton) will do better in the oval office than other candidates. Just like how venture capitalists pick CEOs for their portfolio companies, I put “experience” and “track record of execution” very high in my assessment. If you ...more »