George John has Published 1080 Articles

MySQL - CAST DECIMAL to INT?

George John

George John

Updated on 30-Jul-2019 22:30:24

6K+ Views

Cast DECIMAL to INT with the help of FLOOR() function. The syntax is as follows −SELECT FLOOR(yourColumnName) from yourTableName where condition;Let us first create a table. The following is the query to create a table.mysql> create table DecimalToIntDemo -> ( -> Amount DECIMAL(3, 1) ... Read More

Java Program to retrieve the set of all keys in HashMap

George John

George John

Updated on 30-Jul-2019 22:30:24

312 Views

First, create a HashMap and add elementsHashMap hm = new HashMap(); hm.put("Wallet", new Integer(700)); hm.put("Belt", new Integer(600)); hm.put("Backpack", new Integer(1200));Now, retrieve all the keysSet keys = hm.keySet(); System.out.println("Keys..."); Iterator i = keys.iterator(); while (i.hasNext()) {    System.out.println(i.next()); }The following is an example to get the set of all key in ... Read More

What is Polynomial Code?

George John

George John

Updated on 30-Jul-2019 22:30:24

4K+ Views

A polynomial code is a linear code having a set of valid code words that comprises of polynomials divisible by a shorter fixed polynomial is known as generator polynomial.They are used for error detection and correction during the transmission of data as well as storage of data.Types of Polynomial CodesThe ... Read More

In MySQL how to replace all NULL values in a particular field of a particular table?

George John

George John

Updated on 30-Jul-2019 22:30:24

317 Views

To replace all NULL values in a particular field of a particular table, use UPDATE command with IS NULL property. The syntax is as follows:UPDATE yourTableName SET yourColumnName=”yourValue’ WHERE yourColumnName IS NULL;To understand the above syntax, let us create a table. The query to create a table is as follows:mysql> ... Read More

Why we mention in MySQL WHERE 1=0?

George John

George John

Updated on 30-Jul-2019 22:30:24

4K+ Views

The condition 1=0 can be used to stop the query from returning any rows. It returns empty set.The syntax is as follows:SELECT *FROM yourTableName WHERE 1=0;To understand the above syntax, let us create a table. The query to create a table is as follows:mysql> create table ConditionDemo    -> ( ... Read More

General Data Link Layer Frame Structure

George John

George John

Updated on 30-Jul-2019 22:30:24

2K+ Views

Framing in Data Link LayerIn the physical layer, data transmission involves synchronised transmission of bits from the source to the destination. The data link layer packs these bits into frames. Data-link layer takes the packets from the Network Layer and encapsulates them into frames. If the frame size becomes too ... Read More

How do I add to each row in MySQL?

George John

George John

Updated on 30-Jul-2019 22:30:24

540 Views

You can add a value to each row in MySQL using UPDATE command.Let us see when your column is an integer. The syntax is as follows:UPDATE yourTableName SET yourIntegerColumnName = yourIntegerColumnName+anyValue; UPDATE yourTableName SET yourIntegerColumnName = anyValue WHERE yourIntegerColumnName IS NULL;You can add a value for a date column name. ... Read More

Lazy loading of images in table view using Swift

George John

George John

Updated on 30-Jul-2019 22:30:24

1K+ Views

To load an image in table view cell we’ll go through a series of steps.Create a table view, table view cell and add an Image view to it.Assign a custom class to the cell we created.In the cell for row at method write the following lines of code.let cell = ... Read More

Change value from 1 to Y in MySQL Select Statement?

George John

George John

Updated on 30-Jul-2019 22:30:24

239 Views

You can use IF() from MySQL to change value from 1 to Y. The syntax is as follows:SELECT IF(yourColumnName, ’Y’, yourColumnName) as anyVariableName FROM yourTableName;To understand the above syntax, let us create a table. The query to create a table is as follows:mysql> create table changeValuefrom1toY    -> (   ... Read More

How can I get the current screen orientation in Android?

George John

George John

Updated on 30-Jul-2019 22:30:24

3K+ Views

In some situation, we need to find an android activity orientation. This example demonstrates how to integrate Android Login and registration form.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add ... Read More

Advertisements