Thursday, March 31, 2011

Shut Down Your frnds Pc


how to hack administrator password


learn c sharp Gaming Chapter 6


Values versus References
There are different ways for a compiler to talk about data, and C# has two different ways
to do so. All datatypes in C# fall into one of two categories:
_ Value types
_ Reference types
I’ll explain each of these different kinds of types in the following sections.
Value Types
A value type is typically a small piece of data that the system spends very little time managing.
You have already used value types in Chapter 2 with all of the built-in numeric data
types. —such as ints, floats, and so on—is a value type.

note
Value types are created on the system stack. You don’t necessarily need to know what that is, but
if you’re interested, I strongly urge you to research it on your own. This topic goes beyond the scope
of this book, so I don’t have enough room to explain it here, but it greatly helps you understand
exactly how computers work, which will in turn make your programs faster and more efficient.

Value types are fairly simple and straightforward to use, as you can see in this code:
int x = 10, y = 20;
x = y; // value of y is copied into x
y = 10; // y is set to 10
Along with the built-in data types, structures are value types as well, which I explore in
much more detail later in this chapter.

Reference Types
Reference types are completely different from value types. Classes, unlike structures, are
always reference types. Reference types, rather than storing the data directly, store an
address inside of them, and that address points to the actual data in the computer somewhere.

Declaring a Reference Type

Sql Deleting Records Answers


Deleting Records Answers

  1. Jonie Weber-Williams just quit, remove her record from the table:
    delete 
      from myemployees_ts0211
      where lastname = 
        'Weber-Williams';
  2. It's time for budget cuts. Remove all employees who are making over 70000 dollars.
    delete 
      from myemployees_ts0211
      where salary > 
        70000;

Sql Deleting Records


Deleting Records

The delete statement is used to delete records or rows from the table.
delete from "tablename"

where "columnname" 
  OPERATOR "value" 
[and|or "column" 
  OPERATOR "value"];

[ ] = optional
[The above example was line wrapped for better viewing on this Web page.]
Examples:
delete from employee;
Note: if you leave off the where clause, all records will be deleted!
delete from employee
  where lastname = 'May';

delete from employee
  where firstname = 'Mike' or firstname = 'Eric';
To delete an entire record/row from a table, enter "delete from" followed by the table name, followed by the where clause which contains the conditions to delete. If you leave off the where clause, all records will be deleted.

Delete statement exercises

(Use the select statement to verify your deletes):
  1. Jonie Weber-Williams just quit, remove her record from the table.
  2. It's time for budget cuts. Remove all employees who are making over 70000 dollars.

Create at least two of your own delete statements, and then issue a command to delete all records from the table.

Sql Insert Into a table answers of exercise

Inserting into a Table Answers

Your Insert statements should be similar to: (note: use your own table name that you created)
insert into 
  myemployees_ts0211
(firstname, lastname, 
 title, age, salary)
values ('Jonie', 'Weber', 
        'Secretary', 28, 
        19500.00);
  1. Select all columns for everyone in your employee table.
    select * from
    myemployees_ts0211
  2. Select all columns for everyone with a salary over 30000.
    select * from
    myemployees_ts0211
    where salary > 30000
  3. Select first and last names for everyone that's under 30 years old.
    select firstname, lastname
    from myemployees_ts0211
    where age < 30
  4. Select first name, last name, and salary for anyone with "Programmer" in their title.
    select firstname, lastname, salary
    from myemployees_ts0211
    where title LIKE '%Programmer%'
  5. Select all columns for everyone whose last name contains "ebe".
    select * from
    myemployees_ts0211
    where lastname LIKE '%ebe%'
  6. Select the first name for everyone whose first name equals "Potsy".
    select firstname from
    myemployees_ts0211
    where firstname = 'Potsy'
  7. Select all columns for everyone over 80 years old.
    select * from
     
    myemployees_ts0211
     
    
    where age > 80
  8. Select all columns for everyone whose last name ends in "ith".
    select * from
    myemployees_ts0211
    where lastname LIKE '%ith'

Sql Insert Into Table


Inserting into a Table

