Posts by Wallace Maxters • 102,340 points
1,984 posts
-
1
votes1
answer109
viewsQ: Relationship count in Laravel 4
In Laravel 4, we do not have the method present in Laravel 5.2 >= called withCount. That one withCount is responsible for adding to SELECT the counting of items related to the current entity. For…
-
1
votes2
answers434
viewsA: What’s the difference between the remote Github repository and the remote one on my dedicated server?
No, it doesn’t. Github is a website. Git is a tool. Github simply uses a backend to read the information from the Git repository and shows it nicely to you. If you use VS Code or Visual Studio,…
-
4
votes1
answer1179
viewsA: Add value to a date with PHP
It’s always safer in these cases to use DateTime::createFromFormat, since it is you who tells PHP what format should be used to parse the date. Behold: $datetime = DateTime::createFromFormat('d/m/Y…
phpanswered Wallace Maxters 102,340 -
2
votes1
answer245
viewsA: Update modal when deleting record from table - MVC
I think I found the mistake. You have that definition for the tr repeating in the foreach <tbody> @foreach (var item in Model.ProdutosFornecedores) { <tr>…
-
4
votes1
answer185
viewsA: Save div to a cookie
Your intention seems to me to use a cache, to avoid database queries. You need to think about whether this is feasible first. Is the data you are searching constantly changed? Or never? If the…
-
3
votes1
answer81
viewsQ: What safe practices can I use to store a password in desktop applications?
I plan to make an application with Pyqt5 to issue notifications based on an API I have. The user, obviously, in a first access would have to use the login and password, to access the application. I…
-
1
votes5
answers1314
viewsA: How to turn a Pyqt5 project into an executable?
I used Pyinstaller to create the executable structure of the program. The steps used were: I installed Python 3.5, 32 bit version I used Virtual Env, through the command python -m venv venv. I…
-
1
votes1
answer399
viewsQ: How to run Processlist periodically on the command line?
Is there any way to see the command SHOW PROCESSLIST from X to X seconds via the command line? I am using Ubuntu 16 Operating System.
-
20
votes2
answers710
viewsQ: How could you make a Pacman by moving your mouth with pure CSS?
In order to go deeper into the CSS, I would like to know different ways of making animations. My goal is to know some new properties and features that CSS has been implementing. In the specific…
-
9
votes4
answers1814
viewsA: How to Make an Inverted Border-Radius?
Man, my humble suggestion would be to use a radial-gradient. In this case, in each corner of a div daughter, would you use a radial-gradient with the same color you use in the parent container.…
-
11
votes1
answer372
viewsQ: Why is an internal alignment of a <button> button different from a <a> link, even using the same class?
Well, I created a class called .btn, where I wanted to use it so much to button as for a. So I pushed a few things in this class, to reset the original style, both of the button as in the a. For…
-
3
votes1
answer54
viewsQ: Is it possible to interpolate a string already declared in C#?
The question What does the symbol "$" mean before a string? , explains that it is possible to interpolate strings in C# through the $ (dollar sign). However, I noticed that, in all cases where it is…
-
4
votes1
answer256
viewsQ: What is the purpose of a TT extension file?
Well, I was searching around the Internet for a way to create a string as template, based on an archive of template. I came across an answer from SOEN that talks about files .tt, to use a template…
-
3
votes2
answers91
viewsA: Join in array creating elements?
Thus? var arr = [1, 2, 3, 4, 5]; var html = "<li>" + arr.join("</li><li>") + "</li>"; console.log(html) The idea is you use the </li><li> as the object of…
-
4
votes5
answers1314
viewsQ: How to turn a Pyqt5 project into an executable?
I would like to know what would be the best way to convert an application Pyqt5 to an executable application. Is there any way to "compile" an application in Pyqt5? Is there any way to create an…
-
3
votes2
answers93
viewsQ: How to disable a Qlineedit in Pyqt?
How do I disable one QLineEdit in Pyqt5? Example: inputUserName = QLineEdit(self) I’d like to disable it, just like in Html, when we use the attribute disabled. It is possible?…
-
1
votes0
answers83
viewsQ: How to convert a date into C# `/Date(1504020443813-0300)/` format for PHP?
In some applications I use C#, when I return the value in JSON, the object DateTime is serialized to a weird format, more or less like this: /Date(1504020443813-0300)/ And I’ll get it in PHP. When I…
-
3
votes1
answer159
viewsQ: How do I know which source I’m running Python from?
I would like to know how I do to know from which source I am running the Python. For example, if I installed Python 3.5 on my machine and created a Virtualenv, how could I know, through Python…
pythonasked Wallace Maxters 102,340 -
3
votes1
answer102
viewsQ: What is the difference between the settings properties <Compilation> and <httpRuntime>?
I am going through some problems while learning to work with C#, more specifically with Asp Net MVC. I saw a setup snippet on Web.config that left me a little confused, knowing: <compilation…
-
3
votes1
answer588
viewsQ: Is it possible to send an email via the "sendmail" command from a local machine?
I just learned to use my Amazon server to send emails with the command sendmail. Everything works perfectly. I wanted to know if I could do the same thing through my local machine. Because,…
-
9
votes1
answer732
viewsQ: What is ~ (til) and (circumflex accent) in the Composer versioning scheme for?
In some cases, I see that some libraries that use the Composer, place ~ or ^ at the beginning of the library version, thus: "orchestra/testbench" : "^3.6" Or "phpunit/phpunit" : "~7.0" I wanted to…
commiserateasked Wallace Maxters 102,340 -
1
votes2
answers89
viewsA: How to search for the selected value in Mysql/PHP and HTML?
I don’t really know the API of Mysqli, but I would concatenate SQL according to the query and add in another variable the parameters I will use for the query. Then run with a bind_param to ensure…
-
13
votes4
answers542
viewsQ: Is there a design standard or recommendation that defines the optimal amount of parameters a function should have?
I always value writing my codes in a short and readable way. My motto is always to think that "someday someone will mess with my code and I want the person who does it to understand it easily".…
-
2
votes2
answers144
viewsA: Reuse AJAX calls with jQuery
Young man, the call of $.ajax returns a Promise (most likely not native, but jQuery’s). That way, you can call a function that returns this Promise, allowing parameters, such as function $.ajax…
-
1
votes2
answers131
viewsA: Store array within Cookie
It is not easier to use the session? session(array('frete' => '', 'mercados' => array())); I believe it is even the most appropriate for the situation, since the Cookie has some limitations in…
-
1
votes1
answer59
viewsQ: How do I detect whether the $http request is a cache response or not?
In Angularjs, the $http has a very useful option of caching the result of a request to a url specific. For example: $scope.getUsers = function () { return $http.get('/users', {cache: true}) }…
-
7
votes2
answers209
viewsQ: What’s the Weakmap object for?
How the object works WeakMap? What’s the difference between him and a Object (which is the most common in Javascript)? What’s the difference between WeakMap and Map? Which browsers can I use?…
-
7
votes1
answer307
viewsQ: What is the purpose of the Reflect object in Javascript?
Still curious with some news that I’m seeing in Javascript, I would now like to know what is the purpose of the object Reflect. I even found an explanation in MDN, but I didn’t quite understand the…
-
3
votes1
answer508
viewsA: What is the difference between Request::wantsJson() and Request::ajax()?
Well, let’s look at the source code of both? Wantsjson: public function wantsJson() { $acceptable = $this->getAcceptableContentTypes(); return isset($acceptable[0]) && $acceptable[0] ==…
-
3
votes1
answer508
viewsQ: What is the difference between Request::wantsJson() and Request::ajax()?
In Laravel 4, I used to use the method Request::ajax() to know and the request was an XHR. When I started using the Laravel 5, I realized that it was being used more in the Request::wantsJson(). But…
-
1
votes2
answers864
viewsA: How to upload image canvas
How to upload this to the PHP server using jQuery? It’s quite simple: Convert your canvas to blob and send an Ajax, with a small modification in the settings. function ajaxUpload(options) { options…
-
1
votes2
answers332
viewsA: Create random code by loading the PHP page
I’ll give an opinion: I want to play this code in an input, to create the folder that will receive the files, among other things. Really? You will really trust information coming from the customer…
phpanswered Wallace Maxters 102,340 -
5
votes1
answer121
viewsQ: What is the uneval function for?
I was seeing some things in Javascript (which seems new to me) and I came across an example that showed a function called uneval. Some questions below about her: This function is new in Javascript…
javascriptasked Wallace Maxters 102,340 -
6
votes1
answer273
viewsQ: What is the Map object for in Javascript?
This also seems to be another novelty of Javascript: the object Map. Unlike Set, that I already have an idea of how it works and saw in other languages, the Map is something I didn’t get to see in…
-
9
votes3
answers623
viewsQ: What is the Javascript Set object for?
I’ve asked a similar question about the Python language: What’s the set for in Python?. I wonder if that object Setin Javascript does the same things as set python makes. Example: var numbers = new…
-
6
votes2
answers645
viewsQ: What is the <output> tag for?
I wonder what the tag is for <output>. I saw this example here on the Internet: <form onsubmit="return false" oninput="o.value = a.valueAsNumber + b.valueAsNumber"> <input name="a"…
-
8
votes2
answers159
viewsQ: What is the "dirname" attribute in HTML for?
I saw on the Internet a code similar to this: <form action="/the-action"> First name: <input type="text" name="fname" dirname="fname.dir"> <input type="submit" value="Submit">…
htmlasked Wallace Maxters 102,340 -
11
votes3
answers1622
viewsQ: What are the allowed elements within the <P> tag?
I’ve been through some trouble and I could still contemplate in that reply that the tag <p> does not accept any element as a child. It seems to me that there are exceptions to some tags, IE,…
-
0
votes1
answer181
viewsA: Route with variable
From what I understand, you seem to be wanting to do something impossible: Calling a PHP function by passing a Javascript variable as a parameter. But once speaking: PHP is Server-Side, Javascript…
-
9
votes1
answer174
viewsA: Good Practice Object Orientation
I hate to hear the word "good practice" as if it were a pattern to be followed to the letter. There are times when each case is a case. But in your particular case, wouldn’t it be too complicated to…
-
3
votes1
answer2490
viewsA: Parse error: syntax error, Unexpected '$error' (T_VARIABLE) in C: xampp htdocs HITSS register.php on line 26
You forgot to close some parentheses. See the lines below: Line 26: if((substr_count($_SESSION['email'], '@') != 1 || substr_count($_SESSION['email'], '.') < 1 || substr_count($_SESSION['email'],…
-
14
votes3
answers1699
viewsQ: What HTTP status returns to an expired token?
I have an application where the user can request a token for password recovery. However, I give this token a period of 2 hours. When the token expires, I want to return an error to the client,…
-
4
votes1
answer281
viewsA: Update a PHP variable inside Javascript in a time interval
PHP is a language server-side (that works next to the server). Javascript is a language client-side (that works on the client side [read "browser"]). You cannot run a Javascript function waiting for…
-
3
votes1
answer996
viewsA: How to detect when the scroll of an element reaches the end without jQuery?
I think something closer would be like below, but I would need to know more details about why you need this code. window.addEventListener('load', function () {…
-
3
votes2
answers55
viewsA: Custom border for certain table columns
Thus? .table{ border-collapse: collapse; } .table tr td{ border-right: 5px solid lightblue; } .table tr td:last-of-type{ border-right: none; } <table class="table"> <tbody> <tr>…
-
1
votes2
answers904
viewsA: How to remove CSV file lines using PHP?
I like to use the function SplFileObjectPHP. You can open the file and point to the line from which you want to read the file through the function seek. Example relatorio.csv: a1,b1,c1 a2,b2,c2…
-
2
votes2
answers832
viewsA: Focus on the next input when reaching the maximum number of characters
I particularly like to uncomplicate things. Why should the directive guess which is next input, and I can inform you myself in the directive statement mover-proximo-campo? Look at the example I…
-
4
votes2
answers154
viewsA: How to align items with HTML and CSS?
Do so #contato { margin-top: 120px; } #contato form { width: 100% } #contato form input { width: calc(33% - 20px); float: left; box-sizing: content-box; font: 400 18px 'Open Sans', sans-serif;…
-
2
votes3
answers946
viewsA: Function to add Multidimensional array elements
The other reply indicated the array_push, but I would say it would be better (by being a language builder, not a function) and more readable to use empty brackets to add values. Example: $data =…
phpanswered Wallace Maxters 102,340 -
18
votes2
answers2025
viewsQ: What is the maximum and minimum value for z-index?
I was arguing with some friends about putting 99999 in the z-index to ensure that the element has the highest priority of overlapping over another element. But when I thought about it, I got a…
cssasked Wallace Maxters 102,340