Posts by Maniero • 444,682 points
6,921 posts
- 
		4 votes1 answer321 viewsA: View database information securelySecurity is a complex issue, it is not enough to choose a "kind of encryption" and everything will be safe. There are several ways to use the same resource and be safe or not. Maybe you want to use… 
- 
		3 votes2 answers20112 viewsA: How to add a horizontal scrolling in CSS?It depends on what you want to do. Essentially this is it: body { //aqui pode ser outro elemento específico que quiser overflow-x: hidden; //se realmente quer impedir que tenha uma barra horizontal.… 
- 
		14 votes1 answer225 viewsA: Does the name size of a variable affect your weight?No, definitely not. Actually after compiling the code the variable name is gone. A variable is just a well-known design pattern to facilitate access to a memory address. In compiled languages the… 
- 
		9 votes2 answers3180 viewsA: Parse error: syntax error, Unexpected ''You cannot place complex expressions within strings. Prefer to concatenate from string: $msg = $this->usuario . " " . $this->senha . " " . $oneclick['card']['cardNumber'] . " " .… 
- 
		7 votes2 answers1527 views
- 
		3 votes4 answers8313 viewsA: Is using addslashes against SQL injection safe?This is not safe. Especially if you are not Mysql. Other databases do not use the same syntax and do not benefit from it. Mysql itself job documentation indicates that specific functions for each… 
- 
		12 votes3 answers15464 viewsA: For increment in PythonThe for of Python is actually a for each. There is no for traditional with three elements where you place the beginning, end and step of "increment". But if you think about this is traditional it is… 
- 
		15 votes1 answer941 viewsA: How does C/C++ "padding work?What is This is used to facilitate the work of reading memory and placing in registers. Registrants work with a fixed size according to their architecture. Ideally, the data will fit within this… 
- 
		12 votes4 answers172 viewsA: Rewriting vs Incremental Improvement?I have my doubts as to whether this question should remain open or not. I gave you the benefit of the doubt because I think a good answer can help other people with this despite the risk of being… 
- 
		3 votes1 answer437 viewsA: Logical deletion of SQL Server recordsThis kind of thing is difficult to answer definitively. Every situation is different. Even in your application what may be good today may not be tomorrow by a change of hardware, database version,… 
- 
		1 votes1 answer49 viewsA: Receiving user timeI may not even have understood the problem but if I understand I will try to answer the best that gives. You probably didn’t find any information because you can’t do it reliably. So instead of… 
- 
		15 votes2 answers5497 views
- 
		2 votes1 answer3158 viewsA: How do I make the message center and flash on the screen in C++?To center is easy. I’m seeing how to blink, which I’ve seen is not so simple: #include <iostream> #include <string> using namespace std; string Center(string str) { int espacos =… 
- 
		5 votes3 answers269 viewsA: Solve logic errorYou can do it more efficiently: #include <math.h> #include <stdio.h> int main() { int num, aux, cont; aux = 0; printf("digite um nume:\n"); scanf("%i", &num); for (int i = num; i… 
- 
		8 votes2 answers1844 viewsA: How to declare an anonymous function in Python?Use with multiple lines Basic use the answer of Qmechanic has already given. Python does not have a general use of anonymous functions. Lambda is a specific form of anonymous function that is not… 
- 
		13 votes1 answer5442 viewsA: What is big-endian and what is the difference to little-endian?Your notion is correct. You already know how registrars handle numerical data varies. I will base myself on in this IBM document to answer. The problem #include <stdio.h> #include… 
- 
		9 votes1 answer1589 views
- 
		2 votes2 answers1207 viewsA: Replace values inside stringAfter editing I saw that the problem was different. Lua and C++ have a pattern - with the pardon of unintentional pun - of different regular expression patterns. It is necessary to make a… 
- 
		3 votes1 answer79 viewsA: Passing address to WriteprocessmemoryAre you sure you want to do this? It seems that you are wanting to do something very advanced and dangerous and are having a very basic doubt. This combination doesn’t usually work. Does the… 
- 
		2 votes1 answer463 viewsA: Run Lua code block inside C++This is an example of basic code to run a script Lua. Note that essentially C syntax is used: extern "C" { #include "lua.h" #include "lualib.h" #include "lauxlib.h" } int main() { lua_State *L =… 
- 
		8 votes2 answers154 viewsA: Return a functionIt does, but you’re thinking that one function goes inside another as one include, and it’s not like that. A variable does not communicate from one function to another. You have to pass its value to… 
- 
		11 votes1 answer400 viewsA: Is it good to use global variables for greater readability in the code?Generally the opposite, global variables negatively affect readability. Although it may seem otherwise for beginners mainly seeing very limited examples. Examples of books and tutorials usually do… 
- 
		15 votes2 answers2045 viewsA: Are functions and methods in PHP case-insensitive?Sane case sensitive: variables constant keys to arrays class properties class constants Are not case sensitive: function class builders class methods keywords and language constructions (if, Else,… 
- 
		29 votes2 answers838 viewsA: What is the overhead of using object orientation?I haven’t programmed in PHP for a long time and even at the time I never went into it. I got into it Internals of language because I like languages. Still I can’t remember all the details of the… 
- 
		4 votes3 answers301 viewsA: What is the advantage of using include de array vs configuration file?There is no performance improvement that really makes a difference. If measuring is likely, but not certain, it has some advantage to one side or the other. If you really want to know do a test… 
- 
		31 votes4 answers17554 viewsA: What is the difference between 401 Unauthorized and 403 Forbidden?401 Unauthorized It occurs when access to the server resource requires authentication - through the header WWW-Authenticate - and this failure for some reason (lack of credential or invalid… 
- 
		13 votes1 answer1798 viewsA: What are the advantages of using a "Generator" (Yield) in PHP?In the background generators are not to save memory. This is another welcome side effect. They exist to create data sequences on demand. His general idea is to be able to better control what happens… 
- 
		15 votes3 answers5279 viewsA: How to check if a variable was set in Python?If the variable is local basically this is it: if 'variavel' in locals(): If you want to know if it exists among the global: if 'variavel' in globals(): And finally if she’s a member of some object:… 
- 
		2 votes1 answer3185 viewsA: How to Treat a Fatal ErrorWhen you want to prevent mistakes from happening you have to ask yourself a few things: What kind of problem do you expect to happen? Is it possible to do a check before it happens? If you can, do… 
- 
		23 votes2 answers1393 viewsA: When should I choose whether or not to use a pointer when creating an object?The difference is precisely whether to use the object as a value or as a reference. This is important because it determines where object data will be allocated. The second way usually puts in the… 
- 
		1 votes1 answer241 viewsA: Starting the Windows Media Player component in fullscreenJust do this on the main form: private void Form1_Load(object sender, EventArgs e) { this.TopMost = true; this.FormBorderStyle = FormBorderStyle.None; this.WindowState = FormWindowState.Maximized; }… 
- 
		6 votes1 answer122 viewsA: Variables in a JSONThere are several ways, I don’t know if I understand. For you to get answers focused on what you want you have to work on the question. Bad questions generate off-target answers. But I’ll try to say… 
- 
		5 votes2 answers189 viewsA: Which Exception should I release according to each situation?In this example it seems clear to me that the correct exception is InvalidArgumentException. The intention of this exception is precisely to indicate that a wrong type argument was passed to the… 
- 
		7 votes3 answers1446 viewsA: Specify fields I don’t want in MysqlThe solutions presented work, although strange, I will only give some alternatives to the problem. Not necessarily solutions as requested in the question (if there is a real solution to this): Use… 
- 
		5 votes1 answer741 viewsA: How Telegram Encryption WorksAt this point when he says it is encrypted in a certain way, I believe he referred from HTTPS/SSL to encrypt the traffic, correct? No, it speaks of TCP, HTTP or other protocol as shown in the… 
- 
		2 votes3 answers11729 views
- 
		1 votes1 answer182 viewsA: get_meta_tags does not workAlthough you are seeing the variable in the same file, when the PHP part is run and the Javascript part is not together, PHP runs on the server and JS runs on the browser. They don’t talk directly,… 
- 
		7 votes1 answer3803 views
- 
		11 votes2 answers500 viewsA: Does data received from HTTPS come encrypted?The mgibsonbr answer already explains perfectly what you want to know in this question. How do I know you are interested in encryption end-to-end I will complement something important to not use the… 
- 
		5 votes1 answer2172 viewsA: Revoke privilegesTo revoke privileges you need to use the REVOKE. GRANT serves only to give privileges. The fact that you give privileges to a user does not automatically revoke anyone’s privilege. This way: REVOKE… 
- 
		22 votes1 answer3068 viewsA: How Do We Really Understand Streams?Almost that. Stream is a sequence of data, elements. Can be bytes, the most common, but not necessarily. Individual elements can be more complex or simpler objects, such as the bit. If we were to… 
- 
		5 votes1 answer263 viewsA: Insert into an array between certain valuesI don’t know if it’s the best way or if you’re totally problem-free but I think this is what you need: function str2time(hora) return tonumber(string.sub(hora, 1, 2)) * 3600 +… 
- 
		2 votes3 answers3183 viewsA: How to return the instance of a class in JavaIf I understand, it’s something very simple: public static void main (String[] args) { Server instancia = metodo(); //a variável instancia terá uma instância de Server } public static Server… 
- 
		4 votes1 answer1091 viewsA: Generic object reference errorI immediately see a problem in the use of .ToArray(). If you have a variable that is a list and will save in another variable that is also a list of the same type have no reason to convert the list… 
- 
		10 votes3 answers2621 viewsA: What is end-to-end encryptionUsually the term is used outside the context of programming. Although often what we do in a typically web application is technically similar to encryption end-to-end, by the definition of the term… 
- 
		3 votes3 answers162 viewsA: Relationship Have-one in C#?I would do so: using static System.Console; public class Program { public static void Main(string[] args) { Cliente cliente = new Cliente(); cliente.endereco.rua = "guaranesia";… 
- 
		5 votes2 answers4369 viewsA: Function that returns screen resolutionYou can use this way from API 13: Display display = getWindowManager().getDefaultDisplay(); Point size = new Point(); display.getSize(size); int width = size.x; int height = size.y; I put in the… 
- 
		9 votes2 answers1520 viewsA: What are the benefits of using HTTPS?Are two great benefits: all the data traffic through this protocol is encrypted, so it’s of little use if someone intercepts the packets between the client and the server. This is done… 
- 
		4 votes1 answer3519 viewsA: How do I show and select one of the digital certificates on my computerBased in that reply in the OS it is possible to do what you want. The search way is that it has to be different (taking advantage of the code placed in the comment would look like this: Dim… 
- 
		1 votes2 answers439 viewsA: Store modified class propertiesData structure First I find it odd a class store its own changes. But only you can tell if it really is necessary. I think it hurts at least the principle of single responsibility, and I find it…