Posts by ScrapBench • 634 points
33 posts
-
1
votes2
answers31
viewsA: Locking app when adding a new page in Pageradapter
You are accessing an instantiated property in the Pageradapter class or your arraylist is another reference in memory and not the one you pass to your constructor try the following…
-
1
votes1
answer34
viewsA: I cannot compile program in Java
Ta missing Static in your method public static void main(String[] args)
javaanswered ScrapBench 634 -
0
votes1
answer29
viewsA: DIV of Failed Queries: Every derived table must have its Own alias
Your error is missing declaring one as XXX at the end SELECT soma div totalregistros from ( SELECT SUM(espera) soma, COUNT(*) as totalregistros FROM (SELECT…
mysqlanswered ScrapBench 634 -
3
votes1
answer25
viewsA: Location jquery in new tab
No need for JQUERY $(".mySlides").click(function(){ let url = $(this).data('value'); window.open(url, '_blank'); }
jqueryanswered ScrapBench 634 -
2
votes2
answers118
viewsA: How to remove a class of multiple elements whose names obey a certain criterion
Insert in all your <button> class btn in prefix, example: <button class="btn btn-sucess"> Thus the method getElementsByClassName(); will create an array of these Buttons; var btns =…
javascriptanswered ScrapBench 634 -
1
votes1
answer18
viewsA: How to compress folder and download, how to proceed in a simple way?
$zip = new ZipArchive(); $zip->open('nomeDoFicheiro.zip', ZipArchive::CREATE | ZipArchive::OVERWRITE); $ficheiros = new RecursiveIteratorIterator( new…
-
1
votes1
answer78
viewsA: PHP repeating database data
Hello, so from what I see in your code you’re echo twice the same variable <?php $server ='localhost'; $user ='root'; $password ='root'; $dbname ='site_salgados'; $port ='3306'; $db_connect = new…
-
2
votes1
answer163
viewsA: Updating Mysql Table at a Certain Time
It’s clear like this ?? CREATE EVENT nome_do_evento ON SCHEDULE EVERY 8 DAY_HOUR COMMENT 'faz algo as 8:00 am todos os dias' DO UPDATE tabela SET coluna = valor ...…
-
0
votes2
answers2151
viewsA: How to avoid "Missing 1 required positional argument" error when one of the parameters is omitted
Python supports named arguments i.e., Voce can define a variable name in the function arguments: def v(arg=None, arg2=None): if arg: // corre o codigo pro primeiro argumento if arg2: // corre o…
-
2
votes1
answer400
viewsA: How to count the elements of a list
Your python list is called a dictionary, and the format is 'inverted' a = {"aaa":111, "bbb":222, "ccc":333} this is the format of a dictionary in python or are pairs {"key":value} what you presented…
-
1
votes2
answers453
viewsA: Is it possible to return a float value with 2 decimal places to end 0?
Try this as proof var product_price = '100.00'; var value = Number(parseFloat(product_price).toFixed(2)); console.log( value ); console.log(Number(parseFloat(value).toPrecision(5))); console.log(…
-
1
votes2
answers239
viewsA: Consume JSON data from Mysql PHP flock
just use the json_decode(); $retorno = json_decode($o_seu_Json); $retornoAssociativo = json_decode($o_seu_Json,true); //a boolean true no parametro transforma a array em uma array associativa But…
-
0
votes3
answers1776
viewsA: How to show error returned from backend in nodejs in React
You only need to read your Answer’s status property when it comes to receiving it on the front end Depending on how you’re sending the information here’s an example of how you can do it.…
-
0
votes1
answer126
viewsA: Stop execution of an asynchronous function
I think there is a small lack of detail in the understanding of async functions, we cannot stop an async Function because it has already been added to the execution chain by the Event loop when the…
-
3
votes2
answers4009
viewsA: How to upload an image to the backend
So , to start you will need to use a static folder you can do this with express, if you do not have the module still use this npm init -y npm i -S [email protected] Declare the static folder const…
-
-1
votes4
answers60
viewsA: Array assigned to another does not hold the same value
I’ll throw something in the air but technically in Python sharpeners do not exist, but I think by doing it that way yours x is "pointing" to the same object id as the key, ie you have not created a…
-
0
votes2
answers94
viewsA: When logging in redirect to more than one page
The header() principle according to documentation is to keep a single page, you can not open two pages in one tab , that would eventually be an iframe but it is another story, if you want to act yet…
phpanswered ScrapBench 634 -
6
votes3
answers296
viewsA: What are God Objects?
In my view a God Object is a class/object that has many responsibilities, commonly associated with the phrase "Knows Too Much or does Too Much". Normally, God Object has such a strong coupling and…
-
0
votes1
answer148
viewsA: Shuffle array typed by the user in javascript?
I’m using the Fisher-Yates algorithm for random values, if I’ve helped valores = []; function adicionaInput() { var quantidade = document.getElementById('ordenando'); valores.push(quantidade.value);…
javascriptanswered ScrapBench 634 -
0
votes1
answer22
viewsA: Extension does not execute and does not show which error
You’ve tried that already ? Only put the function inside a . js file and reference in HTML And maybe it would be better to check the size of the input and some more error detectors because if my…
-
0
votes2
answers67
viewsA: Dynamic array in php for pg_insert()
You can instead create a JSON object and convert to array with json_decode() $dados = '{"nome":luiz,"idade":21,"status":true}'; $arr = json_decode($dados, true); //o parametro true vai converter em…
-
0
votes2
answers113
viewsA: Mysql select data by period
I think the problem is that you treat datetimes like Dates tries this SELECT * FROM vendas WHERE feita_em BETWEEN '2019-10-10' AND '2019-10-11';
-
0
votes3
answers696
viewsA: How to make a custom filter using the Bootstrap Selectpicker?
Leo, as you requested, you have a solution here that might work in your case. JS: document.getElementById("Id_do_campo_de_pesquisa").addEventListener("keyup",function() { getInfo(this.value); });…
-
0
votes2
answers84
viewsA: Mysql Select replace a code with information
Hello, You can use the if functions of Mysql or even CASE, SELECT Pgto, CASE WHEN Pgto = 'S' THEN "Sim" ELSE "Não" END FROM a_tua_tabela;
mysqlanswered ScrapBench 634 -
0
votes2
answers181
viewsA: Reduce image along with div
Hello try to change your class from navbar-fixed-top for sticky-top And you can also use the scroll-Smooth property of css to help your effect html { scroll-behavior: smooth; } You can also create a…
-
0
votes1
answer1016
viewsA: How do I get the machine name via javascript?
require('dns').reverse(req.connection.remoteAddress', function(err, domains) { console.log(domains); }); To follow up the comment of the question using this function your server will do a DNS reset…
-
1
votes2
answers44
viewsA: How to Improve/Optimize this code?
Good afternoon Alex I would recommend to iterate through an array and create these querys dynamically as an example if(!isset($data)) { return; } $totalDeDataLotes = count($data); for ($i=0; $i <…
-
0
votes1
answer40
viewsA: Dynamic search when writing to input
So to begin I advise you to execute the query that recovers your values right at the beginning of the page and frame these in an array variable client side with your jQuery Then you can search the…
jqueryanswered ScrapBench 634 -
-1
votes1
answer211
viewsA: Wampserver - Accessing Windows cmd.exe and running a file. bat
The problem must be the safe-mode that is active The solution is: stop all Wamp-Server services and close the program Open... / wamp / bin / apache / Apache2 .. / bin / php.ini Copy php.ini for…
wampanswered ScrapBench 634 -
1
votes2
answers144
viewsA: Foreach only works if the array is inside brackets
To use an array without bracket and as you did in the example where it does not work you need to use . push(); But this one needs to be set before var array2 = new Array(); array2.push("9.0");…
-
1
votes1
answer45
viewsA: Jquery seems not to update
Hello, so I think the problem here should be the Onchange Vent that is triggered when you load your dropdown because it considers switching from empty to something and recovers that value, if you…
-
0
votes1
answer147
viewsA: Is there a function that does the same thing as "fetch" in java?
Hello to start your question is very open indeed, but I think I realized the ideal in your situation would actually use something to manage HTTP REQUESTS Retrofit 2 can help you is nothing…
javaanswered ScrapBench 634 -
1
votes2
answers94
viewsA: Button to add numeric value, write to Postgresql database and display on screen with PHP
So if I understand your problem you want to indicate an increment for it you can just create another table in your comic book, being the value indicated in this new table simply created and inserted…