Thursday, 22 November 2012

Oracle 11g: Install+Login+Uninstall

Installation 
Step 1:
its better to create a drive (>10GB) for Oracle.

Step 2:
run the oracle 11g setup file, then u will see the picture, check 'Advanced Installation', then click 'Next'.


Step 3: Click 'Next' (Enterprise Edition is checked default)


Step 4:
Change installation location, i have created a new drive I, and replace C to I in default directory of Oracle base. Path will be automatically Changed. Click 'Next'.


Step 5:
Check all that is not checked automatically. Click 'Next'.


Step 6:
Click 'Next'. (Create Database is auto selected)
 

Step 7:
Click 'Next'. (General Purpose / Transaction Processing is selected by default)

Step 8:
Click 'Next'. (both text-box are filled with 'orcl' by default.

 Step 9:
Click 'Sample Schemas' tab, check 'create database with sample schemas', Click 'Next'.


Step 10:
Click 'Next'.


Step 11:
Click 'Next'.


Step 12:
Click 'Next'.

Step 13:
check 'use the same password for all account'. then enter and confirm your password (dont forget the password). Click 'Next'.


Step 14:
Click 'Next'.

Step 15:
Click 'Install'. (if u see 132 product in New installation, then you are done)
 

Step 16:
Nothing to do :), just watch.


Step 17:
Nothing to do :), just watch.


Step 18:
Nothing to do :), just watch.

Step 19:
its better to screenshot this page, u need 'The Database Control URL' to login with OEM (Oracle Enterprise Management)
Click on 'Password Management'.


Step 20:
uncheck 'Lock Account' under 'SCOTT'. click 'ok'.
 

Step 21:
click 'exit'.
you have finished installing successfully.... :)



Login
there are several login progcess for oracle, the most two common process are:

Process 1.
 go to your Database Control URL. if you forgot to save the link while installing, don't worry, the link is
https://ip:1158/em or https://host name:1158/em
here, ip is your ip address and host name your host name, you can find your ip/host name writing ipconfig/all in cmd.
use SYS or SYSTEM as your user name.

Process 2:
start>SQL plus. then enter username and password
use SYS or SYSTEM as your user name.


Uninstall
Step1:
goto start>Universal Installer. click 'Deinstall Products'.


Step 2:
mark all check boxes. (to uninstall completely). Click 'Remove'.


Step 3:
Click 'Yes'.


Step 4:
Click 'Yes'.
 Step 5:
click 'Close'.

 now you have successfully uninstalled Oracle 11g from your computer.
its better to format your oracle drive.



Sunday, 28 October 2012

computer and internet related some abbreviation

HTTP --> Hyper Text Transfer Protocol
HTML --> Hyperlink Text Markup Language
IP --> Internet Protocol

APN --> Access Point Name
ATM --> Automated Teller Machine
BIOS --> Basic Input Output System
CD --> Compact Disc
VCD --> Video Compact Disc
CDR --> Compact Disc Recorder
DVD --> Digital Versatile Disc
FDD --> Floppy Disk Drive
HDD --> Hard Disk Drive
JAR --> Java Archive
JAD --> Java Description/Descriptors
LAN --> Local Area Network
LCD --> Liquid Crystal Display
LED --> Light Emitting Diode
PIN --> Personal Identity Number
PDF --> Portable Document Format
RAM --> Random Access Memory
ROM --> Read-Only Memory
SIM --> Subscriber Identity Module
USB --> Universal Serial Bus
URL --> Uniform Resource Location
www --> World Wide Web
WAN --> Wide Area Network
WAP --> Wireless Application Protocol

UVa 10104 - Euclid Problem Solution

#include<iostream>
#include<cstdio>
#include<list>
#include<string>
#include<cstring>
#include<sstream>
#include<cctype>
#include<string.h>
#include<algorithm>
#include<cmath>
#include<stack>
#include<fstream>
#include<cstdlib>
#include<vector>
#include<map>
#include<set>
#include<utility>
#include<iomanip>
#include<queue>
#include<deque>
#include<iterator>
#include<assert.h>
#include<bitset>
#include<climits>
#include<ctime>
#include<complex>

using namespace std;

