NavigableMap lastEntry() method in Java

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

53 Views

The NavigableMap lastEntry() method returns a key-value mapping associated with the greatest key in this map.Let us first create a NavigableMap and add some elements to it −NavigableMap n = new TreeMap(); n.put(5, "Tom"); n.put(9, "John"); n.put(14, "Jamie"); n.put(1, "Tim"); n.put(4, "Jackie"); n.put(15, "Kurt"); n.put(19, "Tiger"); n.put(24, "Jacob");Now, get the last entry −n.lastEntry();The following is another example to get last entry from NavigableMap −Example Live Demoimport java.util.*; public class Demo { public static void main(String[] args) { NavigableMap n = new TreeMap(); n.put("A", 498); ... Read More

What are amphibious fishes? Can they live outside water?

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

174 Views

The fishes that can survive without water for a good amount of time are known as amphibious fishes. Convergent evolution plays an important role in these species, as the next generation species receives analogous structures that have similar function but were not present in the last generation.Many fishes are amphibious, which means they can naturally survive out of the water. These fishes have developed limbs or use lateral undulation (that is, wave-like movement patterns that act to propel an animal forward) for terrestrial locomotion. They leave water bodies for many reasons like escaping predators, low oxygen environments etc.Ancient fish had ... Read More

What is Flaring and what are the different types of Horn antennas?

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

851 Views

To improve the radiation efficiency and directivity of the beam, the waveguide should be provided with an extended aperture so as to make the abrupt discontinuity of the wave into a gradual transformation, so that all the energy in the forward direction gets radiated. This can be termed as Flaring. Flaring is done to provide greater directivity and narrower beam width. The types of horn antennas depend on how they are flared.Sectoral HornThis type of horn antenna, flares out in only in one direction. Flaring in the direction of Electric vector produces the sectorial E-plane horn. As well, flaring in ... Read More

Get Last Entry in a MySQL table?

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

1K+ Views

You can get the last entry in a MySQL table using ORDER BY. The first approach is as follows:Case 1: Using DESC LIMITSELECT * FROM yourTableName ORDER BY yourColumnName DESC LIMIT 1;The second approach is as follows:Case 2: Using MAX()SET @anyVariableName = (SELECT MAX(yourColumnName) FROM yourTableName); SELECT *FROM yourtableName WHERE yourColumnName = @anyVariableName;Now to understand both the approaches, let us create a table. The query to create a table is as follows:mysql> create table lastEntryDemo    -> (    -> Id int NOt NULL AUTO_INCREMENT,    -> Name varchar(30),    -> Age int,    -> PRIMARY KEY(Id)    -> ); ... Read More

Design a Keylogger in Python

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

3K+ Views

Here we are going to develop a keylogger using python. But before that, what is a keylogger? Keylogger is a program with which we monitor keystrokes. These keystrokes will be stored in a log file. We can record sensitive information like username and password using this keystroke.To create a keylogger we are going to use the pynput module. As its not the standard library of python, we might need to install it.Installing pyxhook module −I’m going to use pip to install pynput −pip install pynput Requirement already satisfied: pynput in c:\python\python361\lib\site-packages (1.4) Requirement already satisfied: six in c:\python\python361\lib\site-packages (from pynput) ... Read More

What made iphone the game changer in the world of smartphones?

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

213 Views

Apple launched iPhone in 2007 and caused a tidal wave of change throughout the mobile phone industry. It was the only smartphone with just one functional button (home button) which created a revolution in the market.Apple StoreApple has invented apple store for its product where you can download software safely.The invention of the apple store, created a revolution because you can download any type of software for your phone which is compatible with the i phone. Apple store can only be accessed by an apple phone user.Before iPhone, the idea of using on-screen keyboard on a phone was unimaginable. When ... Read More

BOOLEAN or TINYINT to store values in MySQL?

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

455 Views

The MySQL BOOLEAN and BOOL both are equivalent to TINYINT(1). Whenever you create a column using BOOLEAN and BOOL data type, MySQL implicitly convert the BOOLEAN and BOOL to TINYINT(1). The BOOLEAN and BOOL are equivalents of TINYINT(1), since they are synonyms.Create a table using BOOLEAN data type. The query to create a table.mysql> create table BooleanDemo    -> (    -> IsOn BOOLEAN    -> ); Query OK, 0 rows affected (0.58 sec)Now check internal structure of the above table. The query is as follows −mysql> show create table BooleanDemo;Output+-------------+----------------------------------------------------------------------------------------------------------------------------------+ | Table       | Create Table   ... Read More

Does SQL Server have an equivalent to MySQL's ENUM data type?

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

2K+ Views

This works in MySQL version 8.0.12. The syntax is as follows.create table yourTableName ( yourColumnName enum(‘Value1’,Value2’,Value3’,......N) default Value1’ or Value2 or Value3,..N );Set the enum type in MySQL with the following query.mysql> create table EnumInMySQL -> ( -> WebCRUD enum('CREATE','READ','UPDATE','DELETE') -> default 'CREATE' -> ); Query OK, 0 rows affected (0.60 sec)The syntax of enum in SQL Server.create table yourTableName ( yourColumnName varchar(100) CHECK(yourColumnName IN (‘Value1’,Value2’,Value3’,......N)) DEFAULT ‘Value1’ or Value2’ or Value3’,......N );Now the query is as follows for enum in SQL Server.

What is the significance of Charminar in Hyderabad?

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

1K+ Views

Charminar is a monument which was constructed in 1591, in Hyderabad, India. The literal translation of Charminar in English is 4 pillars. It is located on the east bank of the Musi River and is listed among the most recognized structures of India. There are many theories regarding the reason for the construction of Charminar but the commonly accepted theory is that it was built to celebrate the elimination of the Plague, which was widespread at that time.Charminar was built by Muhammad Quli Qutb Shah, the fifth ruler of the Qutb Shahi dynasty. After shifting his capital from Golkonda to ... Read More

What is the role of taxonomy in biodiversity conservation?

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

3K+ Views

The classification of things while describing and naming them can be understood as Taxonomy. This helps to identify any developmental and experimental work that needs to be done.Simply put, why would anyone mix the shoes in shoe rack with the bed sheets in a cupboard? Taxonomy is our inheritance where we define the places to which they belong. In the same way, it provides an easy to identify the categories of the species so as to have an idea of the existing conditions and to plan necessary measures for the biodiversity conservation.What is Bio-diversity Conservation?Bio-diversity is regarded as the foundation ... Read More

Advertisements