Posts by André Lins • 1,518 points
65 posts
-
0
votes2
answers43
viewsA: Correlation in Javascript lists
You put legth instead of length, with the code below will work: function getMostEffective(scores,costs,highScore){ var cost=100; var index; for(var i=0;i<scores.length;i++){ if…
javascriptanswered André Lins 1,518 -
2
votes2
answers90
viewsA: Vertical alignment of a div
You can use the flex html for this, see below: html { height: 100%; } body { overflow-x: hidden; overflow-y: hidden; background-image: linear-gradient(to top right, #a4bcb2, #34b9e9); height: 100%;…
-
2
votes2
answers226
viewsA: Group by date in a timestamp field
Use the function Date, as follows: $sql = "SELECT * FROM tbl_reclamacoes GROUP BY DATE(data_reclamacoes) ORDER BY data_reclamacoes ASC"; It will bring only the date at the time of grouping.…
-
0
votes4
answers444
viewsA: Navigatdraweror does not work
Use the createStackNavigator and remove the createAppContainer, as follows: import { createDrawerNavigator, createStackNavigator } from 'react-navigation'; ... const AppStack =…
-
2
votes3
answers592
viewsA: Adapt formatting of input
One option is to use the plugin jquery mask, see an example below: $(document).ready(function(){ $('.placa').mask('00-00-AA'); }) <script…
-
1
votes1
answer41
viewsA: use programmatically linear Radius corner, modifying circuference only on one side
Create a Drawable to make the shape of the corner, with the name corner.xml, as below: <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <stroke…
-
2
votes1
answer79
viewsA: How to work with Javascript split with dates?
The splitreturns an array, just take the second position of the array as below: var resultado = $('#idPeriodoInicio').val().split("/"); alert("o valor do split " + resultado[1]); <script…
javascriptanswered André Lins 1,518 -
0
votes2
answers287
viewsA: Copy button in textarea in Ionic
Use the plugin Clipboard, see below: Installation ionic cordova plugin add cordova-clipboard npm install @ionic-native/clipboard Insert into modules Add the Clipboard in the modules of AppModule,…
-
1
votes1
answer74
viewsA: Method does not start at first time (Constructor or Ionviewdidenter)
As all calls are asynchronous the showLoadingand the closeLoading is called in sequence and so gives the impression that is not working, you can put a counter and do the closeLoading only when you…
-
1
votes1
answer60
viewsA: Pass function by validation function in php
First valide no setTelefone and only assign the value if the isValidTelefone be it true, see below: /** * @param mixed $telefone */ public function setTelefone($telefone) {…
-
0
votes1
answer266
viewsA: Clone inputs by changing the id of each cloned item
In function duplicarCampos you need to set the variable data clone instead of document, see below: function duplicarCampos(){ j++; var select = document.getElementById('origem'); var clone =…
-
0
votes2
answers504
viewsA: Laravel 5.8 - Can we make Sync in a pivot table without the id field?
You can tell in your pivot table model which primary key, as below: class PivotModel extends Eloquent { public $incrementing = false; protected $primaryKey = [ 'user_id', 'article_id' ]; } After…
-
0
votes1
answer27
viewsA: Error using maximum number of vectors, and does not return to menu
Do first the if before creating the new instance, see below: public void execCadastro() { Scanner cad = new Scanner(System.in); if(indice >= Q){ System.out.println("Todos os espaços foram…
-
1
votes2
answers483
viewsA: How do I use javascript to make one div visible and hide another?
The id of divs are equal and you are not calling the function that is in the script, see how it looks after the fixes: <div onclick="Mudarestado()">ALTERNAR</div> <div id="minhaDiv1"…
-
0
votes1
answer146
viewsA: Change the quadrants of an even-sized matrix
Some of your validations were wrong, if you validate l>=0 will allow any l between this condition, this happened in the first two ifs, the correct validation is l<2, see below:…
-
0
votes1
answer32
viewsA: How to know which link class to select with php
You will pass the parameter to the other page, through the protocol http GET, insert into the hrefthe following adjustment to pass as parameter: <?php do{ echo "<tr><td><a…
-
7
votes2
answers3248
viewsA: Capture repeated elements from a Javascript array
Below is a way to capture all repeaters by following the code that was passed on: var repeated = []; var aux = vetor.filter(function(elemento, i) { if(vetor.indexOf(elemento) !== i) {…
-
0
votes1
answer999
viewsA: Fieldset and Legend with bootstrap
Place the fieldset with the width 100%, and put it above the divwith class row, as below: fieldset { border: 1px solid #999; padding: 10px; /* controla a distancia entre os elementos e a borda */…
-
2
votes1
answer28
viewsA: For() you’re not going through every time you should
Your code is with format error, is missing close function, see below: geraVariacoes(){ let produto = new Array() console.log(this.listaValorAtributosColunaUm.length) for (let i = 0; i <…
-
0
votes1
answer227
viewsA: Vuejs - v-if and v-Else chained
The v-if does not support multiple conditions, use the v-show as below: <template> <div v-if="!visibleForm" style="min-height: 793px;"> // conteúdo .... </div> <div…
-
0
votes1
answer52
viewsA: I can’t find the reason why my code doesn’t calculate correctly
Calculate the value of C after capturing the value of X, Y, Z and K, see below: #include <stdlib.h> #include <math.h> int main() { int A = 998; //Salario minimo float X, Y, Z, K;…
canswered André Lins 1,518 -
1
votes1
answer48
viewsA: How to ignore json elements and capture only those that are correct = true
Your json had some formatting errors that I fixed and put inside the code phpto illustrate better. Below is a way to clean the json going through the questions and their alternatives removing the…
phpanswered André Lins 1,518 -
0
votes4
answers2211
viewsA: Javascript converting wrong date
Opa Willian, this happens due to the time zone, by default the time zone is UTC, when changing the location toLocaleDateString takes over the local time zone. Because you do not set time he assumes…
-
0
votes3
answers170
viewsA: How do I break a string into several substrings so I can work with each of them separately using the C language?
Use the function strtok library string.h in the following way, this function returns a pointer to the first token found in the string, and each new interaction it returns the next token: #include…
canswered André Lins 1,518 -
1
votes1
answer47
viewsA: Using Vector in Javascript
You are using qtd_Veiculos instead of tot_Veiculos in the forwhich is used when printing, below is the code of how it should look. for (indice = 1; indice <= tot_Veiculos; indice++) {…
-
3
votes2
answers52
viewsA: Doubt in the structure of the code
Opa Matheus, most of these questions are in relation to the JS, Constructor It is a special type of method to create and start an object created by the class. Super A basic class of React inherits…
-
2
votes1
answer296
viewsA: Turn Date into String and Format to DD/MM/YYYY using Typing
Opa, use the library Moment js. and do it this way: moment('Wed Mar 15 1995 00:00:00 GMT-0300 (Horário Padrão de Brasília)').format('DD/MM/YYYY') If you want to do it manually use the following…
-
1
votes1
answer26
viewsA: Code stating which method does not exist but method is in Class
On that line you are transforming the $estudo in a string: $estudo = strlen( $estudo->getEstudo() ) >= 20 ? substr( $estudo->getEstudo(), 0, 20 ) . "...": $estudo->getEstudo(); That is…
phpanswered André Lins 1,518 -
1
votes2
answers104
viewsA: Remove Shadow from Bootstrap Status
Do it this way: .btn:focus{ box-shadow:none !important; } <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"…
-
3
votes1
answer622
viewsA: Creating and checking session - Laravel
The Laravel offers a practical way to create the entire authentication base, using the following command: php artisan make:auth If you want to do this manual authentication, in the function you want…
-
1
votes1
answer19
viewsA: I cannot make the Purchase Value appear in the given field
I made some adjustments, try it this way: <form> Valor da Compra <br> <input type="text" id="valorCompra"><br> Parcelas <br> <select id="parcelas"> <option…
-
2
votes1
answer181
viewsA: Invalid Parameter number - PHP
In his update is missing set id, need to insert this row before running: $stmt->bindParam(':uid',$id);
-
1
votes1
answer11633
viewsA: Increase input size
Opa, you can insert this size through css, so that the td increase. .text-input{ width:300px } <td> <div class="input-group"> <span class="input-group-addon">R$</span>…
-
0
votes4
answers460
viewsA: How do you separate word into letters in php?
A simpler solution is using the preg_split, as below: $valores = preg_split('//u', $IdNota,-1, PREG_SPLIT_NO_EMPTY);
-
4
votes2
answers51
viewsA: Capture value within the string
Do it this way: <?php $cidade = "CIDADE (BAIRRO)"; $options = explode("(", $cidade); if(isset($options[1])) $bairro = str_replace(")","",$options[1]); else $bairro = null; $nome_cidade =…
phpanswered André Lins 1,518 -
1
votes2
answers458
viewsA: Jquery-Mask plugin does not work
In the new version is 0 instead of 9, see below: <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script…
-
0
votes1
answer199
viewsA: Deleting Local Ionic Files 4
Oops, removeFile is an asynchronous function, in which case it returns a Promise, you have to wait for Promise’s callback or use async/await, it follows the two forms below: Callback deleteAudio(){…
-
4
votes1
answer58
viewsA: I want to give enter send a form
Below is a way to do this through javascript, insert an id on the button to force the event to click on it: document.getElementById("dado") .addEventListener("keyup", function(event) {…
-
3
votes2
answers108
viewsA: Route envelope
Just reverse the routes, like this: Route::get('/user', (...)); Route::get('/user/{id}', (...) ); Route::get('/user/{id}/perfil', (...) ); // retorna o perfil do usuário…
-
1
votes2
answers581
viewsA: Return True or False $.ajax(). done
Simply change the async setting from true to false, as follows: function getAccontAjax(id, method) { let bool = false; if (responseToken != null && responseToken != '') { let url =…
-
0
votes3
answers699
viewsA: How can I use the function href="#"?
Use anchors to solve this problem, it’s quite simple. <a href="#div1">Link 1</a> <a href="#div2">Link 2</a> <div id="div1"…
-
2
votes1
answer1146
viewsA: Laravel 5.7 (Blade) - Ternary operator on two levels is not working
I believe your error is related to not having a parentheses split, here’s a way to resolve this: {{ $cc->is_removed ? 'Removed' : (!$cc->isActive ? 'Inactive' : 'Active') }} This may take the…
-
2
votes2
answers50
viewsA: How to query 2 columns in a single input text
Do it as follows, inserting another clause in the condition of your query: $query = ("SELECT bem, des_bem, revenda FROM AFX_BEM WHERE revenda LIKE :rev AND ( des_bem LIKE :dbd OR bem LIKE :bd ) ");…
-
3
votes1
answer226
viewsA: Query problem using DB Where/orWhere Laravel
It is necessary to use a Parameter Grouping of the Laravel, so that the ORM does not get confused in the relation between the operators, see below how it should be: $result =…
-
2
votes1
answer172
viewsA: React - Redux, how can I modify a complex object?
Do as follows, opening key inside the function and doing the assignment manually. case 'setTotalEstoque': const arrayFavorito = state.contents.map((content, i) => { if(i ===…
-
3
votes2
answers1139
viewsA: Effect appear text when mouse and transparency in photo
Use the property Pointer-Events in the description, setting it to None. It will cause no event to be released relative to the description, follows below the correct form. .aro12_bikes1 img { width:…
-
0
votes2
answers36
viewsA: Problem in return after sending data! HTML & PHP. I thought echo would appear when sending the data, but nothing appears
You are resetting the values after rescuing them, do as follows, entered default values before. I put some improvements to avoid Warning messages: <!DOCTYPE html> <html> <head>…
-
3
votes1
answer51
viewsA: How to change the opacity of an element excluding its edge?
Opacity works on the element as a whole, and this affects both the border, color and background. To apply an opacity in the text you can use the option rgba only in the color, the last of the 4…
cssanswered André Lins 1,518 -
2
votes2
answers168
viewsA: Mask-Money does not work on input array
The id is a unique identifier, so it will only be inserted in the first tag that it was found, try to use a class as follows: <tr> <td><input id="item" name="item[]" type="text"…
-
2
votes1
answer104
viewsA: Count integer occurrence in an Arraylist
Below is a way to resolve this. import java.util.ArrayList; import java.util.List; public class Principal { public static void main(String[] args) { ArrayList<Faltas> faltas = new…
javaanswered André Lins 1,518