Turbo C Shortcut Keys

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++.

Turbo C Shortcut Keys

Shortcut Keys used in turbo c programming

Shortcut Keys(Hot Keys)     Operation   

  1. Alt + F  -            Open file
  2. Alt + F3 -           Close
  3. Alt + F + N  -    New file
  4. Alt + X  -           Exit turbo c
  5. Alt + F5 -          Output Screen
  6. Alt + F + L  -    Check programme load or not.
  7. Alt + ENTER  - Full screen
  8. Shift + Del -       Cut
  9. Shift + Insert -   Paste
  10. Ctr + Insert -    Copy
  11. Alt+F9 -           Compile a program 
  12. Ctr + F8           Bbreak point
  13. Ctrl+F9 -          To run a program 
  14. Ctrl+s -            To save a program 
  15. Alt + BkSp  -   Undo
  16. Ctr + K + H  -  Deselect point
  17. Shift + Alt + BkSp  -  Redo
  18. Ctr + Del -        Clear.
  19. Ctr + Y  -      Delete Line
  20. Alt + F7 -          Previous Error
  21. Alt + F8 -          Next Error
  22. Ctr + F2 -          Program reset
  23. F1 -                   Help
  24. F2  -             Save file
  25. F3  -              Open file
  26. F5  -              Minimize/Maximize
  27. F6  -                   Jump From One file to another
  28. F7  -                   Debug
  29. F8  -                   Step Over
  30. CTRL + KB -    point to the start of a line to copy.
  31. CTRL + KK -    point to the end of the line to copy.
  32. CTRL + KC -    line of text to copy.
  33. CTRL + KV -    PASTE



Bookmark and Share

JQuery interview questions and Answers

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?

  • 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())
});
});



Bookmark and Share

One to One relationship example in database

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.

One to One relationship example


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.


Bookmark and Share

MySql queries interview questions and answers

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'


Bookmark and Share

XSS Prevention in PHP Cheat sheet pdf - Cross Site Scripting examples

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.

XSS (Cross Site Scripting) Prevention in PHP

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

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


Bookmark and Share