Posts by Vinicius Farias • 751 points
30 posts
-
0
votes1
answer72
viewsA: How to import node_modules styles into an Angular 10 library?
Inside the archive .angular-cli.json in the project root it is possible to import the css files just by mapping each one of them in the Styles property, example of the primeng library css: { ...…
-
0
votes3
answers41
viewsA: Assign new items in an array without rewriting the whole code
You can use the merge array function for this, as follows: $options = [ CURLOPT_URL => $url, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HEADER => true, CURLOPT_RETURNTRANSFER => true,…
-
0
votes1
answer69
viewsA: How to remove the border in Bootstrap when an object is clicked?
You can use the css Focus event to take some attribute out of your element, in which case you will need to remove Outline from it as follows: ELEMENTO:focus{ outline: none; } Simply replace the…
-
0
votes1
answer35
viewsA: How to zip a folder with php
The file may not be being saved because Ziparchive is not being "closed" after adding the files. To save the file, just add the following code below the addFile(); $diretorio = getcwd().'/zipado/';…
phpanswered Vinicius Farias 751 -
3
votes1
answer41
viewsA: How to set and manipulate the number of digits in an integer type variable with php?
You can use the PHP str_pad function as follows: $nomeDaVariavel = 1; $nomeDaVariavel = str_pad($nomeDaVariavel, 6, "0", STR_PAD_LEFT); // Irá printar 000001 como texto print $nomeDaVariavel; The…
-
1
votes2
answers84
viewsA: Convert string.match() result to string?
The return of the match() function is an array, so it can be converted to string as follows: var value = ">>>> Ola" var result = value.match(/\w+/g) !== null ? value.match(/\w+/g).join('…
-
4
votes1
answer37
viewsA: Send to different email according to time of day
You can check the date based on Datetime, setting the time for noon, then checking if the current date is after noon. If yes, change the email that should receive the shot. <?php $date = new…
-
0
votes2
answers84
viewsA: Mysql Select replace a code with information
You can do it this way SELECT CASE WHEN Pgto = 'S' THEN 'Sim' ELSE 'Não' END AS Pgto, CASE WHEN Status = 1 THEN 'Pendente de Pgto' WHEN Status = 2 THEN 'Liberado' WHEN Status = 3 THEN 'A caminho'…
mysqlanswered Vinicius Farias 751 -
0
votes2
answers149
viewsA: how to create a "Store list"?
Since localstotage is a Key->Value type Log, it is not possible to create an array in it, but it is possible to transform the text to JSON string and save it. Then just parse that text. As…
-
5
votes2
answers908
viewsA: Capitalize Javascript text, ignoring abbreviations
To facilitate the work you can use the library https://www.npmjs.com/package/capitalize-pt-br Installing as follows, if NPM is used: npm install --save capitalize-pt-br In case of non-use of NPM,…
-
3
votes1
answer3139
viewsA: Angular 7 - Input validation in a dynamic form
The error occurs because all fields are required, that is, the fields that are not displayed will be validated, you can make use of setValidators to generate the validations, for example: ...…
-
1
votes2
answers3487
viewsA: move up to the repository on github
If you want to add all the changed files use the command: git add . If you only want to add a specific file: git add NOME_DO_ARQUIVO.EXTENSAO To create a new branch run the following commands: git…
-
3
votes2
answers843
viewsA: Get specific XML tag with PHP
When you load the files via Simplexmlelement or simplexml_load_file it already enters the xml root, ie the index categories is already the default index, to catch the default id you only need to…
-
4
votes4
answers205
viewsA: Catch event that happened on page
It is not recommended that you listen to all events because of the performance, however, for test cases you can add multiple listeners as follows: Object.keys(window).forEach(key => { if…
-
8
votes1
answer8331
viewsA: Removing all spaces from a string using Javascript
You can use REGEX to perform such action, follow code example: var strDefault = 'Te s te de remo ção de es pa ço s'; document.querySelector('.default').innerHTML = strDefault; var str =…
-
1
votes1
answer26
viewsA: Error in instanceof in foreach
The error occurs because the class name is being passed as a string. The right thing would be for you to import the class into that code of yours and use it as follows: print_r (instanciaClasseArray…
-
1
votes2
answers1928
viewsA: Add values in a list
Using the append method of the Array you add elements at the end of your list. lista = []; lista.append(3); lista.append(7); lista.append(13); lista.append(4); print(lista);…
-
0
votes2
answers129
viewsA: Read an integer greater than 0 and return the sum between the numbers that compose it in Python
With the following code you perform the sum of the digits of the number: n=int(input("Digita um número:")) tot=0 while(n>0): dig=n%10 tot=tot+dig n=n//10 print("A soma é:",tot)…
-
1
votes2
answers2217
viewsA: Navigation menu with flexbox
You must add the property Justify-content: space-between; so that the flexbox can perform the spacing between the elements. ul { display: flex; width: 100%; list-style-type: none; padding: 0;…
-
0
votes1
answer151
viewsA: How to remove an element in HTML?
You are adding the elements inside the div that you remove at the end, I made some changes to the code so that whenever it adds it creates a line. When removing, it will remove only this line,…
jqueryanswered Vinicius Farias 751 -
2
votes1
answer28
viewsA: Multiple results with pre-established value of one addition
You can use the input change event (change), would be as follows: var porcentagemUm = 1.4; var porcentagemDois = 2.5; var porcentagemTres = 1.3; var porcentagemQuatro = 1.87; var porcentagemCinco =…
-
1
votes1
answer2227
viewsA: Graphics Component for React Native?
I’ve used this component graphics. It is very simple and useful. Under-implemented: import React from 'react' import { LineChart, Grid } from 'react-native-svg-charts' class LineChartExample extends…
-
3
votes1
answer58
viewsA: Call Function while holding down
You can do the following: $( "#target" ).on({ mousedown: function() { $(this).data('timer', setTimeout(function() { foo(); }, 60000)); }, mouseup: function() { clearTimeout( $(this).data('timer') );…
-
0
votes1
answer23
viewsA: Dynamic checkboxes
The error occurs because subscribe does not return categories, it only serves to take the request data and keep it within the scope if the value is not assigned to a variable. You can make the…
angularanswered Vinicius Farias 751 -
1
votes2
answers917
viewsA: Angular 7 - Add a datatables to the component
I saw the code and it seems to me Moduloscomponent is not a component of Appmodule, that is, its component is linked to the other module. Realize the import of Datatablesmodule in the module…
-
2
votes2
answers147
viewsA: Pass values to 99 fields in a loop
In C# you cannot create variables with dynamic names because the language is strongly typed. What you can do is create an array with these fields, the way recommended by MICROSOFT is that you use a…
-
0
votes2
answers399
viewsA: Typeerror: sheets.foreach is not a Function typescript [on hold]
The problem is because the leaves may not be an array. Initializes in the function thus: folhaDePagamentoEstagiariosToItemCard(folhas = []) {
-
0
votes1
answer551
viewsA: How do I reverse a specific commit from master?
First check that git push --force is active in your repository. Find the commit hash by following these steps: Access the Repository Take the Commit Copy the HASH and replace in the command below…
-
1
votes0
answers1714
viewsQ: Generate A1 certificates for testing in the ICP-BRASIL standard
I need to generate a FAKE digital certificate with the standard used by ICP-BRASIL for testing systems with the following files: 1. Certificate Chain (Pro system identify the certificate when…
-
1
votes1
answer248
viewsA: Angular 7: Add multiple parameters to the URL with Httpparams
You can do the following: Create httpOptions object normally without params: const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Authorization': 'Basic ' +…