Thursday, September 20, 2012

Is It Is


Monday, September 17, 2012

Introduction to .NET Framework

.Net Architecture

Over last few years there are so many things that have came into picture in the Microsoft .Net environment that help and support developer more and more. It has introduces many concepts, technology and design terms to extends its capabilities and potential aptitude. Microsoft .Net technology has been one of the most excellent boons for developers that provide rapid application development in true aspect.

Microsoft .NET technology has a great future ahead in all spheres ranging from Desktop Applications, Client Server Applications, Distributed Applications, Enterprise Applications, Web Applications, e-commerce store fronts and the most important Mobile Applications.

Architecture
If someone asks that what are the benefits of .Net to the end users and someone says that common language runtime, ASP.NET, WPF, WCF, LINQ, Parallel LINQ, XML integration, Garbage Collection, and so on. Is it an appropriate to say? Obviously no, it all helps to developer not to end users. The benefit of .Net is to users is the new generation of software that .NET introduces: software that runs anywhere, at anytime, on any platform, and from devices large and small.

The .NET Framework is a software framework. It includes a large library and provides language interoperability (each language can use code written in other languages) across several programming languages. Programs written for the .NET Framework execute in a software environment (as contrasted to hardware environment), known as the Common Language Runtime (CLR), an application virtual machine that provides important services such as security, memory management, and exception handling. The class library and the CLR together constitute the .NET Framework.

The .NET Framework's Base Class Library provides user interface, data access, database connectivity, cryptography, web application development, numeric algorithms, and network communications. The Common Language Runtime (CLR) serves as the execution engine of the .NET Framework. All .NET programs execute under the supervision of the CLR, guaranteeing certain properties and behaviors in the areas of memory management, security, and exception handling.

Common Language Specification (CLS) is a set of basic language features that .Net Languages needed to develop Applications and Services, which are compatible with the .Net Framework. When there is a situation to communicate Objects written in different .Net Complaint languages, those objects must expose the features that are common to all the languages.

CLS defines a subset of Common Type System (CTS). CTS is a standard that specifies how Type definitions and specific values of Types are represented in computer memory.CTS describes a set of types that can use different .Net languages have in common, which ensure that objects written in different languages can interact with each other.
For example CTS defines System.Int32, a 4 byte integer but C# defines int as an alias of System.Int32.

Microsoft .NET is tiered, modular, and hierarchal. Each tier of the .NET Framework is a layer of abstraction. .NET languages are the top tier and the most abstracted level. The common language runtime is the bottom tier, the least abstracted, and closest to the native environment. This is important since the common language runtime works closely with the operating environment to manage .NET application. Since higher tiers request services only from the lower tiers, .NET is hierarchal. The architectural layout of the .NET Framework is illustrated in following figure.

 If we compare the architecture of .Net and Java we find almost same and strong architecture.

Sunday, September 16, 2012

Cross Browser

Introduction

There are several browsers and everyone does not use same browser and each one runs their own rendering engine. So it is not possible that our website or web application would run in each one of them. To avoid all these concept of cross browser came into the picture of internet world.

Cross browser is the concept or ability of website or web application or client-side scripting to work in the environment where they can get required features to run in any browser.

Don’t confuse with the multi browser where website or web application can only work in the environment where they have been guided to work. Cross browser make website or web application to be work in any environment.

Cross Browser Compatibility
Compatibility means functionality in different and alternative environment. It means how to perform equivalently under alternative condition.

Friday, September 14, 2012

Type of Shell

There are several different type shells for UNIX. We will discuss some of these shells.

1. Bourne shell(sh)
2. C shell(csh)
3. TC shell(tcsh)
4. Korn shell(ksh)
5. Bourne Again shell(bash)
6. Almquist shell(ash)
7. Debian Almquist shell(dash)
8. Friendly interactive shell(fish)
9. Es
10. Rc
11. Scsh
12. sash
13. zsh

Bourne shell
This is the original shell by Steve Bourne of Bell Labs. It is not interactive like C shell and korn shell. It is intended as a scripting language and contains all the features to produces structured programs. It is available on all UNIX systems. It is small and fast. It is good for I/O control. Its default prompt is $.

