Posts by Pedro • 679 points
23 posts
-
1
votes1
answer957
viewsA: Expand Apache POI Excel column
The problem with your for to change the column size is that it uses the row value as the basis, not the column value. To get the number of columns, you can use the method getPhysicalNumberOfCells()…
-
0
votes1
answer167
viewsA: How to get out of Joptionpane without closing the Main window?
I believe the choice of a do while was not the best in that scenario, because when the JOptionpane is closed, you already have this information in hand, which is the return of value. If the goal is…
-
2
votes1
answer9398
viewsA: Angular 6 ngFor
The cause of this "problem" is the change detection angular. This process aims, in a brief explanation, to catch all its componentes and render them in visão. Each time a detection cycle is called,…
-
1
votes1
answer103
viewsA: Popular Excel with Java object
The problem is that you are creating all the items in the same row. To skip lines, another row. for (Dado data : array) { Row row = sheetEtiquetas.createRow(rownum++); int cellnum = 0; Cell cellOp =…
-
1
votes1
answer44
viewsA: Angular list implementation with problem
The problem is in its component: getRestaurants() { ... response => { if (!response.restaurants) { } else { this.restaurants = response.restaurants; } }, ... Your API returns only one list, with…
-
2
votes1
answer215
viewsA: How to update Java application format . War for several clients?
Downloading my comments for a reply: We don’t know his entire scenario, but I have some indications: Remote deploy That application allows you to deploy a . War to an external IP. Knowing clients'…
-
3
votes2
answers254
viewsA: Fill Map without duplicating records
You can use the library Collectors, the method toMap(). In this example, I have an object with two fields, chave and valor, which will be the respective key / value of the map. It is also possible…
-
2
votes1
answer8567
viewsA: Problem with CORS at Angular 5
First, we need to understand what CORS is. Cross-origin Resource sharing or cross-source resource sharing is a browser security specification that aims to secure resources from different…
-
6
votes3
answers318
viewsA: How do you get part of a String?
We already have some answers that meet the scenario, however, I would like to share my solution using regular expressions. import java.util.regex.Matcher; import java.util.regex.Pattern; public…
-
1
votes2
answers544
viewsA: Update from Jenkins
wget http://updates.jenkins-ci.org/latest/jenkins.war cp jenkins.war /usr/lib/jenkins systemsctl stop jenkins systemsctl start jenkins It is a simple process, just swap the . War for the newer…
-
0
votes1
answer320
viewsA: Doubt about best practices for Rest API (object -> json)
Regarding the POST, the biggest problem when sending the whole object is the consistency of data. If for example, for some reason, the state comes with the following structure: "estado":{ "id":1,…
-
6
votes1
answer605
viewsA: Typescript, dot and comma or no?
In theory, the mandatory semicolon exists in a single scenario, which is when the next line starts with one of the following symbols: [ ( ` For example: var x = { xx : "hello", yy : "world"}…
-
1
votes2
answers47
viewsA: How to dynamically get specific day in a query
SELECT (date_trunc ('month', current_date - interval '1' month) + interval '1 month' - interval '1 day')::date AS ultimo_dia_mes_anterior; Today, the query returns: 2018-06-30…
-
1
votes1
answer1315
viewsA: Transform object into array keeping the index
You can use the function Object.() const original = {0: 0.08075, 1024.0: 51200.0} const map = new Map(Object.entries(original)); console.log(map);…
-
1
votes1
answer225
viewsA: Angular 2 Error Httpresponse not found
As @Eduardo Vargas mentioned in his comments, login.component.html passes two parameters to the function `fazerLogin, of which it receives only one. We can notice that it is not interpreting the…
-
0
votes1
answer755
viewsA: How to run and display CMD log?
Follows a generic method, where you pass the command, in your case, the full path + the name of the executable, and it returns a string with the result of the process. /** * Executa um comando no…
-
2
votes1
answer123
viewsA: How do I import a. jar file without using an IDE? (Java)
You can pass some parameters at build time: javac -classpath lib/bar.jar com/example/Foo.java In this scenario, your class Foo.java depends on the jar bar.jar. If you’re using a project that doesn’t…
-
0
votes2
answers883
viewsA: Read lines from a TXT to Arraylist
Without knowing which graphic library you will use, here is a generic solution, which uses a Map to store the latitude set / longitude. public HashMap<Double, Double> getCoordenadas() throws…
-
1
votes1
answer92
viewsA: readline() returning null
You can use an external library, Apache Commons IO, to turn your inputStream directly into a string, since you only need the first line. URL url = new URL("http://brunnw.cf/plugins.php?licenca=" +…
-
0
votes1
answer538
views -
4
votes1
answer270
viewsA: Modifications in Jfreechart
To change the color of certain sliced, you can use the following: plotagem.setSectionPaint("Conteúdo 1", Color.black); Where the first paramêtro is the key to the slice, and the second is the color.…
-
2
votes1
answer118
viewsA: Attribution operator "=" javascript
As @Guilhere Nascimento commented, this is because objects in Java are mere references to a memory position. var d = new Date(); var dataInicial = new Date(2017, 5, 1); var dataFinal = new…
-
1
votes1
answer47
viewsA: Java arithmetic operations with database data
You can get this information directly from the database using an sql command called Sum. The syntax happens this way: Select Sum('NOME_COLUNA') as resultado from 'NOME_TABELA'; Having this…