Monday, 12 January 2015

Wednesday, 18 June 2014

Oracle Linux 5.8 Server DVD 64-bit link for Torrent download.

Torrent File Link

Magnetic Link

File List.

1. OracleLinux-R5-U8-Server-x86_64-dvd.iso    Size : 3.61 GB

Tracker :

udp://tracker.openbittorrent.com:80

udp://tracker.publicbt.com:80

udp://tracker.istole.it:80/announce

udp://open.demonii.com:1337

Seeders    : 1
Leechers : 3

Oracle Linux 6.0 link for torrent download.

Torrent Link

Magetic Link

Hash Code : 948D63227E488D718A1E34DFE783D7258F32EF59

Total Size : 10.1 GB

List of Files available :
 File Name                                                                             Size (in GB)
1. OracleLinux-R6-U0-Server-i386-dvd.iso                          2.63
2. OracleLinux-R6-U0-Server-x86_64-dvd.iso                     3.16
3. OracleLinux-R6-U0-src-dvd1.iso                                      3.00
4. OracleLinux-R6-U0-src-dvd2.iso                                      1.38

Trackers

udp://tracker.openbittorrent.com:80/announce

udp://open.demonii.com:1337


How to run 16 bit program in 64 bit Windows OS

Generally you will not be able to run old widows 16 bit program in Windows 64 bit OS.
But it is possible after installing a software known as DOSBox. This is basically an emulator
which helps you to run your 16 bit programs.
Just follow this link given below from where you can download DOSBox.

DOSBox Download link

Wait... After installing when you open the program you will get a DOS based interface.
Now suppose you want to run Turbo C which is in you D:\TC . You need to mount this folder as
as virtual drive i.e. d, for that write this command mount d d:\tc. If succeeded it will display a
message : Drive D is mounted as Local Directory D:\TC.

It's all done. Just type D: ad press enter on the prompt and it will change the drive to virtual drive
as D:>. Now you have to imagine your current directory as d:\tc, not d: ad you can do all work you
need to to on this current directory.

Sunday, 15 June 2014

Wolf 3D versio 1.0 cheats

Start the game from the command line with the goobers option:

wolf3d -goobers

After doing this, press Left Alt, Left Shift, and Backspace simultaneously during gameplay. You should see a message, "Debugging keys are now available!" You can now use the following cheat codes:

    Tab + C - Show statistics
    Tab + E - Instantly ends current level
    Tab + F - Show current coordinates
    Tab + G - God mode
    Tab + H - Player takes damage
    Tab + I - Same effect as the LIM cheat
    Tab + S - Slow motion
    Tab + T - Show all game sprites
    Tab + W - Warp to any map in current Episode (prompt)
    Tab + N - No clipping (disabled on later game versions)

Wednesday, 4 June 2014

How to use rm command in linux


    Command is - rm filename.extensionname
     rm file1.txt

     rm does not remove directory but you can remove list of files in a directory by this command
     rm -r directoryname.  (-r recursive method)
     rm -r Music.  This command will remove all the files in the directory Music.

     You cannot remove files with rm if you do not have write permission on the files.

Few functionalities of ls command in Linux


Lists the contents of the current working directory
(pwd - "Print Working Directory" To see the current working directory)

ls -a
List all files including the files with Dot prefix

ls -l

List name of files with details like permission,date time (created/modified)

Commands can be combined
Say you want to list all files with details you type
ls -a -l or ls -al
This joining can be only done for Short options
for long options like -all you cannot join to options
(example ls -al)

Long and short options can be mixed.
ls --all -l

Monday, 26 May 2014

How to swap 2 numbers using pointers.

#iclude"stdio.h"
#include"conio.h"
void main()
{
int a=4,b=8;
void swap(int *,int *); // Prototype  for the function
clrscr();
printf("\nNumbers before swap : a = % d, b = %d",a,b); // print variable value before swap
swap(&a,&b);
printf("\nNumbers after swap : a = % d, b = %d",a,b); / print variable value after swap
getch();
 }
void swap(int *p,int *q)
{
int t; // Temporary variable to store the value before swapping
t=*p;
*p=*q;
*q=t;
}

How to copy string using pointer in C Programming

