Posts by Guilherme Nascimento • 98,651 points
2,383 posts
-
2
votes1
answer38
viewsA: List system or directory fonts for a dropdown
Except what the @Rafaeltavares commented, there is the API (not enabled by default) that only works in Chrome (you need to enable in chrome://flags/#font-access (since the Chrome 87) In summary when…
-
4
votes1
answer71
viewsA: Using CPF generator in Postman
For any kind of data you can set the variables in the Pre-request Script, whether it is a random value for CPF or for something else. Use pm.globals to define a global variable, example:…
-
4
votes2
answers3036
viewsA: How to check which file is the latest in a Python folder?
In view of Mr Woss' reply, I suggest a few modifications: Instead of creating a function (lambda) for time (creation or modification): data_criacao = lambda f: f.stat().st_ctime data_modificacao =…
-
2
votes1
answer44
viewsA: How to move between windows?
For that there is the Tkinter.Frame and with the method pack to display the frame you want and using the pack_forget (can use the forget_grid if working with grids) to hide (remove), very simple…
-
2
votes1
answer27
viewsA: About the HTML iframe
The cache control is not done by the "tags" as IFRAME and is not solved on the front end, it is done by what the reply HTTP specify and by what the user’s browser decides to maintain, will not…
-
2
votes2
answers174
viewsA: What color format should be used in the range parameters of the "cv2.inRange" function?
The cv2.inRange() uses HSV (which you may already know, is used to be closer to what human eyes perceive) and seek in the documentation itself:…
-
4
votes2
answers76
viewsA: How to add images to a program generated by Pyinstaller?
Have 2 steps to follow, first add the file to the "packaged", you can do this in two ways: Using the parameters --add-data and --add-binary The --add-data should be used for non-binary files such as…
-
1
votes1
answer27
viewsA: How to make a Window always stay above the others in PYQT5?
There is no guarantee that it will stay on top always, especially if other programs use the same feature, I’ll have to be a little more honest about it, programs at the top have always bothered me,…
-
0
votes1
answer29
viewsA: What’s different from php.ini in Apache2 and CLI?
One is specifically to be used for apache and another for when you will run php via terminal, which need have nothing to do with web, for example run composer or execute CRON that calls scripts…
phpanswered Guilherme Nascimento 98,651 -
3
votes1
answer66
viewsA: "echo" shows decimal number with comma instead of dot
In accordance with the documentation until PHP7.x string conversion was affected by locale A value can be converted to a string using the (string) $variavel or the function strval(). The string…
-
0
votes1
answer44
viewsA: Allow maximize and minimize windows in Pysimplegui
Looking at the documentation (readthedocs.io), see that you have the option resizable = False,, the standard is False then just adjust to True, example: # -*- coding: utf-8 -*- import PySimpleGUI as…
-
1
votes1
answer31
viewsA: How to remove the blue background from the table item when selected?
This is QSS (Qt Style Sheets, a style loosely similar to CSS), to style you can (should) refer to the official Qt documentation (and not your "Wrappers"), in the case of QSS styles:…
-
1
votes1
answer21
viewsA: How to customize Jwplayer with Javascript functions
To get the current position of the video you can use jwplayer().getPosition() (in your code something like playerInstance.getPosition() and to detect the change of position of the current video…
-
1
votes1
answer46
viewsA: Pyqt5 - Set an Inputmask on a Qlineedit to type only the "F10" key
Just apply setReadyOnly(true) So in Pyqt5: self.lineEdit.setReadOnly(True)…
-
1
votes1
answer31
viewsA: scroll down to map region - google maps
Just look at the documentation on each method you are using, see: Infowindowopenoptions The default is to scroll to display the infoWindow when available, to "make it intuitive" probably, but as the…
-
6
votes2
answers78
viewsA: Line Break inside the P tag does not work
This is because the split() divides the <br> also, what you can do is use a regular expression, so instead of split() you can use String.prototype.match, see how the array looks after:…
-
1
votes1
answer35
viewsA: Regular Expression to validate email provider string - Java
The important thing is to start with the documentation https://docs.oracle.com/en/java/, in that case the indexOf (java.lang.String) combined with the substring (java.lang.String), use the return of…
javaanswered Guilherme Nascimento 98,651 -
3
votes1
answer48
viewsA: Scroll (scroll bar) with the same look in multiple browsers
The styling of scrollbar with -webkit-scrollbar is a unique feature for Webkit-based browsers (such as Safari) and Blink-based browsers (such as Chrome and Chromium). For modern browsers probably in…
-
0
votes1
answer71
viewsA: Pyqt5 - Identify who pressed F10 on a Qlineedit
Use the PyQt5.QtWidgets.QShortcut with PyQt5.QtGui.QKeySequence('F10') or with the shortcut PyQt5.QtCore.Qt.Key_F10 Note that to run the shortcut only in the specific widget you need to inform the…
-
1
votes1
answer62
viewsA: How long does Developer lru_cache live?
There is no specification for life time, only for size, the @functools.lru_cache works as a dictionary, so as long as your application and function with the decorator are there the feature will…
-
3
votes1
answer41
viewsA: subtraction of error months in 31 days (strtotime)
According to the documentation: https://www.php.net/manual/en/datetime.formats.relative.php To get the last day of a month you must use last day, you can see in the documentation link where this…
-
3
votes1
answer46
viewsA: How to style/customize the colors of the variables within VSCODE?
Go to the file settings.json, to access it go to View > Command Pallete or simply press Ctrl+Shift+P (or Cmd+Shift+P in Macos), so in the field that appears type settings.json and select the…
visual-studio-codeanswered Guilherme Nascimento 98,651 -
4
votes4
answers143
viewsA: Show days of the week
First of all, there’s no use datetime.date(ano, mês, dia) if you’re already using today() And to check if it is Saturday or Sunday just check if the value of weekday is greater than 4, if it is less…
-
2
votes1
answer134
viewsA: How to capture the Header of a PHP Curl request?
Use the variables $_SERVER['HTTP_*'] to get the headers in case: $input_data = file_get_contents("php://input"); $authorization = $_SERVER['HTTP_AUTHORIZATION']; You can also use the function…
-
1
votes2
answers231
viewsA: Selenium - Unable to login ( unsecured browser )
You probably have to activate less secure apps on https://myaccount.google.com/lesssecureapps, when accessing click the button where it is marked OFF, as in the image below Another possibility (but…
-
4
votes3
answers190
viewsA: CSS catch siblings before element?
To reply by @Bacco is great, however where there are spacing if you accidentally hover :hover the parent element will be applied: Note how it turned yellow in the case of the example does not cause…
-
3
votes2
answers129
viewsA: How to choose a random array element in Javascript?
A suggestion made by @K-Gun would use bitwise operator ~ (NOT) twice to approach the integer, for example: let value = 5; console.log(value); // 0000000000000101 console.log(~value); //…
-
11
votes4
answers150
viewsA: What regular expression to use to replace symbols in a string?
No need for regex, and even if it still needed you would have to use a loop, as it is or while to solve other things. Create a simple object to map what you want to replace and use…
-
6
votes1
answer124
viewsA: How to discover the CSV delimiter by PHP?
Use strpos or preg_match may conflict, as some CSV may come like this: "foo,bar","Nome";"Telefone" Or else: "foo,bar";"Nome","Telefone" Depending on the type of check as: $handle =…
-
5
votes1
answer148
viewsA: How to hide characters from a Cpf using substr_replace() in table column?
If you are absolutely sure that there will be 14 characters (11 numbers plus 3 points), then just apply in the second parameter 4, which represents 3 digits plus the dot, and in the third parameter…
phpanswered Guilherme Nascimento 98,651 -
2
votes1
answer43
viewsA: How to fire an event if the user stays up with the mouse for more than 3 seconds?
Just use setTimeout in the mouseenter and clearTimeout in the mouseleave, example: let timeout; const e = document.querySelector("p"); e.onmouseenter = () => { // 3 segundos timeout =…
javascriptanswered Guilherme Nascimento 98,651 -
1
votes1
answer48
viewsA: Get App version in Play Store
You can use what is indicated in the documentation itself https://developer.android.com/guide/playcore/in-app-updates To install you can import the Play Core library to the Android project as a…
androidanswered Guilherme Nascimento 98,651 -
1
votes1
answer85
viewsA: Open Python file in a different folder (Explorer)
There is the medium without "almost dependencies", which is using the parameters, example: import sys if len(sys.argv) > 1: arquivo = sys.argv[1] print(arquivo) else: print('Digite o caminho…
-
2
votes1
answer221
viewsA: Is it possible to use Websocket connections in Apache?
There is the mod_proxy_wstunnel (requires Apache 2.4.5 and also have installed and enabled the mod_proxy) Basically in your .conf (depends on the system, in windows usually gets the majority in…
-
2
votes1
answer72
viewsA: Regex how to separate by groups each occurrence
From what I understand the question you have generated: <a href="https://hiperlynk" title="title">Cool Text</a>(class="ext-link-icon" data-super="..." foo="bar") You want to take the…
-
2
votes2
answers102
viewsA: How to convert the If-Modified-Since header to a date (and vice versa)?
Actually to send the Last-Modified doesn’t need the If-Modified-Since, the If-Modified-Since already is consequence of Last-Modified, then if the claim is to send only the filemtime($arquivo) as…
-
0
votes1
answer78
viewsA: How do Ionic app running task in the background?
Task in "background" is one thing, Job is another, Job can be timed as well as can be in "real time". Note that on Android 10 or higher (I do not remember well) if you make much use of it, or a bad…
-
0
votes1
answer58
viewsA: AJAX AND XHR FALIED REQUEST PROBLEM
When jQuery’s Ajax sends a request it also sends the header x-requested-with (request), so you have to set up on cors() the Access-Control-Request-Headers thus: Access-Control-Request-Headers:…
-
2
votes1
answer34
viewsA: PHP - Using phpmailer passwords
It is partially safe, there is only one possibility of password leak in PHP scripts, it is if some debug that shows the source is on, but this would not fail to have put the password in the class…
-
3
votes1
answer2372
viewsA: Array and string offset access syntax with Curly braces is no longer supported
Change the following lines: $d += $cpf{$c} * (($t + 1) - $c); for $d += $cpf[$c] * (($t + 1) - $c); And the next: if ($cpf{$c} != $d) { To: if ($cpf[$c] != $d) { As the message itself says: ...…
-
5
votes2
answers218
viewsA: Alternative to __filename and __dirname in Node.js with Ecmascript Modules
As the source on Soen suggests several uses for working with the import.meta.url Alternative for __dirname in Node when using the --experimental-modules flag, however what has not been said is that…
-
3
votes3
answers104
viewsA: How does inheritance work with "Constructor Property Promotion" in PHP 8?
The estate ->foo will be accessible, because each one belongs to one of them, however ->foo will have the value NULL, because simply overwriting a method within the "child method" will need to…
-
2
votes1
answer151
viewsA: How to define the HREF property of HTML dynamically, with Alpine.js?
I believe the author has already found the answer as he himself commented, yet yes to formulate the answer aiming to help future visitors. Before answering, for those who have doubts where to find…
javascriptanswered Guilherme Nascimento 98,651 -
0
votes1
answer364
viewsA: Attributeerror: str Object has no attribute 'num_points'
I believe the goal is to access the "father" class, so change: Experimento.__init__(material, num_points, time, 'ponto fixo') For super(), thus: super().__init__(material, num_points, time, 'ponto…
-
3
votes1
answer29
viewsA: Div with max-content width does not break line
If the goal is to limit the div to the screen size you can try the max-width: 100vw; which is relative to the view-port size: .foobar { font-size: 28px; background: #eee; padding: 10px; }…
-
2
votes1
answer168
viewsA: Does "Artisan" need the cmd to remain open?
Yes, but it could have been "programmed" in different ways, but there the goal is simply to have on the screen log outputs and possible errors already in the interface itself. Example, I downloaded…
-
1
votes1
answer27
viewsA: Keyframe in css for background effect
Yes, it is normal, they do not blink, in fact the area is with white background, the next image has not been loaded yet, if you have been on a slow internet, like a slow 3G, maybe not even see the…
-
6
votes2
answers353
viewsA: Why does Typescript when compiled convert "Let" to "var" in variables?
This is because the --target (or just -t) by default will convert to ES3, very similar to ES5, but has many Apis that do not exist in it (although in this case depends on the browser) and will not…
-
0
votes1
answer253
viewsA: Pagseguro API 401 error - Unauthorized; Error logging in paid
That body you put on is totally wrong: body: { email: encodeURIComponent(process.env.PGS_EMAIL), token: encodeURIComponent(process.env.PGS_TOKEN) } That’s not how the fetch() works, if it is…
-
0
votes1
answer64
viewsA: How to execute formula when the cell is filled?
Just use the SE() within the =SE() again, something like: =SE(A3="";"";SE(A4="";"";HOJE()-A3)) If understood the logic is to apply the formula only if A3 and A4 are filled. You can also simplify…
excelanswered Guilherme Nascimento 98,651