The insert statement is used to insert or add a row of data into the table.
To insert records into a table, enter the key words insert into followed by the table name, followed by an open parenthesis, followed by a list of column names separated by commas, followed by a closing parenthesis, followed by the keyword values, followed by the list of values enclosed in parenthesis. The values that you enter will be held in the rows and they will match up with the column names that you specify. Strings should be enclosed in single quotes, and numbers should not.
insert into "tablename"
 (first_column,...last_column)
  values (first_value,...last_value);
In the example below, the column name first will match up with the value 'Luke', and the column namestate will match up with the value 'Georgia'.
Example:
insert into employee
  (first, last, age, address, city, state)
  values ('Luke', 'Duke', 45, '2130 Boars Nest', 
          'Hazard Co', 'Georgia');
Note: All strings should be enclosed between single quotes: 'string'

Insert statement exercises

It is time to insert data into your new employee table.
Your first three employees are the following:
Jonie Weber, Secretary, 28, 19500.00
Potsy Weber, Programmer, 32, 45300.00
Dirk Smith, Programmer II, 45, 75020.00
Enter these employees into your table first, and then insert at least 5 more of your own list of employees in the table.
After they're inserted into the table, enter select statements to:
  1. Select all columns for everyone in your employee table.
  2. Select all columns for everyone with a salary over 30000.
  3. Select first and last names for everyone that's under 30 years old.
  4. Select first name, last name, and salary for anyone with "Programmer" in their title.
  5. Select all columns for everyone whose last name contains "ebe".
  6. Select the first name for everyone whose first name equals "Potsy".
  7. Select all columns for everyone over 80 years old.
  8. Select all columns for everyone whose last name ends in "ith".
Create at least 5 of your own select statements based on specific information that you'd like to retrieve.

Most Important Question for An Interview For sql server on Joins And Functions


What are different Types of Join?
Cross Join
A cross join that does not have a WHERE clause produces the Cartesian product of the tables involved in the join. The size of a Cartesian product result set is the number of rows in the first table multiplied by the number of rows in the second table. The common example is when company wants to combine each product with a pricing table to analyze each product at each price.
Inner Join
A join that displays only the rows that have a match in both joined tables is known as inner Join. This is the default type of join in the Query and View Designer.
Outer Join
A join that includes rows even if they do not have related rows in the joined table is an Outer Join. You can create three different outer join to specify the unmatched rows to be included:
                        Left Outer Join: In Left Outer Join all rows in the first‐named table i.e. "left" table, which appears leftmost in the JOIN clause are included. Unmatched rows in the right table do not appear.
                        Right Outer Join: In Right Outer Join all rows in the second‐named table i.e. "right" table, which appears rightmost in the JOIN clause are included. Unmatched rows in the left table are not included.

                        Full Outer Join: In Full Outer Join all rows in all joined tables are included, whether they are matched or not.

Self Join
This is a particular case when one table joins to itself, with one or two aliases to avoid confusion. A self join can be of any type, as long as the joined tables are the same. A self join is rather unique in that it involves a relationship with only one table. The common example is when company has a hierarchal reporting structure whereby one member of staff reports to another. Self Join can be Outer Join or Inner Join.  
What are primary keys and foreign keys?
Primary keys are the unique identifiers for each row. They must contain unique values and cannot be null. Due to their importance in relational databases, Primary keys are the most fundamental of all keys and constraints. A table can have only one Primary key.
Foreign keys are both a method of ensuring data integrity and a manifestation of the relationship between tables.

What is User Defined Functions? What kind of User‐Defined Functions can be created?
User‐Defined Functions allow defining its own T‐SQL functions that can accept 0 or more parameters and

Most Important Question for An Interview For sql server 2


What is View?
A simple view can be thought of as a subset of a table. It can be used for retrieving data, as well as updating or deleting rows. Rows updated or deleted in the view are updated or deleted in the table the view was created with. It should also be noted that as data in the original table changes, so does data in the view, as views are the way to look at part of the original table. The results of using a view are not permanently stored in the database. The data accessed through a view is actually constructed using standard T‐SQL select command and can come from one to many different base tables or even other views.
What is Index?
An index is a physical structure containing pointers to the data. Indices are created in an existing table to locate rows more quickly and efficiently. It is possible to create an index on one or more columns of a table,

