Saturday, January 9, 2010

SENTENCE:
SIMPLE SENTENCE

The basic English language sentence is called a simple sentence. It requires a subject and a verb. We ordinarily include some additonal words that explain the subject. The sentence or a part of a sentence that contains a subject and a verb and constitutes a complete thought is called an independent clause.


COMPLEX SENTENCE


A complex sentence contains an independent clause and a subordinate clause. The independent clause can function as a complete sentence. The subordinate clause also contains a subject and a verb but cannot function as an independent sentence.

IMPORTANCE OF ENGLISH GRAMMER

IMPORTANCE OF ENGLISH GRAMMER

We know that the strength of a tree lies in its roots. Similarly the strength of any spoken language lies in its grammar. So if you seriously want to improve your spoken English, then you have to work on your grammar. Getting a good hold on grammar is required so that you can speak correct English. I have seen many speakers who speak incorrect grammar while speaking in English.

Having a perfect grammar is very hard, but the English grammar used for daily life can be easily attained by going back to your school books for grammar. Have a tight grip over your Nouns, Pronouns, Verbs, Adjectives, Adverbs and Prepositions.

The English Grammar school books that we thought of as very boring are the best resource for English Grammar available. The topics there are explained in a very descriptive and basic way, so as to help even a child gain confidence in English. Once you have chosen ESL, then be sure that you have made the right choice.

There are many other ways also to build up your grammar like speak in English to a teacher, watching English Movies to get the correct grammar usage, etc., you need not be a master for it, but the basic skill set is required. Grammar is something which goes within you and the output is quality English. It defines the basic rules for the English language and must be adhered to.

The way you express yourself during communications gives off hints as to your knowledge and education. The use of correct grammar at all the occasions will cause people to perceive you as a good English knowing person. On the contrary if incorrect usage of English grammar is done, then the impression formed on others is a very poor one and they might take you to be poorly educated. This explains why we need to go the depths of English and that is grammar itself.

All you need to get started is a good English grammar book and some time to spare everyday for reading and practicing it. The more you get used to working on your grammar, the more your English will automatically improve. This is similar to the fact that if a tree is dying, then the probable reason is the lack of water reaching the roots. So there is no advantage in watering the leaves, but the person has to water the roots. Similarly you need to provide food for the basic requirement of English.

Learning grammar can be boring initially, but once you gain momentum and start learning new rules, it will start to become fun. Remember that the more you learn the more confident you will become.

Exception:,Inheritance:

Exception:


The C# language's exception handling features provide a way to deal with any unexpected or exceptional situations that arise while a program is running. Exception

handling uses the try, catch, and finally keywords to attempt actions that may not succeed, to handle failures, and to clean up resources afterwards. Exceptions can be generated by the common language runtime (CLR), by third-party libraries, or by the application code using the throw keyword.
A try block is used by C# programmers to partition code that may be affected by an exception, and catch blocks are used to handle any resulting exceptions.

Within the class we need to add new line “throw new Exception (“ Speed already zero” )” which will be executed when a value less then zero.
Inheritance:
Please refer to the definitions of inheritance discussed in lecture # 1
In order to have a practical solution of inheritance let’s make another class named SportsCar. The class will have similar characteristics of car except that acceleration and braking is faster. Following is code for class SportsCar


The class sports car overrides the accelerate method of class car in other words, of the two accelerate methods present in class SportsCar (one created here and the other one inherited from class car) the method declared in subclass will take precedence.
For this code to work properly “virtual” keyword needs to be appended before each method. Formally speaking, A virtual function is a member function that you expect to be redefined in derived classes. When you refer to a derived class object using a pointer or a reference to the base class, you can call a virtual function for that object and execute the derived class's version of the function.
Analysis of Algorithms


How good is the algorithm?
time efficiency
space efficiency

Does there exist a better algorithm?
lower bounds
optimality

Greedy approach

Problem: What is fib(200)? What about fib(n), where n is any positive integer?


Algorithm 1 fib(n)
if n = 0 then
return (0)
if n = 1then
return (1)
return (fib(n − 1) + fib(n − 2))



Questions that we should ask ourselves.
1. Is the algorithm correct?
2. What is the running time of our algorithm?
3. Can we do better?

Algorithm Design Techniques/Strategies

Brute force

Divide and conquer

Decrease and conquer

Transform and conquer

Space and time tradeoffs

Greedy approach

Dynamic programming

Backtracking

Branch and bound

Imam Muslim

The full name of Imam Muslim is Abu'l-Husain 'Asakir-ud-Din Muslim b. Hajjaj al-Qushayri al-Naisaburi. "Muslim," as his nasba shows, belonged to the Qushayr tribe of the Arabs, an offshoot of the great clan of Rabi'a. He was born in Naisabur (Nishapur) in 202/817 or 206/821. His parents were religiously minded persons and as such he was brought up in a pious atmosphere. This left such an indelible impression on his mind that he spent the whole of his life as a God-fearing person and always adhered to the path of Righteousness. He was in fact a saint of high calibre. His excellent moral character can be well judged from the simple fact that he never indulged in backbiting, a very common human failing.

