Posts by Maniero • 444,682 points
6,921 posts
-
9
votes1
answer515
viewsA: Is scripting language always built on another language?
I’ll start casting some links important to understand about languages, compilers, interpreters, etc.: What is a programming language, IDE and compiler? How a programming language is developed? How…
-
3
votes1
answer466
views -
5
votes2
answers7160
viewsA: Decimal to binary conversion in C language
There is no dichotomy between these two things. The function exists to isolate and/or generalize an algorithm, the loop serves to repeat things. Unless you’re talking about using iteration or…
-
4
votes2
answers742
viewsA: What is Python’s native support for database manipulation?
Set native. If you are speaking from the standard library only Sqlite is available. If you are talking about extra modules available for direct access in the most raw API possible from the database…
-
1
votes1
answer286
viewsA: Does typescript support an implementation equivalent to trait?
I think you want to use mixin which, in theory, should be even more flexible than trait. To proposal for the implementation of trait was closed because the mixin should solve this. But mixin does…
-
22
votes2
answers930
viewsA: What is a meta language?
Meta language is the language to create languages. Or at least it is a language to create code that generates code. Meta is something about that. Just like we have the Sopt meta which is a Q&A…
-
4
votes2
answers904
viewsA: How to access properties of an object that is inside another object?
To solve this problem the way you’ve developed it has to do this: ((casa)(cidade1.casas)).dono The problem is that casas is the type object and he does not possess the member dono so it can’t be…
-
14
votes3
answers361
viewsA: Is it correct to call a method, and pass your null parameters?
Yes, since there is no overload that can handle your call without arguments. But it may not be the most appropriate. I would only question if it is what you want, in general when you receive a…
-
3
votes3
answers2408
views -
4
votes1
answer383
viewsA: What are the advantages and disadvantages of using object-oriented mysqli?
The OO or procedural API consumption changes very little. The advantage usually occurs in development, which in the case of PHP does not help much because the OO version is just a shell on top of…
-
1
votes2
answers88
viewsA: Power calculation
The code is very confusing, there are things that are not quite C++, but for exercise goes. I think this function calc() is unnecessary in this case, but the biggest problem I see is not being using…
-
17
votes1
answer3203
viewsA: What are the pillars of object-oriented programming?
You’re asking to whom? Some people disagree. How many and what are the pillars of object-oriented programming? Most of the available literature cites four, the three that are more or less universal…
-
6
votes2
answers1252
viewsA: What is the good solution to replace Alert?
The message should be displayed on the page itself, preferably close to the data that originated the error, highlighting, perhaps temporarily and in a way that does not obstruct the normal use of…
-
25
votes2
answers463
viewsA: What’s a loose comparison?
The loose comparison is the default for PHP. As a weak typing language, it leaves aside the rigidity of types at the time of buying, so one tries to get a result, even if one is comparing bananas…
-
2
votes1
answer300
viewsA: Error: Expected End of Statement
There’s a space here ID Passaporte, right is IDPassaporte. The code in general is confusing and can be simplified, which helps to identify more these problems.…
-
13
votes1
answer1173
viewsA: What is the difference between WCF and a Web Services?
Web Service is a general concept and WCF is a specific technology of Microsoft (.NET), so just so it is already very different. Web Services usually use REST as basic mechanism. There are some…
-
2
votes1
answer51
viewsA: Error condition in C
C is a so-called static language, and weak typing, is the opposite of Python which is dynamic and strong. You cannot change a type of variable, as you can in Python, but you can interpret one data…
-
2
votes1
answer365
viewsA: How to store vector values?
I gave an improved readability of the code and gave a modernized, but the same error is time to get the positions of the new array. It is starting at the 0 position that has already been filled, it…
-
6
votes4
answers362
viewsA: How do I skip the "Finally" block, in C#, when the exception is generated?
This code has several problems, some are errors, others is just bad style issue: 1 - This problem need not deal with exception. It needs to check the error and give due treatment. Use TryParse() and…
-
3
votes1
answer131
views -
1
votes1
answer130
viewsA: Why does this goroutin loop just repeat the last value?
I already answered this in C#. A Goroutine is a call from a code controlled by Runtime for asynchronous parallel execution or not. Obviously the code presented there is executed lazily (Lazy), that…
-
14
votes2
answers715
viewsA: What does && ! mean in PHP?
Spaces usually make no difference to the code. At least in PHP almost always not. Which is a shame because programmers do atrocities and make the code less readable, inconsistent. More or less like…
-
7
votes3
answers1022
views -
10
votes5
answers1163
viewsA: PHP only connects to Mysql?
In theory it can be integrated with any database. In general the connection is made through an extension to the database. And when none of that works, you can probably use ODBC, that is not as good…
-
8
votes3
answers247
viewsA: Concatenation or data sequencing: which performs best?
Whenever speaking in language performance, it makes sense to discuss this when programming in Assembly, C, C++, even C#, Java, who knows Rust, D, or Delphi. In PHP the solution is very simple if you…
-
13
votes2
answers229
viewsA: If I can do everything with structural programming, why did you create object-oriented?
To organize better codes complexes, to better handle extended domains. Yes, do OOP in scripts, Fleeting, simple, not advantageous applications. But luckily many people don’t do OOP on these things,…
-
12
votes2
answers4989
viewsA: What is a boolean?
Boolean, in the context I understand you’re asking, is a data type representing only two states, true or false. This has a direct relationship to the bits of the computer that only have two states 0…
-
4
votes2
answers689
viewsA: Call for generic methods in C#
There is no secret, if it was difficult could have shown the code to us to see what was wrong. Just call and pass the parameters. Unless you are in a specific situation that creates some difficulty…
-
2
votes1
answer52
viewsA: How to return warning in a View if there is no data to display?
I imagine you want this: return new EmptyResult(); Documentation. To class documentation ActionResult shows all possible return types for the view. You can even create others that better suit your…
-
12
votes2
answers1800
viewsA: What is the relationship between encapsulation and polymorphism?
It’s not all the same. College means very little. It is useful, but having a degree does not guarantee anything. Most students learn to be great truco players in the schoolyard. In general people…
-
6
votes2
answers811
viewsA: What is memory segmentation?
Remember the page fault? It’s similar, but the reason is different. Page failure is inherent in virtual memory system. The segmentation failure is a bug in the code (probably). It occurs when you…
-
5
votes1
answer1880
viewsA: MVC versus MVVM
You can answer with a quote from Josh Smith: If you put ten software Architects into a room and have them discuss what the Model-View-Controller Pattern is, you will end up with Twelve Different…
-
16
votes3
answers1312
viewsA: How to create PHP executable program?
Yes, it’s possible. It has a huge list of PHP compilers that generate executables. Many don’t even exist anymore. Their level of quality is variable, and in practice "nobody" uses it. Some:…
-
13
votes2
answers440
viewsA: Does any programming language use memory?
When I write a program in any programming language, compiled or interpreted, a RAM is required to run? Theory All programming language must be Turing Complete, otherwise it cannot receive this…
-
23
votes2
answers19395
viewsA: What’s the difference between varchar and nvarchar?
It has to do with character encoding. The NVARCHAR is a guy multibyte to store texts Unicode. As far as I know only exists in SQL Server, it is not part of the standard. The question has the tag…
-
28
votes3
answers971
viewsA: Is POO the same in all languages?
Object-oriented language In accordance with already answered to AP in previous question, object orientation is not exactly a language mechanism. The paradigm can be applied to any language, even…
-
9
votes4
answers4690
viewsA: Caesar cipher - problem with letters and spaces
If I understand the problem, you need to make an exception for the last characters. I took the opportunity to discard something outside of what is expected. I made the most idiomatic code C walking…
-
4
votes2
answers287
viewsA: How to add methods to a native class?
This is not possible today, and it has little advantage to do this. Create a new class and good. public class MathExt { public static double test(double a) => a; } MathExt.test(10); I put in the…
-
1
votes1
answer265
viewsA: How to split the string after counting 50 characters
You can do a little better, but the question does not give details. You need to pick up to the established limit where you have space. Has function ready for this (LastIndexOf()). Imports System…
-
2
votes1
answer133
viewsA: Dynamically allocating text, and error in free()
The code has some problems, even is not readable. I simplified a little. The most serious problem is that it keeps in name the pointer to the allocated location. It cannot be modified so that the…
-
3
votes2
answers9247
viewsA: How to check if one string is contained in another in C?
As there is already a function ready that takes a part of the string, rather make a substitute from where found the second substring at first string. There are some other errors in this code and it…
-
3
votes1
answer118
viewsA: Type of char data needs space after quotation marks in the scanf
Because the scanf() treats the input with a line break at the end and this can cause problems of buffer. This space indicates that there will be a substitution of the line break that is spurious…
-
1
votes1
answer98
viewsA: Function is zeroing last vector value
The statement of a array should contain the amount of elements expected to be used from it. As the elements start at 0, the last will be the size minus one. But the quantity of elements is the…
-
1
votes1
answer71
viewsA: Something simpler than that to allocate a dynamically typed text?
There are small improvements that can be made in the code, mostly only cosmetic, stylistic and things like that, even to favor the legibility that is bad. Could put a null character at the end to…
-
15
votes5
answers7541
viewsA: Is programming for iOS on a virtual machine feasible?
Technically, I might be able to, but the license doesn’t allow me to do that. You can only run an iOS simulator and generate the app from an Apple machine. You can even use a VM, but it has to be…
-
5
votes1
answer3224
viewsA: Input string was not in a correct format
This is a common mistake. People think that converting string in another kind will always work. If the data is not controlled by you, that is if it comes from an uncertain external source, like…
-
2
votes2
answers114
viewsA: Methods with more than one Generic
This code will work best so: public static TResult ToEntityForType<TResult>(this DataRow row, Type type) { var entity = Activator.CreateInstance<type>() as TResult; var properties =…
-
11
votes2
answers6312
viewsA: Doubts about the toString() method of the Object class
I’ll disagree with Math’s answer. She’s not wrong, but he provides one himself link for documentation that tells how the method should be written, and the answer in my assessment does not do as the…
-
17
votes3
answers2048
viewsA: What is the function of the toString() method?
As the name says, what it does is it results in a text that expresses what that object is, so every object has this method. There is some controversy about the right conceptual use. My…
-
7
votes2
answers1833
viewsA: Create objects without reference C#
Read this. In reference types the assignment operator only copies the variable reference, in practice you do not have two objects but two variables that point to the same object. So if you move the…