Posts by Jefferson Quesado • 22,370 points
421 posts
-
2
votes1
answer681
viewsA: Mutually exclusive relationship (MER)
Multiplexing of "foreign key" Each form has its advantages and disadvantages, obviously. Decide which is the best I believe you should do in your application, provided you have knowledge basis to be…
-
5
votes2
answers454
viewsQ: Jenkins slave build with JDK not previously installed
I have a Jenkins server that orchestrates my build. Overall, it performs lighter builds, but I need the slave to build GWT projects by SSD. I have some freedom with that slave, but he is a resource…
jenkinsasked Jefferson Quesado 22,370 -
12
votes2
answers430
viewsA: Deadlock at Conceptual Design Level, Entity-Relationship Modeling (MER)
You can accept the eventual inconsistency in a physical modeling [0,N] as in the Reply from @Victorstafusa. Or use a database that accepts inconsistencies in the middle of transactions. This option…
-
1
votes6
answers1851
viewsA: Interlink two strings into one vector
Observing the care that the @Maniero quoted and its related links, as well as the observations of reply from @mercador, I decided to put a pointer-based response. The idea is to navigate with the…
-
4
votes2
answers503
viewsA: How to write numbers between 0 and 10 to a file
To reply from @Caiqueromero attacked the problem in a way that I consider unexpected, but very good. He also talks about the other things related to opening files and left great reading references.…
canswered Jefferson Quesado 22,370 -
8
votes5
answers2539
viewsA: Regex to check if string does not end with certain characters
Who accompanies me here at Sopt knows that I do not enjoy much functionalities other than those provided for regular languages. To reply provided by @nunks.lol uses the Negative lookbehind, which is…
-
2
votes2
answers841
viewsA: Replace "[" with [ using sed
It’s full of little problems in your line of code. The argument passed to sed is being interpreted by bash, which may result in unexpected effects [ is the list metacharacter (or linked list if used…
-
0
votes1
answer186
viewsA: Error inserting Image in Readme.Md in bitbucket
Some possible troublesome points I saw in your question, but which may not mean anything: switched extension; the system expects to find .md for markdown, nay .dm URL with spaces, would need to…
-
24
votes5
answers8920
viewsQ: What is the difference between Visualg and Portugol?
I see here a great rummage in the tags visualg and portugol. By the tag wiki, it seems that Visualg would be the interpreter and Portugol would be the language itself. Visualg is regarded as a…
-
4
votes2
answers62
viewsA: Incorrect Printed Form Values
There are several errors, probably a mix of conventions without you have noticed: i never zero, so never start the values of menor nor of maior The value of soma is not initialized, so loads memory…
-
4
votes1
answer173
viewsA: Sqlite - Too Many levels of Trigger recursion
The problem is in trigger of update. The update will generate the firing of trigger, then you will be doomed to an infinite loop if you do not treat correctly. Maybe the following works (ignores…
-
5
votes1
answer326
viewsA: Solve polynomial between two values interval
We will solve your problem step by step. First, let’s see the use of range. Let’s look at the documentation and... For life, it only accepts integer numbers! This function accepts up to 3 parameters…
pythonanswered Jefferson Quesado 22,370 -
4
votes1
answer251
viewsA: How to reference instance variable with the same name as a local variable in C++?
In C++, there is a keyword this. It is reserved for contexts where an object is having its method run. That one this behaves like a constant, constant that is a pointer to the class from which the…
-
10
votes1
answer606
viewsA: Doubt with signaled binary sum
In fact, the result obtained is the right one (assuming complement of 2 , as perceived by @Isac). But it’s not -5, and yes -27. But if you assume magnitude sign (see below), the binary you got would…
-
2
votes4
answers229
viewsA: Is overloading methods less performatic?
On performance in Java method calls, first I would say not to worry so strongly about the subject, to leave to worry when the performance is a real bottleneck. Secondly, I would say that your…
-
5
votes2
answers427
viewsA: Free() in struct with char array
You can use a macro if you are careful. The use of macros is subject to criticism, not to mention that using carelessly will produce wrong results. Look that question on Soen to understand how…
-
2
votes4
answers8945
viewsA: What’s the importance of indenting the code?
To reply from @Victor deals perfectly with languages Curly bracketed, others focus on more conceptual issues In Python, bad code is not even valid code: # inválido if marmota: marmotante()…
indentationanswered Jefferson Quesado 22,370 -
15
votes4
answers359
viewsA: Output a C code with pointers
to reply by @Maniero has a more explanatory bias of the operations, this mine has a bias of how the operations are made, without further details p ==> 6487628: this is the address of i in memory…
-
0
votes3
answers88
viewsA: Problem receiving random integer values in array
In the existing responses, I missed cohesion in the code. From the page of disambiguation of the entry Cohesion, in Wikipedia in English, we can see that cohesion is a "measure of relationship…
-
21
votes4
answers3943
viewsA: Calculate mail freight for various products
About the packaging The main difficulty point I saw in your question was when sending the package dimensions. I will do in 2D to simplify. Imagine you want to send two Sugar Union: It has dimension…
-
4
votes3
answers1680
viewsA: How to put a whole word inside a char?
Do you know the difference between character and string? The type char is a character, so it only accepts scalar information. You want vector information, you should use a string for this case. In…
canswered Jefferson Quesado 22,370 -
4
votes1
answer1148
viewsA: How to call different methods in different Switch Case conditions?
You call the code normally, as if it were in the body of a method: case 1: fifoMethod(); break; case 2: lruMethod(); break; ... Note that the switch requires you to have a destination point of the…
-
1
votes1
answer849
viewsA: Switch chained list pointers - python
You wish to do an operation of swap. The swap is an operation which, given an indexable set and two indices, changes the time-consuming elements of these indices. Foreplay Let’s call the indexable…
-
1
votes2
answers646
viewsA: What is wrong with my Thread ultilizando Synchronized - Java
I won’t stay long because I think reply from @romarcio explains very well. I would just like to leave other alternatives. Class method Instead of attaching the method to the instance, one could…
-
4
votes2
answers52
viewsA: How to play a list that skips the numbers according to the number typed
You can use list comprehension for this question, much more idiomatic: [ i**2 for i in range(5) ]
python-3.xanswered Jefferson Quesado 22,370 -
9
votes2
answers334
viewsA: Regex validating only normal and leap years in C++
You got the gun, I give you the ammo, but you decide whether to shoot yourself in the leg or not. I come here to offer you the regex that recognizes leap years, does not do everything as the reply…
-
1
votes2
answers212
viewsA: Recursive algorithm does not work
Please print the numbers from 0 to n, n provided, which are divisible by 2 and 3 simultaneously. As @Maniero realized, it needs to be multiple of 6. Since the question says nothing about storing in…
-
22
votes2
answers383
viewsA: Is gamification the same as competition?
Not always. Making playful through competition is one of the options available. To be honest, I’m competitive, so I’m easily hooked on this lure. If in the gamification chosen the points system is…
-
3
votes1
answer1775
viewsQ: How to turn a context-free grammar into a stack automaton?
I have a grammar, like for example: Or else: Or even that: Or this grammar, which represents the boolean logic for three variables: How to turn these grammars into stack automata? Would have some…
-
2
votes1
answer1775
viewsA: How to turn a context-free grammar into a stack automaton?
There is an algorithm that allows you to do just that, turn any grammar into a nondeterministic stack automaton. The idea is that all grammatical production consumes at most an element of the input…
-
4
votes2
answers255
viewsA: Possibility challenge in c,c++ or Matlab
The equation to which you want to find the roots is: x * y = 1700/57 You need, for your solution space, two real numbers x and y. But x and y are not any real numbers, they are positive reals and…
-
4
votes3
answers1178
viewsA: What is the difference in use between the Matcher() and find() methods?
Let’s get the wedding expression (bb|([^b].|b[^b]))*. This expression can be understood as "two bê or not two bê" applied to kleene star. Kleene star, tl;dr: repetition of the element quantified by…
-
0
votes1
answer167
viewsA: How to generate directory list and perform actions for each list item?
Quick response for d in /Volumes/*; do if [ "$d" != "/Volumes/Preboot" -a "$d" != "/Volumes/Macintosh H" ]; then itera "$d"; fi; done Explanation for will iterate over a given set of words. In this…
bashanswered Jefferson Quesado 22,370 -
3
votes2
answers3400
viewsA: Error: Unable to create 'C:/Myproject/. git/index.lock': File exists
A repository git is a specific use database. It maintains commits (its main data structure), branchs (containing name and reference to a commit) and tags (contains the same information as a branch).…
-
8
votes3
answers454
viewsA: Loop of repetition in C
Esoteric strategies To Reply from @Ruy Neto deals with the main. But the question is not limited to practical resolutions, it resembles another exercise. Since it is an exercise, let’s exercise?…
-
3
votes2
answers218
viewsA: Could someone help me with this formal language?
The following grammar is enough to recognize this language: This grammar generates words incrementally, always increasing a a and one or two bs in a self-nested way. This grammar is a context-free…
computer-theoryanswered Jefferson Quesado 22,370 -
23
votes1
answer1194
viewsQ: Regular expression to recognize language: words that do not contain "bbab"
The @LINQ challenged me to write a regular expression to recognize the following language L: I was able to assemble, on this premise, the following finite state machine: the Miguel Angelo detected a…
-
3
votes1
answer77
viewsQ: Is there inclusion mapping for ' #include "cmylib" '?
Reading that question, there is talk of the inclusion of headers in c++. In the answer accepted, section #include <filename>, the author speaks the following: it is common to have these names…
-
7
votes4
answers13368
viewsA: What are files with extension . cpp and . h?
Archives .cpp are the files that contain the C++ implementations fonts. Files .h are called headers, used to extract the declaration of functions, classes and other statements from the…
-
2
votes1
answer1116
viewsA: Visualg - 5 larger issues
Your writing is bad. Did not make clear what the expected result, nor what was your doubt. I think you’re wondering how to sort the variables n1 until n5 to print them. Correct? Well, this is a…
-
3
votes1
answer420
viewsA: Time complexity of recursive palindromic algorithm
To demonstrate a formula derived from recurrence, you need the conjecture (the derived formula defined above, which we want to prove) and 3 other features: Recurring formula; Basis of the recursion;…
-
1
votes2
answers928
viewsA: Segmentation failure (recorded core image)
You forgot to allocate p->c in the creative function of Pilhas, the pilha_cria. Since this value is coming from a crudely allocated memory area, it will necessarily have memory junk. Occasionally…
-
10
votes2
answers489
viewsA: Can a regular expression become Assembly?
To answer your question, A regular expression can become Assembly?, we need to understand 2 concepts a priori: regular expression Assembly Regular expression I am not taking as a basis modern…
-
12
votes8
answers4394
viewsA: How to identify "Capicua" numbers that have 5 digits?
I can define a word as being a set of tuples formed by character/position. Thus, the word banana would have the following mathematical representation: { ('b',0), ('a',1), ('n',2), ('a',3), ('n',4),…
-
3
votes2
answers300
viewsA: heuristica h(n)=0 is permissible for algorithm A*
On the heuristic, if you put h(n) = 0, this implies that there will be no guided search. Without heuristics, there are no search optimizations. So yes, it is plausible that you put the heuristic…
artificial-intelligenceanswered Jefferson Quesado 22,370 -
0
votes2
answers336
viewsA: Width Search - error: 'str_no' undeclared (first use in this Function)
The first point here is: what is a struct str_no? At the moment, the compiler has no idea what it is. How are you trying to create an array with tamanho elements, the compiler will take an…
-
4
votes2
answers2523
viewsA: SQL - Merge order table and products
You find yourself in a typical relationship n,m. In this case, your problem of products included in sales is the same problem of students enrolled in disciplines: In this case, the above scheme is…
mysqlanswered Jefferson Quesado 22,370 -
3
votes1
answer982
viewsA: Two GIT Projects
This was a necessity in the work, I had to join some repositories. I adapted what is in this answer, to remedy my problem. Thanks to AP for discovering the original link I had lost Know that you…
-
16
votes8
answers4394
viewsA: How to identify "Capicua" numbers that have 5 digits?
To be Picua, just separate all digits and compare the digit d_a with its complement d_(5-a+1). Note that the middle digit is ignored because it is equal to itself. Consider // the entire split…
-
2
votes2
answers81
viewsA: (Error of Segmentation fault)
It was a little careless. In strlen, the value of i is not initialized. The following code corrects: int strlen(char *s) { int i = 0; while(s[i]) { i++; } return i; } Like i not initialized, it…