Posts by Wallace Maxters • 102,340 points
1,984 posts
-
2
votes2
answers188
viewsA: Locate the index of the highest and lowest value of an array
To get the higher or lower value, you can simply do so: var arr = ["885.9", "984.9", "444.9", "528.9", "528.9"]; var maior = Math.max.apply(null, arr) Now to get the position just use indexOf var…
-
2
votes2
answers64
viewsA: How to mount a number 1 pyramid of 20 consecutive lines?
As a matter of fact, you wish it? for (var i = 0; i <= 20; i++) { var p = Array(i + 1).join('1'); console.log(p); } The function Array, when added a number, it will generate an array with empty…
-
1
votes1
answer28
viewsA: The problem [Object Htmlinputelement] appears in a Function in JS
The Element input[type=text] must have the attribute value accessed so you can display the value typed in it. Change your code to: <!DOCTYPE html> <html lang="pt-br"> <head>…
-
6
votes1
answer283
viewsQ: GIT LOG: How do I search for a commit through a specific message?
I wonder if there’s any way to use the git log to list commits, filtering through a specific message. Example: git commit -am "Correção do ícone de exclusão na listagem de usuários" In the above…
-
8
votes3
answers300
viewsA: How to perform a condition in the array to verify that multiple elements exist at the same time?
It is possible to use the function every. It checks if all conditions are true and returns true. Should any of them return false, returns false. let a = ['view', 'edit', 'insert'];…
javascriptanswered Wallace Maxters 102,340 -
1
votes1
answer436
viewsA: Laravel - Storage::url() does not return correct url
I had a similar problem yesterday. I was having the full url on my local machine and two more people running correctly, showing the full way, when calling Storage::url. However, when it was in…
-
3
votes2
answers421
viewsA: How to apply conditions in this string template?
For the sake of organization and reading, it is preferable to avoid placing large expressions inside a string template. The ideal would be to formulate the logic outside the string template and save…
-
17
votes5
answers582
viewsQ: What is a Webhook?
I saw some questions here that talk about the term Webhook. I would like to know better what that term is in programming.
terminologyasked Wallace Maxters 102,340 -
6
votes2
answers917
viewsQ: How to make an all-white PNG image with CSS only?
I have an image, which is the client’s logo, all colored. At times, I need this completely white logo, to apply on dark backgrounds. I don’t always want to have to use two Pngs and I wonder if you…
cssasked Wallace Maxters 102,340 -
4
votes1
answer317
viewsQ: How to change default Composer installation folder?
Is there any way to change where Composer installs the dependencies? Composer always installs in the folder vendor, but would have to change to another folder?
-
4
votes2
answers166
viewsQ: What does the double-dash stand for in a Bash command?
There is a little time that I use Linux and I know that some commands have arguments that use the - at the beginning of a word. Example: ls -la And some others use two traits, so: php artisan --help…
-
2
votes1
answer133
viewsQ: Is there any way to force the stash override on the current modifications?
When I use the remote git stash to hide the changes, sometimes you need to change that same file, while it is already hidden by Stash. When I try to apply one git stash pop, but at the same time one…
gitasked Wallace Maxters 102,340 -
8
votes2
answers537
viewsQ: How to recover only one specific stash file?
Suppose I did have a.txt, b.txt and c.txt that have been modified in a given branch and that I have used the command git stash in all of them to hide the changes. If I rotate the git stash pop, I…
gitasked Wallace Maxters 102,340 -
6
votes1
answer312
viewsQ: How to organize the use of the z-index attribute?
One thing I’ve always found in CSS to be the most disorganized thing is the use of z-index. Often some frameworks/libraries, or even some developers, place an exaggerated value on z-index, causing…
-
11
votes3
answers576
viewsQ: What is CSS OK?
I saw that some people are adopting the pattern of putting some classes in CSS separated by a double underline. Example: .form__field{ /** Css aqui **/ } I never had anything about it, and I came…
-
2
votes1
answer123
viewsQ: Is there any way to extend the "Transform" property to avoid losses or repetitions?
In CSS, I often like to use some "modifying classes" to extend functionality. Example: .btn{ background-color: red; height: 50px; } .btn.btn-outlined{ background-color: transparent; color: red; } I…
cssasked Wallace Maxters 102,340 -
3
votes2
answers1028
viewsQ: In white-space, what is the difference between pre, pre-line and pre-wrap options?
I already know that when using white-space: nowrap, the text does not break when it exceeds the limit of a container. However, I noticed that this property in CSS has the options pre, pre-line and…
cssasked Wallace Maxters 102,340 -
2
votes1
answer77
viewsA: Parse String to read HTML
According to the documentation: Double keys interpret the data as plain text, not HTML. To display HTML, use the v-html directive: That is, interpolation through {{ expressao }} always convert to…
-
12
votes1
answer1894
viewsQ: What is the real need for SSR (Server Side Rendering)?
It is notorious that the development of web applications for a while has taken a very "different" course. Frameworks such as Angularjs, Vue and Reactjs have become quite popular, as in common they…
-
31
votes2
answers1150
viewsQ: What is a microfrontend?
I have come across several "new" terms over the internet when it comes to programming. And recently, I came across the term microfrontendon. From what little I could understand, the idea would be…
terminologyasked Wallace Maxters 102,340 -
3
votes3
answers1087
viewsA: How do I convert Filelist to Array in Javascript?
The previous answers used Array.from to convert FileList in Array, however I noticed the support for this function is not yet available in all browsers: It is possible to obtain the same result…
javascriptanswered Wallace Maxters 102,340 -
4
votes3
answers1087
viewsQ: How do I convert Filelist to Array in Javascript?
In Javascript, when selecting return the selected values from a file input[type=file], it returns the values within a FileList. Example: document.querySelector('#files').addEventListener('change',…
javascriptasked Wallace Maxters 102,340 -
0
votes1
answer433
viewsA: Undefined variable: page (View: ... Resources views layouts app.blade.php
You are trying to use the variable $page view that inherits layouts.app? Maybe you explicitly pass the variable $page for your layout. @extends('layouts.app', compact('page'))…
-
1
votes1
answer28
viewsA: Transform array into single matrix
If you can ensure that all items within the array always have another arraywith the countryside name, just use the array_map. $lista = array_map(function ($item) { return $item['nome']; }, $array);…
phpanswered Wallace Maxters 102,340 -
1
votes1
answer450
viewsA: How to do a like research in Aravel 5.5 using eloquent relationship?
In your case, you should use whereHas and not with. There’s a difference between the two: whereHas -> You use when you want the result of your query to be changed by the condition passed in the…
-
12
votes1
answer844
viewsQ: What is the CSS "display: ruby" for?
The question is basically this: What’s the point of display: ruby in CSS? This attribute is new? When to use it?
cssasked Wallace Maxters 102,340 -
1
votes1
answer135
viewsQ: What is the difference between "merge" and "Fill" in Adonisjs' Lucid?
I have several years of experience with Laravel and am taking a look at the Adonisjs framework. It is very similar to the Laravel in several points, but specifically I’m having a doubt regarding the…
-
3
votes2
answers1046
viewsQ: What is the difference between KTS and KT extensions?
I am studying Kotlin and opened a Spring Boot project out of curiosity. I came across two files of different extensions, contento code Kotlin: .kts and .kt. What is the difference between these two…
-
6
votes1
answer40
viewsA: Much of my site has become a link
You must correct that passage: <li><a href="login.php">Login</li> For that reason: <li><a href="login.php">Login</a></li> Probably the lack of tag closure…
-
0
votes3
answers463
viewsA: How to list files in a folder with size
In a very small way, you can write your code like this: from os import path, listdir pasta = '/diretorio' lista = [dict(arquivo=f, tamanho=path.getsize(path.join(pasta, f))) for f in listdir(pasta)]…
pythonanswered Wallace Maxters 102,340 -
0
votes1
answer302
viewsQ: How to remove all items from a Many-to-Many relation in Django?
I have the following models in my Django app: class Tag(models.Model): name = models.CharField(max_length=150) description = models.TextField(null=True, blank=True) created_at =…
-
4
votes3
answers315
viewsQ: Would it be possible to list Enum from a table field through a query?
I wonder if there is any way to bring the values of the inserted in the ENUM of a table column through a query. For example, with this table: CREATE TABLE shirts ( name VARCHAR(40), size…
-
3
votes1
answer880
viewsA: What is the purpose of the "request" and "Response" objects of a web framework?
I’ve had the opportunity to build some frameworks in languages like PHP and Python, as well as I’ve looked at how their source code works. Basically, we can understand that the idea of frameworks is…
-
1
votes2
answers2049
viewsA: Visual Studio and Github - Which files to ignore (C#)
I’m wondering which files I should add to git and which ones to ignore. I can (read 'should') add the entire project folder? You can add as many files as you want. The problem itself is that there…
-
2
votes2
answers668
viewsA: Problems trying to access JSON file in Python
To open a file on Python you can use the function open combined with the keyword with. Behold: import json with open('TesteJSON.json', 'r') as f: dados = json.loads(f.read())…
-
2
votes1
answer19
viewsA: select all records from the table stored in a Session
If you want to create an array of records within the session, you would need to do so: session_start(); $not = $crd->select('*', 'noticias', 'ORDER BY id DESC', array()); foreach ($not as $key…
phpanswered Wallace Maxters 102,340 -
2
votes1
answer358
viewsA: How to insert paragraphs and then recognize them with a textarea
I believe you can take the string value of your textarea and give a split in the "\n" to split the lines into one array. Then just go through and create an element p, by inserting the value of the…
-
1
votes2
answers127
viewsA: Organize data from a Binding date into a table
From what I’m seeing, you’re using an object, whose each value is an array, which in turn has the same size in each property. The solution I would give for this would be to count the amount of…
-
6
votes1
answer86
viewsQ: Is there a shortcut to go to the last edited line?
In Sublime Text, I’ve already happened to be editing a line of code and have to check a code right above to see what I’m going to implement. Turns out, when I do this, I miss a shortcut so I get…
-
1
votes1
answer350
viewsQ: How to access a local virtualhost from another device?
I’m needing to test a local application that runs on Apache2 on my mobile and other devices here. I usually configure my Apache2 on Linux as follows: In the /etc/hosts, I place the desired domain:…
-
6
votes2
answers1259
viewsQ: How to get the month or day of the week in Portuguese on C#?
In PHP, through the function strftime, I can return the name of the day of the week or month, in the language installed in the operating system. Example: echo strftime("%d %B", time()); Upshot: 16…
c#asked Wallace Maxters 102,340 -
5
votes1
answer189
viewsQ: Mysql returning all integers as string in PHP
Whenever I am making a query, PHP is bringing the data from the MYSQL database as string, and this is affecting data conversion when I send the customer a JSON response. For example, in the table…
-
11
votes2
answers3362
viewsQ: CSS: hexadecimal color opacity?
I accidentally put a hexadecimal color with two extra digits and noticed that in Google Chrome it affects the color opacity as well as function rgba(). Sort of like this: body { background-color:…
-
5
votes1
answer96
viewsA: Scope of PHP variable
Is because you didn’t use the key use. It is necessary to import the variable into the scope of the Closure: foreach ($vehiclesInfo as $vInfo) { $splitOpenedIdleEvents = array_filter($openedEvents,…
-
1
votes2
answers169
viewsQ: How to list the log of a local GIT repository through PHP?
The git has a command called git log, that shows the commit history of the repository. I wonder if I could use that git log GIT and pass it to a array of PHP. In this case, the PHP script would be…
-
4
votes1
answer1238
viewsQ: What is the difference between $Digest and $apply?
In Angularjs, we have two methods that execute the $watchers synchronously: $digest and $apply. I’d like to ask a few questions: What’s the difference between them? When I should wear one or the…
angularjsasked Wallace Maxters 102,340 -
1
votes1
answer377
viewsA: Difference between $apply() and $evalAsync()
You seem to be having trouble with the Angularjs data update cycle. Angularjs configures most events to update/sync values between views and controllers. An example of this is input (talk of the…
-
1
votes3
answers123
viewsA: Format value for date
It has already been answered, but if you prefer the procedural way, you can do so: $date = date_create_from_format('Ymd', '20180120'); echo date_format($date, 'Y-m-d'); The functions…
-
3
votes2
answers240
viewsQ: How to return a literal object in an Arrow Function?
How much I try to return a literal object with Arrow Function, makes a mistake: var items = [1, 2, 3].map( i => {valor: i, data: new Date() }) How to get around this in Javascript?…
-
3
votes2
answers672
viewsA: Return columns from belongsToMany Laravel pivot table
In Laravel, to access a value present in a Pivot table it is necessary to use the attribute pivot. For example, if you have a relationship N:N of Usuario for Produto, you would have three tables:…
laravelanswered Wallace Maxters 102,340