Posts by Guilherme Nascimento • 98,651 points
2,383 posts
-
3
votes1
answer1990
viewsA: How to detect internet connection on Ionic?
There is the plugin cited in the documentation itself: https://ionicframework.com/docs/native/network/ to install navigate to the project folder with cd and execute the commands, as in the example:…
-
4
votes2
answers268
viewsA: Open and close the code or use variable?
There’s no right and wrong here, there are needs, at first you saved everything in a string and then played to echo, this is useful if it will treat the variable value including HTML Now if the…
-
1
votes2
answers81
viewsA: Error calling function
Is trying to do a bitwise operation with inteiro and with a string? That makes no sense, agree? I think what you want is something like: def check_bit4(input): mask = 0b010 desired = input &…
pythonanswered Guilherme Nascimento 98,651 -
1
votes1
answer55
viewsA: How to use a Robots.txt on Github pages
If it’s githubpages then it’s a domain something like silas333.github.io, then just go up in your repository robots.txt, i have a website on githubpages and it works normal:…
-
1
votes1
answer361
viewsA: Catch date of the next 12 months with php
With Datetime Use DateTime to catch one month at a time in a loop I use ::modify() can extract, for example: <?php $dt = new DateTime('first day of next month'); $datas = array(…
phpanswered Guilherme Nascimento 98,651 -
3
votes2
answers432
viewsA: Parse error: syntax error, Unexpected '$folder' (T_VARIABLE) in
Its spaces are neither spaces nor tabs, which is within this below (from the gray table below): Behold: The ASCII value of space (" ") is 32 The ASCII value of tab (" t") is 9 Already the ASCII…
phpanswered Guilherme Nascimento 98,651 -
7
votes2
answers795
viewsA: What is http/ftp 220 status?
FTP is not HTTP, are different protocols, work with different tools, have different purposes. There is no HTTP code 220, what exists in the range of 200 are: 200 OK 201 Created 202 Accepted 203…
-
1
votes2
answers30
viewsA: Which way is more correct not to let a function run
After the die it makes no difference what you will write, simply die "kills" the execution and nothing else will be executed after this (with the exception of functions in…
-
1
votes2
answers147
viewsA: How to give a "refresh" after updating the new video?
This is because it is cached, because probably the name is the same, one way to solve is to use a random querystring (which is not repeated, as something based on timestamp). However first it is…
-
2
votes1
answer1088
viewsA: Copy batch files by renaming them with the original directory name
Assuming that the names are random, both of the folders and of the files, what will be enough will be a recursive function to grab the photos, use the cp and copy to a new destination, something…
-
0
votes1
answer49
viewsA: Prevent running . js on mobile
I think your problem is in the structure you thought for the cache, believe me, I have a structure similar to yours that I use on my clients' websites, what I did to solve was add a suffix when…
-
3
votes1
answer22
viewsA: Test value javascript
This is probably it: {{ !(form.tel_numero.length >= 9) }} Because if you don’t use parentheses to isolate, ! ends up making the form.tel_numero.length in a boolean value, true or false, and then…
-
0
votes1
answer78
viewsA: php - fetch_assoc() errors
Spaces are missing at the beginning and end of the string, otherwise they will join/concatenate and it will do something that was meant to be like: SELECT ... WHERE foo='bar' AND baz='bar' AND…
-
2
votes1
answer109
viewsA: Is it possible to verify that two variables are defined in an easier way?
The isset accepts several parameters, thus: if(isset($_POST['sd'], $_POST['video'])){ $sd = $_POST['sd']; $vid = $_POST['video']; $sql = "UPDATE `player` SET `sd` = '$sd', `video` = '$vid' WHERE…
phpanswered Guilherme Nascimento 98,651 -
1
votes1
answer232
viewsA: WEBCAM without Flash
Your only mistake is calling the function when declaring: window.addEventListener("DOMContentLoaded", startCamera()) The right is the right DOMContentLoaded call, getting like this:…
-
0
votes2
answers397
viewsA: Carousel Bootstrap with images coming from server folder
It’s because your while and the foreach are doing the <div class="carousel-inner"> repeated several times, this element must be unique for each Carousel Another situation to be corrected is…
-
2
votes1
answer3290
viewsA: appendchild is not working
It is the order of your execution, you have to use or DOMContentLoaded or the attribute defer on the tag <script>, this because you are running the script before the elements in body have been…
javascriptanswered Guilherme Nascimento 98,651 -
1
votes1
answer588
viewsA: Is it possible to send an email via the "sendmail" command from a local machine?
Simply set up a valid SMTP on sendmail.ini, as I explained in: /a/67017/3635 something like (example with Gmail): [sendmail] smtp_server=smtp.gmail.com smtp_port=587 default_domain=gmail.com…
-
4
votes1
answer103
viewsA: Chr() value outside the range (0.255)
Explain how it happens exactly internally in the PHP script interpreter (in windows or php.exe), PHP is written in c, the code is this:…
phpanswered Guilherme Nascimento 98,651 -
2
votes1
answer167
viewsA: How they work and what the concept of streams in PHP is
This is not about PHP, input and output are basic use in any computer program, in PHP there are protocols to facilitate: php://stdin php://stdout and can be used with fopen, file_get_contents…
-
0
votes1
answer372
viewsA: checked by name and value javascript
This is typo, there is no getElementByName, missing an S, correct is getElementsByName: <!DOCTYPE html> <html> <body> <input type="radio" name="generoi1"…
-
1
votes2
answers332
viewsA: Create random code by loading the PHP page
I would not do this in any way, there are no guarantees of "integrity", names can be repeated mixing files, folders that will be empty can be created and stay there without link with the bank, other…
phpanswered Guilherme Nascimento 98,651 -
2
votes1
answer491
viewsA: How to search the summary in Portuguese by wikipedia API?
If it is the https://pypi.org/project/wikipedia/ define the language using: wikipedia.set_lang("pt") Thus: import wikipedia wikipedia.set_lang("pt") # Defina antes…
-
7
votes3
answers623
viewsA: What is the Javascript Set object for?
The Set is a object that allows setar unique values. You can start a Set empty, or start already with some content from the constructor: let foo = new Set([1, 2, 3, 4, 5]); foo.add(6);…
-
1
votes2
answers1333
viewsA: Error in troubleshooting
If it is the urionlinejudge even, maybe you have selected C (gcc) instead of Javascript (up to another language) in the combobox, as per image: Probably should be: So I think the code should be…
javascriptanswered Guilherme Nascimento 98,651 -
4
votes2
answers667
viewsA: Know all the $_SESSION
Can use var_dump or print_r, thus: <?php session_start(); var_dump($_SESSION); Or so: <?php session_start(); print_r($_SESSION); The print_r is easier to read, because it contains less…
-
0
votes1
answer145
viewsA: Looking for an item in the php XML file
Simply do this (remember the Dice starts counting from scratch, then 0 is the first item, 1 is the second, etc): $rss->channel->item[6]; Example to catch the title: <?php $feed =…
-
6
votes2
answers317
viewsA: Enable Animate.css only when object is clicked
You don’t need to put an entire, relatively heavy library like jQuery just to use Animate.css just add the classes with .className to the desired element, and use the events webkitAnimationEnd,…
-
2
votes2
answers119
viewsA: Attributes in functions - Javascript
If you do that, it’ll work: function Guilherme() { console.log('Chamou o Foo'); } Guilherme.falar = function (msg) { console.log('Guilherme diz:', msg); }; Guilherme(); Guilherme.falar('olá mundo');…
javascriptanswered Guilherme Nascimento 98,651 -
2
votes2
answers202
viewsA: Is the third parameter of filter_input required in PHP?
It’s not, see how this in the documentation: http://php.net/manual/en/function.filter-input.php mixed filter_input ( int $type , string $variable_name [, int $filter = FILTER_DEFAULT [, mixed…
phpanswered Guilherme Nascimento 98,651 -
5
votes2
answers645
viewsA: What is the <output> tag for?
In short, the tag <output> is like the tag <input> with the attribute readonly, the value of it can be sent via request form, so no, it was not enough innerText, since another tag, like…
-
4
votes1
answer554
viewsA: Image compression without changing content format (png, jpeg, gif, webp)
Just use for each image the functions for each format: For PNG imagecreatefrompng imagepng For JPEG imagecreatefromjpeg imagejpeg To GIF imagecreatefromgif imagegif For WEBP (requires PHP 5.4+)…
-
2
votes1
answer702
viewsA: Read latest email - Javamail
Never used, but reading the API documentation: https://javaee.github.io/javamail/docs/api/sun/mail/imap/IMAPFolder.html#getSortedMessages-com.sun.mail.imap.Sortterm:A- I guess you have to use…
javaanswered Guilherme Nascimento 98,651 -
2
votes1
answer90
viewsA: Suggestions from the IDE / how to do?
By using the tag regex I believe your difficulty is changing the #nome of string, in your case I believe this solves: foobar.replaceAll("(^|\\s)#hoje($|\\s)", "$1" + valorAtual + "$2"); Note: I…
-
3
votes3
answers85
viewsA: Error searching string inside another python string
Your ifs are incorrect, and and or are logical operators, they are not part of the in, so this is wrong: if 'são' or 'sao' in self.frase Should be: if 'são' in self.frase or 'sao' in self.frase This…
pythonanswered Guilherme Nascimento 98,651 -
0
votes2
answers295
viewsA: Find out if smartphone (Android and iOS) has Automatic Time Zone enabled using ngCordova
I think finding out if this enabled will not be possible (I’m not sure, maybe there is some compiled plugin that solves, so far I found nothing), but can try to compare the value of "API Date…
-
0
votes2
answers39
viewsA: How to view class information
I’m pretty sure the question is about Woocommerce, if that’s the case, I can’t master this, but I think you’ll solve it using the WC_Order::get_data(), because the variable is protected (protected),…
-
0
votes1
answer1611
viewsA: Json Special Characters Error
Your page must be using UTF-8 and your JSON must have been saved as iso-8859-1/ANSI, do the following, open both json paises.json in sublimetext or Notepad++ and save them as UTF-8: To save using…
-
3
votes1
answer252
viewsA: Disable option if not with Javascript enabled?
There’s no way to get rid of the contents of <noscript> when the user enables Javascript, it will be necessary to do the refresh, and this only the user can do, there is no way around this,…
javascriptanswered Guilherme Nascimento 98,651 -
2
votes1
answer31
viewsA: Knowing if the time is right
Use the event onblur in the input then just use split to split both numbers, this way the event will validate the values and clear the input if they are incorrect, for example: var hora =…
javascriptanswered Guilherme Nascimento 98,651 -
5
votes1
answer381
viewsA: Error: Undefined variable 'x' in'local
I think it should be instead of this: <td><?php print_r($tarefas) ?></td> This: <td><?php $tarefas = busca_tarefas($conexao); print_r($tarefas); ?></td> Because…
-
7
votes6
answers2089
viewsA: Check if a String contains two words
A suggestion with regex, which will probably accept accentuation and will also work with CASE-INSENTIVE, would be using so: public static boolean validacao(String nome){ return nome != null…
-
0
votes2
answers683
viewsA: Sum foreach within foreach
I don’t quite understand, but wouldn’t it be the case that your variable is setting the zero value at every moment: $TOTQtdeFormaRetorno = 0; Should be out of the second foreach, no? So:…
phpanswered Guilherme Nascimento 98,651 -
0
votes1
answer3655
viewsA: Fatal Error : Call to a Member Function bind_param()
This error is because you tried to access the bind_param of the object of mysqli instead of the object generated by prepare, always follow the documentation examples:…
-
1
votes1
answer256
viewsA: Problem with parent element overflow affecting the visibility of a child element with "position: Absolute"
The problem is that position: absolute; will not affect the height of the box-model of the parent element, the cut is by simply the element appear at the height limit, has nothing to solve in this,…
cssanswered Guilherme Nascimento 98,651 -
1
votes1
answer1295
viewsA: Phpmailer + gmail
The main error message is this: SMTP Error: Could not connect to SMTP host. This can occur for several reasons: Your server/hosting network is blocking access to smtp.gmail.com Some firewall or…
-
4
votes5
answers286
viewsA: Regex to capture dimensions of a product with unit of measure
"Simply simplify" using (\s+)? into the spaces be optional, regex does not have to be very simple, but in your case you can simplify a little, like this:…
-
4
votes1
answer271
viewsA: How to write CSV file data without erasing existing data
Just change the w for a+, thus: historico = open("historico.csv", "a+") linha=str(material)+";"+str(mod_elasticidade)+";"+str(tensao_escoamento) historico.write(linha) historico.close() ps: use the…
pythonanswered Guilherme Nascimento 98,651 -
0
votes1
answer323
viewsA: Obfuscate JS Code ES6
I do not master this tool (electronjs), but for general use, independent of Electron I believe that what you are looking for is this: https://www.npmjs.com/package/uglify-js-es6 To install…
-
5
votes1
answer110
viewsA: Why does this syntax error occur?
You’re making a lot of mistakes: The indentation is incorrect foul : after the else besides the else should be elif and the : should come after the name != 'Alice' missing line break after Else the…
python-3.xanswered Guilherme Nascimento 98,651