Posts by Ricardo Pontual • 21,129 points
751 posts
-
0
votes1
answer32
viewsA: How to delete a column from multiple tables in Mysql?
In the mysql, the table "information_schema.Columns" has the record of all columns in all tables, if you make a select you will find the table names: SELECT TABLE_NAME FROM…
mysqlanswered Ricardo Pontual 21,129 -
0
votes1
answer16
viewsA: Change property value depending on your type
You can use Reflection for that reason. With Reflection it is possible to treat an object instance in a generic way, without knowing its type and analyzing its members (properties, methods, etc).…
-
0
votes1
answer20
viewsA: chronometer that starts on the button is on top of each other
You need to "finish" the previous timer before starting a new one using the clearInterval as already mentioned in the question. You can associate the timer with a variable to facilitate this, and…
-
2
votes1
answer20
viewsA: Group By of 1 Oracle SQL Column with latest date
"But select gives error in Group By and only runs if I put group by NU_TLFN" extamtente. When using GROUP BY all fields of SELECT shall be grouped or use aggregation functions such as SUM and MAX.…
-
0
votes1
answer27
viewsA: How to exchange the primary key of a table in Mysql
The problem is you’re using the field that is Primary key also as Foreign key, and gives error there. You will see the error if you try to drop/add a single command like this: ALTER TABLE Itens DROP…
-
1
votes1
answer46
viewsA: Remove row from a dynamic table with Javascript
In order to be able to remove a specific line it is necessary to pass to the function that will delete some reference. As the function is triggered, you can pass the button reference using this. So,…
-
2
votes1
answer63
viewsA: I can’t center text - CSS
The text of header is inside a tag H1, that does not occupy all the size of the header, add to it a width: 100% will work simply by using together a text-align: center: * { margin: 0%; padding: 0%;…
-
2
votes2
answers40
viewsA: Consultation with Count
You can do it that way: Group by product (GROUP BY ID_PRODUTO), this will allow you to check each product. Take only the records that the count is equal to 1, that have only 1 status (HAVING…
-
0
votes1
answer49
viewsA: Mysql event does not run at specified time
"starting on 18/07/2021" this must be the problem, if you try to create an event with a retroactive date it will not work, the STARTS should always be a later date. For example, at the time of this…
-
2
votes1
answer52
viewsA: Does accessing a variable outside the scope of the class go against SOLID principles?
As well noted in the question, the "Open/close" principle of "SOLID" may go against the use of members of global or public scope (public in most languages). What says the principle of "Open/close"?…
-
1
votes1
answer54
viewsA: Request Restsharp
This has happened to me, this mistake is not very clear, but the part that helps the most is this: System.Security.Permissions.Securitypermission The Zone of the Assembly that failed was: Mycomputer…
-
5
votes1
answer149
viewsA: What is the virtual data structure for in Dbeaver or Mysql?
Before that it is necessary to understand that to be virtual (or not), they need to be computed columns, that is, are values calculated from other columns. This feature is not only present in the…
-
0
votes1
answer43
viewsA: the identifier 'DMBS_OUTPUT.CHARARR' must be declared plsql oracle
"I am following the example of the book and everything is in agreement" if you are still have an error in this book and should report it. There is no dmbs_output the correct is dbms_output, there is…
-
0
votes1
answer88
viewsA: How many days a week (Monday, Tuesday...) do you have in a 1-month period?
That’s not very simple because of some things: It is necessary to group by dates, but there may be more than one record on the same date, so it is necessary to make a DISTINCT; To make a DISTINCT,…
-
2
votes1
answer28
viewsA: How to change the format of an object in javascript?
Your object has two arrays, the object itself and then "subpath", so you need to interact on the two. If you couldn’t understand reduce, maybe a forEach be simpler to understand: var lista = [ {…
javascriptanswered Ricardo Pontual 21,129 -
3
votes3
answers75
viewsA: Store data in DB vertically or horizontally?
By normalization using the normals forms (1F to 5F) its first model would not be "correctly normalized". The third normal form (3F), which is the form that moves the fields that are dependent on…
-
0
votes1
answer27
viewsA: Various Inner Join with Where SQL
The problem is that it is not respecting the order of the clauses SQL of command SELECT. You can add many JOINS, but the JOIN of this outside of your query is being done within clause FROM, that is,…
sqlanswered Ricardo Pontual 21,129 -
1
votes2
answers57
viewsA: What is the correct definition of concatenation and what really happens when we do this with variables?
Vinicius, your own questions and code answer for you: "Why the second output of data returned a sum of two variables of the real type?" See the code: pi+0.0015926 here no strings, there is a numeric…
-
0
votes1
answer46
viewsA: Problem when using isNaN
In the documentation of parseInt() explains why this: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt If parseint finds a character other than a numeral in…
javascriptanswered Ricardo Pontual 21,129 -
-2
votes2
answers36
viewsA: Compare two to two elements of a vector
Could do so: for i in range(1, len(vetor2)): if vetor2[i]==vetor2[i-1]: print(vetor2[i]) That is, starting from 1 (the first position is zero) and comparing with the previous (i-1) Or so, limiting…
python-3.xanswered Ricardo Pontual 21,129 -
1
votes2
answers55
viewsA: How to format the date and month so that they are typed 0 in their formatting (day or month that goes from 1 to 9)?
You can use the String.format using the "0nd" parameter, where n is the number of digits you should have. For example String.format("%02d", dia) will format "day" to 2 digits, completing with zero…
-
3
votes2
answers67
viewsA: Is there practical application in write-only properties?
There is some practical application in write-only properties? I honestly cannot see a really practical application. If you need to set something on some object and will do it only once could use a…
-
-2
votes1
answer48
viewsA: I can’t use strcmp in C
As I put in the comment, you’re using scanf("%s", & alunos[i].inf); outside the for, that is, will read a value in "i" with the last value of for and that comparison won’t work. The searched…
-
0
votes1
answer30
viewsA: Query in different columns at the same time in Mysql
He’s a little confused but from what I understand I could say that return records where the value of "column1" also exists in "colonnade 2" and vice versa For that you need to use the EXISTS, who…
-
1
votes1
answer36
viewsA: Mega API Client: Cancellationtoken at Downloadfileasync
A CancelationToken is an object used to notify a thread that the code that started the process wants to cancel. As a thread is an asynchronous process, the code that starts "loses" control over it,…
-
2
votes1
answer43
viewsA: Time mask HH:MM from a number type field using oracle sql for reporting
If you have a field number, for example 1522 would be "15:22", you can convert the number to string with TO_CHAR and use SUBSTR to pick up the time and minutes digits, like this:…
-
1
votes1
answer44
viewsA: Doubt with "minor" in Visualg
Let’s go to some stitches: In your code all numeric variables are real, but ages are whole, so you can use inteiro: Note that you have 2x the same conditional Se (sexo="M") entao, can combine this…
visualganswered Ricardo Pontual 21,129 -
2
votes3
answers105
viewsA: How to create listeners for multiple elements in a loop?
The issue here is not "creating a jQuery loop", but "creating a Javascript loop". The fact that using jQuery does not make you have a specific implementation, just using the Javascript structure is…
-
1
votes2
answers39
viewsA: Show data set with SELECT
"the error that is an ambiguous list" that means, some field you have in charge, is in the SELECT, WHERE, ORDER BY or GROUP BY exists in more than one table with the same name. In this case it is…
-
1
votes1
answer35
viewsA: Pure Javascript: Multiply tds values in a table and return the value
The way you’re using the for perhaps not the best, the best would be to do the for for each line, to ensure that it picks up the values of the line, but first let’s see what happens in your code: is…
-
1
votes1
answer31
viewsA: Problems with ORDER BY in MY SQL search
The LIKE doesn’t help much in this, so a solution would be: Make two different queries and use UNION to join the results, and with a "priority column"; Sort by that priority. I can’t mount a…
-
0
votes2
answers43
viewsA: How to calculate the cumulative sum/subtraction of previous records in SQL?
You can use the function SUM for this, combining with the CASE WHEN for: CASE type_movement = 'E' sum "value" ELSE (accounting case) sum "- value", that is, subtract when it is "S" Here an example…
-
3
votes2
answers63
viewsA: Infinity C loop array
First your loop should not be infinite if you are reading values for the array "n", which has 30 positions, this should be the size/duration/number of interactions of your loop. Some considerations:…
-
2
votes1
answer32
viewsA: What’s the difference between using getBoundingClientRect() and Intersection Observer to see if the element is visible on the screen
Although I can use to observe some information about a rectangular area, they are quite different Following the documentation of getBoundingClientRect() here:…
javascriptanswered Ricardo Pontual 21,129 -
1
votes2
answers40
viewsA: Why is my vector ordered if I am ordering in a function (void) without any return?
C-language arrays are treated as pointers. This means that a variable of the array type "points" to the first element of the array. In this case, when you pass an array per parameter you are…
-
0
votes1
answer12
viewsA: Fill a vector using useDelimiter in Java
If you want to read the string at once and separate the values do not need to use the useDelimiter, can use the split to separate the string in an array. In the example below I do this, generating a…
-
-1
votes2
answers36
viewsA: Show input field depending on radio button selection
You need to study html and javascript more, because there are many simple problems in the code: <radio id="def"> there is no "radio" element, except that the way it was defined would still…
-
1
votes2
answers43
viewsA: How to deserialize JSON Array in an Object Array?
I used the structure like this: public class Request { public string tipo { get; set; } public string descricao { get; set; } public string url { get; set; } } public class Produto { public int…
-
2
votes1
answer32
viewsA: Pass database and table as parameters to process
You can create a dynamic query with the parameters and run with EXEC(), so for example: CREATE PROCEDURE dbo.sp_DR @bd NVARCHAR(20), @VAL AS INT AS DECLARE @COMANDO nvarchar(1000) SET @COMANDO =…
-
0
votes1
answer20
viewsA: Simple GET Request
I tried to replicate the problem and it didn’t happen, it works correctly. Since you don’t have all your code, I don’t know if something is missing, see below: var url =…
-
2
votes2
answers57
viewsA: Add and remove rows in a table
By making that line: $("#riscos").append("<div>"+$("#riscoform").html()+"</div>"); is cloning whatever is in the div "riscoform". Note that right at the beginning has a table with ID,…
-
3
votes1
answer22
viewsA: Calculate value difference from same column after sum with condition
You can do it using one CASE WHEN within the SUM, returning "value statement" when "type statement" is equal to 'e' and "value statement * -1" otherwise, which will add and subtract: SELECT SUM(CASE…
mysqlanswered Ricardo Pontual 21,129 -
1
votes1
answer18
viewsA: How to do an event in more than one box/button/label at the same time?
Events are recorded in the class NomeDoForm.Designer.cs, for example if the form is called Form1, it has a file "Form1.Cs" and there will be the "Form1.Designer.Cs". If you open this class, you will…
c#answered Ricardo Pontual 21,129 -
3
votes1
answer60
viewsA: HTML table inside another table in a foreach in PHP
The element <table> can be inserted into another table, within an element <td>, so I could do something like this: <table border="1"> <thead> <tr>…
-
3
votes1
answer31
viewsA: How do I change the position of two names in the table using up and down buttons?
Basically you need to find the reference of the TR, because you want to move the whole line, then find the reference of the previous or next line and move the TR. If you have a button, it will be…
-
2
votes3
answers81
viewsA: Is it possible to use functions in an arbitrary order in C++?
In C it is only possible to use a member that has already been declared, it would be a similar mistake to do so: x = 10; int x; Hence, the compiler when finding a member (variable, Function,…
-
1
votes1
answer24
viewsA: For each field that is created add a value
Why not assign value to the element that was cloned before making the append? This will already add the ready element, and in addition, you can declare the variable "destination" only once before…
-
2
votes1
answer36
viewsA: Js click event, change div
A simpler way to do this is to create a style that hides the div, and use the method toggle from the class list of the element, it adds a class if it does not exist, or removes if it already exists,…
javascriptanswered Ricardo Pontual 21,129 -
4
votes2
answers55
viewsA: What is the Bufferedstream of C#?
Following the documentation here: https://docs.microsoft.com/pt-br/dotnet/api/system.io.bufferedstream Add a buffer storage layer to read and write transactions in another flow .... A buffer is a…
-
1
votes2
answers47
viewsA: How to check the id of an item in a class in Javascript?
Before answering your question, let me make a few remarks about her and her code: I don’t know if it was a typo, but you’re not closing the quotes on the attribute class, should be class="figuras";…