Posts by Ricardo Pontual • 21,129 points
751 posts
-
0
votes2
answers224
viewsA: Save legacy data in C#
Yes you need to create another "Dao" and also another table. See that the inheritance works well, turns out that in your Dao you a list of Aluno, and he accepts a AlunoTecnologico because this…
-
0
votes1
answer109
viewsA: Help with DBMS_STATS.GATHER_TABLE_STATS - Oracle for DB2
DBMS_STATS is a command package of oracle that does not exist in the db/2. In your query, you are using DBMS_STATS.GATHER_TABLE_STATS, that the goal is to optimize the query with statistics, so in…
-
0
votes1
answer798
viewsA: How to read values from an html table with js
Your code is using jQuery, so you don’t have to mix up some stuff like that line: var lista = document.getElementById('tbLista').rows;, that may simply be so: var lista = $('#tbLista').rows;. As for…
-
2
votes2
answers66
viewsA: Cost of using exceptions with PHP and Valueobjects
If you are using in Exception for what he should be using, ie exceptions, have no reason to worry about perfomance. The idea is to treat the code as much as possible to avoid errors (testing null…
-
1
votes1
answer30
viewsA: Array saving only the last inserted value (PYTHON)
Writing like this: process = [ this overriding the array, that is, each time you run this line, the array is created with an element, and in your case it displays only the last one. To add a new…
pythonanswered Ricardo Pontual 21,129 -
7
votes1
answer40
viewsA: How to insert an element into an array[]?
If it is an array you should not concatenate other things into the array, you need to use a positional or push a new item, for example: array_push($boletos, ["numero" => $i, "date" =>…
-
0
votes1
answer50
viewsA: How to view a whitelabel project?
Yes this is possible by defining a strategy for the file or a folder. For example, imagine that in your project there is a client logo that you want to preserve in the merge, and that is in the…
gitanswered Ricardo Pontual 21,129 -
2
votes1
answer1094
viewsA: What is Batch Script?
A batch file is a term for a "batch" file, meaning that it contains a lot of information to be processed. It’s an old term, it’s not necessarily associated with a program or script, it can be a lot…
-
2
votes1
answer135
viewsA: System.Argued tofrangeexception how to solve?
If you’re declaring a List should not treat as if it were an array, stating the index ([0], etc.), the list works differently, treat this way: var conexao = new List<string>() { "127.0.0.1",…
c#answered Ricardo Pontual 21,129 -
0
votes1
answer34
viewsA: SQL Insert when Inserted but Skip Duplicate
You can include a clause where validating whether it already exists, for example with not exists: INSERT INTO [BILLING].dbo.tbl_UserStatus (id, Status, DTStartPrem, DTEndPrem, Cash, Bonus) SELECT…
-
1
votes2
answers524
viewsA: Validate Form Jquery
First your field is not invalid, then even with all the code would work. You need to handle the event of the click on the Submit button, for that I associated the event with "on" in the Document,…
-
3
votes2
answers143
viewsA: Is there an advantage in languages that package (.dll, .class, .exe) for scripting languages (.php, .py, .js)?
Everything has advantages and disadvantages, and many aspects can be analyzed, but I will focus on the security approach, which seems to be your main concern. From this point, there is the advantage…
-
0
votes3
answers1262
viewsA: Hide a div and show another
A simple way would be to hide all the Ivs you want and then treat only what was clicked. There are several ways to do this, but to bring the code closer to yours and make it easy to understand, this…
-
4
votes1
answer49
viewsA: How do I work with git when there are problems with the production version?
The way I think it’s safer is by using git reset --hard and passing the commit hash before the commit with issue. To do this, first discover the commit hash, using git reflog, that will generate…
gitanswered Ricardo Pontual 21,129 -
2
votes1
answer69
viewsA: NODE.JS MSSQL use SQL NEWID() function as a variable value
NEWID() is an internal function of sql-server, it cannot be used being processed in the code like this: req.input('chave', sql.VarChar, 'NEWID()'); To use it, include it directly in the SQL command:…
-
2
votes1
answer72
viewsA: SQL - Decimal out of range
DECIMAL(5,3) means that the maximum size is 5, being 3 decimal digits, that is, the maximum value is 99.999. If you need 5 digits and 3 decimals, then you need 8 digits: DECIMAL(8,3) See the…
-
4
votes1
answer117
viewsA: How to change the color when clicking?
You can create two css classes: classeX, with background-color: greenand classeO with background-color: green, and, in Function render(), which is the one that generates the table, add the class…
-
2
votes1
answer103
viewsA: Why does the model return null after using Automapper?
It was not mapping correctness because, although it had been defined the mapper for address types (cfg.CreateMap<Endereco, EnderecoDTO>();), in class Cliente, the property is a…
-
2
votes2
answers389
viewsA: What is the function of the keys { } in this interpolation?
The function is to interpolate the string, without need to concatenate or convert data. Take this example: print("O nome é ${widget.nome}"); Without the ${ would need to do so, concatenating with +:…
-
8
votes2
answers87
viewsA: Change the type of a variable in a statement of a line, change the type of variables that come and sequence, why?
This is because when finding a text value, everything else is treated as text because the operating signal + becomes the concatenate operation. But note that this only occurs when finding a text,…
javascriptanswered Ricardo Pontual 21,129 -
2
votes1
answer194
viewsA: Error when changing the type of a smalldatetime column to int
Because it is not possible to convert a type smalldatetime for int. Imagine telling SQL "convert 01/01/2019 to an integer," how to do that? How should it convert? Divide 1 by 1 and then by 2019? He…
-
1
votes1
answer70
viewsA: Is there any way to "dismember" an element child of a parent element?
For that you can use insertBefore(), insertAdjacentElement() or after() Here an example using after, where I select the "parent" element and add the "child" after it. Note that the element is moved…
-
0
votes2
answers230
viewsA: How can I create a Javascript function for the prompt?
Use a while to continue the function until a valid value is entered: function validar() { var opcao = "0" while (opcao != "1" && opcao != "2") { opcao = prompt("Digite uma opção (1 ou 2)");…
-
3
votes3
answers576
viewsA: How to get the ID value of a button?
You can use the querySelector as mentioned in the other answer, and select the button named "Edit": console.log("id=" + document.querySelector('button[name="edit"]').id) <button name="edit"…
-
14
votes1
answer4230
viewsA: What is the difference between export and export default?
Both commands are used to create modules, and allow that when importing into another file, can be used everything in that module. The main difference is, as its name suggests (default), the export…
-
0
votes1
answer153
viewsQ: git origin/branch and git origin branch what’s the difference?
When I need to update the local repository, I usually run the command git pull or git pull origin/branch. The git pull origin/branch as far as I understand "pull" what you have on the remote branch…
gitasked Ricardo Pontual 21,129 -
1
votes1
answer39
viewsA: Report with date_trunc including zeroed values
Yes it is possible to generate all dates using the function generate_series: generate_series(timestamp '2019-06-21 00:00:0.00000', '2019-06-21 23:00:0.00000', '1 hour') Basically generates a series…
-
3
votes1
answer270
viewsA: Convert String to Float
Your code has some problems: on the line etanol = parseFloat(txtEtanol.value.replace(",","."));, where the variable was defined txtEtanol? in its input, it would not be better to define "txtEtanol"…
-
0
votes1
answer48
viewsA: How do I insert a new row between two other rows of a table with jquery?
To insert right after the line where you clicked on the "+" button, you need to use this line as a reference and use insertAfter, or insertBefore if you wanted to before: (function($) { AddTableRow…
-
3
votes2
answers72
viewsA: Know which values within the IN condition are not linked to the table
Since your list of letters is not in a table, you need to put it in a "pseudo-table", or "dummy table". The oracle has an interesting resource to do that which is to declare a table in the body of…
-
0
votes2
answers38
viewsA: Query mysql bring last call without duplicate
Cannot use a simple group by because you need the other columns, so you can do a subquery that groups by area and brings the id sorted by date: SELECT * FROM `chamado` where chamado.nomechamado =…
-
0
votes1
answer678
viewsQ: How to clone/snapshot a Docker container with all data?
I’m trying to make a clone or snapshot of a container Docker and all its contents. More specifically, I have two containers where databases run, one with Cassandra and another with MySQL. They are…
dockerasked Ricardo Pontual 21,129 -
1
votes2
answers121
viewsA: How to verify that the executable has been changed? C#
For that you can use Currentdomain.Frindlyname if (!System.AppDomain.CurrentDomain.FriendlyName == "Demo.exe") { MessageBox.Show("O Arquivo deve ter o nome \'Demo\'.", "Error"); Environment.Exit(0);…
c#answered Ricardo Pontual 21,129 -
1
votes2
answers1154
viewsA: How to take the edge of an image as a link
Need to remove link edge (a) and not the image ( img), so the correct selector would be: a { border: none; outline: none; } a { outline : none; border: none } <a href="#"> <img…
-
1
votes1
answer68
viewsA: Java Script Code Loading by Screen Resolution
Using javascript it is possible to do this by analyzing for example the window.innerWidth to identify the resolution, then create a "script" type element and add to your page: var scriptDinamico =…
-
5
votes2
answers355
viewsA: What are the main differences and advantages of using Shadow DOM and Virtual DOM?
First and very important, let’s understand the DOM: DOM (Document Object Model) It’s the object model used in a web document, or so to speak, a web page. It defines how is modeling the objects that…
-
1
votes1
answer588
viewsA: Datareader Error Data is Null
This happens because the returns of DataReader are not of the same type as .NET, then when it executes a GetString or any other type (GetInt for example), the value is converted, and a value null…
-
5
votes3
answers290
viewsA: How to make compatible objects coming from two different classes, derived from the same interface?
The reason is very simple: one cannot implicitly convert two objects because they implement the same interface, this does not guarantee that they are equal. Otherwise we can say that, the two…
-
9
votes2
answers278
viewsA: Matrix or Vector, huh?
Their statement is not correct, they do not do the same thing, may even be similar in foundation but are different and definitely do not do the same thing. In a very simple way we can say that…
-
1
votes1
answer383
viewsA: Using the Mail API with AJAX
As for your first doubt, in this validation block: if(cep.length != 8){ $('p').css({color: "red"}) $('p').html("CEP não existe."); }else if(isNaN(cep)){ $('p').css({color: "red"}); $('p').html("CEP…
-
0
votes1
answer118
viewsA: Automatically change CSS every date
You can locate the link through its content (as I have not seen jquery in your code, I’m using javascript pure): var dataAtual = new Date().toLocaleString('pt-br', {year: 'numeric', month:…
-
1
votes2
answers189
viewsA: How to locate information by considering a range (range of numbers)
Since the track is in the same row of the table, you can use the BETWEEN to find the delivery value between base and ceiling: select dados.nome, parametros.bonus from dados, parametros where…
-
3
votes3
answers1332
viewsA: Format DATETIME SQL Server
This is the way to display the date, the database only returns the date, how to display it is done after. You can format dates in a few different ways on sql-server: Using CAST e CONVERT: format not…
-
0
votes4
answers712
viewsA: How to access only the first position of each row in an array of arrays (matrix / multidimensional array) using foreach?
It is possible to use foreach become the array in one-dimensional, taking only the first position of the objects: string[,] operacoes = { { "SOMA", "x", "" }, { "SUBTRAÇÃO", "x", "" }, {…
-
1
votes1
answer432
viewsA: Using the fetch api
First, you are turning an object into a string, so you cannot access its properties if it has been converted to a string (dados.name for example). Second, the result is an array, so you need an…
javascriptanswered Ricardo Pontual 21,129 -
10
votes2
answers132
viewsA: How to correctly read documentation from an SQL command?
The notation for documentation means the following: { } or < >: what’s inside of keys is obligatory, should be used { x | y } or < x | y >: an option, x or y, shall be chosen obligatory…
-
0
votes1
answer71
viewsA: Insert C# data.sqlclient
The method AddWithValue receives two parameters: (string, object), according to the documentation: Addwitvalue So it must be like this: cmd.Parameters.AddWithValue("@parm1", txt_razao.Text); Taking…
-
1
votes1
answer330
viewsA: Fatal error SQLSTATE[42000]
The problem is that the ORDER BY should come after the WHERE in a command sql. Look at this piece of your code: $sql = "SELECT * FROM post ORDER BY id DESC"; // a smart code to add all conditions,…
-
0
votes1
answer35
viewsA: Problem setting a list in a Singleton
You can turn the object into a Static to have a single instance, and check if it has already been instantiated in get: private static List<Requisicao> requisicaolist; public…
javaanswered Ricardo Pontual 21,129 -
9
votes2
answers73
viewsA: On the implementation of some() and Every()
Some means "some", so it will return immediately if any item is found (true): if (callback.call(context, this[i], i, this)) return true; Every means "each", "all of a list", that is, if you find one…