George John has Published 1167 Articles

General Data Link Layer Frame Structure

George John

George John

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

1K+ 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

363 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

116 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

How to convert Varchar to Double in SQL?

George John

George John

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

4K+ Views

You can convert varchar to double using CAST() function. The syntax is as follows:SELECT yourColumnName1, yourColumnName2, ......N, CAST(yourColumnName AS DECIMAL(TotalDigit, DigitAfterDecimalPoint)) anyVariableName FROM yourtableName ORDER BY anyVariableName DESC;To understand the above syntax, let us create a table. The query to create a table is as follows:mysql> create table VarcharToDouble   ... Read More

User-defined variables vs Local Variables in MySQL?

George John

George John

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

1K+ Views

The user defined variable is also known as session-specific variable. It is a type of loosely typed variable which can be initialized somewhere in session and contains the value of user defined variable until session ends.The user defined variable is prefixed with symbol @. For Example:@anyVariableName;There are two approaches by ... Read More

How to multiple insert or batch insert at a time in MySQL query?

George John

George John

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

418 Views

You need to use VALUES() with comma separation for multiple insert or batch insert at a time. Use the following syntax that does not produce an invalid MySQL query on insert. The syntax is as follows:INSERT INTO yourTableName VALUES(yourValue1), (yourValue1), (yourValue2), (yourValue3), (yourValue4), (yourValue5), .......N;To understand the above syntax, let ... Read More

How to determine if running on a rooted device or not in Android?

George John

George John

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

3K+ Views

In some cases, we should not allow application should run on rooted devices for payment gateways. This example demonstrates how to determine if running on a rooted device or not.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details ... Read More

How to prevent going back to the previous activity in Android?

George John

George John

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

1K+ Views

There are so many situations, where we should not call back action when user click on back button.This example demonstrates how to integrate Android Login and register form.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create ... Read More

Advertisements