Posts by Ricardo Pontual • 21,129 points
751 posts
-
4
votes3
answers478
viewsA: .is() jQuery - how does it work?
The function is() of jQuery is used to check if an object "matches" with a given selector. Take this example: console.log("O elemento 'i' é um input: " + $('#i').is('input')); console.log("O…
-
2
votes2
answers189
viewsA: What data can I get from a user?
From the user itself there is not much to obtain, since the browser does not store user information. Who guada information are the sites, in cookies, but we already know that we cannot read from…
-
2
votes1
answer212
viewsA: What is the difference between Integrated Security and Persist Security?
Integrated Security means the form of authentication of the bank: - if "false", you must enter login and password in the connection string; - if "true", no login/password is required as the…
-
2
votes2
answers188
viewsA: Button does not run Javascript
Missing close the structure of the click, that I commented below: $('#btnGnrt').click(function() { function sorteio_numero(nummin, nummax, numqtd) { var amostra = new Array(), lista = new Array(),…
javascriptanswered Ricardo Pontual 21,129 -
2
votes1
answer2093
viewsA: How to format numbers directly by SQL
Using from the SQL SERVER 2012, you can use the function FORMAT : SELECT FORMAT(A.REALIZADO,'#,0.0000', 'pt-BR') ... Using only the pattern '#0.0000' will format the display using punctuation, but…
-
1
votes2
answers348
viewsA: real money mask in php jquery array
As I put in the comment, you need to run again the .maskMoney so that the element that was cloned also works. Here’s an example (I used the class to not need to refer to the ID, and also put the…
-
4
votes2
answers59
viewsA: Event does not work after running replaceWith
Yes, you replaced the content and missed the event, just add the event again: var ops = { ... }; $( "#replaceWith" ).click(function() { $('#teste').replaceWith('<button…
jqueryanswered Ricardo Pontual 21,129 -
0
votes1
answer25
viewsA: APS.NET MVC - BD data split
Does the select to recover by id, and split the return of the Eixox column so for example: eixoX = "a1, a2, a3" Dim eixoSValores As String() = eixoX.Split(New Char() {","c})…
-
0
votes3
answers1188
viewsA: Align button at the end of table
If you want to align according to the size of the table, you can use the tfoot of the table and put the button there, with right alignment on td take the example: table { border-collapse: collapse;…
-
1
votes3
answers555
viewsA: Create an "opacity" on top of a <tr>
Can create any element (a div for example) within the TD to do this: td { border: solid 1px; padding: 4px; text-align: center; position: relative } .tarja { position: absolute; width: 80%; height:…
-
2
votes1
answer4381
viewsA: Change oracle Quence
You can use the ALTER SEQUENCE: ALTER SEQUENCE S_SEG_EXE INCREMENT BY 100; In the above example, the current value of the Quence increased by 100. The value may also be negative if you want to…
oracleanswered Ricardo Pontual 21,129 -
1
votes4
answers181
viewsA: Complete numbers with Javascript
You can use the method repeat javascript to repeat the "0" n times according to the size of the string. From what I saw in your example, you must have a size of 14 (the last part), so: var num =…
javascriptanswered Ricardo Pontual 21,129 -
0
votes1
answer310
viewsA: Using Itaucripto_.dll within web service (without registering on the server)
I’ve had the same problem, I found the solution by reading this question from the OS: Interop type cannot be Embedded The solution was as follows: 1. Registrar o assembly de criptografia do Itaú…
-
3
votes1
answer599
viewsA: transform string into javascript array
Your string JSON appears to be poorly formatted, has two poorly defined arrays (this gives error: ][). I made a small change to a valid array and converted to object using JSON.parse: var x =…
-
3
votes2
answers172
viewsA: SQL SERVER - Convert String in Days
Divide '50' by 24 and you will get the number of days. Take the rest of the division '50' by 24 and you’ll get the rest of the hours. Minutes and seconds don’t need to calculate. declare @h int, @m…
-
2
votes1
answer2850
viewsA: mysql - using SUM()
You can group by request and add the multiplication thus: select id_pedido, sum(valor_unit*qtd) as total from tb_pedido group by id_pedido See example working: http://sqlfiddle.com…
mysqlanswered Ricardo Pontual 21,129 -
2
votes3
answers91
viewsA: Someone can explain to me the following situation:
As @Andrew replied, the Javascript makes implicit conversions to resolve certain situations. Where it is possible to perform operations such as String, he operates as such, otherwise he converts.…
-
0
votes1
answer29
viewsA: Importing an XML and using columns to calculate
Setado CultureInfo works properly: decimal qtdaEmbalagem = Convert.ToDecimal(dgw_Xml.CurrentRow.Cells["QtdaEmbalagem"].Value), System.Globalization.CultureInfo.InvariantCulture); See an example…
c#answered Ricardo Pontual 21,129 -
1
votes1
answer680
viewsA: Return Oracle PL/SQL string range
You can use a regular Expression combined with the function REGEXP_SUBSTR: select regexp_substr('1410,00|83,1|39,29|1410m|','[^\|]+',1,2) from dual The function will apply to regular Expression…
-
5
votes2
answers7405
viewsA: What is the difference between SCHEMA and DATABASE?
According to the mysql documentation: schema Conceptually, a schema is a set of interrelated database Objects, such as Tables, table Columns, data types of the Columns, Indexes, Foreign Keys, and so…
-
0
votes2
answers110
viewsA: Trigger two functions with separate onscroll events - JS
You can include multiple functions or codes responding to an event, just do so: window.onscroll = function() { scrollFunction(); outraFunction(); } You can still use the "good old" addEventListener,…
-
2
votes1
answer46
viewsA: mysql error in creating Foreign key
The problem is that the columns are incompatible. Column in the photo table: moder INT(1) Column in inter table: moder INT(5)
-
1
votes1
answer685
viewsA: How to transfer data from one table to another on different servers
Of mysql to the sql-server you can do so: UPDATE tabela SET campo=A.campo FROM (SELECT * FROM OPENQUERY(nome-linked-server,'Select * From tabela')) A INNER JOIN join tabela B on b.Id=a.Id You must…
-
1
votes1
answer505
viewsA: SQL Server - Trigger does not run after a given field
Yes, there is. First you can disable recursiveness in TRIGGERS, the bad that this is done at the database level: ALTER DATABASE NomeDoBanco SET RECURSIVE_TRIGGERS OFF Documentation:…
-
4
votes2
answers209
viewsA: What’s the Weakmap object for?
How the Weakmap object works? WeakMap is an object of Javascript which provides an object dictionary, i.e., an object that stores data in the key/value format. As a dictionary, it works based on a…
-
13
votes3
answers3857
viewsA: Catch the last occurrence in a javascript string
Just use lastIndexOf which returns the position of the last occurrence of a string: var texto = "xx_xxxxx_0001_ABCDE_TESTE_INTRODUCAO_VIDEO"; var ultima = texto.substring(texto.lastIndexOf("_")+1);…
javascriptanswered Ricardo Pontual 21,129 -
0
votes1
answer33
viewsA: I’m trying to do a text input, and what I type into it I want to play within a variable?
Do not use innerText, use value: var b = document.getElementById('a_input').value; alert(b); We use innerText for objects that may have content in html, as div and span, to get the text content, and…
inputanswered Ricardo Pontual 21,129 -
4
votes3
answers623
viewsA: What is the Javascript Set object for?
It basically creates a collection of unique objects. It is new to ES6, so it is not yet compatible with all browsers. Below is a compatibility link. Unlike a common collection or dictionary, you do…
-
1
votes1
answer39
viewsA: My Javascript/AJAX function is not converting Date to the correct format
Just you take the return and convert to date using parseInt. First remove the bars. See an example: var retorno = "/Date(1531326926000)/"; // remove as barras com o Regex, ou pode ser um replace…
-
0
votes1
answer858
viewsA: Convert to decimal without adding zeros - SQL Server
The number must have this '12345.67' format, so first remove the dot, then replace the comma by a dot, like this: select CAST(REPLACE( REPLACE(ZMI058.Montante, '.', ''), ',', '.') AS decimal(18,2))…
-
2
votes1
answer80
viewsA: How to make relationship between 5 tables?
Just keep doing the joins with the other tables, it will get big but just go adding the other tables: SELECT a.autor as autorAula, c.conteudo as conteudo FROM aulas a INNER JOIN aula_has_conteudo h…
-
9
votes3
answers129
viewsA: Why are Javascript objects not always JSON?
"Can it be considered an Object and also a Json? If not, why not?" Why objects javascript exist since the language was created, and the JSON is a way to represent objects and was created later, in…
-
9
votes2
answers159
viewsA: What is the "dirname" attribute in HTML for?
This attribute puts the information if the text was typed left to right (default for nodes) or right to left, being used to receive the typed value and know how it was typed. Makes sense if used in…
htmlanswered Ricardo Pontual 21,129 -
3
votes2
answers1254
viewsA: Assign value to a specific input
You don’t need the ID, but you only need to use inputs from the same line. In your code, where you reference the elements, here for example: $(".total").val(30-sum); you need to pick up the…
-
2
votes2
answers1174
viewsA: Change the color of a cell according to the value
It would be simple to compare on the line you generate to td, but you’re doing it in a for dynamically, using an index and not field names, which makes it difficult. Looking at its code, we can see…
-
3
votes2
answers47
viewsA: Problem with SQL relational logic
View the query with comments: WHERE genero LIKE 'F' LIKE is used with '%', so for example 'F%' meaning "any gender initiated by F", '%" at the end means "anything". If you want a search with the…
-
1
votes2
answers475
viewsA: Auto increment (Postgresql)
This is normal, the command DELETE erases records but does not restart the seed of quence. The command to change the seed value is this: ALTER SEQUENCE seq RESTART WITH 1 Dai starts again from 1…
postgresqlanswered Ricardo Pontual 21,129 -
1
votes1
answer244
viewsA: Html and Css back a row in the table
You can group the data using Linq without having to change the query, for example: var agrupado = from m in movimentos group m by m.IdAcaoProcesso into g select new { Id = g.Key, Processo =…
-
0
votes3
answers84
viewsA: What are the good practices of MVC with Entity Framework?
It would be good practice to separate the data model from the display model. To do this, create a project with only the bank part, any model/Pattern known (DAC, Repository, etc) and put the models…
-
5
votes2
answers375
viewsA: Select element based on the data-id attribute
In pure javascript can be like this: document.querySelectorAll("[data-id='2']") As it will return an array of elements, you need to check if you returned any, and take the first element, then the…
-
0
votes1
answer36
viewsA: SQL Database Log in Restoring Pending
The SQL Server has a log of these actions, in the case of Store, on Tablea restorehistory. Here a query that will show the last Store for each database, should help you: WITH LastRestores AS (…
-
1
votes1
answer271
viewsA: Show and hide <table> in Javascript with arrows
Since you need to change the table view and are using the "slider" class, you need to change the div class: <div class="slide slide1"> For the table: <table class="slide"..> Here’s an…
-
2
votes2
answers25
viewsA: Checkbox selected in function
You can use the method attr or the method prop jquery to that: $('#ck1').attr('checked', 'checked'); $('#ck2').prop('checked', true); <script…
-
2
votes2
answers56
viewsA: Ignore first input reading
If you want to ignore the element because it is "Hidden", just do it on the selector, with :not([type="hidden"]). Or if you want to ignore the first, switch to a command for ignoring the first…
javascriptanswered Ricardo Pontual 21,129 -
0
votes1
answer32
viewsA: php - Prepared mysqli
Email and password fields are text (varchar for example) correct? In this case, your query is missing quotes: $stmt = $con->prepare("SELECT email, password FROM public_users WHERE email = '?' AND…
phpanswered Ricardo Pontual 21,129 -
0
votes1
answer445
viewsA: Cron command without using password to access MYSQL database
You can use the mysql_config_editor to configure access and avoid passing the login/password opened on the command line: mysql_config_editor set --login-path=local --host=localhost --user=usuario…
-
1
votes1
answer27
viewsA: Do individual requests influence website speed in general?
This code from your example runs locally only in client browsing, so it won’t hurt the speed or performance of the application on the server or for other users. Even if it was a for, will only…
-
4
votes1
answer4461
viewsA: What is a middleware for?
After all what is a middleware? What is the point? Well, we can answer these two questions together: a middleware is, saying in very simple terms a layer in the middle of two applications, that is,…
-
0
votes2
answers365
viewsA: Compare two objects in JS/Jquery
To avoid inserting a duplicate block, you can use ID or a name which can search and see if it already exists, or simply use contains to check if there is already an element with some text, for…
-
1
votes2
answers43
viewsA: By sending Form the Attachment is coming null. ASP.NET
Replace the class FileStream for HttpPostedFileBase: public ActionResult EnviaEmail(string destinatario, string assunto, string mensagem, FileStream arquivo) To read the Stream, use the method…
asp.net-mvcanswered Ricardo Pontual 21,129