Posts by Maniero • 444,682 points
6,921 posts
-
4
votes3
answers949
viewsA: Why does the User-Agent header always return "Mozilla /5.0" independent of the browser?
I don’t know how to answer in detail. I’m answering only to have an answer that’s not wrong. The reason browsers use this should be more or less the same reason as they claim the Windows 10 do not…
-
3
votes2
answers215
viewsA: How to maintain a local file that is in conflict with the repository?
You can use the stash to "protect" the file. So you can get back any changes that exist in local files. Of course there may be conflicts around that which must be resolved as needed. git stash git…
-
1
votes3
answers2971
views -
30
votes2
answers12475
viewsA: What is the Antiforgerytoken?
Is a method which generates and inserts into the HTML generated in view a code to prevent data sending to the server from being falsified. When using this method he inserts something like this:…
-
4
votes2
answers675
views -
16
votes1
answer10829
views -
16
votes1
answer10829
views -
12
votes3
answers3377
viewsA: How does the MVC framework for Desktop applications work?
I cannot give a very complete answer now. But I can help with something. This thing of organizing into folders and files is something that depends on the need. MVC does not define any of this. Each…
-
11
votes1
answer1492
viewsA: Libraries, interface, classes and methods
The terms are completely wrong and mixed. There is a relationship between class and interface. Library is a generic term that is not used in the code itself. What you are probably talking about are…
-
3
votes2
answers718
viewsA: What is the most threads supported by Java EE?
This information is not relevant. The processing architecture and the operating system will determine this. There may be a theoretical limit, but what will determine the limit is practicality. It is…
-
6
votes2
answers214
viewsA: Make a reference variable point to another variable
As the variable is a reference and this type is immutable, there is no way to do it this way. With a pointer you can get the same result. After creating a pointer to a, it is possible to point to…
-
7
votes4
answers872
viewsA: I need different ways to rearrange characters within a string, how do I do that?
You don’t have to keep fiddling with the text, just compare each character starting from the first with the last, then the second with the penultimate and so on. You need to compare only half as…
-
10
votes2
answers3445
views -
1
votes1
answer109
viewsA: Unity code does not compile
If you take the ; on these two lines should already solve all problems: private void OnTriggerEnter2D (Collider2D other) { //checa se e a saida. if (other.tag == "exit") I put in the Github for…
-
2
votes1
answer94
views -
9
votes1
answer450
viewsA: Web application for multiple people
There are both forms and even a hybrid form (part of the application accesses shared database and part uses alone). This can still vary whether companies are different customers or companies within…
-
2
votes3
answers451
viewsA: Exchange Postgresql connection for Mysql connection
I believe phpMyAdmin has nothing to do with it. Certainly you can change the access from Postgresql to Mysql but will have to change in several places. The change is not so simple. The first change…
-
6
votes2
answers1050
viewsA: How to order numbers from an array?
You know how to do, just don’t know how to see the result. The function sort() realize what you want upon your own array that you pass. Then you just print the array again after going through the…
-
10
votes2
answers1608
viewsA: Infinite loop trying to calculate if the number is prime
To program you have to think of everything as the problem really is. It’s no use kicking things. This is not programming. One of the things that helps clarify the thoughts is to keep the code well…
-
3
votes2
answers2263
viewsA: How to generate an extract per month in the database?
To make the balance would do so: SELECT DATE_FORMAT(data,'%d/%m/%Y') AS data, IF(tipo = 'D', valor, '') AS debito, IF(tipo = 'C', valor, '') AS credito, (SELECT SUM(IF(tipo = 'C', valor, -valor))…
-
2
votes1
answer127
viewsA: Repeat commands to restrict a valid value
I solved other problems, I formatted better for easier reading. See that even looking silly, the spaces, the score, everything helps. If the problem is to keep repeating the order until an invalid…
-
4
votes2
answers19877
viewsA: How to include an action in the HTML5 sign-up button?
Or you have to do: <form action="paginas/login.php"> <p id="log">Usuário: </p> <input id="cmpG" type="text" name="usuario"/> <p id="log">Senha: </p> <input…
-
4
votes1
answer223
viewsA: How does this code restrict entry to a number between 0 and 4?
The correct answer is C. The program calculates the factorial Clearly the program is doing this - Checked of a given value in the range of 0 to 4 inclusive (sic) while(n<0 || n>4) scanf("%d",…
-
2
votes1
answer159
viewsA: How do I select multiple fields in the same query?
If I have understood, it is more or less this (I hope I have not interpreted anything wrong): SELECT Titulares_Adicionais.Limite, Titulares_Adicionais.Grau_Parentesco, Conta.Cod_Titular,…
-
3
votes1
answer67
viewsA: Problem with product update
I don’t know if I understand what you want but it seems to me that’s all you need: UPDATE loja.produto SET UNIDADE = UNIDADE - 1 WHERE CODIGO = '212212121'; I put in the Github for future reference.…
-
4
votes1
answer1061
views -
6
votes1
answer5793
viewsA: How to close all active connections?
It does not exist directly but it is possible to do this. Run this in Mysql: select concat('KILL ',id,';') from information_schema.processlist where user='root' into outfile '/tmp/a.txt'; afterward…
-
2
votes1
answer454
viewsA: Code build error in Unity
It gets hard to help with just this but one thing that’s definitely wrong is this: bool walking = h != 0f.v!=0f;. This particular problem probably solves so: void animating(float h, float v) =>…
-
7
votes4
answers6626
viewsA: What SQL command shows the maximum number of active connections to the Mysql database?
SHOW VARIABLES; Documentation.
-
2
votes1
answer1361
viewsA: Program memory cleaning in use
I’d say 99% of the time someone wears one timer did not need it. A timer It should only be used when you really need something to run at each time interval. But most of the problems that need…
-
5
votes2
answers3368
viewsA: Send email using ASP.NET MVC
One way that I find interesting is this: public bool Mail(MailAddress to, MailAddress from, string sub, string body) { var me = new EmailBusiness(); var m = new MailMessage() { Subject = sub, Body =…
-
4
votes3
answers1053
viewsA: How to update with SQL Server count?
I think this is what you need (I have no way to test): DECLARE @contador int; SET @contador = 1; UPDATE tabela SET @contador = Posicao = @contador + 1 ORDER BY Nome; I put in the Github for future…
-
37
votes2
answers2324
viewsA: Why do they say using arroba to suppress errors is bad practice?
Like anything, you can use without problems as long as you know what you’re doing and have a good reason to use. In general this syntax should not be used because people do not know all consequences…
-
2
votes1
answer321
viewsA: Send UTC Datetime Javascript to C#
UTC is the universal standard time, the so-called GMT, is zero time, the time that is independent of where it is. This time zone information is not available on type DateTime, therefore it cannot be…
-
1
votes2
answers1158
viewsA: Remove specific data on a stack
I think I should use another structure, maybe even create one that uses a list of methods Pop() and Push(). But I’ll give you the solution you asked for: WriteLine("Qual elemento:"); var selecionado…
-
2
votes2
answers172
viewsA: Error in reading, strings and integers
This code doesn’t make much sense so you can’t know what you want. It has some problems and is poorly organized. I was restructured to be able to understand and ended up solving the problem. I just…
-
5
votes2
answers147
views -
1
votes1
answer2060
viewsA: Grab the application folder
This code has some problems but I’ll give you just what you asked: var file = new FileInfo(Path.Combine(Path.GetDirectoryName( Assembly.GetExecutingAssembly().Location), @"script.sql")); Behold…
-
6
votes2
answers1118
viewsA: Testing primes in C
The problem is that this code is not testing whether the numbers are primes. The expression i % i == 0 gives a good indication that there is something missing there. This expression will always be…
-
3
votes1
answer124
views -
3
votes1
answer516
viewsA: Console cursor coordinates in C
There is no standard way to do this, it depends on the console library you are using. On Linux it usually works: void gotoxy(int x, int y) { printf("\033[%d;%dH", x, y); } Under Windows you can use…
-
7
votes1
answer2424
viewsA: Free up memory in C++
No. You don’t have to release memory of variables. Never, at least of local variables (not variables that are part of another object. You have to free up memory of objects that are pointed by…
-
3
votes2
answers7769
views -
2
votes1
answer75
views -
30
votes4
answers48488
viewsA: Where should I put a Javascript code in an HTML document?
All the old answers to this question are right, but there is a better solution that has not been shown in any of them where you do not need to worry about this. Of course this solution is not…
-
4
votes1
answer1015
viewsA: Why is it recommended to place Javascript codes at the end of the body tag scope?
Because then the main elements of the page and that should be the most relevant can already be rendered before the end of the verification and interpretation of the parts in JS that are usually…
-
7
votes1
answer279
viewsA: Store part of a string in a variable
Use the Split(): var items = texto.Split('|'); This will generate a array, if you want to take each element and put it in each variable you want. This is a really manual job. Behold working in the…
-
2
votes1
answer451
viewsA: File reading.ini
Use a library ready or will make many mistakes. CSimpleIniA ini; ini.SetUnicode(); ini.LoadFile("arquivos.ini"); const char * pVal = ini.GetValue("config", "host", NULL); ini.SetValue("config",…
-
3
votes2
answers887
viewsA: Calling a string equivalent method
I advise doing this with delegated methods and not using string to set the method call. It looks like you are using an event to trigger events, only the wrong way. But I’ll give you an answer…
-
6
votes2
answers2960
viewsA: Error log in Java application
It is difficult to make a full tutorial, would escape the focus of the site. You should have a class that takes care of it for you. The ideal is to use one that already does all the work without…