Month: November 2014
String
What is String & how to use it:
The string in C programming language is actually a one-dimensional array of characters which is terminated by a null character ”. Thus a null-terminated string contains the characters that comprise the string followed by a null.
The following declaration and initialization create a string consisting of the word “Hello”. To hold the null character at the end of the array, the size of the character array containing the string is one more than the number of characters in the word “Hello.”
char greeting[6] = {‘H’, ‘e’, ‘l’, ‘l’, ‘o’, ”};
If you follow the rule of array initialization then you can write the above statement as follows:
char greeting[] = “Hello”;
STRING COPY:
strcpy(s1, s2); Copies string s2 into string s1.
OUTPUT:
STRING CAT:
strcat(s1, s2); Concatenates string s2 onto the end of string s1.
OUTPUT:
STRING COMPARE:
Compares two string
OUTPUT:
STRING LENGTH:
strlen(s1); Returns the length of string s1.
OUTPUT:
STRING LOWER:
Converts string to lowercase
OUTPUT:
STRING UPPER:
Converts string to uppercase
OUTPUT:
Posted By-: Vissicomp Technology Pvt. Ltd.
Website -: http://www.vissicomp.com
Pointer, How to use pointer
What Are Pointers?
A pointer is a variable whose value is the address of another variable, i.e., direct address of the memory location. Like any variable or constant, you must declare a pointer before you can use it to store any variable address. The general form of a pointer variable declaration is:
type *var-name;
type is the pointer’s base type; it must be a valid C data type and var-name is the name of the pointer variable. The asterisk * you used to declare a pointer is the same asterisk that you use for multiplication. However, in this statement the asterisk is being used to designate a variable as a pointer. Following are the valid pointer declaration:
int *ip; /* pointer to an integer */
double *dp; /* pointer to a double */
float *fp; /* pointer to a float */
char *ch /* pointer to a character */
POINTER:
OUTPUT:
How to use Pointers?
There are few important operations, which we will do with the help of pointers very frequently. (a) we define a pointer variable (b) assign the address of a variable to a pointer and (c) finally access the value at the address available in the pointer variable. This is done by using unary operator * that returns the value of the variable located at the address specified by its operand. Following example makes use of these operations:
OUTPUT:
Posted By-: Vissicomp Technology Pvt. Ltd.
Website -: http://www.vissicomp.com
ASP.NET – Ajax Control
The UpdateProgress Control:
The UpdateProgress control provides a sort of feedback on the browser while one or more update panel controls are being updated. For example while a user logs in or waits for server response while performing some database oriented job.
It provides a visual acknowledgement like “Loading page…”, indicating the work is in progress.
The syntax for the UpdateProgress control is:
<asp:UpdateProgress ID=”UpdateProgress1″
runat=”server”
DynamicLayout=”true”
AssociatedUpdatePanelID=”UpdatePanel1″ >
<ProgressTemplate>
Loading…
</ProgressTemplate>
</asp:UpdateProgress>
The above snippet shows a simple message within the ProgressTemplate tag, however it could be an image or other relevant controls. The UpdateProgress control will display for every asynchronous postback unless it is assigned to a single update panel using the AssociatedUpdatePanelID property.
Properties of the UpdateProgress Control
The following table shows the properties of the update progress control:
Properties |
Description |
AssociatedUpdatePanelID |
Gets and sets the ID of the update panel with which this control is associated. |
Attributes |
Gets or sets the cascading style sheet (CSS) attributes of the UpdateProgress control. |
DisplayAfter |
Gets and sets the time in milliseconds after which the progress template is displayed. The default is 500. |
DynamicLayout |
Indicates whether the progress template is dynamically rendered. |
ProgressTemplate |
Indicates the template displayed during an asynchronous post back which takes more time than the DisplayAfter time. |
Methods of the UpdateProgress Control
The following table shows the methods of the update progress control:
The Timer Control:
The timer control is used to initiate the post back automatically. This could be done in two ways:
(1) Setting the Triggers property of the UpdatePanel control:
<Triggers>
<asp:AsyncPostBackTrigger
ControlID=”btnpanel2″
EventName=”Click” />
</Triggers>
(2) Placing a timer control directly inside the UpdatePanel to act as a child control trigger. A single timer can be the trigger for multiple UpdatePanels.
<asp:UpdatePanel ID=”UpdatePanel1″
runat=”server”
UpdateMode=”Always”>
<ContentTemplate>
<asp:Timer ID=”Timer1″ runat=”server” Interval=”1000″>
</asp:Timer>
<asp:Label ID=”Label1″ runat=”server”
Height=”101px” style=”width:304px”>
</asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
Posted By-: Vissicomp Technology Pvt. Ltd.
Website -: http://www.vissicomp.com
Operator in SQL
What is an Operator in SQL?
An operator is a reserved word or a character used primarily in an SQL statement’s WHERE clause to perform operation(s), such as comparisons and arithmetic operations.
Operators are used to specify conditions in an SQL statement and to serve as conjunctions for multiple conditions in a statement.
· Arithmetic operators
· Comparison operators
· Logical operators
· Operators used to negate conditions
SQL Arithmetic Operators:
Assume variable a holds 10 and variable b holds 20, then:
Operator |
Description |
Example |
+ |
Addition – Adds values on either side of the operator |
a + b will give 30 |
– |
Subtraction – Subtracts right hand operand from left hand operand |
a – b will give -10 |
* |
Multiplication – Multiplies values on either side of the operator |
a * b will give 200 |
/ |
Division – Divides left hand operand by right hand operand |
b / a will give 2 |
% |
Modulus – Divides left hand operand by right hand operand and returns remainder |
b % a will give 0 |
SQL Comparison Operators:
Assume variable a holds 10 and variable b holds 20, then:
Operator |
Description |
Example |
= |
Checks if the values of two operands are equal or not, if yes then condition becomes true. |
(a = b) is not true. |
!= |
Checks if the values of two operands are equal or not, if values are not equal then condition becomes true. |
(a != b) is true. |
<> |
Checks if the values of two operands are equal or not, if values are not equal then condition becomes true. |
(a <> b) is true. |
> |
Checks if the value of left operand is greater than the value of right operand, if yes then condition becomes true. |
(a > b) is not true. |
< |
Checks if the value of left operand is less than the value of right operand, if yes then condition becomes true. |
(a < b) is true. |
>= |
Checks if the value of left operand is greater than or equal to the value of right operand, if yes then condition becomes true. |
(a >= b) is not true. |
<= |
Checks if the value of left operand is less than or equal to the value of right operand, if yes then condition becomes true. |
(a <= b) is true. |
!< |
Checks if the value of left operand is not less than the value of right operand, if yes then condition becomes true. |
(a !< b) is false. |
!> |
Checks if the value of left operand is not greater than the value of right operand, if yes then condition becomes true. |
(a !> b) is true. |
SQL Logical Operators:
Here is a list of all the logical operators available in SQL.
Ads by InfoAd Options
Operator |
Description |
ALL |
The ALL operator is used to compare a value to all values in another value set. |
AND |
The AND operator allows the existence of multiple conditions in an SQL statement’s WHERE clause. |
ANY |
The ANY operator is used to compare a value to any applicable value in the list according to the condition. |
BETWEEN |
The BETWEEN operator is used to search for values that are within a set of values, given the minimum value and the maximum value. |
EXISTS |
The EXISTS operator is used to search for the presence of a row in a specified table that meets certain criteria. |
IN |
The IN operator is used to compare a value to a list of literal values that have been specified. |
LIKE |
The LIKE operator is used to compare a value to similar values using wildcard operators. |
NOT |
The NOT operator reverses the meaning of the logical operator with which it is used. Eg: NOT EXISTS, NOT BETWEEN, NOT IN, etc. This is a negate operator. |
OR |
The OR operator is used to combine multiple conditions in an SQL statement’s WHERE clause. |
IS NULL |
The NULL operator is used to compare a value with a NULL value. |
UNIQUE |
The UNIQUE operator searches every row of a specified table for uniqueness (no duplicates). |
Posted By-: Vissicomp Technology Pvt. Ltd.
Website -: http://www.vissicomp.com
DATA WAREHOUSING (introduction)
INTRODUCTION TO DATA WAREHOUSING
A data warehouse is a repository of an organization’s electronically stored data. Data warehouses are designed to facilitate reporting and analysis.
A data warehouse is a powerful database model that significantly enhances the user’s ability to quickly analyze large, multidimensional data sets.
It cleanses and organizes data to allow users to make business decisions based on facts.
Hence, the data in the data warehouse must have strong analytical characteristics creating data to be analytical requires that it be –subject- oriented, integrated, time – referenced and non – volatile.
SUBJECT- ORIENTED DATA
This means a data warehouse has a defined scope and it only stores data under that scope. So for example, if the sales team of your company is creating a data warehouse – the data warehouse by definition is required to contain data related to sales.
Data Warehouses group data by subject rather by activity. In contrast, transactional systems are organized around activities – payroll processing, shipping products, loan processing, and the like.
Data organized around activities cannot answer questions such as, “how many salaried employees have a tax deductions of ‘X’ amount across all branches of the company?’’ this request would require have searching and aggregation of employee and account records of all the branches.
Imagine the query response time for a company having branches all over the country with employee strength of 20,000!
In a data warehouse environment, information’s used for analysis is organized around subjects- employees, accounts sales, products, and so on. This subject specific design helps in reducing the query response time by searching through very few records to get an answer to the user’s question.
INTEGRATED DATA
Integrated data refers to de – duplicating information and merging it from many sources into one consistent location.
When short listing your top 20 customers, you must know that ‘’HAL’’ and ‘’Hindustan aeronautics limited’’ are one and the same. There must be just one customer number for any form of HAL or Hindustan aeronautics limited, in your database.
This means that the data stored in a data warehouse make sense. Fact and figures are related to each other and they are integrable and project a single point of truth.
Much of the transformation and loading work that foes into the data warehouse is centered on integrating data and standardizing it,
TIME – REFERENCED DATA
The most important and most scrutinized characteristic of the analytical data is its prior state of bing. In other words, time-referenced data essentially refers to its time – valued characteristic. For example, the user may ask ‘’what were the total sales of product ‘A’ for the past three years on New Year’s Day across region ‘Y’?’’ to answer this question, you need to know the sales figures of the product on new year’s day in all the branches for that particular region.
This means that data is not constant, as new and new data gets loaded in the warehouse, data warehouse also grows in size
Time – referenced data when analyzed can also help in spotting the hidden treads between different associative data elements, which may not be obvious to the naked eye. This exploration activity is termed ‘’data mining’’.
NON – VOLATILE DATA
Since the information in a data warehouse is heavily queried against time, it is extremely important to preserve it pertaining to each and every business event of the company. The non – volatility of data, characteristic of data warehouse, enables users to dig deep into history and arrive at specific business decisions based on facts.
This means that data once stored in the data warehouse are not removed or deleted from it and always stay there no matter what.
NECESSITY –THE DATA ACCESS CRISIS
If there is a single key to survival in the 1990s and beyond, it is being able to analyze, plan, and react to changing business conditions in a much more repaid fashion. In order to do this, to managers, analysts, and knowledge workers in our enterprises, need more and better information.
Information technology (IT) has made possible the revolution in the way organizations operate throughout the world today. But the sad truth is, in many organizations, despite the availability of powerful computers on each desk and communication that span the globe, large numbers of executives and decision – makers cannot get their hands on exiting critical information in the organization.
Every day, organizations large and small, create billions of bytes of data about all aspects of their business; millions of individual facts about their customers, products, operations and people. But for the most part, this is locked up in a maze of computer systems and is exceedingly difficult to get at. This phenomenon has been described as “data in jail”.
Industry experts have estimated that only a small fraction of the data that is captured, processed and stored in the enterprise, is actually available to executives and decision makers. While technologies for the manipulation and presentations of data have literally exploded, it is only recently that those involved in developing IT strategies for large enterprise have concluded that large segments of the enterprise are “data poor”.
Posted By-: Vissicomp Technology Pvt. Ltd.
Website -: http://www.vissicomp.com