Posts by Costamilam • 9,556 points
509 posts
-
0
votes1
answer485
viewsA: How to display the tr’s next to each other with the tds one below the other within the html table?
In a normal table you have the following html structure: td, th { border: 1px solid black; } <table> <tr> <th>Cabeçalho 1</th> <th>Cabeçalho 2</th> </tr>…
-
3
votes1
answer1696
viewsQ: Does HTTP delete method have body?
In the MDN documentation: Requisition has body No The successful response has body No Insurance No Idempotente Yes Cacheable No Accepted in HTML forms No I also saw here on the site answers saying…
-
0
votes0
answers89
viewsQ: return object returned from bank to front-end
I don’t understand why you return On the Node.js server: //Insert user router.post('/', async function(request, response) { let object = { name: request.body.userName, password:…
-
0
votes1
answer72
viewsA: Keep the form open when sending data to the table
In this script you add a commit event listener to the form that executes a fetch, there are other options like Xmlhttprequest //Adicona o ouvinte de evento…
-
0
votes1
answer113
viewsA: Query execution after a few seconds
Call a function inside the setTimeout, passing the delay time it should have (in milliseconds), this function will make an asynchronous call to the php file that runs the Insert…
-
9
votes5
answers2767
viewsQ: HTTP methods in practice
I’ve seen the W3C documentation some questions here at Sopt: What are the HTTP request methods, and what is the difference between them? What are the advantages of using the right HTTP methods? Why…
-
0
votes1
answer145
viewsQ: Angular asynchronous ng-repeat
I am using Angular 1.6.10 to show the data of an API, as the data search is asynchronous, I believe ng-repeat runs before the data is loaded: angular .module('appDataPOA', [])…
-
0
votes2
answers65
viewsA: Tag exchange with javascript
You don’t need javascript, you can do it with css, hide the image, and in the parent div’s Hover show one and hide the other: .produtodesc img { display: none; } .produtodesc:hover p { display:…
-
16
votes2
answers1660
viewsQ: What is a Backend as a Service (Baas)
I would like an explanation of what a Baas is that would overcome some doubts: What is Baas? In general, they are an API and/or framework and/or library? Why? What are the main ones? What are the…
-
1
votes1
answer76
viewsA: javascript exercise
You can simply replace the ? for , please?, so this will put the please in the phrases that have questions function makePoliteQuestion(str) { return str.replace('?', ', please?'); }…
javascriptanswered Costamilam 9,556 -
1
votes3
answers501
viewsA: Like leaving a pie div?
I believe you did the right thing, all you had to do was hide what’s left #pai { overflow: hidden; } #filho { background-color: skyblue; transform: rotate(-5deg); margin: 50px -15%; } #texto {…
css3answered Costamilam 9,556 -
0
votes3
answers446
viewsA: Sum of component numbers
Use the split to transform the value into an array of values and loop to read and add String[] array = numeroQueOUsuarioDigitar.split(""); int total = 0;…
javaanswered Costamilam 9,556 -
1
votes2
answers678
viewsA: What is the most efficient way to take information from any website and use it in an Android APP?
In general you will not get information from reading a website, the most common is to use an API that returns this in a JSON or XML format. The format most used is JSON for being lighter and faster,…
-
8
votes2
answers2106
viewsA: What is the importance of README.Md in Git?
This file creates the bottom of the github projects where there’s a brief explanation of what it is, how to use it and more README.md or .mkdn or .markdown denotes that the file is…
gitanswered Costamilam 9,556 -
1
votes1
answer2698
viewsA: Multiplication algorithm by sum for any integer
My other answer already answers that, just do a check to know which value is higher: n1 = int(input('Digite um número')) n2 = int(input('Digite um número')) # Cria uma variável que vai receber um…
pythonanswered Costamilam 9,556 -
1
votes1
answer59
viewsA: How to take values from an array without array.push
Only one explanation: var array = []; //Cira o array navigator.geolocation.watchPosition(function(position) { array = []; //Zera o array //Cria variáveis com os valores var lat =…
-
1
votes1
answer146
viewsA: How to exchange content without changing the structure?
If you already have everything ready, you can configure the file .htaccess to create a friendly url, as stackoverflow itself uses, a simple example: <IfModule mod_rewrite.c> RewriteEngine On…
-
0
votes1
answer103
viewsA: How to add values from a for structure?
I don’t understand if you want the sum of all d or if you want an array with all the d, the res_soma will contain the sum and res_array will contain all elements K = 5 N = 2 L = 5 del_a = 1.5 del_b…
-
1
votes1
answer51
viewsA: Doubt beginner ! Manipulating series
You can use the function replace: str = "Casa Stark" str = str.replace("Casa ", "") print(str) #Retorna Stark You have to use inside a loop, you can do something like this: array = [ ["coluna 1",…
-
0
votes3
answers265
viewsA: Effect of unwanted scroll
What was causing the problem was the tabs initialization $('.tabs').tabs(); I was able to solve the problem by adding a class to the links that are not part of the tabs and changing the smooth…
-
1
votes3
answers265
viewsQ: Effect of unwanted scroll
I’m using the tab of the materialize, the switch works normally, but every time I click on a tab moves the page to the top, I don’t know why, I believe it has to do with the smooth scroll effect,…
-
0
votes1
answer478
viewsA: Take php function and add to another file
You can use: require "nome/arquivo_funcoes.php"; Or require_once 'nome/arquivo_funcoes.php'; Or include("nome/arquivo_funcoes.php"); Or include_once nome/arquivo_funcoes.php; And call the function…
-
1
votes1
answer28
viewsA: Build templates in PHP or JAVASCRIPT?
That question doesn’t have an exact answer as I said in my comment in that question: I believe that in general the more on the client side the better, but there are cases where this can change, if…
-
1
votes1
answer46
viewsA: Organize mysql select by month groups
GROUP BY serves to group for some value, what you want is the ORDER BY, that serves to order: SELECT *, MONTH(`DataConfirmacao`) FROM `doacoes` WHERE Pendente = '1' ORDER BY `DataConfirmacao`;…
-
1
votes3
answers1243
viewsA: Merge all values at the same array level, at the same level
A single function I believe does not exist but you can use some together: //Uni os array $array = array_merge($array[0], $array[1], $array[2]); //Ordena os array como string, assim ficará [10, 100,…
phpanswered Costamilam 9,556 -
0
votes3
answers62
viewsA: How to use a button along with a function?(Javascript/HTML)
An even simpler way would be to pass the option that the user chose as a function parameter and there do the check In this example I did with switch case, if you prefer you can keep the if else…
-
0
votes3
answers734
viewsA: Show image after loading via ajax
Simply with pure Javascript: document.getElementById('IDdaImagem').addEventListener('load',function(){ this.style.display = 'block' }) <img width="100px" heigth="100px" id="IDdaImagem"…
-
0
votes1
answer494
viewsA: Save to database via javascript
I don’t quite understand if you want this inside the if or of else, but just change: //Funções, exceto construtoras, devem iniciar com minúsculas e com um verbo no infinitivo (convenção criada para…
-
0
votes1
answer373
viewsA: Android - How to create and combine two tables within a list of Sqlite tables on Android?
You need to add a new column in the table parameters, this column will be a foreign key that references the primary key of the aquarium table (aquarioId): CREATE TABLE parametros( //... aquerioId…
-
2
votes2
answers4232
viewsA: Can I use a JSON file as a database?
Can do this with one file functions example of recording: // Array com dados $cliente1 = array( 'codigo' => '001', 'nome' => 'William', 'telefone' => '012 9999-6352' ); $cliente2 = array(…
-
0
votes3
answers68
viewsA: Doubt of HTML5
Problems: Javascript is a weakly typed language, you create a variable with var a or let a and not int a Take the value of the widget when doing document.getElementById() you are taking a reference…
-
2
votes3
answers5180
viewsA: How to generate random numbers in javascript, differently
Simply: Math.round(Math.random() * 550 / 5) * 5 + 5; If you want something with variable values or can be easily called, you can create a function: function myRandom(min, max, multiple) { return…
javascriptanswered Costamilam 9,556 -
1
votes1
answer219
viewsA: Repeated post in sending the data to the controller, how do I fix?
The post is not being sent several times, you are reading it several times, by calling a function within the function itself, creating an infinite loop: You have a function Create and within it…
-
1
votes1
answer1047
viewsA: Insert Data into PHP PDO database
session_start(); include_once("settings.php"); //Verifica se clicou no botão $enviarCadastro=filter_input(INPUT_POST, 'enviarCadastro', FILTER_SANITIZE_STRING); if($enviarCadastro){ $nome =…
-
1
votes1
answer79
viewsA: Multiple users on my Nodejs server accessing the same variable
Imagine that there is only one flow of execution. When a request arrives, it enters this stream, the Javascript virtual machine checks what has to be done, delegates the activity (query data in the…
-
1
votes2
answers42
viewsA: Plural in time_ago
Just add a few more conditions, check also the value of $val, it is 5 then add "ese" if not, add "ês", note that in the plural month there is no rise, in the array I left only the "m", and then add…
phpanswered Costamilam 9,556 -
0
votes1
answer376
viewsA: <select> calling either a text field or another select
//elementos html (select e input) let tipo = document.getElementById('tipo'); let situacao = document.getElementById('situacao'); let filtro = document.getElementById('filtro'); //quando houver uma…
-
12
votes3
answers1529
viewsQ: What technologies can I use to create a PWA
I’ve seen it before What are Progressive Web Apps? and the google documentation, but I’m still in doubt: What are the available technologies that can be used to create a progressive web application?…
-
2
votes2
answers488
viewsA: Best way to relate two tables
The reply from @Murillogoulart is correct but only to be more complete... "In systems analysis, a many-to-many relationship (also abbreviated as N to N or N:N) is a type of cardinality that refers…
-
1
votes1
answer125
viewsA: Combobox brings only one Mysql table result (Nodejs + Javascript)
Just put the select tags out of the loop: <% if(busca.length > 0) { %> <select> <% for(var i = 0; i < busca.length; i++) {%> <option…
-
4
votes1
answer153
viewsA: Search localStorage Json object list for your key name
You can make a loop: localStorage.clear(); localStorage.Deposito1 = 'item 1'; localStorage.Deposito2 = 'item 2'; localStorage.Deposito3 = 'item 3'; for(let i = 0; i < localStorage.length;) {…
-
0
votes5
answers505
viewsA: Is it possible to listen to multiple buttons with a single addeventlistener() ? If it is possible How to do it with pure javascript?
A way to do it without having to loop by adding the event on all buttons: var textarea = document.getElementById('resultado'); document.getElementById('buttons').addEventListener('click',…
-
1
votes1
answer64
viewsA: Doubt Return API Json Android
You can use the library GSON //Instancia o gson Gson gson = new Gson(); //Usa o método gson.fromJson para trans formar o json (primeiro argumento) em uma classe (segundo argumento) ApiSumario…
-
3
votes2
answers56
viewsA: How to select in a table as if it were two records
Using INNER JOIN: SELECT p.nome AS aluno, r.nome AS responsavel FROM pessoa p INNER JOIN responsavel_aluno r ON p.id = r.responsavel WHERE p.e_responsavel = true…
-
0
votes2
answers3043
viewsA: How to add and remove elements with Javascript
The simplest way I know is with innerHTML: document.getElementById('criar').addEventListener('click', function(){ document.getElementById('div').innerHTML = '<strong>Testo…
-
-1
votes2
answers1715
viewsQ: Return entire part in Javascript
What’s the difference of these methods in Javascript? console.log(parseInt(3.3)); console.log(parseInt(3.7)); console.log(Math.floor(3.3)); console.log(Math.floor(3.7));…
-
0
votes1
answer273
viewsA: Cannot add Foreign key Constraint! but syntax and pks are correct
The error is in creating the tables as you put in the comments: CREATE TABLE minsarh.tb_ds_pergunta ( id_ds_pergunta int(11) unsigned NOT NULL AUTO_INCREMENT , ds_pergunta varchar(255) NOT NULL ,…
-
0
votes2
answers144
viewsA: how to assign html code in javascript variable?
If you want to take an html code and assign a variable call it by an id, class, tag name or something: var code = document.getElementsByClassName('menu')[0] console.log(code) <div…
-
0
votes3
answers134
viewsA: View products from multiple categories
Just sort by category If you just want to show first all the data of the X category products and after the Y and so on, you can make a simple select with order by SELECT * FROM produdo ORDER BY…
-
4
votes2
answers655
viewsA: How to save Javascript objects in JSON format in localStorage, and then deserialize them?
Nothing like a test to know what’s going on (with some fixes): getElementById() won’t work if you don’t use document before Withdraw the display: none to see the form Instead of putting a…