C shell
It was written at the University of California, Berkeley. It is C-like syntax which provides shell scripting. It is a command language interpreter. It provides some additional features as command history, command alias, filename completion and job control. Its default prompt is %.

TC shell
It is enhanced version of C shell. It is a command language interpreter used as interactive login shell as well as shell script command processor. It provides all the features of the C shell together with emacs style editing of the command line, command history, command alias, filename completion and job control.

Korn shell
It was developed by David Korn at Bell Labs. It is considered as standard shell on UNIX systems. It provides all the features of the C and TC shells together. It is backward-compatible with the Bourne shell. The Korn Shell language is also a complete, powerful, high-level programming language for writing applications, and hence suitable for prototyping.

Bourne Again shell
It was written by Brian Fox for the GNU Project as free software. It is default shell on LINUX operating system. It is a command processor and run in text window. It incorporates features from the C Shell and the Korn Shell and conforms to the POSTIX 2 shell specifications.

Wednesday, September 12, 2012

Shell and Shell Script

Shell

Shell is a command interpreter that executes commands reads from the keyboard or from a file. It is user program and not a part of kernel, but uses the system kernel to execute programs.It is a user program that is ASCII based, that allows the user to specify operations in a certain sequence.

Some aspects of shell
1. User interacts with the system using shell.
2. It is a full featured programming language, with variables, conditional statements, and the ability to execute other programs.
3. It allows you to easily create a new program with all of the privileges of any other UNIX program.

Shell script Shell script is series of commands written in plain text file. It is just like a batch file.
Whenever we give command to shell through keyboard, it accepts command and executes them. But when we write command one by one then we can store this sequence of commands to text file and tell the shell to execute this file instead of entering command. This is called as shell script.

Use of Shell Script
1. Shell script is used for manipulation of text or files.
2. Useful to create our own commands.
3. To automate some task of day today life.
4. System Administration part can be also automated.
5. Creating simple application


Partial Page Rendering

Partial Page Rendering

Partial page removes the unnecessary loading whole page as a result of a postback. Instead, only particular regions of the page that have changed are updated. As a result, we do not see the whole page reload with every postback which make more user interaction with the web page.
For example, while updating cricket score refresh button is used to update the score. In this case, only score part of a page is only updated.

We can do in .NET framework by extending exiting ASP.NET application with AJAX and incorporates AJAX functionality.

Touch Optimized Web Framework

Tuesday, September 11, 2012

AJAX Libraries

Ajax libraries are a set of JavaScript libraries that are used to perform client-side process to send request to   the server.
 1.AjaxAnywhere
This library is used to help to develop Ajax based application in JSP or JSF framework. It is designed to turn any set of exiting JSP or JSF component into AJAX –components without complex JavaScript coding. Suppose we have to refresh or update some part of a page then we have to separate our page into multiple parts and use AjaxAnywhere to refresh only that part that needs to be updated or refreshed.

2.AjaxCFC
AjaxCFC is a ColdFusion framework meant to speed up Ajax application development and deployment by providing developers seamless integration between JavaScript and ColdFusion, and providing built-in functions, such as security and debugging, to quickly adapt to any type of environment and helping to overcome cross-browser compatibility problems.

3.Ajax.NET Professional
Ajax.NET professional is a Ajax Framework for themicrosoft.NET framework which we can use with any .NET languages like C#, Vb.NET, F# to create JavaScript proxies to invoke any .NET method from the client side.
4.ANAA-An Ajax API

It is a complete Ajax library written in JavaScript with function to load and save data from and to the server.It's code is easy and simple to understand.It works with PHP or other backends.

5.Anthem.NET
It is Ajax library that supports only ASP.NET 1.1 and ASP.NET 2.0.It depends on classic client id generation.But it can work with upgraded version also with some changes in webcofig file like version.It works on IE,Firefox,safari and under mono also.

6.Dojo
Dojo is a japanese word which means "place of the way".Dojo is one of the mosr powerful language for constructing Ajax based rich internet application.It is a open source modular Javascript library designed to ease the rapid development of cross-plateform,JavaScript ,Ajax based application and web applications.

