Posts by Cleef Souza • 301 points
10 posts
-
-2
votes7
answers87300
viewsA: How to validate with regex a string containing only letters, whitespace and accented letters?
Fala brother, has a simple regex to use in your validations: const regex = /[^a-zA-Z\wÀ-ú ]/g;
-
0
votes5
answers2691
viewsA: Array, how to apply in this question?
You have to create a function that checks a specific array then creates another one that calls the first one and checks several arrays. So: function acontece(arr, num) { if(arr.length < num ) {…
-
9
votes3
answers1189
viewsA: Check if a string exists in an array
Cara is a very simple exercise, I will leave the solution, but be sure to try other ways to improve your prospects and Skills; Try it this way: function temHabilidade(skills) { return…
-
1
votes3
answers145
viewsA: Same codes, different outputs
The python only understands that the print (i) is part of while if it is within the scope of the loop. Try to ident the print so that it stays within the scope of while thus: x = 1 while (x < 4):…
-
0
votes1
answer38
viewsA: Sum of two values
You can use a ternary operator: $soma1 > 0 ? $soma : 0;
phpanswered Cleef Souza 301 -
0
votes3
answers931
viewsA: Sql Help that queries 2 fields from the same table
If I understand what you’re wanting, you can use a simple JOIN: SELECT tx.id AS "TabelaX ID", t2.id AS "Tabela2 ID", t2.coluna1, t2.coluna2 FROM TabelaX tx JOIN Tabela2 t2 ON (tx.coluna1 = t2.id OR…
-
3
votes3
answers108
viewsA: How to replace a string depending on page resolution
Just listen to the screen size, when it reaches 370px wide you change the desired text. Apply this logic below <!-- @cleefsouza --> <!DOCTYPE html> <html> <head>…
-
0
votes1
answer283
viewsA: recover txt file formatted with utf-8 in python
It’s simple, just one more parameter: file = open('cmds.txt', 'r', encoding='utf-8') for f in file: print(f)
-
-3
votes3
answers639
viewsQ: How to compress python code 3?
I wanted to leave this little piece of code in one line ... i = int(input()) for j in range(1,i+1): if(i%j==0): print(j) it is possible ?
-
3
votes1
answer2921
viewsQ: Percentage Postgresql
I cannot perform the percentage of this query . You should take the sum of "valor_convenio" of each municipality and divided by the total sum of the "valor_convenio" : <h3>Entrada SQL SEM…