Javascript Fundamentals - (Learning Javascript Series)

Javascript fundamentals

Let us learn the fundamental of javascript. This includes knowing the common programming terms related to javascript and also how to work with them.

Some of the most common terms are:

Statement: One line of programming code; statements are often separated by semicolons (;) in JavaScript.

Variable: A named location for storing values that can be changed during program execution.

Constant: A named location for storing values that cannot be changed during program execution.

Function: A named set of statements that perform some operation and can optionally return a single value.

Keyword: A word that has a predefined meaning in JavaScript, and cannot be used for any other purpose.

Operator: Typically a symbol (such as +, -, *, or / ) that takes one or more values (called operands) and returns a result.

Expression: A combination of keywords, operators, variables, and/or functions from which a result can be calculated.

String: A sequence of 0 or more letters, numbers, or other text characters; strings are typically enclosed in quotation marks, as in “Hello World!”.

Boolean: A value or expression that evaluates to either true or false.

Literal: A Boolean, number or string that is written directly in the code. For example the expression 22/7*radius*radius contains 2 number literals.

Value: A number, Boolean, string or object.


Javascript Alert, Prompt, Confirm and Write function - (Learning Javascript Series)

Javascript functions: alert, prompt, confirm and write

Alert, prompt and document.write functions are most commonly used for user interaction and writing some content on browser window.

  • Alert is used to display some warning message window
  • Prompt is used to capture user input
  • Confirm is used to capture Yes/No or OK/Cancel response from user in order to perform further activity
  • Write is used to write some text on browser window.

Below are some examples of using these functions.


Using Alert function:


var browserInfo = '';
        browserInfo = "Browser CodeName: " + navigator.appCodeName + "\n\r";
        browserInfo += "Browser Name: " + navigator.appName + "\n\r";
        browserInfo += "Browser Version: " + navigator.appVersion + "\n\r";
        browserInfo += "Cookies Enabled: " + navigator.cookieEnabled + "\n\r";
        browserInfo += "Platform: " + navigator.platform + "\n\r";
        browserInfo += "User Agent: " + navigator.userAgent + "\n\r";





What is JavaScript - (Learning JavaScript Series)

The Javascript Language (File Extension .js)

Javascript is often confused with Java, but It has nothing to do with "Java Programming Language". It is a client side scripting language which supports object oriented, imperative and functional programming style. Javascript is mainly used in web pages and now a days it is implemented as part of web browsers (by default javascript is enabled in most of the browsers, but you can disable if you want). But it is not only restricted to web page and used in pdf documents and desktop widgets as well.

What is scripting language? "Scripting language is not compiled rather it is interpreted. VBScript and Perl are other scripting languages."

Javascript is most frequently used as cilent side validation on web pages. But it is also used in areas like

  • Google Adsense scripts are javascript, which are placed to show ads
  • Google Analytics, web site visitor tracking, is also javascript
  • Javascript is used in serving asynchronous content on web pages

History of Javascript

Javascript was originally developed for Netscape browser by Brendan Eich and was named as "Mocha" and made its first appearance in Netscape 2.0 in 1995, later it renamed to "LiveScript" and finally "JavaScript" as it is been claimed that the name is result of a co-marketing deal between "Netscape" and "Java". JavaScript was originally designed to help integrate HTML pages with "Java applets" - Java applications embedded in web pages. As of year 2011 javascript's current version is 1.8.5.

"JavaScript" is a trademark of "Oracle Corporation" and used under license for technology invented and implemented by "Netscape Communications" and current entities such as the "Mozilla Foundation".

"JavaScript" is officially managed by "Mozilla Foundation" and new language features are added from time to time. However some "Vendor Specific JavaScript" extensions also exist.

"JavaScript" supports much of the structured programming syntax from "C" langugage.


Microsoft.Net Debugging and Tools (.Net Debugging Series)

Debugging is one of most common activity that every developer has to deal with in its day to day development life cycle. So It is very important that one should know the proper debugging technique and also could use the correct tools for debugging that particular issue.