7.DWR-Direct Web Remoting
It is a Java library that enables Java on the server and Javascript in the browser to interact and call each other in simple way.It is easy Ajax for Java.
It generates the JavaScript to allow web browsers to securely call into Java code like it was running locally.it can marshal virtually any data including collections,XML and binary data like images and pdf files.

8.JsHttpRequest
It is a Ajax library for Ajax based script creation.It is cross browser ajax library used for ajax file uploading from browser to server without page reload.It is an analogue of XmlHttpRequest.It is useful in creating dynamic web page cretaion.It uses JavaScript in frontend and PHP in backend.It iscompatible with Prototype Ajax library.

9.Prototype
It is a JavaScript framework for creation of dynamic web application.It is JavaScript library which enables you to manipulate DOM in a very easy and safe way(cross-browser).It has built in support for classes-style OOP including inheritence

10.Rialto-Rich Internet Application Toolkit

It is Ajax based cross browser JavaScript widgets library. Since it is technology agnostic, it can be encapsulated in JSP, JSF,.NET,Python or PHP graphic components. It is easy to use and create rich internet application development. It’s main target audience are corporate developer and corporate application. If we know Rialto, no need to understand and write DHTML, Ajax or DOM code.
Widgets library includes forms, drag & drop, tree, data list with fix header and resizable columns, pop up, splitter. Rialto enables single page interface application development. It is available under open source Apache License.

11.Rico
Rico is an open source JavaScript library for developing rich internet applications that uses Ajax. It uses Prototype JavaScript framework library and JSON standard. Since Rico uses the Prototype library, which contains classes for using Ajax, Rico provides a very simple interface for registering Ajax request handlers as well as HTML elements or JavaScript objects as Ajax response objects. Multiple elements and/or objects may be updated as the result of one Ajax request. Rico provides one of the simplest interfaces for enabling your web application to support drag and drop. Just register any HTML element or JavaScript object as a draggable and any other HTML element or JavaScript object as a drop zone and Rico handles the rest.

12.Sajax-Simple Ajax Toolkit
Sajax is an open source tool to make web applications using the Ajax framework. Sajax makes it easy to call PHP, Perl or Python functions from your WebPages via JavaScript without performing a browser refresh.

13.Sardalya
It is a cross-browser AJAX Framework, designed to work in all DOM-supporting browsers, aiming to make DHTML programming easy and fun.

14.Visual WebGui
Visual WebGui is the only .NET based platform that enables the development and modernization of Client-Server applications for native Web (Cloud) & Mobile deployments. It enables moving existing Client-Server applications to native Web, Cloud & Mobile environments without risky, expensive rewrite and reengineering.

15.WebORB
WebORB for .NET was designed for universal connectivity, which means it supports multiple client-side technology connectivity with .NET server-sider resources. Multi-client support is especially important when you want to port an existing application to multiple client-side technologies, such as Flex and iOS. The client-side technologies currently supported by WebORB for .NET include Flash,Flex,Silverlight,AJAXand JSON.



Electric Car Revolution: Wirelessly transfer electricity from roads to cars

Now time has come to fly car in the air. Physicists have taken one step in that direction. They are working on technology that will wirelessly transfer electricity from road to electric car using magnetic fields to send the power from one place to other place and provide the cars with an unlimited range.

Today's most advanced electric car have a range of little more than 160km.The system is in development at Stanford University,California.It would allow vehicles to be charged while they are driven, with copper wire beneath the road surface transferring electricity to identical coil under the car.
Shanhui Fan, associate professor of electric engineering at Stanford is leading the research and said t his team has proved that physics works. In his system, an alternating current passes through copper coils in the road producing the oscillating the magnetic field. The coils under the car detect this field and convert tit back into electricity.
Other system has been developed also to transfer electricity to vehicles but only Fan's team said that it would allow transferring electricity to a range of long distance. So vehicle would have driven so accurately above the coils.
But "What we have not done is to build a road and test transferring power to electric car" said Fan.
Reference-BBC Knowledge Magazine

Thursday, September 6, 2012

AJAX and ASP.NET

Basic Controls of ASP.NET AJAX

There are some ASP.NET Web server controls that enable you to add Ajax functionality to an ASP.NET Web page. Ajax functionality includes re-rendering parts of a page with a partial-page update and therefore avoiding a full-page postback.
These controls are ScriptManager, ScriptManagerProxy, Timer, Update Panel and Update Progress.

