Wednesday 2 September 2015

Install Ubuntu with Windows 8 for dual boot

You can try updating grub after installing ubuntu by booting from ubuntu live CD/USB.
Open terminal and run following commands: -
If Linux's "/" on sda2 (second) (you can check it from Disks utility of ubuntu) partition. Run the following command.
$ sudo mount /dev/sda2 /mnt
$ sudo grub-install --root-directory=/mnt /dev/sda
The above commands will install GRUB. Now boot your system with the HardDisk. When the system is booted up open the terminal and run the following command.
$ sudo update-grub2
The above command will add an entry for windows  operating system in the grub config file.
But mostly (if you are not lucky) above steps will not work with Windows 8, then follow the following steps and you will have a dual boot machine

1. Back up Windows

There are two steps to backing up Windows:
  1. Create a recovery drive for backing up Windows 8.1
  2. Create a file history for backing up personal files

Be ready with a bootable Ubuntu USB drive

3. Shrink your Windows partition

Windows takes up the whole of the drive when it is first installed. In order to install Ubuntu you will need to make space for it. Press the "super key" (Windows key) on your keyboard and click the magnifying glass in the top right corner. In the search box start typing "Partitions". Click on the option called "Create and format partitions". This will bring up the "Disk Management" screen. 
 
To shrink the drive, right click on the "OS (C:)" volume and select "Shrink volume". A screen will appear showing how much you can shrink the drive by. Click "Shrink" to continue. When you are finished you will see that there is a lot of unpartitioned space. This is where Ubuntu will be installed.

4. Turn off fast boot

To be able to boot to your Ubuntu USB drive you will need to turn off the fast boot option. Press the "super" key (Windows key) and then click the magnifying glass in the top right corner. Enter "Control Panel". Click on the "Control Panel" option that appears. When the "Control Panel" appears click on the "System and Security" heading. Now click on "Power Options". On the following screen click on "Choose what the power button does". A screen will appear with the heading "Define power buttons and turn on password protection". Scroll down until you see "Shutdown Settings". An option should be available called "Turn on fast startup" (recommended). Uncheck this option. Click "Save Changes".

5. Turn off secure boot

Turn off secure boot from your BIOS setup.

6. Install Ubuntu

Boot from the USB drive into Ubuntu live and you should have a similar option available to you. 
 
In “INSTALLATION TYPE ” Window select “Something else” 
create partitions for boot and root folders.

7. Boot Repair

Restart now and your computer booted straight into Windows without giving the option for Ubuntu. So reboot and choose to boot from USB again. You will now be booted back into the live session of Ubuntu. Make sure that Internet connection is on your computer, and open a terminal by pressing the "super" key (Windows key) and typing "term". Within the terminal window enter the following commands one by one.
sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo sh -c "sed -i 's/trusty/saucy/g' /etc/apt/sources.list.d/yannubuntu-boot-repair-trusty.list"
sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair
Eventually the boot repair screen will appear.

Click on the "Recommended repair".
A message stating "EFI is detected" may appear. This is just an informational message as far as I am concerned because it is perfectly fine to install Ubuntu with EFI turned on. After clicking "OK" to the EFI detected message the utility performed a few tasks and then asked me to select some text and run it in a terminal window. If you are asked to do this open a new terminal window (press the "super" key, enter "term" into the Dash and click on the icon that appears). Copy the text from the boot repair window by selecting it with the mouse. Press CTRL and C and then right click in the terminal window and select paste. Make sure all the commands have run correctly. You may need to press return to get the last command to run. Now click on the "Forward" button within the boot repair application. You may be asked to copy and paste more text. Repeat the process of selecting all the text, press CTRL and C and then right click in the terminal window and select paste. Make sure the commands run. Keep following through on the process until the boot repair finishes.

8. Fix the boot loader

Reboot your computer.
Unless you are lucky it will still boot straight into Windows and actually this is ok because we are going to use Windows to fix the boot loader. Log into Windows and make sure you are viewing the desktop and not the tiles screen. Hover the mouse in the bottom left corner and right click. You should see an option for the administrator's command prompt. Click on this option. Within the administrator's command prompt type the following command:
bcdedit /set "{bootmgr}" path \EFI\ubuntu\grubx64.efi
Exit the command prompt.

9. Reboot into Ubuntu

Reboot your computer. This time when the computer boots you should see 4 options.
1. Ubuntu
2. Ubuntu (advanced)
3. Windows (might say something similar like Windows boot options).
4. Setup

Choose option 1.
Ubuntu should now appear.

10. Reboot into Windows

Reboot your computer (click the symbol in the top right corner, click shutdown and restart). This time when the boot menu appears click on the Windows option. Your computer should boot back into Windows 8.

Monday 25 May 2015

Configuring the PHP Development Environment With NETBEANS IDE in Linux Ubuntu

Installing the Software Packages Together

