Posts by Wictor Chaves • 8,445 points
320 posts
-
2
votes3
answers932
viewsA: Current or formal argument lists differs in length
It is asking for if assigned the arguments(Parameters), this is the cause of the error. To use Scanner, you must import: import java.util.Scanner; An example of using taking an input via console:…
javaanswered Wictor Chaves 8,445 -
1
votes1
answer118
viewsA: Searching for values with PHP - Is it possible?
I made this function you enter with the file you want to search, the column where you will search the value and the column where you will return the value and the search value. <?php function…
-
2
votes2
answers11713
viewsA: How do I make python read line by line?
It opens the file as read-only 'r', loads all lines in the Arq variable and prints line by line: #!/usr/bin/env python # -*- coding: utf-8 -*- arq = open('arquivo.txt', 'r') texto = arq.readlines()…
-
5
votes2
answers1020
viewsA: Format ZIP in Query - Mysql
Use this function: DELIMITER // CREATE FUNCTION mask (unformatted_value BIGINT, format_string CHAR(32)) RETURNS CHAR(32) DETERMINISTIC BEGIN # Declare variables DECLARE input_len TINYINT; DECLARE…
mysqlanswered Wictor Chaves 8,445 -
1
votes3
answers2361
viewsA: Configuration Network via prompt
Create a file with the . reg extension (example: proxy.reg) with the code below: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings] "MigrateProxy"=dword:00000001…
-
0
votes4
answers13368
viewsA: What are files with extension . cpp and . h?
The files . cpp is the source of your c++ code and . h are header files. When you do a include you are adding a library to your code: #include "header.h"
-
1
votes2
answers226
viewsA: Jscript and CSS - Rotate by running the div instead of an image
According to the code of your link, the image is not inside the tag with id content but inside the tag with id image, there are two image ids, and you should remove the id repeated, let’s assume…
-
1
votes1
answer896
viewsA: Successful Toast dialog when sending the form with PHP
It’s very simple, do it this way: if (!$mail->send()) { echo "<script> $(function(){ Materialize.toast('Mailer Error: ".$mail->ErrorInfo."' , 2200) } }); </script>"; } else { echo…
-
1
votes1
answer73
viewsA: Problem with subquery
He is saying that the subquery is returning more than 1 value, see its first subquery, it does not have the "sum" so it will return several values select (valor * 0.05) from tbl_exames Either you…
-
0
votes2
answers944
viewsA: Menu, submenus Dynamic NAV Bootstrap with PHP PDO Mysql
So the code gets smaller and easier to see, as much as my code isn’t 100% the way you need it, to adjust it is simpler this way. In the second query I put it to get the id of the first query and in…
-
0
votes2
answers196
viewsA: Bring item from an API in Swift
It’s not because there’s a key missing in the code? let httpStatus = response as? HTTPURLResponse if httpStatus?.statusCode == 200 { if data?.count != 0 { let respJson = try!…
-
3
votes1
answer753
viewsQ: How to run a script without worrying about special characters?
I made a batch for windows to install some programs and make settings automatically, it worked normally, but when doing a test using a folder that had space in its name it stopped working, put in…
-
2
votes1
answer30
viewsA: Simple doubt about json
This code you posted is just a stretch of jquery. JSON: Javascript Object Notation As the name itself says it is only a notation, that is a way of writing. See an example of a JSON code: {…
-
1
votes2
answers502
viewsA: Dynamic component name Delphi
So you can catch the element using a string, as in jquery: var painel: TPanel; painel := FindComponent('Pn' + IntToStr(ponteiro)) as TPanel; if painel <> nil then painel.Visible := not…
delphianswered Wictor Chaves 8,445 -
2
votes2
answers39
viewsA: Create variables with database data?
To get the 3 results is simple: $result = mysql_query("SELECT * from tabela order by id DESC LIMIT 0,3"); $itens = array(); while ($row = mysql_fetch_array($result)) { $itens[$row['id']] =…
-
0
votes1
answer301
viewsA: How to save information like pprint to a txt file
I figured out how to do, there is a method within the pprint itself that does this to pformat. from pprint import pformat saida = pformat(valor).encode('utf-8');
-
0
votes1
answer301
viewsQ: How to save information like pprint to a txt file
I am creating a function to generate a log file: def setLog(msg): file = open(nome_arquivo, adicionar_informacao) if type(msg) == str: msg_log = msg.encode('utf-8'); else: try: msg_log =…
-
1
votes1
answer166
viewsA: How to hide a CSS materialize checkbox from css
The materialize is composed of two elements: The input that is the element itself <input type="checkbox" id="test5" /> And the label that is the visual part of the element <label…
-
-1
votes3
answers827
viewsA: Create serial number generator button
The html code: <input type="text" value="" id="txt_serial"> <input type="button" value="gerar" id="botao_serial"> Import the jquery: <scritp…
-
0
votes3
answers102
viewsA: Replace command output with a custom message
You can do it this way: Let’s use the ls command as an example ls > saida.txt it will throw the entire output into the output.txt file and will not show anything on the screen, you can analyze…
-
1
votes1
answer297
viewsQ: Concepts for the adoption of object orientation
I came across this question, researched it and the correct answer is: e) computing is triggered by the exchange of messages between objects. I agree that the And is true, but what I don’t understand…
-
0
votes5
answers1319
viewsA: Insert "X" value after some characters
Import the jquery: <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script> Set as you wish, position where X will be, if it will be another character and textarea id.…
-
0
votes1
answer752
viewsA: Compare two simple strings in C, input with scanf();
When picking up a string you don’t need to use &, J that string name is already a memory address. char pass[5]; printf("insira a senha: "); while(!strcmp(pass,"asdfg")) { //enquanto a senha for…
-
3
votes1
answer73
viewsA: Increase text size by scrolling the page
This changes a little what you want in the pixel issue, but I believe it will look better in the final result. You configure the min and max and the intensity that the source grows in the control…
-
1
votes1
answer235
viewsQ: Error while trying to run android emulator without android studio
I installed android studio and studied how to use Avd without the need of android studio, I learned how to make the machines via command line and it worked perfectly, but when I went on another…
-
4
votes7
answers49407
viewsA: How to install PIP in Windows 10?
If Python is already in the environment variables just do so: python -m pip install -U nome_pacote If you’re not: <pasta_onde_esta_instalado>\python.exe -m pip install -U nome_pacote…
-
1
votes4
answers2092
viewsA: Null values in PHP
When you use "" this is not null but an empty string. Use this command that takes the type of the variable to better understand: echo gettype(""); echo gettype(null); The first will return string…
-
1
votes1
answer848
viewsA: jquery - variable pass from one page to another
Create cookies to move the variable to the other page, with this function becomes easier to create: function setCookie(name, value, duration) { var cookie = name + "=" + escape(value);…
-
3
votes2
answers1560
viewsA: How to know which tab is selected
Use jquery for this(But it can also be done with pure javascript), add jquery to the page: <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script> <div…
-
0
votes1
answer315
viewsQ: How can I copy a machine from android studio to another machine, without needing to install android studio?
I installed the android studio on my machine and created a machine with android to emulate the applications, but now I want to take only this machine that I created and put on another computer, I’m…
-
1
votes1
answer298
viewsA: Record Mysql PHP Radio Button
There is how I pass the price, without using the value of the radio button? Create an input to type Hidden, or multiple if it becomes easier to understand. <input type="hidden"…
-
3
votes1
answer922
viewsQ: How to create an emulator without using the ide?
I need to emulate android on my machine, but I did not want to use a virtual machine because it would use many features, wanted to use sdk tools android studio, but also did not want to install…
-
0
votes1
answer474
viewsA: Assign value using val(value) or attr('value', value) does not work
With the help of Anthraxisbr the question has been resolved: $(document).ready(function () { $(".twitter-typeahead span").text('dfsd'); var campo = $('input.cidade_estado'); campo.keypress(function…
-
0
votes1
answer474
viewsQ: Assign value using val(value) or attr('value', value) does not work
I’m using the typeahead, which works as follows, every text I type in the field it takes the value of the field, goes to a database, searches and creates a dropdown with the values found. It works…
-
0
votes1
answer109
viewsA: JSON Return Giving Error
It is because the "codeClient" is inside the "clienteModel" array, so you must first take the "clienteModel" array". String[] clienteModel = jsonObjectEntity.getStringArray("clienteModel");…
-
1
votes1
answer103
viewsA: Light and delete background content with Animation
I made an example, but I don’t know the intensity or the time you will want, so to regulate the way you want, you need to regulate only these values: Ease - The time of animation normal - When the…
-
0
votes1
answer36
viewsQ: Connection only works with manually set values
I have a Socket class that is working normally this way: class Socket(): __ffChatSocket = "" __meuTelefone = "" __WhatsappAPI = "" __dest = () def __init__(self, telefone, WhatsappAPI): ip =…
-
1
votes1
answer599
viewsA: How to recover PHP array for javascript comparison?
So it will go through the data array and each input of the Voce array can be accessed with the "."(dot) plus the attribute name as for example "user", see the code below for better understanding.…
-
1
votes2
answers77
viewsA: Error when Count() less than 1
It does not find the $total variable because it does not enter if where the "$Results" is found and does not initialize the "$total". So before I check if the variable "$Results" exists and if it is…
phpanswered Wictor Chaves 8,445 -
4
votes1
answer435
viewsA: Remove "scratches" from a textarea
Just add in your CSS: textarea { resize: none; } Remembering that this will remove the "scratch" and also disable the resizing of textarea.
-
0
votes2
answers5343
viewsA: How to run a jquery script when loading a page
With this script the results will be: Federal: - Nome State: - State - Nome Municipal: - State - City - Nome Now this easier to make any changes, since you need to worry only about the values that…
-
3
votes1
answer51
viewsA: How to do a while with 2 checks
I take it you don’t want to do an assignment but a comparison, right? If it is it should contain "==" instead of "=", because if the assignment works it will always return true. while($mediaA==0.5…
-
3
votes1
answer1177
viewsQ: How can I run my script when I’m sure it’s run as administered?
I want to run a batch(.bat) and check if it was opened as an administrator, here’s an example of what I want on linux: if [ `whoami` == 'root' ] then echo I am root else echo I am not root fi I…
-
2
votes2
answers111
viewsA: Selects nested in jquery or javascript?
If you already use jquery please remove the line that adds the script. <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script> <table id="table_com_parcelas" class="table…
-
0
votes1
answer62
viewsA: I can’t generate that second vector
Remembering the remaining positions of the array that are not used, and should be ignored when displaying the array. int valorAnterior = vet1[0]; int contatodor = 0; for(i=1;i<=9;i++) {…
-
0
votes2
answers414
viewsA: Problems with contact form 7 - obsolete on_sent_ok function
Try replacing wpcf7submit with only Ubmit, because wpcf7submit is not an event. add_action( 'wp_footer', 'mycustom_wp_footer' ); function mycustom_wp_footer() { ?> <script>…
-
0
votes2
answers970
viewsA: Check open or closed popup window
Why not try to store the value in a cookie? Once you submit the event to open the pop up you create the cookie and in the event of closing the window you remove the cookie. I found this code can be…
javascriptanswered Wictor Chaves 8,445 -
1
votes1
answer127
viewsA: Replace default CTRL+F from browsers with a jQuery event
Test add and.preventDefault(); $(document).keydown(function (e) { if (e.keyCode == 70 && e.ctrlKey) { $("#dataTable_filter").find('.form-control').show().focus(); e.preventDefault(); } });…
-
1
votes3
answers80
viewsA: Deleting parts of a Text
You can do it this way: #!/bin/bash caminho='/home/meucliente/publlic_html' from="/home/" replace="" caminho=${caminho//$from/$replace} from="/publlic_html" replace=""…
-
0
votes2
answers215
viewsA: Gather background information that is in different arrays in the same array
Try to use this code: $temperos = array(); foreach($itens['tempero'] as $index => $item){ $indice = 'tempero'.$index; $temperos[$indice] = array($item, $itens['quantidade'][$index],…
phpanswered Wictor Chaves 8,445