But quite often it happens that developers are using wrong tools trying to investigate a particular problem. Sometimes developers are lucky to identify the exact place of code for the problem. And some times in spite of extensive code review still the problem is not caught because may be they are looking at wrong place or incorrect tool/no tool is used for debugging.

There are many powerful and free investigative tools which can dramatically reduce the troubleshooting time. These tools are very efficient and used by most of the professional developers. As fact we should know that a single tool can not address the every problem as each of these tools focus on a specific category. So knowing when and how to use each tool is very important for debugging .net applications.

Debugging Tools for Windows

URL: www.microsoft.com/whdc/devtools/debugging/default.mspx

Debugging Tools for Windows 32-bit Versions
Debugging Tools for Windows 64-bit Versions

There are three user mode debuggers available in the Debugging Tools for Windows package—NTSD, CDB, and WinDbg—and one kernel mode debugger (kd). Although these debuggers are three separate tools, it is important to understand that they all rely on the same core debugger engine. The most significant difference between the debuggers is that WinDbg has a graphical user interface (GUI) component, making it easier to work with when doing source level debugging. In contrast, NTSD and CDB are purely console-based debuggers. The snippets of debugger conversation that will be outlined in the book are all captured using NTSD.

After choosing the flavor of the debugger (32-bit or 64-bit), the installation process for Debugging Tools for Windows is straightforward and the default installation options are typically sufficient. The default installation path is

%programfiles%\Debugging Tools for Windows

here are several versions available for download. I have used version

Working and Debugging with .Net Framework 2.0

.Net 2.0 SDK Path: (%programfiles\Microsoft.net\SDK)


asp.net SQL server - import export excel worksheet using ado.net

Import/Export E worksheet using ADO.Net

Excel is very known format for storing small amount of data. So you may want your data residing in ms sql or oracle or any other data source do be exported because of any of the following reason:

  • Running calculation to derive the wanted information
  • Doing some statistical computation like MEAN, MEDIAN, MODE
  • Filtering/Sorting
  • Generating Graphical report
  • Making use of PivotTable and PivotChart

Apart from above listed one there exists also lots of other reasons to export data in excel format. Similarily we can use excel to do bulk import of data and put it into sql server database. It is very easy and faster to do data entry in excel sheet and then import those data to rdbms system.

Export to Excel from SQL Server:

There are may ways we can read data from sql server and export to excel sheet like using third party controls, binding data to some data controls and then exporting using "GridView.RenderControl()" method.

But here I am going to show how to export from sql server to ms excel using ado.net.

1. Create an asp.net website project named "ExcelExportImport" and 2 folders to it "DownloadFiles" and "UploadFiles".

2. Download AdventureWorksLT2008 database and attach ot your sql server database. More...

WolframAlpha - Computational Knowledge Engine

Computational Knowledge Engine

Today I was googling to find comparison data between "India" and "USA". I wanted to know all the important data including demographics on a single page and in a comparison chart.

While trying to find some comparison result I browsed wikipedia and google for term "India vs USA". Then I came to know about a site "www.wolframalpha.com" which is in initial phase of their engine.

WolframAlpha is termed as "computational knowledge engine" by their developer and promoter. They have a very good knowledge base data which includes topics like:

  • Mathematics
  • Statistics
  • Physics
  • Chemistry
  • Materials
  • Engineering
  • Astronomy
  • Earth Sciences
  • Life Sciences
  • Computational Sciences
  • Units and Measures
  • Dates and Times
  • Weather
  • Places and Geography
  • People and History
  • Culture and Media
  • Music
  • Words and Linguistics
  • Sports and Games
  • Colors
  • Money and Finance
  • Socioeconomic Data
  • Health and Medicine
  • Food and Nutrition
  • Education
  • Organizations
  • Transportation
  • Technological World
  • Web and Computer Systems

So if you want to know about any particular word related to above topics, you can just type the word and hit enter button and you will see the all the necessary data in a tabular format.


Posts By Month