Posts by Maniero • 444,682 points
6,921 posts
-
231
votes5
answers6588
viewsQ: Should error messages apologize?
It is common to find an error message that says: "Sorry, you are not allowed to access this function. Please contact the administrator for help." An "apology" is appropriate in this case? It is a…
-
152
votes4
answers6835
viewsQ: Why should I only use a "Return" in each function?
It is common to see the recommendation to use only one return by function/method. But this seems somewhat meaningless and leaves the code more confusing in many cases. See the examples: The way I…
-
183
votes4
answers6835
viewsA: Why should I only use a "Return" in each function?
Should not, do what is best for the readability of the code Basically this rule is called Single Entry, Single Exit (SESE) and is an important recommendation in languages that use explicit (or…
-
42
votes3
answers6498
viewsQ: How to model a tree data structure using a relational database?
How to appropriately and efficiently define naturally organized tree-based data in relational databases, considering the physical implications of this? That is, organize in a way that minimizes the…
-
384
votes9
answers31327
viewsQ: How to hash passwords safely?
If I do the hash of passwords before storing them in my database is enough to prevent them from being retrieved by someone? I’m just talking about the recovery directly from the database and not any…
-
19
votes3
answers9326
viewsQ: Is it possible to use Sqlite as client-server?
There is any technique or tool to use Sqlite using an architecture Client-Server instead of local access? Of course you would need a client library to communicate with the server. And a server…
-
23
votes3
answers1636
viewsQ: How to create a conditional index in Mysql?
How to create an index filtered by a specific data range? As far as I know, it is impossible to do this directly in Mysql. In some other database systems, there is usually a WHERE clause for this…
-
48
votes6
answers7903
viewsQ: When should we allow a column of a table from a database to accept NULL?
This is a conceptual question that always creates confusion when deciding whether or not a column should accept NULL. There’s a current that considers the use of NULL to be an error and that an…
-
14
votes5
answers3496
viewsA: What are the main advantages and disadvantages of using an LL parser or an LR?
LL and LR contrast analysis for a number of criteria: Complexity LL wins here, easy. You can easily write an LL parser by hand. In fact, it is commonly done: the Microsoft C# compiler is a…
-
17
votes2
answers1365
viewsQ: Should I use a parser generator or should I develop my own code to do "parse" and "lex"?
Obviously the question should not be interpreted "to the letter". I do not want anyone to decide for me, I need to know the perks and disadvantages to use one method or the other. When should I wear…
-
17
votes2
answers1365
viewsA: Should I use a parser generator or should I develop my own code to do "parse" and "lex"?
In fact there are three options, all three preferable in different situations. The third can be observed in the excellent original response in Software Engineering given by Alex ten Brink. Option 1:…
-
40
votes5
answers3496
viewsQ: What are the main advantages and disadvantages of using an LL parser or an LR?
I’m building a parser for a programming language. Grammar does not need to meet all the complexities of a language like C++ or Lisp. I have a moderate knowledge of language building but little…
-
35
votes2
answers998
viewsQ: A C compiler can generate a 64-bit executable where pointers are 32-bit?
Most programs fit well into address space of less than 4GB, but in some cases the program may need to use new processor features/instructions that are only available on x64 architecture.…
-
124
votes8
answers5920
viewsA: Is it always guaranteed that a multi-threaded application runs faster than using a single thread?
An analogy can help. You have a lot of letters that need to be delivered to various addresses in the city. Then you hire one motoboy to deliver your letters. Consider that traffic signs (traffic…
-
124
votes8
answers5920
viewsQ: Is it always guaranteed that a multi-threaded application runs faster than using a single thread?
It is possible to observe in some cases that the separation of tasks into multiple threads does not give gain and even makes an application slower than the use in thread unique. It should not always…
-
122
votes6
answers17915
viewsQ: How to make a phonetic algorithm for Brazilian Portuguese?
To facilitate the search for commonly misspelled information, we use phonetic algorithms. A feature that is extremely useful but that is often neglected, especially outside the English language…
-
8
votes2
answers495
viewsA: Parse error given when checking variables with the Empty() function
Yes, the function Empty accepts only one parameter. See function manual empty() on the official website. bool empty ( mixed $var ) This Mixed means it accepts various data types for the parameter…
-
38
votes3
answers2673
viewsQ: How to make "case-insensitive" comparisons in Sqlite?
Since there’s an obsession with accent questions, here goes mine :) Sqlite allows direct comparisons or through like with any encoding/charset as long as it’s done byte to byte. It only allows…
-
13
votes2
answers505
viewsQ: Is it possible to program using the Winrt API without resorting to XAML?
Some time ago declarative languages took over the development of software for creating graphical user interfaces. The most obvious examples are the framework WPF that uses XAML (Extensible…
-
17
votes3
answers799
viewsA: Floats module in PHP returns integers?
There is the possibility to use the function fmod (in English) which is appropriate for this. I don’t know if it will give the result you expect, but in my quick test it was ok. Then you would: echo…
-
10
votes2
answers6298
viewsA: How to find the default printer and print plain text on a dot matrix printer on . NET?
To get the default printer use the class PrinterSettings(in English). Example: var configImpressora = new PrinterSettings(); Console.WriteLine(configImpressora.PrinterName); Note that this way you…