Given birthDate and the day of death as strings the following method calculates the lifespan in...
Jest is a popular JavaScript testing framework that provides an intuitive and powerful way to write...
One easy way to display a custom name for each test.each test in jest, is to place the text name in...
The schema model object in Mongoose provides an _id that is of type ObjectId. If you are not...
First install jest-extended with the npm install --save-dev jest-extended command and use the...
As a software developer, having quick access to relevant information and resources is essential to...
In the following example we define template attribute to be of type String with values defined in the...
To set the initial value of the input control, just use the value attribute: <input type="text"...
Get current date with new Date() and setHours to 0, 0, 0 and then you are ready to compare with the...
Let's test with Jest the following isInfiniteDate function, which checks whether the given date is...
If you are using Angular Material Dialogs for example and when it pops up the page seems to move a...
Configuring application environments First define different environment files for the...
Going "green" As mentioned How I manage my dev bookmarks to save time and nerves I use...
Use the ngClass input attribute with the object notation, where the keys are CSS classes that get...
Use the expanded attribute of the mat-expansion-panel element and set it to true when the condition...
To access the filtered results of the pipe just define it as a variable via the as...
Use the click event to pass the text to the handling function, in this case...
Use the DefaultValue annotation parameter (accepts strings) where you set the default value alongside...
Given the following Superhero class: import javax.xml.bind.annotation.XmlAccessType; import...
Use the executeUpdate method of the Query interface. It will return the number of deleted...
With Java version 8 it's very easy to get the current timestamp with LocalDateTime.now(). One problem...
In the snippet you can see a message driven bean set up to consume asynchronously messages from a JMS...
To delete one entry you can use findOneAndRemove command - it issues a mongodb findAndModify remove...
Use the firstResult(int startPosition) and setMaxResults(int maxResult) of the JPA Query...
Define a named parameter (:status) in a named query: import...
You can define several named queries on an entity by using the @NamedQueries and @NamedQuery...
Use created(URI location) of the javax.ws.rs.core.Response class. Usually when you return the 201...
Use the ok() method of the javax.ws.rs.core.Reponse class to create a ReponseBuilder with a status of...
Use the $ sign to define the variable $variable_name: variable_value. Below we define anthracite-gray...
First select the deployment name in the current context you, if you don't know it with the following...