Yagi-Uda antenna is the most commonly used type of antenna for TV reception over the last few decades. It is the most popular and easy-to-use type of antenna with better performance, which is famous for its high gain and directivity. The frequency range in which the Yagi-Uda antennas operate is around 30 MHz to 3 GHz which belong to the VHF and UHF bands.Construction of Yagi-Uda AntennaA Yagi-Uda antenna was seen on top of almost every house during the 90's when we had only Doordarshan Channels. The parasitic elements and the dipole together form this Yagi-Uda antenna. It is seen ... Read More
You can change the column position of MySQL table without losing data with the help of ALTER TABLE command. The syntax is as follows −ALTER TABLE yourTableName MODIFY yourColumnName1 data type AFTER yourColumnName2;To understand the above concept, let us create a table. The query to create a table with some columns is as follows −mysql> create table changeColumnPositionDemo −> ( −> StudentId int, −> StudentAddress varchar(200), −> StudentAge int, −> StudentName varchar(200) −> ); Query OK, 0 rows affected (0.72 sec)Let us insert some data in the table. The query to insert records is as follows -.mysql> insert into changeColumnPositionDemo ... Read More
An ArrayList can be cloned using the java.util.ArrayList.clone() method. This method does not take any parameters but returns a shallow copy the specified ArrayList instance. This means that the new ArrayList created using the ArrayList.clone() method refers to the same elements as the original ArrayList but it does not duplicate the elements.A program that demonstrates this is given as follows −Example Live Demoimport java.util.ArrayList; import java.util.List; public class Demo { public static void main(String[] args) { List aList1 = new ArrayList(); aList1.add("Apple"); ... Read More
Use the clone() method to copy all elements from one set to another.First HashSet −HashSet set = new HashSet (); set.add("One"); set.add("Two");Create another set and clone first set into the second −HashSet newSet = new HashSet ();Copy (clone) all elements to the second set −newSet = (HashSet)set.clone();The following is an example to copy all elements from one set to another −Example Live Demoimport java.util.*; public class Demo { public static void main(String args[]) { HashSet set = new HashSet (); HashSet newSet = new HashSet (); set.add("One"); ... Read More
To get the maximum element of HashSet, use the Collections.max() method.Declare the HashSet −Set hs = new HashSet();Now let us add the elements −hs.add(29); hs.add(879); hs.add(88); hs.add(788); hs.add(456);Let us now get the maximum element −Object obj = Collections.max(hs);The following is an example to find maximum element of HashSet −Example Live Demoimport java.util.*; public class Demo { public static void main(String args[]) { // create hash set Set hs = new HashSet(); hs.add(29); hs.add(879); ... Read More
To know the biggest value from two or more fields, use the function GREATEST() from MySQL.The syntax is as follows −SELECT GREATEST(MAX(yourColumnName1), MAX(yourColumnName2), ...............MAX(yourColumnName2) ) from yourTableName;Let us understand the above concept by creating a table with more than two columns −mysql> create table GreatestOfTwoOrMore -> ( -> Marks1 int, -> Marks2 int, -> Marks3 int -> ); Query OK, 0 rows affected (0.57 sec)Here is the query to insert records in a table −mysql> insert into GreatestOfTwoOrMore values(23, 78, 89); Query OK, 1 row ... Read More
To get records from NOW()-1 Day, you can use the following syntax −select *from yourTableName where yourColumnName >=now()-interval 1 day;To understand the above syntax, let us first create a table. The query to create a table.mysql> create table GetRecordsFromNow −> ( −> YourDateTime datetime −> ); Query OK, 0 rows affected (1.76 sec)Now insert some dates into the fields. The query to insert records are as follows −mysql> insert into GetRecordsFromNow values(date_add(now(), interval 3 day)); Query OK, 1 row affected (0.28 sec) mysql> insert into GetRecordsFromNow values(date_add(now(), interval -1 day)); ... Read More
Use the containsKey() method and check if a given key exists in the HashMap or not.Let us first create HashMap and add some elements −// Create a hash map HashMap hm = new HashMap(); // Put elements to the map hm.put("Bag", new Integer(1100)); hm.put("Sunglasses", new Integer(2000)); hm.put("Frames", new Integer(800)); hm.put("Wallet", new Integer(700)); hm.put("Belt", new Integer(600));Now, let’s say we need to check whether the key “Bag” exists or not, For that, use the containsKey() method like this −hm.containsKey("Bag")The following is an example to check if a given key exists in HashMap −Example Live Demoimport java.util.*; public class Demo { ... Read More
To fetch LinkedHashSet key-value pair in Java, use the entrySet() method.Let us first create LinkedHashSet and add some elements −LinkedHashMap l = new LinkedHashMap(); l.put("1", "Jack"); l.put("2", "Tom"); l.put("3", "Jimmy"); l.put("4", "Morgan"); l.put("5", "Tim"); l.put("6", "Brad");Now, fetch a key-value pair −l.entrySet()The following is an example to fetch key-value pair from LinkedHashSet −Example Live Demoimport java.util.*; public class Demo { public static void main(String[] args) { LinkedHashMap l = new LinkedHashMap(); l.put("1", "Jack"); l.put("2", "Tom"); l.put("3", "Jimmy"); l.put("4", "Morgan"); l.put("5", "Tim"); ... Read More
To add AUTOINCREMENT in MySQL, you can use the ALTER command.ALTER TABLE yourTableName change yourColumName yourColumnName dataType AUTO_INCREMENT PRIMARY KEY;To understand the above concept, create a table with a column. Let us create a table −mysql> create table AlterTableToAddAutoIncrement -> ( -> StudentId int -> ); Query OK, 0 rows affected (0.57 sec)Implement the above syntax to change “StudentId” with AUTOINCREMENT. The query is as follows −mysql> alter table AlterTableToAddAutoIncrement change StudentId StudentId int AUTO_INCREMENT Primary key; Query OK, 0 rows affected (1.93 sec) Records: 0 Duplicates: 0 Warnings: 0We ... Read More