Posts by Renato Tavares • 2,031 points
88 posts
-
0
votes3
answers61
viewsA: Automatic filling product name
No, only with HTML is not possible. You need at least one Javascript to pull the texts from another location, but the recommended is to pull the data from a given product of the database. Ideal is…
htmlanswered Renato Tavares 2,031 -
0
votes1
answer54
viewsQ: SQL grouping product balance by company
What I need to do is I need to put together a report that will return the stock of products by individual companies. select must return the following:…
-
1
votes1
answer77
viewsA: String methods - isdigit and isdecimal
It is mainly about Unicode classifications. See some examples to show discrepancies: >>> def spam(s): ... for attr in 'isnumeric', 'isdecimal', 'isdigit': ... print(attr, getattr(s,…
pythonanswered Renato Tavares 2,031 -
0
votes1
answer151
viewsA: Uncompromising a CSV file import using Pycharm
Problem is not from the IDE, you are reading a CSV file and Python is reading the file correctly. You need to format the output to the way you want it. If I remember well in the Panda documentation…
-
1
votes1
answer451
viewsA: Error in foreach - Notice: Array to string Conversion in
Exchange your <?php echo $value.["id_animal"] ?> for <?php echo $value["id_animal"] ?> and tries
-
2
votes1
answer82
viewsA: Title with PHP variable
If while watching the HTML of your site and the tag title is normal, so everything will be quiet for Google. Remember that Google indexes your site according to his will, not to mention that the…
-
2
votes1
answer961
viewsA: Pass parameter to route Resource | Orange
In the documentation of Laravel available here, in the controller this parameter is not exemplified Request $request it seems to me to be transparent to the Resource controllers. Your error…
-
4
votes2
answers253
viewsA: Is it possible to generate an executable in Android Studio?
Unfortunately, as far as I know, it’s not possible. When you compile your code, it generates a bytecode that runs on a JVM, but this JVM is dedicated to the android system. Anyway you need an…
-
1
votes1
answer31
viewsA: Page Template - List data and send to another template
You can browse the list of products by taking their ids and using them to compose the URL of produtos-item.php <a url="produtos-item.php?id=$id">produto 1</a> You will recover on the…
-
0
votes2
answers84
viewsA: How do I get a given function to return the value of a date variable and a numeric one in php?
Why not use an array as a return? function proximoDiaUtilPr($data, $saida = 'Y-m-d') { // Converte $data em um UNIX TIMESTAMP $timestamp = strtotime($data); // Calcula qual o dia da semana de $data…
-
1
votes1
answer23
viewsA: Generate array with substring positions
Why not use the explode() in the string and turn every sentence into an array? Then reassemble the string with the new text? <?php // Example 1 $pizza = "piece1 piece2 piece3 piece4 piece5…
-
1
votes1
answer277
viewsA: Ways to instantiate a Java String
Basic difference is that the first example will be in the string pool and the second in the object memory. Also use the String x = new String("y"); is slower than the other method. Check out this…
javaanswered Renato Tavares 2,031 -
1
votes1
answer95
viewsA: Subfolder configuration in htaccess
Is he not ignoring the folder? Try deleting the second option like this: # Configurações do url <IfModule mod_rewrite.c> RewriteEngine On # Angular APP RewriteBase /app/ RewriteCond…
-
1
votes3
answers3153
viewsA: Alert in an html boot
In HTML <input type="submit" class="btn btn-primary" id="btn_cadastro" onclick="cadastro();" /> In your Javascript function cadastro() { alert("Oiii"); } See an example working:…
-
0
votes2
answers39
viewsA: How to view class information
Two things: You cannot access this object directly because it is protected If you were public you could use the example below to get an idea class Foo { public $data = ['shipping' =>…
-
-1
votes2
answers52
viewsA: Problem with Vagrant up - Homestead-7 already exists
Try to access your virtualbox with the graphical interface, there should be a virtual machine there called Homestead-7. Delete it and try again. This happened to me and deleting the machine by…
-
3
votes1
answer256
viewsA: What is Keybase Proof?
And an archive of the site https://keybase.io/ it serves to tell Keybase that you actually own the github account. Keybase looks like a social network, but its users have security keys, which allows…
githubanswered Renato Tavares 2,031 -
0
votes1
answer215
viewsA: Array help with multiple PHP levels?
Possibly this is a JSON response, use the function json_decode() to convert this to a PHP array. Example: <?php $json = '{"a":1,"b":2,"c":3,"d":4,"e":5}'; var_dump(json_decode($json));…
-
3
votes1
answer395
viewsA: Close libreoffice Writer via terminal on Ubuntu
Try using the following command ps aux | grep -i office | awk {'print $2'} | xargs kill -9 Or the shorter version kill -9 `pgrep -lf soffice.bin | awk {'print $1'}`…
-
1
votes1
answer40
viewsA: Web service for web/android
You have to pass a parameter during the request, stating which web service you want to access. It would be a half mouth alternative, better even would be to have a webservice for each device as it…
-
2
votes3
answers994
viewsA: Query with connection to more than one mysql php database
First question and check the database, its internal structure. As it was not posted I will assume that the database ocomon_rc6 really has the table ocorrencias. Second, the code you posted is…
-
0
votes1
answer130
viewsA: Update a record with a single field
I think your problem is something else. The mistake Parse error: syntax error, Unexpected T_VARIABLE means that PHP was not expecting the definition of a variable at any given time. Check out this…
-
2
votes1
answer196
viewsA: PHP Dynamic Function
I believe you want something like this. public function Lista($tabela){ $sql = "SELECT * FROM '$tabela'"; $results = array(); $stmt = $this->conn->prepare($sql); $stmt->execute(); if($stmt)…
phpanswered Renato Tavares 2,031 -
1
votes1
answer72
viewsA: Integrity breach not released in BD Sqlite
You need to enable foreign key verification support with the following command: PRAGMA foreign_keys = ON; So the Sqlite will know that you need to check the foreign keys. You can check this in the…
-
0
votes1
answer118
viewsA: HTTP libraries/HTTP server
It wouldn’t be like Apache since built-in servers are quite limited, full servers like Apache have numerous settings and extra features that built-in servers don’t have. They usually serve for quick…
-
2
votes1
answer419
viewsQ: Implementation of ANSI C queue
I have a code (end of question) that allows manipulation of a queue in ANSI C, my question is as follows: The code declares a data type of its own to store the data of the queue and has a function…
-
0
votes2
answers1627
viewsA: Generate random name in Mysql - Stored Procedure
Have you considered using a tool like http://www.generatedata.com ? it can generate outputs in multiple formats, including SQL
-
1
votes1
answer52
viewsA: Send email to all registered
Try something like the example below. Your problem was that the mail function was outside the loop, so it would only be excommunicated once. Inside the while she will send an email for each record.…
-
4
votes1
answer2328
viewsA: Error Notice: Trying to get Property of non-object when picking the page title
You have some errors in your code, the first of it is - Never use @ to suppress error messages, this makes your code slower and harder to debug. If you hadn’t put the @ would know the reason for…
-
1
votes2
answers431
viewsA: Creating a website and back-end with PHP frameworks
Briefly, the statement of his friends proceeds. Large frameworks like Laravel help the developer simplify countless tedious day-to-day tasks, but this comes at a cost. They load several packages…
-
1
votes1
answer86
viewsA: What is the best method to build Meta-tags for SEO?
In reality you only need 2 tags for Google to understand your content. A description which will contain a description of the content of the page and the tag title which will contain the main title…
-
1
votes1
answer2641
viewsA: Error "Parse error: syntax error, Unexpected end of file"
Test something like that: <?php function conecta( ) { if(!defined("HOST")){ define('HOST','localhost'); } if(!defined("BD")){ define('BD','bala'); } if(!defined("USER")){ define('USER','bombom');…
phpanswered Renato Tavares 2,031 -
4
votes1
answer50
viewsA: Mailchimp return amount in PHP
In the official documentation there is the option count which allows specifying the number of records to be returned. The example below should work cool (brings 100 records). $ch = curl_init();…
phpanswered Renato Tavares 2,031 -
1
votes2
answers277
viewsA: Display the first 5 divisional numbers by 3, discarding the number 0
You need to use a flag to verify that you have printed all the first 5 numbers. #include <stdio.h> #include <stdlib.h> int main() { int n = 20; int flag = 0; for(int i=1; i<=n; i++) {…
-
0
votes1
answer1716
viewsA: Error using php Curl ssl certificate
Your problem is due to the lack of some parameters required when making requests to https page. The correct one would be: <?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,…
phpanswered Renato Tavares 2,031 -
1
votes1
answer72
viewsA: Mysql backup with create schema
The command mysqldump not only backup the data but also the database structure. It has several options that generate the output you need, for example --create-options, --add-drop-table and…
-
1
votes1
answer75
viewsA: Fine-tuning Ranking for a Game System
The error already says it all. You need to set an alias for your derived tables. Look at the example below: SELECT SUM(`quant`), MONTH(`date`) AS month, `id` from ( ... inner select ) group by id,…
-
2
votes3
answers1167
viewsA: How to make language selector
You can use the Flagstrap that does exactly what you want, or still use the Countries dropdown with flags that also meets your needs.…
-
1
votes2
answers1461
viewsA: How to insert query result in mysql with python
Change your line: cursor.execute("""INSERT INTO temperatura (temp, umidade) VALUES ('temp', 'umid')""") For this one: sql = "INSERT INTO temperatura (temp, umidade) VALUES ('%s', '%s')" % (temp,…
-
0
votes2
answers551
viewsA: Problem with duplicate form sending
I’ve seen something similar using Jquery: $("form").submit(function() { $(this).submit(function() { return false; }); return true; }); There is also a plugin called jquery-safeform that solves…
-
1
votes1
answer61
viewsA: Mysqli prepared sentences
If it’s a login system, there’s a problem - I don’t know if this is all your code, but if it is, you should also look for the password, never just email. If your goal is just to inform the user…
-
2
votes1
answer30
viewsA: Paypal buyer’s email returns in incorrect format
That format comprador%40gmail%2com means that the return has been encoded to be sent in a URL, one can return to the correct format using urldecode()…
-
1
votes1
answer622
viewsA: How to receive a variable within the php URL
I am not going to answer the question itself, because the general concept is very wrong and unsafe. Breaking your entire login system is frighteningly easy because you’ve made some very amateur…
-
1
votes2
answers1071
viewsA: Capture event close window
The example below works well in current browsers: <html> <head> <script type="text/javascript"> window.onbeforeunload = function() { return "Tem certeza que quer fechar?" }…
-
2
votes1
answer318
viewsA: Redirect all media requests(css,js and images) with htaccess
Tested something like this? I believe it solves your problem. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{DOCUMENT_ROOT}/public/$0 -f RewriteRule…
-
0
votes2
answers143
viewsA: Copy all before the first blank line
I’m not sure if I understand correctly, but if your goal is to remove the blank lines, you can use the following command: sed '/^\s*$/d'
-
1
votes3
answers2136
viewsA: Error 500 Internal Server Error
First, if this code in the pastbin is your complete code, it is missing the PHP opening and closing tags. <?php ?> and there is a return; out of a function. And then on line 3 the variable $a…
-
1
votes2
answers6059
viewsA: Create executable program with php, html and mysql
First, PHP is a interpreted language and as such, no executable files are generated from it. You can even create desktop applications using the PHP-GTK, but as the language was not created for this…
phpanswered Renato Tavares 2,031 -
0
votes1
answer102
viewsA: Show PDF in browser without printing or saving
Unfortunately I believe that this is not possible, since, everything that the browser displays can be downloaded in some way, just need to know where to look and how to convert. But if you need to…
pdfanswered Renato Tavares 2,031 -
2
votes1
answer898
viewsA: Interpret the JSON response of a Webservice that was called by Arduino
Different from what happens in high-level languages like Python and PHP, in C (mainly in Arduino) when making a request, will be returned character by character of the web service and there are no…