Turbo C Shortcut Keys
Posted by Raj
Turbo C Shortcut Keys - Computer Keyboard Shortcuts
In this article,I will explain how to use keybord Shortcut Keys in Turbo C.we have to use Keyboard Shortcut Keys to Speed up progamming skills.I have selected list of most commonly-used keyboard shortcut keys for turbo C and C++.
Shortcut Keys used in turbo c programming
Shortcut Keys(Hot Keys) Operation
In this article,I will explain how to use keybord Shortcut Keys in Turbo C.we have to use Keyboard Shortcut Keys to Speed up progamming skills.I have selected list of most commonly-used keyboard shortcut keys for turbo C and C++.
Shortcut Keys used in turbo c programming
Shortcut Keys(Hot Keys) Operation
- Alt + F - Open file
- Alt + F3 - Close
- Alt + F + N - New file
- Alt + X - Exit turbo c
- Alt + F5 - Output Screen
- Alt + F + L - Check programme load or not.
- Alt + ENTER - Full screen
- Shift + Del - Cut
- Shift + Insert - Paste
- Ctr + Insert - Copy
- Alt+F9 - Compile a program
- Ctr + F8 Bbreak point
- Ctrl+F9 - To run a program
- Ctrl+s - To save a program
- Alt + BkSp - Undo
- Ctr + K + H - Deselect point
- Shift + Alt + BkSp - Redo
- Ctr + Del - Clear.
- Ctr + Y - Delete Line
- Alt + F7 - Previous Error
- Alt + F8 - Next Error
- Ctr + F2 - Program reset
- F1 - Help
- F2 - Save file
- F3 - Open file
- F5 - Minimize/Maximize
- F6 - Jump From One file to another
- F7 - Debug
- F8 - Step Over
- CTRL + KB - point to the start of a line to copy.
- CTRL + KK - point to the end of the line to copy.
- CTRL + KC - line of text to copy.
- CTRL + KV - PASTE
JQuery interview questions and Answers
Posted by Raj
JQuery interview questions and Answers Advanced (Multiple Choice)- JQuery Quiz.
In this tutorial, I have selected advanced and basic Jquery Interview questions and answers with examples for freshers and 1 to 3 year experienced candidates.I have also included Objective Jquery ajax interview questions.
Advanced JQuery interview questions and Answers:
What is Jquery?
jQuery is a JavaScript Library.
Which of the following is correct?
jQuery is a JavaScript Library
jQuery is a JSON Library
Answer :jQuery is a JavaScript Library
jQuery uses CSS selectors and XPath expressions to select elements?
False
True
Answer: True
Which sign does jQuery use as a shortcut for jQuery?
$ sign
% sign
? Sign
Answer: $ sign
Is jQuery a W3C standard?
Yes
No
Answer: NO
$("span"). What does it select?
All span elements
The first span element
Answer: All span elements
Is jQuery a library for client scripting or server scripting?
Client scripting
Server scripting
Answer: Client scripting
Is it possible to use jQuery together with AJAX?
Yes
No
Answer: Yes
The jQuery html() method works for both HTML and XML documents
True
False
Answer :False
jQuery code to set the background color of all span elements to blue?
$("span").style("background-color","blue");
$("span").manipulate("background-color","blue");
$("span").css("background-color","blue");
$("span").layout("background-color","blue");
Answer: $("span").css("background-color","blue");
$("span.intro"). What does it select?
The first span element with class="intro"
The first span element with id="intro"
All span elements with id="intro"
All span elements with class="intro"
Answer: All span elements with class="intro"
jQuery method to hide selected elements?
visible(false)
hidden()
display(none)
hide()
Answer: hide()
jQuery method to set one or more style properties for selected elements?
style()
css()
html()
Answer: css()
jQuery method is used to perform an asynchronous HTTP request?
jQuery.ajaxAsync()
jQuery.ajaxSetup()
jQuery.ajax()
Answer: jQuery.ajax()
What scripting language is jQuery written in?
VBScript
C++
JavaScript
C#
Answer: JavaScript
$("div#id1 .cl1"). What does it select?
The first element with id="cl1" inside any div element with class="id1"
All elements with class="cl1" inside the first div element with id="id1"
All div elements with id="id1" or class="cl1"
Answer: All elements with class="cl1" inside the first div element with id="id1"
Difference between onload() and document.ready() function used in jQuery?
JQuery Methods used to provide effects?
1. Show()
2. Hide()
3. Toggle()
4. FadeIn()
5. FadeOut()
What are the different type of selectors in Jquery?
1. CSS Selector
2. XPath Selector
3. Custom Selector
What does .size() method of jquery return ?
.size() method of jquery returns number of element in the object.
How do you get the text value?
$("#textbox1").val();
How do you check or uncheck a checkbox input or radio button?
1.$('#num1').attr('checked', true);// Check #num1
2.$('#num1').attr('checked', false);// Uncheck #num1
3.$("#num1").attr('checked', 'checked');// Check #num1
4.$("#num1").removeAttr('checked');// Uncheck #num1
Ajax Request in Jquery
$.ajax({
url: 'test.php',
success: function(response) {
alert(response);
},
error: function(res) {
alert(res.status);
}
});
Explain the each() function.
$("#num").click(function(){
$("li").each(function(){
document.write($(this).text())
});
});
In this tutorial, I have selected advanced and basic Jquery Interview questions and answers with examples for freshers and 1 to 3 year experienced candidates.I have also included Objective Jquery ajax interview questions.
Advanced JQuery interview questions and Answers:
What is Jquery?
jQuery is a JavaScript Library.
Which of the following is correct?
jQuery is a JavaScript Library
jQuery is a JSON Library
Answer :jQuery is a JavaScript Library
jQuery uses CSS selectors and XPath expressions to select elements?
False
True
Answer: True
Which sign does jQuery use as a shortcut for jQuery?
$ sign
% sign
? Sign
Answer: $ sign
Is jQuery a W3C standard?
Yes
No
Answer: NO
$("span"). What does it select?
All span elements
The first span element
Answer: All span elements
Is jQuery a library for client scripting or server scripting?
Client scripting
Server scripting
Answer: Client scripting
Is it possible to use jQuery together with AJAX?
Yes
No
Answer: Yes
The jQuery html() method works for both HTML and XML documents
True
False
Answer :False
jQuery code to set the background color of all span elements to blue?
$("span").style("background-color","blue");
$("span").manipulate("background-color","blue");
$("span").css("background-color","blue");
$("span").layout("background-color","blue");
Answer: $("span").css("background-color","blue");
$("span.intro"). What does it select?
The first span element with class="intro"
The first span element with id="intro"
All span elements with id="intro"
All span elements with class="intro"
Answer: All span elements with class="intro"
jQuery method to hide selected elements?
visible(false)
hidden()
display(none)
hide()
Answer: hide()
jQuery method to set one or more style properties for selected elements?
style()
css()
html()
Answer: css()
jQuery method is used to perform an asynchronous HTTP request?
jQuery.ajaxAsync()
jQuery.ajaxSetup()
jQuery.ajax()
Answer: jQuery.ajax()
What scripting language is jQuery written in?
VBScript
C++
JavaScript
C#
Answer: JavaScript
$("div#id1 .cl1"). What does it select?
The first element with id="cl1" inside any div element with class="id1"
All elements with class="cl1" inside the first div element with id="id1"
All div elements with id="id1" or class="cl1"
Answer: All elements with class="cl1" inside the first div element with id="id1"
Difference between onload() and document.ready() function used in jQuery?
- We can add more than one document.ready() function in a page.
- we can have only one onload function.
- Document.ready() function is called as soon as DOM is loaded.
- body.onload() function is called when everything (DOM, images..)gets loaded on the page.
JQuery Methods used to provide effects?
1. Show()
2. Hide()
3. Toggle()
4. FadeIn()
5. FadeOut()
What are the different type of selectors in Jquery?
1. CSS Selector
2. XPath Selector
3. Custom Selector
What does .size() method of jquery return ?
.size() method of jquery returns number of element in the object.
How do you get the text value?
$("#textbox1").val();
How do you check or uncheck a checkbox input or radio button?
1.$('#num1').attr('checked', true);// Check #num1
2.$('#num1').attr('checked', false);// Uncheck #num1
3.$("#num1").attr('checked', 'checked');// Check #num1
4.$("#num1").removeAttr('checked');// Uncheck #num1
Ajax Request in Jquery
$.ajax({
url: 'test.php',
success: function(response) {
alert(response);
},
error: function(res) {
alert(res.status);
}
});
Explain the each() function.
$("#num").click(function(){
$("li").each(function(){
document.write($(this).text())
});
});
One to One relationship example in database
Posted by Raj
One to One relationship example in database(oracle, MYSQL, SQl, Ms access)
In this Article, I will explain how to create one to one relationship between two tables.In a relational database such as Mysql,SQl,Ms access, you can create relationships between pairs of tables like..
1.one-to-one
2.one-to-many
3.many-to-many.
One-to-one relationships in a relational database:
one-to-one relationships are bidirectional relationships.each row in one database table is linked to one and only one other row in another table.
An example of a one-to-one relationship is a Person can have only one Passport and that a Passport can belong to only one Person.
we are designing Database with a One To One Relationship between Person and Passport Table.
You may not use one-to-one relationships very usually, but you should know how to create them.
There are other types of database relationships, one to many and many to many relationships.
In this Article, I will explain how to create one to one relationship between two tables.In a relational database such as Mysql,SQl,Ms access, you can create relationships between pairs of tables like..
1.one-to-one
2.one-to-many
3.many-to-many.
One-to-one relationships in a relational database:
one-to-one relationships are bidirectional relationships.each row in one database table is linked to one and only one other row in another table.
An example of a one-to-one relationship is a Person can have only one Passport and that a Passport can belong to only one Person.
we are designing Database with a One To One Relationship between Person and Passport Table.
You may not use one-to-one relationships very usually, but you should know how to create them.
There are other types of database relationships, one to many and many to many relationships.
MySql queries interview questions and answers
Posted by Raj
MySql queries interview questions and answers - MySql Database Tutorial
MySql queries Interview Questions & Answers
In this section, I have selected advanced MYSQL queries interview questions and answers for all levels of candidates(entry level, advanced level, expert level).Last few months I have been working to select best MYSQL queries for MYSQL interview questions.
This article introduces MYsql Database queries:
Suppose we have to tables
1.Employee
2.Employee Salary
CREATE TABLE `employees` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`photo` varchar(100) DEFAULT NULL,
`first_name` varchar(100) DEFAULT NULL,
`last_name` varchar(100) DEFAULT NULL,
`gender` varchar(11) DEFAULT NULL,
`email` varchar(100) DEFAULT NULL,
`mobile` varchar(100) DEFAULT NULL,
`password` varchar(100) DEFAULT NULL,
`active` tinyint(4) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1
employees
id name
1 Admin
2 Employee1
3 Employee2
4 Employee3
5 Employee4
CREATE TABLE `employee_salary` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`employee_id` int(10) DEFAULT NULL,
`salary` varchar(50) DEFAULT NULL,
`created_on` datetime DEFAULT NULL,
`created_by` int(10) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=32 DEFAULT CHARSET=latin1
id employee_id salary
1 1 10000
2 2 20000
3 3 10000
4 4 40000
5 5 30000
1. Find Second highest paid employees withou using LIMIT function.
Query:
SELECT MAX(salary) FROM employee_salary WHERE salary <(SELECT MAX(salary) FROM employee_salary)
2.Skip repeating values
Query:
SELECT salary FROM employee_salary GROUP BY salary
3.Reset Auto-increment next value
Query:
ALTER TABLE tablel SET AUTO_INCREMENT=val;
4.Find the Size of database
Query:
SELECT
s.schema_name AS 'database',
SUM(t.data_length) AS DATA,
SUM( t.index_length ) AS INDEXES,
SUM(t.data_length) + SUM(t.index_length) AS 'Mb Used',
IF(SUM(t.data_free)=0,'',SUM(t.data_free)) AS 'Mb Free',
COUNT(table_name) AS TABLES
FROM information_schema.schemata s
LEFT JOIN information_schema.tables t ON s.schema_name = t.table_schema
GROUP BY s.schema_name
5.First and Last Date of Month
Last day of next month:
SELECT LAST_DAY (DATE_ADD(CURDATE(), INTERVAL 30 DAY))
Last day of Previous month:
SELECT LAST_DAY (DATE_SUB(CURDATE(), INTERVAL 30 DAY))
First day of next month
SELECT CONCAT(LEFT(CURDATE() + INTERVAL 1 MONTH, 8), '01');
6.Display every Nth row
Query:
SELECT id
FROM employees
GROUP BY id
HAVING MOD(id, N) = 0;
7.Age in years
SELECT DATE_FORMAT(FROM_DAYS(TO_DAYS(NOW()) - TO_DAYS('1991-07-01')), '%Y') + 0;
8.Difference between two dates
SELECT DATEDIFF('2002-07-15','2001-07-15')
9. Update Table using Join
UPDATE employee e LEFT JOIN employee_salary s ON e.id=s.employee_id
SET s.salary='50000'
where e.first_name='Admin'
10. DELETE Table using Join
Delete employee_salary FROM employee_salary LEFT JOIN employee ON employee.id=employee_salary.employee_id
WHERE employee.first_name='Admin'
MySql queries Interview Questions & Answers
In this section, I have selected advanced MYSQL queries interview questions and answers for all levels of candidates(entry level, advanced level, expert level).Last few months I have been working to select best MYSQL queries for MYSQL interview questions.
This article introduces MYsql Database queries:
Suppose we have to tables
1.Employee
2.Employee Salary
CREATE TABLE `employees` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`photo` varchar(100) DEFAULT NULL,
`first_name` varchar(100) DEFAULT NULL,
`last_name` varchar(100) DEFAULT NULL,
`gender` varchar(11) DEFAULT NULL,
`email` varchar(100) DEFAULT NULL,
`mobile` varchar(100) DEFAULT NULL,
`password` varchar(100) DEFAULT NULL,
`active` tinyint(4) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1
employees
id name
1 Admin
2 Employee1
3 Employee2
4 Employee3
5 Employee4
CREATE TABLE `employee_salary` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`employee_id` int(10) DEFAULT NULL,
`salary` varchar(50) DEFAULT NULL,
`created_on` datetime DEFAULT NULL,
`created_by` int(10) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=32 DEFAULT CHARSET=latin1
id employee_id salary
1 1 10000
2 2 20000
3 3 10000
4 4 40000
5 5 30000
1. Find Second highest paid employees withou using LIMIT function.
Query:
SELECT MAX(salary) FROM employee_salary WHERE salary <(SELECT MAX(salary) FROM employee_salary)
2.Skip repeating values
Query:
SELECT salary FROM employee_salary GROUP BY salary
3.Reset Auto-increment next value
Query:
ALTER TABLE tablel SET AUTO_INCREMENT=val;
4.Find the Size of database
Query:
SELECT
s.schema_name AS 'database',
SUM(t.data_length) AS DATA,
SUM( t.index_length ) AS INDEXES,
SUM(t.data_length) + SUM(t.index_length) AS 'Mb Used',
IF(SUM(t.data_free)=0,'',SUM(t.data_free)) AS 'Mb Free',
COUNT(table_name) AS TABLES
FROM information_schema.schemata s
LEFT JOIN information_schema.tables t ON s.schema_name = t.table_schema
GROUP BY s.schema_name
5.First and Last Date of Month
Last day of next month:
SELECT LAST_DAY (DATE_ADD(CURDATE(), INTERVAL 30 DAY))
Last day of Previous month:
SELECT LAST_DAY (DATE_SUB(CURDATE(), INTERVAL 30 DAY))
First day of next month
SELECT CONCAT(LEFT(CURDATE() + INTERVAL 1 MONTH, 8), '01');
6.Display every Nth row
Query:
SELECT id
FROM employees
GROUP BY id
HAVING MOD(id, N) = 0;
7.Age in years
SELECT DATE_FORMAT(FROM_DAYS(TO_DAYS(NOW()) - TO_DAYS('1991-07-01')), '%Y') + 0;
8.Difference between two dates
SELECT DATEDIFF('2002-07-15','2001-07-15')
9. Update Table using Join
UPDATE employee e LEFT JOIN employee_salary s ON e.id=s.employee_id
SET s.salary='50000'
where e.first_name='Admin'
10. DELETE Table using Join
Delete employee_salary FROM employee_salary LEFT JOIN employee ON employee.id=employee_salary.employee_id
WHERE employee.first_name='Admin'
XSS Prevention in PHP Cheat sheet pdf - Cross Site Scripting examples
Posted by Raj
XSS Prevention in PHP Cheat sheet pdf - Cross Site Scripting examples
XSS (Cross Site Scripting) Prevention in PHP
In this Article,I will show how to prevent XSS in PHP. Cross Site Scripting occurs, when an attacker uses a Web Application to send a malicious script(Javascript,VBScript,HTMl Script), Most often Malicious Data comes from the HTTP request.This script can access cookies,sessions and other information stored by your browser.These scripts even change the content of HTML Page.
There are Two types of XSS Attackes:
1.Stored XSS Attackes: Malicious code permanantly stored on server such as in Database ,Comment..etc
2.Reflected XSS Attacks: Injected Code reflected off the Web server such as error message,Search results..etc
- Untrusted User Input Data:
Most often Malicious Data comes from the HTTP request.Never trust data coming from the user.you should not insert or send it anywhere without taking steps to make sure that any attacks are detected .you have to validate all user input data using PHP functions before Insert into database or send it to anywhere.
- Validation:
Validate all user input data ($_GET, $_POST, $_REQUEST, $_COOKIE) using Regular expressions,Javascript and PHP functions to prevent XSS attacks.
- Some PHP functions that helps you to prevent XSS attacks
1.htmlspecialchars: htmlspecialchars Converts all special characters to HTML entities.(<, >, &, ‘, “.).
2.strip_tags: Used to strip HTML and PHP tags from a string.
3.mysql_real_escape_string: Escapes special characters in a string for use in an MySQL statement
4.Encode URL Query String Parameters.
- You can use htmlentities and stripslashes php functions for Retrieving and Displaying the Data From the Database.
- Use Escape methods (HTML Escape,Javascript Escape,CSS Escape) for XSS (Cross Site Scripting) Prevention.
- Always Use XHTML.
I hope This article will help you to prevent XSS Attacks.
For more Inforamation about XSS Cheat sheet click here
XSS (Cross Site Scripting) Prevention in PHP
In this Article,I will show how to prevent XSS in PHP. Cross Site Scripting occurs, when an attacker uses a Web Application to send a malicious script(Javascript,VBScript,HTMl Script), Most often Malicious Data comes from the HTTP request.This script can access cookies,sessions and other information stored by your browser.These scripts even change the content of HTML Page.
![]() |
1.Stored XSS Attackes: Malicious code permanantly stored on server such as in Database ,Comment..etc
2.Reflected XSS Attacks: Injected Code reflected off the Web server such as error message,Search results..etc
XSS (Cross Site Scripting) Prevention in PHP Cheat sheet:
- Untrusted User Input Data:
Most often Malicious Data comes from the HTTP request.Never trust data coming from the user.you should not insert or send it anywhere without taking steps to make sure that any attacks are detected .you have to validate all user input data using PHP functions before Insert into database or send it to anywhere.
- Validation:
Validate all user input data ($_GET, $_POST, $_REQUEST, $_COOKIE) using Regular expressions,Javascript and PHP functions to prevent XSS attacks.
- Some PHP functions that helps you to prevent XSS attacks
1.htmlspecialchars: htmlspecialchars Converts all special characters to HTML entities.(<, >, &, ‘, “.).
2.strip_tags: Used to strip HTML and PHP tags from a string.
3.mysql_real_escape_string: Escapes special characters in a string for use in an MySQL statement
4.Encode URL Query String Parameters.
- You can use htmlentities and stripslashes php functions for Retrieving and Displaying the Data From the Database.
- Use Escape methods (HTML Escape,Javascript Escape,CSS Escape) for XSS (Cross Site Scripting) Prevention.
- Always Use XHTML.
I hope This article will help you to prevent XSS Attacks.
For more Inforamation about XSS Cheat sheet click here