#include"stdio.h"
#include"conio.h"
void main(int argc,char *argv[])
{
void stringcopy(char *,char *);
char target[10];
clrscr();
fflush(stdout);
if(argc<2)
{
printf("\nWrong number of argument parameter");
exit(0);
}
stringcopy(target,argv[1]); // target, &target[0]
printf("\nSource string %s, Target String %s",argv[1],target);
getch();
}
void stringcopy(char *trg,char *source)
{
while(*trg++=*source++);
//Alternative way pretty adhoc process
/*while(*source)
{
*trg = *source;
trg++;
source++;
}
*trg=*source;*/
}

Monday, 12 May 2014

How to create a view in Oracle

A view is a sql statement which can be stored in Oracle database as SQL statement. It never stored as data but as a sql statement.

Syntax to create a view

CREATE OR REPLACE VIEW VIEW_NAME AS
SELECT * FROM TABLE_NAME;

Syntax to see a view content

DESC VIEW_NAME

Syntax to delete a view

DROP VIEW VIEW_NAME

You can use a view as a table i.e. add where clause in view or use it in an inline view.

SELECT * FROM VIEW_NAME WHERE COLUMN_NAME = FIELD_VALUE

Example

Suppose you have a sql based on 2 table employee having 2 columns ecode, ename
and salary having 2 columns month_year, net_pay. Now the sql is to get ecode, ename,month_year
and sum of ney_pay. sql statement is given below.

select ee.ecode, ee.ename,sl.month_year, sum(sl.ney_pay) tot_net_pay
from employee ee,salary sl
where sl.emp_id = ee.emp_id
group by ee.ecode, ee.ename,sl.month_year,
order by 1,3

sl is the alias for table salary, ee is the alias for table employee, emp_id is primary key in employee
and reference key in salary. order by clause uses index of columns in select clause.

Now to create the view we write

CREATE OR REPLACE VIEW EMP_SAL_VIEW AS
select ee.ecode, ee.ename,sl.month_year, sum(sl.ney_pay) tot_net_pay
from employee ee,salary sl
where sl.emp_id = ee.emp_id
group by ee.ecode, ee.ename,sl.month_year,
order by 1,3

Now if you write a select query on this view it will be

SELECT ECODE,ENAME,MONTH_YEAR,NET_PAY FROM EMP_SAL_VIEW;

You can also use where clause in this view.

SELECT ECODE,ENAME,MONTH_YEAR,NET_PAY FROM EMP_SAL_VIEW
WHERE NET_PAY<=1000;

Sunday, 11 May 2014

How to shutdown a Windows machine from command line.

Open command prompt.

1. To simply shutdown type
     shutdown -s

2.  To forcefully shutdown the machine (Close all application forcefully before shutdown)
     shutdown -f -s

3. To restart type
    shutdown -r

4. To forcefully restart the machine (Close all application forcefully before restart)
    shutdown -f -r

5.  To set countdown before shutting down your machine.
   
     shutdown -s -t 60  (60 is value in seconds if you want to shutdown after 1 hour value will be 3600)

