GSON is java library, It is used to convert OBJECT to JSON and JSON to Object. Internally it going to work based on serialization and de- serialization.This example demonstrate about how to convert ArrayList to string using GSON library.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 the following code in build.gradle.apply plugin: 'com.android.application' android { compileSdkVersion 28 defaultConfig { applicationId "com.example.andy.myapplication" minSdkVersion 15 targetSdkVersion 28 ... Read More
In this program we will see how to search an element in an array of bytes using 8085.Problem StatementWrite 8085 Assembly language program to search a key value in an array of data using linear search technique.DiscussionIn this program the data are stored at location 8002H to 8007H. The 8000H is containing the size of the block, and 8001H is holding the key value to search. After executing this program, it will return the address of the data where the item is found and store the address at location 9000H and9001H. If the item is not found, it will return ... Read More
Sometimes we need to display more time then LENGTH_LONG. This example demonstrates how to show toast longer than Toast.LENGTH_LONG.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 the following code to res/layout/activity_main.xml. In the above code, we have taken a text view. when a user clicks on text view, it will show toast for 1000 ms.Step 3 - Add the following code to src/MainActivity.javapackage com.example.andy.myapplication; import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.view.Gravity; ... Read More
You can create user if it does not exist with the help of “create user” command. The command will work on MySQL version 5.7.6 and above. The syntax is as follows −mysql> CREATE USER IF NOT EXISTS 'yourUserName'@'localhost' IDENTIFIED BY 'yourPassword';Apply the above syntax to create a user if it does not exist. The query is as follows −mysql> CREATE USER IF NOT EXISTS 'Smith'@'localhost' IDENTIFIED BY 'Smith123456'; Query OK, 0 rows affected (0.29 sec)To check the new user is created or not, use the below query −mysql> SELECT User FROM mysql.user;The following is the output −+------------------+ | User ... Read More
You can achieve this with the help of INFORMATION_SCHEMA.TABLES. Use the date_sub() with interval. The syntax is as follows −SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE DATE_SUB(NOW(), INTERVAL -1HOUR) < ‘UPDATE_TIME’;Now you can check the above syntax. Here is the query to find the tables modified in the last hour −mysql> select table_name from `INFORMATION_SCHEMA`.`TABLES` -> WHERE -> DATE_SUB(NOW(), INTERVAL 1 HOUR) < `UPDATE_TIME`;Output+---------------------+ | TABLE_NAME | +---------------------+ | innodb_table_stats | | innodb_index_stats | | employeeinformation | +---------------------+ 3 rows in set (0.37 sec)The above query selects only table name. If you want information like table schema, table ... Read More
Use the isEmpty() method to check of a HashMap is empty or not. Let us first create the HashMap −HashMap hm = new HashMap();Now, add some elements −hm.put("Bag", new Integer(1100)); hm.put("Wallet", new Integer(700)); hm.put("Belt", new Integer(600));Since, we added elements above, therefore, the HashMap isn’t empty. Let us check −set.isEmpty()The following is an example to check if a HashMap is empty or not −Example Live Demoimport java.util.*; public class Demo { public static void main(String args[]) { // Create a hash map HashMap hm = new HashMap(); ... Read More
An earthquake is defined as the sudden shaking of the Earth's surface. Earthquakes are caused by the collision of tectonic plates in the Earth's crust. These plates ride over each other when instability is created in the crust due to the release of energy from the Earth's core.There are large earthquakes and small earthquakes. Earthquakes are measured using an instrument called Seismometer. The magnitude of an earthquake is represented on the Richter scale. On the scale, 3 or less is scarcely noticeable, and magnitude 7 or more causes damage over a wide area.The Great Chilean earthquake also known as the ... Read More
The screenshots taken on an simulator are stored usually on desktop of the system that you are using.There are multiple scenarios in which screenshots could have been taken, some of them are mentioned below.When the images are taken using "Command" + S, or from File menu's New Screenshot option, They are usually stored by name similar to "Simulator Screen Shot - iPhone 7 Plus - 2018-12-26 at 18.18.14" which consists of Simulator running currently followed by date in YYYY-MM-DD at HH:MM:SS format.If they are taken with mac's "Command + shift +3" or "command + shift + 4" buttons, they are ... Read More
Business Process Outsourcing (BPO) is a subset of Outsourcing which involves contracting some of the Business processes like operations or other responsibilities to a third party service provider. Basically, this outsourcing is providing many jobs to fresh graduates and has become a booming industry.Here are some of the advantages of working in a BPOSalariesBPOs in the country of India gives good starting salaries with periodical raises yearly. The average income of a person working in a BPO in India can range anywhere between 15, 000 rupees to 30, 000 rupees or in some cases it may be even higher. This ... Read More
To find my.cnf on Windows system, first open the command prompt with the help of shortcut key Windows + R (run). The snapshot is as follows −Type “services.msc” on command prompt and press ENTER as shown in the following screenshot −Now, a new wizard will open. The snapshot is as follows −Now, search for MySQL. The snapshot is as follows −Right click on “MySQL80” and select “Properties” as in the following screenshot −As you can see in the above screenshot, “Path to executable” tells about the location of my.cnf on Windows.
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP