How to use SUM() function in MySQL?

In MySQL, SUM() function is used to return the total sum of a numeric column in a table. SUM() Syntax SELECT SUM(column_name) FROM table_name; We have a table "employee" as below: employee id first_name last_nam...

What is the difference between == and equals in Java?

In Java, the "==" operator is used to compare references. When we use the == operator in Java it compares 2 objects, it checks whether the two objects refer to the same place in memory or not. Example: String str1 = new String("abc"); S...

Difference between TRUNCATE and DROP in MySQL.

TRUNCATE TRUNCATE comes under DDL(Data Definition Language). TRUNCATE removes only rows from the table but the structure of the table remains same. Data can not be roll backed if we use "TRUNCATE" command to delete data. Can not use WHERE...

What is DEFAULT Constraint in MySQL?

In MySQL, the DEFAULT constraint is used to insert value into a column in a table. If there is no value is specified for a column then the default value will be added to column for all new records. DEFAULT Constraint on CREATE TABLE The fol...

What is CHECK Constraint in MySQL?

In MySQL, the CHECK constraint is used to put limit on value range on value inside a column. CHECK Constraint on CREATE TABLE The following statement creates a CHECK constraint on the "id" column when the "employee" table is created. The CH...

Difference between && and and in ruby.

Ruby supports both && as well as and. The basic difference between these 2 lies in their precedence order. && has higher preference than and. and has lower preference than = unlike && which has higher preferen...

What is FOREIGN KEY Constraint in MySQL?

Note that the "P_Id" column in the "Orders" table points to the "P_Id" column in the "Persons" table. In MySQL, the FOREIGN KEY on one table is used to point a PRIMARY KEY in another table. We have two tables with the following values. ...

What is PRIMARY KEY Constraint in MySQL?

In MySQL, the PRIMARY KEY constraint is used to uniquely identify each record in a table. Primary key contains UNIQUE values only and the column defined as Primary key column can not be NULL. A table can have only one PRIMARY KEY. PRIMARY K...

To get all properties that belong to an object in javascript

