karthikeya Boyini

karthikeya Boyini

1,421 Articles Published

Articles by karthikeya Boyini

Page 78 of 143

How to use offer() in android ConcurrentLinkedQueue?

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jun-2020 154 Views

Before getting into an example, we should know what ConcurrentLinkedQueue is, it is an unbounded queue based on linked nodes. Multiple threads can access queue elements with safety. Elements travel based on queue strategy as FIFO and elements going to insert from a tail. It does not allow null values.This example demonstrates about How to use offer() in android ConcurrentLinkedQueueStep 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, ...

Read More

How to use lastIndexOf() in android CopyOnWriteArrayList?

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jun-2020 159 Views

Before getting into the example, we should know what CopyOnWriteArrayList is. It is a thread-safe variant of ArrayList and operations add, set, and so on by making a fresh copy of the underlying array.This example demonstrate about How to use lastIndexOf() in android CopyOnWriteArrayListStep 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 to show CopyOnWriteArrayList elements.Step 3 − Add the following code ...

Read More

How to use isEmpty() in android CopyOnWriteArraySet?

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jun-2020 153 Views

Before getting into the example, we should know what CopyOnWriteArraySet is. It is a thread-safe variant of ArrayList and operations add, set, and so on by making a fresh copy of the underlying array.This example demonstrate about How to use isEmpty() in android CopyOnWriteArraySetStep 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 to show CopyOnWriteArraySetelements.Step 3 − Add the following code to ...

Read More

How to use in android CopyOnWriteArraySet?

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jun-2020 224 Views

Before getting into an example, we should know what CopyOnWriteArraySet is. It is a thread-safe variant of ArrayList and operations add, set, and so on by making a fresh copy of the underlying array.This example demonstrates about How to use in android CopyOnWriteArraySetStep 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 to show CopyOnWriteArraySet elements.Step 3 − Add the following code to ...

Read More

Given a column name how can I find which tables in a MySQL database contain that column?

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jun-2020 205 Views

Use the COLUMN_NAME to find which table in a database contains a specific column. Let us first create a table −mysql> create table DemoTable    -> (    -> CustomerId int,    -> CustomerName varchar(20),    -> CustomerCountryName varchar(100)    -> ); Query OK, 0 rows affected (1.05 sec)Following is the query to find in which tables a specific column “'CustomerCountryName'” is present −mysql> select *from information_schema.columns WHERE COLUMN_NAME = 'CustomerCountryName';OutputThis will produce the following output −+---------------+--------------+--------------+---------------------+------------------+----------------+-------------+-----------+--------------------------+------------------------+-------------------+---------------+--------------------+--------------------+-----------------+--------------+------------+-------+---------------------------------+----------------+-----------------------+-------+ | TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME  | COLUMN_NAME          |ORDINAL_POSITION  | COLUMN_DEFAULT | IS_NULLABLE | DATA_TYPE |CHARACTER_MAXIMUM_LENGTH | CHARACTER_OCTET_LENGTH |NUMERIC_PRECISION ...

Read More

How to order MySQL rows by multiple columns?

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jun-2020 334 Views

Let us first create a table −mysql> create table DemoTable    -> (    -> FirstName varchar(20),    -> LastName varchar(20)    -> ); Query OK, 0 rows affected (1.44 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('John', 'Smith'); Query OK, 1 row affected (0.35 sec) mysql> insert into DemoTable values('Chris', 'Brown'); Query OK, 1 row affected (0.37 sec) mysql> insert into DemoTable values('Carol', 'Taylor'); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable values('David', 'Miller'); Query OK, 1 row affected (0.24 sec)Display all records from the table using ...

Read More

How to use containsAll() in android CopyOnWriteArraySet?

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jun-2020 211 Views

Before getting into an example, we should know what CopyOnWriteArraySet is. It is a thread-safe variant of ArrayList and operations add, set, and so on by making a fresh copy of the underlying array.This example demonstrates about How to use containsAll() in android CopyOnWriteArraySetStep 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 to show CopyOnWriteArraySet elements.Step 3 − Add the following code ...

Read More

Sort a column ignoring a specific word in MySQL

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jun-2020 208 Views

Let us first create a table −mysql> create table DemoTable    -> (    -> Name text    -> ); Query OK, 0 rows affected (1.31 sec)Insert some records in the table using insert command. Here, we have inserted a name with a specific word “name”, which we need to ignore −mysql> insert into DemoTable values('John 7'); Query OK, 1 row affected (0.65 sec) mysql> insert into DemoTable values('John 6'); Query OK, 1 row affected (0.42 sec) mysql> insert into DemoTable values('John 9'); Query OK, 1 row affected (0.33 sec) mysql> insert into DemoTable values('name John 3'); ...

Read More

Change the column name from StudentName to FirstName in MySQL?

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jun-2020 224 Views

Use CHANGE with ALTER statement. Let us first create a table −mysql> create table DemoTable -> ( -> StudentName varchar(100), -> Age int -> ); Query OK, 0 rows affected (0.84 sec)Now check the description of table −mysql> desc DemoTable;OutputThis will produce the following output −+----------------+--------------+------+-----+---------+-------+ | Field          | Type         | Null | Key | Default | Extra | +----------------+--------------+------+-----+---------+-------+ | StudentName    | varchar(100) | YES | | NULL | | | Age         ...

Read More

Fix Drop table view #1051 unknown table error in MySQL

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jun-2020 2K+ Views

To correctly drop a view, use the below syntax −drop view yourViewName;Let us first create a table −mysql> create table DemoTable -> ( -> Id int -> ); Query OK, 0 rows affected (1.01 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(1001); Query OK, 1 row affected (0.22 sec) mysql> insert into DemoTable values(1002); Query OK, 1 row affected (0.34 sec) mysql> insert into DemoTable values(1003); Query OK, 1 row affected (0.26 sec)Display all records from the table using select statement −mysql> select *from DemoTable;OutputThis will produce the following output −+------+ | ...

Read More
Showing 771–780 of 1,421 articles
« Prev 1 76 77 78 79 80 143 Next »
Advertisements