Ubuntu provides a Linux AMP (LAMP) package that contains all the necessary packages for your PHP environment. You can install the software by executing the following command at the command prompt in the Terminal window:

sudo tasksel install lamp-server

The lamp-server package includes the most suitable version of PHP, Apache 2, MySQL, and PHP5-MySQL.

Installing the Software Packages Separately

Instead of installing the entire set of LAMP packages, you can also install the packages individually. This is useful if you already have installed one of the components, such as the Apache server or MySQL database server. You can use command-line tools or the Synaptic Package Manager GUI.
The individual packages to install are the following:
  • apache2
  • php5
  • mysql-server
  • php5-mysql

Checking the Installation

After you set up your PHP web stack, check that it is installed correctly and that your Apache server recognizes your PHP engine.
To check that Apache and PHP are installed and running, open "NetBeans IDE" and create a PHP project. In the index.php file, enter the PHP method phpinfo(). Run the file. The standard PHP information page should display.

The following are some frequently encountered problems when checking the installation of your PHP stack in Ubuntu:
  • The browser window displays a Not Found error for ~USER/PROJECT/index.php. Remove the ~USER string from the URL. For example, if this error appears for the URL ~ubuntu/test1/index.php, change the URL to test1/index.php. Note that you can set the URL for a PHP project in NetBeans IDE either when you create the project, or by right-clicking the project node and going to Properties > Run Configuration.
  • The browser shows you a popup asking you to open the file, as if the PHP engine is not recognized. There's a problem with your php5-common package. Replace it with php5 and phpmyadmin. To replace php5-common, run the following two commands:
    apt-get --purge remove php5-common
    
    apt-get install php5 phpmyadmin
     

    Specifying the Document Root for the Apache2 HTTP Server

    The Document Root is the directory where the Apache HTTP server takes files for displaying in the browser. The Document Root is specified in the file that defines your virtual host. The default virtual host configuration file is /etc/apache2/sites-available/default with the document root /var/www/ We recommend that you create your own virtual host and enable it instead of editing the default one.
  • Create the Document Root Location
  • Specify the new document root in a new virtual host
  • Activating the new virtual host

Creating the Document Root Location

  1. Choose Places > Home Folder.
  2. From the context menu, choose Create Folder.
  3. Enter the name of the folder, for example, public_html.

Creating a New Virtual Host

  1. To launch the Terminal, choose Applications>Accessories>Terminal. The Terminal window opens.
  2. To copy the configuration file of the default virtual host to a new file (mysite), type the following command at the command prompt:
    sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/mysite
  3. Run the gedit application and edit the new configuration file (mysite) in it:
    gksudo gedit /etc/apache2/sites-available/mysite 
    If asked, enter the password that you specified for the root user during the installation of your operating system.
  4. Change the Document Root to point to the new location:
    /home/<user>/public_html/
  5. Change the Directory directive, replace
    <Directory /var/www/>
    with
    <Directory /home/user/public_html/>
     

    Activating the New Virtual Host


    1. To deactivate the default host and activate the new host, launch the Terminal and run the following two utilities in the Terminal window:
      sudo a2dissite default && sudo a2ensite mysite
    2. Restart the Apache HTTP server:
      sudo /etc/init.d/apache2 reload
       
       
      Troubleshooting Apache
      If you get this error:
      apache2: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName then use a text editor such as "sudo nano" at the command line or "gksudo gedit" on the desktop to create a new file,
      sudo nano /etc/apache2/conf.d/fqdn or
      gksu "gedit /etc/apache2/conf.d/fqdn" then add
      ServerName localhost to the file and save. This can all be done in a single command with the following:
      echo "ServerName localhost" | sudo tee /etc/apache2/conf.d/fqdn


Configuring the MySQL Database Server

During the installation of the MySQL database server, a root user is created. A dialog opens during installation in which you set a root user password. If this dialog did not open, or you did not set a password in this dialog, you need to create a MySQL root user password now. You will need the password for creating other MySQL server users.
  1. To connect to the MySQL server, launch the Terminal and in the Terminal window enter the following command:
    mysql -u root -p
    The MySQL command prompt appears.
  2. At the command prompt enter the following command and press Enter:
    SET PASSWORD FOR 'root'@'localhost' = PASSWORD('<yourpassword>');
    If the command is executed successfully, the following message is displayed:
    Query OK, 0 rows affected (0.00 sec)

Friday 22 May 2015

Ubuntu Netbeans and LAMP server

In this article the author will show you how to setup Linux Apache Mysql PHP (LAMP) web development environment on Ubuntu  with your web site files in your home directory. This way you can easily develop for web.

