Snippets tagged “filter”
19 snippets use this tag.
- Find first element by predicateJava
To find the first element in a list that matches a certain condition, you can use the stream() method to create a stream from the list, and then use the filter() method to specify the condition that the element should satisfy. Finally, you can use the fin
- How are lambdas useful?Python
Lambdas, also known as anonymous functions, are useful in Python because they allow you to create small, one-time use functions without having to define them with a full function statement.
- How do I do a not equal in Django queryset filtering?Python
You can use the exclude() method to filter out records where a certain field is not equal to a certain value.
- How to Add a Blur Filter to the Background ImageCSS
Learn How to Apply a Blur Filter to a Background Image with W3docs tutorial. Follow up the steps and create a blurred background image for your website.
- How to Blur the Background Image in CSSCSS
Learn about how to add blurring effect to your background image withe the CSS filter property. See examples.
- How to Change the Color of PNG Image With CSSCSS
Learn how you can change the color of PNG image with the filter CSS property values. See some examples and create your own code!
- How to Convert an Image into a Grayscale Image With CSSCSS
Learn the steps to make an image grayscale or black and white using either filter or background-blend-mode properties. See examples.
- How to Create a Blurry Text in CSSCSS
One of the best effects to stylize your text, is making it appear blurred. In this snippet, we are going to show you two methods of creating a blurry text. So here we go.
- How to Create a Drop Shadow for PNG ImagesCSS
Shadows always give an image a fresh look and make it eye-catching. Learn How to Create a Drop Shadow for PNG image with W3docs online tutorial.
- How to Create an SVG Drop ShadowCSS
On this page, you’ll find information on creating an SVG drop shadow. For that purpose, you can use the SVG <feDropShadow> element or the CSS filter property.
- How to filter a Java Collection (based on predicate)?Java
To filter a Java collection based on a predicate, you can use the removeIf method of the Collection interface. This method removes all elements from the collection that match the specified predicate.
- How to Get the Difference Between Two Arrays in JavaScriptJavaScript
Read this tutorial and learn several JavaScript and jQuery methods that help you get the difference between two arrays easily. Choose the best one for you.
- How to Loop Through Array and Remove Items Without Breaking the For LoopJavaScript
Read this JavaScript tutorial and learn some useful information about the method of looping through an Array and removing items without breaking for loop.
- How to Merge Two Arrays in JavaScript and De-duplicate ItemsJavaScript
Read this tutorial and find useful information about the simplest methods that are used for merging two arrays and removing duplicate items in JavaScript.
- How to Remove an Element from an Array in JavaScriptJavaScript
Read this tutorial and learn what several useful Array methods exist that will help you remove the specified element from an Array in JavaScript easily.
- How to Remove Empty Elements from an Array in JavascriptJavaScript
Read this tutorial and learn the method of removing empty elements from an Array. Also, read about removing falsy elements that include an empty string.
- Java 8 Distinct by propertyJava
To get a list of distinct elements by a property in Java 8, you can use the distinct() method of the Stream interface and the map() method to extract the property from each element.
- Java List.contains(Object with field value equal to x)Java
To check if a Java List contains an object with a specific field value, you can use the List.stream().anyMatch() method along with a lambda expression to filter the elements in the list based on the field value.
- Python: Find in listPython
Here is a code snippet that demonstrates how to find an element in a list in Python: