Posts by Ricardo Pontual • 21,129 points
751 posts
-
0
votes2
answers47
viewsA: How to manipulate another Window Front with JS
You need to wait for the window to be loaded so that the element is available and you can change it. You can do this by treating the event onload: var janela = window.open(…
javascriptanswered Ricardo Pontual 21,129 -
2
votes4
answers60
viewsA: Averaging
The correct is to add first and divide and not the other way around: const media = (p1 + p2) / 2 Otherwise the result would be 2 divided by 16.3, which is 0.12. Take the example: var p1 = Number…
javascriptanswered Ricardo Pontual 21,129 -
0
votes2
answers514
viewsA: Sum values with Angularjs
This is because valueB and valueB are not numbers but strings, so by summing it is actually concatenating its values. I’d have to wear something like {{Number(valorA) + Number(valorB)}} Or convert…
angularjsanswered Ricardo Pontual 21,129 -
3
votes2
answers114
viewsA: Programming logic - Constant
She is not a constant, to be, she could not be altered in any way. Although, as you put it in the example, it is not changed during the code, still it is not a count, because at any time it can be…
logicanswered Ricardo Pontual 21,129 -
1
votes2
answers355
viewsA: Extract child tags from an XML
What is wrong basically in your code is the following: you’re not using namespace to navigate the XElement; is treating attribute as element. "NSU" is an attribute in element "docZip". Can solve…
-
2
votes1
answer4265
viewsA: In EXCEL, How to use Bold formatting of a cell and apply in a "concatenate" function in another cell
You cannot apply format to a formula or copy formatted content. CONCATENAR copies only the text. If it was a number or date formatting, you can use the function TEXTO, which can apply a format (for…
excelanswered Ricardo Pontual 21,129 -
1
votes1
answer266
viewsA: Parameters for query in sql server
You can make the comparison if the parameter is null and use operator OR if it is not, if it were to "say" the logic would be like this: "parameter @start date is null or D2_EMISSAO = @start date"…
sql-serveranswered Ricardo Pontual 21,129 -
0
votes1
answer71
viewsA: Pick up line data with checkbox marked
The simplest way to interact with an array would be to use foreach, but in your case, it would be better to use a for because when finding a "checked" item, we take the name value with the same…
-
0
votes1
answer422
viewsA: SQL Server 2017 - Recover column description/comment in table in database - Metadata
The Description column is in the table sys.extended_properties, need to include in your select making Join with object_id, like this: left join sys.extended_properties tep on T.object_id =…
-
1
votes1
answer279
viewsA: How to change the color of a div via javascript with one condition
Victor, the problem of using the Javascript is that if it is an external file .js will not work because the @ViewBag only works on the page .cshtml (if you are VB, .vbhtml). A simple way would be to…
-
4
votes2
answers203
viewsA: Button that scrolls the page up without reaching the top
You can scroll the screen "so many on so many" pixels, until you reach the top: $(document).ready(function() { $(window).scroll(function() { if ($(this).scrollTop() > 10) { $('#scroll').fadeIn();…
-
6
votes2
answers51
viewsA: How to show only the number of a Cpf
You can use something simpler, a regular Expression to search for anything other than digits and remove using the function replace: var cpf = "123.456.789-00"; var cpr_sonumeros =…
htmlanswered Ricardo Pontual 21,129 -
6
votes1
answer31
viewsA: SQL Filter to not display some items from a table
If not, include a column in the "loc_pais" table of type "bit", for example "sanctioned ofac" and update the table with which countries are sanctioned (sancionado_ofac=1). Then just add one where…
-
3
votes1
answer45
viewsA: What is the difference between setAttibute, getattribute and hasAttribute?
No, they’re different things: hasAttribute returns a Boolean, stating if an attribute exists in the element; getAttribute returns the value of an attribute; setAttribute assigns the value to an…
javascriptanswered Ricardo Pontual 21,129 -
4
votes2
answers76
viewsA: SQL SERVER Counting the data of a record
You can use the SUM but it has two points: - Add up all columns - Group for each yes/no/no You could do it in one SELECT, adding up the columns (sum(col1)+sum(col2)+...), but would have the problem…
-
11
votes3
answers3987
viewsQ: What does it mean to run lint in the code?
I saw that expression "lint code" in some places, in the IDE of Visual Studio and also when executing the NG CLI, the client of Angular. What does that mean? What exactly "lint code" ago?…
-
2
votes2
answers400
viewsA: Add to MYSQL query in varchar field by deleting Strings
You need to add the converted value: remove the R$, remove the point of thousands replace the comma by the period After that convert to number and add: SELECT SUM( cast( REPLACE( REPLACE(…
-
1
votes1
answer147
viewsA: Register Header in a SOAP service reference in C#
You can set the header like this: WebClient client = new WebClient(); client.Headers.Add("login", "us1"); client.Headers.Add("senha", "b81476fc88f1a2a4"); client.Headers.Add("codigoEmpresa", "1");…
-
0
votes2
answers949
viewsA: Is it possible to return the Javascript result in HTML with Javascript only?
Here is an example of a function to log in (just switch from console.log to'log in'): function logar() { // onde vai ser escrito o log var logger = document.getElementById('resultado'); // verifica…
-
1
votes1
answer50
viewsA: View Log with TYPE command
As to appear at the end of the file there is nothing to do, because the type list and add to buffer from the screen and to the end. If you want to see the whole file you have to scroll the bar until…
-
2
votes1
answer43
viewsA: Conversion of Procedures
Has, knowing well how each bank works :) This is undoubtedly the best way, to have one or two professionals who understand well, especially if the Procedure use very specific resources, such as…
-
2
votes1
answer33
viewsA: Is it possible to count word order in a field via Mysql?
That took a little work, but come on... The center of the solution is in the function FIND_IN_SET of mysql, looking for the index of a value in a comma-separated list. Basically it makes a split and…
mysqlanswered Ricardo Pontual 21,129 -
3
votes3
answers62
viewsA: Best way to apply a Pattern to the acronym
This Regex must meet: /^[A-Z]([A-Z]*|\d+)$/ // validos console.log(/^[A-Z]([A-Z]*|\d+)$/.test("A")) console.log(/^[A-Z]([A-Z]*|\d+)$/.test("AB")) console.log(/^[A-Z]([A-Z]*|\d+)$/.test("A1"))…
-
1
votes1
answer982
viewsA: Restore a SQL SERVER database from a mdf file
This error happens because ldf file is missing. An alternative is to create a new database and insert the mdf into it. It can be done via command: CREATE DATABASE dados ON (FILENAME =…
sql-serveranswered Ricardo Pontual 21,129 -
1
votes2
answers101
viewsA: Calling function after fadeOut
You can put getTotal() right after remove(). If there is any problem it may be because we did not have time to update the DOM after deleting the line, then a small timeout must solve:…
-
3
votes1
answer182
viewsA: Individual and Legal in the same table
Here’s an example of how you can change your model and implement the method Validate: // adicione a interface IValidatableObject public class ApplicationClient: IValidatableObject { [Key] public…
-
2
votes1
answer1719
viewsA: Inconsistent accessibility: "value" parameter type is less accessible than "value" method
Declare the interface as public: public interface IClientManager : IDisposable Thus it is at the same level of accessibility as the "Clientcontroller" class, which is public…
-
3
votes1
answer48
viewsA: Javascript in several html’s
Yes, you can include the same file javascript on multiple pages using the tag script. Including on pages from other sites. See jQuery for example, which you can include on any page using this…
-
2
votes2
answers47
viewsA: validation of multiple selects
Use the selector $('select option:selected[value=Selecione]') to know if there are any select with this option "Select" selected: $( "#validar" ).click(function() { console.log($('select…
-
6
votes2
answers1871
viewsA: What does "At Execution Time" mean?
"At runtime" or "Runtime" is something that occurs when the program is running basically. To illustrate, consider analyzing a code. An error can occur at build time or runtime. See this code: int x…
c#answered Ricardo Pontual 21,129 -
0
votes1
answer47
viewsA: Uncaught Typeerror: $(...). removeClass(...). affix is not a Function at Htmldocument.<Anonymous>
Your code is correct, and error in affix, the jquery was loaded correctly, so the problem is in itself affix. It was removed in the boostrap starting with version 4:…
jqueryanswered Ricardo Pontual 21,129 -
5
votes1
answer47
viewsA: Put JS only in a div
Yes you can use several versions on the same page. jquery allows this by using a function called noConflict. In your case it would look like this to load the scripts on the page: <script…
-
0
votes1
answer20
viewsA: Redirect to page when removing iframe
Note the "onload" event from iframe: <iframe src='URLDOIFRAME' onLoad="this.contentWindow.location = 'http://www.google.com/?=destino' ... > Or use the jquery: $('#id-do-iframe').on('load',…
-
0
votes2
answers4479
viewsA: Safest way to encrypt passwords in Mysql ? And the easiest?
I believe that the best option would be to let the bank only store the information, ie already come encrypted by the application. Another alternative is to use the function PASSWORD() to encrypt…
mysqlanswered Ricardo Pontual 21,129 -
2
votes2
answers841
viewsA: Data in SQL ORACLE
You can use WHERE like this: WHERE trunc( DAT_REFERENCIA, 'MM' ) = trunc( sysdate, 'MM' ) Will take the current date of sysdate (as getdate() in the sql-server) EDIT: To take the current and…
-
2
votes2
answers41
viewsA: Format result of time
You can use the function TIME_FORMAT: SELECT TIME_FORMAT( TIMEDIFF(primeiraSaida, primeiraEntrada) + TIMEDIFF(segundaSaida, segundaEntrada)) , '%H:%i') AS DIFERENCA…
mysqlanswered Ricardo Pontual 21,129 -
3
votes2
answers862
viewsA: No parameterless constructor defined for this Object
No parameterless constructor defined for this Object That is, you need to have a constructor without parameters: public DashboardController() { } This won’t disturb your other constructor with an…
-
8
votes2
answers680
viewsA: In HTML what is an Undetermined Checkbox and how to use this status along with CSS?
as it is possible to set a checkbox as undetermined? This state is defined by a property of the checkbox, that is indeterminate, that can only be accessed using javascript: there is a third state in…
-
2
votes2
answers744
viewsA: Background color on calendar specific days and times
You need to generate the event and add the property rendering: 'background', this will make him have a differentiated fund. To set the color you want, overwrite the class "Fc-bgevent". Example:…
-
3
votes1
answer1380
viewsA: How to capture the result of a command and store in an MS-DOS variable in batch file?
I took the example from here: How to store the result of a command Expression in a variable using bat scripts? And I took a test and it worked: set c="youtube-dl -e…
ms-ofanswered Ricardo Pontual 21,129 -
3
votes2
answers1012
viewsA: Duplicate keys
You must have created the table with the email statement so: email varchar(max) unique Placed max just as an example. This will generate a Constraint which will not allow duplicate values, including…
-
1
votes1
answer261
viewsA: Auto Input Fill in another browser tab via script
You can pass the parameter by query string, and read on the other page, something very common and simple: <a href="www.paginaxyz.com.br?codigoConsulta=12345">Consultar</a> OBS.: here I’m…
-
3
votes2
answers814
viewsA: Delete triggers by query
DELETE FROM sys.triggers this will try to erase the records from a system table, not the triggers. To delete a Trigger the command is: DROP TRIGGER nome Documentation: DROP TRIGGER Here a script…
-
2
votes1
answer363
viewsA: How to add fields dynamically and link them to viewmodel in Asp.Net
Add neat html just like you’re doing, you won’t have important things from your model, like Dataannotations for example. A "mixed" solution would be to create a Action return a new line from your…
-
4
votes1
answer208
viewsA: How to group values from a json
You can create a new object, browse through json using a for, and add a new node to each city, and go grouping the cities within that node, like this: var jsData=[ { "id": 459, "razao_social":…
-
3
votes4
answers72
viewsA: Remove Class after Click
Your code works, I added a text to make sure where you are clicking and a style to demonstrate: $("#sidebar-show").click(function() { $('#sidebar').removeClass("d-none"); }); #sidebar-show { cursor:…
jqueryanswered Ricardo Pontual 21,129 -
8
votes4
answers1235
viewsA: Does the order of CSS styles influence the render tree?
I’ve asked myself that question before :) In this similar OS question, the answers say no: Are there speed Benefits of putting CSS Attributes in Alphabetical order? Although it has nothing based on…
-
5
votes3
answers1758
viewsA: Display comma separated results with Mysql
I made a fiddle to validate, taking advantage of the idea of group_concat from the @fernandosavio response: select a.nomeAdm as nome, GROUP_CONCAT(DISTINCT r.nomeREg SEPARATOR ", ") as regiao from…
-
9
votes3
answers1419
viewsA: Comparison of integers in Java
First it is important to understand that Integer is a class in java, while int is a primitive type. This way, when using Integer valor is creating an object. This serves, for example, to make…
javaanswered Ricardo Pontual 21,129 -
5
votes1
answer59
viewsA: IFNULL is not working
In the scenario where id = 3 does not exist in my table SELECT does not returns '0' just keeps returning NULL Of course, the function will check the value of the field, but if you have already…
mysqlanswered Ricardo Pontual 21,129