Tanzim Saqib on .NET discovery

Innovate. Create. Share.

  Home  |   Contact  |   Syndication    |   Login
  43 Posts | 0 Stories | 59 Comments | 0 Trackbacks

News

Photo of Tanzim Saqib Tanzim Saqib is a Senior Developer, who spent half of his life on software and worked for many companies like #1 .NET controls provider Telerik Inc, #1 personalized Web 2.0 start-page like Pageflakes (acquired by LiveUniverse). He developed many projects ranging from banking solutions for Citibank, HSBC, Wamu, Wells Fargo etc. to Paperless Virtual University. He is industry's earliest and leading widget developer and as know as "Widget Master" to his peers.

He is a preacher of Microsoft technologies. While he jams with the latest additions to .NET, in his spare time he blogs at http://weblogs.asp.net/TanzimSaqib, maintains his personal website http://www.TanzimSaqib.com, leads .NET Research group. writes articles.

He is an easy going, fun loving, and passionate technology individual who is open to any kind of business opportunity and professional relationship. He currently lives in Bangladesh, but travels anywhere in the world on professional demand.

Email: me at TanzimSaqib dot com

Archives

Post Categories

Personal

January 2008 Entries

I know there are GetById, GetById<> methods in Document object. But, I often miss a method that I feel should be in Volta, which iterates through its child nodes and find an element for me. Let us say, there is a HTML like the following:<div id="divContainer"> <b>Some text</b> <div id="firstDiv"> <i>Some more text</i> </div> <div id="secondDiv"> Okay, I gotta go now </div> <div anyAttribute="anyValue"> Babye </div> </div>The ......

Microsoft Volta team blogged about me and one of my articles: http://labs.live.com/volta/... ......

While we develop AJAX applications, we often carelessly ignore giving up bad practices, which cause effects which are not so significantly visible when the site is not so large in volume. But, it’s often severe performance issue when it is the case for sites that make heavy use of AJAX technologies such as Pageflakes, NetVibes etc. There are so many AJAX widgets in one page that little memory leak issues combined may even result the site crash into very nasty “Operation aborted”. There are a lot ......

HttpRequestFactory was designed for use by tiersplitting internally and was not supposed to be exposed as part of the Volta API as Danny van Velzen from Microsoft Volta team told me today. So, its better if you use XMLHttpRequest instead because this factory class might not show up in the later releases. You will find this class in Microsoft.LiveLabs.Volta.Xml namespace. As like as JavaScript's one, in this .NET version you can also Open URL, specify method name, and of course pass credentials. You ......

I have just configured my GeeksWithBlogs.net blog in Windows Live Writer. Steps are simple:

1. Put your blog URL. E.g. http://geekswithblogs.net/saqib, and User, Password

2. Choose “Another blog service”

3. Put an URL like (in my case): http://geekswithblogs.net/saqib/services/MetaBlogAPI.aspx


This is my first article which is based on the first CTP of Volta considering its current limitations. You will see how you can create a Volta control that the compiler can convert into an AJAX Widget without requiring us writing a single line of JavaScript code: http://dotnetslackers.com/a... ......

Someone had questions about the article recent I wrote on DotNetSlackers are: “i am curious to know how you have hooked the DownloadPhotos to voltaControl1, is it hooked automatically, when added to the volta project, what is the case of using external flickr api ? Also, let me know what is the purpose of screen_name in voltaControl1.” You might have the same questions, so to clarify, here are the answers: Inside VoltaControl, PhotosLoaded event of FlickrHelper class is subscribed and FlickrHelper's ......

