Posts by Diego Schmidt • 1,059 points
43 posts
-
0
votes2
answers671
viewsA: Display different message in case of timeout
The ideal would be for you to place these invoices in a queue and process them asynchronously. But as it is a legacy system and maybe you can not make this change, to capture the timeout error you…
-
2
votes1
answer1579
viewsA: Calculation of working days
See if it is what you want, will pick up the working days, the amount and the last day. From an initial date and within a number of days. <?php function getListaDiasFeriado($ano = null) { if…
-
3
votes1
answer1457
viewsA: Error trying to install Nodejs
At the time of installation disables the option Perfomance Counters and Event Tracing (ETW) and tries to install again. In some cases disabling Antivirus also solves.…
-
1
votes1
answer133
viewsA: Insert return ajax into table
You can use the parent() to climb an element above the element being clicked, and then use the prev() to take the first previous element with the class td-rating, it is also possible to call the…
-
4
votes1
answer502
viewsA: Like locking <tr> after clicking once
The estate disabled has no effect on tr. What you can do is disable the event click when you click on tr. For example: $("tr").click(function(event) { alert("Clicado!"); $(this).off("click"); });…
-
1
votes2
answers1127
viewsA: Regex only at first occurrence
It’s quite simple. In the search use the following regex: (ABC)\s. Where it is in parentheses is the content that will remain and the rest outside the group is what will be deleted. In content to…
-
1
votes1
answer1014
viewsA: Insert records from one table into another in Mysql?
You can use a INSERT along with a SELECT. For example: INSERT INTO ordem_compra (id, id_orcamento, fornecedor) SELECT id, id_orcamento, id_fornecedor FROM orcamento WHERE orcamento = 330;…
-
1
votes3
answers1161
viewsA: How to send an object array type variable via AJAX?
The first thing is you set the property dataType of ajax as json so that you can receive the return of PHP as an object. Instead of using the complete of ajax, use the success. The complete will…
-
1
votes1
answer189
viewsA: How to copy div from iframe to parent? (replicate) can be using ajax, jquery, javascript
First you need to take all the content that comes within the iframe, in this case it is yours div. You can do it this way: var iframeContent = $(data).text(); // aqui vai retornar todo conteúdo…
-
1
votes2
answers144
viewsA: Collapse in bootstrap 4
For you to hide the menu by clicking on some option you can use the collapse("hide"), you must apply the action of click in all tags <a> that are within the divs with class collapse. Your…
-
1
votes3
answers41
viewsA: Jquery does not run correctly
Missed you remove the class close before giving a toggleClass("open"), also failed to remove class open when giving a toggleClass("close"). Your code should look like this: $(function () {…
-
0
votes2
answers41
viewsA: Check if line in database exists, if not, restart query again
You can search based on current ID and limit registration amount. Ex: SELECT * FROM noticia WHERE id < 3 ORDER BY id DESC LIMIT 1 -- Essa seria a noticia anterior SELECT * FROM noticia WHERE id…
-
0
votes3
answers842
viewsA: Disable and maintain click
To disable Hover instead of using .off("hover") you have to use $(".imagemModelo").off('mouseenter mouseleave') Ref: https://api.jquery.com/hover/…
-
0
votes1
answer94
viewsA: Error when sending e-mail via production
Maybe your gmail account isn’t allowing external applications. Try the following: 1. Fazer o login no gmail 2. Acessar a url https://accounts.google.com/DisplayUnlockCaptcha 3. Pressionar o botão…
-
2
votes1
answer109
viewsA: Error passing array as parameter for Eloquent object
It seems that the saveMany phone is not correct. Try it this way: $cambista->telefones()->saveMany([ new \Telefone(["numero" => "(82) 99178-1066"]), new \Telefone(["numero" => "(82)…
-
1
votes1
answer1800
viewsA: Convert a JSON String to a JAVA Object Array
First you will need to create a class called Empresa, follow: public class Empresa { private Integer id; private String idCategoria; private String imagePath; private String name; private String…
-
6
votes1
answer64
viewsA: How to format the day of the week to not show symbol in PHP
In this case, just call the function utf8_encode Thus remaining: echo ucwords(utf8_encode(strftime("%A ")));…
-
0
votes1
answer62
viewsA: Disable Submit function when appearing error message
After adding the error message, add the property "disabled" to the button. $("#email").attr("disabled", "disabled"); // adicionando a propriedade para desabilitar o botão. e.preventDefault(); //…
-
3
votes1
answer955
viewsA: How to get the value of an input with getParameter?
Inputs containing the attribute disabled are not sent together with the form data. Remove the attribute disabled and just let readonly (read only) that will work. It is worth remembering that not…
-
1
votes2
answers42
viewsA: Iterate indexes of a vector
Follow an example: a = [10, 20, 50, 80, 50, 60]; b = []; tamanhoLista = len(a); for i in range(tamanhoLista): subtracoes = []; for x in range(i, tamanhoLista): if (x+1) < tamanhoLista:…
-
1
votes2
answers543
viewsA: How to find out if I need to rotate the image
If the image contains the EXIF pattern you can identify and rotate if necessary. EXIF (Exchangeable Image File Format) is a specified standard and followed by digital camera manufacturers recording…
-
1
votes3
answers50
viewsA: Determine the indices of a vector to be subtracted
Follow an example: a = [10, 20, 50, 80, 50, 60]; b = []; for i in range(len(a)): if (i+1) < len(a): b.append(a[i+1]-a[i]); del(a[i]) print (b);
-
4
votes1
answer45
viewsA: How to make foreign table associate fields using select?
It seems that your query is wrong, the where has to be after your Join and you have two columns with the name "ID", so you have to pass the alias. Change to: select p.*, c.nome as categoria_nome…
-
2
votes3
answers4984
viewsA: Get the highest value from a list?
Using Linq, just call: int maiorNumero = MinhaLista.Max();
c#answered Diego Schmidt 1,059 -
0
votes1
answer1270
viewsA: How to find position of occurrence of a String in a JAVA file?
I don’t know if I fully understand what you want, but follow an example: First you will need to take all the content of the text, so create the following method in the main class: private static…
-
4
votes1
answer226
viewsA: Download data in JSON
If the structure is exactly as it is in the question, you can do it this way: String jsonString = "[{\"ID\":1,\"ano\":5}]"; JSONArray jsonArray = new JSONArray(jsonString); JSONObject jsonObject =…
-
1
votes1
answer407
viewsA: Filter data from a string with regular expression
Just call the group() cnpj = re.search("\d{2}.\d{3}.\d{3}/\d{4}-\d{2}", variavel).group()
-
1
votes1
answer220
viewsA: Validate form with equal name[] and id
The function call you have to pass exactly as it is in the name. <button onclick="validacao('descr_icon[]')">Validar campos</button> In the function you have to go through the elements…
-
1
votes2
answers357
viewsA: Update key in state when another key is updated
In the documentation official says this.setState() should not be called within the componentWillUpdate, if you want to update the state when a property is modified you should do this within the…
-
1
votes2
answers152
viewsA: Pass search input to another file
The problem is that the form action will run before its javascript function. Follow an example working the way you want in the question: HTML: <!DOCTYPE html> <html> <head>…
-
1
votes4
answers2363
viewsA: Javascript - Validating Numeric Field (popup)
The onblur event is for when you take the focus off the field and you’re putting it on the button, you are also passing button value and not inputs value. One way to work is to place the…
-
8
votes2
answers318
viewsA: PHP mkdir vs chmod
It seems to be because of the umask. Here is the translation of the answer https://stackoverflow.com/questions/6229353/permissions-with-mkdir-wont-work You may notice that when you create a new…
-
2
votes1
answer1419
viewsA: How to Get a json list of a JAVA Api?
I recommend using the library called Jackson, it is very good to do this type of conversion to java objects. If you use Maven, you can import the following library: <dependency>…
-
0
votes1
answer292
viewsA: Use of Lastinsertid() more than once
It looks like you’re not performing on $insertUsuario and yes two executions in $insertEndereco. I mean, you do the first run on $insertEndereco and then you’re doing it again giving a bindValue em…
-
0
votes3
answers582
viewsA: How to receive form data and inform the result of the sum in php in the form div element?
You can not put the class file in the action, you have to put the script that will call the class Numbers, in this case you will call the file itself, and then yes take the values of $_POST and pass…
phpanswered Diego Schmidt 1,059 -
0
votes2
answers707
viewsA: Checking repeated numbers in PHP
I don’t know if it’s exactly what you want, but I made a simple example. You can see the script working on ideone. Note: I used the str_pad to fill the values that have only one digit with 0 left to…
-
4
votes2
answers4248
viewsA: Error "Fatal error: Cannot redeclare (Previously declared)"
You can use the date_diff function() or manually do the same as shown below: function tempoCorrido($dataHoraString) { $hoje = time(); $dataHora = strtotime($dataHoraString); $diferenca = $hoje -…
phpanswered Diego Schmidt 1,059 -
1
votes1
answer833
viewsA: Remove row from table after deleting via AJAX
Grab the element tr before making the ajax request and after a fadeOut. You’re taking all the elements that have the class delete-aluno and taking their respective trs, this way will return 3 trs…
-
1
votes3
answers2084
viewsA: How do I Reload only in the modal window?
You want to clear all modal content? If so, you can remove the body content. Ex: $('#myModalpv').on('hidden.bs.modal', function () { $(".modal-body").html(""); })…
-
2
votes3
answers224
viewsA: remove first array from an array
You can use the array_splice function and remove a portion of the array. $novoArray = array_splice($array, 1); Remove to first position and adjust the contents.…
phpanswered Diego Schmidt 1,059 -
1
votes1
answer1274
viewsA: CSS formatting for PDF generation
Try it this way: <!DOCTYPE html> <html lang="pt-br"> <head> <title></title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,…
-
0
votes1
answer102
viewsA: Select Mysql query used ports?
I did using IN, but can also be done using NOT EXISTS. If you want to know which particular ports switch you are not using could do so: select switch.nome, ( select group_concat(porta.porta) from…
-
1
votes1
answer234
viewsA: I can’t use json return in php
It seems that some non-utf-8 character in json is breaking its json_decode. Try it this way: $json = json_decode(utf8_encode($jsonString), true); You can also see which error occurred with your…