Posts by Maniero • 444,682 points
6,921 posts
-
4
votes1
answer325
viewsA: The Node in the World . NET would be CLR or . NET?
The question is formulated in a way that does not reflect reality. In a way we can compare the . NET platform with Node.js. The platform involves a number of things. The CLR is the Runtime,…
-
5
votes1
answer62
viewsA: Demand that one method must be followed by another?
This is usually a conceptual error. An object should be created in a valid state to perform any behavior at any time. For that reason there is the builder. The valid state guarantee should ideally…
-
1
votes1
answer136
viewsA: File closure
You must open the resources deform that it close itself, something like that: using (var sw = new StringWriter()) using (var tw = new XmlTextWriter(sw)) using (var arquivo = new FileStream("C:\\" +…
-
2
votes1
answer61
viewsA: Float to Byte Array conversion
ByteBuffer.allocate(4).putFloat(180).array(); I put in the Github for future reference. This would create a array with 4 positions. Bytes alone will not do much good. Documentation. There it shows…
-
6
votes1
answer69
viewsA: Does using multiple namespaces weigh more?
In the execution of the code itself does not weigh because it is only a facility to write the code without having to enter the whole name. It weighs slightly more to interpret the code since it has…
-
4
votes3
answers86
viewsA: Why do you print the variable type instead of the result?
You’re actually having a list printed up and this is the result you should actually get. If you want to print the list items, then you should use a structure that goes through the list and shows…
-
4
votes1
answer171
viewsA: How to organize namespaces?
How to define exactly do not know if I can say, I think open, depends on the project. What you can do is to have some naming conventions. To Microsoft documented this, but nothing prevents people…
-
2
votes1
answer94
viewsA: The "Mailaddress.Displayname" property or indexer cannot be assigned, as it is read-only
You need to create an object to use on From: var body = "<p>Email From: {0} ({1})</p><p>Message:</p><p>{2}</p>"; var message = new MailMessage(); message.From =…
-
10
votes3
answers1585
viewsA: How to generate large random numbers in C++?
It depends on the compiler, probably using a bad one. See that this one reaches 2 billion. Of course, every compiler that manages at least 32767 is within the standard. If you don’t need it to give…
-
5
votes2
answers145
viewsA: Leaking memory in PHP
PHP essentially does not have memory leakage because it works with language-managed memory through a garbage collector based on reference count with additional collection of cycles, then the leak…
-
4
votes1
answer324
views -
1
votes1
answer43
viewsA: Join lists without repeating
Use the LINQ: var lista3 = lista1.Union(lista2).ToList(); I put in the Github for future reference.…
-
10
votes4
answers8025
views -
6
votes1
answer376
viewsA: Web service hosting equals a website with pages?
Hosting essentially yes. Or not, it depends on the technology used, but not the functionality. For tags is using the Web API, which seems right to me. What differentiates this technology from MVC is…
-
12
votes1
answer632
viewsA: What are the main differences between Kotlin and Scala?
I imagine you’re wondering why they created Kotlin if Scala already solves these problems, that is, why they created a better Java than Java if Scala already does this? Otherwise I imagine the…
-
4
votes3
answers388
viewsA: Is it possible to offer return options in a method?
This is not possible, the signature of the method only consider your name and parameter types. If I did with the return it would complicate the compiler, create ambiguity and possible bugs. The most…
-
3
votes2
answers1485
viewsA: Problems with function that returns character array in C++
There are some problems in this code, what is being shown is that it is calling the function without the parentheses. Calling criaVetor() this error disappears. Only there’s actually another error,…
-
3
votes2
answers4669
viewsA: Problem with library Math. h (indefinite reference to `sqrt')
You need to ensure that the library is included in the compilation, for this use -lm in the compiler command line.
-
3
votes2
answers219
viewsA: Loop memory and processing optimization
Optimization can be a lot. It can be by performance, memory consumption, it can be by code or even other things to be defined. Optimization has to test. And what is worth today may not be worth…
-
6
votes1
answer115
viewsA: What is Lazy instantiation?
This is a technique of memoisation. So in this case you’re declaring a property that owns a get which will deliver the value defined there, in the case of "$firstName $lastName", however the value…
-
3
votes2
answers166
viewsA: Tablespace and data files on Oracle
Tablespace is a place to store data files. The data file usually has several tables, but nothing prevents it having only one or even a part of a table. Indexes also. Usually each Tablespace is on a…
-
2
votes3
answers171
viewsA: Is it possible to have properties other than those generated automatically in a data class?
It is possible to create property extensions, and in the example quoted it should work because I believe that in the background it is not a property, to tell the truth or I don’t really like the…
-
7
votes1
answer1794
viewsA: What is the purpose of "data class"?
Also called registration, is to be a simple structure basically with data, without behaviors, other than those necessary for the basic infrastructure of the language, as a comparison (equals()),…
-
2
votes1
answer6600
viewsA: How to calculate the use of a football team in a championship?
The calculation is the least, basic math. The logic is a bit complicated. I would actually take out most of the methods. There is a school of learning that has to create getters/setters for…
-
1
votes2
answers80
viewsA: Method is executed by clicking the button despite doing "button01.Enabled = false"
I found a question like this in the O.R., and I liked it of that answer: button1.Enabled = false; Task.Factory.StartNew(() => { // execução lenta aqui, se não for lenta, não faz sentido…
-
2
votes3
answers62
viewsA: Memory and processing - Variables and verification
I made a comparison with the two forms just to prove it. The first: IL_0000: ldc.i4.1 IL_0001: stloc.0 IL_0002: ldarg.0 IL_0003: ldloc.0 IL_0004: call instance string C::FindExamByID(int32) IL_0009:…
-
9
votes2
answers335
viewsA: How to customize the getter in Kotlin?
For this code apparently: var content: String get() = this.content.toUpperCase(); set(value) { if (value != "") { field = value } } I put in the Github for future reference. Obviously I made a stter…
-
7
votes2
answers296
viewsA: What is the Anko?
According to the Github of his is a library to facilitate development for Android with mechanisms for Intents, Dialogs and toasts, Logging, Resources and Dimensions and even corollaries, a Kotlin…
-
1
votes2
answers64
viewsA: Is declaring variable receiving element of a vector within a for a good practice or is it unnecessary?
Essentially it makes no difference to have an extra variable although the statement itself may be slightly worse in some versions of some browsers. Particularly I do not create variables that are…
-
21
votes4
answers8801
viewsA: What is it and what is a "truth table" for?
It’s like a table of tables, but in another context. It demonstrates the results of Boolean algebra operations. Having only two input values and two possible results is always very easy to…
-
9
votes2
answers188
viewsA: Boolean arguments, in general, are not good?
Boolean arguments, in general, are not good. This phrase is correct? In general are not good. If yes, what is the problem with booleans? Because booleans are not good arguments? It gives little…
-
6
votes1
answer781
viewsA: What is the purpose of the Ternal lateinit?
The internal is a middle ground between the private and the public. It is public if it considers that the member can be accessed outside its object, but it is private if it considers that only what…
-
11
votes2
answers785
views -
13
votes1
answer236
views -
11
votes1
answer236
viewsA: Is it possible to interact a C# code with code external to . NET?
Yes. In fact much of . NET interoperates with Win32 or with the API of other operating systems that are provided in C. So it is possible for you to interoperate as well. We are usually talking about…
-
3
votes1
answer1275
viewsA: Calculate annual salary
It is close. In fact it needs to reread the statement, it even says the names of the methods that should be created. There is not much because the method is static there. There are syntax errors.…
-
11
votes1
answer632
viewsA: In a programming language, what differentiates a first-class citizen from the rest?
According to Wikipedia is when a language feature allows it to be used in all ways that it is normally possible to use in it. If a resource can be created in the language but cannot be assigned to a…
-
4
votes2
answers2426
viewsA: Displaynamefor and Displayfor
@Html.DisplayNameFor(model => model.Title) //mostra Title @Html.DisplayFor(model => model.Title) //mostra o conteúdo de Title Almost always wants to use the DisplayFor. In fact the…
-
4
votes2
answers776
viewsA: Markup language equivalent to HTML?
HTML is a variation of XML (actually this has changed a little, it turned out that XHTML is what it looks like). As its name says (XML), it is an extensible markup language, so it has a basic idea…
-
7
votes2
answers308
viewsA: Why does Kotlin use a way of declaring functions and variables other than "traditional"?
Exactly, this "traditional" right between quotation marks. The way you call traditional comes from the C style, which is considered bad by many. Complicates compiler because it generates context for…
-
16
votes1
answer2503
viewsA: What are the main features of the Go language?
What are the main characteristics? I will quote only what is most important. It is a high-level language, much more than C, similar to C#, for example. It is compiled and generates native…
-
12
votes3
answers649
viewsA: What is the Target Framework and what is it for?
There are several versions of frameworks as can be seen on the screen. Actually there is much more than these, since there is not only . NET Framework, there is, the . NET Core, the . NET Native,…
-
7
votes3
answers213
viewsA: What’s a Kotlin label for?
Is a form of drop, although some do not like to use that word :). As people have prejudice with the word, can only use with break, continue and return that people accept better, but the mechanism is…
-
7
votes1
answer420
viewsA: How can I "postpone" the startup of a property?
Probably the simplest way would be: public lateinit var prop: String fun init(param: String) { valor = Executa(param) } Kotlin has estates much like the properties of C#, with a better syntax, so it…
-
6
votes2
answers1264
viewsA: How to read a file with Kotlin?
Most of the Kotlin library is the same as the existing one for Java, one of the great advantages of the language was already born with all this library available. It is possible read the entire file…
-
8
votes3
answers1764
viewsA: How to create a static method using Kotlin?
Kotlin has a slightly different mechanism. Within a class: companion object { fun getDragonGlass() : String = String.valueOf("All the dragon glasses.") } I’d call it like in Java:…
-
4
votes1
answer682
viewsA: Making the Insert in SQL Server in a float field?
There’s a lot of mistakes there. This looks like money or something similar (quantity) and float should never be used for this. This is a very serious problem that causes damage. If there is a wrong…
-
2
votes1
answer612
viewsA: What would be Pro*C/C++?
What would be Pro*C/C++? A mechanism that allows using these languages within the database as if they were PL/SQL codes. It can give some performance gain and allow more powerful algorithms that…
-
3
votes1
answer99
views -
10
votes2
answers6409
viewsA: What is a stream?
Almost everything has been answered in How To Really Understand Streams?. Nothing to do with video streaming directly, although the technique is the same. You access a feature that gives you the…