Posts by Artur Brasil • 501 points
24 posts
-
1
votes3
answers124
viewsA: How to use a variable within another function?
You need the variable dados is a global variable. As you set the variable within a function, it will only work within that function. What is the scope of a variable? When we refer to the variable…
javascriptanswered Artur Brasil 501 -
1
votes2
answers44
viewsA: Grab list of objects within the array
You can do it like this: {listaPais.map((item) => ( <MenuItem key={item.id}> <span>{item.name}</span> </MenuItem> ))}
-
0
votes1
answer188
viewsA: How to compare 2 values with YUP
You can use the .ref() and .moreThan(): let schema = Yup.object().shape({ intervalo_inicial: Yup .number() .required() .positive() .integer(), intervalo_final: Yup.number() .required() .positive()…
-
2
votes1
answer78
viewsA: How to exclude an element from the array if an equal value already exists?
1st error: you are trying to execute if (a.ID = e). But in a comparison you should use == or ===. See in What is the difference between the operators == and == in Javascript? 2nd error: the logic…
-
1
votes2
answers133
viewsA: Git Push repository problem (with other people)
The error is self-explanatory: "Updates were rejected because your current branch is behind your remote counterpart. Integrate remote changes (for example, git pull ...) before pushing again." Like…
-
1
votes1
answer86
viewsA: Add score in memory game in Javascript
The problem you’re having is with logic or with implementation? If the problem is the implementation: what have you tried to do and how far have you got? Try to specify the problem better. If the…
-
0
votes1
answer323
viewsQ: How to ignore upper and lower case in the Contains method?
I have two List with some strings, for example: List<string> lista1 = new List<string>(); lista.Add("string1"); lista.Add("string2"); lista.Add("STRING3"); List<string> lista2 =…
c#asked Artur Brasil 501 -
0
votes1
answer888
viewsA: chatterbot_corpus module not found after installing chatterbot
Error says that the module chatterbot_corpus is not installed. Try to update chatterbot: pip install --upgrade chatterbot Or install the chatterbot_corpus individually: pip install --upgrade…
-
0
votes1
answer37
viewsA: Error: Unrecognized escape Quence
In the file path is missing a bar after two points and you need to 'escape' the bars, can do this in two ways: string caminho = @"C:\Desktop\Dataset.xlsx"; or string caminho =…
-
0
votes2
answers301
viewsA: SELECT LAST_INSERT_ID() always returns 0
The solution was to put the SELECT LAST_INSERT_ID(); right in the SqlJson.php
-
2
votes4
answers2571
viewsA: Number of vowels in the Python function
You can do it like this: def cacavogais(): i = 0 j = 0 string = str (input("Digite alguma coisa: ")) for i in string: if (i == 'A' or i == 'a' or i == 'E' or i == 'e' or i == 'I' or i == 'i' or i ==…
-
3
votes2
answers93
viewsA: How to remove a certain key and value in a dictionary with composite data (Keys and Values) in Python?
First you have to go through all the alchemists, and for each of them, erase the patent key. With the for you can go through the dictionary. In the first iteration alquimista will be Edward Elric,…
pythonanswered Artur Brasil 501 -
4
votes4
answers4894
viewsA: PHP returning wrong current time
You’re taking the server time. To fix just use the date_default_timezone_set php. For Brasilia time use: 'America/Sao_Paulo'. Other time zones you can find here. The code will look like this:…
-
0
votes4
answers587
viewsQ: How to correctly send the value of a null variable in an INSERT?
Assuming I have the following code: public async void InsertBanco(string parametro1, string parametro2) { var b = new BancoN(); SetBanco(b); await b.EnviaMySQLInsert($"INSERT INTO tabela(parametro1,…
-
5
votes2
answers369
viewsA: Save App Settings
Here’s what you need: https://developer.android.com/guide/topics/data/data-storage?hl=pt-BR To obtain an object SharedPreferences for the application, use one of these two methods:…
-
0
votes2
answers301
viewsQ: SELECT LAST_INSERT_ID() always returns 0
I have the following codes: public async Task EnviaMySQL<T>(string sql,bool pass = false, string file = "SqlJson.php") { if(!pass) Utils.Acoes.Load.ShowLoad(); var result = ""; var lista = new…
-
-1
votes1
answer347
viewsQ: Compare string ignoring uppercase/lowercase letters C#
How to check if two strings are equal by ignoring upper and lower case letters?
c#asked Artur Brasil 501 -
1
votes1
answer78
viewsA: Convert JSON file to object - C# Xamarin
SOLUTION First I had to create the classes to store JSON information. I found a website who does all this work for me: public class Item { public string id { get; set; } public string name { get;…
-
1
votes1
answer78
viewsQ: Convert JSON file to object - C# Xamarin
I have the following JSON file: { "createdAt":"Apr 17, 2019 10:28:39", "id":"52329770-64e2-4759-9d3d-f2595973de4e", "items":[ { "id":"82d2e4ab-da74-45df-a9ea-99cc257ead59", "name":"REFRIGERANTE KS",…
-
0
votes1
answer81
viewsQ: Filenotfoundexception - Android Studio
I have the following code: String f = getStringFromFile(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) + "/PagamentoLio.json"); String getStringFromFile (String…
-
0
votes2
answers248
viewsA: return a part of the code in java
The question is not very clear, but if I understand correctly you can do it with a do while: boolean tentarNovamente = false; do { System.out.println("digite Lançar para Rolar os dados para atirar…
javaanswered Artur Brasil 501 -
4
votes1
answer59
viewsA: Delete characters from a string
Use Substring: string resultado = texto.Substring(0, 35);
c#answered Artur Brasil 501 -
0
votes2
answers3490
viewsA: Error uploading new version of an apk to google play console
I was able to solve by deleting the folders bin and obj of the android project. I gave a rebuild and managed to upload!
-
0
votes2
answers3490
viewsQ: Error uploading new version of an apk to google play console
I have an app already published and I want to publish a new version. While uploading apk I’m getting this error: Sending failed The APK or Android App Bundle must be named after package…