Imam Muslim travelled widely to collect traditions in Arabia, Egypt, Syria and Iraq, where he attended the lectures of some of the prominent Traditionists of his time: Ishaq b. Rahwaih, Ahmad b. Hanbal, 'Ubaydullah al-Qawariri, Qutaiba b. Sa’id, 'Abdullah b. Maslama, Harmalah b. Yahya, and others.

Having finished his studies, be settled down at Nishapur. There he came into contact with Imam Bukhari, and was so much impressed by his vast knowledge of Hadith and his deep insight into it that he kept himself attached to him up to the end of his life. He was an ardent admirer of another great-teacher of Hadith, Muhammad b.Yahya al-Dhuhali and attended his lectures regularly, but when the difference of opinion between Muhammad b. Yahya and Imam Bukhari, on the issue of the creation of the Holy Qur'an, sharpened into hostility, Imam Muslim sided with Imam Bukhari and abandoned Muhammad b. Yahya altogether. He was thus a true disciple of Imam Bukhari.

He wrote many books and treatises on Hadith, but the most important of his works is the collection (Jami’) of his Sahih Some of the commentators of Ahadith are of the opinion that in certain respects it is the best and most authentic work on the subject. Imam Muslim took great pains in collecting 300,000 Traditions, and then after a thorough examination of them retained only 4000, the genuineness of which is fully established.1

He prefixed to his compilation a very illuminating introduction, in which he specified some of the principles which he had followed in the choice of his material.

Imam Muslim has to his credit many other valuable contributions to different branches of Hadith literature, and most of them retain their eminence even to the present day. Amongst these Kitab al-Musnad al-Kabir 'Ala al-Rijal, Jami' Kabir, Kitab, al-Asma' wa'l-Kuna, Kitab al-Ilal, Kitab al- Wijdan are very important.
His Methods of Classification and Annotation

Muslim's Sahih comes next to it. However, in certain respects the latter is considered superior to the former. Imam Muslim strictly observed many principles of the science of Hadith which had been slightly ignored by his great teacher Imam Bukhari (may Allah have mercy on both of them). Imam Muslim considered only such traditions to be genuine and authentic as had been transmitted to him by an unbroken chain of reliable authorities and were in perfect harmony with what had, (been related by other narrators whose trustworthiness was unanimously accepted and who were free from all defects.

Moreover, Imam Bukhari, while describing the chain of narrators, sometimes mentions their kunya and sometimes gives their names. This is particularly true in case of the narrators of Syria. This creates a sort of confusion, which Imam Muslim has avoided.

Imam Muslim takes particular care in according the exact words of the narrators and points out even the minutest difference in the wording of their reports.

Imam Muslim has also constantly kept in view the difference between the two well-known modes of narration, haddathana (he narrated to us) and akhbarana (he informed us). He is of the opinion that the first mode is used only when the teacher is narrating the hadith and the student is listening to it, while the second mode of expression implies that the student is reading the hadith before the teacher. This reflects his utmost care in the transmission of a hadith.

Imam Muslim has taken great pains in connecting the chain of narrators. He has recorded only that hadith which, at least, two reliable tabi'in (successors) had heard from two Companions and this principle is observed throughout the subsequent chain of narrators.
His Students

Imam Muslim had a very wide circle of students, who learnt Hadith from him. Some of them occupy a very prominent position in Islamic history, e.g. Abu Hatim Razi, Musa b. Harun, Ahmad b. Salama, Abu 'Isa Tirmidhi, Abu Bakr b. Khusaima, Abu ‘Awana and Hafiz Dhahabi.
His Death

Imam Muslim lived for fifty-five years in this world. Of this short span of his life he spent most of his time in learning Hadith, in Its compilation, in its teaching and transmission. He always remained absorbed in this single pursuit and nothing could distract his attention from this pious task. He died in 261/875, and was buried in the suburbs of Nishapu

THE HISTORY AND DEVELOPMENT OF MULTIMEDIA::A STORY OF INVENTION, INGENUITY AND VISION.

Today multimedia might be defined as the seamless digital integration of text, graphics, animation, audio, still images and motion video in a way that provides individual users with high levels of control and interaction. The evolution of Multimedia is a story of the emergence and convergence of these technologies.

As these technologies developed along separate paths for disparate purposes, visionaries saw the possibilities for the sum of the parts as well potential personal application in the broader societal context This chapter highlights visionaries and technological developments from the development of the printing press to the emergence of the WWW .

