Posts by Lucas Samuel • 386 points
17 posts
-
2
votes2
answers59
viewsA: Serialize to different objects in C#
Unable to use "one of two types" in C#, as is possible in Typescript. But as you demonstrate that answer, you can use the type Dynamic and run logics for type conditions. For example: public class…
-
0
votes1
answer33
viewsA: Problem when using keydown
onkeydown is executed when the key is pressed, but has not yet been released by the user, that is, the value has not yet been entered in the input (read that answer for more details). onkeyup is…
-
4
votes1
answer53
viewsA: Perform action in all textboxes without having to repeat for each one (C#)
Welcome to the community! You can go through each control of the Form through property Controls. So for each item, you define a Eventhandler that will execute the logic you want: public MyForm() {…
-
1
votes1
answer40
viewsA: I cannot understand/find the error in php code
The first two messages are notifications that PHP did not find the indexes reported within $_POST (see that answer for more information). You should check whether this information is being passed…
-
0
votes1
answer26
viewsA: Block catch shows as Undefined to a variable
Variables within the local scope of a block try cannot be accessed outside this scope, as in a block catch, for example. For this, you must declare this variable in a scope above the scope where the…
-
3
votes1
answer56
viewsA: How to insert HTML tags into an Anguar array?
You must use the Property Binding Angular to determine the value of a property in an HTML element. How you want to determine the HTML inside an element p, the property innerHTML of that element…
angularanswered Lucas Samuel 386 -
-2
votes1
answer432
viewsA: Password encryption with Crypto on Node js
Passwords should not be encrypted, but scrambled with a hash algorithm (see more details in that reply). When you use the function createHash using the algorithm SHA-256, you are creating a hash, so…
-
2
votes2
answers170
viewsA: How to place two arrays inside a single loop of repetition to populate an object?
As each element a contains a href and within each a there is a p, we can assume that the variable key, used in the position of p in the loop for, can also be used to define the position of a. And…
-
0
votes1
answer22
viewsA: Is it possible to download the link page displayed in the onclick input?
As you demonstrate that answer, you can use a function that adds the link, with the URL that contains the file to download, in the body of your page, and then click this link programmatically. Or,…
-
0
votes2
answers80
viewsA: How to clear lines on pandas using a list as a filter?
As you demonstrate that answer, you can use the pandas.DataFrame.isin. df = df[~df['nome'].isin(listaFiltro)] With this command, you are replacing your dataframe df by dataframe df where the values…
-
2
votes1
answer41
viewsA: React: npx create-React-app vs referencing . js
The difference is that the command does everything for you: creates the directories and files, installs packages, makes the initial configuration and delivers the project ready to start. After a…
reactanswered Lucas Samuel 386 -
0
votes3
answers66
viewsA: Can someone explain to me what this program does?
The program prints a number and the time used by the processor to find that number, between 1 and 1,000,000, which returns an integer in the division by 17 and 19 at the same time. It is curious…
javaanswered Lucas Samuel 386 -
0
votes1
answer629
viewsA: Why are you giving the error string indices must be integers?
This error is generated when trying to access a position in a string using another string (see link). Since strings are not dictionaries, only integers can be used as index, returning the respective…
pythonanswered Lucas Samuel 386 -
2
votes1
answer38
viewsA: Loop repeating works in one case, but does not work in another (JS)
When you call people[key], tries to access a position specified by key. However, you are overriding the content of your vector people with each iteration on p, making this vector always have only 1…
-
0
votes2
answers292
viewsA: Basic - Java: error: class, interface, or Enum expected
You can’t declare packets twice in the same file. Also, only one public class can be declared per file. Split your class into two files with the same package declaration: // Arquivo Aula2.java…
-
0
votes1
answer29
viewsA: How can I make the user type a positive integer and display the sum of their example digits : 505 = 5+0+5 =10
John, as the result of prompt is a string (a text), you can use regular expressions to obtain the numbers present. A character class "digit" represents all 10 numerical digits. In order for this…
-
1
votes2
answers860
viewsA: Nestjs with Typeorm for Mysql - Nodejs
Welcome to our community, Littlefish! The decorator @Column shall receive an object of the type Columnoptions (Decorators Reference). Therefore, in the lastname attribute, the decorator should look…