Posts by Valdeir Psr • 10,804 points
433 posts
-
3
votes2
answers144
viewsA: insert a cursor inside of a while on android
In your case, the ideal is to use LEFT JOIN. Left Join, serves precisely to merge the content of two or more tables. This way you will have a cursor with information from both tables. With Left…
-
1
votes1
answer157
viewsA: How to treat variable in bash?
The mistake is in "${PC_FILES}" and "${DROP_FILES}". With the quotes, you’re basically telling the algorithm to capture everything as a string and play in the variable FILE1 and FILE2 respectively.…
-
3
votes2
answers675
viewsA: Position the text in the center
To center the content, just use the attribute gravity or the method setGravity In XML: <TextView android:id="@+id/myId" android:layout_width="match_parent" android:layout_height="match_parent"…
-
1
votes1
answer42
viewsA: HTML: Link a page change
The simplest way is to use iframe, but you can use jQuery, Xmlhttprequest, etc. Example with iframe var menu = document.querySelectorAll("nav ul li a"); var iframe =…
htmlanswered Valdeir Psr 10,804 -
1
votes1
answer445
viewsA: Update form registration with Laravel photo
When Laravel tries to recover an sent file and fails, it returns NULL. Therefore, before checking the extent, size or any other information, it is necessary to use a condition to verify whether or…
-
2
votes2
answers97
viewsA: Problems with setInterval()
The error is happening because you are redeclareting the variable inter. When you define a variable outside the function scope var inter = 0, it is global and can be accessed through any other…
jqueryanswered Valdeir Psr 10,804 -
2
votes1
answer877
viewsA: failed to open stream
The problem is that you are including the file "handlers/Register-Handler.php", but the folder is Handles, without the r.
phpanswered Valdeir Psr 10,804 -
3
votes1
answer781
viewsA: Runtime permissions on android
The permission system android is asynchronous: it returns immediately and, after the user responds to the dialog box, the system calls the method onRequestPermissionsResult of the application with…
-
2
votes2
answers102
viewsA: I need a script (JQUERY) that goes to another page and saves the data.
It is not possible to "control" a page without it. Or at least not in an easy way. Depending on what you really want, it would be best to use the jQuery.ajax to make this request on the page index…
-
1
votes2
answers867
viewsA: How can I echo a JSON in PHP?
If you observe the JSON, its structure is [ {} ], which means that JSON is returning an object within an array. To access this object, first we have to select the array. Thus. $url =…
-
0
votes2
answers1175
viewsA: Get Insert ID after pg_query()
There are two ways to do this, let’s go to the most recommended one in PHP which is using the method/function pg_last_oid The error in your code is because you are passing the method/function value…
-
1
votes1
answer56
viewsA: Error when inserting into BD
The fact that the code does not show the error is because you are returning false when a mistake is cast in the Try.. catch. Tip: Avoid doing this to the fullest. Always handle errors and always…
-
0
votes1
answer26
viewsA: How to catch an hastag on the link?
Yes, it is possible. With the PHP just use the function parse_url $url = parse_url("https://site.com.br/noticia/temer-is-dead#1"); echo $url["fragment"]; To capture the current URL, complete with JS…
phpanswered Valdeir Psr 10,804 -
1
votes1
answer205
viewsA: Read several . txt files and remove duplicate information
You can use the function file to open the file and play all its contents in an array. Then just use the function array_unique to remove identical lines. 01.txt valdeir psr naval fuz. nav valdeir…
phpanswered Valdeir Psr 10,804 -
1
votes1
answer567
viewsA: Fill in form with extension for google Chrome
There are two mistakes: A key browser_action does not have the script, only browser_style, default_icon, default_title, default_popup, theme_icons. The file is calling the onload method, after the…
javascriptanswered Valdeir Psr 10,804 -
1
votes1
answer607
viewsA: Notification when I receive message in the background
If you are not using the Firebase or another database, I recommend using them. This way you will receive database changes when they occur. This will avoid unnecessary delay and save battery. If you…
android-notificationanswered Valdeir Psr 10,804 -
1
votes2
answers68
viewsA: How to not log actions from a specific IP in Nginx?
It is possible using a condition and disabling the access_log nginx. For this just open the file /etc/Nginx/sites-available/default and add the code below. location ~ /(.*)$ { if ( $remote_addr =…
nginxanswered Valdeir Psr 10,804 -
2
votes1
answer181
viewsA: Calculate average speed of the last MYSQL table records
As I do not know the progress of the project, I will assume that you have not yet developed the connecting part of the database. To use the Mysql with the PHP, it is necessary to use the extension…
-
1
votes2
answers56
viewsA: AJAX request is running before click
This is happening because the action is being done by clicking on the form (or inside it). The correct is to apply the action by clicking the button. <!DOCTYPE html> <html lang="pt-br">…
ajaxanswered Valdeir Psr 10,804 -
3
votes3
answers1821
viewsA: Basic Doubt Javascript: How to change an object attribute?
To accomplish this "change", you can create a new attribute and remove the old one. Thus: lista = [ {valor: "azul", tamanho: "grande"}, {valor: "verde", tamanho: "pequeno"}, {valor: "branco",…
javascriptanswered Valdeir Psr 10,804 -
0
votes1
answer38
viewsA: Adapt transparency code in this PHP code
To use alpha channel with function imagecreatetruecolor, it is necessary to use two other functions. imagealphablending and imagesavealpha. For this just replace: $temp_image =…
-
2
votes1
answer118
viewsA: validating only .com.br regex
It’s not working because, at first, you’re putting a ? br. This, in regex, means that the value is optional. The second way, when you inform {2,4}, you mean for the software to take only the data…
-
1
votes1
answer789
viewsA: Can you create a cron to delete files with retroactive dates?
You can use the command find to fetch the old files and then remove them. find /path/to -type f -mtime +7 -print0 | xargs -0 rm -- This way, the command will list all files that were modified at…
-
1
votes1
answer286
viewsA: Namespace does not work in php 5.5
It happens because you’re not giving include or require_once, for example, in the index.php file. One of the ways to work with structures in PHP is to use the function spl_autoload_register. This…
-
2
votes1
answer484
viewsA: How to focus input from a form constantly?
In that case you should use the .phocus since the .Blur works only to detect when the element loses focus. $('#text2').focus(function() { $('#text1').focus(); }); <script…
-
1
votes1
answer71
viewsA: Link color declared in string.xml (Versions below N)
To use HTML in Textview or similar, you must use the class Html, android native. This class has a method called fromHtml which serves precisely this function. In the case of a Textview, you can use…
androidanswered Valdeir Psr 10,804 -
0
votes3
answers2099
viewsA: How to convert String to INT in following situation:?
It happens because when you do (int)$largura, PHP does not interpret javascript code, it simply takes all the content and tries to turn it into a numeral. Since there is no number to be returned, it…
phpanswered Valdeir Psr 10,804 -
0
votes4
answers1914
viewsA: Show table on page after clicking a button
You can add the class ". Hide" in the table, this way: <table width="100%" class="table table-bordered table-hover table-responsive table-striped hide" id="empenho_solicitante"> <!-- Code…
-
0
votes2
answers1276
viewsA: Undefined variable in PHP
The error is due to variable $raio not found within the method calculaArea, to use an out-of-method variable, use the $this->nome_da_variavel…
-
1
votes1
answer2083
viewsA: How to sum the values of an SQL column
You can use the Group By to group the values in SQL and SUM to sum the grouped values. SELECT donate_id, donate_name, Sum(donate_amount) AS donate_AMOUNT FROM donate GROUP BY donate_name ORDER BY…
-
0
votes1
answer169
viewsA: Empty textarea post with ajax jquery and formdata
According to Article Formdata, the id "cadas_anuncio" must be the form. Thus below. <form id="cadastro_anuncio"> <textarea name="myFormField"></textarea> </form> Also check…
-
4
votes2
answers539
viewsA: Keep script running
If you have access to the SSH server, you can run the code below to leave the process in the background (even by dropping from the server). nohup php -f /path/to/script.php &…
-
0
votes2
answers44
viewsA: Add javascript to worddpress
You can put this code in the file wp-content/themes/SEU-TEMA/functions.php function load_scripts() { wp_enqueue_style( 'style-name', get_stylesheet_uri() ); wp_enqueue_script( 'script-name',…