Posts by GeekSilva • 736 points
31 posts
-
1
votes1
answer174
viewsA: I’m having trouble understanding async no flutter
Based on the method Future<List> getAllEspecies() async { Database dbEspecie = await db; List listMap = await dbEspecie.rawQuery("SELECT * FROM $tableName"); List<Especie> listEspecie =…
-
0
votes1
answer24
viewsA: Button to update the text in a search field but entering several values in sequence?
You can keep the state in a list of values already added. Then every click you add an element to that list and update the field information. <form id="form1" name="form1" method="post">…
-
1
votes1
answer220
viewsA: ERROR in src/app/services/auth.service.ts:15:21 - error TS2339: Property 'auth' does not exist on type 'Angularfireauth'
After configuring Angularfire and injecting Angularfireauth you can already use the methods. Without the need for this .auth. constructor( private firebaseAuth: AngularFireAuth ) { } ngOnInit():…
-
0
votes1
answer44
viewsA: Clock that changes color
It would be something like function carregar() { var $msg = $('#msg'); var $img = $('#imagem'); var data = new Date(); var hora = data.getHours(); var min = data.getMinutes(); var seg =…
-
0
votes2
answers38
viewsA: Check parameter in URL and trigger javascript function
Maybe this will help const urlParams = new URLSearchParams(window.location.search); const busted = urlParams.get('bust'); if(busted === 'success') { $('.click').addClass('disabled'); setTimeout(()…
-
2
votes1
answer39
viewsA: How do I consider just what number a user enters in an input? (python)
You will use regular expressions for this. Something like: import re texto = '100 quilogramas' peso = int(re.sub('\D', '', texto)) print(peso) # 100 What the above example does is to take the string…
-
1
votes2
answers2416
viewsA: How to get the first word of a text in Python?
Makes primeira_palavra = str("Eu como abacaxi").split()[0] The method split() will break the string by the informed tab, as not reported it will break by space. After breaking it returns a list like…
-
1
votes2
answers884
viewsA: Python - how to create a two-dimensional matrix with for loops
This syntax of assignment mult[i][j] = (i*j) will not work on your list because the list internal is empty. Try using the append method as in the example below mult =[[] for _ in range(10)] for i in…
-
1
votes2
answers2171
viewsA: How to make a simple calculator with pure Javascript?
In your code there are a few things to adjust. First you are passing a float to the variable oper and another point is that you are using Return, but you are not in within a function. I made an…
-
4
votes1
answer58
viewsA: How do I use ngFor with a Javascript dictionary?
Cannot iterate on Object. Trying to do this on JS you will get the error Uncaught TypeError: a is not iterable. In your case here what you could solve was to have an array of Keys and iterate over…
-
0
votes1
answer93
viewsA: php function cannot compare words with accents
The solution to this link may work Remove accents from a php string I took the following test function tirarAcentos($string){ return…
-
3
votes1
answer234
viewsA: Align items always to the center horizontally
In CSS you will do the following: .header { margin-top: 50px; text-align: center; color: #fff; } .box { display: flex; flex-wrap: wrap; flex-direction: row; justify-content: center; } .body…
-
3
votes1
answer172
viewsA: How to transform a monetary value into Reals in a number 7743;ero float?
Maybe this will help: var value = $('#money').val() // ex: 20.000,99 var currency = value.replace(/\D/g, ''); // remove tudo que não é dígito, fica então 2000099 var money =…
-
0
votes2
answers97
viewsA: Problem with Python string formatting
Try using locale to use decimal separation. import locale locale.setLocale(locale.LC_ALL, '') Then in number formatting you will not need to replace. For example: valor = 9.93 # Decimal em python…
-
0
votes1
answer108
views -
0
votes1
answer487
viewsA: How to update Data from a Select with Ajax?
Add it to <select> desired. Simply insert an element <option>. CODE This would be a POST request to do the insertion of the municipality. I want that only consider the callback function.…
-
5
votes3
answers4280
viewsA: Add minutes in Javascript
You can use the Javascript Date object. First you must convert the received time to a timestamp. This can be done as follows: function toTimestamp(horario){ var aux = horario.split(':'), dt = new…
javascriptanswered GeekSilva 736 -
1
votes1
answer325
viewsA: Translation Woocommerce
I tried to use Loco Translate but was not successful. The solution I found was to go to the directory and change manually. The directory is this:…
-
1
votes2
answers1319
viewsA: Print all form values in the console with Jquery?
Well from what I saw serialize() did not serve, so how do you just want to get the values of inputs and selects. You can use $.each(). As follows : $(function(){ var print=function(){ var data = {};…
-
0
votes1
answer325
viewsQ: Translation Woocommerce
Hello, I am using Wordpress a few months and I am facing a small problem regarding the translation of some terms of Woocommerce. Here is the image, this page is the product visualization. See that…
-
0
votes2
answers79
viewsA: Get row item except for one column
You can add a class on that specific line. For example let’s put a class C1. The code would look like this. HTML : <link…
-
1
votes2
answers1591
viewsA: Identification of guide exchange
Yes, to do that you can use Page Visibility API. It’s quite simple you can link an event of the Document and it will be triggered when the user changes tab. See this very simple code I did to…
-
1
votes1
answer81
viewsA: Modify PHP/Mysql table
See if that solves your problem SELECT ( SUM(ProdValor_1) - SUM(taxas_ps) ) AS total FROM pagseguro This code is just for example, you just need to make this small change in your SQL query.…
-
3
votes6
answers49406
viewsA: how to search for an element in a list that is inside another list?
I did a little different by putting inside a function, so that it gets something more generic. lista = [ ["julian", "0", "5"], ["ana", "10", "4"] ] # Realiza a busca dentro da lista def…
-
4
votes1
answer337
viewsA: Count rows that have the same value in 2 different columns?
Use the function SUM to add up the points, COUNT to count moves and Group By to group by ID. Query SELECT id AS ID, Count(jogada) AS TotalJogada, Sum(pontos) AS Pontos FROM tablename GROUP BY id…
-
1
votes1
answer839
viewsA: Return data from my table by formatting in html
Maybe this is the solution : Listed method() public function listadados(){ try{ //retornar um array $sql = "SELECT * FROM web_cadcli"; $lista = $this->con->conectar()->prepare($sql);…
-
0
votes2
answers310
viewsA: Create node in xml with jquery
See if that solves your problem $.get('teste.xml', function(response){ var xml = response; var usuarios = xml.querySelector('usuarios'); var novoUsuario = xml.createElement('usuario'); var login =…
-
-1
votes1
answer877
viewsQ: How to thumbnail a PDF?
Well, I’m developing a digital materials sharing project, where users can submit articles, presentations and others. That said I wanted to know, how can I make a thumbnail of these submitted…
-
0
votes2
answers1832
viewsA: How to make an image responsive without using frameworks?
What you can do is define the image with these properties. img{ width:100%; height:auto; } Thus it will occupy the entire width of the element that contains it. In order to limit this size of the…
-
0
votes6
answers4426
views -
2
votes6
answers4426
views