Posts by Maniero • 444,682 points
6,921 posts
-
5
votes2
answers181
viewsA: Compiling C for raw binary
If I understand, you want to generate a raw binary file without an OS dependent format. If this is it, it’s a very basic question for something that’s just the tip of iceberg, it’s not simple to…
-
2
votes2
answers182
viewsA: Local database (serveless) not modifiable with update
When you leave the data in the customer, you will always risk losing it, there is nothing that can be done. The file can be accidentally deleted by the user or viruses, equipment malfunction, etc.…
-
3
votes2
answers319
viewsA: Like passing a Char to the bank?
The real solution is to use a NCHAR in the database. This type is suitable for storing Unicode characters, as is the case with the one used in Java. If you choose not to do this you will have to…
-
2
votes1
answer811
viewsA: Is it possible to return the child class through a method in the parent class?
The best I could think of to not create a meaningless dependency was this: abstract class ClassePaiBuilder<T> where T : ClassePaiBuilder<T> { public T SetAtributo(string atributo) { //…
-
8
votes1
answer143
viewsA: Memory addresses
These are two completely different concepts. The address is 4 bytes (32-bit architecture). The size of the data may vary according to its type. Generally 1 is used to represent a character, but this…
-
2
votes3
answers210
views -
1
votes3
answers1340
viewsA: Removing spaces from a text file
You are reading a file with data of fixed size, so you have to access the positions, can not use explode, nor even assume that space is separator. It may not have space between different data, it…
-
6
votes1
answer144
viewsA: Nullpointerexception occurring
Error of NullPointerException should not be dealt with, it should be solved, after all it is a programming error. In fact most of the exceptions should not be dealt with. Within the setEmail()…
-
2
votes2
answers1143
viewsA: Receive variables from other classes
To simplify you can make the attribute public, so you don’t need to create the pair of access methods: public class UsedLinks { public String homepagelink = "abc.com.br"; } Use: Usedlinks link = new…
-
10
votes2
answers604
viewsA: Read all the contents of a text file
Yes, it has, since version 2.0 of the . NET Framework ReadAllText(). var texto = File.ReadAllText("arquivo.txt"); I put in the Github for future reference.…
-
4
votes1
answer425
viewsA: Why isn’t the object being instantiated?
Your code doesn’t even compile, so every description of the question and the comments are not true. When solving the problems that prevent the compilation the code works perfectly, although it is…
-
4
votes2
answers157
viewsA: What’s position on Sqlserver?
It is the position of the column. By the descriptions this is a file of fixed size, so each column of data is always at the same position of the row. So the first column is obviously at position 0…
-
2
votes1
answer244
views -
4
votes2
answers159
viewsA: Javascript and C language accessing the same database
You can access Sqlite directly from JS, but honestly I wouldn’t do it, nobody does, so we don’t know how reliable it is. Too much risk and too little gain. Depending on how this application will…
-
8
votes1
answer269
viewsA: How to calculate with 3 variables of type Datetime?
Thus: public TimeSpan TempoOtimista { get; set; } public TimeSpan TempoProvavel { get; set; } public TimeSpan TempoPessimista { get; set; } public TimeSpan TempoRevisado { get; set; } TempoRevisado…
-
4
votes1
answer106
viewsA: Food list gives "Index out of range"
The error is that you are not adding an element to the new list. You cannot access the element without creating it first. nor do you actually need to access it: public ActionResult errosPorTema(int…
-
3
votes1
answer3478
viewsA: Convert string to Datetime
You cannot keep date format when converting to DateTime. This type keeps a date. Point. To be more accurate a point information in time. It has the date and time. If you want it in a specific format…
-
19
votes1
answer2858
viewsA: When should I use the "?" operator in C?
The conditional operator is the ? :, are not two operators. As it is ternary, it has two parts to separate, as you well noted: the condition, the value for true and the value for false. He is also…
-
7
votes4
answers595
viewsA: How to create a variable where to access its properties via string?
The first pure and simple form can be obtained with a Dictionary var casa = new Dictionary<string, object>(); casa.Add("cor", "verde"); casa.Add("tamanho", 2000); var cor = casa["cor"]; var…
-
10
votes2
answers3131
viewsA: How can I turn line breaking into <br /> in Javascript?
str = str.replace(/(?:\r\n|\r|\n)/g, '<br />'); I put in the Github for future reference. Source. Or you can use the tag without the bar.…
-
2
votes1
answer87
viewsA: Is it possible to convert Windows . NET Framework applications to Mac?
Depends on what was used in the project. It depends on how it was written (this part may require a bit of adaptation if it was not thought to work on a different platform, but nothing too…
-
6
votes1
answer83
viewsA: Access properties without knowing name
Has. There are basically two options. One is using get_object_vars(): var_dump(get_object_vars($classe)); And the other is iterate over the object: foreach ($classe as $key => $value) print "$key…
-
2
votes3
answers533
views -
9
votes3
answers660
views -
5
votes1
answer8989
viewsA: How to add an element to a list?
Don’t confuse the object Pessoa and the object List<Pessoa>. These are separate things. So you can’t "add a person to a person". It looks like the phrase doesn’t make sense. You can "add a…
-
9
votes3
answers8198
views -
5
votes1
answer117
viewsA: Does having the layout ready facilitate development with MVC?
I believe so. The idea of MVC is precisely separate responsibilities of the various components and even the tasks to be performed in the project. But if you consider layout is never ready doesn’t…
-
3
votes1
answer1864
views -
7
votes2
answers9043
viewsA: What’s the meaning of error 406?
Is a problem of content type. Probably the request or response is using a mime-type that the server or client cannot handle. It can also be a charset or encoding invalid. It may still be an invalid…
-
21
votes2
answers1593
viewsA: What is the "?" operator?
This is the operator conditional access or null Propagation or safe navigation. I haven’t decided which to use yet :) But I think the second is better. As it was so frequent to check whether an…
-
2
votes1
answer291
viewsA: Representation of Assembly instructions
Don’t even try this. It’s insane work. If you want to do this you better take one disassembler. See some available. If you want to do this insanity, you have to read all the processor documentation.…
-
4
votes3
answers2804
viewsA: Comparing an array element with a string
Just take the falsefrom within the loop. If it arrives at the count of 2, it can terminate the execution by returning true. But if he doesn’t reach that condition, he has to keep trying to the end,…
-
1
votes1
answer90
viewsA: Read/Write information to file . cds
Write an application in Delphi that reads this .cds and have it saved in XML. Then you can read with .NET. There is no better way, or even another way to do this. Source.…
-
2
votes1
answer137
viewsA: Is comparing a variable to 1 the same as comparing it to true?
You give the semantics you want for the values you use. If you have control over the contents of the variable, you can even choose the type of data you want. So if you prefer that information from…
-
3
votes2
answers241
viewsA: Extensive matrix makes the program stop working
Are you getting a stack overflow. The array is being allocated from stack and it has size limit. Large objects should be allocated in the heap, through the malloc(). Of course, this complicates…
-
4
votes2
answers166
viewsA: Several errors in code C - How to fix?
The code has several errors, from typing, to wrong logic reusing variables that must be separated, passing by function call syntax error. #include <stdio.h> void receber_matriz(int l, int c) {…
-
5
votes1
answer179
viewsA: Is it already possible to make commercial applications with Visual C++ Cross Platform?
Yes, it is already possible. But you will probably prefer to use Xamarin. C++ and C# are the only languages, until the response date, that run on the three main mobile platforms (considering that…
-
11
votes2
answers193
views -
31
votes6
answers2425
views -
5
votes2
answers815
viewsA: Why declare pointer to array if arrays are already pointers?
You nay is declaring a pointer to array. Is declaring a pointer to char. Ai contrary to popular belief they are separate things. In the first example there is a array with 10 chars. In the second…
-
3
votes1
answer177
viewsA: Can you use Firebird by accessing from your Windows Phone?
The question is a little wide but I will answer what it gives. It’s possible if there are no network blocks. Even if you don’t have it, it’s not ideal to give access to the database for applications…
-
14
votes2
answers1641
viewsA: When to use and not use AJAX when submitting forms?
There are no clear cases where you should or should not use it. It depends on the experience you want to give the user. First of all, one of the most common but very common mistakes that I see in…
-
53
votes1
answer2641
viewsA: What does the symbol "$" mean before a string?
That’s called string Interpolation. In C# 6 there is this symbol to indicate a special condition of that literal string. With the interpolation of string, we can use a variable or an expression…
-
12
votes3
answers13362
viewsA: How to remove whitespace from a text?
There are 3 methods to cut spaces, you can cut at the beginning, at the end, or both. You have to use the right one for what you want. It is still possible to cut all. The example shown in the…
-
5
votes3
answers2024
viewsA: Keep application (Windows Form) open in icon tray with C#
To do is not, to solve everything that implies can be a little more. To pass on to you all that is necessary would be very long. You can ask specific questions. To give you a basis to start I found…
-
8
votes2
answers2506
viewsA: Creating two projects in a single Git repository
It’s not possible. Git has its advantages, but one of the drawbacks is just that. Git works with the repository as a whole. It’s actually more common when you need better organization and access…
-
2
votes1
answer898
views -
4
votes3
answers6925
viewsA: How to send 2 Controller objects to the View in C#?
You have to encapsulate them in another object. You can do this in several ways, one of them is to create a viewmodel: public class PessoaViewModel { public Pessoa Pessoa {get; set;} public Contato…
-
8
votes1
answer2403
views -
16
votes2
answers10850
viewsA: What is the main difference between int. Parse() and Convert.Toint32()?
The Int32.Parse(valor) only converts content from string. The Convert.ToInt32() has overloads to work with various types. This is the main difference. But the best way is to see what he looks like…