#define SET(a) memset(a,-1,sizeof(a))
#define ALL(a) a.begin(),a.end()
#define CLR(a) memset(a,0,sizeof(a))
#define PB push_back
#define PI acos(-1.0)
#define MP(a,b) make_pair(a,b)
#define PII pair<int,int>
#define PCC pair<char,char>
#define PIC pair<int,char>
#define PCI pair<char,int>
#define VS vector<string>
#define VI vector<int>
#define VC vector<char>
#define max3(a,b,c) max(a,max(b,c)
#define min3(a,b,c) min(a,min(b,c)
#define READ freopen("input.txt", "r", stdin)
#define WRITE freopen("output.txt", "w", stdout)
#define LL long long
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define RFOR(i,a,b) for(int i=a;i>=b;i--)
#define For(i,a) for(int i=0;i<a;i++)

#define S(a) scanf("%d",&a)
#define S2(a,b) scanf("%d%d",&a,&b)
#define S3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define SLL(a) scanf("%lld",&a)
#define SLL2(a,b) scanf("%lld%lld",&a,&b)
#define SLL3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define SS(a) scanf("%s",a)
#define SC(a) scanf("%c",&a)
#define SD(a) scanf("%lf",&a)
#define P(a) printf("%d",a)
#define PLL(a) printf("%lld",a)
#define PD(a) printf("%lf",a)
#define PC(a) printf("%c",a)
#define PS(a) printf("%s",a)
#define KS printf("Case %d: ",kk++)
#define KN printf("Case %d:\n",kk++)
#define KH printf("Case #%d: ",kk++)
#define NL printf("\n")
#define DB cout<<"done"<<endl;

#define EPS 1e-9
#define MOD 10007
#define INF INT_MAX/3
#define MX 1010

template<typename T>inline string tostring(T a){ostringstream os("");os << a;return os.str();}
template<typename T>inline LL tolong(T a){LL res;istringstream os(a);os>>res;return res;}
template<typename T>inline VI parse(T str){VI res;int s;istringstream os(str);while(os>>s)res.PB(s);return res;}
template< class T > inline T _sqrt(T x) { return (T) sqrt( (double) x); }
template< class T > inline T _bigmod(T n,T m) {T ans=1,mult=n%MOD; while(m){ if(m & 1) ans=(ans*mult)%MOD; m>>=1; mult=(mult*mult)%MOD; } ans%=MOD; return ans;}
template< class T > inline T _modinv(T x) {return _bigmod(x,(T) MOD-2)%MOD;}
inline int LEN(string a) {return a.length();}
inline int LEN(char a[]) {return strlen(a);}
template< class T > inline T __lcm(T x,T y) { return x*y/__gcd(x,y);}


vector<LL> Extended_Euclid(int a, int b)
{
    LL last_x=1,last_y=0,x=0,y=1,tmp,quotient,reminder;
    while(b)
    {
        quotient=a/b;
        reminder=a%b;
        a=b;
        b=reminder;

        tmp=x;
        x=last_x-quotient*x;
        last_x=tmp;

        tmp=y;
        y=last_y-quotient*y;
        last_y=tmp;
    }
    vector<LL>res;
    res.PB(last_x);
    res.PB(last_y);
    res.PB(a);
return res;
}
int main()
{
    LL a,b;
    while(cin>>a>>b)
    {
        vector<LL>res=Extended_Euclid(a,b);
        cout<<res[0]<<" "<<res[1]<<" "<<res[2]<<endl;
    }
return 0;
}

Friday, 26 October 2012

Bitset built-in Function

#include<iostream>
#include<bitset>
 
using namespace std;
 
int main()
{
        for(int x; cin >> x; puts(""))
        {
                cout << bitset<32>(x) << endl;
                cout << "Number of set bits in given number: " << __builtin_popcount(x) << endl;
                cout << "Number of leading zeroes: " << __builtin_clz(x) << endl;
                cout << "Number of trailing zeroes: " << __builtin_ctz(x) << endl;
                cout << "Length of binary representation of given number: " << 32-__builtin_clz(x) << endl;
        }
        return 0;
}
 
 
 
 
input: 10
output:
00000000000000000000000001100100
Number of set bits in given number: 3
Number of leading zeroes: 25
Number of trailing zeroes: 2
Length of binary representation of given number: 7 

Thursday, 25 October 2012

Spoj 6471. Printing some primes Solution