"The historian, with a vast chronological account of a people, parallels it with a skip trail which stops only at the salient items, and can follow at any time contemporary trails which lead him all over civilisation at a particular epoch. There is a new profession of trailblazers, those who find delight in the task of establishing useful trails through the enormous mass of the common record. The inheritance from the master becomes, not only his additions to the world's record, but for his disciples the entire scaffolding by which they were erected." Vannevar Bush (1945).

This chapter is constructed around five themes developed over a time line. Presented within an interactive timeline framework, the reader has the option to pursue elaboration with a click of the mouse.

Visionaries: From the ingenious idea of the programmable computer, trace the innovations of the outstanding thinkers that had a direct impact on the explosion of the technological age.

Text, Processing and Software: Inventions and innovations that spawned the development of software enabling computers to move from mathematical processing to technology that creates and delivers multi media.

Computers: From the printing press through the exclusive military and academic and corporate worlds trace computer development into the ubiquitous role of the desktop personal computer of today.

Audio & Communication: From the telegraph signal to cellular telephones, follow the development from signal transmission to digital transmission of voice

Video &Animation: From manually manipulated negative film and hand drawn sketches, video and animation develops to sophisticated digital creation and rendering of motion

INTRODUCTION ABOUT Microsoft .NET,common language runtime (CLR):,MSIL (Microsoft Intermediate Language): ,Metadata:

Microsoft .NET is actually a set of Microsoft software technologies for connecting information, people, systems, and devices. It enables a high level of software integration through the use of Web services that are small, discrete, building-block applications that connect to each other as well as to other, larger applications over the Internet.

.NET Framework 2.0 is a part of Microsoft .NET. To understand what is .NET Framework 2.0 lets first see that what is meant by the term framework.

Framework:
It is a set of assumptions, concepts, values, and practices that constitutes a way of viewing reality. An example of framework is “The Primary Framework for literacy and mathematics” developed by the “Department of Children, Schools and Families, UK”. This framework has been designed to support teachers and schools to deliver high quality learning and teaching for all children. It contains detailed guidance and materials including concepts, values and practices to support literacy and mathematics in primary schools and settings.

Software Frameworks: support the development of software by providing collection of items which are reusable as a group. They have carefully designed plug–points into which the user inserts code to customize or extend the framework.

The .NET framework thus is a set of concepts, values, practices and items that can be used to develop next generation of applications. The .NET framework has plug-In points defined that allow users to write code inorder to develop customized applications. The .NET framework has two main components,
The common language runtime (CLR): The CLR can be considered as an agent that manages code at execution time, providing core services such as memory management, thread management, and remoting, while also enforcing strict type safety and other forms of code accuracy that promote security and robustness.

The .NET framework class library: The class library is a comprehensive object oriented collection of reusable types/classes that can be used to develop a range of applications.

If we look into what enables the CLR to manage the code execution, we will come to the conclusion that a major role in performing this activity is played by metadata and MSIL (Microsoft Intermediate Language).

MSIL (Microsoft Intermediate Language):
When compiling to managed code, the compiler rather than producing an executable version of your code, translates your source into a psuedocode known as Microsoft Intermediate language (MSIL). MSIL is a CPU-independent set of instructions that can be efficiently converted to native code. MSIL defines a set of portable instructions that are independent of any specific CPU. In short, MSIL defines a portable assembly language

Metadata:
Compilers that target the runtime’s facilities must emit metadata in the compiled code that describes the types, members and references in the code. The runtime uses metadata to locate and load classes, layout instances in memory, resolve method invocations, generate native code, enforce security and set run-time context boundaries.

How CLR Works IN Microsoft .NET

How CLR Works
The result of compiling a C# program is not an executable but it is MSIL
When you compile a C# program output containing MSIL is generated rather than native executable code. It is the job of the CLR to translate the intermediate code into executable code when a program is run. Thus, any program compiled to MSIL can be run in any environment for which the CLR is implemented. This is one of the factors that contribute towards the portability of .NET applications. It is also important to know that CLR converts Microsoft Intermediate Language into executable code by using a JIT compiler. This conversion, as the name of the compiler suggests, is on demand basis as each part of your program is needed.
Managed Code & Unmanaged Code:

Code that is executed by CLR is sometimes referred to as managed code, in contrast to unmanaged code which is the one that is compiled into native machine language rather than MSIL and targets the system directly rather than communicating with CLR.

what is C# Language:

C# Language:

C# is an elegant and type-safe object-oriented language that enables developers to build a wide range of secure and robust applications that run on the .NET framework. You can use C# to create miscellaneous type of applications including those that run on desktop, that are hosted by a web-server etc. C# is considered to be a highly expressive language, simple and easy to learn language. The syntax has been made similar to that of java and c++ thus programmers of these languages can learn C# within no time. However the syntax of C# simplifies many of the complexities that were there in C++. This simplification was done by java as well, however C# introduces a number of powerful features that are not available in java.

