Posts by Augusto Vasques • 15,321 points
571 posts
-
3
votes3
answers329
viewsA: How to return the number of arguments and sum the values of the arguments in a javascript function
The object Arguments corresponds to the arguments passed to a function. It looks like a matching Array object but is not a Array. The property is used here arguments.length to return the number of…
javascriptanswered Augusto Vasques 15,321 -
1
votes1
answer64
viewsA: Problem in javascript table creation
botao_excluir, botao_editar, inputEquipamento, inputModelo, inputData, inputChamado and inputQuantidade are not defined when the page is loaded they are generated dynamically within the dynamic…
javascriptanswered Augusto Vasques 15,321 -
4
votes4
answers1946
viewsA: Incorrect Date/Time Formatting Nan/Nan/Nan Nan:Nan:Nan
You can do it this way too: var data = "/Date(1566322265000)/"; console.log("Data: " + (new Date(parseInt(data.replace(/\D/g,'')))).toLocaleDateString('pt-BR'));…
-
1
votes1
answer85
viewsA: Focus an entire array on a variable that prints in DOMPDF
You don’t have to use array, one string can do it. When you search the value for $soft every iteration you are overriding the value obtained in the previous iteration. I modified the line where you…
-
2
votes2
answers163
viewsA: String replacement in javascript
To meet your requirements I made a modification in html. I put a <input file> to upload the file containing the aerodrome information so that it can be loaded from an arbitrary location. In my…
-
7
votes1
answer598
viewsA: Concatenate content from a String Array (JSON) generating a sentence
I believe you’re looking for the method Array.prototype.join(). The method join joins all elements of an array into a string and returns it. join accepts a parameter, which will be the separator…
-
2
votes1
answer160
viewsA: Geocoordinate does not contain a definition for Getdistanceto
You have created a console solution that uses only the core of . NET Framework, which prevents you from adding references to assemblies because the purpose of this type of application is to be…
c#answered Augusto Vasques 15,321 -
2
votes1
answer1726
viewsA: How to check if a Date field is NULL C# ASP.Net
I believe the error is generated on this line: DateTime meuValor = Convert.ToDateTime(command.ExecuteScalar()); According to the question command.ExecuteScalar() can return either a date, in which…
-
0
votes1
answer85
viewsA: Send e-mail with attachment in PHP
The problem is simpler than I imagined, the moment the page is first loaded the request variables $_POST, $_GET and $_REQUEST are present but have no defined values. Hence a direct check to…
-
-2
votes2
answers546
viewsA: PHP adding and subtracting wrong
Warning: Although the question is using float to manipulate currency, never store or manipulate money using float, as rounding errors may occur. Work with integers internally, where the integer…
-
1
votes2
answers549
viewsA: IP condition of the user via Javascript?
You want to authenticate the connection via IP? This type of block is called ACL or Access Control Lists and only serves to bar the majority of lay users. Access Control Lists (ACL) allow or deny…
-
0
votes3
answers35
viewsA: Take attribute value when page is loaded and select or modified
Hitching a ride in the answer of Fabiano Salles, with Jquery you can evoke an event with the method .trigger(). $(document).ready(function() { //Configura o evento change…
jqueryanswered Augusto Vasques 15,321 -
0
votes1
answer426
viewsA: How to find an xml tag information using xPath in Postgresql?
You can use the function xpath: xpath( xpath_exp , xml [ , nsarray ]) The function xpath evaluates the expression xpath_exp in relation to the value xml and Rretorna an array of XML values…
-
2
votes5
answers583
viewsA: How to sort json in php
The function usort gives a lot of control over sorting. This function will sort an array by values using a user-defined sorting function. If the array needs to be ordered using a peculiar criterion,…
-
1
votes1
answer105
viewsA: update mysql attribute according to a day (12/12/2019) cakephp, mysql
You can create an event. An event is a task executed based on a predefined schedule, so it is sometimes referred to as a scheduled event. A procedure is executed only when it is called directly, a…
-
1
votes1
answer80
viewsA: Doubt with Bubble Sort
In these two passages for (i=0;i<=tamanho;i++) and for (k=0;k<=tamanho;k++){ you used the comparator <= to limit the value of the variable to the size of the vector. As in Java the vector…
javaanswered Augusto Vasques 15,321 -
3
votes5
answers3418
viewsA: Check the amount of negative elements in a JS array
Using for of. function quantidadeDeMesesComPerda(umPeriodo){ var contador = 0; for(var item of umPeriodo) { if (item < 0) contador ++; } return contador; } console.log("Meses com perda: " +…
-
2
votes2
answers964
viewsA: Show array elements in random order
Analyzing Your code has many errors and does not match what is proposed in the question, which can be defined in steps: 1. Collecting the data 2. Shuffling the data 3. Display the data The first…
javascriptanswered Augusto Vasques 15,321 -
3
votes1
answer121
viewsA: Problem with animation of a sort algorithm
Visual problem In the browser Javascript executes the code in context and single thread(Single Thread) and canvas does not have a method to force visual updates(redraw type), this implies that any…
-
11
votes2
answers218
viewsA: What is this !! operator in PHP?
Complementing the Jroger answer, and applying in the context of the question code, the double use of the negation operator !! can be used to find out if an array is empty or not, as a replacement…
-
0
votes1
answer50
viewsA: How to develop a wordpress homepage that changes according to locale
Yes. And it can be done by both the client and the server part. For this you will have to have a geolocation service, in this case I used the ipinfo.io that offers both paid and free services with…
-
1
votes2
answers1184
viewsA: Extract object list from JSON
Analyzing In the question it is not clear what format your JSON document has for sure if it is really an array or if the tool you used to dump formatted the output of the data in an object. Then I…
-
1
votes2
answers316
viewsA: Autofocus for next field with Javascript + Maxlength
I modified the logic, but maintaining the same principle of navigating the DOM tree. The code sequentially auto-focus all input[type=text] within a <form>, independent of the hierarchical…
javascriptanswered Augusto Vasques 15,321 -
3
votes1
answer54
viewsA: Doubt about class Abstract and method __Construct?
The problem is occurring with the argument $date constructor public function __construct($date). Even if the php default for passing arguments is the passage by value for primitive types, for…
-
4
votes2
answers536
viewsA: How to extract only the filename without extension using javascript?
Can be done by combining your file name extraction method with the methods substr and lastIndexOf. String.prototype.substr(*inicio*[, *quantidade*]) Where: beginning This is the place to start…
javascriptanswered Augusto Vasques 15,321 -
8
votes4
answers333
viewsA: How to manipulate these objects with Javascript?
For each element of data apply a function that adds the property items[val.letter] the value val and then remove the letter with the operator delete in delete val.letter var items = {}; var data = […
-
1
votes1
answer168
viewsA: Transparent background
I don’t know if this is what you’re looking for, but I applied it to the square(class base) the CSS attribute mix-blend-mode with the value hard-light. The estate mix-blend-mode describes how a…
-
0
votes1
answer1268
viewsA: Store an image within a javascript variable?
The way you want to do it, using the property innerHTML, one way is to build a tag <img> and stores it within its variable variavelFoto. function saudacao(obj) { var data = new Date(); var…
-
0
votes1
answer189
viewsA: Skip an iteration with Foreach when found error in file (PHP)
I believe the problem is occurring on the line: $arquivo[$i] = $xml->getElementsByTagName( "nfeProc" );//Entra na TAG Pai do XML The purpose of the method DOMDocument::getElementsByTagName(…
phpanswered Augusto Vasques 15,321 -
2
votes1
answer2565
viewsA: How to know the date of each record that was entered in the database?
It is good practice in commercial systems to keep a log of operations(who/did what/when), this gives you the possibility to do: An audit in your system in case of direct or judicial request. History…
-
1
votes2
answers682
viewsA: How to count how many odd numbers there are between -999 and 0
This is an arithmetic progression exercise also known as PA. An arithmetic progression is a numerical sequence in which each term, starting from the second, is equal to the sum of the previous term…
-
0
votes5
answers1617
viewsA: Check if variable is a positive integer
I will use a different approach, I will use a script in Pyton within the Shell Script. The goal is not to be better or faster, so much so that the other answers are arguably good, but to show a…
-
0
votes1
answer251
viewsA: Enable Images in Datagridview
I’m not sure I understand your question but I believe you’re looking for the component Datagridviewbuttoncolumn. The DataGridViewButtonColumn is a specialized class of DataGridViewColumn used to…
c#answered Augusto Vasques 15,321 -
5
votes1
answer420
viewsA: By displaying the result of the sum of two numbers I got "[Object Htmlinputelement]"
The problem is not the sum but what you are adding up. tn1 and tn2 are references to the inputs: let tn1 = window.document.getElementById('txtn1') let tn2 = window.document.getElementById('txtn2')…
javascriptanswered Augusto Vasques 15,321 -
3
votes1
answer161
viewsA: Computer Architecture - Transistors
Excerpt from the book Santana, Edu - Computer Architecture. Made available by the Federal University of Paraíba:…
architecture-computersanswered Augusto Vasques 15,321 -
1
votes3
answers385
viewsA: Calculate values in sub array [PHP]
PHP provides a native set of functions to work with arrays, are the Array Functions. Array Functions allow accessing and manipulating arrays and are supported both simple and multi-dimensional…
-
2
votes1
answer39
viewsA: Nothing happens in Success, even if Json returns
There are two possibilities. The first possibility is your request to return an HTML, because analyzing this line $('#form_result').html(''); implies that you have deleted the HTML code from…
-
3
votes2
answers75
viewsA: With calling a file in Clojure?
If you want to load a module in LISP you can use require or load. The difference between them is that the require is specific to load modules written in LISP. Already the load can be used with any…
-
1
votes2
answers199
viewsA: Creation of Mysql database
What Are Storage Engines? Storage engines, or storage engines, are Mysql components that control SQL operations for different types of tables that store and manage information in a database. Innodb…
-
0
votes2
answers798
viewsA: Loop in Javascript to click button
I’m not sure I understand, but you want to programmatically fire 100 clicks on a button third party pages. If it is I will give a specific answer for Chrome because Chrome is the most common browser…
javascriptanswered Augusto Vasques 15,321 -
1
votes1
answer139
viewsA: Java: Problem with Substring
You have to remember that String is a collection of characters analogous to the `Array``: As with the Arrays the index of the first character is 0(zero). The index of the last character, if any, is…
-
3
votes1
answer83
viewsA: (Java) Error saving multiple lines in a TXT file
The solution to your problem is to simplify the test for existence of the file, because existing or not the file you will use the FileWriter and withdraw the statement FileWriter arq = new…
javaanswered Augusto Vasques 15,321 -
1
votes1
answer105
viewsA: Generate only a Table header with PHP using Foreach
One possibility is to have the table encapsulate the for, as this makes possible the unique presentation of the header and gives the iterators the function to build the table body. //O inicio da…
-
2
votes1
answer133
viewsA: Wherein problem using array
According to Laravel’s documentation Where clauses the method whereIn checks whether a given column is contained in a given array. The example given in the documentation is: $users =…
-
2
votes1
answer485
viewsA: Django 2.2 error - mysql connection
Seems to be a problem of divergence with the required Mysql versions and the version installed on the machine. First step upgrade python to the latest version. Upgraded and before installing the…
-
1
votes1
answer299
viewsA: Insert being executed twice
Analyzing In that code: //Esse IF verifica se a sessão está ativa. Só chama a função se a sessão está ativa. if(session_status() == PHP_SESSION_ACTIVE) { pegarLogout($conecta, $usuario); } It seems…
-
3
votes2
answers243
viewsA: Convert VB code to C# which turns characters into numbers
Analyzing your code makes it easy to understand what function bool eNumero(string s) is a logical function that takes a string as input returns the logical value true indicating whether the first…
-
6
votes7
answers620
viewsA: How to access a circular array?
If you don’t want to waste time: To make an array use circular indexes at the end just use the formula: indíce normalizado = resto(indice estrapolado, comprimento da array) Remembering that rest in…
-
1
votes2
answers108
viewsA: Mark only one radiobutton for each line
I’m not sure I understand but the property name indicates to which group the <input::radiobutton> belonging. <link rel="stylesheet"…
-
0
votes3
answers144
viewsA: I would like to take the case sensitive out of a search in . PHP
This is not PHP is Javascript. You can convert both search and search pattern to uppercase or lowercase. Insensitive search by converting texts to lowercase: if(…
javascriptanswered Augusto Vasques 15,321