Posts by Maniero • 444,682 points
6,921 posts
-
6
votes3
answers766
views -
4
votes2
answers2291
viewsA: Storing measure drive in Mysql table
I always say that information that is only descriptive should be of the character type (VARCHAR, for example). Only information involving accounts should use numeric types (DECIMAL, FLOAT, for…
-
16
votes2
answers1560
viewsA: How to create an aquivo. h?
The files with extension .h or .hpp As some like to differentiate from C header files, they are usually used to place code needed to compile other parts of an application. When we create an…
-
1
votes1
answer893
views -
3
votes1
answer1167
viewsA: Where can I get the Android source code?
The sources of the operating system stay in place where almost everything is open source today stands, in the Github. Of course there are other mirrors but this is the most practical. A alternative.…
-
2
votes2
answers1307
views -
1
votes1
answer455
viewsA: Can I become a programmer studying Python using Qpython?
It can. Especially if you consider that making programs makes one a programmer. Becoming a quality programmer is something else. It’s a long process of dedication. Something few people do. Even so,…
-
1
votes1
answer215
viewsA: IIS Express or Owin self host (as a service)
It’s always hard to say anything about this kind of situation because every case is a case and only knowing all details is that you can make a reasonable decision. And it’s complicated because in…
-
3
votes1
answer812
viewsA: Licensing of programs made in Python
From a legal point of view, you can do as you like, the software is yours and no one can say anything as you will distribute it. The only restriction is if you use code in your application that…
-
13
votes1
answer2093
viewsA: OWIN and Oauth What are they and how to use them?
The OWIN (Open Web Interface for . NET) is a solution to generalize application access to the host. Before it existed to run ASP.NET it required IIS or it would have to modify ASP.NET’s own…
-
10
votes3
answers1132
viewsA: When to use finalizers and garbage collection in Java?
They don’t use it because it’s not meant to be. There must be a strong reason to use them directly in production application code and there is rarely this strong reason. In general the System.gc is…
-
3
votes1
answer227
viewsA: Program does not execute anything when it enters function
The error is that you are incrementing the second loop with the wrong variable: #include <stdio.h> #include <stdlib.h> #include <time.h> int random() { float x;…
-
1
votes1
answer252
viewsA: More performative way to return data to the View
Essentially, it makes no difference. It can, and I said only that there may be a small difference between one or the other, but it will be irrelevant, especially near the whole that will be…
-
24
votes2
answers418
viewsA: Is it bad practice to use empty interfaces?
That’s what I always say, good or bad practices depend on the case. The term, unfortunately, is used to create manuals, "the right way to do," and so people start following things blindly.…
-
12
votes8
answers45010
views -
8
votes2
answers1353
viewsA: What can the Model do to validate the MVC?
You can do whatever you want. No one can tell you that you are the creator of the software what you should do. Unless, of course, there is a technical reason to do so. This is the good news. Forget…
-
32
votes5
answers106673
viewsA: How to generate random numbers in Python?
from random import randint print(randint(0,9)) This generates integer numbers between 0 and 9. It is possible to use several other functions available in documentation. Each one can be better for…
-
3
votes2
answers193
viewsA: Insert in Mysql does not run
Just make it work: INSERT INTO match VALUES(NULL, 5, 0, 'open') You’re trying to record strings a columns of the type int. Is not possible. With the editing it looks like it’s PHP code, so the…
-
5
votes1
answer1432
views -
4
votes1
answer155
viewsA: Is Visual Studio 2013 compatible with SQL Server 2014?
If you are saying it is because there is some incompatibility, but in more information it is difficult to help. In thesis it is possible to use both together but may need to do some things. There is…
-
70
votes1
answer13752
views -
8
votes1
answer558
viewsA: Try/catch on JS
The point is that Javascript has the variable scope declared with var location to the function and not to the execution block, as occurs in other languages. This phenomenon is known to Hoisting. So…
-
4
votes1
answer143
viewsA: Use of % in HTML files
This is used by the software on the server. The browser has no way to do this directly (at least not as you are talking about). Just look at the font of the page in the browser and you will see that…
-
2
votes1
answer709
viewsA: Add typed values without using array
The use of array was just getting in the way, just use a normal variable instead of a array, after all it had no function in the algorithm. #include <stdio.h> int main() { int soma = 0;…
-
11
votes2
answers111
viewsA: Access to specific memory points
You cannot access a random address like this in most situations. Today there is protection for access to memory. In some cases you will be able to access by doing: #include <cstdint> uintptr_t…
-
19
votes4
answers23451
viewsA: How to convert seconds to "Hour:Minute:Second" format?
You can go splitting seconds to find hours and minutes: $total = 685; $horas = floor($total / 3600); $minutos = floor(($total - ($horas * 3600)) / 60); $segundos = floor($total % 60); echo $horas .…
-
15
votes4
answers847
viewsA: How to generate indented code?
It’s quite simple: echo "<div>\n". " <table>\n". " <tr>\n". " <td>\n". " </td>\n". " </tr>\n". " </table>\n". "</div>\n"; There are other ways to do…
-
3
votes1
answer226
viewsA: How to solve several errors of this code?
There are typos. Maybe some very serious ones. Maybe the book example is really bad and doesn’t work at all. What then would be good to abandon book so bad. The example is very bad also to learn to…
-
3
votes2
answers811
viewsA: Record and recover information in files
I decided to answer because although the other answer works, it has a wrong way of doing the operation. There are 2 problems. First encourages the existence of a running condition when a file that…
-
3
votes1
answer106
viewsA: Upload large or compressed files?
There is no problem in this type of extension, on the contrary. And if there were also, you would be doing something very wrong in your script. To allow sending of larger files you can change the…
-
1
votes1
answer194
viewsA: Change script variable value via Java application
In the script you will do it: retorno = $(java -jar VerificaSolucao.jar $numCorA A) Use the variable retorno in the if. In Java you will change the line where you try to change a variable that does…
-
2
votes1
answer59
views -
14
votes3
answers224
viewsA: Use of using versus full name
There is no clearly established criterion. It is more like. Some people prefer to always use one way or the other. Others prefer to switch depending on what is being used or even more than how often…
-
33
votes3
answers8360
viewsA: Property x Attribute
Heed! This started with just the context of C#, but now after research I conclude that what is written in this answer applies to any programming language, perhaps except Smalltalk. I’m sorry, but…
-
2
votes1
answer2024
viewsA: Problem using getch() in C
First of all avoid using the getch() or anything that is present in conio.h. Use the getchar()that does the same thing in a standard and reliable way. The problem is not in this function, it is…
-
2
votes3
answers1923
viewsA: How to fetch a file in all folders
Basically this is it: var lista = new DirectoryInfo("c:\\").GetFiles("aria2c.exe", SearchOption.AllDirectories); The secret is the second parameter of GetFiles() which determines the recursive…
-
6
votes2
answers975
viewsA: Database connection error
It is telling you no longer to use these functions based on the old extension that gives access to Mysql. You should switch to the extension MySQLi. You can also switch to PDO, but do not advise.…
-
3
votes2
answers918
viewsA: How to cast a typed class in C#?
Are you in trouble variance. To solve you must allow the interface to be used covariantly. See: public class Program { public static void Main() { ITeste<Objeto> teste = new CarroTeste(); } }…
-
4
votes1
answer9051
viewsA: What are the SQL Server Express and Mysql limits?
Both have no database limit. SQL Server Express can have bases up to 10GB each. The full version does not have this limit. Mysql only has a practical operating system limit that may be 2TB in some…
-
2
votes2
answers90
viewsA: Return columns that accept Boolean in a table
SELECT column_name FROM information_schema.columns WHERE table_name = 'clientes' AND data_type = 'bit' I put in the Github for future reference.…
-
9
votes2
answers661
viewsA: Where to create macros in C?
In terms of good practice you must do what is right for each situation. For this you need to gain experience. And has nothing worse to gain experience than reading "manuals" that say what is right…
-
11
votes1
answer149
viewsA: Checking string inside string
To check use the method contains() and to exchange use the replace(). String str = " Hello Word"; if (str.contains("Hello")) { str = str.replace("Hello", "Olá"); //note que é necessário reatribuir a…
-
4
votes1
answer2293
viewsA: How do I add a new column between 2 columns in Postgresql?
It is not possible. The solution is to create a new table with the new structure with the columns the way you want, copy the data to it and after deleting the old, rename the new to take the place…
-
4
votes3
answers2845
viewsA: How to make ?
Could not play. It’s probably something Jsfiddle did and you shouldn’t worry about it. Note that you are inspecting a website that you have not done. If it appears in another situation, it was she…
-
10
votes1
answer1514
viewsA: Is it possible to create graphical interfaces for Python applications?
Yes it is possible, you need a library that does this. It has several options depending on your need. Some options (there are several others): Pyqt Pygtk wxPython kivy Tkinter To run Python…
-
6
votes3
answers71632
viewsA: How to make a select in the bank not to bring repeated values?
SELECT DISTINCT cor, outra_coluna_se_quiser FROM cores; I put in the Github for future reference. The secret there is the DISTINCT. It selects only rows in a single way, without repeating the column…
-
35
votes3
answers847
viewsA: Does merging PHP files into one only increase performance?
Yeah, up. So what? First, it will be a minimum increase. Irrelevant in most cases, if not all. The gain will be only in charge. And you probably won’t even be able to measure. You probably don’t…
-
3
votes2
answers184
viewsA: How can I sort by line size in Sublime Text?
I don’t know if it’s a good idea to do this, it may seem cute but the ideal is to sort by use relevance. But if you really want I found a code in their forum: import sublime, sublime_plugin import…
sublime-textanswered Maniero 444,682 -
2
votes1
answer359
viewsA: Better performance in a WPF system
The question is somewhat broad, there is no specific problem but I will try to help, even if in a generic way. The WPF actually has a lot of details that if not observed will generate performance…
-
16
votes1
answer13715
viewsA: Undoing a pull in Git
Tried to reset? Try: git reset --hard If you need to reset to a specific state just say what it is: git reset --hard hash_do_commit_aqui This should also work in some situations: git merge --abort…