Posts by Ricardo Pontual • 21,129 points
751 posts
-
1
votes1
answer96
viewsA: Mysql - Select in two databases comparing columns
Your query is almost right, for just one detail: The banco1 is the most complete. I would like to know which plates are listed in Banco1 and not in Banco2. If one bank has data that the other bank…
-
0
votes1
answer21
viewsA: Edit class style individually with JS
Since the class that has the % is an H2 with the class "percentage", you can make a selector for that element directly which is simpler, and then set the % in the div element before the H2; function…
-
3
votes1
answer32
viewsA: Cast in MYSQL X Performance
"It seems to me that when using the CAST function the engine ignores the INDEX of the field in question, that’s right?" Answer: no, do not ignore, what happens is that to get to the INDEX you must…
-
0
votes1
answer77
viewsA: Select parent div by clicking on child element
There are two points here: the event "focusin" is entering with Focus in one element, so it will not be able to change to another without canceling the current event inside the same Handler, for…
-
0
votes2
answers64
viewsA: How do I enable uploading large files to classic ASP on IIS?
Despite being "classic ASP", due to the page "freeaspupload.Asp", this config is from ASP.Net. You need to include a Section <asp> with settings within the <system.webServer>, defining…
-
6
votes3
answers142
viewsQ: Multiple cases on switch with C# 8
On seeing this question about multiple conditions in the switch, reminded me of a problem I had and I couldn’t solve. In C# 8, a new syntax for switch: int num = ObterUmNumero(); var descricao = num…
-
0
votes1
answer48
viewsA: I’m trying to make a switch case with more than one variable, but I don’t know how to make it work, can anyone help me?
This is not possible to do, the switch use a single "commutator" or value that must be tested, and is always equal, one cannot combine conditions such as x1 == x2 && y1 != y2. For example:…
c#answered Ricardo Pontual 21,129 -
1
votes1
answer37
viewsA: Simplify function in JS
Yes it is possible, the part that varies is the modal selector ( [data-modal="abrir"]), then you can create a Function that receives this value (can be the end of the selector, since the rest is…
-
2
votes1
answer34
viewsA: Transform 3 similar functions into one
The common parts are: Always replace the three elements: The "featured" element is the class "xxx-div-js" and the other "xxx-js-no-display" Therefore, you need to pass a parameter that determines…
-
2
votes1
answer37
viewsA: How to find another name like the one selected and highlight
You are passing to Function the element LI who has the mouseover, to catch the span can use a find("span") and pay the element text. Then find the span elements with the same content. For this you…
-
0
votes1
answer125
viewsA: How do I, in Postman, validate that in a "data" array all elements contain a specific value in the "name" field?
You can use the method every(), testing whether all elements within an array meet a condition: var name = "Rukmin Naik"; var array = `{ "data":[ { "id":148, "name":"Amrita Naik",…
-
0
votes1
answer25
viewsA: send only completed PHP ARRAY data
I could do like this for example: $materialarray = $_POST["material"]; $codigoarray = $_POST["codigo"]; $quantidadearray= $_POST["quantidade"]; for ($i = 0; $i < count($codigoarray); $i++) {…
-
1
votes2
answers722
viewsA: How index selectivity works
"index 1 was faster, but I thought 2 would be faster" To answer this question, we need to remember that an index is a list ordered by one or more fields with a pointer pointing to the corresponding…
-
2
votes2
answers108
viewsA: How to get the product to scale two vectors in Javascript?
The math.js works perfect and returns the same result: let a=[2,4,6]; let b=[1,3,5]; console.log(math.dot(a,b)) <script…
-
1
votes1
answer116
viewsA: What is the difference between space-Around and space-Evenly?
The basic difference is in the distribution of spaces: space-around: takes all the space left on the line and distributes equally between the elements, leaving the space equal across the line;…
cssanswered Ricardo Pontual 21,129 -
1
votes1
answer43
viewsA: Is it possible to call members of a Dynamic class as a string?
As a response, not taking into account the code itself, can be done by case Reflexion Name be a property: var name = stud .GetType() .GetProperty("Name") // Só funciona com properties…
-
1
votes1
answer31
viewsA: How to delete rows in three tables with specific condition (SQL)
The SELECT can have as many tables as you want, but the command DELETE should be done one for each table. That should invalidate making one JOIN with that SELECT, or even a subquery, because after…
-
3
votes3
answers283
viewsA: How to delete duplicates between multiple tables
How your tables have id AUTO_INCREMENT, a third option is possible, without creating index or doing Join that would, group by the duplicate field "numero_serie" and mater the smallest "ID". Take…
-
1
votes1
answer46
viewsA: When I put the class in the first <Section> it works , but in the second <Section> (with the same class) the effect does not work - Javascript
Answering the last comment, you need to use the querySelectorAll, that returns an array of objects. Need to iterate over each element, can be done with for, foreach, etc. I usually use it like this,…
-
0
votes1
answer40
viewsA: Execute query by pressing a button and send to modal
Try updating after the modal is displayed. For this you can treat the event "show": $('#myModalClass').modal("show"); $('#myModalClass').on('shown', function() { $("#prop-details").html(data); });…
-
0
votes1
answer111
viewsA: How to access a global application.json variable in . NET Core c#
There are several ways to do this. In your example, you haven’t even created the Host yet, so you need to do it manually, like this: public static void Main(string[] args) { // Le o appsettings e…
-
0
votes2
answers58
viewsA: Pass txtBox value to Label (between Windows Form Forms) - However, string is null
You can create a property in Form and set this value when instantiating: public class CronogramaLogado { public string UsuarioLogado { get; set; } } private void FormLogado() { var cronograma = new…
c#answered Ricardo Pontual 21,129 -
0
votes1
answer87
viewsA: C# and MS SQL Server Special Characters
You don’t have to do REPLACE explicit, the SQL SERVER has the leotard that can do this directly in the query result. It is a statement that can be used in the command SELECT, thus: SELECT…
-
3
votes2
answers53
viewsA: How to transform a numeric value into CURRENCY FORMAT (Brazilian Real) in SELECT MYSQL
The database stores "numbers", if you want to show in another format you can do this later, with some programming language, to display in a report or page. If you still need to format at query level…
-
0
votes1
answer33
viewsA: Perform a query by checking if this record already exists in another table
You can use the NOT EXISTS to the subquery, thus: SELECT * FROM tbl_noticias WHERE NOT EXISTS (SELECT * FROM tbl_desbloqueado WHERE id_cliente = 123 -- id do cliente AND id_noticia =…
-
2
votes1
answer97
viewsA: SQL: Sort List by Vote Numbers from Another Table
"Unfortunately there were no zeroed votes, no options to vote that were without votes". By that description and by your example, the problem is in join. When using INNER JOIN, causes, a related…
-
0
votes2
answers49
viewsA: How to take Settings from a URL and put in a Button?
There are many ways to read the url parameters that are in location.search. Here are several solutions: https://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript I…
-
0
votes2
answers75
viewsA: Button can not mark radio button nor do right in div
Your code, in addition to the detail of the selectors I mentioned before, has several improvement points in CSS and javascript. I will comment on a few points here: Simplify the selector by ID; Add…
-
4
votes4
answers3540
viewsA: How to count occurrences of a letter in a sentence?
An alternative solution is to transform the string in a array to use methods proper to the array as filter, reduce or forEach. Basically you can do it using this way: [...frase]. The operator Spread…
-
1
votes1
answer37
viewsA: How to declare a class and how to define its values?
The concept of using class members is wrong. In the class constructor, several properties are defined, such as info and spUsage, this is ok. Now the "set" methods should set to these values, for…
-
1
votes3
answers71
viewsA: How to take larger amount of each product and show within a list from the largest to the smallest?
First you need to extract the amounts from the Object that has the items. See that it is an array (items: [ ... ]), so you can interact with the elements using for or foreach, but it is simpler…
-
1
votes1
answer361
viewsA: Trigger to fill table with data from another table
You need to take only what was inserted again, using NEW as an alias. For example, imagine that "Tabela1" is like this and inserted the record 1: ID DESCRIPTION 1 Testing Then use NEW.ID and…
-
0
votes1
answer125
viewsA: Place a caption on a Chart.js chart
To generate the caption, you need to return an object of the type LegendItem, see the documentation with the definition of Interface:…
-
1
votes1
answer42
viewsA: How to generate summary comments of methods, properties and etc in C#
In order for comments to be exported along with the DLL a file . xml with this metadata must be generated, and must also be bundled with the DLL. To do this, in the Visual Studio go to the…
c#answered Ricardo Pontual 21,129 -
1
votes1
answer42
viewsA: how to use Dictionary select . value concepts
The object you are iterating is a Dictionary, which is an object of the type "key pair value", that is, an object that has a pair of data, a "key" which is the key, and a "value", which is the value…
-
2
votes1
answer873
viewsA: What is Broken Pipe Error?
A pipe, if you use literal translation, it would be a "pipe" through which data, information, etc. That is, an isolated channel that protects this data, either from alteration, or so that it follows…
-
0
votes1
answer85
viewsA: console.log returning "Undefined" no then (fetch)
If you access the url in the browser, you will get the following answer: [ { "code":"USD", "codein":"BRL", "name":"Dólar Comercial", "high":"5.3861", "low":"5.3861", "varBid":"0.0003",…
-
1
votes1
answer42
viewsA: How to duplicate a table by changing string values to decimal
If you have a table with the data in text, just make a INSERT with SELECT converting the data: INSERT INTO circulante2 SELECT CAST(data AS DATE) as data, nome, CAST(replace(replace(valor, '.',''),…
-
0
votes2
answers68
viewsA: What to use to store status in a database?
I thought that way for memory saving, since storing one 'Start Time' type string occupies more long-term memory than only '0', '1' or '2'. But I don’t think that’s the best practice for it. I…
-
2
votes2
answers50
viewsA: UPDATE REPLACE works on Phpmyadmin but does not work on Workbench
Has two ways to solve for a query: Include the where with the field(s) (s) that are primary key, as recommended where possible; Use the command SET SQL_SAFE_UPDATES to disable SAFE_UPDATES…
-
1
votes2
answers32
viewsA: How to rename an input from a selector?
You can do so (I will leave commented in the code what was done): // aqui associa o evento "change" do select. Para facilitar o seletor do elemento select, adicionei a ele um id "nomes…
-
3
votes1
answer35
viewsQ: How to serialize Object for yaml in . NET?
We can serialize objects (I’ll use as an example C#) for XML, using the class System.Xml.Serialization.XmlSerializer, for example: var obj = new AlgumaClasse();…
-
1
votes1
answer171
viewsA: What is Asp:Content?
To understand how the tag works <asp:Content...> it is necessary to understand the concepts of master page and content page. The Asp.Net allows a page to be segmented into small parts, being a…
-
0
votes2
answers59
viewsA: Javascript. Changing a string to an operator
You can use the function eval() that computes a string crossing as expression: console.log(eval("1 + 1 + 1 + 1 + 1 + 1 + 1")); // pode inclusive usar expressões mais complexas: var x = "10";…
javascriptanswered Ricardo Pontual 21,129 -
1
votes1
answer83
viewsA: Create dynamic form in javascript
So that the string template replace the value of the variables you need to put between ${ } otherwise it will be treated as a literal text. You need to do it that way for example: <label…
-
2
votes2
answers68
viewsA: Can’t print objects using template string?
Using the literal template works a little different, in this case you need to serialize the object using for example stringify, or access the properties: const obj = { a: 1, b: 2, c: 3}…
javascriptanswered Ricardo Pontual 21,129 -
5
votes4
answers798
viewsA: Search id in object array with Javascript
You can do this using the filter: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filtro Basically, you need a boolean expression that returns true/false to…
javascriptanswered Ricardo Pontual 21,129 -
1
votes1
answer16
viewsA: Localstorage, jquery and CSS
You are trying to use the value of localstorage as a number, it turns out it is not garated that, you need to convert, or add the unit of measure if the value is string. var fontSize =…
-
0
votes2
answers56
viewsA: Is it appropriate to use If-Else in a function along with Fetch?
The @user204221 answer already says well about the subjective concept of how to leave the code. I wouldn’t even go into that concept so much because in your case it’s a simple if the problem. Let’s…
-
0
votes2
answers57
viewsA: Name of the Linq Dynamics column?
There is a package called System.Linq.Dynamic that has an option to pass the column name as string, this should solve your problem: var coluna = "colunaDinamica"; .... .OrderByDescending(coluna);…