Monday, March 28, 2011

Most Important Question for An Interview For sql server



1)General Questions of SQL SERVER
What is RDBMS?

Relational Data Base Management Systems (RDBMS) are database management systems that maintain data records and indices in tables. Relationships may be created and maintained across and among the data and tables. In a relational database, relationships between data items are expressed by means of tables. Interdependencies among these tables are expressed by data values rather than by pointers. This allows a high degree of data independence. An RDBMS has the capability to recombine the data items from different files, providing powerful tools for data usage.
What are the properties of the Relational tables?
Relational tables have six properties:
                        Values are atomic.
                        Column values are of the same kind.
                        Each row is unique.
                        The sequence of columns is insignificant.
                        The sequence of rows is insignificant.
                        Each column must have a unique name.

What is Normalization?
Database normalization is a data design and organization process applied to data structures based on rules that help building relational databases. In relational database design, the process of organizing data to minimize redundancy is called normalization. Normalization usually involves dividing a database into two or more tables and defining relationships between the tables. The objective is to isolate data so that additions, deletions, and modifications of a field can be made in just one table and then propagated through the rest of the database via the defined relationships.
What is De‐normalization?
De‐normalization is the process of attempting to optimize the performance of a database by adding redundant data. It is sometimes necessary because current DBMSs implement the relational model poorly. A true relational DBMS would allow for a fully normalized database at the logical level, while providing physical storage of data that is tuned for high performance. De‐normalization is a technique to move from higher to lower normal forms of database modeling in order to speed up database access.
What are different normalization forms?
1NF: Eliminate Repeating Groups
Make a separate table for each set of related attributes, and give each table a primary key. Each field contains at most one value from its attribute domain.
2NF: Eliminate Redundant Data
If an attribute depends on only part of a multi‐valued key, remove it to a separate table.
3NF: Eliminate Columns Not Dependent On Key

learn c sharp Gaming Chapter 5


Short-Circuit Evaluation
Let me go off on a tangent here and go over a topic that is fairly important when evaluating
conditional statements.
All C-based languages support something called short-circuit evaluation. This is a very
helpful performance tool, but it can cause some problems for you if you want to perform
some fancy code tricks.
If you know your binary math rules, then you know that with an and statement, if either
one of the operands is false, then the entire thing is false. Table 2.7 lists the logical and and
logical or result tables.
Look at the table, specifically the two lines where x is false. For the operation “x and y,” it
doesn’t matter what y is because the result is always going to be false. Likewise, if you look
at the first two lines, you’ll notice that whenever x is true, the operation “x or y” is true,
no matter what y is.

Friday, March 25, 2011

Learn Gaming in c sharp Chapter 4

Typecasts:

Check out this code:

float a = 1.875;

int x = (int)a; // 1

Look at the last line: the value of a is 1.875, a fractional number, and the last line of code

is trying to put the value of a into x, which is an integer. Obviously, you can’t just transfer

the contents of a into x, so you need to lose some precision. Older languages, such as

C/C++, would do this for you automatically, and chop 1.875 down to 1 in order to fit it

into the integer (the process is called truncation). If you tried typing this line into a C#

program, however, you would get a compiler error:

x = a; // error! Cannot implicitly convert type ‘float’ to ‘int’

Of course, this code works perfectly well in older languages, so a lot of people will automatically

dismiss C# as “difficult to use.” I can hear them now: “Can’t you just automatically

convert the float to the integer, you stupid compiler?”

Well, the compiler isn’t actually stupid; it’s trying to save you some time debugging. You

may not realize it, but a common source of bugs in programs is accidental truncation.

You might forget that one type is an integer and some important data may get lost in the

translation somewhere. So C# requires you to explicitly tell it when you want to truncate

data. Tables 2.5 and 2.6 list which conversions require explicit and implicit conversions.

Explicit/Implicit Conversions, Part 1

From byte sbyte short ushort int uint

byte I E I I I I

sbyte E I I E I E

short E E I E I E

ushort E E E I I I

int E E E E I E

uint E E E E E I

long E E E E E E

ulong E E E E E E

float E E E E E E

double E E E E E E

