Posts by Guilherme Nascimento • 98,651 points
2,383 posts
-
1
votes1
answer241
viewsA: How to take src from an img of <content:encoded> Angular 7
The image is in a CDATA, so it’s like text to Domparser and not like HTML, so you won’t find anything, so .getElementsByTagName('img') returns an empty Nodelist Another thing, namespace tags like…
-
1
votes1
answer110
viewsA: Nginx forwarding without proxy
You created two serve {} with the same parameters of port and server_name, then probably only the first is recognized, the second is ignored, to solve just put both location{} within the same serve…
-
2
votes1
answer82
viewsA: Is there any kind of PEP8 for PHP?
Yes (although it is not official PHP), there is the PSR, at the moment exist: Basic Coding Standard Coding Style Guide Logger Interface Autoloading Standard Caching Interface HTTP Message Interface…
phpanswered Guilherme Nascimento 98,651 -
2
votes1
answer855
viewsA: How to disable the right mouse button event in Angular 7?
The (click) as well as the parameter 'click' in @HostListener will execute as addEventListner, click event works even only with left click, if you want to make more iterations with mouse you should…
-
2
votes1
answer680
viewsA: SESSION PHP LOGIN
I think the mistake is this: if ($linhas == ''){ Exchange for: if ($linhas == 0){ Because mysqli_num_rows always returns int and no empty string, in the case when no results will return zero (0) Now…
-
4
votes2
answers136
viewsA: Python flask Static status 304
The code 304 HTTP is not error, otherwise no code in range 3xx will necessarily be error, but all are always referring to redirects. In case flask already implements E-tag or if-modified system in…
-
2
votes1
answer487
viewsA: Redirect everything to index.php HTACCESS
I don’t quite understand the problem, I don’t know how you’re trying to get the GET, but I think the flag is missing [QSA], being like this: RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-f…
-
0
votes1
answer160
viewsA: Get SRC attribute value of an image inside the DIV
You are trying to get the DIV src and not the image, if the getElementById returns the DIV element, so you have to run in the DIV context getElementsByTagName('img'), so it will take any descending…
phpanswered Guilherme Nascimento 98,651 -
0
votes1
answer74
viewsA: GET method does not access data in mongoDB
I believe you tried to define true in a scheme that expected a value of the kind Date: data: { type: Date, contentType: Number, default: true } Probably what you want is the "current date", so set…
-
0
votes2
answers816
viewsA: In requests, how to correctly read the ISO-8859-1 encoding?
If you refer to display in terminal or windows command prompt then to resolve you should set in python the charset script, thus: # -*- coding: latin-1 -*- import requests from bs4 import…
-
1
votes1
answer232
viewsA: Analyze request and decide action, Chrome extension
If detalhes.url returns a string exactly like: http://ouo.io/s/1XTIn2cB?s=https://google.com You can use the API URL that is native, to manipulate and extract specific data, as I said in this answer…
google-chromeanswered Guilherme Nascimento 98,651 -
3
votes2
answers3422
viewsA: Css effect when mouse clicking
You could try using the dial :target for elements with Ids combined with the URL HASH, for example: .spin:target { animation: spin 3s linear infinite; } The code must be something like: Click on the…
-
8
votes3
answers500
viewsA: What’s $(this.hash) in jQuery for?
This is not a jQuery syntax exactly, to understand we need to first talk about the this.hash, elements such as <a> and <link> (and possibly some others, which support Urls), are…
-
2
votes1
answer279
viewsA: Node ~ Failure in Segmentation
First of all, any mistake with npm distributed via repositories always confirm that it is not lacking to update the program, your problem may be with Node, it may be with npm can be with Ubuntu, see…
node.jsanswered Guilherme Nascimento 98,651 -
0
votes1
answer87
viewsA: I believe it’s an overflow mistake
This is probably because your Python is 32bit, so the architecture does not support large numbers, in the @Andersoncarloswoss example (https://repl.it/@acwoss/sopt-Question-387036) works because the…
-
2
votes1
answer795
viewsA: Play private videos with the Youtube API
With private I believe it is impossible, what you can/should use is the unlisted To change privacy do the following steps: Sign in to beta version of Youtube Studio. In the menu on the left, select…
-
1
votes1
answer809
viewsA: Error making request in Ajax
The mistake specifically when they contain null: from origin 'null' has been blocked by CORS policy Indicates that you are trying to access via protocol file:// probably (definitely?!), then for…
-
0
votes2
answers430
viewsA: Alert message Response Headers
First, "message" is not a "valid" header, I really don’t know why this wanting to do this way, headers are usually browser instructions, content BODY should be the place to use something like this,…
-
3
votes2
answers154
viewsA: Removes spaces produced by line breaks
And why not just use a native function, like http_build_query()? Example: $urlCorreios = "http://ws.correios.com.br/calculador/CalcPrecoPrazo.aspx"; $data = array( "nCdEmpresa" => "", "sDsSenha"…
phpanswered Guilherme Nascimento 98,651 -
0
votes1
answer298
viewsA: Error generating a PDF by PHP
It’s a typo, you wrote it first $mpdf and then $mdpf, changed the p for d: $mpdf = new \Mpdf\Mpdf(); ---> Aqui esta M P D F $mdpf->WriteHTML($conteudo); ---> Aqui esta M D P F…
phpanswered Guilherme Nascimento 98,651 -
3
votes1
answer307
viewsA: Webbrowser does not load css c#
CSS is working yes, what happens is that simply Google is carrying a "lighter" and "older" version of your site, this is because either it does not recognize your browser as a modern browser, or…
-
1
votes1
answer1874
viewsA: Use of getter and Setter on Dart
Dear @Aiken, if you do by the methods you can modify by methods you can treat the input, allowing only "correct" values for the class rule/logic. This is the basics of "visibility" in OO with…
-
1
votes1
answer23
viewsA: Conflict in Archive . Htacess
Place [L] at the end of each RewriteRule that are in fact different "rules", as is the case, it is also necessary to note that the regular expression with (.*) will catch anything, is like a "joker"…
-
2
votes2
answers133
viewsA: How to move the cursor to the end of content with span of a contenteditable element after Focus
Lazyfox’s answer is almost correct, but the child elements affect the cursor, in case the range.setStart(el, 1); will move the cursor on the parent, but any Element (textNode "does not count")…
-
1
votes2
answers1313
viewsA: How to extract a text from a page?
Assuming you are using bs4 you could use the method yourself getText (https://www.crummy.com/software/BeautifulSoup/bs4/doc/#get-text) from bs4 import BeautifulSoup soup =…
-
2
votes1
answer49
viewsA: Position elements in the horizontal
Elements <p> are block by default (user agent style uses display: block;), then just exchange for or other element that is inline, as <span>, something like: <div class="back">…
-
1
votes1
answer233
viewsA: Destroy specific session in PHP
A simple idea would be at the time user authenticate you would save the value of session_id() in some file or table of LOGONS, and in the user "administrator" you would have a page that would…
-
2
votes1
answer275
viewsA: How to soften the anchor effect?
Before the: window.location.href = target_id; It will lead directly to the element, without the scroll, but I believe that already imagined Second, with all due respect and forgive me beforehand,…
-
1
votes1
answer47
viewsA: Doubt of beginner in javascript
If I understand your doubt, while will rotate several times, while the j is GREATER than 50, as it is divided this number will decrease, when it is equal to or less than 50 o while will stop. The…
javascriptanswered Guilherme Nascimento 98,651 -
0
votes1
answer145
viewsA: Media queries within nesting - Sass
SCSS does not run, SCSS/SASS is converted to CSS, and yes, writing a media query within SCSS will be converted to CSS correctly, the SCSS language is not a usage language ("executable") and yes to…
-
3
votes2
answers248
viewsA: Close PHP and ASP connection or not?
I believe that perhaps in the documentation it has not been made clear, it is not a question of closing at the end with mysqli_close or automatically, what the documentation that is to say it is…
-
3
votes1
answer457
viewsA: Select all elements of a CSS class except $(this) with jQuery
You wouldn’t even need something like :not, just do the Hide and then the show just for the selected one, like this: $(".link").click(function(event) { $(".link").hide(); $(this).show(); });…
jqueryanswered Guilherme Nascimento 98,651 -
2
votes1
answer532
viewsA: Run program on linux in an easier way (generated by Electron)
According to the documentation: https://electronjs.org/docs/tutorial/application-distribution First you must download pre-compiled binaries: https://github.com/electron/electron/releases Then copy…
-
5
votes1
answer71
viewsA: What is the default speed value in Bootstrap 4 animations?
As per bootstrap SCSS source https://github.com/twbs/bootstrap/blob/master/scss/_variables.scss it seems that are these: $transition-base: all .2s ease-in-out !default; $transition-fade: opacity…
-
3
votes1
answer1258
viewsA: Problem generating PDF with mPDF in hosting
The solution is in LOG itself: Unable to set PDF file Protection, CSPRNG Functions are not available. Use paragonie/random_compat polyfill or upgrade to PHP 7 If CSPRNG functions are not available…
-
2
votes1
answer261
viewsA: How to change the voice genre of Microsoft.Speech.Synthesis synthesizer?
I don’t know if it has anything to do with it, but I think maybe I’m getting my age: sp.SelectVoiceByHints(VoiceGender.Male, VoiceAge.Adult); VoiceAge.Child indicates to use the voice of a 10 year…
c#answered Guilherme Nascimento 98,651 -
4
votes1
answer104
viewsA: Pegcity does not exist in type 'string'
It’s a typo In your class you have this: city : string; And here you tried to access the method PegarCidade() of the variable this.city: this.city.PegarCidade().subscribe( (retorno : any) =>{…
-
2
votes3
answers1214
viewsA: bs4.Featurenotfound (Beaultifullsoup and parser error)
You requested the use of lxml, reading the error message it informs: Couldn’t find a Tree Builder with the Features you requested: lxml. Translating: You cannot find a structure/tree builder with…
-
3
votes1
answer68
viewsA: POST sent by ajax is empty in php
This is "typing error" in jQuery to inform the method nay we use method:, that is wrong: $.ajax({ method: "POST", The correct is type:: $.ajax({ type: "POST", It is worth noting that in jQuery 1.9+…
-
2
votes1
answer101
viewsA: REST in the microframework Inphinit
I am the developer of this framework, let’s isolate some explanations Inphinit requires a class with 7 functions Actually not required, all are optional, basically the class Rest checks which class…
-
3
votes1
answer39
viewsA: Error calling Setter PHP method with Interface!
Your script is full of errors, first: $this.setUserEmail($uMail); The $this in PHP usa -> and not point, should be: $this->setUserEmail($uMail); Second, class methods should always be accessed…
php-7answered Guilherme Nascimento 98,651 -
2
votes1
answer405
viewsA: How to fix: Object has no attribute, in python?
This is a typo, you named the constructor as: __Init__ When it should be with minuscule letters: __init__ That is, without the __init__ the self.__notes cannot be "declared". See how it works…
pythonanswered Guilherme Nascimento 98,651 -
4
votes1
answer295
viewsA: What is the difference between extension and library in PHP?
What is PHAR in PHP First I want to make it clear that PHAR files are not extensions, they are "packages" that can contain an entire application (and usually contain) to facilitate installation and…
-
2
votes2
answers317
viewsA: Why does "echo" accept parentheses in PHP?
Is not the echo that accepts parentheses, what happens is that everything that comes afterward of echo with or without parentheses will be understood as values, for example one or more strings or…
-
17
votes1
answer243
viewsQ: Always display "progress/load" or only when a request seems to take longer than expected?
My question is about ux (user experience), it is not about material-design and the like and it is also not about "think", but about some experience in this type of functionality that has already…
uxasked Guilherme Nascimento 98,651 -
3
votes1
answer118
viewsA: cat file.txt VS. cat < file.txt
The command cat file.txt simply reads the file and displays it on the screen, or more precisely displays it on stdout, not always going to be a screen, in your current case yes, since it is using…
-
1
votes2
answers106
viewsA: HTML - is it possible to determine the content of an input?
Any input value will always be text/string (except in type=file) Even in inputs like: <input type="number"> <input type="tel"> Regardless of whether you write a number or not in the…
htmlanswered Guilherme Nascimento 98,651 -
4
votes2
answers2019
viewsA: Invalid character in file . bat
Your file was possibly saved with UTF-8 WITH BOM (GOOD being the abbreviation of BYTE ORDER MARK) in the notepad, ie at the top of the document .bat or any kind of document, when it is saved with…
-
1
votes1
answer1439
viewsA: "PDO" class not found after upgrading from PHP 7.2.13 to PHP 7.3.0 in Debian 9
It is possible that you have installed PHP7.3 without installing the PDO, since in many distros some extensions are downloaded only via repository, which makes them optional, so even if you enable…
-
2
votes2
answers210
viewsA: How to change the file extension recursively in GNU/Linux?
Probably could use $(dirname $file) to take the path of the current file folder in the loop for file in ./**/*.sql; do mv "$file" "$(dirname "$file")/$(basename "$file" .sql).md" done…