Tuesday, September 12, 2017

My answers Quizz - 1 - 2017 - Artificial Intellengence (S1-17_ISZC444)

Artificial Intellengence (S1-17_ISZC444)

 

A* with the heuristic h(n)=1 if n is not a goal node and h(n)=0
otherwise, is equivalent to
Select one:
Correct

Feedback

Monday, February 9, 2015

How to Compare one Column to other Column contents in Excel using VBA script.... Traceability...

Sub Traceability()

Dim i As Long
Dim j As Long
Dim k As Long
Dim CheckReq As String


i = 1
j = 1
 Sheets("Req").Select
 Do While Not IsEmpty(Sheets("Req").Cells(i, 1))
 Sheets("Req").Select
 CheckReq = RTrim(Sheets("Req").Cells(i, 1))
 Sheets("Req").Rows(i & ":" & i).Select
 Selection.Copy
 Sheets("Availability").Select
 Sheets("Availability").Rows(j & ":" & j).Select
 ActiveSheet.Paste

 k = 1
 Do While Not IsEmpty(Sheets("TestSpec").Cells(k, 1))

 If (RTrim(Sheets("TestSpec").Cells(k, 1)) = CheckReq) Then
 Sheets("Availability").Select
 Sheets("Availability").Cells(j, 13) = "Available in Test Spec"
 Exit Do
 End If
 k = k + 1

 Loop



 'This below variables for Req
 j = j + 1
 i = i + 1
   
 Loop
   
End Sub

How to detect OS version in System

/*
 * Os_version.c
 *
 *  Created on: 09.02.2015
 *  Author: Karthikeyan D
 *  This C code will be useful to detect the OS version in System...
 *  It can be adopted in in various application like Installation mode selection, Directory prediction, etc...
 *
 */

# include <stdio.h>
# include <stdlib.h>
int main()
{
    // To execute system command in  C program

    system("systeminfo | findstr /C:\"OS\"");

    printf("\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");

    system(" systeminfo | findstr /B /C:\"OS Name\" /C:\"OS Version\"");

    printf("\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");

    system("systeminfo");

    return 0;
}

Tuesday, January 27, 2015

Round Robin Algorithm Implementation in C program

/*
 * Round_Robin_Alg.c
 *
 *  Created on: 13.01.2015
 *      Author: karthikeyan dharmalingam */

# include "main_header.h"

//Declaration part
int nRound_Robin_Algorithm_fun(void);

// Definition part
int nRound_Robin_Algorithm_fun()
{

    printf("\nInside Round robin algorithm \n");

    //Variale declaration
    int nQuantumTime;     // To ge the quantum or slice number from user
    int nProcess,nRemainingProcess;     // To ge the number of process
    int nArrivalTime[255], nBurstTime[255], nRemainingTime[255]; //To get the arrival, burst,and remaing time of process.
    int nLoop, nTime, nFlagComplete;

    printf("\nEnter the number of process \n");
    scanf("%d",&nProcess); //To get the user input for number of process
    //To update remaining process count to complete all process
    nRemainingProcess = nProcess;

    printf("Enter the Quantum/Slice size 1 <--> 255\n");
    scanf("%d",&nQuantumTime); // To get the slice value from user

    //To get the individual timing information on each process.
    for (nLoop = 0; nLoop < nProcess; nLoop++ )
    {
        printf("Enter the arrival and Burst timing for process: P%d: ",nLoop+1);
        scanf("%d",&nArrivalTime[nLoop]);
        scanf("%d",&nBurstTime[nLoop]);
        nRemainingTime[nLoop] = nBurstTime[nLoop];
    }
    printf("\nSuccessfully input received from user\n");
    //Round robin Agorithm to schedule all the process.
    for (nLoop = 0, nTime = 0; nRemainingProcess != 0;)
    {
        //Check for remaining time greater than or equals to slice.
        if(nRemainingTime[nLoop] <= nQuantumTime && nRemainingTime[nLoop] > 0 )
        {


            nTime = nTime + nRemainingTime[nLoop];
            nRemainingTime[nLoop] = 0;
            nFlagComplete = 1; //Set the flag to notice the completion
            printf("\nInside  IF \n");

        }
        //Check for remaining time lesser than slice.
        else if(nRemainingTime[nLoop] > 0)
        {
            nTime = nTime + nQuantumTime;
            nRemainingTime[nLoop] = nRemainingTime[nLoop] - nQuantumTime;
            printf("\nInside ELSE IF \n");
        }
        //process compeleted status
        if(nRemainingTime[nLoop] == 0 && nFlagComplete == 1)
        {
            nRemainingProcess--; //Reduce number of process by one.
            printf("P[%d]\t|\t%d\t|\t%d\n",nLoop+1,nTime-nArrivalTime[nLoop],nTime-nArrivalTime[nLoop]-nBurstTime[nLoop]);
            //Remove flag for uncompleted process
            nFlagComplete = 0;
        }

        if(nLoop == nProcess - 1)
        {
            nLoop  = 0;
            printf("\nInside I \n");
        }
        else if(nArrivalTime[nLoop] <= nTime)
        {
            nLoop++;
            printf("\nInside II \n");

        }else
        {
            printf("\nInside III \n");
            nLoop = 0;
        }



    }



    return 0;
}