Posts by Maniero • 444,682 points
6,921 posts
-
5
votes2
answers332
viewsA: What is the behavior of the reference variable and the primitive variable?
First understand that variable is a memory address you gave a name. Both class-based variables - which are references - and so-called primitives - which are by value - may be in stack or in the…
-
4
votes1
answer310
views -
8
votes2
answers462
viewsA: How to allocate dynamically when I don’t know how many positions I will use in C?
A int will have (almost) always 32 bits, so you know the required size. Even if you don’t know it, in cases like this it’s best to allocate enough for as long as possible. It’s actually something so…
-
1
votes2
answers357
viewsA: How to translate a hexadecimal statement on the intel x86 architecture to Assembly?
You need a disassembler. Trying to do it by hand is hard work, risky and problematic, as well as needing a book to explain. Has a online.…
-
2
votes1
answer731
viewsA: How do you turn off a key in a full form?
In the KeyDown put something like this: if (e.KeyCode == Keys.Tab || e.Alt) e.SuppressKeyPress = true; I put in the Github for future reference. Obviously you can put the keys you want. Note the…
-
2
votes2
answers151
views -
3
votes1
answer400
viewsA: Which component to use in Pyqt4 to display records of an on-screen SQL query?
Have you searched the documentation? It’s the QTableWidget. There are other widgets auxiliary to him. A simple example in Python. Most complete tutorial for C++ using Model-View. Another on the…
-
5
votes2
answers452
viewsA: Can I use a char in an arithmetic operation in Java?
In the language it does not. Only languages that allow the execution of arbitrary codes dynamically allow this, and in general in a different way. Nor is there any reason to have this in a language.…
-
2
votes1
answer43
viewsA: How to use something similar to Borderlayout in Qt?
There is no ready class in the library but there is one example in the documentation showing how to do something similar.…
-
8
votes3
answers27933
viewsA: Python str.replace() doubt
print(texto.replace('caixa 1 ', 'pacote 2 ')) I put in the Github for future reference. This solves if you always have the comma later. You have to have a pattern that ensures that you will not have…
-
1
votes1
answer74
views -
4
votes4
answers822
viewsA: When is a string considered a primitive type in web development?
Understand that in classes, materials and mainly on the internet people make simplifications. Probably your teacher made a simplification. Or he learned wrong, and he’s moving on, I don’t know :P…
-
1
votes1
answer67
viewsA: Error converting with Duocode using Winforms
Forget it, the Duocode does a lot of things, but it doesn’t work miracles. It can only convert trivial applications that operations in memory and little else. Surprisingly he can even convert…
-
11
votes1
answer255
viewsA: How to show an element for a few seconds and then hide it?
Serves like this? function esconde() { document.getElementById("exemplo").style.visibility = "hidden"; } setTimeout(esconde, 3000); <div id="exemplo" style="visibility: visible">Vou sumir em 3…
-
7
votes1
answer598
viewsA: Is it correct to return a memory address in function?
There is a misconception in your thinking, perhaps you lack better understanding about stack and heap. If the information is on stack really you can’t trust that it will be there when the function…
-
11
votes6
answers14587
viewsA: Show the largest and smallest number
It is wrong because you cannot compare more than two operands at the same time. This does not exist: if ( n1 > n2 > n3) { The right thing would be: if ( n1 > n2 && n2 > n3) {…
-
1
votes2
answers2642
viewsA: Physically delete a struct type record
The code is confusing and there are several things that should be otherwise. But I will focus on your problem without giving you the code since it is difficult to assemble something that works…
-
2
votes2
answers68
viewsA: Nullpointerexception on a Servlet when using Datavoting method
It’s hard to say for sure with so little information and uncompromised. You say the code is poorly done just to see if it works. The problem is there, do it well and it will work. All the code…
-
1
votes1
answer119
viewsA: A function of a Windows DLL has the same address?
Forget the address of the function. It is variable and doesn’t matter. The fact that it shows the same is a coincidence and cannot be used as something guaranteed. You just have to know which…
-
2
votes2
answers339
viewsA: Where to put Data Annotation? View Model or Model?
Depends on how you want to secure it. It seems to me that you want to ensure under all circumstances that this property and consequently the database column has 2 characters at most. So put in the…
-
2
votes1
answer1587
viewsA: Create a fixed header and footer for all pages
You create a page with layout basic that will be used on all pages. Usually it gets in this position in the project: ~/Views/Shared/_Layout.cshtml. Of course you can use other locations and names…
-
3
votes3
answers472
viewsA: MER - Temporal confusion of cardinality
You’re complicating it because you’re putting in a variable that doesn’t exist. Forget this temporal thing. It may even be that in some modeling case this variable is relevant and has to consider…
-
12
votes3
answers366
viewsA: Variable in main is global?
Not, main() is a function like any other. Variables declared within it are only seen within it. The most that can be done is to indirectly access the addresses where these variables were allocated.…
-
5
votes3
answers272
viewsA: Problems with "strcpy" locking program
I’m not gonna look at all the code, and there could be other mistakes. I have no way to test without isolating, which would be work and this you should have done before posting. Two things need to…
-
5
votes2
answers607
viewsA: Resource on an Enum
One way to solve is to create an extension method, which if there is no Resource, returns the Enum item itself: public static class SystemAreaExtension { public static string Display(this SystemArea…
-
4
votes1
answer301
viewsA: Increasing the size of a string
As shown in the original answer, mounting and displaying data are separate things, you can’t mix. Then you need to change your page to treat the parts separately and can not concatenate what is…
-
26
votes1
answer6034
viewsA: What is the storage limit for Sqlite?
The line limit is 2 raised to 64, that is, there is no practical limit. There is the 128TB limit on the total size of bytes database, which in practice is difficult to achieve. Remembering that…
-
7
votes6
answers14101
viewsA: String Format with Javascript
I found some implementations in the OS. I don’t know if any answer what you want. One of them is the sprintf.js, seems to be one of the most complete implementations. Other: if…
-
3
votes3
answers2918
viewsA: Format a string with time
You can do this which is more elegant: DateTime.Parse(dtSolicitacao).TimeOfDay Behold working in the ideone. And in the .NET Fiddle. Also put on the Github for future reference. Anyway, make sure…
-
1
votes1
answer421
viewsA: Failure to copy an entire directory and its files
This method only copies files and not directories. The comments seem to be working when used correctly. I noticed that there is a parameter inversion that makes its use not so intuitive and is…
-
6
votes3
answers3097
viewsA: How to generate random matrices without repeating numbers on the same line?
Generate a list of all the possible numbers, shuffle them and take the top six: List<Integer> lista = new ArrayList<>(60); for (int i = 1; i <= 60; i++) { lista.add(i); }…
-
26
votes1
answer2966
viewsA: Roslyn Compiler - What is it, and why was it created?
Now he calls .NET Compiler Platform. It’s a build-as-a-service platform, so you have an extremely uncoupled library with the various compiler features available to call as needed. The language…
-
6
votes3
answers1242
viewsA: LINQ with Where condition using variable
Unless the question is poorly explained it seems to me not to be a problem with LINQ, it is normal code: int idade = 18; string nome = ""; if (idade != 0) { var resultado = (from u in db.Usuario…
-
5
votes2
answers14331
views -
2
votes1
answer49
viewsA: Static does not share values between web users
It is not possible, the static just indicates a sharing of the data across the application. With this modifier the member becomes unique to the class and all instances access it. I do not know if I…
-
7
votes1
answer188
viewsA: How to get links to open in an iframe?
If the iframe of index.html was declared so: <iframe name="principal" src="pagina.html"></iframe> The link will be: <a href="contato.html" target="principal">Contato</a> I…
-
15
votes1
answer276
viewsA: Why is using String in a switch block more efficient than in an if-Else block?
The main reason in this case is that it does not compare the strings with equals() rather with hashCode(). After each compiled case will guard the hash of string and not the string in itself. There…
-
33
votes2
answers16435
viewsA: What are the out and ref parameters
Simply a normal parameter has a sense, it only goes, the argument value is only sent to the parameter. O out also has only one sense, but otherwise, it only passes the value of the parameter (what…
-
3
votes2
answers2290
viewsA: Can I use the same WPF view for Desktop and Web?
There is no WPF for the web and it will never exist. Web is web, if you’re not using HTML, CSS, Javascript, it’s not web. Not even Silverlight is web, just like Flash. The fact that it runs on top…
-
12
votes1
answer1858
viewsA: What are the differences between Hashmap and Hashtable?
Hashmap Is not synchronized Accepts null values and a null key It is possible to scan the entire structure with a simple iterator Has containsValue() and containsKey() Is faster Consumes less memory…
-
4
votes2
answers1026
viewsA: How to resolve "Typeerror: must be Unicode, not str" error in Python?
Severe in binary format and you won’t have a problem. It’s reckless to record a backup of a database as text: #coding: utf-8 __author__ = 'Dener Carvalho' import sqlite3 import io #Conecta ao banco…
-
3
votes1
answer1429
views -
4
votes3
answers1590
viewsA: How to add or subtract a digit in the Textbox via a button?
Use the TryParse() if you do not want to generate an error if the value is invalid. You can treat as you wish if it is invalid. In this case I ignored the sum. private void btn_plus_Click(object…
-
7
votes2
answers1212
viewsA: What does the application gain by using Type Hint?
From the information the question shows already have the answer can not escape the obviousness. In addition to the best documentation as already mentioned, and this cannot be minimized, it gains…
-
10
votes2
answers306
viewsA: #Region is an antipattern or a Smell code?
Yes, it is. It shows that the code is too big, too difficult to organize. It exists because they need to separate code generated by the IDE (Visual Studio) from code the programmer should mess with.…
-
8
votes5
answers860
viewsA: Why is a variable with no value considered uninitiated?
There is a difference between declaring a variable and assigning a value to it. Declaring means that you have specified that a variable will exist in a given context. But that’s it. In PHP if the…
-
10
votes3
answers1828
viewsA: How does version naming work for private or public projects?
You can’t tell which one is the most used, and even if you gave it, it wouldn’t do you any good. There are some guidelines that can be adopted within what you use, but you can choose the best shape…
-
16
votes3
answers1166
viewsA: Write Timespan in full
There’s a response in the OS And it was accepted. I would probably improve something to look more elegant and still not doing exactly as you wish, but this is it: public static String…
-
1
votes1
answer68
viewsA: Configuration table
I might be wrong because it’s been a long time since I’ve touched this or because I didn’t understand the question, but I don’t think it exists. Nor would there be any reason for anything specific.…
-
2
votes2
answers85
viewsA: Fixed and unique value on Android in Unity 3D
According to this response in the OS each system has its shape. In Android the suggested form is: android.telephony.getDeviceId() I put in the Github for future reference.…