#include<iostream>
#include<cstdio>
#include<list>
#include<string>
#include<cstring>
#include<sstream>
#include<cctype>
#include<string.h>
#include<algorithm>
#include<cmath>
#include<stack>
#include<fstream>
#include<cstdlib>
#include<vector>
#include<map>
#include<set>
#include<utility>
#include<iomanip>
#include<queue>
#include<deque>
#include<iterator>
#include<assert.h>
#include<bitset>
#include<climits>
#include<ctime>
#include<complex>

using namespace std;

#define SET(a) memset(a,-1,sizeof(a))
#define ALL(a) a.begin(),a.end()
#define CLR(a) memset(a,0,sizeof(a))
#define PB push_back
#define PI acos(-1.0)
#define MP(a,b) make_pair(a,b)
#define PII pair<int,int>
#define PCC pair<char,char>
#define PIC pair<int,char>
#define PCI pair<char,int>
#define VS vector<string>
#define VI vector<int>
#define VC vector<char>
#define max3(a,b,c) max(a,max(b,c)
#define min3(a,b,c) min(a,min(b,c)
#define READ freopen("input.txt", "r", stdin)
#define WRITE freopen("output.txt", "w", stdout)
#define LL long long
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define RFOR(i,a,b) for(int i=a;i>=b;i--)
#define For(i,a) for(int i=0;i<a;i++)

#define S(a) scanf("%d",&a)
#define S2(a,b) scanf("%d%d",&a,&b)
#define S3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define SLL(a) scanf("%lld",&a)
#define SLL2(a,b) scanf("%lld%lld",&a,&b)
#define SLL3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define SS(a) scanf("%s",a)
#define SC(a) scanf("%c",&a)
#define SD(a) scanf("%lf",&a)
#define P(a) printf("%d",a)
#define PLL(a) printf("%lld",a)
#define PD(a) printf("%lf",a)
#define PC(a) printf("%c",a)
#define PS(a) printf("%s",a)
#define KS printf("Case %d: ",kk++)
#define KN printf("Case %d:\n",kk++)
#define KH printf("Case #%d: ",kk++)
#define NL printf("\n")
#define DB cout<<"done"<<endl;

#define EPS 1e-9
#define MOD 10007
#define INF INT_MAX/3
#define MX 100000000

template<typename T>inline string tostring(T a){ostringstream os("");os << a;return os.str();}
template<typename T>inline LL tolong(T a){LL res;istringstream os(a);os>>res;return res;}
template<typename T>inline VI parse(T str){VI res;int s;istringstream os(str);while(os>>s)res.PB(s);return res;}
template< class T > inline T _sqrt(T x) { return (T) sqrt( (double) x); }
template< class T > inline T _bigmod(T n,T m) {T ans=1,mult=n%MOD; while(m){ if(m & 1) ans=(ans*mult)%MOD; m>>=1; mult=(mult*mult)%MOD; } ans%=MOD; return ans;}
template< class T > inline T _modinv(T x) {return _bigmod(x,(T) MOD-2)%MOD;}
inline int LEN(string a) {return a.length();}
inline int LEN(char a[]) {return strlen(a);}
template< class T > inline T __lcm(T x,T y) { return x*y/__gcd(x,y);}


bool Check(int N,int pos){return (bool)(N & (1<<pos));}
int Set(int N,int pos){ return N | (1<<pos);}

int status[(MX/32)+2];
void sieve()
{
     int i, j, sqrtN,cnt=0;
     sqrtN = int( sqrt( MX ) );
     printf("2\n");
     cnt++;
     for( i = 3; i <= sqrtN; i += 2 )
        //if( Check(status[i>>5],i&31)==0)
        if(!(status[i>>5] & (1<<(i&31))))
        {
            if(!(cnt%100))  printf("%d\n",i);
            cnt++;
            for( j = i*i; j <= MX; j += (i<<1) )
                //status[j>>5]= Set(status[j>>5],j & 31);
                status[j>>5]= status[j>>5] | (1<<(j&31));
        }

     for(i=sqrtN+1;i<=MX;i+=2)
         //if( Check(status[i>>5],i&31)==0)
         if(!(status[i>>5] & (1<<(i&31))))
         {
             if(!(cnt%100))  printf("%d\n",i);
             cnt++;
         }
    return;
}
int main()
{
    sieve();
return 0;
}