Posts by Ricardo Pontual • 21,129 points
751 posts
-
3
votes1
answer2142
viewsA: Read a value inside a complex JSON in C#
result is another object, can not be string. Moreover, parameters is also an object. The structure would be like this: public class Parameters { public string news { get; set; } } public class…
-
2
votes1
answer110
viewsA: JS of a document working within iframe html
You need to select the iframe and then use contents: $("iframe").contents().find(".teste"); If iframe has a better ID: $("#idIframe").contents().find(".teste"); Reference: api.jquery.com/Contents…
-
2
votes1
answer398
viewsA: User permissions
Remove the user from the group db_owner; Add the group db_datareader so that you have permission to SELECT; Add specific permission from EXECUTE in the procedures you want it to perform. Example:…
sql-serveranswered Ricardo Pontual 21,129 -
4
votes2
answers51
viewsA: Error Backing Up Windows Forms Database
The message is clear, can’t find the backup file. Do not forget that when executing the command backup database on the server of SQL-Server, he will look for "C: Dbbackup" on the local disk of the…
-
0
votes3
answers464
viewsA: drop table with temporary table giving error
That syntax if exists may not work on SQL-Server, is a new syntax from SQL SERVER 2016, you can do so: IF OBJECT_ID('#tempCID', 'U') IS NOT NULL DROP TABLE #tempCID OBJECT_ID is a function that…
-
4
votes1
answer417
viewsA: Hash and Encryption Algorithms
According to dictionary definitions, cryptography is "a set of principles and techniques employed to encrypt the writing, make it unintelligible for those who do not have access to the combined…
-
1
votes2
answers131
viewsA: Selected combo component
ng-selected should be a logical expression, can be done like this: <select ng-change="selecionaArendimento(nota.flagARendimento)" ng-model="nota.flagARendimento" class="form-control">…
-
1
votes1
answer24
viewsA: Create new file by discarding current XML lines C#
Maybe you can another way to it. How do you want to simply manipulate the xml, an archive xslt is well suited to it. The file would have this structure: <?xml version="1.0"?>…
-
0
votes2
answers35
viewsA: When assigning an attribute to a function, is it like creating a variable within that function?
No, it’s different.. in your example, the variable declared within the Function (var pais) in the last code cannot be accessed outside the Function, is local to Function only, see the example: var…
javascriptanswered Ricardo Pontual 21,129 -
4
votes1
answer79
viewsA: problem with parseint sum()
The correct would be to first convert the "10" and then add 1, otherwise it makes the operation "10" + "1" which gives "101". Look at it this way: var adicicaoEstoque = parseInt(dados[1]) + 1;…
javascriptanswered Ricardo Pontual 21,129 -
1
votes2
answers652
viewsA: Convert SQL query to Mongodb
Would look like this: db.match_table.find({ "$or":[ { "$and":[ { home_team_api_id:9991 }, { "home_team_goal":{ "$gt":"away_team_goal" } } ] }, { "$and":[ { "away_team_api_id":9991 }, {…
-
3
votes1
answer1116
viewsA: Connect Entityframeworkcore with Oracle database
According to the support page of the EF Providers (on 12/06/2018), in the section "Future Providers": Oracle’s . NET team announced that it intends to release a provider own for EF Core 2.0…
-
4
votes2
answers2691
viewsA: Using two Onsubmit in Javascript and If Function within an Alert
"In the Form field I wouldn’t have to report two onsubmit ? One validateName and another validateEmail?" In the form, the event onsubmit is an event that happens when you try to "submit" the form,…
-
4
votes2
answers220
viewsQ: Standard implementations in C#interface
I was reading about the new features of C# 8 and came across the Default Interface Implentations, i.e., standard implementations in interfaces. The code below exemplifies public interface…
-
4
votes2
answers65
viewsA: Javascript : How to make an Andom based on time?
Use the method toISOString and then remove what is not numbers: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString var data = new Date();…
javascriptanswered Ricardo Pontual 21,129 -
0
votes2
answers25
viewsA: Specify element not to receive properties from other main elements
There are two ways: 1) use the selector :not to apply to anything the selector picks up, but something. For example, in the element you don’t want to put a ID different, lkProdutos for example, then…
-
1
votes1
answer207
viewsA: Query to count table dependencies
Only SQL-SERVER you can link the table foreign_keys with the table sysobjects for that reason: SELECT s.name, count(f.name) Dependencias FROM sys.foreign_keys AS f INNER JOIN sys.sysobjects s ON…
sqlanswered Ricardo Pontual 21,129 -
1
votes1
answer65
viewsA: What’s the best way to get responsiveness from @Media
The information is still valid on the link yes, I just find a bit of exaggeration for each difference of 100px for example, make a media query. See the resolutions of bootstrap for example that are…
-
1
votes1
answer232
viewsA: List Database result in checkbox with AJAX and Jquery
So to get the result of the query Ajax and generate the checkboxes: $.each(data, function (i, element) { $('#divEntradas').append('<input type="checkbox" name="entrada" id="' + element.Id +'"…
-
0
votes2
answers73
viewsA: Validate only 1 and 2 in an sql table in the relational and logical model?
You can add a Constraint to check the field values, like this: ALTER TABLE nome-da-tabela ADD CONSTRAINT check-valores CHECK (nome-do-campo= 1 OR nome-do-campo = 2); Or when creating the table:…
postgresqlanswered Ricardo Pontual 21,129 -
4
votes1
answer469
viewsA: What is the purpose of the "Asp-area" attribute in Web ASP.NET Core MVC?
Basically to inform that a link/route refers to an area ASP.NET Core areas Like the ASP.NET go find a controller in the briefcase Controllers at the root of the site, if you want to use a controller…
asp.net-coreanswered Ricardo Pontual 21,129 -
1
votes2
answers896
viewsA: What is the difference between Htmlcollection, Nodelist and Object?
The GIFT (Document Object Model) has several objects, such as window representing a browser window, and document representing the content of the page. Within these objects, there may be lists of…
-
0
votes2
answers52
viewsA: Problems with Javascript
I put its functions together with the correction that @Arnaldo commented and it worked, see the proof: function calculaResultado(x) { console.log(x); a = document.getElementById('avInicial' +…
javascriptanswered Ricardo Pontual 21,129 -
1
votes3
answers2371
viewsA: Download all columns of all tables containing a text
The Workbench has this functionality, allows you to search for a content in all tables using WbGrepData. The command would be like this: WbGrepData -searchValue=ValorProcurado -tables=public.*…
-
3
votes1
answer424
viewsA: How to fire scroll using pure javascript?
Using window.scroll, thus: window.scroll({top: 500, left: 0, behavior: 'smooth' }) p {height: 40px; vertical-align: middel; border: solid 1px} <h1>Rolar o html até o final...</h1>…
javascriptanswered Ricardo Pontual 21,129 -
3
votes1
answer464
viewsA: Begin Transaction and Save Transaction SQL Server
You don’t have the full code of Procedure, but if that’s all, the SAVE is of no use in your case. SAVE TRANSACTION saves a point in the code block to return if the transaction is canceled…
-
1
votes1
answer115
viewsA: How to cancel an Xmlhttprequest using a button?
Use the method abort: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/abort // a variável deve ser global ou ser passada por parâmetro para a function que irá abortar var xhrList =…
-
1
votes4
answers1373
viewsA: How to create an empty/null value in select dynamically?
Just create a option with empty text and add to the end of for in the select: for(var i = 0; i < cidades.length; i++) { ..... } var select = document.getElementById('cidade'); var opt = new…
-
1
votes2
answers214
viewsA: Popular dynamically select form
The "city" element is a select so and add html as he would in an element div perhaps not the best option, creating the elements option and add would be more readable: for(var i = 0; i <=…
javascriptanswered Ricardo Pontual 21,129 -
1
votes1
answer58
viewsA: Help me to understand
"Why should I serialize before using stringify?" To make the call Ajax you would need to assemble each value you send, whether in an object: var parametros = { nome: 'fulano', idade: 18 }; or in a…
-
0
votes2
answers163
viewsA: File.Exists and the accentuation
I’ve seen a code here never class that lists a directory with a comment to "handle paths with accents". When I saw your question I remembered this and went after. This is the code (I wrote some path…
-
5
votes3
answers315
viewsA: How to mount this SQL to bring months that are not in the list?
Like the select will return only existing data, you can create a table with the months and do the left join with this table, grouping by month and doing the count in the mv_clients table, for…
-
2
votes1
answer409
viewsA: Change div by clicking / when hovering over with jquery
In case when the mouse is over the widget, just use the pseudoclass hover, which will temporarily change the style while you are over the element. Read more here:…
-
2
votes2
answers17697
viewsA: Set width of <tr> or <td> in HTML5
Just an addendum, prefer to get direct references on https://www.w3.org/ or in the https://developer.mozilla.org are more reliable Back to your question, why not use the css? The attribute width is…
-
1
votes3
answers32
viewsA: Jquery . text printing only once
I put your code on jsfiddle, clear removing the name of the script and works, just fixing the tags that are wrong: <div class="teste1" style="color: red"><div> Should be: <div…
-
4
votes1
answer30
viewsA: Script shows success message, but does not update the database
Not getting the correct value of the code on WHERE, needs to change to take $cod, thus: $sql_altera = "UPDATE usuario SET nome_user='$nome', login_user='$login', senha_user='$senha' WHERE cod_user =…
phpanswered Ricardo Pontual 21,129 -
2
votes2
answers88
viewsA: Unrecognized keyword "as"
If you’re using the case based on a field, do not need to repeat the field in each when: SELECT c.`nome`, case c.`id_estado` WHEN 1 THEN 12 WHEN 2 THEN 27 WHEN 3 THEN 13 WHEN 4 THEN 16 WHEN 5 THEN…
-
3
votes3
answers122
viewsA: Get the record name in the most repeating column
You can simply group and sort to see which one repeats the most select tipo_doenca, count(tipo_doenca) from tb_grafico where localidade = 'Centro' group by tipo_doenca order by count(tipo_doenca)…
-
2
votes1
answer368
viewsA: doubts about target="_Blank"
There is but you need to do it using javascript, only the link won’t make it. Change your link to include a call to a function like this: <a href="endereço-da-janela" target="_blank"…
-
0
votes1
answer24
viewsA: Replace no `contenteditable` does not play the end pro pointer
For this you can use the object Range and position you where you wish. Reference https://developer.mozilla.org/en-US/docs/Web/API/Range Here an example: $('#botao').click(function () { var div =…
-
2
votes1
answer52
viewsA: Problem accessing concrete class methods using reference this in C#
"When using the reference this.Dao.Existeregistro();, it points to the method in the abstract class" The reserved word this always references the current class, to reference the class to which it is…
-
1
votes3
answers767
viewsA: Escape Single and double quotes from the text area even giving Crlt+V
You can use the following Regex: $('#bot').on('keypress', function (e) { if (!/['"]/.test(String.fromCharCode(e.keyCode))) { return; } else { e.preventDefault(); } }); <script…
-
2
votes3
answers83
viewsA: How to capture only a specific part of a string?
You can use /<txt_conarq_assunto>(.+?)<\/txt_conarq_assunto>/ See the example below, with javascript var texto = "<txt_conarq_assunto>A classificar</txt_conarq_assunto>"; var…
regexanswered Ricardo Pontual 21,129 -
0
votes1
answer100
viewsA: Using cache during user session
For this you can write your own rule for the cache using VaryByCustom. In this case, you need to write the method GetVaryByCustomString will either return whether or not to use the cache based on…
-
0
votes2
answers1469
viewsA: Convert from decimal or integer to php hours
I use this Function: function converterParaHora($dec) { $seg = ($dec * 3600); $hor = floor($dec); $seg -= $hor * 3600; $min = floor($seg / 60); $seg -= $min * 60; return…
phpanswered Ricardo Pontual 21,129 -
5
votes2
answers391
viewsA: C++ (basic): for, references and syntax
Because you need to continue keeping the reference to the object within the code. If you do not use &vi in the for, will not change the original object that was passed by reference, but a copy…
-
1
votes1
answer568
viewsA: change text from fileupload Asp.net
There is no way to change the text within the input, each browser renders the element in its own way, but there is a way to use some workaround to resolve. An alternative is to add a label of its…
-
2
votes2
answers416
viewsA: Concatenate CPF in Mysql
Would that be: CONCAT(SUBSTRING(cpfcgc, 1,3), '.', SUBSTRING(cpfcgc,4,3), '.', SUBSTRING(cpfcgc,7,3), '-', SUBSTRING(cpfcgc,10,2)) See here an example working: http://sqlfiddle.com/#! 9/9c7c0/2…
mysqlanswered Ricardo Pontual 21,129 -
12
votes3
answers10018
viewsA: SASS and SCSS: Why use them instead of conventional CSS?
I’ll share what I know and some sources on the subject. What exactly do they do? LESS, SASS and SCSS are extensions of CSS, I mean, in a very simple way, they add functionality to the CSS. Taking…
-
2
votes2
answers1806
viewsA: How to disable and enable onclick with Jquery
You can do so by using the off: // Começa com o click associado $('#botaoAcao').click(clickBotao); $('#ligar').click(function() { $('#botaoAcao').click(clickBotao); $('#botaoAcao').text('Clique…