Drawbacks of Procedural Programming:

Drawbacks of Procedural Programming:
• It is often the case that methods have dependencies between each other therefore when updating a function it might be required to update other dependencies as well. However if the dependencies are distributed in various modules then it will be a lengthy task to track and update the dependents accordingly. In order to avoid such situations the phenomenon of cohesion was adapted which suggested the grouping of only related functions into a module.
• Another problem in the procedural paradigm was that emphasis was only laid on the actions or functions, however the actual purpose for which computer programs are made is the storage and management of data, which was given 2nd class status in procedural programming.
• In addition to this there was another problem related to data that was irritating the developer community. Actually in functional programming every function had complete access to data; this resulted in chances that a function having poor logic will modify the important data in an unexpected way thus negatively affecting other functions as well.
• Another problem related to data was that if all functions had access to data and the storage pattern of data was changed then all the functions should be modified accordingly.

The article talks about the flu and what causes it and how to resist it using home remedies and some common sense health approach

Prepare for Avian Influenza!

Various U.S. and U.N. agencies and the Council on Foreign Relations
are spreading the word that the Avian Influenza, if it breaks out this fall or
winter, could be as severe as the worldwide Spanish Influenza epidemic
of 1918, and they are predicting hundreds of millions of deaths worldwide.

This influenza, currently isolated in China, is a hemorrhagic illness.
It kills half of its victims by rapidly depleting ascorbate (vitamin C)
stores in the body, inducing scurvy and collapse of the arterial
blood supply, causing internal hemorrhaging of the lungs
and sinus cavities.

Most people today have barely enough vitamin C in their bodies
(typically 60 mg per day) to prevent scurvy under normal living conditions,
and are not prepared for this kind of illness. (Vitamin C deficiency
is the root cause of many infant and childhood deaths worldwide,
and it is the root cause of Sudden Infant Death Syndrome - SIDS.)

The way to prepare yourself and protect your family from this influenza
is not a vaccine or anti-viral drug. If vaccines and/or anti-viral drugs are
offered to you, please refuse them. These actually reduce your immunity;
vaccines contain many toxic components, such as aluminum and
mercury, and anti-viral drugs interfere with critical body processes.

Historical evidence of vaccinations has shown that they actually
increase the chances of becoming severely ill. The best way to
prepare for influenza is by enhancing your immune system
and increasing the amount of vitamin C in your body.

The supplements I suggest below can be obtained at good quality
supplement stores such as Vitamin Shoppe or online at supplement
discounters although the powdered varieties are
generally only available online. Buy good quality supplements
such as those made by NOW Foods, Source Naturals, Jarrow,
Nature's Way, Vitamin Shoppe (store brand), etc. (These are not
endorsements, but suggestions based on my personal experience).

Do not use drug store supplements.

1. Begin increasing the amount of vitamin C that you take each day
to very high levels, spread over the course of the day, in divided doses
taken with meals. Start at 1000 mg per meal, and increase slowly to
2000-4000 mg per meal. (These are adult doses, modify by body weight
for children.) Your optimal dose is just below the point where your body
complains by giving you mild diarrhea.

This is called the "bowel tolerance dose."


Such doses are perfectly safe - vitamin C is natural to our bodies
and needed for many body processes. Most people don't get nearly
enough. Stock up on this vital nutrient - buy in powder form,
1-pound or 3-pound canisters (ascorbic acid form).

Mix with water or fruit juice. Be sure to take vitamin C with food
that will coat your stomach to prevent stomach upset,
such as organic soymilk.

2. Take 6000 mg of the amino acid lysine per day, 2000 mg per meal
(adult dose, modify by body weight for children).

Lysine is a natural protease inhibitor -

it prevents bacteria and viruses from spreading in your body.
You can obtain it in tablet, capsule, or powder form.
The latter form is the least expensive;
buy several pound containers of it.

3. Take a high-potency multivitamin/ multimineral tab, and a
calcium/magnesium supplement, every day.

4. Drink at least 2 quarts (8 cups, 2 liters) of non-caffeinated liquids
per day. Spring water and/or decaffeinated green tea made with
spring water are best. Do not drink diet soda or consume anything
with aspartame or other artificial sweeteners.

5. Stock up on other anti-viral agents and nutrients: l-proline and
l-glycine (amino acids - at least one pound of each, in powder form),
turmeric extract capsules, ginger capsules, garlic capsules,
15-mg zinc/1-mg copper capsules or tabs, oil of oregano
(Gaia Herbs brand is a good one), decaffeinated green tea extract,
N-Acetyl Cysteine (NAC), and non-gmo or organic soy protein drink
concentrate.
(Note to expectant mothers: Do not use oregano oil or green tea extract.)

6. In advance (right now), find a chelation or alternative health clinic
that is willing to administer intravenous vitamin C infusions.
This may be necessary if you are stricken by the Avian Flu and
find that you cannot keep up with it with the oral dosage.