ScriptManager
When it is used.?
1. Whenever we want client-script functionality of the Microsoft Ajax Library and any custom script that we want to send to the browser.
2. While partial-page rendering which enables regions on the page to be independently refreshed without a postback. The ASP.NET UpdatePanel, UpdateProgress and Timer Controls require a ScriptManager in order to support partial-page rendering.
3. When we want client script to access Web services and specially marked methods in ASP.NET pages, it needs to enable JavaScript proxy classes for Web services.
4. To access ASP.NET authentication, profile and roles application services, JavaScript Classes is needed and must be enabled by ScriptManager.

ScriptManager enables client-script functionality, partial-page rendering, JavaScript proxy classes and JavaScript Classes on a page.
When a page contains one or more UpdatePanel controls, the ScriptManager control manages partial-page rendering in the browser. The control interacts with the page life cycle to update the parts of the page that are inside UpdatePanel controls. The EnablePartialRendering property of the ScriptManager control determines whether a page participates in partial-page updates. By default, the EnablePartialRendering property is true. Therefore, by default partial-page rendering is enabled when you add a ScriptManager control to the page.

ScriptManagerProxy
Only one instance of the ScriptManager control can be added to the page. The page can include the control directly or indirectly inside a nested component such as a user control, content page for a master page, or nested master page. If a page already contains a ScriptManager control, but a nested or parent component needs additional features of the ScriptManager control, the component can include a ScriptManagerProxy control.

Timer
To avoid the refreshing whole page and to refresh only some region of page or content of UpdatePanel, a timer control is used for this purpose.

UpdatePanel

UpdatePanel control is used to create rich, dynamic and client-centric Web applications. By using UpdatePanel control, we can refresh selected parts of the page instead of refreshing the whole page with a postback.This is called as partial page update. An ASP.NET Web page that contains a ScriptManager control and one or more UpdatePanel controls can automatically participate in partial-page updates, without custom client script. When we use an UpdatePanel control, the page behavior becomes browser independent and can potentially reduce the amount of data that is transferred between client and server.


Tuesday, September 4, 2012

God's code

It is about how nature work and how functions of nature work?It is about the interrelationship between the functions of nature.

Monday, September 3, 2012

JSON for ASP.NET

We have seen that JSON text can easily be created and parsed from JavaScript code. Whenever JSON is used in ASP.NET web application, only browser part of the application used JavaScript since server side code is written in VB or C#.


There are many Ajax library designed for ASP.NET that provides support for programmatically creating and parsing JSON text. So we have to consider one of these libraries to work with JSON in a .net application. We will discuss about one library Jayrock. Jayrock is a modest and an open source (LGPL) implementation of JSON and JSON-RPC for the Microsoft .NET Framework, including ASP.NET.

Working with JSON in .NET using Jayrock is similar to working with XML through the XmlWriter, XmlReader, and XmlSerializer classes in the .NET Framework. There are some classes JsonWriter, JsonReader, JsonTextWriter and JsonTextReader used for interfacing with JSON at a low and stream oriented level. Using these classes. SON text can be created and parsed through a series of method calls. For example, using the JsonWriter class method WriteNumber(number) writes out the appropriate string representation of number according to the JSON standard. The JsonConvert class offers Export and Import methods for converting between .NET types and JSON. These methods provide a similar functionality as found in the XmlSerializer class methods Serialize and Deserialize, respectively.

Using Class JsonTextWriter
StringBuilder sbl=new StringBuilder();
StreamWriter swr = new StreamWriter(sbl);
JsonTextWriter writer = JsonTextWriter(swr);
writer.Formatting = Formatting.Indented;
writer.WriteStartObject();
writer.WritePropertyName("Job");
writer.WriteValue("Manager");
writer.WriteEndObject();
string output = sw.ToString();
writer.Close();
sw.Close();

Parsing JSON Text-Using Class JsonTextReader
The JsonTextReader class provides methods to parse the tokens of JSON text with the help of method Read. Each time the Read method is invoked, the parser consumes the next token, which could be a string value, a number value, an object member name, the start of an array, and so forth. Where applicable, the parsed text of the current token can be accessed via the Text property. For example, if the reader is sitting on Boolean data, then the Text property will return "true" or "false" depending on the actual parse value.

