Posts by Renato • 516 points
13 posts
-
2
votes3
answers308
viewsA: Doubt when exporting Promise
What’s going on When you write a function async, the result is always a Promise. In this case, as you depend on a genuinely asynchronous function and you are not waiting through await or chained…
-
3
votes1
answer186
viewsA: Error in ASYNC update method with Node.js
This message means you have a Promise, which was rejected(an error occurred) and this error was not treated. If you are dealing with Promises through functions async, you must add a Try...catch to…
-
0
votes1
answer146
viewsA: How to install moon in Ubuntu via terminal?
In a new installation, the package cache does not list the moon. But just update: sudo apt-get update. Running Ubuntu through Docker: docker run -it --rm ubuntu bash Error while trying to install…
-
1
votes1
answer58
viewsA: Return the original radio button image when selecting another
To solve using javascript code, you would need to store the value previously selected, and return the original value at the beginning of the function. However, since you already have css, including…
-
3
votes1
answer56
viewsA: How to replace the value of a property in an object using spread?
What’s going on: When you use the spread on the object, you receive a new object with the same properties and values, {...usuario} return the same value. When using the second property, you are…
javascriptanswered Renato 516 -
0
votes2
answers83
viewsA: Problems with struct reading in function
The operator -> expects the element on the left to be a pointer. When writing: &dados[count]->avenida You’re trying to catch the avenue attribute of dados[count], which is of the type…
-
2
votes1
answer105
viewsA: Modify a Linkedlist using another Linkedlist
The Java Linkedlist does not expose internal Nodes, so it is not possible for you to reference directly from a second Linkedlist. If you want to update a property of a list item instead of changing…
-
3
votes1
answer144
viewsA: Mysql query grouping the results in the case
I think the problem is Count, try it like this: SUM(CASE DAY(o.data_fechamento) WHEN 22 THEN 1 ELSE 0 END) AS '22' In Mysql this can work also, more elegant: SUM(o.data_fechamento = 22) AS '22'…
-
3
votes5
answers2766
viewsA: What HTTP code should I use when I can’t authenticate to third-party services with login and password provided by the client earlier?
As you do multiple operations, some work and others don’t, you can use the multi status (207) and list the appropriate status by operation.
-
1
votes2
answers979
viewsA: How to add object property in Array to *ngFor
As you want the sum of all elements, you should not put yourself inside ngFor which is where you present something for each element. If you don’t want to follow Lucas Costa’s recommendation, you can…
-
0
votes2
answers118
viewsA: CSS attribute does not work
Without seeing the rest of the document, the problem is probably the referential size (5%) rather than an absolute size. This size is calculated with reference to the size of the element that…
-
4
votes1
answer642
viewsA: How to format a number for String by placing points "."?
The %,d is the thousand separator, and will use the default JVM location unless you specify different. To force the Brazilian location using point as separator, unlike the American using comma you…
-
1
votes1
answer168
viewsA: Doubt about parallel programming
The problem is that there is no guarantee that all threads will process at exactly the same speed. Just for example, let’s assume that the prime numbers are equally distributed among the Threads;…