<rss version="2.0"><channel><title>AzamSharp</title><link>http://www.AzamSharp.com</link><description>AzamSharp Blog Postings!</description><copyright>Copyright (C) 2008</copyright><item><title>Creating FixedDocument in WPF Using Custom Collection </title><link>http://www.AzamSharp.com//Posts/127_Creating_FixedDocument_in_WPF_Using_Custom_Collection.aspx</link><description>&lt;font size="2" face="Arial"&gt;I just published an article on &lt;a href="http://www.highoncoding.com"&gt;HighOnCoding &lt;/a&gt;which talks about how to print your custom collection using FixedDocument in Windows Presentation Foundation. &lt;br&gt;&lt;br&gt;You can check out the article using the link below: &lt;br&gt;&lt;br&gt;&lt;a href="http://highoncoding.com/Articles/461_Creating_FixedDocument_in_WPF_Using_Custom_Collection.aspx"&gt;Creating FixedDocument in WPF Using Custom Collection &lt;/a&gt;&lt;/font&gt;</description></item><item><title>Presenting at North Houston DotNet User Group on November 20th 2008 </title><link>http://www.AzamSharp.com//Posts/126_Presenting_at_North_Houston_DotNet_User_Group_on_November_20th_2008.aspx</link><description>&lt;font face="Arial" size="2"&gt;I will be presenting at &lt;a href="http://nhdnug.org/homepage.aspx"&gt;North Houston .NET User Group&lt;/a&gt; on November 20th 2008. If you are in town then do come by the session. If you are not in town then get in town for this session. &lt;br&gt;&lt;br&gt;I will be talking about different Ajax frameworks. These frameworks include Ajax.Net library, Microsoft AJAX and JQuery Ajax API. The presentation will contain lot of live coding and minimum slides (3-5 slides). &lt;br&gt;&lt;br&gt;For directions and stuff check out the link below: &lt;br&gt;&lt;br&gt;&lt;a href="http://nhdnug.org/findmeeting.aspx"&gt;Find Meeting&lt;/a&gt;&lt;/font&gt;</description></item><item><title>Repetitive Calls to Find the Same Element Using document.getElementById and Performance</title><link>http://www.AzamSharp.com//Posts/125_Repetitive_Calls_to_Find_the_Same_Element_Using_document_getElementById_and_Performance.aspx</link><description>&lt;font face="Arial" size="2"&gt;You will find no difference in performance when using document.getElementById to find an element once. But if you are performing this operation hundreds of times on a single element then you might be hurting the performance. &lt;br&gt;&lt;br&gt;I performed a small test in which I created 200 TextBoxes and added it to the ASP.NET Panel control. Here is the code for that: &lt;br&gt;&lt;br&gt;&amp;lt;code&amp;gt;&lt;br&gt;private void BindData()&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 1; i &amp;lt;= 200; i++)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TextBox t = new TextBox();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t.Text = "something " + i;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; panelContainer.Controls.Add(t); &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;lt;/code&amp;gt;&lt;br&gt;&lt;br&gt;Now, I need to add a custom TextBox which will be searched among these 200 TextBoxes. &lt;br&gt;&lt;br&gt;&amp;lt;code&amp;gt;&lt;br&gt;&amp;lt;asp:Panel ID="panelContainer" runat="server" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input type="button" value="Execute" onclick="execute()" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input type="text" id="txtName" /&amp;gt;&lt;br&gt;&amp;lt;/code&amp;gt;&lt;br&gt;&lt;br&gt;Now here is the JavaScript code that will try to search for the ???txtName??? TextBox: &lt;br&gt;&lt;br&gt;&amp;lt;code&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;script language="javascript" type="text/javascript"&amp;gt;&lt;br&gt;&lt;br&gt;function execute() &lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.profile("profiling start"); &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; callingGetElementByIdMultipleTimes(); &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pullingTheObjectIntoTheVariable(); &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.profileEnd(); &lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;}&lt;br&gt;&lt;br&gt;function pullingTheObjectIntoTheVariable() &lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var txtObject = document.getElementById("txtName"); &lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(i=0; i&amp;lt;=200;i++) &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; txtObject.value = 'hello world';&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br&gt;}&lt;br&gt;&lt;br&gt;function callingGetElementByIdMultipleTimes() &lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var txtObject;&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(i=0;i&amp;lt;=200;i++) &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; txtObject = document.getElementById("txtName");&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; txtObject.value = 'Hello World';&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;}&lt;br&gt;&lt;br&gt;&amp;lt;/script&amp;gt;&lt;br&gt;&amp;lt;/code&amp;gt;&lt;br&gt;&lt;br&gt;As you can see that I am trying to find the element ???txtName??? 200 times and then setting the custom text into the TextBox. &lt;br&gt;&lt;br&gt;Now, let???s see the results using the FireFox profiler. &amp;nbsp;&lt;br&gt;&lt;br&gt;&amp;nbsp;&lt;img src="http://publicimages.s3.amazonaws.com/performancetestfordocumentid.PNG"&gt;&lt;br&gt;&lt;br&gt;As, you can see that moving the value of the TextBox into a variable and then referring&amp;nbsp; the variable is little faster then searching for the element in the complete DOM tree. &lt;br&gt;&lt;br&gt;For most of the time you won???t see any difference but if you are finding the same element again and again then it is much better to move the element object into a variable and refer the variable. &lt;/font&gt;</description></item><item><title>HighOnCoding Gets You High!</title><link>http://www.AzamSharp.com//Posts/124_HighOnCoding_Gets_You_High_.aspx</link><description>&lt;font size="2" face="Arial"&gt;&lt;img src="http://publicimages.s3.amazonaws.com/highoncodinglogo.jpg"&gt;&lt;br&gt;&lt;br&gt;As someone wise said ???Wanna get high????&lt;br&gt;&lt;br&gt;Getting high and wasted is illegal in most countries. If you want to do light drugs then you have to make a trip to a city that rhymes with HamsterDam. Off course, this trip will be very expensive and time consuming. &lt;br&gt;&lt;br&gt;We want to make it easier for you. We want to get you high legally without any cost.&lt;br&gt;&lt;br&gt;HighOnCoding is a knowledge based website that will get you high in valuable information. Here are several of suggested ways to get high. &lt;br&gt;&lt;br&gt;1)&amp;nbsp;&amp;nbsp; &amp;nbsp;Take pill of RSS feeds everyday. &lt;br&gt;2)&amp;nbsp;&amp;nbsp; &amp;nbsp;Smoke videos every week&lt;br&gt;3)&amp;nbsp;&amp;nbsp; &amp;nbsp;Inject yourself with a dose of articles&lt;br&gt;4)&amp;nbsp;&amp;nbsp; &amp;nbsp;Inhale podcast &lt;br&gt;&lt;br&gt;If you are reading this line you are still NOT high! Check out &lt;a href="http://www.highoncoding.com"&gt;www.HighOnCoding.com&lt;/a&gt; and get high in valuable information.&lt;/font&gt;</description></item><item><title>Google Video and Chat</title><link>http://www.AzamSharp.com//Posts/123_Google_Video_and_Chat.aspx</link><description>Google just releasted Video and Chat functionality. You can download the Google Video and Chat &lt;a href="http://mail.google.com/videochat"&gt;here&lt;/a&gt;.&amp;nbsp; Now my chat has a video functionality. Here is a little screenshot of Google Video and Chat. &lt;br&gt;&lt;br&gt;&lt;img src="http://publicimages.s3.amazonaws.com/GoogleVideoChat.PNG"&gt;&lt;br&gt;&lt;br&gt;The sound quality is also very good. In the above image only I am running the web cam. Running a web cam puts extra pressure on the performance. Right now it is consuming 118, 200 KB of memory. &lt;br&gt;&lt;br&gt;I think this is a very good edition to the already popular Gmail system. One thing I would love to see is Group Chat feature. Currently you cannot engage a person in a group chat if that person is involved in a video chat. If you try to do it then the video video chat will stop and the group chat will be engaged. &lt;br&gt;&lt;br&gt;</description></item></channel></rss>