Posts by Maniero • 444,682 points
6,921 posts
-
2
votes2
answers3095
viewsA: How to pass variables from Controller to View in ASP.NET MVC 4.5?
It is usually used ViewBag or ViewData. What is created in the controller can be accessed in the view. [HttpPost] public void Attempt(string email, string password, Admins db) { Admins admin =…
-
12
votes3
answers1072
viewsA: What is and what is the function of . (dot) in POO?
It is a binary operator (has two operands, one on the left and one on the right side). Usually called Operator. The most common is that on the left side is the object to which you are referring. On…
-
9
votes1
answer2200
viewsA: What is the maximum amount an array can support in PHP?
The problem in this case is not the array, is the total amount of memory. Contrary to popular belief, the array does not include everything that may appear to be on it. Most likely several data that…
-
5
votes1
answer2299
viewsA: How to clear Mysql’s cache of queries?
Documentation: RESET QUERY CACHE; I put in the Github for future reference.…
-
6
votes3
answers428
viewsA: Linux or GNU/Linux?
The question already answers that. If the greatest experts on the subject don’t get along about this, it is not an answer in Sopt that will tell which is correct. There seems to be no doubt that the…
-
12
votes2
answers15565
viewsA: What are the differences between Kernel and Microkernel?
Definitions Kernel is a generic term and the definition is already in the question. It’s the core of the operating system, it’s what makes the basic things an operating system should do. It does not…
-
3
votes2
answers18066
viewsA: Access variable inside and outside a function
In PHP, to export the variable itself would have to declare it global. It’s the only way, but don’t do this. In general global variables should only be used in PHP very specific situations, and…
-
3
votes2
answers98
viewsA: Faster way to add an item to a list, using a structure
Switches to: Public Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load turmas.add(New turma() With { .id_turma = 1 }) End Sub I put in the Github for future reference. You need to…
-
2
votes1
answer135
viewsA: Faster way to add an item to an array, using a structure
There is no quick way to do this with array in VB.NET. Arrays were not made to have their size changed. If you need to do this, it is advisable to use a list. If you really want to do this, you’ll…
-
4
votes2
answers2117
viewsA: What is a literal?
In the above example the literal is 2. The literal term is not something from . NET or even computation, it is a basic mathematical term. Literal can be said, roughly speaking, since it is difficult…
-
10
votes2
answers2921
viewsA: What does the "=>" operator mean?
This is a function lambda, or as it is often called, arrow function. Is a anonymous function with a simpler syntax. available since Ecmascript 6. The left parentheses are the parameters and the one…
-
7
votes2
answers238
viewsA: Generalization of parameters in Java
Actually it is not possible to do this. If you need the method CompareTo() on the object then have to ensure that it exists. There are even some gambiarras that can be done individually to be able…
-
7
votes3
answers2963
viewsA: How to measure the complexity of an algorithm?
The complexity O(n) (linear) means that for each element of the collection that needs to manipulate, there must be at most one step in the algorithm. You can determine the amount of steps by doing a…
-
2
votes2
answers65
viewsA: Incremental result?
In fact, although it works, it is hardly readable in this way and can mislead the interpretation. It would be better so: x++; y -= x;
-
5
votes2
answers125
viewsA: Why does the list show the first two elements?
When you say >>> convites[0:2] is saying: from the 0 element of convites, go to the element preceding element 2. He is not saying: take the element 0 and 2. Ali is not a list but a…
-
5
votes2
answers1180
viewsA: Limit file size
One of the possibilities would be to add this to the web.config: <configuration> <system.web> <httpRuntime maxRequestLength="10000" /> </system.web> </configuration> It…
-
7
votes1
answer6364
viewsA: What are the advantages of using object-oriented databases?
Perks They allow a modeling that is said to be closer to the real world, although this is not possible in fact, in theory reducing maintenance. While it is possible in other types of Dbs, the…
-
2
votes1
answer61
viewsA: Get values from Arraysegment
Do so: string[] meuArray = {"stack", "overflow","em", "português"}; var meuSegmento = new ArraySegment<string>(meuArray, 2, (meuArray.Length - 2)); string[] arraySegmentado =…
-
7
votes1
answer297
views -
4
votes1
answer119
viewsA: Error reading and comparing matrix numbers
Vectors in almost all programming languages start from scratch and not from 1. So for 3 elements it must vary between 0 and 2, thus: #include <stdio.h> int main() { int matriz[3][3];…
-
5
votes1
answer459
viewsA: What is a shared_ptr?
You use it when you want to create a pointer to an object and let C++ manage it for you. The object will be automatically destroyed when there are no more references to it. It is preferable to use…
-
6
votes2
answers505
viewsA: Calling protected variable inside static method
Think of all static members as a single instance pre-instantiated in the application, it’s as if these members belong to another object. Already the members considered of instance belong each to its…
-
10
votes1
answer2823
viewsA: What does i-esimo mean in an array?
When you refer to the index 0 of a array, can speak the first element, right? Just as 1 is the second, 2 is the third, and so on. 19 is the twentieth. How would you talk about the element i of…
-
21
votes1
answer37459
views -
9
votes1
answer3721
viewsA: Is it possible to know the functions of a DLL without having its documentation?
It is possible to get through a utility to list DLL members such as the dumpbin Visual Studio or the DLL Export Viewer or the Dependency Walker. This will not give many details and will not tell…
-
5
votes3
answers394
viewsA: What does it mean to assign Math.Random() > 0.5 to a variable?
It means exactly a boolean. What is the answer of the expression Math.random() > 0.5? Will be true or false, right? It will check whether the drawn number is greater than half and get the result…
-
9
votes2
answers327
views -
12
votes1
answer568
viewsA: Would it be right to leave the attributes of the abstract class as private or protected?
It depends on what you want. If you leave the derived class private you will not be able to access them directly, this is usually what you want. If the derivative needs to access the field directly…
-
2
votes2
answers4930
viewsA: What is the difference between Math.Random and java.util.Random?
The class is more complete and flexible, allows to determine the type of data you want and is more efficient. It can, for example, repeat the same numbers if used with the same seed. The static…
-
16
votes10
answers1739
viewsA: How to count the zeroes to the right of a number?
Would this be: int countZeros(int n) { int count = 0; while (n % 10 == 0) { count++; n /= 10; } return count; } In C: See working in the ideone. And in the repl it.. Also put on the Github for…
-
8
votes1
answer20445
viewsA: How to open a. fdb file?
You can use any language that has Firebird support, or you can use a manager for it, such as Flame Robin, Interbase Query, Fbexport, Fenixsql, Marathon, Ibexpert (as comment below), among others,…
-
2
votes1
answer630
viewsA: Encrypt Sqlite3
It takes a little work because there is nothing ready to use with PHP (and most technologies), but there are libraries that can be integrated or replace the standard Sqlite: Sqlcipher…
-
9
votes3
answers210
viewsA: Function contrary to TRIM
The opposite of making a trimming (trimming) is making a padding (filling), so the functions to be used should be PADL() and PADR().…
-
6
votes2
answers180
viewsA: Very large integer does not work
Use the type unsigned long long and be happy.…
-
1
votes1
answer49
viewsA: What is the best way to work with user data coming from the server?
Localstorage is the way to go. Only Operamini does not accept it yet, if you need to support it you will have to make special code for it, as far as I know there is no good solution. You will…
-
6
votes3
answers454
viewsA: Why was the parameterized class attribute <T> not instantiated?
If the class wasn’t parameterized, it would still look like this. The ideal is that the parameter type of the constructor method is the same as the member it will initialize, that is, it should also…
-
14
votes3
answers675
viewsA: Why can’t I declare an attribute using the var keyword?
The simple answer: because the language specification says that you should not infer in this case. That is, the language creators thought it was not worth doing this. There are languages that infer.…
-
6
votes2
answers121
viewsA: Is there an alternative to Removeat()?
You have to analyze what you can lose. The search or access by index in the structure shown by Ono Sendai is bad (not that his answer is bad, on the contrary), if this is not important, go to it. If…
-
6
votes1
answer290
viewsA: Manipulation of Vectors in C++
Specifically for the type vector iterate with for normal controlling access is faster than through an iterator, but this is not true in most other existing data collections. Has to measure. To…
-
4
votes2
answers222
viewsA: Problems computing on average in Java
The question already answers where the problem is. Note that the 4 notes are of the type int. This type, as its name implies, only accepts integers. You have to change the type of variables, and…
-
18
votes2
answers1468
viewsA: When and why should I use Class <T> templates classes in Java?
In C++ this can be called template, but in Java these classes are called generic. This is necessary when a class can use the same basic structure and algorithms with several data types. Think of…
-
27
votes3
answers1989
viewsA: How do I know if the first digit of a string is a number?
It’s simple, you need to take the first character and use the ready function isDigit(). Character.isDigit(x.charAt(0)) Behold working in the ideone. And in the repl it.. Also put on the Github for…
-
8
votes3
answers5080
viewsA: Clear C buffer with fflush() or __fpurge()
The main reason is that there is no clear definition of the ISO standard. Few compilers implement it in a way that does what is expected of it, especially with stdin which is used by scanf(). It is…
-
8
votes2
answers209
viewsA: Is there a package management system on the Moon?
The language’s "default" package manager is Luarocks. Luadist is also used by some, I don’t know if we can consider as package manager.…
-
20
votes3
answers1862
viewsA: Specification and Implementation
Specification It is something abstract. It is some "document" that establishes rules to be followed, what is expected from possible implementations. These rules may require some things and prohibit…
-
21
votes2
answers1527
viewsA: What are and how do . NET technologies relate to developing web systems?
Although there are several options frameworks in the. NET ecosystem, unlike in Java, almost no one uses them. One sits on top of Microsoft’s ASP.NET. Whether this is good or bad is for each one’s…
-
4
votes2
answers3704
viewsA: How does the equals method work?
The Equals() is a method that comes from the class Object and in its signature awaits an object of the type Object as a parameter. If the signature of the method were equals(ExemploContaEquals obj),…
-
3
votes3
answers1081
viewsA: Sort chained list with O(n*log(n) method)
The question is something that can guarantee complexity, does not talk about anything related to speed, are different concepts. Chained list with this complexity is hard to find, only quicksort does…
-
8
votes3
answers242
viewsA: Why do I need to declare a guy inside the "foreach"?
The code ArrayList textos = new ArrayList<String>(); textos.add("texto1"); textos.add("texto2"); for (String t : textos) { System.out.println(t); } It’s actually compiled like this: ArrayList…
-
8
votes3
answers157
views