Don't you think the following block of code has written keeping every possible good practice in mind? Any option for performance improvement?function pageLoad() { var stringArray = new Array(); // Suppose there're a lot of strings in the array like: stringArray.push('<div&g... stringArray.push('some content'); stringArray.push('</div&... // ... code edited to save space var veryLongHtml = $get('divContent').innerHTML; var count = stringArray.length; for(var i=0; i<count; ++i) veryLongHtml ......

It's still long way to go for a final release of ASP.NET MVC, the one I've been using right now is just a December CTP. But, like me you might be experiencing this confusing problem. The server controls that you put in a View (ViewContentPage) can not be found in code-behind page. The reason behind it is - the Views don't have a back-end designer code file. I believe it's just a bug or they could not find time to fix/look into it. I'm sure it will be fixed in any of the upcoming versions. To enable ......

If you have gone through configuring Selenium in Windows system by Setting up Selenium RC server in Windows and Setting up PHP in Windows using Abyss server, next thing you need to setup is the Selenium PHP client. Let me show you the steps I've gone through to accomplish this: 1. Open up the console with all administrative privileges especially in Vista 2. Go to the directory where PHP is installed 3. Execute command: php PEAR/go-pear.phar 4. Follow the instructions, and ignore the additional offerings ......

Take a look at the following loop. This loop calls a function in each iteration and the function does some stuffs. Can you think of any performance improvement idea?for(var i=0; i<count; ++i) processElement(elements[i]); Well, for sufficiently large array, function delegates may result in significant performance improvement to the loop.var delegate = processElement; for(var i=0; i<count; ++i) delegate(elements[i]); The reason behind performance improvement is, JavaScript interpreter will use ......

Reason behind installing another server to your system Whichever platform you have been working with must using a server. For .NET developers, IIS eases all the pain. So, what is now if you must install PHP in your system side by side .NET. I suggest you not to install PHP in the same server the .NET is working in. So, install another server which will work with all burdens of PHP stuffs. Why Abyss? The reasons behind choosing this server is Abyss is free, easy to configure, very lightweight, and ......

We have seen DOM caching before and function delegation is also a kind of function caching. Take a look at the following snippet: for(var i=0; i<count; ++i) $get('divContent').appendCh... As you can figure out the code is going to be something like: var divContent = $get('divContent'); for(var i=0; i<count; ++i) divContent.appendChild(elem... That is fine, but you can also cache browser function like appendChild. So, the ultimate optimization will be like the following: ......

Unlike .NET languages or any other compiler languages, JavaScript interpreter can not optimize switch block. Especially when switch statement is used with different types of data, it's a heavy operation for the browser due to conversion operations occur in consequences, it's an elegant way of decision branching though.


In one of my earlier posts, I talked about DOM element accessing in a loop but forgot to talk about a very common, yet performance issue in AJAX. We often use code like the following:var items = []; // Suppose a very long array for(var i=0; i<items.length; ++i) ; // Some actionsIt can be a severe performance issue if the array is so large. JavaScript is an interpreted language, so when interpreter executes code line by line, every time it checks the condition inside the loop, you end up accessing ......

Less use of "var" can result into wrong calculation as well as mistake in logic control. And also JavaScript interpreter finds it hard to determine the scope of the variable if var is not used. Consider the following simple JavaScript code:function pageLoad() { i = 10; loop(); alert(i); // here, i = 100 } function loop() { for(i=0; i<100; ++i) { // Some actions } } Here you see, the loop uses the variable i used before in pageLoad. So, it brings a wrong result. Unlike .NET code, in JavaScript ......

I, Tanzim Saqib do work as Developer at the AJAX king "Pageflakes.com". I've spent half of my life on software and worked in many projects ranging from Banking solution for CitiBank, HSBC, Wells Fargo etc. to Personalized Start Page. I love twisting latest Microsoft technologies. In my spare time I enjoy National Geographic channel, writing articles and blogging. Drop few lines: me@TanzimSaqib.com Original Homepage: http://www.TanzimSaqib.com ......

Ever wondered how to make web.config work in Volta first CTP release? Simply add a web.config file and add content to it? Unfortunately this is not the case in Volta at least in the first CTP. Five steps to get it done: Add a web.config file Add content to simply by copying from other web.config file Right click on web.config from the Solution Explorer and then Properties Choose Build Action to Embedded Resource In your Volta Page Designer CS file, add the following line of code: [assembly: VoltaFile("web.config")] ......

Make minimum use of setters and getters if possible. Such accessors look like .NET like kind of beautiful properties, but these create new more scopes for JavaScript interpreter to deal with. If applicable, try directly setting/getting the private variable itself rather implementing methods for getters, setters.


It's not pretty common. But, if you ever encounter such code, be sure it's a very bad practice. Introducing more scopes is a performance issue for JavaScript interpreter. It adds a new scope in the ladder. See the following sample scope:function pageLoad() { scope1(); function scope1() { alert('scope1'); scope2(); function scope2() { alert('scope2'); } } } Introducing more scopes enforces the interpreter to go through new more sections in the scope chain that it maintains for code execution. So, ......

Avoid implementing your own getElementById method that will cause script to DOM marshalling overhead. Each time you traverse the DOM and look for certain HTML element requires the JavaScript interpreter to marshalling script to DOM. It's always better to use getElementById of document object. So, before you write a function, make sure similar functionality can be achieved from some other built-in functions.


When a Volta control is rendered, the ID attribute of the generated HTML is changed to something like _vcId_1_DivName which is inconvenient to find from code. But the ID attribute stays the same in case of Volta Page, so it is discoverable by ID like this: Div divContent = Document.GetById<Div>... However, if you add HTML controls to the control like the following, the ID is not changed during the rendering: public VoltaControl1() : base("VoltaControl1.html") { InitializeComponent(); ......

1. Download latest Java SE from http://java.sun.com/ and install 2. Download latest version of Selenium RC from and extract 3. Create a folder named Selenium at C:\Program Files\Java\jdk1.6.0_03\bin 4. Copy all files under Selenium-server-0.9.2 which you will find in the extracted folder and paste in the newly created folder 5. From Command prompt run the following commands: cd \ cd C:\PROGRA~1\Java\jdk1.6.0_0... java -jar .\Selenium\selenium-server.jar -interactive If you see the following messages ......

Making a cross domain AJAX call in Volta is piece of cake. Volta compiler generates necessary client codes to make it work. Here is a snippet that can make an AJAX call to some Url and fetch data: public void DownloadPhotos() { IHttpRequest request = HttpRequestFactory.Create(); request.AsyncSend("POST", URL, string.Empty, delegate(string response) { OnPhotosLoaded(new PhotosLoadedEventArgs(respo... }); } Both IHttpRequest and HttpRequestFactory classes can be found in the Microsoft.LiveLabs.Volta.Mu... ......

Let us say somebody in your company loves crazy coding and really do not bother about his/her codes affect others. (S)He put class name System and a constant Console and now wondering how come a simple Console.WriteLine does not compile: class System { int Console = 10; static void Main(string[] args) { Console.WriteLine("Hello World!"); // Compile time error System.Console.WriteLine("H... World!"); // Compile time error } } Making use of global::System.Console must solve your problem: class System ......