Posts by Maniero • 444,682 points
6,921 posts
-
3
votes3
answers1980
viewsA: How to find a letter in a string?
I’m not a big fan of Regex, but Ruby encourages not having a very simple solution to this and having specific syntax for regular expressions, so I think the most appropriate. palavra = "palavra"…
-
4
votes2
answers154
viewsA: Explanation in constructor method
static The static indicates that that member is part of the class and not object to be created for that class - the instance - and will exist only in every application, unlike the instances of…
-
2
votes3
answers163
views -
9
votes3
answers302
viewsA: What is a module in PHP?
In this context it was a way for them to generalize where the function was called or where the code is being executed, in the case of the return, since it can be called from several places and it is…
-
1
votes1
answer218
viewsA: Why aren’t you entering this if/Else?
In Java String is a normal class and as the language has no operator overhead, can only make the comparison with the method equals(). import java.util.Scanner; class VerificaLetra { public static…
-
3
votes2
answers125
viewsA: Should I use int_least8_t or int_fast8_t?
In fact, until you have a reason to choose something other than int, you must choose it. If you want to use a char, use it. It always has 1 byte. And I doubt that I will find an active platform that…
-
2
votes2
answers119
viewsA: Chained List C does not insert new node
The code can be greatly improved and simplified. But the main problem is that you are not passing the list by reference. Even though it is a pointer you need to pass its address so that it is…
-
2
votes2
answers730
views -
14
votes1
answer364
viewsA: Identical sign "===" is only used in PHP? Why?
Is the identical sign used only in PHP? If not, which languages have this sign? No, it’s used at least in Javascript also, perhaps in other languages of dynamic and weak typing. The == compares the…
-
17
votes1
answer1419
viewsA: What is the advantage of semicolons in programming languages?
It doesn’t change in performance, it’s just syntactic, it’s even semantic. The first obvious advantage is that it allows instructions (statements) can be written in more than one line, which can…
-
1
votes2
answers99
viewsA: Generation of allele numbers
We had to initialize the random seed. The random generator is not actually random so you need to randomize the seed, the most common is to use the computer clock. You must only call the srand() once…
-
1
votes1
answer223
viewsA: Program does not wait to read the received content
The first error described in the question is that you are asking for only one character. You need to ask for one string, with %s in the scanf(). Of course, first you need to allocate memory to her…
-
10
votes1
answer1030
viewsA: Best practices with Java exception handling
As already stated in the comments, programming errors like the NullPointerException should never be captured, they should be fixed. Ideally it should only occur during your testing in development.…
-
6
votes1
answer1683
viewsA: How to identify and avoid memory Leak in . NET?
What is memory Leak? We can say that memory leakage occurs every time there is an allocated memory longer than necessary. This is usually because the code (or more precisely the programmer who wrote…
-
1
votes1
answer692
views -
1
votes1
answer145
viewsA: Comparative Xamarin.Forms Portable or Shared
This now has little relevance. A lot has changed, was created the . NET Standard, other ways to organize things in Xamarin, and in 2020 the . NET 5 that changes even more. I don’t work with Xamarin…
-
1
votes2
answers87
viewsA: Object Reference not set to an instance of an Object?
You gotta take that con = Nothing. In fact the code is very confused, doing nonsense things, it may be that solving this error find other. Dim con As SqlConnection = New SqlConnection() //criou o…
-
8
votes1
answer1138
viewsA: What are the existing layers in an HTTP/HTTPS request?
In addition to the transport layer and application layer, in an http or https request, there is some other layer? Actually it’s not quite HTTP or HTTPS that has layers. It’s all the traffic that has…
-
5
votes1
answer2472
viewsA: Undefined error Reference to Std
If you are using C++ with g++: g++ -Wall -Wextra -Werror -o calc_carre calc_carre.cpp If you want to gcc, which I don’t recommend, add the standard library: gcc -lstdc++ -Wall -Wextra -Werror -o…
-
19
votes3
answers3434
viewsA: What does "sanitize" data mean?
Delete text snippets in a data entry that have metadata characteristics, and that may cause some security problem. For example: in HTML the < > & characters are part of the Markup, If a…
-
7
votes4
answers2820
viewsA: What is the difference between "notice" and "Warning" in PHP?
Though it may not seem Warning is an error. It is something that does not prevent the execution of the code, it may eventually produce the expected result, but it should not be done that way. Must…
-
19
votes1
answer2673
viewsA: What makes Python a multiparadigma programming language?
It allows using various paradigms :P Knowing that the paradigm is just a fancy name for the style, you can program in more than one style. If you are not absolutely sure what a paradigm is and which…
-
9
votes1
answer256
viewsA: What is an unrolling?
This is an optimization that tries to give more speed to the code by eliminating or reducing the repetitions of a loop. It is common for the optimizer to try to keep the generated final code about…
-
4
votes1
answer112
viewsA: How is the signature check of the super function
Method signatures only consider the number and types of parameters in their specific order, besides, of course the name of the method, their names do not matter. So if you have two methods with the…
-
6
votes1
answer957
viewsA: How exactly do you divide two variables?
You need to convert already in data acquisition. What your code is doing is adding two strings and then convert to float. The problem is that adding up string is a concatenation, so when you type 5…
-
2
votes1
answer89
viewsA: Protected methods of a DLL
Yes, you must use the internal in each method that can only be called by the DLL. The whole class can be internalalso. Actually this is the standard. It can be used with protected also, since this…
-
6
votes2
answers757
views -
6
votes2
answers2918
viewsA: Entity Framework WITH (NOLOCK)
You can use raw SQL. Or set to read data that hasn’t been committed which is as close as you want. Has a example on Scott Hanselman’s blog: ProductsNewViewData viewData = new ProductsNewViewData();…
-
4
votes1
answer115
viewsA: Build error: expected ';' before 'case'
The compiler showed what the error is, just read it and fix it. Missing the ; after each break to close the statement. Maybe if you hadn’t put it all on the same line that would have made it…
-
7
votes2
answers6502
viewsA: Extensions . pyc . pyd . Pyo in Python
.py: usually the input source code you wrote. .pyc: is the bytecode compiled. If you import a module Python will build a file *.pyc containing the bytecode to make it easier and faster .pyo: is a…
-
8
votes2
answers2249
viewsA: Should we use SVG or PNG icons for websites?
Reasons for SVG to be a good choice: It supports browsers with windows of any size smoothly, especially with CSS background-size you can climb them up/down, as for an effect Hover you can embed Svgs…
-
11
votes2
answers118
viewsA: Why does comparing different objects return true?
Because of the interning (Flyweight Pattern). This technique is usually perceived as a cache, And it’s even in a way, but the main advantage is sharing the state. Traditional cache has a slightly…
-
18
votes1
answer678
viewsA: Is . NET Core stable enough for production?
The . NET Core becomes the only option in 2020 and will be called . NET 5. So the question no longer makes much sense and is here for historical questions. Yes, you could say that. But with some…
-
3
votes4
answers220
viewsA: How many Strings are created in the codes below?
I’m going to give an alternative answer because either the question is tricky, or it’s been misspelled. The question talks about creation at runtime. So it doesn’t count the ones that were already…
-
8
votes3
answers207
viewsA: Unsigned in the primary key increases my chances?
If you use the UNSIGNED can reach the ID 255. If you do not use only up to 127 (you can use negatives up to -128). So does not increase your chances, you’ll still have 255, only then you can use all…
-
12
votes1
answer2376
viewsA: What is non-blocking I/O?
What is non-blocking I/O? Is the ability to do in and out operations (access file system, database, network, servers, etc.) without the application being prevented from performing other things in…
-
5
votes2
answers325
viewsA: How to test the factorial in Main()?
This code has no logic whatsoever. It even starts well, except by creating unnecessary variable again. To call the function you need to be parentheses and pass as argument the number typed to be…
-
4
votes2
answers3951
viewsA: Factorial function in C does not return the result
The function is not returning anything, whether the value is valid or not. I used -1 to indicate error. Also, you are using completely unnecessary parameters: fat can be local and n simply do not…
-
4
votes3
answers953
viewsA: How do you relate the hash which is also called the python dictionary to the encryption hash function?
The dictionary is a table of hashes. Each hash is obtained through a function that calculates its value to determine in which Bucket shall be inserted. The hash It’s just a way to make it easier to…
-
10
votes3
answers122
viewsA: Why does the code print 0 instead of 5?
Because the code is assigning the parameter b for the parameter itself b and the attribute b class is not being changed. When there is ambiguity, the local symbol wins. If the parameter had another…
-
4
votes2
answers207
viewsA: How to use If Else correctly
I think this is what you want. If each option is mutually exclusive they need to be evaluated as a single structure, executing one of them, does not perform the other following. This is in fact…
-
17
votes2
answers3974
viewsA: What is "word" of a CPU
Initial definition Word is a natural datum of an architecture (processor). Just as in human natural language we have the letter as the smallest given, the syllable as the first grouping of the…
-
7
votes1
answer684
viewsA: What would be Iteration?
iteration | s. f. fem derivation. Sing. to iterate i te ra substantive female Replay. "iteration", in Dicionário Priberam da Língua Portuguesa [online], 2008-2013,…
-
7
votes2
answers849
viewsA: What is the difference between SET and SETX?
SET Set values immediately in the shell that you are working now. It dies when it is finished. It is embedded in itself shell, it is only a command recognizable by the cmd. SETX Assign values to all…
-
6
votes2
answers68
viewsA: How can I indicate the directory where my assemblies should be found?
You can configure the probing. <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <probing privatePath="bin;bin2\subbin;bin3"/>…
-
3
votes1
answer125
views -
11
votes5
answers15150
viewsA: How to avoid "Cannot read Property ... of Undefined" error?
Don’t like this solution too much, but can capture the exception that will be generated because of the error: var a = {}; try { console.log(a.b.c); } catch (e) { console.log("indefinido"); } I put…
-
3
votes1
answer345
viewsA: How to join records from a table distributed in multiple . sqlite files?
Attach the files in the session, give a INSERT selecting table data in each database. The base name (table surname) comes before the table. ATTACH 'path/aqui/vihicles1.sqlite' as v1; ATTACH…
-
7
votes2
answers1882
viewsQ: How to convert a text to number?
How should I convert a text that I know is an entire number coming externally? It would be something like a ToInt() or something like that.
-
7
votes2
answers1882
viewsA: How to convert a text to number?
The function strtol() is what you are looking for. There is still atoi() which is considered obsolete. If you want a int get the long with the first function and then do the conversion if possible…