(Refer to Dr. Robert Cathcart's intravenous vitamin C preparation
document if the clinic needs this information:
http://www.orthomed .com/civprep. htm )

7. If you do become ill, start increasing your vitamin C dosage
dramatically - your bowel tolerance dose will rise as it is used to
detoxify your body from the virus toxins; it may rise to as much as
100,000-200, 000 mg (100 to 200 grams) per day (adult dose).

Take up to 4000 mg per dose, with increased number of dosages.
Start taking 12,000 mg of each of l-lysine, l-proline and l-glycine per day,
in divided doses. Take 1000 mg oregano, 4000 mg turmeric extract,
4000 mg ginger, 4000 mg garlic, 45 mg zinc/3 mg copper,
1500 mg N-acetyl cysteine (NAC), and 2000 mg green tea per day,
in divided doses.

Increase fluid intake to 3-4 quarts (liters) per day. (These are the
adult doses, modify by weight for children.) Eat easily-digestable meals
complemented with 1/2-scoop soy protein shakes.

Continue this regimen until all signs of illness have subsided.
If the illness is not controlled by the regimen, obtain a series
(2-3 per week) of 30-gram Vitamin C intravenous infusions at a
chelation or alternative health clinic, with higher dosages if necessary
for pneumonia or previously compromised immunity
(e.g., AIDS or CFIDS). (Important: See note above regarding use
of this regimen during pregnancy; do not use oregano oil or green tea
extract during pregnancy.)

8. If you are currently taking Lipitor or another cholesterol- lowering (statin)
drug, stop taking it immediately. These drugs are very damaging to the
immune system. The above vitamin C and lysine regimen will (through a
completely different mechanism) naturally balance your cholesterol and
protect you from heart disease. If you continue to take a maintenance
dose of 6000 mg of vitamin C and 6000 mg of lysine per day,
you will never need to take statin drugs ever again.

(For more information on this, click here for an article about statin side
effects, and an excellent article at Dr. Mercola's website
http://www.mercola. com/article/ statins.htm )

9. You must take the regimen above every day, consistently.
After the danger period has passed, I recommend that you continue
the regimen at the level of 6000 mg vitamin C and 6000 mg lysine
per day (adult dose, modify by weight for children).

You will enjoy better health, lose fewer days to illness, and protect
yourself against heart disease. (If you choose not to continue the regimen,
please taper off gradually.) Use your stocks of anti-viral nutrients
for any illness you may encounter.

WHAT IS THE DATA TYPES & HOW MANY TYPES OF DATA

Array:
Array is a very good example of how simple structures combine together to form a composite structure or type. (Composite data types are those that are made of other data types/structure).
An array is defined as a:
• List of values
• All of same type

• Individual elements identified by an index
• Variable holds the address of first element in the list
In the declaration of array an integer is passed which specifies the size of array. Whereas while using the array an integer is passed that indicates the index from which the value should be fetched. Indexes start from zero
Implementation of Array:
In memory arrays are allocated as contiguous blocks. As mentioned that for accessing individual elements it is required to pass an index. This index value multiplied by size of each block is then added to the address of first element of array in order to obtain the address of a particular block.

Multi-dimensional arrays

Arrays can have more dimensions, in which case they might be declared as:-
int results_2d[20][5];
int results_3d[20][5][3];
Each index has its own set of square brackets.
It is useful in describing an object that is physically two-dimensional, such as a map or a checkerboard. It is also useful in organizing a set of values that are dependent upon two (or more) inputs.
Posted by Zubi at 1:40 PM 1 comments
WHAT IS THE DATA TYPES & HOW MANY TYPES OF DATA

Data Type:

A data type is composed of two things
• Range of possible values
• Set of operations that can be performed on data.

Initially languages provided a non-extensible data type system. But as the benefits of software technology became clear, people started to apply technology to solve complex and diversified set of problems, thus a need for extensible data-type system was felt.
By extensible it is meant that apart from using the built-in data types of a language, programmers can use these types to create their own data types such data types.
Some major categories of data types include:
Binary and Decimal Integers: (Converted into a bit string where the left most bit represents the sign of number).
Real Numbers: (In a 32-bit space, 24-bits represent the coefficient and 8 bit represent exponent)
Character Strings: (Also converted into bit strings but by means of encoding a specific bit-string is associated with a character. An eight bit binary sequence is capable of representing 255 characters)
Abstract Data Types (ADTs)
As mentioned above that a data type is a set of values and relevant operations. The collection of values and operations form a mathematical construct or represent a mathematical concept that may be implemented using a particular hardware or software data structure. The term “abstract data type” refers to the basic mathematical concept that defines the data type. The definition of ADT is not concerned with implementation details
Variable: variable is something whose value does not remain same. In order to ensure that machine understands the program correctly, a programmer must specify the data type of a variable.
Variables and Computers Memory: whatever value is assigned to a variable, it is converted into a bit string and stored into memory. By bit string we mean a series of “1s” and “0s”. (i.e. data is converted into binary). The computer’s memory is actually only capable of holding one of two values i.e. “1” which means “ON” (“presence of specific voltage”) and 0 which means OFF (“absence of specific voltage”)

Variable Declaration:

The statement that creates a variable is known as declaration. Declaration includes the data type and name of variable. Following is an example of declaration
int a;
The above statement communicates that “a” should have the data type “int”. i.e. it is capable of storing the range of data supported by “int” and all the operations of “int” can be applied on “a”. This statement will also cause memory to be allocated which will be referred by the variable “a”. Each memory location will have an address.
Address Operator can be used to retrieve the address of particular variable. e.g. “&a” will retrieve address of “a”
Pointers and Pointer Variable:
The address of a particular variable is often known as pointer and variables that hold the address of a pointer are known as pointer variable

DEFINATION OF LABEL CONTROL , STRING CONSTANT , VARIABLES(in .net)

Label Control:

Currently the form does not contain any indication about what should be entered in the textbox. For such a purpose, Label control is used and the process of adding it is same. As in other controls studied so far “Text” property here is also used for indicating what should be displayed in the Label

String constant:

When you observe the above codes regarding message box you will identify that when displaying a predetermined set of characters (also known as String) in the message box, we used double quotes (“”). However when we wanted the contents of textbox which obviously depends upon the input of the user, we didn’t use the double quotes. Actually when any thing is written outside double quote it is considered to be something that the compiler/runtime should evaluate however things that are written in double quotes are considered as string constants

Variables:

Variables are place holders that can hold data values. For example age can be stored in a variable for further processing. Similarly Text property of TextBox is also a variable as it stores string values that are typed in the textbox.
Since C# is a strictly typed language therefore you must identify the data-type (e.g, integer, decimal, etc) while creating a variable. The process of creating a variable is known as declaration. Following is an example of declaring and integer variable. The example also includes statement to store a value in the declared variable which is known as assignment. When the variable is assigned a value first time, it is known as initialization.


The above statements can be combined into a single one which is indicated as follows


Variables are also created in classes but when created in classes they are known as properties. For example Microsoft created a variable named Text in class Label which is termed as property of label

DESCRIPTION ABOUT EVENT CLASSES IN JAVA (OBJECT ORIENTED PROG)

EVENT CLASSES


The classes that represent events are the core of java’s event handling mechanism .
thus we begin our study of event handling with a tour of the event classes .As our will see,they provide a consistent ,easy-to-use means of encapsulatating events.
At the root of java event class hierarchy is Eventobject, which is in java .util.It
Is the superclass for all events.its one constructor is show here



EventObject(Object src)

Here , src is the object that generates this event.
EventObject contain two methods: getsource() & toString().The getsource() method return the source of events . its general form show here:


Objectgetsource()
As expected string() return the string equivalent of the event
The class AWTEvent , define with in the java.awt package , is a subclass of EventObject.it is the superclass(either directly or indirectly) of all AWT-based event used by the delegation event model.its getID() method can be used ti determine the type of the event .the signature of this method is show here
Int getID()

At this point , it is important to know only that all of the other classes discusses in this section are subclasses of AWTEvent.



TO SUMMARIZE:

EventObject is a superclass of all event

AWTEvent is a superclass os all AWT event that are handled by the delegation event model.


The package java.awt.event define several types of event that are generated by various user interface elements .the table below enumerates the most important of these event classes & provide a breif description of when they are generated .The most commonly
used constructors,

EVENT ClASS DESCRIPTION

ACTIONEVENT Generated whan a button is presses,a list item
is double-clicked or a menu item is selected .

AdjustmentEvent Generated when a scroll bar is mainuplated.

ComponentEvent Generated when a component is hidden,moved,resizes,
Or become visible.

ContainerEvent Generated when a component is added to removes from a
Container.

FocusEvent Generated when a component gains or loses keyboard focus.


InputEvent Abstract super class for all component input event classes.

Thursday, January 7, 2010

DOS INTERRUPT

The Interrupts
INT 00 - internal - DIVIDE ERROR
Automatically called at end of DIV or IDIV operation that results in error or overflow. Normally set by DOS to display an error message and abort
the program.


INT 01 - internal - SINGLE-STEP
Generated at end of each machine instruction if TF bit in FLAGS is set. This is what makes the T command of DEBUG work for single-stepping. It
is not generated after MOV to segment register or POP of segment register (unless you have a very early 8088 with a microcode bug).



INT 02 - hardware - NMI (NON-MASKABLE INTERRUPT)
Generated by NMI signal in hardware. This signal has various uses:
Parity error: all except Jr and CONV
Coprocessor interrupt: all except Jr and CONV
Keyboard interrupt: Jr, CONV
I/O channel check: CONV, PS50+
Disk-controller power-on request: CONV
System suspend: CONV
Real-time clock: CONV
System watch-dog timer, time-out interrupt: PS50+
DMA timer time-out interrupt: PS50+



INT 03 - ONE-BYTE INTERRUPT
Generated by opcode CCh. Generally used to set breakpoints for debuggers. Also used by Turbo Pascal versions 1,2,3 when {$U+} specified




INT 04 - internal - OVERFLOW
Generated by INTO instruction if OF flag is set. If flag is not set, INTO is effectively a NOP. Used to trap any arithmetic errors before the
erroneous results propagate further through the computation.




INT 05 - PRINT-SCREEN KEY
Automatically called by keyboard scan when print-screen key is pressed. Normally executes routine to print the screen, but may call any routine that
can safely be executed from inside the keyboard scanner. Status and result byte for default handler is at address 0050:0000.




INT 05 - internal - BOUND CHECK FAILED (80186/80286)
Generated by BOUND instruction when the value to be tested is less than the indicated lower bound or greater than the indicated upper bound.



INT 06 - internal - UNDEFINED OPCODE (80286)




INT 07 - internal - NO MATH UNIT AVAILABLE (80286)




INT 08 - IRQ0 - TIMER INTERRUPT
Generated 18.2 times per second, this interrupt is used to keep the time-of-day clock updated.






INT 08 - internal - DOUBLE FAULT (80286 protected mode)
Called when multiple exceptions occur on one instruction, or an exception occurs in an exception handler. If an exception occurs in the double fault
handler, the CPU goes into SHUTDOWN mode (which circuitry in the PC/ATconverts to a reset).






INT 09 - IRQ1 - KEYBOARD INTERRUPT
Generated when data is received from the keyboard. This is normally a scan code, but may also be an ACK or NAK of a command on AT-class
keyboards.


INT 09 - internal - MATH UNIT PROTECTION FAULT (80286 protected mode)


INT 0A - IRQ2 - EGA VERTICAL RETRACE
Notes: on the Tandy 1000, this interrupt is used by the hard disk the TOPS and PCnet adapters use this interrupt request line by default



INT 0A - internal - INVALID TASK STATE SEGMENT (80286 protected-mode)



INT 0B - IRQ3 - COM2 INTERRUPT
Note: the TOPS and PCnet adapters use this interrupt request line as an alternate
Note: on PS/2's, COM2 through COM8 share this interrupt on many PC's, COM4 shares this interrupt



INT 0B - internal - NOT PRESENT (80286 protected-mode)
Generated when loading a segment register if the segment descriptor indicates that the segment is not currently in memory. May be used to
implement virtual memory.


INT 0C - IRQ4 - COM1 INTERRUPT
Note: on many PC's, COM3 shares this interrupt



INT 0C - internal - STACK FAULT (80286 protected-mode)
Generated on stack overflow/underflow. Note that the 80286 will shut down in real mode if SP=1 before a push.





INT 0D - IRQ5 - FIXED DISK (PC), LPT2 (AT/PS)
Note: the Tandy 1000 uses this line for the 60Hhz RAM refresh



INT 0D - internal - GENERAL PROTECTION VIOLATION (80286)
Called in real mode when an instruction attempts to access a word operand located at offset FFFFh


INT 0E - IRQ6 - DISKETTE INTERRUPT
Generated by floppy disk controller on completion of an operation


INT 0E - internal - PAGE FAULT (80386 native mode)

INT 0F - IRQ7 - PRINTER INTERRUPT
Generated by the LPT1 printer adapter when printer becomes ready.
Note: most printer adapters do not reliably generate this interrupt.









INT 10 - internal - COPROCESSOR ERROR (80286/80386)
Generated by the CPU when the -ERROR pin is asserted by the coprocessor. AT's and clones usually wire the coprocessor to use IRQ13, but not all
get it right.




INT 10 - AH = 00h VIDEO - SET VIDEO MODE

What are interrupts?

interrupts
An interrupt is the automatic transfer of software execution in response to hardware that is
asynchronous with the current software execution. The hardware can either be an external I/O device (like a
keyboard or printer) or an internal event (like an op code fault, or a periodic timer.) When the hardware
needs service (busy to done state transition) it will request an interrupt. A thread is defined as the path of
action of software as it executes. The execution of the interrupt service routine is called a background
thread. This thread is created by the hardware interrupt request and is killed when the interrupt service
routine executes the iret instruction. A new thread is created for each interrupt request. It is important to
consider each individual request as a separate thread because local variables and registers used in the
interrupt service routine are unique and separate from one interrupt event to the next. In a multithreaded
system we consider the threads as cooperating to perform an overall task. Consequently we will develop
ways for the threads to communicate (see the section on FIFO in this chapter) and synchronize (see the
discussion of semaphores in Chapter 7) with each other. Most embedded systems have a single common
overall goal. On the other hand general-purpose computers can have multiple unrelated functions to
perform. A process is also defined as the action of software as it executes. The difference is processes do
not necessarily cooperate towards a common shared goal.
The software has dynamic control over aspects of the interrupt request sequence. First, each
potential interrupt source has a separate arm bit that the software can activate or deactivate. The software
will set the arm bits for those devices it wishes to accept interrupts from, and will deactivate the arm bits
within those devices from which interrupts are not to be allowed. In other words it uses the arm bits to
individually select which devices will and which devices will not request interrupts. The second aspect that
the software controls is the interrupt enable bit, I, which is in the status register (SR). The software can
enable all armed interrupts by setting I=1 (sti), or it can disable all interrupts by setting I=0 (cli). The
disabled interrupt state (I=0) does not dismiss the interrupt requests, rather it postpones them until a later
time, when the software deems it convenient to handle the requests. We will pay special attention to these
enable/disable software actions. In particular we will need to disable interrupts when executing
nonreentrant code but disabling interrupts will have the effect of increasing the response time of software.
There are two general methods with which we configure external hardware so that it can request
an interrupt. The first method is a shared negative logic level-active request like IRQ . All the devices
that need to request interrupts have an open collector negative logic interrupt request line. The hardware
requests service by pulling the interrupt request IRQ line low. The line over the IRQ signifies negative
logic. In other words, an interrupt is requested when IRQ is zero. Because the request lines are open
collector, a pull up resistor is needed to make IRQ high when no devices need service.
Normally these interrupt requests share the same interrupt vector. This means whichever device requests an
interrupt, the same interrupt service routine is executed. Therefore the interrupt service routine must first
determine which device requested the interrupt.
The second method uses multiple dedicated edge-triggered requests. In this method, each device has
its own interrupt request line that is usually connected to a status signal in the I/O device. In this way, an
interrupt is requested on the busy to done state transition. Edge-triggered means the interrupt is requested
on the rise, the fall or both rise&fall of the Status signal. Normally these individual requests will have a
unique interrupt vector. This means there can be a separate interrupt service routine for each device. In this
way the microcomputer will automatically execute the appropriate software interrupt handler when an
interrupt is requested. Therefore the interrupt service routine does not need to determine which device
requested the interrupt.
often use shared negative logic
level-active interrupts for their external I/O devices.
Observation: Microcomputer systems running in single chip mode often use dedicated edgetriggered
interrupts for their I/O devices.
Observation: The number of interrupting devices on a system using dedicated edge-triggered
interrupts is limited when compared to a system using shared negative logic level-active
interrupts.
Observation: Most Motorola microcomputers support both shared negative logic and dedicated
edge-triggered interrupts.
The advantages of a wire-or negative logic interrupt request are: 1) additional I/O devices can be added
without redesigning the hardware, 2) there is no fundamental limit to the number of interrupting I/O
devices you can have, and 3) the microcomputer hardware is simple. The advantages of the dedicated edgetriggered
interrupt request are: 1) the software is simpler, therefore it will be easier to debug and it will run
faster, 2) there will be less coupling in between software modules, making it easier to debug and to reuse
code, and 3) it will be easier to implement priority such that higher priority requests are handled quickly,
while lower priority interrupt requests can be postponed. Because the Motorola microcomputers support
both types of interrupt, the designer can and must address these considerations.

