Thursday 28 December 2017

Validate 10 Digit Phone Number


Enter Phone Number :

Code

<html>
<head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
    <title>Girfa : Phone number validate</title>

Thursday 21 December 2017

Query String PHP

Query String PHP

Query string is part of an URI which is use to pass some information in URL. Information pass by a query string can be used by server or client by java script or any server side language. Query string is one most powerful method to pass additional information about web processing application but query string is not recommended to pass sensitive information because query string put flat text which can be read by anyone.

Wednesday 20 December 2017

Dynamic Memory allocation C language

Memory is storage unit which every program need for their operation. When you run your program then a request is made to OS for memory allocation. There are two types of memory allocations are used in programming.
  • Static
  • Dynamic

Static memory allocation is fix allocation.  It cannot be change during run time. Static memory allocation is better option in case when we know exactly how much amount of memory need. For example holding roll number marks of student etc.

Tuesday 19 December 2017

IDENT_CURRENT SQL Server



IDENT_CURRENT return last inserted identity field value from any session any scope table.
One most interesting things which surprise me while I had used this first time. Which is follows

You can get SQL server generated identity value which inserting row, means it is not necessary that identity value only can get after save a row. Not at all!

You can use this feature while creating some userid and roll number type field in many applications.

i.e: 10000001,2000829 etc.

