Posts by Jefferson Quesado • 22,370 points
421 posts
-
4
votes2
answers109
viewsA: Calculation of T(n)
This algorithm presented is very similarread observation at the end of the reply an implementation of the algorithm to calculate the number n of the Fibonacci sequence, which in turn has linear…
-
2
votes4
answers131
viewsA: MAX with LIMIT does not give the correct result
They have already presented the best solutions. But you can solve only with junctions your problem: SELECT a1.nome, a1.idade FROM pessoas a1 LEFT JOIN pessoas a2 on a1.idade < a2.idade WHERE…
-
9
votes1
answer348
viewsA: Git - Ignoring files with . gitignore
You know you can put the .gitignore in any sub-folder of the project git? It took me a few years to figure that out, and I was happy with the discovery. The first case, pasta/, does not require the…
gitanswered Jefferson Quesado 22,370 -
3
votes1
answer241
viewsA: Split Array into Multiple Threads
You can do through a stream in parallel. But for this, it is first necessary to "hide" the exception to a RuntimeException (read more). Let’s put a TEN that loads UnknownHostException or…
-
1
votes0
answers290
viewsQ: How to prevent ADVPL’s Httppost from printing the payload in the log file?
I am doing a routine of sending information from Protheus to my system. To send the information, I am using the function HttpPost, and send an update data package. Each request sends, only payload,…
advplasked Jefferson Quesado 22,370 -
10
votes1
answer328
viewsQ: How to analyze the performance impact of a code snippet in ADVPL?
I have the following code in ADVPL: Static Function linhaJson(cTabela, cChave, lVerificaExclusao) local cTipo local xResult local cJson := "{" dbSelectArea("ZX1") ZX1->(dbSetOrder(1))…
-
1
votes2
answers71
viewsA: When to use these commands?
getch is a function derived from conio.h. It reads the key pressed by the user. One day, conio.h may even have been something worthy and hand on the wheel, but please don’t use anymore. system is a…
canswered Jefferson Quesado 22,370 -
1
votes2
answers321
viewsA: How to place an integer at the end of a string?
Just to give more possibilities to the solutions presented by @Isac. Alternative use of sprintf int main() { char prefixo[3] = {'E','0'}; char ent[4];//se quiser números com 2 casas decimais, basta…
-
4
votes1
answer1091
viewsA: Best way to go through a Hashset
Normally I would recommend going by the loop for-each traditional. It solves much of what you normally want when you go through a collection. Of course, there are some exceptions. And there are also…
-
1
votes2
answers116
viewsA: Is there anything in ADVPL equivalent to Java lambda function?
It exists, it’s called a code block (block code). You can see a code block usage in the following example: // arquivo Test1.prw static function apendar(aArray, cStr) // se o threshold for 2: if…
-
3
votes2
answers116
viewsQ: Is there anything in ADVPL equivalent to Java lambda function?
I am maintaining an ADVPL project. In it, I have some source files. Among these sources, I have an information miner in the GEO1 file and a communicator of the information mined in the GEO3 file. In…
-
5
votes2
answers162
viewsA: Filter common elements in two Arrangements
In case you wish "common elements" discards me the possibility of thinking in arrangement. By the concept that I am accustomed to arrangement order matters. At an intersection, order is totally…
javaanswered Jefferson Quesado 22,370 -
2
votes3
answers115
viewsA: totalcross application with images, when deploying for windows CE does not work
I know you already solved your problem, but it costs nothing to explain what happened for future reference. The images were reachable in Java code. This means that they were in the classpath…
-
4
votes2
answers580
viewsQ: How to create an optional parameter in ADVPL?
In several functions documented by Totvs there are optional parameters. I would like to create an optional parameter in my function, how to do? I’m wanting to make the function updEnvio receive a…
-
4
votes4
answers278
viewsA: What is the Java command that returns the uppercase characters?
In the title of the question is to take only the uppercase letters of the words. In the example in the body of the text has spacings, but I am with the @André Filipe. You can use regular expressions…
javaanswered Jefferson Quesado 22,370 -
5
votes2
answers1116
viewsQ: What are the scopes of the variables in the ADVPL and when to use each one?
I am taking a code from a colleague to give maintenance. I find myself with this code here: Static Function Conv2Json(cCpo) Local cRet := "" Local cSeparador := "" aCpo := StrtoKArr(cCpo, ';')…
-
14
votes0
answers398
viewsQ: How to make ajax calls through reverse proxy in elegant way?
I have a project that validates, in Javascript, the structure of a JSON. Here is more or less the structure I had used to rescue the structure asynchronously, as well as what would be the static…
-
4
votes3
answers12436
viewsA: What are recorders and what is their basic functioning?
What are Registers? Are pieces of logic circuits of specific end capable of storing values to be worked out next. You can have whole, floating point registers with 16, 32, 64 bits (other bites are…
assemblyanswered Jefferson Quesado 22,370 -
11
votes3
answers1181
viewsA: Is GIT Staging Area useless?
Let’s start by analyzing the names? staging area: area to cast In this part, you’re putting together a cast, but you don’t have it yet. You are still calling the "actors" who will "participate in…
gitanswered Jefferson Quesado 22,370 -
2
votes1
answer42
viewsA: Number of co-occurrences in a matrix
Your if has already been designed for it to run only on a part of the domain matrix. Consider that your domain consists of the following matrix: d s s s s i d s s s i i d s s i i i d s i i i i d…
algorithmanswered Jefferson Quesado 22,370 -
3
votes1
answer77
viewsQ: Is there an alternative in Javascript similar to Java 8’s "flatMap"?
I need to do an element mapping that returns a vector to me. However, I am already doing a job on top of a array, then the simple map will return me a vector containing vectors. In this case, I have…
javascriptasked Jefferson Quesado 22,370 -
2
votes4
answers2189
viewsA: Sum of primes in a range in C
We can tackle the issue with a little more mathematics, so we can use other concepts of programming. In this one, let’s take advantage of the fact that it is possible (and efficient) to pre-compute…
-
2
votes1
answer45
viewsA: Helps with understanding cellular automaton code
It bit by bit encoded the "neighbors". In bit 2 (value 4), placed neighbor on the left: 4*L_ant[n-1] In bit 1 (value 2), put the current value: 2*L_ant[n] Already in bit 0 (value 1), put the…
-
11
votes1
answer252
viewsQ: In a map/reduce in Java, should the accumulation operation generate a new object? Or can I use the old one?
I have an application that creates several objects on top of a stream of functions. And then I collect all these generated objects in a accumulator. For example, if I generated strings and…
-
17
votes2
answers2682
viewsA: Is it possible to declare Unknowns in Python to calculate constants of a Mathematical function?
What you’re looking for is something that solves linear system. This answer will be written in a generic way, it can be applied in any function whose thick form is known. In this case, the examples…
-
15
votes2
answers160
viewsQ: What are "weak references"? When to use them?
In managed memory environments like Java, Python and Javascript, I’ve read something about weak references (WeakRef). I read that it had something to do with detecting the objects that can be…
-
2
votes1
answer428
viewsA: Is there a standard for key naming of a JSON?
There are no limitations to the JSON key, it is a string. Section 7 of the RFC defines what is string, while the section 4 defines that a member is composed of <string> <separador>…
-
10
votes3
answers129
viewsA: Why are Javascript objects not always JSON?
JSON is a notation. In this case, it aims to serialize and deserialize information. It is not an object in the sense of possessing behaviors, it is more a raw structure. It would be something…
-
4
votes1
answer326
viewsA: Reduce grammars in the Chomsky hierarchy
In the Chomsky hierarchy, we have the following grammars, from the simplest to the most powerful: Regular grammar Grammar free of context Grammar sensitive to context Unrestricted grammar Curiosity:…
-
1
votes1
answer259
viewsA: Opening merge request in Gitlab via Curl
As well indicated by the user @Noobsaibot in comment on the question, there is a publication on Gitlab blog just on that subject. Specific like that. Look at the title in free translation: How to…
-
3
votes1
answer259
viewsQ: Opening merge request in Gitlab via Curl
Where I work, we use a variation of Gitflow in which, when a hotfix enters the product code, there is only the merge to the master which, when approved, we propagate to the develop through the…
-
8
votes4
answers2189
viewsA: Sum of primes in a range in C
We can tackle the issue with a little more mathematics, so we can use other concepts of programming. In this one, let’s abuse the fact that pure functions may suffer memoisation. In short: pure…
-
8
votes1
answer83
viewsQ: Is there a property in Maven to access the "Resources" directory value?
Issue-based https://stackoverflow.com/q/9216557/4438007 I know I can use ${project.build.sourceDirectory} to access my source file directory. If I want to access the resource files directory, the…
-
7
votes2
answers144
viewsQ: "Hello, world" with Wish TCL/TK, how to change the text of a widget?
I’m having trouble understanding how the program works wish, to make a good old "Hello, World". For those who don’t know what the wish, it is a TCL interpreter ready to make graphical interfaces in…
untaggedasked Jefferson Quesado 22,370 -
4
votes1
answer52
viewsQ: Push a tag to the remote
I need to push to my remote repository a single tag, v0.0.1. I know there’s a git push --tags, but this command, as per your documentation, pushes all tags. What is the command to push a single tag…
gitasked Jefferson Quesado 22,370 -
5
votes1
answer511
viewsA: Arithmetic error from 20 decimal places in C
This is a competitive programming problem. Whoever does this kind of problem knows which algorithm you need to use to solve it. And try to row against the current, solve the problem in a different…
canswered Jefferson Quesado 22,370 -
12
votes1
answer1046
viewsA: What are the differences between Treeset, Hashset and Linkedhashset?
What changes are the internal structures. Some give more guarantees than others. I won’t go into details of what a Set, does not seem to be the purpose of the question. TreeSet Only applies to…
-
4
votes1
answer1036
viewsA: How Workflow Works with Pull Request
There are some levels to give an answer that I consider appropriate to your question: what is the pull request? which gains to use pull request? we often see this in portals that work on git, as…
-
5
votes1
answer64
viewsQ: How to know if the list contains so many elements that meet and do not meet a condition, using stream?
I have a list of columns, I need to know if this list contains both columns that are keys and columns that are not keys. I guarantee the existence of at least one column on the list My class of…
-
3
votes2
answers302
viewsA: Doubt FILE in . h
First of all, we need to know the compilation cycle of a C source file. Basically, it goes through the following stages: preprocessor compilation for object linkediting The linkediting process takes…
canswered Jefferson Quesado 22,370 -
0
votes1
answer353
viewsA: Can I set up Gitlab-CI to only run a particular job with a branch name Pattern?
According to the documentation, yes, it is possible. Read to detailed documentation In addition to keywords (such as branches and tags), you can specify the name of the branch Verbatim. In the…
-
5
votes2
answers972
viewsA: How to use Stream.reduce() appropriately
To accepted answer already answers what is important to know about the question. However, I still felt a loose gap: and how would be using reduce? Foreplay To begin with, we need to understand what…
-
8
votes3
answers1436
viewsA: What is the fastest way to calculate the sequence of Fibonacci
First point, we need to know the behavior of the function to calculate Fibonacci of a number. We have several alternatives. First, start with the recursive definition of the Fibonacci function: def…
-
1
votes5
answers1659
viewsA: What is the best way to pass data between php files
Your architecture is a mess! Let’s go in parts, before, understanding of HTTP: the client makes a request the server receives this request the server processes this request ... still processing...…
-
3
votes1
answer495
viewsA: "<<<<<<< HEAD" in the middle of the code after merging
This is the indicator of conflict. If you give a git status you may find that you are in the middle of a conflict resolution yet. Or if you are not... it means you have made a mess. It means that…
gitanswered Jefferson Quesado 22,370 -
2
votes1
answer1086
viewsA: Passing a list of arguments to a Jasper Reports query
The part of .jrxml is correct. The use of expansion $X{} was done in an appropriate way. But the receipt of the form was not done in an appropriate manner. In the javadoc of @RequestParam has the…
-
1
votes1
answer655
viewsA: git fetch: "inflate: data stream error" and "SHA1 COLLISION FOUND WITH"
I tried to recover the repository that had given problem at the time of the opening of the call. It turned out that I had altered it a bit, but I took a backup after a few attempts to try to study…
gitanswered Jefferson Quesado 22,370 -
1
votes1
answer305
viewsA: java.sql.Sqlexception: Can not Issue data Manipulation statements with executeQuery()
Diego Schmidt found another bug in his code in the comment he made, but it wasn’t his bug yet. After fixing the issue bug, your data would not be updated, or would give an error when entering null,…
-
3
votes1
answer121
viewsQ: Mbean named conflict when climbing two Spring Boot applications in the same Tomcat
I have two applications in Spring Boot that use a common nomenclature for Beans. In case, man pool of connections to the database is managed by Hikaricp. Due to an infrastructure problem, I had to…
-
4
votes1
answer121
viewsA: Mbean named conflict when climbing two Spring Boot applications in the same Tomcat
Yes. By setting the JMX domain name you get a kind of "isolation" by setting a JMX domain name. You can check the property spring.jmx.default-domain in the documentation. This response in the…