In this program we will see how to sort a block of bytes using bubble sorting technique.Problem StatementWrite 8085 Assembly language program to sort numbers in ascending order where n number of numbers are stored in consecutive memory locations starting from 8041H and the value of n is available in memory location 8040H (Using BUBBLE sort).DiscussionIn this program we will arrange the numbers in bubble sorting technique. In this sorting technique, it will be executed in different pass. In each pass the largest number is stored at the end of the list. Here we are taking the numbers from location ... Read More
The size() method is used to get the size of LinkedHashMap in Java.Create a LinkedHashMap and add some elements to it −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");Get the size now −l.size()The following is an example to get the size of LinkedHashMap −Example Live Demoimport java.util.LinkedHashMap; 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 part DATE and TIME from DATETIME, you can use the DATE_FORMAT() method from MySQL. The syntax is as follows −SELECT DATE_FORMAT(yourColumnName, '%Y-%m-%d') VariableName, DATE_FORMAT(yourColumnName, '%H:%i:%s') VariableName from yourTableName;To understand the above method DATE_FORMAT(), let us create a table with data type “datetime”.Creating a table −mysql> create table DateAndTimePartDemo -> ( -> YourDateandtime datetime -> ); Query OK, 0 rows affected (0.56 sec)Now, I am inserting current date and time using now(). The query is as follows −mysql> insert into DateAndTimePartDemo values(now()); Query OK, 1 row affected (0.37 sec)Display the record ... Read More
No, you won’t get any issues with underscores in a MySQL table name. You will get the issues with a dash in a MySQL table name.Here is the demo that does not have any issue with underscore with table names −_StudentTrackerDemoLet us see the same while creating a table. The query to create a table is as follows −mysql> create table _StudentTrackerDemo -> ( -> StudentId int, -> StudentFirstName varchar(100) -> ); Query OK, 0 rows affected (0.75 sec)The underscore is valid for table names but dash is ... Read More
To check for duplicates in MySQL, you can use group by having clause. The syntax is as follows.select yourColumnName1, yourColumnName2, ......N, count(*) as anyVariableName from yourTableName group by yourColumnName1, yourColumnName2 having count(*) > 1;To understand the above syntax, let us create a table. The query to create a table is as follows.mysql> create table DuplicateDemo -> ( -> StudentId int not null, -> StudentFirstName varchar(100), -> StudentLastName varchar(100), -> Primary Key(StudentId) -> ); Query OK, 0 rows affected (0.50 sec)Insert some records in the table using insert command. The query is as follows.mysql> insert into DuplicateDemo values(1, 'John', 'Smith'); Query ... Read More
In this article we'll see how to compare two NSDates in swift. First of all we'll need to create two NSDates.We'll do it in playground instead of simulator this time.First Let's create two different dates.let dateOne = NSDateComponents() dateOne.day = 5 dateOne.month = 6 dateOne.year = 1993 let dateTwo = NSDateComponents() dateTwo.day = 4 dateTwo.month = 2 dateTwo.year = 1995Using these date components we'll create dates and then compare themlet cal = NSCalendar.current let FirstDate = cal.date(from: dateOne as DateComponents) let secondDate = cal.date(from: dateTwo as DateComponents)Now to compare them we'll use a if condition.if secondDate!.compare(firstDate!) == .orderedAscending { ... Read More
The class of large military weapons that are used to fire ammunition, are called as Artillery. These are used to target far ranges than the small arms can handle. The artillery includes Field and Infantry guns, Muzzle-loaded guns, Howitzers, Anti-aircraft and Anti-tank guns, heavy and Infantry mortars, Cannons and Autocannons, other large projectile weapons etc.When perfectly aimed, it could destroy the enemy trenches, can kill a group of soldiers or infantry, can destroy their ammunition and communication systems as well.China’s Song DynastyIt was during the middle ages, the artillery especially Cannons were introduced. Cannons which were widely used in wars, ... Read More
Use the size() method to get the size of HashMap. Let us first create a HashMapHashMap hm = new HashMap();Now, add some elements −hm.put("Bag", new Integer(1100)); hm.put("Sunglasses", new Integer(2000)); hm.put("Franes", new Integer(800)); hm.put("Wallet", new Integer(700)); hm.put("Belt", new Integer(600));Since, we added 5 elements above, therefore, the size() method will give 5 as the result −set.size()The following is an example to find the size of HashMap −Example Live Demoimport java.util.*; public class Demo { public static void main(String args[]) { // Create a hash map HashMap hm = ... Read More
In this program we will see how to exchange a block of bytes using 8085.Problem StatementWrite 8085 Assembly language program to exchange a block of data, where block size is given.DiscussionThe data are stored at location 8010H to 8019H and 9010H to 9019H. The location 8000H is holding the number of bytes to exchange.The logic is very simple, The HL and DE register pair is pointing the first and second data block respectively. By taking the data we are just swapping the values of each memory locations. Then repeating this process to swap two blocks completely.InputAddressData......800006......801000801111801222801333801444801555......9010849011639012129013479014489015AD......Flow DiagramProgramAddressHEX CodesLabelsMnemonicsCommentsF00021, 10, 80LXI ... Read More
Plagiarism is the process of infringement which means presenting other’s work as one’s own. This is mostly done in the content field. The information from web pages, articles, blogs, books etc. is often copied by some to present it as their own work. As the process of content publishing online is increasing day-by-day there are many chances of having copied content, which can be either video, text or images.Google itPlagiarism tools help us identify that copied content. Usually, when we check on google to know whether this is genuine content, the copied part is immediately highlighted with the pages displaying ... Read More