Posts by Leonardo Alves Machado • 652 points
30 posts
-
0
votes2
answers39
viewsA: How to solve Sonarqube’s criticism: Read of unwritten field Connector
What the tool is saying is that the object connector has not been initialized, and you are reading/accessing/calling a method from it. This can be both a false-positive (sometimes - especially in…
-
0
votes1
answer43
viewsA: Remove commits from a repository
As far as I know, Jhon, git doesn’t allow removing commits from your history. The most you can do is a squash, as described in this tutorial. If you have entered an unwanted change, it is a git…
-
0
votes2
answers278
viewsA: CHANGE PATH WINDOWS 7
Yes, it would be a problem - some programs(s) might stop working with this (apparently, the npm, in your case). You have to enter the value by separating it from the others with ;…
-
1
votes1
answer112
viewsA: Git Manage Branches
In the projects I work, we open Pull Request (we use github here, in Gitlab I believe it is Merge Request) for every branch that has to be merged with master. Having the request, it is possible to…
-
4
votes2
answers782
viewsQ: How to delete git branches that don’t exist on the remote
In my current project, I locally created several branches for local testing - all from master. Now, I have more than 20 local branches that don’t exist on the server. I wanted to clean up here, and…
-
1
votes1
answer61
viewsA: Circumference area
For documentation: public double nextDouble() Scans the next token of the input as a double. This method will throw InputMismatchException if the next token cannot be translated into a valid double…
-
2
votes1
answer102
viewsA: Problems with C++ encryption
I didn’t actually implement it, but I would use the operation % to limit entries by following these steps: converts the character to int (or long, depending on the need) - this to get the code from…
-
1
votes2
answers828
viewsA: Parametric polymorphism and overload in Java and C++
I put there, in the comments, links to sources that talk about parametric polymorphism. Overload refers to "regular" polymorphism, so option C is incorrect. Parametric polymorphism means that one…
-
6
votes2
answers1202
viewsA: Java Runtime could not be Located in Visual Studio Code
Visual Studio Code looks at variables JAVA_HOME and JDK_HOME. On Windows, go to Control Panel (Control Panel), System (System), Advanced System Settings (Advanced System Settings) and click…
-
0
votes1
answer67
viewsA: Command Validations - CQRS
Validations vary according to the application and the data to be validated. If, for example, you have a customer registration form in an e-commerce, you would need, for example, to validate the…
-
1
votes2
answers510
viewsA: How to return the git add --all command
We have an example of this in git manual online $ edit $ git add frotz.c filfre.c (1) $ mailx (2) $ git reset (3) $ git pull git://info.example.com/ nitfol (4) The example is this: you are working…
-
1
votes1
answer45
viewsA: Multiple Returns Pattern Builder
The methods constroiJson, constroiLista and constroiXml of your class ObjetoBuilder do not build class objects Objeto, logo are not part of the Design Pattern. They could be part of the class…
-
0
votes1
answer209
viewsA: Adding new data to JSON with Typescript and Angular
You tried to use Array.push? It would be something like: meuArray.push({ "texto": "De boas?", "contato": "Victor", "data": "2018-09-25T21:09:00" }); or else var objetoComAsInformacoesDesejadas = {…
-
2
votes3
answers69
viewsA: Shouldn’t this function return a bool instead of a pizza?
The function map takes the array values and uses them as the input key (any word typed) and maps them all to the same value (the pizza). The end ('' && word) serves to print nothing when the…
javascriptanswered Leonardo Alves Machado 652 -
1
votes1
answer178
viewsA: How do I set the call timeout of an EJB function?
Try to use the following annotation in the method that is taking: @AccessTimeout(value = 15, unit = TimeUnit.MINUTES) @Override public void metodoDemorado() { //implementação }…
-
0
votes2
answers1526
viewsA: Create array within JSON object
Have you tried, for example, that: objeto = { "item" : [ { "id" : delDiv, "nome" : nomeItem.value, "cod" : codItem.value }, { "id" : delDiv2, "nome" : nomeItem2.value, "cod" : codItem2.value }, {…
-
0
votes3
answers491
viewsA: Converting C to Java
Answering your points: The condition of while is equivalent to qtos != 0 The line soma += (*(num + qtos) - '0' ) peso++; gives build error. You need an operation (or semicolon) there between the…
-
0
votes1
answer38
viewsA: The queue code has an error in the search. How can I fix it?
In function buscaBinaria, your first parameter is an integer (int l) and you try to use it as an array in if(l[meio] == x).
-
1
votes1
answer43
viewsA: wprintf problems with long int c++
You’re probably popping the long with that number. Tries: #include <stdio.h> #include <fcntl.h> #include <io.h> #include <wchar.h> int main() { _setmode(_fileno(stdout),…
c++answered Leonardo Alves Machado 652 -
2
votes1
answer556
viewsA: Doubt binary search c++
To use binary search, you first need to sort the array of elements. This will download the complexity of O(n2) - your solution - to O(n log n) (ordering complexity, using quicksort, for example). To…
c++answered Leonardo Alves Machado 652 -
1
votes2
answers1770
viewsA: How to scroll through a chained list from the last position?
The error of the remark, basically, is that you declared struct Node fimNodo; as a static variable, and not as a pointer. Use: struct Node* fimNodo; to use fimNodo->next out fimNodo->data.…
-
0
votes2
answers407
viewsA: Sort objects in json file (Java)
Yes, it is possible. Just have your class use the interface Comparable. In this interface, you will define the comparison criteria. So you can add your elements to a collection that supports…
-
0
votes1
answer82
viewsA: How to omit space to insert only numbers in different lists
The problem is in your job apaga. In it you always delete the next non-null element (which can be null). Try to change the test to something similar to this: Nbig *apaga(Nbig *L) { if (L == NULL)…
-
0
votes1
answer147
viewsA: SMPSEQ3 problem - Fun with Sequences - SPOJ
It took me a while to figure it out, but I found the "infinite loop" Nessa for: for (int i = 0; i <= Q; i++) You’re waiting for an element more than the read, because of the test i <= Q.…
-
0
votes2
answers114
viewsA: Foreach implementation
Dude, the foreach in php has the second syntax: foreach (array_expression as $key => $value) statement For example: $arr = array(1, 2, 3, 4); foreach ($arr as &$value) { $value = $value * 2;…
-
1
votes1
answer79
viewsA: Allocate space to a double vector vector vector
You could do it this way: vector<vector<vector<double>>> v(WIDTH); for (int i = 0; i < WIDTH; i++) v[i].resize(HEIGHT); for (int j = 0; j < HEIGHT; j++)…
-
0
votes4
answers1196
viewsA: Different colors inside the tag H1
Try this: CSS: h1 { font-size:22px; color:#341C12; font-weight:normal; font-style:italic; } h1 .h1color { color:#862E06; } HTML: <h1>News <span class="h1color">&…
-
3
votes2
answers198
viewsA: Bhaskara beginner
Negative root is NAN 9 - 40 is -31, and this is the value of delta Following your code line of reasoning (which is to show message with the answer) you could put the following test: if (delta <…
c#answered Leonardo Alves Machado 652 -
0
votes1
answer2608
viewsA: Read whole and negative numbers in Phyton
To read an integer in python: x = int(input("Enter a number: ")) To make a loop until a condition is reached: while (<expressão_condicional>): <código_executado> An example: count = 0…
python-3.xanswered Leonardo Alves Machado 652 -
2
votes2
answers1662
viewsA: How to convert to Base64 in C#?
I took it from here Encode public static string Base64Encode(string plainText) { var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText); return…