JS Calculator

I have just created a calculator that can be invoked in a page. Currently, the key combination for invoking the calculator is the Ctrl Windows key. This shows and hides the calculator. The calculator has a text area and the user can type in an arithmetic (Validation is pending for non arithmetic keys) expression and on enter key, the same is evaluated. Here is the code ============================= <html> <head> <script language="javascript"> document.onkeyup = KeyCheck; var calcVisible = false; function KeyCheck(e) { var KeyID = (window.event) ? event.keyCode : e.keyCode; switch(KeyID) { case 91: if (!calcVisible) ShowCalc('CalcPlace') else HideCalc('CalcPlace'); break; default:

Continue reading

A-Z Guide to Being an Architect

Eh! There is something interesting to read and learn. We here also are in the way of architecting in a big way already. I am reproducing this post from MSDN.   A-Z Guide to Being an Architect A Is for Advocate “I think you’ll find that you really don’t want to do it like that.” Architects have to explain and advise on technical issues to business stakeholders. They also have to be able to advise delivery teams on how to build. This advice is the currency of an architect; invested wisely, it will return goodwill and trust. The architect is

Continue reading

Using TreeView inside AJAX UpdatePanel

Microsoft does not support TreeView Control inside AJAX:UpdatePanel. So there are lots of issues if one need to do the same. One of my teams needed to use the TreeView inside the UpdatePanel. The core of the application is around some hierarchical documentation. As the user interaction with the system mostly through this hierarchical data, TreeView with check boxes is the most obvious selection. However, the pain began as the development progressed and changes in requirements started pouring in. One option was for clientside population of treeview. But some dynamic changes happening to the underlying hierarchical data (by concurrent users),

Continue reading

TreeView inside UpdatePanel issue – postbacks on check and uncheck of the node’s Checkbox

Problem: In ASP.NET TreeView control, user wish to select one or many treenodes and wish to have options for further working depending upon the selection. The selection is done using a checkbox. On checking, the server side code need to know what has been checked and provides further options for the same. The checkbox check/uncheck does not fire a postback. Though we tried to imitate the same using javascript, the page gets refreshed. We used AJAX and put the TreeView control inside an UpdatePanel Findings: Microsoft does not support this. An issue/request for the feature was put on Microsoft feedback

Continue reading

Version Conflict of .NET Framework in IIS

Another point to share. Of course I delayed the publishing. While I was migrating the YAFNET forum from my machine (WinXP with SQL Server 2005 Express), to a machine with Win2K3 and SQL Server 2000, I faced another issue. The first issue was of migrating SQL Server 2005 Express database to SQL Server 2000 database. The next issue is of conflict of versions of .NET in IIS. The target machine was hosting few web applications developed on .NET 1.1 and was running fine. I created a site for the YAFNET application and in the properties, set the .NET version as

Continue reading

Moving SQL Server 2005 Express databases to SQL Server 2000

Beyond general concept of upgrading, I faced a challenge of downgrade. I needed to migrate a database in SQL Server 2005 Express edition to SQL Server 2000 standard edition. I thought of how to do the same. Time permitted was just few hours.   I scratched on my head and thought of possible ways:  1. Detach from 2005 and attach in SQL 2000: Can not be done. It is not allowed, even if you set the compatibility level of the database to SQL server 2000. This just sets the way how sql queries are parsed and processed.  2. Import from

Continue reading

How choice of Data Structures and Algorithms affect Performance

  The main data structure issues that you need to consider are as under: Table 1 Issues Implications Choosing a collection without evaluating your needs (size, adding, deleting, updating) Reduced efficiency; overly complex code. Using the wrong collection for a given task Reduced efficiency; overly complex code. Excessive type conversion Passing value type to reference type causing boxing and unboxing overhead, causing performance hit. Inefficient lookups Complete scan of all the content in the data structure, resulting in slow performance. Not measuring the cost of your data structures or algorithms in your actual scenarios Undetected bottlenecks due to inefficient code,

Continue reading

State Management Best Practices

  The following table highlights the main state management issues:   State Management Issues Implications Stateful components Holds server resources and can cause server affinity, which reduces scalability options. Use of an in-memory state store Limits scalability due to server affinity. Storing state in the database or server when the client is a better choice Increased server resource utilization; limited server scalability. Storing state on the server when a database is a better choice In-process and local state stored on the Web server limits the ability of the Web application to run in a Web farm. Large amounts of state

Continue reading

HTTP Compression – A faster way to improve web site performance – At minimal cost

  HTTP compression – is a simple way to improve site performance and decrease bandwidth, with no configuration required on the client side. – is a capability built into both web servers and web browsers, to make better use of available bandwidth. – HTTP protocol data is compressed before it is sent from the server. How HTTP Compression Works When IIS receives a request, it checks whether the browser that sent the request is compression-enabled. (Recent versions of Microsoft® Internet Explorer and most other browsers typically send the following header if they are compression-enabled: Accept-Encoding: gzip, deflate.) IIS then determines

Continue reading

schema.ini file to interpret column attributres while reading a CSV using MS Text Driver

Problem – While reading a CSV file using Microsoft Text Driver, It interprets CSV file columns in it’s own way like if one the column contains data specific to a date, then it only keep data which is in proper format otherwise it put null against that. Solution – Create a schema.ini file which defines the structure of a CSV file in turn gets interpreted automatically by driver itself in a desired format. Details – Schema.ini files provide schema information about the records in a text file. If you create a DSN, the schema.ini file gets created automatically in the

Continue reading