Posts by Kevin Kouketsu • 784 points
30 posts
-
4
votes2
answers155
viewsA: Variable receiving trash
Your doubt refers to: why the variable is filled in pass by passing the maximum rate of buff. These two variables are in the stack. They are stored in order, following the FILO system (First In,…
-
1
votes1
answer100
viewsA: Arraylist in C# does not display user-typed values
The ArrayList is a class used prior to the arrival of generics in C#. In Microsoft’s own documentation on the ArrayList can be found: We do not recommend that you use the Arraylist class for the new…
-
1
votes2
answers98
viewsA: CS0847 error in matrix code in C#
You defined that the array lista 3x3 but defined it to be only 3x2. Adding another name to each index would solve your problem. Or you can decrease the setting to new string[3, 2] I recommend you…
-
1
votes2
answers259
viewsA: C# - Can you run a task and return to the main thread later?
Look... is very confused your question but the information I was able to extract follows: This if you have available . NET Framework 4.0+ public async Task DoWork() {…
-
7
votes2
answers114
viewsA: What is the function of Asreadonly() in C#?
It returns a class called ReadOnlyCollection. With this, you guarantee that the collection will not be changed, it will actually be read only. List<int> myList = new List<int>();…
-
4
votes2
answers262
viewsA: Add value to a string list
You need to create an instance of your List. You can do it like this: public List<string> dados { get; set; } = new List<string>(); The above code creates an instance of List of strings,…
-
1
votes1
answer153
viewsA: Encrypt String C#
This "encryption" algorithm is quite simple. It simply adds the shift value to the character code. To "encrypt", subtract the value. private static string Encrypt(string source, short shift) { int…
c#answered Kevin Kouketsu 784 -
0
votes2
answers335
viewsA: Search for words in almost 1 million files
My solution, as suggested by Leandro Angelo in the comments, was to use the Windows Search API. I made the implementation of Ifilter in a DLL and registered it to be used. With this, I could open an…
-
2
votes1
answer29
viewsA: How to add parameters in the WHERE of a Procedure without using IF?
One approach you can try is the following SELECT c.FullName, p.Descricao as DescricaoPedido, S.Descricao as Seguradora, p.PremioLiquidoTotal, p.ComissaoLiquidoTotal, p.PercentualComissao,…
mysqlanswered Kevin Kouketsu 784 -
3
votes2
answers105
viewsA: Doubts with do-while loop
The problem is that your exit condition do-while is 0. This entry of 0, in your program, is not expected in sex conditions, ie ends up resulting in invalid option. Therefore, one way to do it is…
-
4
votes1
answer177
viewsA: How to put a char variable in a string through the keys { }?
You can do using String.Format thus: String.Format("{0}", posJogaveis[0].ToString()); If you can use version C# 6.0 or higher, you have the option to use string interpolation. Using interpolation…
-
-1
votes2
answers75
viewsA: Get an item from a referenced list
Do the Tostring() method Overload to get a correct string. class ItemsList { public int ID { get; set; } public int Quantidade{ get; set; } public override string ToString() { return $"ID: { ID }.…
-
1
votes2
answers1808
viewsA: I cannot declare variables as a string in my C++ code
To use the string in C++, you must specify it from the namespace from which it is coming. In the case of string, the namespace is the std. In your case, just insert before each string use the text…
-
4
votes1
answer44
viewsA: C# convert Object to Object[]
One way you do it is this: var pagamentos = new List<PerfService.Pagamento>(); pagamentos.Add(new PerfService.Pagamento() { IdPagamentoCliente = "Teste", }); request.Pagamentos =…
c#answered Kevin Kouketsu 784 -
1
votes3
answers40
viewsA: I am producing a kind of form, but in age people put (age + "years")
There are a few ways to do this. The simplest would be with int.TryParse where it will try to convert a string to an integer. If it fails, it returns false and makes no exception. The version…
c#answered Kevin Kouketsu 784 -
0
votes2
answers335
viewsQ: Search for words in almost 1 million files
I am looking for methods/ideas that can help me to solve my problem. I have a structure of folders / files that my program generates, so far so good. But what happens is that this folder already…
-
0
votes1
answer62
viewsA: Malloc in a string, based on the size of a FILE
First, the function of fopen does not return the file size, see in fopen. In your case, you might even notice that you arrow to a variable of type FILE*. To do this, you must read the whole file…
-
3
votes2
answers96
viewsA: Why does Return "terminate" the script even if in a condition?
Because when you do Return, you are literally leaving the function. Rather, you are "returning" to the function that called it. When the function returns something, it makes more sense. Imagine the…
phpanswered Kevin Kouketsu 784 -
0
votes1
answer401
viewsA: Drawing Program
Well, I made a code with comments for you. There are other ways to do it, obviously, but I think this one is very simple and can help you. I commented on the code rather than explain here because…
c#answered Kevin Kouketsu 784 -
0
votes1
answer64
viewsA: Alias directive - What would it be?
Serves to avoid ambiguity. Imagine the following situation: using System.Windows.Forms; using System.Windows.Input; In these two namespaces there are common classes. How would the compiler know…
-
1
votes1
answer183
viewsA: Query with Pointer for Struct in C
You need to allocate memory to your pointer. The way you used it, you are pointing nowhere valid. With the use of the function malloc we allocate a space in memory for you to use. struct cadastro…
canswered Kevin Kouketsu 784 -
1
votes2
answers2570
viewsA: Gitignore does not work
If you’ve committed files/folders that you don’t want, put them in .gitignore will not remove them. If this is the case: Delete the files and folders you don’t want from the repository. Commit to…
gitanswered Kevin Kouketsu 784 -
0
votes2
answers221
viewsA: Vector ordering problem in C
Another way to do it is by using the XOR Swap algorithm where you can exchange values without using an auxiliary variable. int main() { int i, vet[10], aux; aux = 0; for (i = 0; i < 10; i++) {…
-
1
votes1
answer91
viewsA: Return of a simple javascript function not working
Do it this way: if(isSequenceNumber(term) && term.length >= 6){ var data = findCustomers(term, true, resultado); }else{ var data = findCustomers(term, false, resultado); } function…
javascriptanswered Kevin Kouketsu 784 -
1
votes2
answers112
viewsA: Will someone please explain to me how I get to this algorithm?
First, as I mentioned in the commentary, binary numbers are composed by base 2. This particular code I found very interesting the way it was made. I am not the best guy to make an explanation but I…
-
0
votes1
answer32
viewsA: Removal of files in c
As previously commented, it seems that its entry does not have the file extension and its file has. You can use a sprintf to generate the new file name. So, you can do it this way: void…
canswered Kevin Kouketsu 784 -
0
votes1
answer56
viewsA: Binarywriter C#
For me it was a little vague but I will give my solution for what I understood. This behavior is normal, the packages are not differentiated in the way you want just because you want. You must…
c#answered Kevin Kouketsu 784 -
0
votes1
answer546
viewsA: URI problem 1061 - C#
The URI will not always send valid entries to your program, as I recall, and so your code should wait for errors and treat them. Example: // Caso 1 int horaI = int.Parse(tempoI[0]); int minI =…
c#answered Kevin Kouketsu 784 -
0
votes2
answers336
viewsA: How to prevent an addeventlistener from running several times in a function?
As I recall, there’s no way to verify the existence of a listener to an event. In this case, each time the function addEventListener is called, you add another anonymous function (your case) to be…
-
0
votes0
answers117
viewsQ: Project with MVVM architecture
I’m having some doubts regarding the MVVM architecture. I am developing a project that has the following characteristics: - Main form with dynamic content - Main form generates some tabs according…