Posts by Maniero • 444,682 points
6,921 posts
-
12
votes1
answer4428
viewsA: What’s the difference in Kotlin between var and val?
val declares a variable immutable and var declares a variable changeable, so the compiler detected that you tried to change the value of something you can’t. It seems that you already know this. But…
-
15
votes1
answer678
viewsA: What is data-driven design?
What relationship it has with object orientation? In fact it is easy to confuse with the data-driven project which is something related to object orientation, unlike the project oriented the data in…
-
2
votes2
answers355
viewsA: Advantage in giving null in a variable on Android
So In a class, a local variable will be cleared when? You mean in a method? You don’t have to unless he’s got some serious problems. In a global variable, if you give null to it, knowing that it…
-
9
votes2
answers993
viewsA: Is there the equivalent of Andalso and Orelse in C#?
C# comes from the line of C that prefers symbols rather than words to express much of its syntax, so: AndAlso => && OrElse => || I think a lot programmer uses the wrong operator,…
-
5
votes3
answers467
viewsA: How to get an advanced "for" score?
It doesn’t. The second example is what’s called foreach and its function is to take each element of a data collection and use it directly. If you want an index use the for simple of the first…
-
4
votes2
answers65
viewsA: Is it a bad idea to automatically versize classes with Jibx?
I understood that this tool, which I do not know, generates bad code, and so I should look for another solution. There must be a reason for them to be generated in the build and not make available…
-
2
votes3
answers186
views -
8
votes2
answers137
viewsA: Constants of non-priminal types
First, in my opinion Java has no constant, has static fields that can not have their value changed after defined, which is static will always occur before being accessed the first. I don’t know if…
-
5
votes1
answer74
viewsA: Why "new Array" after variable?
This is one way to declare a array in Javascript, you call a function Array() which should precisely generate the array to assign to the variable. O new is used to indicate the object allocation. It…
-
24
votes1
answer678
viewsQ: What is data-driven design?
I came across the term data-oriented design, I saw some things and I was a little surprised because what I could see on top is different than what I could imagine, since these terms usually refer to…
-
1
votes1
answer334
views -
12
votes2
answers2789
viewsA: Is SOA the same as REST?
If we consider that REST is a way to meet the requirements of web services and that this in turn is a form of SOUNDS (service-oriented Architecture), so although it’s not the same thing, but every…
-
19
votes3
answers1780
viewsA: Is the SQL language object oriented?
She’s not even a programming language. So it would not be appropriate to analyze whether it has mechanisms of object-oriented programming languages. It does not support paradigms typical programming…
-
14
votes1
answer1978
viewsA: How to program in a modular way?
I am going to talk here about something that is not well formalized and that there are different currents of thought. More recently we have started to define the subject differently than originally…
-
1
votes1
answer43
viewsA: Error declaring a matrix
Cannot initialize with value in structure declaration. You can do this in variable definition: int main(void) { struct horario { char M[8][40]; }; struct horario hora = { .M = { {"X 8 9 10 11 12 13…
-
12
votes1
answer586
viewsA: Do Java 8 streams and streams bring more benefits than concision?
More benefits compared to what? In creating entire classes to simulate the same result? After all the lambda uses class infrastructure to work. So conciseness is probably the biggest gain. And…
-
5
votes2
answers447
viewsA: Python assignment and OO
Reliable sources First start by saying that it is common for video lessons to be bad, in general they are made by voluntary people who understand nothing of the subject that can not evaluate itself…
-
3
votes1
answer47
viewsA: Windows service, using async method, is there a need?
It doesn’t have many details, but I would say no. In general the asynchronicity is to improve the user experience, which in the case does not exist. Of course it could have the need if this service…
-
3
votes4
answers708
viewsA: Conversion of interface list into object list: (List<Interface> in List<Object>)
What you want to do is not possible, C# does not support covariance return type. One can think of another solution depending on the problem, but in fact the example is anti didactic, so it is even…
-
1
votes1
answer59
viewsA: I can’t run Def in Python
Assuming you’ve written a function, you have to call it, so if you’ve done something like this,: def funcao() return 1 you need to call it that: funcao() I put in the Github for future reference.…
-
3
votes2
answers726
viewsA: How to read numbers from a txt file in C#?
You can’t, you have to be manual. You have to read the lines, break the data and convert it. I considered that the file will always be well formatted and with correct data. Something like this:…
-
2
votes1
answer54
viewsA: Which type to use to store values that are in an Arraylist<> in an Sqlite table?
VARCHAR, there is no other way, you will have to convert and manage it in the database both to write and to read. There are some strategies you can use, the most common is to separate each element…
-
9
votes2
answers2136
viewsA: Web API x Webservices
No, Webapi is to create web services. He uses a technique Restful to communicate interaction points. Web service is a general technique, Webapi is a specific technology from Microsoft to handle web…
-
1
votes1
answer100
viewsA: Why the return on an assignment operator method?
No, because operators are expressions and expressions must always generate a result to be used where it is written, and a result is generated with a return. If only he were statement would not need,…
-
5
votes3
answers318
viewsA: Difference between properties syntax in C#
The first code is a syntactic sugar for the second, roughly speaking. So there is no difference between them, this you know. If it is the same thing, why doubt? The first has everything you have in…
-
7
votes3
answers323
viewsA: How to prevent a System.Nullreferenceexception within an if
Do not under any circumstances what is in the other answer by swallowing the exception. This does not solve any problem, it only worsens the situation. This is even more terrible than capture…
-
3
votes1
answer403
viewsA: How to get the same strcpy() result with strcpy_s()?
It would be something like that: strcpy_s((char*)m_pOriginalCVar->pszName, /*tamanho aqui*/, m_szDummyName); I put in the Github for future reference. This size should be the size of…
-
30
votes1
answer4649
viewsA: What is it, Kotlin?
A wonderful language, that’s all I have to say :P Okay, aside from the fun, it’s a language created by Jetbrains, owner of an IDE that many consider to be the best in the market, such as the…
-
21
votes5
answers43935
viewsA: What is a Table Test? How to apply it?
There are basically two ways to check whether an algorithm is doing what is expected. One of them is the formal method where he "proves" mathematically that he does what he wishes. There are also…
-
12
votes2
answers1301
viewsA: Differences between compiling and recompiling?
I imagine you’re talking about build and rebuild which is a little different from compiling and recompiling. The exact semantics may vary and it is not so much the IDE, it is the project…
-
6
votes2
answers209
viewsA: Is there a function that fills a string to a certain length?
Running on any version of Javascript. function padRight(str, len, char) { if (typeof(char) === 'undefined') { char = ' '; } len = len + 1 - str.length len = len > 0 ? len : 0 return…
-
3
votes1
answer137
viewsA: How do temporary folders work?
Depends on operating system. How and when these files are removed? Is there any configuration on the operating system regarding this? On Windows do not have anything automatic, you should remove…
-
4
votes1
answer9941
views -
4
votes1
answer198
views -
3
votes2
answers165
viewsA: Can’t find Parameter passed to the Insert command
The code is very confusing and even the compiler is not understanding, try to do this: public class Cliente { public Cliente() {} //tem certeza que quer impedir a construção? public void gravar() {…
-
6
votes2
answers714
views -
12
votes5
answers1059
viewsA: Is it possible to convert a 16-bit number to a single byte?
No room You’re going to take something 1 kg and put it in a 500 g container, you’re going to throw away 500 g, and then you want to take the 1 kg back. There is only one possibility, to save the…
-
2
votes1
answer180
viewsA: What are TTML files?
It is a markup format for texts that need information of the time they should be used. Do you know the subtitles that people take to watch their favorite series as soon as they launch in the…
markup-languageanswered Maniero 444,682 -
15
votes2
answers3018
viewsA: Is it really necessary to create an auxiliary 3rd table in N-N relationships?
'Cause they say you need to do it? For winnings, see below. It has to do with standardisation? Yes. It’s really necessary? No, but almost. It’s very difficult to get it right without this table of…
-
10
votes1
answer432
viewsA: What is a template engine?
I don’t like the word motor engine in this context, I prefer mechanism. PHP is already a feedback mechanism (since it’s for translating). It takes a text that in thesis is an HTML and allows…
-
1
votes1
answer685
viewsA: Registration without duplicity in Sqlite
When you need a die (one or more columns) to be unique in a table you use the clause UNIQUE prohibiting the registration of duplicate values in an unambiguous manner and without risk of running…
-
4
votes3
answers280
viewsA: How do I block access to setting parameters in a class?
Try this: import math class Circulo(): def __init__(self): super() self.__raio = None def get_perimetro(self): return 2 * math.pi * self.raio def get_area(self): return math.pi * self.raio ** 2…
-
9
votes1
answer94
viewsA: Why can Unboxing only be made for the type that was previously performed Boxing?
So it’s correct to say that Unboxing/Int32 does the casting implicit class System.ValueType for System.Object? ValueType is a class abstract used to give the necessary infrastructure to the…
-
2
votes1
answer4468
viewsA: Mean numbers of a matrix in C
You have to go through the whole matrix and add up the numbers, then just divide by the number of elements, which is the formula of the average. #include <stdio.h> int main(void) { int matriz…
-
1
votes1
answer139
viewsA: Execute commands in a C++ string
Generally speaking you don’t have to, you have to practically create a compiler that will do it for you. Of course you can use what you have ready as a basis to adapt. Of course, if you restrict…
-
7
votes1
answer1925
viewsA: Can I apply HTML/CSS to a pure C program?
Yes and no. C can send texts to where you want them to be. HTTP servers receive text from any technology you want as long as it meets certain standards, especially the CGI (a little outdated) or…
-
2
votes2
answers88
viewsA: Is it possible to view all the content of a C++ namespace?
You get direct access to all elements of the Std namespace That is not true. When you make the directive: using namespace std; you do not get direct access to all elements of the namespace std, just…
-
4
votes2
answers280
views -
4
votes1
answer111
viewsA: Difference of parameters in Python
Funcao(param = 'value') is a function that has a argument default, ie if the argument is not passed in the call of Funcao, the value 'value' shall be assigned to the parameter param. Funcao(value) I…
-
9
votes1
answer231
viewsA: How to use the 9th rule of Object Calisthenics in PHP?
Introduction on good practice Where are you saying that use getters and setters is good programming practice? Who said? What is the reliability and relevance of this? And even if you have something…