Posts by Hélio Márcio Filho • 564 points
10 posts
-
2
votes1
answer514
viewsA: What would be a service class in a Java MVC project?
Citing Spring MVC as an example I like to separate the MVC project into Model, View, Control and Service. The reason is that in my projects I don’t like to leave business rules directly in the…
-
0
votes1
answer279
viewsA: Doubt with ide Dbeaver
This function was implemented as a solution for Issue #1478: https://github.com/dbeaver/dbeaver/issues/1478 According to the source code, the part outside the parentheses is Execution time and the…
-
4
votes1
answer89
viewsA: Reorganize my array’s index
See if this fits you. This function removes the elements whose indexvariacaoatributo is equal to the parameter index past and then picks up the elements that have indexvariacaoatributo the front of…
-
1
votes1
answer2990
viewsA: How to import and configure a Maven project with Tomcat server in Intellij?
Right. So you want two things: 1. Import a Maven project into Intellij: File > Open > Search for pom.xml > OK > Open as Project 2. Setting up Tomcat: Add a new Run Configuration: Add a…
-
1
votes2
answers67
viewsA: Can you declare a variable in Javascript so that it always has 2 decimal places?
There is no way. The number will always be saved in the standard language precision. You will have to continue controlling the number of decimal places when displaying. Hint: Do not add values after…
-
0
votes2
answers68
viewsA: Turn the value into String for Integer
Your monetary value has decimal places, but you explicitly said you want to convert to whole, so my suggestion ignores the decimal places of your string: var numString = "R$ 5.000,00"; var…
javascriptanswered Hélio Márcio Filho 564 -
0
votes3
answers125
viewsA: Async Function javascript
As every async function returns a Promise, you can do: exports.postItemProduto = function (req, res) { try { var idProd = req.body.produtoPrincipal; getProduto(idProd, produto).then(() =>…
-
2
votes2
answers795
viewsA: Difference between Comparator and Comparable
Comparable: If you have control over the class’s source code, you can implement this interface in it to define a standard sorting strategy. Example: if you have a class of Person, you can implement…
javaanswered Hélio Márcio Filho 564 -
2
votes2
answers67
viewsA: nextInt() after the third integer
You can use . Skip() by passing a regular expression to ignore unwanted parts. See example below: public static void main(String[] args) { Scanner sc = new…
-
-1
votes2
answers169
viewsA: When to use Stringbuilder and Stringbuffer instead of concatenating with "+" operator in Java?
As Maniero put it well, Stringbuilder and Stringbuffer should be used when it is necessary to perform successive concatenations. This prevents memory waste. What I wanted to add is an observation…