The goal of the author in this  session are to install Apache, MySQL and PHP with Xdebug module for PHP development debugging.  The author will setup Xdebug and use it with Netbeans, but once Xdebug is properly installed, you can debug your applications with any other application like Eclipse. The most important thing for a web developer or web programmer is to be able to easily modify his web development files without becoming root for everything he is working on. The author  will show you how to instruct Apache to make virtual host in your home directory. At the end of it all the author will install Netbeans and create sample project to work with our new development environment. So lets get started...
First thing you need to do is to install Linux Apache Mysql PHP server. In Debian based Linux distribution this is easily done using tasksel to select all necessary packages for typical Linux Apache Mysql PHP server. So lets install tasksel program first. Type this at your terminal:

sudo apt-get install tasksel

Next thing is to use tasksel to install Linux Apache Mysql PHP server. We do this this way:

sudo tasksel install lamp-server

In the middle of Linux Apache Mysql PHP installation, tasksel will ask you for MySQL root password. It is very important to write down what you gave to tasksel, because this password will be used to access MySQL database. After Linux Apache Mysql PHP installation is over, you will install Xdebug and one of the PHP image manipulation modules any web developer will need in his work, namely GD library. While you're working with apt-get, you will install Netbeans from Ubuntu repository. Here's the command to do this:

sudo apt-get install php5-xdebug php5-gd netbeans

Author usually use directory "public_html" inside auhtor home to keep all of author web sites code. You can use whatever directory inside you home you want. Important thing to mention is that Ubuntu web server is started as user "www-data" and directory where you keep your web source code should be accessible and writable by this user. So you will designate "www-data" as the owner of "public_html" directory. What's important for you is that you, as users have same permissions like your web servers "www-data" user for "public_html" directory so you could freely do your work. you will accomplish this by adding your selves to the "www-data" group. Now lets create "public_html" directory, adjust its permissions and add your selves to the "www-data" group:

mkdir /home/$USER/public_html 

sudo chown -R www-data:www-data /home/$USER/public_html sudo chmod -R 775 /home/$USER/public_html 

sudo adduser $USER www-data

Now after we have our "public_html" folder in place, we will adjust Apache setting so that "public_html" is used as web server document root. This way when we go to "localhost" or "127.0.0.1" server serves files from "/home/$USER/public_html". We will copy default web site template and modify it:

sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/public_html

Now we need to edit new web site template to point to "/home/$USER/public_html" instead of default "/var/www". Lets open our new template for editing:

gksudo gedit /etc/apache2/sites-available/public_html

We need to modify two lines: "DocumentRoot" from "/var/www" to "/home/username/public_html" and location of the second "Directory" section from "/var/www/" to "/home/username/public_html/". Notice the extra "/" on the "Directory" definition when compared to "DocumentRoot", this is on purpose. Instead of "usensame" put you own username. Everything else should be left as it were.
Here's the example of our modified file on my Ubuntu PC. Instead of "Aryan" in this file you must put your own username:
 
<VirtualHost *:80>
 ServerAdmin webmaster@localhost
 
 DocumentRoot /home/Aryan/public_html
 <Directory />
  Options FollowSymLinks
  AllowOverride None
 </Directory>
 <Directory /home/Aryan/public_html/>
  Options Indexes FollowSymLinks MultiViews
  AllowOverride None
  Order allow,deny
  allow from all
 </Directory>
 
 ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
 <Directory "/usr/lib/cgi-bin">
  AllowOverride None
  Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
  Order allow,deny
  Allow from all
 </Directory>
 
 ErrorLog /home/Aryan/public_html/error.log
 
 # Possible values include: debug, info, notice, warn, error, crit,
 # alert, emerg.
 LogLevel warn
 
 CustomLog /home/Aryan/public_html/access.log combined
 
    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>
 
</VirtualHost>
 
Now we can disable Ubuntu default "/var/www"site and enable our new "public_html" site:

sudo a2dissite default sudo a2ensite public_html

What's left is to adjust Xdebug settings to allow debugging. We need to append to Xdebug configuration file:
For older Ubuntu (Debian) versions:

gksudo gedit /etc/php5/conf.d/xdebug.ini

For recent Ubuntu (Debian) versions:

gksudo gedit /etc/php5/mods-available/xdebug.ini

We will add this at the bottom of "/etc/php5/conf.d/xdebug.ini":
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
HERE's the example of old Xdebug configuration file, and HERE's the example of our modified file.
Now we restart Apache server to apply our new settings:

sudo service apache2 restart

The last thing to do is to setup Netbeans with project inside our new "public_html" directory. Because we added our selves to the "www-data" user group, we should restart our PC now to make sure everything is refreshed properly. Next we start Netbeans from Applications -> Programming -> Netbeans and create new project by going to the File -> New Project. In the dialog we select PHP from the left side and "PHP Application" from the right side.
On the next screen you should configure things like this if you want your project to be called "techytalk":
Netbeans New PHP Project - selecting name and location
Netbeans New PHP Project - selecting name and location
After you click "next" you will be presented with the screen for run configuration. "Run As" should be set to "Local web site" and "Project URL" to "http://localhost/techytalk/". Leave the checkbox unchecked and click next two times.
Now you are presented with index.php inside Netbeans IDE and you can start creating your new web site. You can go to Run -> Run Project to show your web site in your browser or Debug -> Debug project to debug it. When you choose debug you will be given an opportunity to go trough your PHP code line by line and watch state of variables change at the bottom of Netbeans window on "Variables" tab.
This guide is a bit longer so there are many places for both of us to make mistake. So if something doesn't work, comment here (you don't need to register) and I'll do my best to help you out.

