useful technique for ppt

1.“B”  screen turns to black, B again, return to normal

2.right click,show->play

3.effect of magnifier:

insert->object->Microsoft powerpoint slide

insert one pic in that slide and change size of pic to size of slide

back to original slide, adjust the size of inserted slide

4.choose multiple slides and generate summary,alt+shift+s

5. goto page 5: 5<enter>

6.go to page 1: press <- and -> at the same time for more than 2 seconds

7.picture can be used as bullets

c++ pointer

1.pointer must be initialized

2.*a=&b,address of b=>a

3.all points needs 4 bytes. short*p=&b,means type b needs 2 bytes

4.*p=&b: b addr=>p value;b=*p:value that p points to =>b;*p=5:5=>value at p points to   *p=0:void pointer

5.after pointer declaritino:p=&b,works,just like type,”short *” is a type

6.memory:stack,global storage,code area,register(stack-top pointer or instructive pointer),the rest is heap

7.stack can be released automatically,but heap needs to be released by person

8.new:allocate memory for heap;new returns address,so p=new int;

9.p=new int;=>delete p(p still exists,but not point to memeroy anymore;=>p=0;delete p(delete void pointer)

10.create new object/new pointer=>call constructor;delete pointer/working range ends=>call destructor

11.member function: object.getage() is equal to p->getage()

12.const int*p: the value at p can not be changed;int * const p:the address stored in p can not be changed

13.cin.getline(buffer,buffersize)to get the input string

14.isanum():Tests whether an element in a locale is an alphabetic or a numeric character.

15.if after you called a function,you wanna keep the value of variable,pointer or reference as parameter,which means you can change the value in the function,such as:GetWord(char* theString,char* word,int & wordOffset)

16.const int * p: p is a pointer who points to an int variable.and the variable can not be changed by pointer.int* const p:p is a pointer who points to an integer.and this pointer can not be assigned again.

c++ class

1.data and methods in one func are private by default.declaraion:class,visit:.

2.in Class,public accessors and member functions,private member data

3.difinition of class:”::”

4.constructor and deconstructor functions,same name with classname:Cat()=>Cat kitty;,~Cat()//Cat(int,int)=>Cat kitty(2,3);

5.member function const: getAge() const; cz it doesn’t change value of member variables of objectany member funcs that won’t change member varialbes should be set to const!which is a good habit!

6.class declaration is put in .hpp file which is like an interface,and class difinition is put in .cpp file,and #include ” .

7.inline member function:1)inline in difinition 2)in declaration,write the whole difinition 3)hpp”

8.struct,default public,but without methods

9.different instances of the same class can visit each other’s private member data!

c++ function

1.function are all global,but if u wanna call it,u must declare it first.

e.g. if wanna call a func in main(),you should before main(),write func prototype and define func after main()

2.global variables:define outside main,any function can use it;local variables,effective in block

3.function:return(x<5)=>function is bool

4.default parameter:func(a,b=1,c=2),attention!if b doesn’t have a default num,it’s useless that a has a default num.

5.reload function=>polymorphism:only return type is different,wrong!

c++ variables

1.case sensitive:myAge

2.Ctrl+F5:see result

3.for both unsigned or signed,overflow will lead to return to square one.

4.enum CoLOR{Red,Blue…}

5.to write simple codes,dont use too many brackets

6.! >> && >> ||

7.if(x=3)=>x=3,true and if(x=0)=>x=0,false

security

four aspects

1. network ID

2. log in ID

permission to log into server

modify in security->right click new logins

3. userID

permission to access database

modify in security->right click new logins

4.access permission

permission to access objects

right click database or tables->properties->permissions->search->select all object types->browse->select all->you can permissions like (select,insert…)

 

 

 

TABLE in sqlserver

There are two ways to execute your command

1. always right click to check the menu

2. new query script

some common commands:

1. CREATE TABLE TestTable

(Username CHAR(16),

Age INT)

2.ALTER TABLE TestTable

(

ADD Date DATETIME,

ALTER COLUMN Username VERCHAR(32),

DROP COLUMN Age

)

how to connect your laptop to office printer

  • first download VPN client so that you can be in the same subnet with printers
  • secondly you should know the IP address of host computer connected to printer
  • ping the IP address,if succeed,connected and continue
  • then in your laptop:choose devices and printers->add a printer->add a network,wireless or bluetooth printer->find a printer by name or TCP/IP address->type a printer hostname or IP address



  • add the IP address of host computer and write anything for port name

done!

create database in sqlserver2008

method 1:

  • open sqlserver management studio
  • right click databases folder->new database

method 2:

  • new query
  • program

CREATE DATABASE Test

ON PRIMARY

( NAME=’Test_Data’,

FILENAME=’c:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\Test_Data.mdf’,

SIZE=10MB,

MAXSIZE=50MB,

FILEGROWTH=5MB

)

LOG ON

( NAME=’Test_Log’,

FILENAME=’c:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\Test_Log.Ldf’,

SIZE=10MB,

MAXSIZE=25MB,

FILEGROWTH=5MB

)

GO

 

if you can not see new databases in databases,reconnect server and refresh

how to install sql server 2008 management studio

when you install visual studio 2010, it contains sqlserver 2008 express, but it is a simplified version without management studio.

Solution:

  1. open sql server installation center->maintenance->edition upgrade

upgrade to “Express edition with advanced service” and next till end.

2.  run your sqlserver 2008 management studio installation file, and you can see the sql server installation center again.

3. choose installation->new sqlserver stand-alone installation or add features to an existing installation->next->add features to sqlserver 2008:sqlexpress->next you ‘ll see management tools->basic.