[VV15] lambda min, security filter, custom hook, scrum DoD, long method, error message, course platform
JAVA CERTIFICATION QUESTION: Lambda and Min
Given:
What is printed?
Answer:
The Stream.min finds the minimum element of the stream according to the provided comparator.
A comparator compares its two arguments for order, returning a negative integer, zero, or a positive integer as the first argument is less than, equal to or greater than the second.
Here, the comparator always returns a positive number. This means an element is always deemed greater than the following one.
So, the last Champion instance is considered the minimum element, and "Geertjan" get printed out.
min??? : https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/stream/Stream.html#min(java.util.Comparator)
?
???? SPRING CERTIFICATION QUESTION: What is the security filter chain?
Answer:
??????????????????????????????? maintains a list of ????????????????????????????????????? objects each of which is capable to decide whether it should be applied to a web-request or not.
The first filter-chain which matches the request is responsible for its processing.
Internally ????????????????????????????????????? is itself a list of ???????????? objects plus single instance of ??????????????????????????? which actually performs url-matching.
A Custom Filter in the Spring Security Filter Chain???https://lnkd.in/egUPrBqE
?
QUOTE
?
REACT: Custom hook
Hooks ?? are reusable functions.
When you have component logic that needs to be used by multiple components, we can extract ?? that logic to a custom Hook.
Custom Hooks start with "use". Example: useFetch.
Build a Hook
In the following code, we are fetching data ?? in our Home component and displaying it.
We will use the JSONPlaceholder service to fetch fake ?? data.
This service is great for testing ?? applications when there is no existing data.
Use the JSONPlaceholder service to fetch fake "todo" items and display the titles on the page:
The fetch logic may be needed in other components as well, so we will extract ?? that into a custom Hook ??.
Move ?? the fetch logic to a new ?? file to be used as a custom Hook:
Example Explained
We have created a new ?? file called?useFetch.js?containing a function called?useFetch?which contains ?? all of the logic needed to fetch our data.
We removed ? the hard-coded URL and replaced it with a?URL?variable that can be passed to the custom Hook??.
Lastly, we are returning ?? our data from our Hook.
In?index.js, we are importing ?? our?useFetch?Hook and utilizing it like any other Hook. This is where we pass in the URL to fetch data.
Now we can reuse ??? this custom Hook in any component to fetch data from any URL.
领英推荐
?
SCRUM: Definition of Done ?
The Definition of Done is a formal description ?? of the state of the Increment when it meets the quality measures required for the product.
The moment a Product Backlog item meets the Definition of Done ?, an Increment is born ??.
The Definition of Done creates transparency ?? by providing everyone a shared understanding ?? of what work was completed as part of the Increment. If a Product Backlog ?? item does not ? meet the Definition of Done, it cannot be released ?? or even presented ?? at the Sprint Review. Instead, it returns ?? to the Product Backlog for future consideration.
If the Definition of Done for an increment is part of the standards of the organization ??, all Scrum Teams must follow it as a minimum. If it is not an organizational standard, the Scrum Team must create a Definition of Done appropriate ?? for the product.
The Developers ???????? are required to conform to the Definition of Done. If there are multiple Scrum Teams working together on a product, they must mutually define and comply with the same ?? Definition of Done.
?
CODE SMELL: Long method
Long functions are not bad per se. Functions and classes that do more than one thing (and are, as a consequence, long) are bad ??. This smell is about jamming ?? different responsibilities into the same entity; therefore the "multitasker" name rather than just "long function".
Why is it bad? ??
How to fix it? ??
?
Good and bad error messages
Bad ??
Good ??
?
Survey: Online course platforms to learn ???? how to code
Udemy leads as the most popular online course or certification program for learning how to code. This may be popular for the same reasons we saw above - people can purchase the individual courses they want, creating their own learning path.
?
Java bug joke ??
Cat fixing his piping like a developer fixes Java exceptions. When the developer copes with one, another exception pops up.
It starts with ClassCastException, fixed with casting (MyClass).
It uncovers a new exception: ArrayIndexOutOfBoundException, fixed by putting -1 on the array index.
Then a NullPointerException reveals itself, fixed with !=null.
And last but not least a FatalError which lets this poor cat alone in his helplessness... LOL