Sunday 19 April 2015

How to recover GRUB after Microsoft Windows Installation ?


I have been asked so many times by the linux newbies "How to recover GRUB after installing XP or windows 7 ?".

To make the Linux booting after installing windows on the other partition, we need to re-install the GRUB again. You need a Ubuntu bootable pendrive or live CD for this purpose. Boot your system with this pendrive or live CD. Open command line terminal (Application-> Accessories-> Terminal). I am assuming that windows is on first partition and Linux's "/" on second partition. Run the following command.
$ sudo mount /dev/sda2 /mnt
$ sudo grub-install --root-directory=/mnt /dev/sda

The above commands will install GRUB. Now boot your system with the HardDisk. When the system is booted up open the terminal and run the following command.
$ sudo update-grub2
The above command will add an entry for windows  operating system in the grub config file

Saturday 10 January 2015

CBSE NET December 2014 Computer Science 2nd Paper Answers

CBSE NET December 2014 Computer Science 2nd Paper Answers: -
Q.No.
Ans
Q.No.
Ans
Q.No.
Ans
Q.No.
Ans
Q.No.
Ans
1
C
11
B
21
A
31
B
41
B
2
D
12
A
22
D
32
C
42
C
3
C
13
B
23
A
33
A
43
B
4
C
14
A
24
A
34
C
44
D
5
D
15
B, C
25
C
35
C
45
D
6
D
16
B
26
B
36
D
46
D
7
C
17
D
27
***
37
47
B
8
B
18
D
28
C
38
C
48
D
9
D
19
B
29
B
39
C
49
D
10
B
20
B
30
D
40
B
50
B
Hope all done good

CBSE NET December 2014 Computer Science Answers


Please share your views guys: -


1. A hierarchical memory system that uses cache memory has cache access time of 50 nano seconds, main memory access time of 300 nano seconds, 75% of memory requests are for read, hit ratio of 0.8 for read access and the write-through scheme is used. What will be the average access time of the system both for read and write requests ?
A.      157.5 n.sec.
B.   110 n.sec.
C     75 n.sec.
D.      82.5 n.sec

2: For switching from a CPU user mode to the supervisor mode following type of interrupt is most appropriate
A.      Internal interrupts
B.      External interrupts
C.      Software interrupts
D.      None of the above

3:  In a dot matrix printer the time to print a character is 6 m:sec., time to space in between characters is 2 m.sec., and the number of characters ina line are 200. The printing speed of the dot matrix printer in characters per second and the time to print a character line are given by which of the following options?
A.      125 chars/second and 0.8 seconds
B.      250 chars/second and 0.6 seconds
C.      166 chars/second and 0.8 seconds
D.      250 chars/second and 0.4 seconds

4: Match the following 8085 instructions with the flags:
   List - I              List - II
a. XCHG            i. only carry flag is affected.
b. SUB              ii. no flags are affected.
c. STC              iii. all flags other than carry flag are affected.
d. DCR             iv. all flags are affected.
a  b  c   d
A.      iv  i   iii  ii
B.      iii  ii   i  iv
C.      ii  iii   i  iv
D.      ii  iv   i  iii
5:  How many times will the following loop be executed?
          LXI    B, 0007 H
LOP: DCX  B
          MOV  A,B
          ORA  C
          JNZ   LOP
A.      05
B.      07
C.      09
D.      00

6:  Specify the contents of the accumulator and the status of the S, Z and CY flags when 8085 microprocessor performs addition of 87 H and 79 H.
A.      11, 1 ,1 ,1
B.      10, 0 ,1 ,0
C.      01, 1, 0, 0
D.      00, 0, 1, 1

7:  Location transparency allows :
I. Users to treat the data as if it is done at one location.
II. Programmers to treat the data as if it is at one location.
III. Managers to treat the data as if it is at one location.
Which one ofthe following is correct ?
A.      I, II and III
B.      I and II only
C.      II and III only
D.      II only

8: Which of the following is correct?
I. Two phase locking is an optimistic protocol.
II. Two phase locking is pessimistic protocol
III. Time stamping is an optimistic protocol.
IV. Time stamping is pessimistic protocol.
A.      I and III
B.      II and IV
C.      I and IV
D.      II and III

9: ------------------ rules used to limit the volume of log information that has to be handled and processed in the event of system failure involving the loss of volatile information.
A.      Write-ahead log
B.      Check-pointing
C.      Log buffer
D.      Thomas

10:  Let R = ABCDE is a relational scheme with functional dependency set F = {A -> B, B ->C,AC -> D}. The attribute closures of A and E are
A.      ABCD, Ø
B.      ABCD, E
C.      ɸ , Ø
D.      ABC, E

11:  Consider the following statements:
I. Re-construction operation used in mixed fragmentation satisfies commutative rule.
II. Re-construction operation used in vertical fragmentation satisfies commutative rule
Which of the following is correct?
A.       I
B.       II
C.       Both are correct
D.       None of the statements are correct.

12: Which of the following is false?
A.       Every binary relation is never be in BCNF.
B.       Every BCNF relation is in 3NF.
C.       1 NF,2 NF, 3 NF and BCNF are based on functional dependencies.
D.       Multivalued Dependency (MVD) is a special case of Join Dependency (JD)

13: Which of the following categories of languages do not refer to animation languages?
A.      Graphical languages
B.       General-purpose languages
C.       Linear-list notations
D.      None of the above

14:  Match the following:
     List- I                                       List- II
a. Tablet, Joystick                   i Continuous devices
b. Light Pen, Touch Screen  ii.  Direct devices
c. Locator, Keyboard             iii. Logical devices
d. Data Globe, Sonic Pen    iv. 3D interaction wires
 a   b   c    d
A.       ii    i    iv   iii
B.       i    iv    iii   ii
C.       i    ii   iii   iv
D.       iv   iii   ii    i

15: A technique used to approximate halftones without reducing spatial resolution is known as ----
A.       Halftoning
B.       Dithering
C.       Error diffusion
D.       None of the above

16:  Consider a triangle represented by A(0, 0), B(1, 1), C(5, 2). The triangle is rotated by 45 degrees about a point P( -1, -1). The co-ordinates of the new triangle obtained after rotation shall be
A.       A'(-1, √2 -1), B'(-1, 2√2 - 1), C'((3/2)√2 - 1, (9/2)√2 - 1)
B.       A'(√2 -1,- 1), B'( 2√2 - 1, -1), C'((3/2)√2 - 1, (9/2)√2 - 1)
C.       A'(-1, √2 -1), B'(2√2 - 1, -1), C'((3/2)√2 - 1, (9/2)√2 - 1)
D.       A'(-1, √2 -1), B'( 2√2 - 1, -1), C'((9/2)√2 - 1, (3/2)√2 - 1)


17. In Cyrus-Beck algorithm for line clipping the value of t parameter is computed by the relation: (Here P1 and P2 are the two endpoints of the line, f is a point on the boundary, ni is inner normal)
Answer is B
18:  Match the following :
a. Cavalier Projection              i. The direction of projection is chosen so that there is no foreshortening of lines                                               perpendicular to the xy plane.
b. Cabinet Projection              ii. The direction of projection is chosen so that lines perpendicular to the xy planes are                                     foreshortened by half their lengths.
c. Isometric Projection        iii. The direction of projection makes equal angles with all of the principal  
                                                                axis.
d. Orthographic Projection    iv. Projections are characterized by the fact that the direction of projection
                                                         perpendicular to the view plane.
a  b   c  d
A.      i  iii   iv   ii
B.      ii  iii   i   iv
C.      iv  ii   iii   i
D.      i   ii   iii   iv
19:  Consider the following statements S1, S2 and S3 :
S1 : In call-by-value, anything that is passed into a function call is unchanged in the caller's scope when the function returns.
S2: In call-by-reference, a function receives implicit reference to a variable used as argument.
S3: In call-by-reference, caller is unable to see the modified variable used as argument.
A.       S3 and S2 are true
B.       S3 and S1 are true.
C.       S2 and S1 are true.
D.       S1, S2, S3 are true.
20:  How many tokens will be generated by the scanner for the following statement?
x = x * (a+b) - 5;
A.       12
B.       11
C.       10
D.       7
21:  Which of the following statements is not true?
A.       MPI_lsend and MPI_Irecv are non-blocking message passing routines of MPI.
B.       MPI_lssend and MPI_Ibsend are non-blocking message passing routines of MPI.
C.       MPI_Send and MPI_Recv are non-blocking message passing routines of MPI.
D.       MPI_Ssend and MPI_Bsend are blocking message passing routines of MPI.
 