6. To shutdown a machine remotely from another computer.

    shutdown -s -m \\computer name or ipaddress (Be sure the machine has permission to shutdown
    remotely.

Some useful shortcut key in Windows 7 and 8

1. To open, hide or show run dialog Press Windows key + R together.

2. To select any of the taksbar pinned program Press [Window + program position in taskbar] together.
    Say your Firefox is in 4th position from the left then press Window key + 4. If the program is running and
    in minimized state or not an active window then pressing this buttons will make it active window or
   maximized if it is minimized.

3. To open search window on a particular folder. Select the folder from the explorer and press
    Windows key + F.

4. To minimize all window press Window key + D.

5. I hope you know about the second screen window, it is used if you want to extend your monitor to a
    projector,  or make a duplicate screen to another monitor etc. To open the second screen window, press
    Window key + P.

6. To minimize all screen Press Window key + M.

7. To open the explorer window press Window key + E.

8. To open the start menu press Window key, or press Control key + Escape key.


How to add Quick Launch toolbar in Windows 8

Right click on empty space in task bar.

Go to Toolbar.
Select new toolbar from Toolbar submenu.
Set this path into select folder dialog

C:\Users\[You user folder]\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch
Click on Select Folder
You are all done.

Quick launch toolbar will be visible on right corner of the taskbar just left to the datatime.

How to start and stop Oracle database service in Linux.

You can do this task from both server and client.

1. If you do it from server then

  i. Make sure you are logged in as oracle user i.e. user which Oracle is installed and user who has all the
     rights.
 ii. Open terminal
iii. type sqlplus / as sysdba
iv. You will be logged in sql prompt. In the sql prompt just type startup. This will start your Oracle database
     service.
v.  type exit to exit from sql prompt.
vi. Now type service start lsnrctl. This will start your listener service.

You are all done.

2. If you are in  a client / remote machine then you need to have putty ssh client. Log in to oracle user
    through putty and do the same steps as mentioned above.

How to start and stop Oracle database service in Windows.

Suppose your instance name of Oracle is ORA.

You will be having 2 services which need to be started.

Step 1:
You can configure Windows service to start this service at startup, if it is not started.

  i. Press window key + R to open run dialog. type services.msc and press enter.
 ii. Search for service OracleServiceOra.
iii. Right click on it and click on properties from popup menu.
iv.From the startup type select Automatic if you want to start the service when windows start, or select
   manual if you want to start the service manually, this will save you windows loading time and save memory
  also.
v. Click on start button if you want to start the service now.
vi. Click on apply.
vii/ Search for Oracle[OracleHomeName]TNSListener (Oracle home name is your oracle installed path).
viii. Do the same process as you have done with OracleServiceORA.

Step 2.

If you have set your service as mentioned above to be started manually then you can use command prompt
to start your service.

  i.  Create a batch file named say StartOracleService.bat
 ii.  In the batch file add these following line.
      @echo off
       net start OracleServiceOra
       net start Oracle[OracleHomeName]TNSListener
       REM OracleHomeName is you Oracle installed path
       exit
iii.   To stop the service create a batch file named say StopOracleService.bat
       In the file add these following line.
      @echo off
       net stop OracleServiceOra
       net stop Oracle[OracleHomeName]TNSListener
       REM OracleHomeName is you Oracle installed path
       exit


Monday, 7 April 2014

Check for prime number in Objective-C

#import <Foundation/Foundation.h>

int isPrime(int n)
{
int i;
if(n==1||n==2)
return 0;
for(i=3;i<=n/2;i++)
if(n%i==0)
return 0;
return 1;
}

int main (int argc, const char * argv[])
{
   NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
   int i;
   for(i=1;i<=100;i++)
   {
   if(isPrime(i)==1)
    NSLog (@"%d is Prime number,",i);
   else
    NSLog (@"%d is not Prime number,",i);
   }
 [pool drain];
   return 0;
}

How to print Fibonacci series in Objective-C

#import <Foundation/Foundation.h>

int fibonacci(int n)
{
if(n<=2)
return(1);
return fibonacci(n-1) + fibonacci(n-2);
}

int main (int argc, const char * argv[])
{
   NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
   int i;
   for(i=1;i<=8;i++)
   {
   int fib=fibonacci(i);
   NSLog (@"%d,",fib);
   }
 [pool drain];
   return 0;
}

Find Factorial of a number recursively in Objective-C

#import <Foundation/Foundation.h>

float factorial(int n)
{
if(n<=1)
return(1);
return n*factorial(n-1);
}

int main (int argc, const char * argv[])
{
   NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
   long fact=factorial(8);
   NSLog (@"Factorial of 8 is %ld",fact);
 [pool drain];
   return 0;
}

Sunday, 6 April 2014

How to format Date using SimpleDateFormat in JSP

<%@ page import="java.io.*,java.util.*" %>
<%@ page import="javax.servlet.*,java.text.*" %>
<html>
<head>
<title>Current Date & Time</title>
</head>
<body>
<center>
<h1>Display Current Date & Time</h1>
</center>
<%
   Date currDt = new Date( );
   SimpleDateFormat sdf =  new SimpleDateFormat ("dd/MM/yyyy hh:mm:ss");
   out.print( "<h1 align=\"center\">" + sdf.format(currDt) + "</h1>");
%>
</body>
</html>