decimal E E E E E E

 Explicit/Implicit Conversions, Part 2

Tuesday, March 22, 2011

Learn C sharp Gaming Chapter 3


Your First C# Program
There is an ancient tradition (okay it’s not that old) in computer programming that says
that your first program in any language should be a “Hello World” program, a program
that simply prints out a welcome message on your computer.
On the CD for this book you will find a demo entitled “HelloCSharp.”You can find it in the
/Demos/Chapter02/01-HelloCSharp/ directory. The HelloCSharp.cs file in that directory
contains the code for the program; you can open it up in any text editor or Visual Studio
and view it. The code should look like this:
class HelloCSharp
{
static void Main( string[] args )
{
System.Console.WriteLine( “Hello, C#!!” );
}
}
At first glance, you can see that this is about four or five lines longer than you could write
it in C or C++; that’s because C# is a more complicated language.

Classes
C# is an object-oriented programming language, which may not mean anything to you at
this point. “A Brief
Introduction to Classes,” but for now, all you need to know is that C# represents its programs
as objects.
The idea is to separate your programs into nouns and verbs, where every noun can be represented
as an object. For example, if you make a game that has spaceships flying around,
you can think of the spaceships as objects.
A class in a C# program describes a noun; it tells the computer what kind of data your
objects will have and what kind of actions can be done on them. A spaceship class might
tell the computer about how many people are in it, how much fuel it has left, and how fast
it is going.
The Entry Point
Every program has an entry point, the place in the code where the computer will start execution.
In older languages like C and C++, the entry point was typically a global function
called main, but in C# it’s a little different. C# doesn’t allow you to have global functions,
but rather it forces you to put your functions into classes, so you obviously cannot use the
same method for a C# entry point. C# is like Java in this respect; the entry point for every
C# program is a static function called Main inside a class.Every C# program must have a class that has a static Main function; if it doesn’t, then the
computer won’t know where to start running the program. Furthermore, you can only
have one Main function defined in your program; if you have more than one, then the computer
won’t know which one to start with.
note
Technically, you can have more than one Main function in your program, but that just makes things
messy. If you include more than one Main, then you need to tell your C# compiler which class contains
the entry point—that’s really a lot of trouble you can live without.
Hello, C#!!
The part of the program that performs the printing is this line:
System.Console.WriteLine( “Hello, C#!!” );
This line gets the System.Console class—which is built into the .NET framework—and tells
it to print out “Hello, C#!!” using its WriteLine function.
Compiling and Running
There are a few ways you can compile this program and run it. The easiest way would be
to open up a console window, find your way to the demo directory, and use the commandline
C# compiler to compile the file, like this:
csc HelloCSharp.cs

Sunday, March 20, 2011

Assignment On Basics


2.1. Every C# program requires at least one main static class. (True/False)
2.2. Booleans are only 1 bit in size. (True/False)
2.3. Unsigned integers can hold numbers up to around 4 billion. (True/False)
2.4. Floating point numbers hold exact representations of numbers. (True/False)
2.5. Why can’t you use variables before they have been assigned a value?
2.6. Why do constants make your programs easier to read?
2.7. Is the following code valid?
int x = 10;
float y = 20;
x = y;
(Yes/No)
2.8. What is the value of x after this code is done?
int x = 10;
if( x == 10 )
x = 20;
2.9. Assume that c is 0.What are the values of the variables after this code is done,
and why?
int w = 0, x = 0, y = 0, z = 0;
switch( c )
{
case 0:
w = 10;
case 1:
x = 10;
case 2:
y = 10;
break;
case 3:
z = 10;
break;
}

Tuesday, March 15, 2011

Learn gaming in c sharp chapter 2

Learning the basics of a program
using System;
using System.Collections.Generic;
using System.Text;

namespace Tutorial1
{
    class Program
    {       
        static void Main(string[] args)
        {
           
        }
    }
}
The first thing you might notice is the different colors.  Dark blue signifies a code/command that C# recognizes.  Light blue indicates a class, while the regular text is for user defined names.

Skipping those "using" statements for a moment you'll see:

namespace"namespace" is an equivalent to a folder in windows.  Everything in that folder is accessible if that "folder" is open.  Just like in windows a folder can folders inside of it; Namespaces can have other namespaces and classes inside of it as well.  While we'll cover this more later on, it just good to remember that comparison.

classClass is a dual purpose object.  It too acts somewhat like a "folder", however instead of just holding more "folders" it holds methods, variables.... pretty much everything belongs inside of a class with only a few exceptions that we'll cover much later.  Classes too will be covered in depth later.  Just remember that while the class is accessible from the namespace, the things inside of the class are only accessible when the Class is "opened".  Don't worry if this is over your head right now.  It will be made clear in lessons to come.

Learn gaming in csharp 1st Chapter

Which programming language is the best?  Why C#? etc...
In the end there is no "best programming language".  Right now the industry standard for games is C++.  However
there is no guarantee what language will be the one of choice in a year or five years.  A popular game,
Civilization 4, was written in Python which is fairly new.  The idea is to learn a language.  Any language will do
because once you learn one, picking up another is fairly easy to do.  I'm using C# because it's fairly easy to learn,
it's very close to C++ and because it's the language that XNA uses which makes game programming much easier.
More on XNA later. 

Friday, March 11, 2011

Cookies In Asp.Net



Cookies is a small piece of information stored on the client machine. This file is located on client machines "C:\Document and Settings\Currently_Login user\Cookie" path.  Its is used to store user preference information like Username, Password,City and PhoneNo etc on client machines. We need to import namespace called  Systen.Web.HttpCookie before we use cookie. 
  
Type of Cookies?


Persist Cookie - A cookie has not have expired time Which is called as Persist Cookie


Non-Persist Cookie - A cookie has expired time Which is called as Non-Persist Cookie


How to create a cookie? 
  
Its really easy to create a cookie in the Asp.Net with help of Response object or HttpCookie 
  
Example 1: 
  
        HttpCookie userInfo = new HttpCookie("userInfo");
        userInfo["UserName"] = "Annathurai";
        userInfo["UserColor"] = "Black";
        userInfo.Expires.Add(new TimeSpan(0, 1, 0));
        Response.Cookies.Add(userInfo);

Sunday, March 6, 2011

Data List Control In Asp.Net


This is a Data List control demo with code …….


This is a xml file we will use in data list control as a Data Source
<?xml version="1.0" encoding="ISO-8859-1"?>

<catalog>
<cd>
  <title>Empire Burlesque</title>
  <artist>Bob Dylan</artist>
  <country>USA</country>
  <company>Columbia</company>
 

Repeater Control In asp.net


Repeater Control Using XML Data source
This is an xml file, we will use as data source
<?xml version="1.0" encoding="ISO-8859-1"?>

<catalog>
<cd>
  <title>Empire Burlesque</title>
  <artist>Bob Dylan</artist>
  <country>USA</country>

Sql Create Table


Creating Tables

The create table statement is used to create a new table. Here is the format of a simple create tablestatement:
create table "tablename"
("column1" "data type",
 "column2" "data type",
 "column3" "data type");
Format of create table if you were to use optional constraints:
create table "tablename"
("column1" "data type" 
         [constraint],
 "column2" "data type" 
         [constraint],
 "column3" "data type" 
        [constraint]);
 [ ] = optional
Note: You may have as many columns as you'd like, and the constraints are optional.
Example:

Answers Of Sql Select Statement Excercise


Selecting Data Answers

  1. Display everyone's first name and their age for everyone that's in table.
    select first, 
           age 
      from empinfo;
  2. Display the first name, last name, and city for everyone that's not from Payson.
    select first, 
           last, 
           city 
      from empinfo
    where city <> 
      'Payson';
  3. Display all columns for everyone that is over 40 years old.
    select * from empinfo
           where age > 40;
  4. Display the first and last names for everyone whose last name ends in an "ay".
    select first, last from empinfo
           where last LIKE '%ay';
  5. Display all columns for everyone whose first name equals "Mary".
    select * from empinfo
           where first = 'Mary';
  6. Display all columns for everyone whose first name contains "Mary".
    select * from empinfo
           where first LIKE '%Mary%';

AngularJS Basics - Part 1

                                                                  AngularJS What is AngularJS ·          Framework by googl...