Posts by Maniero • 444,682 points
6,921 posts
-
5
votes2
answers335
viewsA: Javascript code does not execute prompt
Javascript has no annotation of data types in the variables and parameters, so the int causes the problem. You have to take this out. If you want to use types, you have to choose Typescript.…
javascriptanswered Maniero 444,682 -
2
votes1
answer71
viewsA: The function does not work
The code has syntax error, missing a sign l of more in the concatenation of texts and also accessed the variable imc that did not exist in that context, when you name a variable, you have to use…
javascriptanswered Maniero 444,682 -
3
votes1
answer40
viewsA: Error trying to set Npgsqldataadapter Missingschemaaction property
That’s what I figured, with the screenshot from the IDE you could see that you are using the wrong variable or trying to use a non-available property for this variable. npgsqlCommand is a variable…
-
2
votes2
answers189
viewsA: Problem to add content in Arraylist
The code had several errors, some very basic syntactics (apart from the disorganization. I fixed to compile. But he still has other problems and he doesn’t make any sense. The classes are not very…
-
3
votes1
answer68
viewsA: "no overloaded Function takes 0 Arguments" when trying to insert into Std:
The problem is just that you are trying to add something to the array without saying what. You need to pass an object of the type bunny for the method for it to make the addition:…
-
25
votes1
answer2199
viewsA: What is generic programming?
Term A paradigm is a programming style, where a technique is applied. So it’s a technique and can be a paradigm, according to specialized and recognized literature. We can say that it is a limited…
-
5
votes2
answers519
viewsA: What is the best place to store the connection string?
The best is to have the basic setup on app.config (eventually web.config) and not put passwords in it. But if you do, what do you do using encryption. Placing passwords exposed, especially, is…
-
2
votes2
answers754
viewsA: How to change the last 100 table records in the Postgresql database?
The UPDATE has not LIMIT so he thinks that that’s continuity of ORDER BY which is also not accepted. Try this: UPDATE titulo SET autorizado = 'S' FROM ( SELECT id_titulo FROM titulo ORDER BY…
-
4
votes1
answer9945
viewsA: How to know if a number is integer
The rest of the division is an integer, by definition. If it is not integer, it is not remainder. Alias the whole description of the problem does not seem to make the least sense. I will answer the…
-
2
votes1
answer163
viewsA: Are the MVC paradigms and Webforms (with code-Behind) mutually exclusive?
MVC and Webforms are design patterns or architectural patterns as they consider some (there are controversies), but they are not paradigms. 3 Layers have nothing to do with it. It’s too generic to…
-
3
votes4
answers343
viewsA: Why not always use Optimize Code?
Because these optimizations are not always desirable. They do not always produce what is expected. Each case is a case and you should choose to call or not after testing both. In addition, it is…
-
3
votes2
answers223
viewsA: Which database is ideal for my scenario?
The Firebird you do not need to install is not at all suitable for what you want, it is absurdly more limited than Sqlite. The version that works well (although scalable even to the version I know)…
-
2
votes2
answers102
viewsA: Function calculates to a certain extent and to
There is a number limit that can be represented by the numeric types, this formula is working with too large numbers. You need to create or use something ready that can handle such large values.…
-
4
votes2
answers239
viewsA: Multiple assignment in Mysql
Mysql has nothing of its own that does this. It has a database that has a type array which allows this to be done in a relatively simple way (it is not so simple). The normal is to create multiple…
-
4
votes2
answers326
viewsA: Vector receives method return
The problem on the specific line is that the method Main() is static and the Fornecimento() it is not, you cannot call an instance method in a static method. Both need to be static, so just put a…
-
3
votes1
answer104
viewsA: Problems with uint64_t in C++
You’ll have to use a library BigInteger or create one of their own. Each has its advantages and disadvantages. I have chosen the Infint by being simple to pick up and use, but it does not have a…
-
3
votes1
answer1019
viewsA: Encrypt a phrase/word by reversing and switching vowels with the following vowels
This is just a pseudo encryption. The code has some problems and is a bit confusing. I modified it to get more organized: import java.util.Scanner; class ExerciciosClass01h { public static String…
-
4
votes1
answer200
viewsA: Phpstorm displays a message when using "include" and "require"
The command makes the inclusion of code based on a variable, so Phpstorm, which is an IDE that tries to analyze as much of what can happen to the code, cannot go any further in analyzing this, only…
-
1
votes1
answer791
viewsA: error expected Primary-Expression before ' ' token
I believe it was just a typo, since the operator % You need to have two operands, you only have one. Parentheses are there without meaning. Maybe the intention was to put an expression in there and…
-
3
votes2
answers159
viewsA: Double wrapper initialization with int does not compile
With the comments it is clear that there is a confusion between Boxing and casting. They are completely different concepts. Boxing What the guy Double makes is the Boxing of floating point values…
-
3
votes1
answer68
views -
5
votes1
answer342
viewsA: Difference in thread execution in Java
First: the class of the first example is conceptually wrong. PingPong is not a Thread, so you shouldn’t inherit it from it. It works, but it’s wrong. That’s not really the problem. I understand that…
-
19
votes4
answers24580
viewsA: Is there a difference between Program, Thread and Process?
Program The program is what is already defined in the question. In general a program generates an executable that can be called directly or through other executables (well, in fact the initial call…
-
31
votes1
answer933
viewsA: Why is the use of "break" considered bad?
People have prejudices. Even with language commands. Deep down what they say is really bad is the use of goto, whose myth I already detonate in another question. They say that the break is a goto…
-
21
votes2
answers8059
viewsA: What is upcasting and downcasting in the Java language?
Upcasting is to make an object pass through an object that is a supertype of it. It will always work since every object is fully compatible with a type from which it was derived. As can always be…
-
3
votes1
answer198
viewsA: Do not repeat letters (char) in an ASCII matrix
Instead of using random generation use the algorithm Fisher-Yates. It would be nice to create a function that creates the list and then use as you wish: public static List<Integer>…
-
13
votes3
answers5129
viewsA: What is the difference between using single and double quotes in C#?
It is different from PHP where they are almost interchangeable. Single quotes or apostrophe only serves to delimit a single character (type char - part of a UTF-16). Double quotes serve to delimit a…
-
7
votes3
answers1496
viewsA: Why is it possible to define two or more methods with the same name in the same class in C#?
Term This is called function overload (in English well better). It is quite common in statically typed languages. It exists in languages of diverse paradigms and is not a feature of object…
-
1
votes2
answers261
viewsA: Inheritance in the Entity Framework
Correct. Assuming you want to have a table for each type. Nor could it be different, since properties do not appear in the child classes. Of course the rest of the modeling needs to be right too :)…
-
8
votes1
answer1481
viewsA: What are "generated columns" in Mysql and what would your applications be?
They are calculated columns. These columns should not be updated by you, they will always have the value defined based on the data of the other columns. It is a facilitator to access a certain…
-
8
votes2
answers972
viewsA: Why only use Return, without returning any data?
There are cases where you just want to run a routine, follow an algorithm, a procedure, without generating results. It does an action but does not produce a value to be used in an expression. Each…
-
8
votes1
answer2251
viewsA: MVC or SPA app
What is best for you in each case only you can say. The two technologies do not compete with each other, so there is no dichotomy. If you want to use both. ASP.NET MVC is a server technology. SPA is…
-
3
votes1
answer409
viewsA: How to pass an array as parameters or arguments?
You don’t have much control over it, a lot can go wrong. You have to know what you’re doing. PHP 5.6 example(...$array); Documentation. This is usually called splat. PHP previous to 5.6…
-
9
votes2
answers1476
viewsA: How to leave variables privately in Javascript?
In the file just use a var to declare the variable. Still not ideal. Variables must be more local yet. The ideal is to declare variables only within functions. You can also do this on objects. Only…
-
3
votes4
answers835
views -
5
votes2
answers70
views -
7
votes2
answers1802
views -
4
votes3
answers414
viewsA: How to change the structure of a LINQ query at runtime?
I think this is what you want: private void lerPessoa(string nome, bool maiorIdade) { using (BancoEFEntities context = new BancoEFEntities()) { var pessoa = from p in context.Pessoa where…
-
8
votes1
answer189
viewsA: Why is the incrementer "lost" in the loop?
It doesn’t get lost, it does exactly what it was told to do. The loop is one thing and the function passed to jQuery is another completely separate. This is because the function is a closure. It…
-
3
votes1
answer87
viewsA: Implement a vector that accepts anything
The solution is simpler than what is in the question, only by the comments can realize that it is only one array of objects. Then simply state that the type is Objeto: Object[] array = new…
-
2
votes1
answer490
viewsA: Store values in inverted order
How you’ll only touch one array, only needs one loop. To find the other’s element array just use math. Just calculate the index backwards. Could scan the array from the first to the last that the…
-
3
votes1
answer225
viewsA: Association of various classes in Java
Although I have strange things I will answer according to what is described in the question and in the comments. If the requirements are wrong it is clear that the solution will go wrong, but then…
-
4
votes2
answers145
viewsA: Modeling Database
This has nothing to do with normalization, neither for better nor for worse. Unless you have hidden requirements in the question, I cannot talk about what is not written. Generally speaking, I…
-
5
votes1
answer85
viewsA: Obtaining different results by passing by value and passing by reference
The function swap() does what is expected of an exchange function, then the second code is right and the first is wrong, after all in the first no exchange is made. Of course, probably the purpose…
-
5
votes1
answer832
viewsA: How to copy a file from the network to my computer using C#?
One solution is to use the class Impersonator available in Codeproject. Also has good answers (accepted and most voted) in the OS. Used WNetAddConnection2 of the Windows API to achieve this. It…
-
1
votes1
answer672
viewsA: Static method with object as parameter
The requirement of exercise seems to make little or no sense. If the method should register the student, he should do the whole, he should not require that an object be passed to him. I would rather…
-
2
votes2
answers161
viewsA: Postgresql oid column attribute type with EF6
According to the Npgsql provider documentation (I imagine this is the one you’re using) the type is the uint. Since there is no EF support for unmarked types, then use the int same. Or change ORM :P…
-
2
votes1
answer842
viewsA: Best way to structure history table with large amount of data
The problem does not seem to be exponential or polynomial. There are some that are, there would not be much to do. If there is an exponential or polynomial implementation, you have to solve it, but…
-
8
votes2
answers1094
viewsA: How to declare a function within another function in C#?
Gambiarra Until C#6 the only way was the use of lambda which is nothing more than a pointer to function (can eventually store captured variables as well), so it is possible to write the body of a…
-
1
votes2
answers247
viewsA: I need to get a description of the task manager process
According to this response in the OS has a form that solves in most situations, but not guaranteed. You need to use Windows API functions that are not normally available on . Net:…