Posts by Maniero • 444,682 points
6,921 posts
-
44
votes3
answers25089
viewsA: What is the function of a static method?
Instance X types In a certain way we can say that it is impossible to instantiate an object to access a static method. Static methods never operate in the instance. If they’re in static classes it…
-
16
votes1
answer7144
viewsA: What is Data Warehouse and what are its advantages and disadvantages?
It is an abstract concept that indicates that you are consolidating data from various sources and applications of an organization into a single "location" facilitating your queries and eventually…
-
7
votes2
answers260
viewsA: Doubt about pointers
It’s simple, in C there are no arrays in fact, it’s just a syntactic sugar, it’s just to make life easier for the programmer. C only has pointers. So in the background when you write: a[5] actually…
-
2
votes2
answers520
viewsA: Problems with if and conditions
I reformulated his program to solve the problem and give an organized to make it more readable. I recommend paying close attention to the changes. I’m not sure if your code is doing what you want…
-
6
votes3
answers237
viewsA: jQuery influences the application’s "performance"?
No doubt it does. It’s an extra layer that will perform extra things that are not always needed if you do it directly in Vanilla JS. Beyond that, hiding things can help on one side and can…
-
4
votes1
answer727
viewsA: What is the difference of implementing classes in C++ and PHP?
Under normal conditions PHP works anyway. You can only define the method next to your declaration. Unlike C++, declaration and method definition (how it is implemented) occurs in a single step,…
-
4
votes2
answers167
viewsA: Is there incompatibility and errors between Internet explorer and Postgresql?
The problem certainly lies in the way the research is done. You’re not finding any differences in the results shown depending on the browser brand. Is finding differences depending on who is using…
-
3
votes1
answer256
viewsA: Is it possible to use C# + Client Delphi server?
Each case is a case. It is possible to use both and make them communicate through webservices or something similar. The intention of the webservice, that is not always the best solution, is…
-
7
votes2
answers105
viewsA: Wrong date calculation
Alternatively you can use a library that knows how to handle this properly like the Noda Time of Jon Skeet (I wanted her to become an official of .NET). He has already set an example by doing this…
-
17
votes2
answers16045
viewsA: Foreach or lambda in lists
The only way to know for sure is to test and this can change according to the data set and the algorithm to be run on each item. First let’s note that the two algorithms shown are not equivalent.…
-
7
votes3
answers10588
viewsA: Global variable in all functions of the class
My understanding of the question is that it is necessary to store the connection data in a variable that can be accessed from any point of the application. A global variable is a solution to this…
-
2
votes1
answer66
viewsA: Generate large proportion prime and integer numbers
I agree with the bfavaretto that the easiest is to assemble a array with all the numbers. Real software does this. It’s only worth creating at hand if it’s exercise to learn but then you should do…
-
7
votes3
answers520
viewsA: Is Microsoft Azure recommended to host game site?
Yes, supports PHP as per a central for PHP developers platform. Then you can make your website without fear. Whether it is recommended or not, only you can say. My opinion would help nothing, but…
-
9
votes1
answer6718
viewsA: Truncate all tables in a database in Mysql
Withdrawal solution of that response in the OS: mysql -Nse 'show tables' DATABASE_NAME | while read table; do mysql -e "truncate table $table" DATABASE_NAME; done Or through sql command: SELECT…
-
2
votes1
answer94
viewsA: Ribbon for Visual Studio Express 2013
First I want to say that you probably no longer need to use this limited Visual Studio. There is an almost full free version called Visual Studio Community Edition. More details can be obtained in…
-
6
votes2
answers1169
viewsA: Fiscal Printer
If you are using a tax printer even for tax purposes, forget it, the legislation itself prevents use through browsers. Not explicitly but by the software type-approval requirements. Even if it is a…
-
4
votes3
answers137
viewsA: Problems with WHERE IN (many records)
Probably if you use one JOIN will get better performance. As there are no details I do not know if would solve your case, if not solve, then the IN may be the best solution even though I have not…
-
17
votes1
answer627
viewsA: Which attribute to use for database fields working with numbers from 0 to 5?
Looking at your modeling I see some weird things. First I will answer what was asked. And the question is a little strange too, maybe because you don’t know the correct terms. Or we’re not…
-
6
votes2
answers3701
viewsA: Get directory from server
I think this is what you want: echo realpath(dirname(__FILE__)); Behold working in the ideone. And in the repl it.. Also put on the Github for future reference. Documentation dirname() and…
-
4
votes1
answer271
viewsA: Database with extra headers
As far as I know no relational database does this "natively". On the other hand the result is possible in any relational database. I speak in relational because there seems to be a requirement to…
-
4
votes3
answers2212
views -
12
votes3
answers419
viewsA: Assign type to parameters
It is possible partially through the so-called hinting type. You can only use complex types, like objects, arrays or flame types (Amble). Cannot use scalar types as is the case with int or string…
-
22
votes2
answers2094
viewsA: Principle of Liskov’s replacement
The the principle of Liskov’s substitution can be applied in languages that guarantee nothing. The principle uses a semantics and does not care about the implementation of this. Even languages that…
-
6
votes1
answer169
viewsA: Add value to SQL table instead of replacing
If you want to add to what already exists you must do this account, so: "UPDATE `login` SET diasvip = diasvip + " . $_POST["qntvip"] . " WHERE userid = '".$_POST["userid"] . "'" I put in the Github…
-
5
votes3
answers527
viewsA: Protect secret configuration file
Not much to do. You can protect from external access with traditional means and protect the entire server so you don’t have improper access but someone being on the server makes it difficult to…
-
4
votes3
answers12476
views -
9
votes5
answers6566
views -
4
votes1
answer366
viewsA: Tables with columns always null
Strictly speaking indeed mutually exclusive columns are not desirable and can rather be considered wrong. This is not to say that you should never do and that proper results cannot be obtained if…
-
16
votes3
answers1348
viewsA: Problems with "or" in C++
The preferred syntax of or in C++ is || although they are synonymous. In addition there was a ; that was closing the if and not performing as it seems to be your wish. The message was not being part…
-
6
votes4
answers784
viewsA: Break an integer into small parts in Java
Mathematically solving: import java.util.*; class Ideone { public static void main (String[] args) { ImprimeLista(SeparaDigitos(12345)); ImprimeLista(SeparaDigitos(-123));…
-
6
votes1
answer2019
viewsA: Could you add a UNIQUE field that accepts nulls?
Postgresql allows a column to be null even if it has a UNIQUE since the value NULL is exceptional and is never equal to other nulls. There is nothing to stop what you are doing. You would only have…
-
4
votes2
answers2092
viewsA: Fill all fields of an Object iteratively
Doing this type of operation always has a bit of risk, whether the order of the data or if the types are not the expected can give problem. The ideal is to try to find another solution, maybe even…
-
27
votes1
answer1075
viewsA: Polymorphism in procedural language
A switch can always be replaced by a table, after all its internal implementation is usually done with a table. A sequence of ifs is just not so because it is difficult for the compiler to determine…
-
6
votes3
answers707
viewsA: Sum table values
I see some problems in this code: The code appears to be manipulated monetary values and using the type double, this does not give hit, you will have rounding problems. Is increasing i twice, I…
-
3
votes1
answer529
viewsA: How to concatenate properties of a single List<> with LINQ?
Do you see any reason to do this? This generates side effect, that is, some data is modified, so LINQ is not suitable. Q there is of query, ie, query. When you want to do more than one query the…
-
11
votes2
answers2530
views -
6
votes2
answers3910
viewsA: Get first digits of a number in Java
There are several ways to do this. One of them is to turn into string with valueOf() and take a piece of it with the method substr() and then convert back to int, thus: import java.lang.*; class…
-
12
votes2
answers3077
viewsA: Why in class statements in Python should we extend Object?
First, you are not passing any parameter, the syntax seems to refer to this but it is just Python’s way of indicating which class you are inheriting. At one point (Python 2.2 and 2.3) there was a…
-
18
votes2
answers2027
viewsA: What are operators for | & << >>?
These are called operators bitwise. They do operations directly on us bits of numerical data. The first two are the or and the and and work in a similar way to || and && but the Boolean…
-
11
votes3
answers4038
viewsA: What is the difference between using virtual property or not in EF?
It creates a class derived from your class to work internally. This is a standard called Dynamic proxy. This makes data navigation easier. Polymorphism How the class is derived the call needs to be…
-
9
votes3
answers9803
viewsA: Passing array as a function parameter
The code has some problems, it can be much simpler than this: <?php function dobrar_array($dobrar) { //agora está recebendo um parâmetro aqui //a função que era chamada aqui não era necessária e…
-
2
votes1
answer238
viewsA: Relationship Tables
I think this is what you want: CREATE TABLE Fornecedor { id INT(4) NOT NULL UNSIGNED AUTO_INCREMENT, nome VARCHAR(100) NOT NULL, endereco INT(4) NOT NULL, PRIMARY KEY (id), FOREIGN KEY (endereco)…
-
4
votes2
answers816
viewsA: Convert hexadecimal to integer
Missed you using the conversion base. There is also a problem because this number does not fit in a int, you need to use a long (Convert.ToInt64()) to perform the conversion. using static…
-
3
votes2
answers472
viewsA: How to expand the window by clicking a button?
Apparently this message box appeared by capturing the exception made by Java itself. So there is nothing to do. What you can do is you capture the exception in the proper location - it can be on…
-
16
votes3
answers10708
viewsA: What is the main difference between a Tuple and a List?
From the technical point of view in Python a tuple is immutable and a list is mutable. From the conceptual point of view you should use tuples to assemble heterogeneous data structures while the…
-
4
votes2
answers2516
viewsA: What are the differences between Inputstreamreader and Java Scanner
Besides the size of buffer standard of the first being much larger than the second, the InputStreamReader was designed to read streams generally and with a lot of control on how to read although not…
-
3
votes3
answers346
viewsA: Variable error within the function
I do not know if you have put enough code and information to indicate clearly where the problem is but surely there is something that will help or solve the problem. Probably just transfer the…
-
9
votes1
answer2747
viewsA: What are the API’s to create a graphical Java interface?
It is possible to use any library that is available, you can make your own library. Ultimately it is clear that all these libraries will have to access the graphical API to desktop operating systems…
-
16
votes2
answers4841
viewsA: How does the merge work?
Only the repository you are currently in is updated (in this case it should be the daniela3 if I got it right). If you want another repository to be updated (not that it seems to be your case) you…
-
55
votes3
answers1056
viewsA: What is "with" for in Javascript?
It is only to facilitate typing when you will access multiple members of an object. As your example shows you can type only nome and didn’t need to type obj.nome to access the member. The gain is…