CREATE TABLE dbo.stu( 
   ID INT IDENTITY NOT NULL PRIMARY KEY,  
   Roll varchar(20),
   Name VARCHAR(40) NOT NULL 
   City VARCHAR(40) NOT

Saturday 16 December 2017

Nested Loop


Nested Loop Banner


When a loop resides inside of other loop .Nested loops are useful while if there is a need of looping for each count of other turn of a loop.

Temporary Table in SQL Server store procedure

declare @mytbl as table
(
     id bigint,
     name varchar(30),
     mobileno varchar(30),

Friday 15 December 2017

Sort Array using pointer

Question : Write a function in ‘C’, using pointers for the array of elements, for sorting the elements.
Solution : 


#include<stdio.h>
#include<conio.h>
void sort(int*);
void main()
{

Thursday 14 December 2017

Sort an Array using pointer

Q : What do you mean by a pointer variable? Write a function in ‘C’, using pointers for the array of elements, for sorting the elements.

Solution : 

Pointer

A pointer is a special type of variable which hold physical address of a non pointer variable.Symbol * is used to make a pointer variable. Programmer can change a variable value from another location with the help of pointer. Call reference is an example of pointer , in which  a variable physical address pass to a function and any change made inside of function direct effect actual value of passed variable due to pointer.

Monday 11 December 2017

Show Modal Using Html.ActionLink

This post will give you an idea about how can you show a bootsrap modal using Html.ActionLink. I will also show you that how can you call a java script function with argument while showing modal.


Ones you will be able to call java script function while showing modal then you will be able to fetch data from server using ajax.

Hyperlink Code :


@Html.ActionLink("Detail", "_myModal", "Usertask", new { id = item.ID }, new { data_toggle = "modal", data_target = "#myModal", onclick = "test("+item.ID +");" })

Saturday 9 December 2017

Structure Example

Q : What is meant by structure data type? How do we reference the elements of a structure?
Give example of how a value of a structure can be assigned to another structure.

Solution : 


A structure is user defined data type which is used to store record based data. Structure is useful when there is a need to process record type data for example student record which is a combination of more than variable (roll,name,class,marks etc). Structure encapsulates more than one variable into a single logical unit. Without structure, processing of record based data is not an easy task. Programmer need to declare many variables with different name. Which increase complexity?


Structure C Language


Structure  C Language


A structure is user defined data type which is used to store record based data. Structure is useful when there is a need to process record type data for example student record which is a combination of more than variable (roll,name,class,marks etc). Structure encapsulates more than one variable into a single logical unit. Without structure, processing of record based data is not an easy task. Programmer need to declare many variables with different name. Which increase complexity?

Friday 8 December 2017

C Language Practice Question

O level ‘C’ Language

All questions are mandatory of part 1. Each question carries 1 mark for Part 1, Part 2 marks written front of question.



Multiple Choice

1. Example of exit control loop.
(A) do-while   
(B) for
(C) while 
(D) All

Saturday 2 December 2017

Jquery Drop Down Menu Operation

Jquery Drop Down Menu Operation

Reset Drop Down List :

Syntax : 

  $('Your drop Down ID').prop('selectedIndex', 0);

Thursday 30 November 2017

series

Q : Write a program to compute the following series:

x + x3 / 3! + x5/ 5! + …

To a given accuracy for x from 00 to 1800 in the steps of 100, use a inbuilt function FACT(n) to compute the factorial.

Solution : 

#include<stdio.h>
#include<conio.h>
int fact(int);
void main()
{
     int x,step,y,i;

Wednesday 29 November 2017

Tax Calculation Program

Write a program to calculate the income tax of an employee for the current financial year. A user will enter his age and Total salary of the current year and program will calculate and display the payable Income Tax from the given table. Tax slabs are applicable after deducting Rs. 1,00,000 of saving from total salary for each employee. The tax slabs are as
under: (Senior citizen: Age<60)

For All Tax
Rs.0 to 2,00,000 0% of income
2,00,001 - 5,00,000 10% on income excess of 2,00,000
5,00,001 - 10,00,000 30,000+20% on income excess of 5,00,000
Above Rs.10,00,000 1,30,000+30% on income excess of 10,00,000

Monday 27 November 2017

Thread

A thread is a basic unit of CPU utilization; it comprises a thread ID, a program counter, a register set, and a stack. It shares with other threads belonging to the same process its code section, data section, and other operating-system resources, such as open files and signals. A traditional (or heavyweight) process has a single thread of control.



Application


Many software packages that run on modern desktop PCs are multithreaded. An application typically is implemented as a separate process with several threads of control.

HTML Table Operation

HTML Table Operation


Hide Table Column


$('#table-name th:nth-child(column-no)').hide();

$('#table-name td:nth-child(column-no)').hide();

Example:
$('#tblService th:nth-child(4)').hide();
$('#tblService td:nth-child(4)').hide();


Print All columns of each row


var table = $("#tblBody");
        table.find('tr').each(function (i)
        {
            var $tds = $(this).find('td');
            alert ($tds.eq(0).text() + " , " + $tds.eq(1).text())
                              
        });


Print All Row columns except first

var table = $("#tblBody");
        table.find('tr').not(':first').each(function (i)
        {
            var $tds = $(this).find('td');
            alert ($tds.eq(0).text() + " , " + $tds.eq(1).text())
                              
        });
 

Get selected column data using rowid


Syntax:
$("RowId”).find('td').eq(ColumnIndex).text();

Example :
$("#r123”).find('td').eq(0).text();


Delete a Single row by row id

Syntax:
$("RowId”).remove();

Example :
$("#tblrow").remove();


Delete all row except first


Syntax:
$("selectorName").find("tr:gt(0)").remove();
Example :
 $("#tblStock").find("tr:gt(0)").remove();

Select A Table all rows by checkbox using jquery

Editable Table Jquery

Java Script Date Operation

Java Script Date Operation

Convert dd/mm/yyyy date to yyyy/mm/dd

Java Script support date in many format except dd/mm/yyyy . So if you are working on a project which has date as in dd/mm/yyyy format then you will need to change it mm/dd/yyyy for further date related operations.

Following code will change dd/mm/yyyy date to mm/dd/yyyy date format

Wednesday 22 November 2017

Solution : July, 2010 M3-R4: PROGRAMMING AND PROBLEM SOLVING THROUGH ‘C’ LANGUAGE

Solution : July, 2010 M3-R4: PROGRAMMING AND PROBLEM SOLVING THROUGH ‘C’ LANGUAGE

1. Multiple Choice : 


1.1 : B
1.2 : B
1.3 : A
1.4 : B
1.5 : C
1.6 : B
1.7 : C
1.8 : C
1.9 : B

Tuesday 14 November 2017

Jquery Animated Validation


Jquery Validation


Validation is most important part any website while creating a form. There are lots of methods and processes of JavaScript or jquery.

I have implemented basic validation as simple as possible which can be used for empty fields check. You need to call just little function and achieved validation on various HTML form tags. 



Roll :
Class :
Message :


Code

<html>
<head>
    <title>Girfa : Javascript Validation</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
    <script>
        var Flag = true;
        function Validate() {
            Flag = true;
            if ($("#txtRoll").val() == "")
                AddCss("txtRoll");
            if ($("#ddlClass").val() == "")
                AddCss("ddlClass");
            if ($("#txtMessage").val() == "")
                AddCss("txtMessage");
        }

        function AddCss(id) {

            Flag = false;

            $("#" + id).css("border", "solid 1px red");
            $('#' + id).animate({
                'marginLeft': "+=10px", //moves right
            }, 100);
            $('#' + id).animate({
                'marginLeft': "+=-10px", //moves right
            }, 100);
            $('#' + id).animate({
                'marginLeft': "+=10px", //moves right
            }, 100);
            $('#' + id).animate({
                'marginLeft': "+=-10px", //moves right
            }, 100);
        }
        function RemoveCss(id) {
            $("#" + id).css("border", '');

Saturday 11 November 2017

O Level C Language solved paper January-2011

NIELIT  O Level C Language solved paper January-2011

1. Multiple Choice


1.1 : B
1.2 : A
1.3 :  A
1.4 : A
1.5 : D
1.6 : B
1.7 :  C
1.8 : B
1.9 : A

Cosine series Flowchart

Q :  Make the flow chart to solve the following cosine series.
       S = 1 – x2/ 2! + x4/ 4! – x6/ 6! + … 100 terms


Solution : 

Cosine series Flowchart

Wednesday 8 November 2017

Dynamic Table Java Script


Dynamic Table Java Script

This post helps you to make dynamic table. You can do following task using this post code
  • Add a row dynamically
  • Check duplicate value
  • Delete a row 




ProductAction



HTML Code



<html>
<head>
    <title>Girfa : DynamicTable Management </title>
    <script>
 var tblrowid=0
 function AddScheduleTOTable() 
{
           

Sunday 5 November 2017

C language Paper Solution July 2011

NIELIT O Level C language Paper Solution  July 2011

1. Objective


1.1 : C
1.2 : B
1.3  :  D
1.4 : B
1.5 : B
1.6 : A
1.7 : A
1.8 :  B

Saturday 4 November 2017

2D character array sorting

Q : Write a ‘C’ program to read an array of names and to sort them in alphabetical order.

Solution :

/*==============================
     Girfa Student Help
     Program : Sort 2D  Array    
================================*/
#include<stdio.h>
#include<conio.h>
#define MAX 3
void main()
{
     char ar[MAX][20],ch[20];

Thursday 2 November 2017

NIELIT O Level C Language Solve Paper

July-12
Answer Key
1. Objective
1.1  : B
1.2 : A
1.3 : A
1.4 : C
1.5 : A

Tuesday 31 October 2017

Nielit O Level C Language Practice Paper Set 3

NIELIT O Level Sample Paper
C Language
Note : Each Question carry one marks :                                                                                Time : 45 Min   
Student Name : ________________________
         



Q 1: which of the following Operator is used to transfer value to another variable.
A) =   
B) ==   
C) &   
D) int

Tuesday 24 October 2017

UGC Net Computer Science December-12 Page 7 Solved

UGC Net Computer Science December-12 Page 7 Solved

61. Which one is a collection of templates and rules ?
(A) XML
(B) CSS
(C) DHTML
(D) XSL

UGC Net Computer Science December-12 Page 6 Solved

UGC Net Computer Science December-12 Paper 3 Page 6 Solved

UGC Net Computer Science December-12 Page 6 Solved

51. Suppose there are logn sorted lists of n logn elements each. The time complexity of producing a sorted list of all these elements is (use heap data structure)

UGC Net Computer Science December-12 Page 5 Solved

UGC Net Computer Science December-12 Paper 3 Page 5 Solved

UGC Net Computer Science December-12  Page 5 Solved

41. Consider a system having m resources of the same type. These resources are shared by 3 processes A, B and C which have peak demands of 3, 4 and 6 respectively. For what value of m
deadlock will not occur ?
(A) 7
(B) 9
(C) 10
(D) 13

42. The grammar ‘G1’ S -> OSO| ISI | 0|1|→ and the grammar ‘G2’ is S → as |asb| X, X → Xa | a.
Which is the correct statement ?
(A) G1 is ambiguous, G2 is unambiguous
(B) G1 is unambiguous, G2 is ambiguous
(C) Both G1 and G2 are ambiguous

NIELIT O Level Paper Solution July-2012 C Language

NIELIT O Level Paper Solution July-2012 C Language

1. Objective


1.1 : C
1.2 : C
1.3 : B
1.4 : D
1.5 : A
1.6 : B
1.7 : C
1.8 : B

Sunday 22 October 2017

Even Odd Separation File Creation

Q : Write a ‘C’ Program to create a file of numbers and copy odd number into second file and even number into third file.

Solution :


#include<stdio.h>
#include<conio.h>
void main()
{
     FILE *source,*even_file,*odd_file;
     char ch;
     clrscr();
     source=fopen("test.txt","r");
     even_file=fopen("even.txt","w");
     odd_file=fopen("o

Friday 20 October 2017

Function

A function is a combination of more than one statement which execute together one by one to achieved some specific task. Function code run while calling. There are many variety of functions some takes arguments and return something or takes argument and doesn’t return and more.

C language is known as building block of function all the things of programming is achieved through function. Program gets start running with main function.

Types


No argument, No return


This type of function neither returns anything nor takes arguments. When a function doesn’t have something to return then void is used. Void indicates no return.

no return type function

Example

Constructor PHP

Constructor used in object oriented language for allocate space while creating object. A constructor also helps initialize a variable while declaring.

Every object oriented language built in support for programming. PHP is also a server side script and object oriented language. So should know how can you use constructor is elaborate in following example.


<?php
class Foo
{
    private 
$roll$name$city;
    function 
__construct($roll$name$city)
    {
        
$this->roll $roll;