string jsonText = @"[""A"", ""B"", ""AC"", ""D"", ""E"", ""AF"", ""GA""]";
using (JsonTextReader reader = new JsonTextReader(new StringReader(jsonText)))
{
while (reader.Read())
{
if (reader.TokenClass == JsonTokenClass.String && reader.Text.StartsWith("A"))
{
Console.WriteLine(reader.Text);
}
}
}

Sunday, September 2, 2012

JSON-Java Script Object Notation

Introduction
JSON is lightweight data interchange format. It is easy to understand and describe because it is a plain text. Since it is text format, hence language independent. It is much like XML but easier and faster. It uses conventions like C, C++, C #, Java, JavaScript and many other languages.

JSON is syntax for storing and exchanging text information like as XML.It is a subset of JavaScript. It uses JavaScript syntax for describing data objects, but is still language and platform independent. It is like XML because it is plain text and human readable, hierarchical and can be parsed by JavaScript.

The JSON format is often used for serializing and transmitting structured data over a network connection. It is used primarily to transmit data between a server and web application, serving as an alternative to XML.

JSON is built on two structures:
1. A collection of name/value pairs. In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array.
2. An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence.

JSON Syntax Rules

1. Data should be in pairs separated by colon (":")
For example, “Name":"Ravi”. This is similar to JavaScript syntax: Name="Ravi"
2. Data should be separated by comma (,)
For example, “Name":"Ravi”, “Phone":"9656757865","Age":"23"
3. Objects should be in curly brackets ("{}").
{"Name":"Ravi”, “Phone":"9656757865","Age":"23"}
4. array should be defined in square bracket("[]").
"information":{[{"Name":"Ravi”, “Phone":"9656757865","Age":"23"},
                       {"Name":"Javi","Phone":"7756757865","Age":"24"}
]}

JSON Values
JSON values can be a number or a string or a Boolean or an array or an object or null.

JSON Object
For example,
{"Name":"Ravi”, “Phone":"9656757865","Age":"23"}

JSON Array
{"information":{[{"Name":"Ravi","Phone":"9656757865","Age":"23"},

{"Name":"Javi","Phone":"7756757865","Age":"24"}
]}
};

Creating objects in JSON
Since JSON uses JavaScript syntax, will see how to create object in JSON
var object1={"information":[
{"Name":"Ravi”, “Phone":"9656757865","Age":"23"},
{"Name":"Javi","Phone":"7756757865","Age":"24"}
]
};
Here object1 is a object and information is a single member of it. Member bindings containing two objects each containing three members Name, Phone and Age.

 How to retrieve member of object?
In the given example, for retrieving member we can write

object1.information [0].Phone //we will get "9656757865"
object1.information [1].Age //we will get "24"

How to convert JSON text into a object?
Since JSON uses JavaScript syntax, method eval() is used for this. So to avoid ambiguity we prefer the text to be wrapped in parenthesis.
For example, var object2=eval ('(''+object1+)');
The eval function is very fast.However,it can compile and execute any JavaScript program, so there can be security issues. The use of eval is preferred when the source is trusted and competent. It is much safer to use JSON parser.

JSON Parser
In web applications over XMLHttpRequest, communication is permitted only to the same origin that provided the page, so it is trusted but it cannot be competent. If server is not rigorous in its JSON parser encoding or if it does not scrupulously validate all of its inputs, then it could deliver invalid JSON text that could be carrying dangerous script. The eval function would execute the script, unleasing its malice.

To defend against this, a JSON parser should be used. A JSON parser will recognize only JSON text, rejecting all scripts. In browser that provides native JSON support, SON parsers are much faster than eval. It is expected that native JSON support will be included in the next ECMAScript standard.
For example:
data1=JSON.parse (Object1, reviver);
Here reviver is a function that will be called for every key and value at every level of this final result. Each value will be replaced by the result of reviver function. This can be used to reform the generic objects into instances of pseudo classes or transform date string into date objects.

JSON Stringifier
It converts JavaScript data structure into JSON text.


Copyright © Codingnodes,2014.All Rights Reserved.