Samual Sam has Published 2492 Articles

Remove all elements from Java NavigableMap

Samual Sam

Samual Sam

Updated on 25-Jun-2020 07:54:39

90 Views

Use the clear() method to remove all elements from NavigableMap in Java.First, let us create NavigableMap −NavigableMap n = new TreeMap();Add elements to the NavigableMap −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");Remove all elements −n.clear();The following is an example to remove ... Read More

Convert array to HashSet in Java

Samual Sam

Samual Sam

Updated on 25-Jun-2020 07:54:16

1K+ Views

Create an array and convert it to List −Integer[] arr = { 10, 15, 20, 10, 10, 10, 20, 30, 35, 40, 40}; List l = Arrays.asList(arr);Now, let us convert the above array to HashSet −Set s = new HashSet(l);The following is an example to convert array to HashSet −Example Live ... Read More

How to set a default column size in CSS Grid

Samual Sam

Samual Sam

Updated on 25-Jun-2020 07:37:38

414 Views

Use the grid-auto-columns property to set a default size for columns.You can try to run the following code to implement the grid-auto-columns property with CSSExampleLive Demo                    .container {             display: grid;       ... Read More

What is a transformation matrix in HTML5 canvas?

Samual Sam

Samual Sam

Updated on 25-Jun-2020 07:26:44

147 Views

HTML5 canvas provides methods that allow modifications directly to the transformation matrix. The transformation matrix must initially be the identity transform. It may then be adjusted using the transformation methods.ExampleLet us see an example of canvas transformation −                    function ... Read More

CSS grid-row Property

Samual Sam

Samual Sam

Updated on 25-Jun-2020 07:25:36

112 Views

With grid-row property, set the size of grid items. It has grid-row-start and grid-row-end properties. You can try to run the following code to implement the CSS grid-row property.ExampleLive Demo                    .container {             display: ... Read More

NavigableMap isEmpty() Method in Java

Samual Sam

Samual Sam

Updated on 25-Jun-2020 07:22:15

65 Views

Check whether a Map is empty or not using the isEmpty() method.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, use the following method to check ... Read More

Why cannot I use iframe absolute positioning to set height/width

Samual Sam

Samual Sam

Updated on 25-Jun-2020 07:17:36

365 Views

iFrames are replaced elements and considered different than non-replaced elements. The element is a non-replaced element.To achieve the same result i.e. to set both the left/right or top/bottom in an iframe, use a div as a wrapper with absolute position, top, left, right, bottom.Place your iframe with −width:100% height:100%.Read More

Java program to find common elements in three sorted arrays

Samual Sam

Samual Sam

Updated on 25-Jun-2020 07:16:12

955 Views

The common elements in three sorted arrays are the elements that occur in all three of them. An example of this is given as follows −Array1 = 1 3 5 7 9 Array2 = 2 3 6 7 9 Array3 = 1 2 3 4 5 6 7 8 9 ... Read More

Internet Explorer unable to render any kind of background color for the
element.

Samual Sam

Samual Sam

Updated on 25-Jun-2020 07:06:55

101 Views

Internet Explorer 11 does not support the element. Add support using Modernizr of the following JS −document.createElement('main');Adding the above element, will not give you the element for the browser, therefore, you need to use the following CSS finally −main {    display:block; }

HTML5 video not playing in Firefox

Samual Sam

Samual Sam

Updated on 25-Jun-2020 07:00:27

2K+ Views

HTML5 video should work in Firefox web browser. If it is still not working, try the following −Start Firefox in Safe Mode to check if any extension is creating issues.To reach Extensions, go to, Firefox/Tools > Add-ons > ExtensionsTry to turn off hardware acceleration.You need to check the media prefs ... Read More

Advertisements