DEFINATION ABOUT STRING CLASS , TOUPPER,INDEXOFF IN .NET (C SHARP)

string class:

String is a word used for a sequence or set of characters. Since set of characters are used a lot therefore a special class has been created for the programmers. Recall that a class consists of data and set functions that usually apply on data. In the case of built-in class string, the objects or instances of string consist a sequence of characters as data and a number of functions that can be applied on data. Lets discuss various functions that can be applied on string.

ToUpper:

This function converts the data held by the object to upper case


Since the data held by textBox1.Text is string therefore we have copied it into a newly created string variable named “txt”. Then “ToUpper” method has been called which will produce a new string that consist of all data converted into upper case. Since the “ToUpper” method is enclosed in the brackets of “Show”, therefore it will be interpreted that the result of “ToUpper” will be given to Show which will display it in message box. If the requirement is to display the case-updated data in the same textbox then the following could be written


IndexOf

It is often requirement to check whether a particular character is present in a string and at which location. “IndexOf” serves both the purposes. For example, a valid email (which is a string i.e. sequence of characters) must contain “@” symbol, this can be checked using the “IndexOf” method. This method will return “-1” if the string does not contain a particular symbol, “@” in this case, otherwise it will return the location at which the symbol or character exists. Following is the code that demonstrates an example.