To get all properties that belong to an object in javascript, we can use Object.getOwnPropertyNames(). The ordering of the non-enumerable properties in the array, and among the enumerable properties, is not defined. Example: var arr = ['a'...

Add dots to UILabel if text does not fit frame

Hi all, If you want to show dots if text does not fit UILabel frame. then just copy this code. UILabel property "numberOfLines" is 1 by default. Try to set it 0 if you dont know the exact numberOfLines and use sizeToFit method of UILable...

Splice method in javascript

The splice() method is used to add/remove items to/from an array, and returns the removed item(s). Syntax array.splice(index, howMany, [element1][, ..., elementN]); where index Index at which to start changing the array. howMany ...

Using slice method in javascript

The slice() method extracts a substring and returns a new string. The syntax for slice() method is string.slice( firstindex [, endindex] ); firstindex : -The zero-based index at which to begin extraction. endindex : -The zero-based i...

JSON with JAVA

A JSONObject is an unordered amassment of name/value pairs. Its external form is a string wrapped in curly braces with colons between the designations and values, and commas between the values and designations. A JSONObject constructor can be ...

How to add element at the beginning of array?

There is method to add elements at the beginning of an array using unshift method The array unshift method adds element at the beginning of an array and returns its new length. This method can be applied to the objects that resembles an array...

How to append existing div to another existing div

We can use jquery method append() or appendTo() method for appending an existing div to another existing div. Example fo appendTo(): $('#menu').on('click', function(){ $('#div1').appendTo('#div2'); }); Example for append()...

How to append elements to an array?

There are methods to add elements to the array using push method and concat method. The array push method adds element at the end of an array and returns its new length. Syntax :- array.push(item1, item2, ..., itemX) Below is the exampl...

How to create SEO friendly responsive web page using CSS

Hi friends,   Now all the website are open from various screen sizes from a small mobile phone to large screen computer, so we required a webpage which adapt according to the various screen size and OS system like android phone, iPhone...

Some of the Important SEO Links tags in HTML

Hi Guys,   Search engine Optimization(SEO) is mainly categorised in two part one is On-Page optimization and other one off-Page Optimization. In On-page all activities are done only at website or webpage end. basically which include me...

AngularJS Otherwise function

Hi Readers, Today, I will be discussing about the Otherwise Function available in $routeProvider in AngularJS. The main objective of this function is to redirect the end users to a particular route when the user by mistake or intentionally...

Filtering the external input data in php

Here we will learn about the filter functions that are used to validate and sanitize the data and make sure that data is in proper form and all the illegal characters are removed from the data.The filter function are: filter_has_var() filter_id...

Jquery ajax json response

There is a need to set dataType in the ajax if you expect to get json response . $.ajax({ url: "/accept", type: "POST", data: myformData, context: this, error: function () {}, dataType: 'json', success : fun...

How to fetch cells data from one Google Sheet to another?

I have two Google Sheets named Sheet_1 and Sheet_2. I want to link both these Google Sheets and fetch the cells numerical data from Sheet_2 to a specific cell location in Sheet_1. ...

Python Tuples

A tuple is a sequence of immutable Python objects. Tuples are in form of sequences as same as lists. The main differences between tuples and lists is that tuples cannot be changed like lists, also tuples use parentheses whereas lists use square b...

Delete List Elements in python

To remove a list element, you can use either the del statement if you know exactly which element(s) you are deleting or the remove() method if you do not know. For example #!/usr/bin/python list1 = ['physics', 'chemistry', 1997, 2000]; ...

Updating Lists in python

If you want to update single or multiple elements of lists then you have to provide the slice on the left-hand side of the assignment operator, and to add to elements in a list you can use the append() method. For example #!/usr/bin/python ...

Accessing Values in Lists in Python

To access values in lists, use the square brackets for slicing along with the index or indices to obtain value available at that index. For example #!/usr/bin/python list1 = ['physics', 'chemistry', 1997, 2000]; list2 = [1, 2, 3, 4, 5, 6,...

Importance of Building Custom 404 Page for Website

Imagine a situation in which you just wake up at 2 Am midnight and you tried to browse internet and typed the Website URL, but due to half sleep condition you typed the wrong URL and aft...

What is .wrapInner() method in jquery ?

Hello Readers, .wrapInner() is the jquery method which is used to wrap the inner HTML element in the set of matched elements.This method wraps the HTML structure by using wrapping element as a parameter and returns the jquery object as a resul...

Python Lists

The list is a most versatile datatype available in Python which can be written as a list of comma-separated values (items) between square brackets. Important thing about a list is that items in a list need not be of the same type.For example you ...

Different ways to round number to 2 decimal places in PHP

Many times we need to format a number with two decimal points, PHP provides many solutions for rounding a number with decimal values. This tutorial list some functions which can be used to round a number with decimal values upto 2 decimal points....

Sending Attachments as an E-mail in Python

To send an e-mail with mixed content you requires to set Content-type header to multipart/mixed. Then, text and attachment sections can be specified within boundaries. A boundary started with two hyphens followed by a unique number, which cannot...

Sending an HTML e-mail using Python

All the content are treated as a simple text at when you send a text message using Python. Even if you include HTML tags in a text message, it will display as simple text and HTML tags will not be formatted according to HTML syntax. But Python pr...

Cakephp putting condition on virtualFields

Hi Readers, Today I will be discussing about the limitation of virtualfields and how can we overcome it's limitations. Firstly, we can not use virtualfields in associated models for conditions,fields arrays or order. Doing so will general...

What is High Availability testing?

High availability(HA) means undisrupted functioning of a system for a long time so that users face no troubles in accessing the system almost all the times. Customers expect from companies that their services will be highly available 24x7x365, es...

Class Not Found Exception org.springframework.web.context.ContextLoaderListener

Class Not Found Exception org.springframework.web.context.ContextLoaderListener Sometimes, when we build a project using maven, we find the error " Class Not Found Exception org.springframework.web.context.ContextLoaderListener " even after...

How to Create ContactUs page in android

In the below code I have created ContactUs page. Here first I have added images in drawable folder, created Scrollview, ImageView, TextView in activity_contactus.xml layout. And I have used OnClickListener method for using phone no, tweeter and m...

E-mail using Python script

I have posted python script for e-mail sending in python project code is given below. import smtplib sender = 'from@findnerd.com' receivers = ['to@todomain.com'] message = """From: From Person To: To Person Subject: SMTP e-mail test ...

What is parents() method in jquery ?

Hello Readers, parents() is the jquery method and it is same as parent() method but the difference is that parents() method return the all ancestors of the given selector which include parent, grandparent, great-grandparent, great-great-grandp...

Python Sending Email using SMTP

Simple Mail Transfer Protocol (SMTP) is a protocol which handles sending e-mail and routing e-mail between mail servers .And with the help of smtp we can provides smtplib module which defines an SMTP client session object that can be used to sen...

Importance of 3 Different Aspects of Link Building Process

Link building process consists of three basic methodologies including Manual Directory Submissions, Local Directory Submissions and Social Media Submissions. All these types of Natural L...

PHP Condition checking on multidimensional array

Hi Readers, We all have used array_values, but we use array_values just to get the values from an array. However, we can do much more than that with the help of it. One of it's alternative use of array_values is in a situation wher...

array_fill() vs array_fill_keys() in PHP

This tutorial explains the difference between array_fill() and array_fill_keys() functions, which are used to initialize or fill an array with values. The main difference is in the method of filling values in array by both functions. The details ...

SQL Tutorial -> Sql Inner Join

<-- Chapter 25: SQL Join Chapter 26 SQL Inner Join SQL Inner Join clause is used to fetch all the rows from more than two tables in which there is a match between the columns. Inner Join is similar like Join clause. Lets see an ...

Attribute Methods

1. attr( properties ):-Set a key/value object as properties to all matched elements. Syntax:-selector.attr({property1:value1, property2:value2}) Example:- <html> <head> <title>The Selecter Example</title...

What is UNIQUE Constraint in MySQL?

In MySQL, the UNIQUE constraint is used to uniquely identify each record in a table. UNIQUE Constraint on CREATE TABLE The following statement creates a UNIQUE constraint on the "id" column when the "employee" table is created: Example ...

What is NOT NULL Constraint in MySQL?

In MySQL, the NOT NULL constraint is used to restrict a column to NOT accept NULL values. The NOT NULL constraint allows a column to always contains a value which means you cant not insert/update a record in a table without passing value for t...

Converting string to symbol & symbol to string in rails

Ruby supports both Strings & Symbols. String being mutable & Symbols being immutable cater to different needs. We can convert String to Symbol & Symbol to String at any time. To convert a string to a symbol, we can use inter...

runOnUiThread() in android

If we want to update UI from a Non-UI thread then runOnUiThread() is the best solution for it. I am showing Toast in every 25 secs. Below is the code private Thread refreshThread; refreshThread = new Thread() { @Override ...

How to make spalsh screen in android

In the below code I have created splash screen. Here first I have added images in drawable folder, and then added in activity_splash_screen, In SplashScreenActivity I have also used Timer function. See the below code it will clerly describe you...

What is parentsUntil() method in jquery ?

Hello Readers, parentsUntil() is the jquery method which is used to return all the ancestors between the selector and stop.Here, ancestor element include parent, grandparent, great-grandparent, great-great grandparent and so on. This method al...
1 152 292