Posts by Wallace Maxters • 102,340 points
1,984 posts
-
1
votes1
answer256
viewsQ: Problem with parent element overflow affecting the visibility of a child element with "position: Absolute"
Ah, there are a few things in CSS that sometimes stress me out! I have a parent element responsible for listing several items. And inside these items, when I pass the mouse on a given link, a dialog…
cssasked Wallace Maxters 102,340 -
2
votes2
answers687
viewsA: Send a recorded video via Javascript by input type="file"
Wrong! You can not put change the value of input via Javascript. The API simply does not allow you to do this. That is, a file in the input[type=file]. But as I have already used this plugin, the…
-
1
votes1
answer6223
viewsA: How to use quotation marks inside quotation marks and exchange words inside the argument?
To use quotes within a string definition, you need to escape it with \. Thus: "meu nome é \"wallace\" The result will be: 'meu nome é "wallace"' You could also replace double quotes with single…
-
1
votes2
answers2549
viewsA: How to set Python 3 as default in linux?
I solved the problem by creating an alias through ~/.bashrc. Code >> nano ~/.bashrc Put the following code at the end alias python=python3 One could say that the command upate-alternatives…
-
5
votes1
answer848
viewsQ: How to calculate the percentage difference (or similarity) between two strings?
I’m using PHP in an application I’m developing, where I have a text editor. In this text editor, with each change made, before saving, I create a record with the original data (i.e., how they are…
-
1
votes2
answers33
viewsA: How to email each new record?
As the previous answer said, you should think about the question of performance. And by directly answering your question about "Or is this a job for a background service?" I would say it would be…
postgresqlanswered Wallace Maxters 102,340 -
3
votes2
answers2549
viewsQ: How to set Python 3 as default in linux?
When I type the command python, Ubuntu runs Python 2.7. However, in the new versions of Ubuntu, Python 3 is also installed. When I run python -V, appears "Python 2.7.12", but I would like to use the…
-
2
votes1
answer292
viewsA: Connection to separate PDO databases - (multi-tenancy )
In your case, young man, I would reimplementate that connection. I believe that Singleton in this case (and in the majority, in my humble opinion) is more of a structure than helps. I believe that a…
-
2
votes1
answer67
viewsA: Check the start value of a variable
You can use the function strpos. She will return you to the position in which determined string was found in your variable $teste. Return 0, means that this string is at the beginning. $teste =…
phpanswered Wallace Maxters 102,340 -
2
votes1
answer610
viewsA: Pass variable query buider Laravel
You are using one Closure within another. To do this, you need to pass the variable to the scope of the second Closure through use. Your code is like this: ->leftJoin('estudantes_carga_horaria',…
-
9
votes3
answers619
viewsQ: What is String.raw for in Javascript?
Well, that’s the question. I would like to know what the method is for String.raw in Javascript. I saw something in the documentation of MDN, but I did not understand very well the use Has something…
-
4
votes1
answer180
viewsA: Error: "Unable to connect to cache daemon: Permission denied" when not using SUDO
Really, the problem is with folder permission. Just run the following command to resolve: sudo chown $(whoami) ~/.git-credential-cache/
-
0
votes1
answer180
viewsQ: Error: "Unable to connect to cache daemon: Permission denied" when not using SUDO
I used that command git config --global credential.helper cache to store the login cache in bitbucket when git pull in production. Everything works perfectly when I use the command sudo git pull,…
-
6
votes2
answers2115
viewsQ: What is a TXT (TXT record) entry for in a domain?
The entrance is usually used TXT (TXT record) when you set up a domain to point to an email server. I’d like to know what the purpose of TXT. What’s an entrance for TXT? How to read configuration…
-
14
votes5
answers2296
viewsQ: What good is a C#?
I saw a class in C# that was stated like this, in a reply I read in Soen: public sealed class Link { // Resto do código } What is the key word for sealed in the above case?…
-
2
votes1
answer444
viewsQ: How to make a chained file with pure Javascript?
How to make a dazed call with Javascript native Promise? I mean, I would like the sentence below to be executed one after the other and I would like to know when that sequence of Promises is…
-
1
votes1
answer444
viewsA: How to make a chained file with pure Javascript?
I saw a solution for this in Angularjs. I adapted this solution to native Javascript. See the code below: var promise = Promise.resolve(); console.log('iniciando...'); [1, 2, 3, 4, 5].forEach((i)…
-
1
votes1
answer368
viewsQ: VS Code is not searching in library folders (Vendor, node_modules, etc) after updating
After I updated my VS Code, by pressing the shortcut CTRL+P, I can no longer view third-party library classes installed in the folder vendor. I noticed that the same behavior occurs for the folder…
visual-studio-codeasked Wallace Maxters 102,340 -
1
votes1
answer368
viewsA: VS Code is not searching in library folders (Vendor, node_modules, etc) after updating
To solve this, just press the shortcut CTRL + , (or File >> preferences >> Settings) and add the following line to the configuration: "search.useIgnoreFiles": false That solved the…
visual-studio-codeanswered Wallace Maxters 102,340 -
13
votes2
answers1340
viewsQ: What good is a Viewmodel in ASP.NET MVC?
I’m used to the MVC approach of frameworks as Cakephp and Laravel. Now that I’m getting deeper into ASP.NET MVC, I’d like to understand what this Viewmodel is for. What is the purpose of the…
-
1
votes2
answers97
viewsA: Angularjs and Laravel edit modal
I guess since jQuery doesn’t follow the Angular’s "Digest Cycle," you’d have to perform a $scope.$apply() so Angular can recognize the data change in its modal. I would do something like this:…
-
2
votes2
answers138
viewsQ: How to make an input redirect (equivalent to "<" on Linux) with Powershell?
On Linux, when we want to do an output redirect, we use the symbol >. echo "Olá mundo" > Hello.txt I did the above test on Powershell and got the same result. It turns out that when I needed…
powershellasked Wallace Maxters 102,340 -
1
votes1
answer47
viewsA: When I click on the tag reference id it does not call the page I want
The Author of the Question informed that it has the following code snippet: <li class="nav-item"> <a id="ClicouNaTag" class="nav-link" href="index.php"> <em class="fa…
-
4
votes2
answers163
viewsQ: File.Exists and the accentuation
I have a system developed in Webforms (Eca!) that checks the existence of an image to then display it. Everything is working correctly, however, when the image path has accents, the method…
-
7
votes2
answers1712
viewsQ: What is the difference between the prefer-dist and prefer-source options in Composer?
In Composer, when we install the library, we can add as an argument the options --prefer-source or --prefer-dist. I would like to know what each one does and/or if there is a difference between the…
commiserateasked Wallace Maxters 102,340 -
4
votes1
answer427
viewsQ: Is there any way to detect the second monitor/screen with Javascript?
I wonder if there is any way to detect the existence of a second monitor with Javascript. In a scenario where I was using two monitors/screens on my computer, I would like to open a popup via…
-
3
votes1
answer201
viewsQ: How to resolve or reject a Promise (native) in Javascript outside of your scope?
Most of the implementations I see of Promises (promises) in frameworks Javascript treats the use of Promises in a way that it is possible to access the functions responsible for rejection and…
-
3
votes2
answers269
viewsQ: What is the __defineSetter__ and __defineGetter__property for?
Every time I open the Chrome Console, I keep an eye on the properties autocomplete, to see if something new comes up, something I haven’t learned yet. And it struck me to see that objects have the…
-
3
votes2
answers2893
viewsA: Change date and date time format in Mysql
If you are using PHP, you can use the database date and display it in the desired format: $date = new DateTime($data_do_banco); echo $date->format('d/m/Y H:i:s'); But it is also possible to do…
-
0
votes3
answers459
viewsQ: Is there a specific event in Javascript to detect when a <option> of a <datalist> is selected?
In Javascript, it is possible, through the onchange, oninput and related, detect if a certain input is amended. Example: var qs = function (el) { return document.querySelector(el); }…
-
1
votes2
answers180
viewsA: Use Static Closures or Closures in PHP?
According to the PHP documentation, the purposes that could be applied using static in a Closure would be: Prevent it from being linked to the context (Class) in which it is called. Example: class…
-
2
votes1
answer128
viewsQ: How to get the duration of a formatted video in Html5?
I am developing a player in Html5. I am in the part where I need to display the total duration time and the current time. But I only know how to get the values through the float. Example…
-
4
votes1
answer1732
viewsQ: How to put an iframe on fullscreen (full screen)?
I made this little player to be used inside a iframe. But I need to give you the option to put it in full screen (as most video players I know do), but I have no idea how to do that. I’ll leave the…
-
4
votes2
answers5448
viewsQ: Is it possible to mirror an image horizontally (flip) with Canvas?
I know it’s possible to mirror horizontally <img> with CSS, but wanted to know if it is possible to mirror an image horizontally inside a canvas. With CSS, I would do like this: #img-flip{…
-
1
votes2
answers412
viewsA: How can I style the <select> arrow in Firefox?
I’ll make a contribution. I’ve solved this using a "wrapper" class around a select, where I remove all the style of this. In this "wrapper" I use the pseudo-element ::after to create the arrow (with…
-
1
votes1
answer51
viewsQ: How to make database transaction in Webforms?
I got a stock in a file .aspx that runs multiple Inserts in the bank. I need that if something fails, the operation is canceled, since one record will depend on the other. I usually use a…
-
4
votes1
answer111
viewsQ: How to put a border / Stroke in an <image> in an SVG?
I need to add one stroke around a <image> within a <svg>. But nothing happens when you add the value to that tag. See below what happens: when I use on <image> does not work, but…
-
6
votes3
answers2496
viewsQ: How do I find the C# version I’m using?
I wanted to know how to find out the version of C# I’m using.
c#asked Wallace Maxters 102,340 -
3
votes1
answer39
viewsQ: Is there any way to run an event whenever the Sqlconnection.Update method of Dapper.Contrib.Extensions runs on an entity?
I’ve been using Dapper for a short time and so I have little experience with it. I wonder if there is any way to detect changes in a specific field. I need this because in a given table, every time…
dapperasked Wallace Maxters 102,340 -
14
votes1
answer152
viewsQ: Is there any difference in performance between writing a file as a response and writing to a file as a part (buffer)?
I have a t2.micro instance on Amazon where I use IIS 10 as server and webforms in the application (C#). In a certain part of the application, I need to grab a list of image files from a certain…
-
1
votes1
answer28
viewsQ: Is there any way to extend a main file into Webforms?
I am maintaining an old application that uses Web Forms. This application uses Iframe to make a kind of layout reuse. The problem is that even doing this, a lot of code is repeating, and I’d like a…
-
2
votes1
answer1940
viewsQ: How to resize an image in c#?
I’m working on an application that uploads images. It turns out that the customer sometimes sends these images with a very large resolution, which is not necessary in our case (reaching 7MB). I need…
-
1
votes0
answers242
viewsQ: What is this net::ERR_SPDY_PROTOCOL_ERROR error while uploading?
I’m using Google Chrome to run some tests on an application that I’m servicing. I am specifically using Ajax to upload a ZIP file. When I do the tests on my machine locally, the upload usually…
-
7
votes4
answers260
viewsA: Send data to server even if window is closed
I was reading about it and I came across the method Navigator.sendBeacon. It seems that this method allows you to send small requests in order to send analytical data to your server. // Adiciona um…
-
2
votes2
answers274
viewsA: Return of Collection after Update
The statement of the question is wrong. find does not return Collection, returns the Model. And it’s easy to solve the problem if you’re using a variable and saving the result of the query in it.…
laravelanswered Wallace Maxters 102,340 -
4
votes2
answers1662
viewsQ: How to convert to Base64 in C#?
I am using Webforms. There is a certain part of this application where I send, through Ajax, a string Base64, which is the code of an image. I’m used to using PHP and use the functions base64_encode…
-
3
votes1
answer331
viewsA: Problem in Django’s send_email function
It seems that you are trying to get the user who completed the form to send an email to you. But then things won’t work out that way. At least, until today, when I needed to make a form where the…
-
0
votes1
answer178
viewsQ: How to ignore Django.contrib.auth Migrations?
I have a Django application where I intend to customise the authentication part. I’ve already made my own Backend of authentication, as well as configuring my own Model that will be used in…
-
4
votes2
answers1159
viewsQ: How to make a "LIKE" in a DJANGO ORM query?
To make a query to get the data accurately in Django, I use the filter, thus: usuarios = Usuarios.objects.filter(nome='Jonh') This will generate an SQL similar to: SELECT * FROM usuarios wHERE nome…
-
2
votes2
answers231
viewsA: Error Parse error: syntax error, Unexpected ';' in C: xampp htdocs adoption backend valida.php on line 32
Young man, the mistake is that you put an expression on else. There is no expression in else. If you need to use a conditional second expression, use elseif. Example: if (expressao) { // bla }…
phpanswered Wallace Maxters 102,340