22:  The pushdown automation M = ( {q0, q1, q2}',{a, b}, {0, 1}, δ, q0,0, {q0}) with
δ (q0, a, 0) = {(q1,10)}
δ (q1,a, 1) = {(q1,11)}
δ (q1,b, 1) = {(q2 , λ)}
δ(q2 , b, 1) = {(q2 , λ)}
δ (q2 , A, 0) = {(q0, λ)}
Accepts the language
A. L= {anbml n,m >=0}
B. L= {anbnl n >=0}
C. L= {anbml n,m >0}
D. L= {anbnl n >0}
23:  Given two languages:
L1= {(ab)n,ak I n> k, k >=0}
L2 = {an bm l n ≠ m}
Using pumping lemma for regular language, it can be shown that
A. L1 is regular and L2 is not regular.
B. L1 is not regular and L2 is regular.
C. L1 is regular and L2 is regular.
D. L1 is not regular and L2 is not regular.
24:  Regular expression for the complement of language L = {an bm I n ≥ 4, m ≤ 3} is
A. (a + b)* ba(a + b)*
B. a* bbbbb*
C. (λ + a + aa + aaa)b* + (a + b)* ba(a + b)*
D. None of the above
25: For n devices in a network, ____ , number of duplex-mode links are required, for a mesh topology.
A. n(n + 1)
B. n(n - 1)
C. n(n + 1) /2
D. n(n - 1)/2
26: How many characters per second (7 bits + 1 parity) can be transmitted over a 3200 bps line if the transfer is asynchronous? (Assuming 1 start bit and 1 stop bit)
A. 300
B. 320
C. 360
D. 400
27: Which of the following is not a field in TCP header?
A. Sequence number
B. Fragment offset
C. Checksum
D. Window size
28: What is the propagation time if the distance between the two points is 48,900 ? Assume the propagation speed to be 2.4 x 108 metre/second in cable.
A. 0.5 ms
B. 20 ms
C. 50 ms
D. 200 ms
29: ----------- is a bit-oriented protocol for communication over point-to-point and multipoint links.
A. Stop-and-wait
B. HDLC
C. Sliding window
D. Go-back-N
30: Which one of the following is true for asymmetric-key cryptography?
A. Private key is kept by the receiver and public key is announced to the public.
B. Public key is kept by the receiver and private key is announced to the public.
C. Both private key and public key are kept by the receiver.
D. Both private key and public key are announced to the public.
31: Any decision tree that sorts n elements has height.
A.      Ω (n)
B.      Ω(lg n)
C.      Ω(n lg n)
D.      Ω(n2)
32: Match the following .
     List- I                                                  List - II
a. Bucket sort                                     i. O(n3/gn)
b. Matrix chain multiplication        ii. O(n3)
c. Huffman codes                             iii. O(nlgn)
d. All pairs shortest paths               iv. O(n)
a   b   c   d
A.       iv   ii   i   iii
B.       ii   iv   i   iii
C.       iv   ii   iii   i
D.       iii   ii   iv   i
33: We can show that the clique problem is NP-hard by proving that
A. CLIQUE ≤ P 3-CNF SAT
B. CLIQUE ≤ P VERTEX_COVER
C. CLIQUE ≤  P SUBSET_SUM
D. None of the above
34:  Dijkstra algorithm, which . solves the single-source shortest--paths problem, is a ----, and the Floyd-Warshall algorithm, which finds shortest paths between all pairs of vertices, is a ___
A.       Greedy algorithm, Divide-conquer algorithm
B.       Divide-conquer algorithm, Greedy algorithm
C.       Greedy algorithm, Dynamic programming algorithm
D.       Dynamic programming algorithm, Greedy algorithm
35: Consider the problem of a chain <A1, A2, A3> of three matrices. Suppose that the dimensions of the matrices are 10 x 100, 100 x 5 and 5 x 50 respectively. There are two different ways of parenthesization : (i) ((A1 A2)A3) and (ii) (A1(A2 A3)) Computing the product according to the first parenthesization is   _  times faster in comparison to the second parenthesization.
A.      5
B.       10
C.       20
D.       100
36: Suppose that we have numbers between 1 and 1000 in a binary search tree and we want to search for the number 365. Which of the following sequences could not be the sequence of nodes examined ?
A.       4, 254,403, 400,332,346, 399, 365
B.       926,222,913,246,900,260,364,365
C.       927,204,913, 242,914,247,365
D.       4,401,389,221,268, 384,383, 280,365
37: Which methods are utilized to control the access to an object in multi-threaded programming?
A. Asynchronized methods
B. Synchronized methods
C. Serialized methods
D. None of the above
38:
Answer is (A)
39: Converting a primitive type data into its corresponding wrapper class object instance is called
A.      Boxing
B.      Wrapping
C.      Instantiation
D.      Autoboxing
40: The behaviour of the documerit elements in XML can be defined by
A.      Using document object
B.      Registering appropriate event handlers
C.      Using element object
D.      All of the above
41: What is true about UML stereotypes ?
A.      Stereotype is used for extending the UML language .
B.      Stereotyped class must be abstract
C.      The stereotype indicates that the UML element cannot be changed
D.      UML profiles can be stereotyped for backward compatibility
42: Which method is called first by an applet program?
A.       start()
B.       run()
C.       init()
D.       begin()
43: Which one of the following is not a source code metric?
A.       Halstead metric
B.     Function Point Metric
C.       Complexity metric
D.       Length metric
44: To compute function points (FP), the following relationship is used FP = Count - total x (0.65 + 0.01 x  ∑(Fi))where Fi (i = 1 to n) are value adjustment factors (VAF) based on n questions. The value of n is
A.       12
B.       14
C.       16
D.       18
45: Assume that the software team defines a project risk with 80% probability of occurrence of risk in the following manner:
Only 70 percent of the software components scheduled for reuse will be integrated into the application arid the remaining functionality will have to be custom developed: If 60 reusable components were planned with average component size as ' 100 LOC and software engineering cost for each LOC as $ 14, then the risk exposure would be
A.       $ 25,200
B.       $ 20,160
C.       $ 17,640
D.       $ 15,120
46: Maximum possible value of reliability is
A.       100
B.       10
C.       1
D.       0
47: 'FAN IN' of a component A is defined as
A.      Count of the number of components that can call, or pass control, to a component A
B.       Number of components related to component A
C.       Number of components dependent on component A
D.       None of the above
48: Temporal cohesion means
A.       Coincidental cohesion
B.       Cohesion between temporary variables
C.       Cohesion between local variables
D.       Cohesion with respect to time
49: Various storage devices used by an operating system can be arranged as follows in increasing order of accessing speed:
A.      Magnetic tapes → magnetic disks → optical disks →  electronic disks →  main memory →  cache →  registers
B.       Magnetic tapes → magnetic disks → electronic disks → optical disks → main memory → cache → registers
C.      Magnetic tapes → electronic disks → magnetic disks → optical disks → main memory → cache → registers
D.      Magnetic tapes → optical disks → magnetic disks →electronic disks →  main memory → cache → registers
50: How many disk blocks are required to keep list of free disk blocks in a 16 GB hard disk with 1 kB block size using linked list of free disk blocks? Assume that the disk block number is stored in 32 bits.
A.       1024 blocks
B.       16794 blocks
C.       20000 blocks
D.       1048576 blocks
(Isme kuch to galat hai.)
51: Consider an imaginary disk with 40 cylinders. A request come to read a block on cylinder 11. While the seek to cylinder 11 is in progress, new requests come in for cylinders 1, 36, 16, 34, 9 and 12 in that order. The number of arm motions using shortest seek first algorithm is
A.       111
B.       112
C.       60
D.       61
52: An operating system has 13 tape drives. There are three processes PI, P2 & P3.1 Maximum requirement of PI is 11 tape drives, P2 is 5 tape drives and P3 is 8 tape drives. Currently, PI is allocated 6 tape drives, P2 is allocated 3 tape drives and P3 is allocated 2 tape drives. Which of the following sequences represent a safe state?
A.       P2 P1 P3
B.       P2 P3 P1
C.       P1 P2 P3
D.       P1 P3 P2
53: Monitor is an Interprocess Communication (IPC) technique which can be described as
A.       It is higher level synchronization primitive and is a collection of procedures, variables, and data structures grouped together in a special package.
B.       It is a non-negative integer which apart from initialization can be acted upon by wait and signal operations
C.      It uses two primitives, send and receive which are system calls rather than language constructs.
D.       It consists of the IPC primitives implemented as system calls to block the process when they are not allowed to enter critical region to save CPU time.
54: In a distributed computing environment, distributed shared memory is used which is
A.       Logical combination of virtual memories on the nodes.
B.       Logical combination of physical memories on the nodes.
C.       Logical combination of the secondary memories on all the nodes.
D.       All of the above
55: Equivalent logical expression for the Well Formed Formula (WFF), ~( x)F[x] is
A.       ( x) ~F[x]
B.       ~( x) F[x]
C.       ( x)~ ( F[x])
D.       ( x)F[x]
56: An A * algorithm is a heuristic search technique which
A.       is like a depth-first search where most promising child is selected for expansion
B.      generates all successor nodes and computes an estimate of distance (cost) from start node to a goal node through each of the successors. It then chooses the successor with shortest cost.
C.      saves all path lengths (costs) from start node to all generated nodes and chooses shortest path for further expansion.
D.      None of the above
57: The resolvent of the set of clauses (A v B, ~ A v D, C v ~B) is
A.      A v B
B.       C v D
C.       A v C
D.       A v D
58: Match the following:
a. Script                                               i. Directed graph with labelled nodes for graphical representation of knowledge
b. Conceptual Dependencies       ii. Knowledge about objects and events is stored in record-like structures                                                                                   consisting of slots and slot values.
c. Frames                                         iii. Primitive concepts and rules to represent natural language statements
d. Associative Network                   iv. Frame like structures used to represent stereotypical patterns for commonly                                                                          occurring events in terms of actors, roles, props and scenes
a  b   c   d
A.      iv  ii   i    iii
B.      iv  iii   ii    i
C.      ii  iii   iv    i
D.       i  iii   iv   ii
59: Match the following components of an expert system :
a. I/O interface                       i. Accepts user's queries and responds to question through I/O interface
b. Explanation module       ii. Contains facts and rules about the domain
c. Inference engine       iii. Gives the user,the ability to follow inferencing steps at any time during consultation
d. Knowledge base            iv. Permits the user to communicate with the system in a natural way
                a  b   c   d
A.      i   iii   iv  ii
B.   iv  iii   i  ii
C.      i   iii   ii  iv
D.      iv   i   iii  ii

60: A computer based information system is needed :
I. as it is difficult for administrative staff to process data.
II. due to rapid growth of information and communication technology.
III. due to growing size of organizations which need to process large volume of data.
IV. as timely and accurate decisions are to be taken.
Which of the above statement(s) is/are true?
A.       I and II
B.       III and IV
C.       II and III
D.       II and IV
61:  Given the recursively enumerable language (LRE), the context sensitive language (LCS) the recursive language (LREC) the context free language (LCF) and deterministic context free language (LDCF) The relationship between these families is given by
A.      LCF LDCF LCS LRE LREC
B.      LCF LDCF LCS LREC LRE
C.                LDCF LCF LCS LRE LREC
D.      LDCF LCF LCS LREC LRE
62: Match the following:
       List- I                                                List -II
a. Context free grammar               i. Linear bounded automaton
b. Regular grammar                     ii. Pushdown automaton
c. Context sensitive grammar     iii. Turing machine
d. Unrestricted grammar             iv. Deterministic finite automaton
 a   b    c    d
A.       ii    iv   iii    i
B.       ii    iv    i    iii
C.       iv    i     ii    iii
D.       i    iv   iii    ii
63: According to pumping lemma for context free languages:
Let L be an infinite context free language, then there exists some positive integer m such that any w L with I w I ≥ m can be decomposed as w = u v x y z
A.      with I vxy I ≤ m such that uvi xyi z L for all i = 0,1,2
B.       with I vxy I ≤ m and I vy I ≥ 1 such that uvi xyi z L for all i = 0,1,2,.....
C.       with I vxy I ≥ m and I vy I ≤ 1 such that uvi xyi z L for all i = 0,1,2,.....
D.       with I vxy I ≥ m and I vy I ≥ 1 such that uvi xyi z L for all i = 0,1,2,.....
64: Given two spatial masks
The Laplacian of an image at all points (x,y) can be implemented by convolving the image with spatial mask. Which of the following can be used as the spatial mask?
A.      Only S1
B.      Only S2
C.      Both S1 and S2
D.      None of these
65:  Given a simple image of size 10 x 10 whose histogram models the symbol probabilities and is given by
P1
P2
P3
P4
A
B
C
d
The first order estimate of image entropy is maximum when
A.       a = 0, b = 0, c = 0, d = 1
B.      a = 1/2, b =1/2, c=0, d=0
C.      a = 1/3, b =1/3, c=1/3, d=0
D.      a = 1/4, b =1/4, c=1/4, d=1/4
66: Answer is (A)
67: If an artificial variable is present in the ,'basic variable' column of optimal simplex table, then the solution is
A.       Optimum
B.       Infeasible
C.       Unbounded
D.      Degenerate
68: The occurrence of degeneracy while solving a transportation problem means that
A.       total supply equals total demand
B.       total supply does not equal total demand
C.       the solution so obtained is not feasible
D.       none of these
69:
A.      5
B.      11
C.      13
D.      15
70: Consider the following statements about a perception:
I. Feature detector can be any function of the input parameters.
II. Learning procedure only adjusts the connection weights to the output layer.
Identify the correct statement out of the following:
A.      I is false and II is false
B.       I is true and II is false .
C.       I is false and II is true
D.       l is true and II is true.
71: A ---------- point of a fuzzy set A is a point x X at which µA(x) = 0.5
A.       Core
B.       Support
C.       Cross-over
D.       α - cut
72: Match the following learning modes w.r.t. characteristics of available information for learning :
a. Supervisead        i. Instructive information on desired responses explicitly specified by a teacher.
b. Recording            ii. A priori design information for memory storing
c. Reinforcement    iii. Partial information about desired responses, or only "right" or "wrong" evaluative information
d. unsupervised      iv. No information about desired responses
a   b   c   d
A.       i    ii   iii   iv
B.       i    iii   ii   iv
C.       ii    iv   iii  i
D.       ii   iii   iv   i
73: Which of the following versions of Windows O.S. contain built-in partition manager which allows us to shrink and expand pre-defined drives?
A.       Windows Vista
B.       Windows 2000
C.       Windows NT
D.       Windows 98
74: A Trojan horse is
A.      A program that performs a legitimate function that is known to an operating system or its user and also has a hidden component that can be used for nefarious purposes like attacks on message security or impersonation.
B.      A piece of code that can attach itself to other programs in the system and spread to other systems when programs are copied or transferred
C.       A program that spreads to other computer systems by exploiting security holes like weaknesses in facilities for creation of remote processes
D.      All of the above
75:  Which of the following computing models is not an example of distributed computing environment?
A.       Cloud computing
B.       Parallel computing
C.       Cluster computing
D.       Peer-to-peer computing