Posts by Jefferson Quesado • 22,370 points
421 posts
-
3
votes1
answer752
viewsA: What’s the difference between "Future.whenComplete" and "Future.then"?
The whenComplete is simply called when the Future is completed: when the value that the Future redeems is finally obtained. Note that the function passed has no arguments, is a simple knowing that…
-
2
votes1
answer114
viewsA: Know the total file size to download
The size of an HTTP resource is informed via an HTTP header, the Content-length. In HTTP 1.1, you can omit this information, as long as the header is used Transfer-encoding: chunked. For static…
-
5
votes1
answer752
viewsQ: What’s the difference between "Future.whenComplete" and "Future.then"?
The Dart language provides several mechanisms for handling asynchronous calls. One I’m very used to is modifying await, which can be used in functions marked as async. However, we are sometimes in a…
-
1
votes1
answer315
viewsA: How to generate the jar file by Maven?
A fix: not a command bash, is a command. Simple as that. It could run on Bourne Shell, Dash, Ash, Csh, Zsh, Cmd, Powershell, even be called inside Ruby using`tics`. On the other hand, Eclipse…
-
4
votes2
answers145
viewsA: How to get all interfaces of an object?
This reply began to be written before the reply from Virgilio Novic. My approach has a different view, with a construction of knowledge that I consider valid to share, but the code obtained remains…
-
8
votes2
answers145
viewsQ: How to get all interfaces of an object?
I need to list all interfaces that an object implements. From what I understand, I could do the following: Object misterioso; .... misterioso.getClass().getInterfaces(); but this would only take the…
-
1
votes3
answers467
viewsA: How to get an advanced "for" score?
If you want a functional alternative (Java 8+), yes is also possible. On the Baeldung website you have several examples. What I came to use was the protopack. So I’m gonna focus on him. The first…
-
2
votes1
answer339
viewsA: The difference between the value of a maximum and minimum element of a vector recursively
A lot depends on how the solution strategy will be. This will define the path recursive to be traversed. For example, take the following recursive algorithm to calculate the maximum: If the vector…
-
4
votes3
answers727
viewsA: What is the difference between client-server and three-tiers?
3 Layers Based on the Presentation Domain Data Layer, Fowler, a 3-layer application consists of: presentation business access to resources/data With this architecture, it focuses on the information…
-
3
votes1
answer48
viewsA: Pointer from a function does not print
What happened here: when you switch to the function conferir the variable p, it does just that: the value of p. However, any change that affects the value of p within the function does not interfere…
canswered Jefferson Quesado 22,370 -
3
votes1
answer470
viewsA: How to change the gradlew version from the command line?
Just type ./gradlew wrapper --gradle-version=<VERSION> that the gradlew will configure to use the version described in <VERSION>. The next time you turn the ./gradlew, it will download…
-
2
votes1
answer470
viewsQ: How to change the gradlew version from the command line?
I need to reverse the version of gradlew back to 4.10.2. I went to version 5.5.2 to do some testing and need to return to the original version to confirm the test results.
-
5
votes4
answers319
viewsA: Regex - set 2 limits and pick up all content inside
Whereas the terminal delimiter can only appear once, and that it is only one character in your example is the %), I made a small adjustment in nullptr response to such an end: ENERGIA ELETRICA…
-
3
votes1
answer410
viewsQ: Is it possible to list the name of the Assets in a Flutter app?
I need to know which ones Assets I uploaded it to an flutter, to reflect and make a decision. I know I can list which ones Assets that I wish to climb into the app through the pubspec.yaml: ...…
flutterasked Jefferson Quesado 22,370 -
3
votes1
answer96
viewsA: How to add Dart syntactic highlight to VIM?
As mentioned by @Acwoss, the first step is to install a plugin manager from vim. For the sake of simplicity, it seemed easier to use the vim-plug. According to the guide of vim-plug, the first thing…
-
2
votes1
answer96
viewsQ: How to add Dart syntactic highlight to VIM?
I am starting the studies of Flutter. For this, I am using as editor the vim. I consider it an option to use an IDE, but for quick and small things, use the vim is mandatory for how I am studying.…
-
2
votes0
answers76
viewsQ: How to use Sqlite in CLI applications written in Dart?
I’m testing the Dart to discuss its feasibility in replacing part of the code base in Java. I didn’t find anything similar to the JDBC specification in Dart, so I’m guessing the language doesn’t…
-
0
votes1
answer38
viewsQ: How to take advantage of the consultation in two separate layouts reports?
I have two reports in Jasper for different views on the same mass of data. So much so that the parameters and query are exactly the same. Is there any method, inherent to Jasper Reports, that allows…
-
3
votes1
answer65
viewsA: How to unite results of queries without mixing them?
The first thing I’d do is make sure the set didn’t overlap, so we could work with UNION ALL. How to do this? Simple: in the second selection, add the filter that you can’t start with Vitor: SELECT…
-
11
votes3
answers559
viewsA: What’s the best way to play a Loop in math?
Specifically about summation and productive operations, not in general and can not represent your specific case because the order of the operation is important. There are operations that are done in…
-
1
votes1
answer351
viewsQ: How to start a process in spring-boot after injecting all the Beans and before you start listening to external events?
I am creating an application in Spring-Boot that for me is critical she recover her previous processing point before to start receiving new requests. For such, I have a table called PROCESSOS which…
-
2
votes2
answers104
viewsQ: How to return an integer when accessing an end-point?
I am trying to return a automatically created key in a spring-boot service (this one, by the way). I tried to directly return an integer by end-point: @RestController public class Controller {…
-
2
votes2
answers858
viewsA: How to check if a table exists using jdbc java
In my system, using NamedParameterJdbcTemplate Spring, I do this: public boolean tabelaExiste(String tableName) { HashMap<String, String> param = new HashMap<>(); param.put("table_name",…
-
2
votes2
answers67
viewsQ: How to programmatically rescue a newly inserted auto increment ID in JDBC?
I am saving a feature for time-consuming processing and must return your ID so the user can check its status in the future. The idea is that the user insert a set of data for import (for simplicity,…
-
3
votes1
answer1085
viewsA: How to define a composite key table in Sqlite?
I found it following the path of taming across of that other answer. Basically, if there is only one column belonging to the primary key, we can set the expression reserved PRIMARY KEY in the…
-
4
votes1
answer1085
viewsQ: How to define a composite key table in Sqlite?
I am making an embedded database as a field medium in the integration between two systems. The system A, where you have the data, export all your data to the system B already properly mapped.…
-
1
votes1
answer86
viewsA: Generate String from list contents
We went through a similar situation. How to generate the queryParam from a set of parameterizations? More specifically, from a set of keys and values? As I mentioned in the comment, I went through…
-
3
votes1
answer111
viewsQ: How to allocate in contiguous memory a structure that contains 1 vector with user defined size?
I was wondering how to answer this issue and I came to the conclusion that I would need a data structure with: the size of a set a previously reported size vector It would be something like the…
-
4
votes2
answers574
viewsA: Calculate Geometric Mean in SQL Query
I am glad that I was not the only person to go through the need of SQL production through Portuguese-speaking lands. As @Motta spoke in his confusing and unattractive response, you can use the fact…
-
5
votes3
answers150
viewsA: Json format is valid, but conceptually incorrect. How to argue?
A valid argument: "73317882484" is not part of any structure. The fields in a JSON object aim primarily to reflect structure. The structure consists of names, codes (such as CPF), other fields,…
jsonanswered Jefferson Quesado 22,370 -
17
votes1
answer429
viewsQ: How to identify the anti-standard TOCTOU? How to avoid/remove it?
I was reading an answer about transform vectors into lists in Java, when we comment the AIR directs me to the source codes of JDK9. There in the sources, I have the following comment: ListN(E...…
-
4
votes1
answer284
viewsA: Optional.ofNullable with ifPresent
There are some problems in the question. The first is language itself: "if ano is null but [...] year is filled". Okay, let’s assume it was a mistake and if you meant the third camp of Carro, the…
-
23
votes2
answers1397
viewsQ: How to calculate the value of a polynomial function at an arbitrary point?
I need to calculate the value of a polynomial function of arbitrary grade in arbitrary values of the realm. I would like to know how to do it in a way that is not naive when doing the floating point…
-
2
votes2
answers108
viewsQ: Does the use of the "alias-assignment" '->' operation interfere with the performance of the application?
In the descending languages of Clipper, there is an operator called "the alias. For example, I can take a field of one result set from that operator (example in ADVPL): cSQL += " SELECT " cSQL += "…
-
3
votes1
answer425
viewsA: What is the Pumping Lemma (or Pumping Lemma) ? And how to apply it?
What is the motto of pumping The motto of pumping is a condition sine qua non of regular/context-free languages (depending on which one you are using, of course). However, it is not a condition…
-
4
votes1
answer1014
viewsA: Difference between 'Regular language' for 'irregular language'
Well, I think the answer here may not be very pleasant, but it is the correct one: a regular language is one that can be generated by a regular grammar. And then what would a regular grammar be?…
-
8
votes1
answer517
viewsA: What’s Breadth First and Depth First?
Breadth first and Depth first are two similar but distinct search strategies. Normally you find the full term: BFS or DFS, where the S of the acronym means search. Its meanings are: breadth first…
-
5
votes1
answer254
viewsA: Two marbles and a 100-story building
I did a test here, on an idea similar to @Bacco’s. I got an average of 11 attempts, the best case being 2 pitches and the worst 20 pitches. I implemented the @Bacco resolution, but the results were…
algorithmanswered Jefferson Quesado 22,370 -
2
votes3
answers3749
viewsA: Problems with input results after using an "int()"
You thought that int(idade) would transform the variable idade in an integer, gives? Well, you just saw that that’s not what happened. The builder int(str) when receiving a string creates an object…
-
3
votes2
answers937
viewsQ: How to save a chart to a PNG image?
I have some data from an experiment, and would like to save them as PNG. To display the data, I simply do the show(). However, I would like to save directly as PNG not to print the screen. How do I…
-
2
votes1
answer408
viewsQ: How to concatenate one vector into the other elegantly in ADVPL?
I have two number vectors, aBuffer and aCandidato. Depending on a condition (external to the vector), I need aBuffer receive the content of aCandidato to work on it afterwards. aBuffer will be used…
-
1
votes2
answers65
viewsA: How to capture the action of a click on a title that is inside a container and that container is inside a scrollContainer?
An alternative to Reply from @J. Eric. With my own developmental addictions in Totalcross. Among things I code, I always look: use the components vanilla when you don’t need to change your behavior…
-
1
votes1
answer387
viewsA: Send xml via POST to API
You are passing the arguments in switched order. According to the documentation of the function in the TDN, the arguments are as follows, in that order: cUrl - endpoint (only mandatory argument)…
advplanswered Jefferson Quesado 22,370 -
6
votes1
answer1169
viewsA: Check that the graph is connected
Since doubt is about undirected graphs, I’m using it as a premise in my entire answer. Everything I write is valid for undirected graphs, except if you find some external reference that shows…
-
4
votes2
answers95
viewsA: Is doing unstable code commits in Git bad practice?
It’s not about good practice, but Kent Beck suggested the experimental scheme test && commit || revert. I didn’t get to try it, but the idea serves as a kind of Quick dojo to increase code…
gitanswered Jefferson Quesado 22,370 -
3
votes1
answer775
viewsQ: How do you read the ADVPL profiler report?
I recently asked a question about how to analyze the impact of a chunk of code on ADVPL. The big @siga0984 gave a great answer, and even with my little intimacy with Protheus I managed to connect…
-
2
votes3
answers1697
viewsA: Remove 2 specific characters from a String
The solution using the DecimalFormat is the most appropriate. However, if you want to treat using String purely, so we can use the replace with the appropriate regular expression pattern. He missed…
-
8
votes2
answers1222
viewsA: How to get out of git listing?
Welcome to less! A Unix pager that does more than more. You can do a lot of interesting things with the less, how to search for a regular expression with /. But if your interest is just getting off…
gitanswered Jefferson Quesado 22,370 -
4
votes1
answer322
viewsQ: What are the Jeps in Java?
I was watching the backlog of JDK 12 and saw that the amendments are all mentioned as Jeps. Inclusive, in the list of Features has "targeted Jeps for JDK 12 until then". From what I’ve seen, a JEP…
-
4
votes1
answer334
viewsA: Raw String Literals Java
JEP canceled The Openjdk team announced via Twitter in December/2018 that this JEP was canceled from Java 12. The official reasons were exposed here. It is worth noting that this functionality was…