Posts by Maniero • 444,682 points
6,921 posts
-
3
votes2
answers811
viewsA: How to close splash screen?
Just give a this.Close() (assuming that the screen of splash is the this) the moment you think you should. The method Close() makes the form available to be removed from memory. It does not need…
-
1
votes2
answers126
viewsA: Std::out_of_range error when using substring C++
Only with this information can not help much. Missing parts of the code, we do not have the data that produce this, nor details of the error. The code looks strange in the two parts shown. For…
-
11
votes3
answers14451
viewsA: Turn the first letter of a string into uppercase?
That’s it: var texto = "stack exchange"; var upper = char.ToUpper(texto[0]) + texto.Substring(1); Behold working in the ideone. And in the repl it.. Also put on the Github for future reference.…
-
4
votes1
answer111
viewsA: Alternative to PHP database?
Database is simpler than you think. If you don’t want to install one, use the Sqlite. It is used precisely to avoid having to write to files. It is fundamental to use such a feature. I understand…
-
16
votes2
answers5787
viewsA: Cut string when it reaches space
The dcastro solution is good but I prefer it this way: var parte = texto.Substring(0, texto.IndexOf(' ')); Behold working in the ideone. And in the .NET Fiddle. Also put on the Github for future…
-
9
votes2
answers6202
viewsA: How does the C++ layer work on the Web system?
Because he is good? In essence there are no specific reasons to use C++ for web. It’s rare and a lot of people divulge it to advertise, nor is it true. So don’t trust information you can’t verify.…
-
13
votes2
answers10623
viewsA: Imperative and Declarative Paradigm
Briefly the imperative tells how to do and the declarative tells what to do. Imperative This paradigm is concerned with the details of the functioning of the algorithm and the declarative only with…
-
3
votes2
answers353
viewsA: Versionar project with Visual Studio 2013 and 2015
There’s a question about differences in files. The 2015 archives may contain information of things not recognized in 2013. So if you use things specific to what can only be used in the 2015 project,…
-
5
votes1
answer285
viewsA: Formatting decimal
Formatting should be done as string same. Formatted numbers are texts to be presented, so this is the correct type. What you want is not formatting, you want to get the exact value, and this is not…
-
16
votes2
answers11055
viewsA: What is the advantage of using the ENUM type?
In general, little. First of all the ENUM is used as a form of normalization. So using a similar mechanism might be useful. If you have a list of data items that can be chosen exclusively, it can be…
-
4
votes3
answers1701
viewsA: How to represent "is-one" relationships in the logical model?
Your problem is similar to the one I answered in that question. I honestly did not understand this junction table. CPF/CNPJ data should clearly belong to the people tables and only. Except for some…
-
3
votes1
answer199
viewsA: What is the reference of C++?
The parameter d of the method timeward is a reference for an object of the type Data defined in the application. Note that there is a member called d within the type Data, which cannot be confused.…
-
2
votes1
answer224
viewsA: Better performance/performance: Smarty, Twig or any other?
Smarty is faster, if that matters. I concluded this by seeing that comparison. Of course I know how to look at these tests as something limited. The test is valid for these conditions, in their…
-
3
votes1
answer115
viewsA: Deployment of Sqlite together with . Net application
It depends on how you are using Sqlite. The most obvious is the System.Data.SQLite.DLL used by ADO.NET. If you use LINQ with it you will need the System.Data.SQLite.Linq.DLL also. You will also need…
-
3
votes1
answer600
viewsA: How do I know if a client is accessing the server over the local network or the internet?
There are some criteria that can be used. I believe that the easiest is to take the IP and check if it is in the possible range of the internal network. This can be done with the property…
-
5
votes1
answer105
viewsA: List three-dimensional table
Some problems: The example of the code is not a three-dimensional table. If so, the following algorithm needs to be modified, but I think we can already understand how to do when there is nesting…
-
25
votes1
answer26770
viewsA: What is XML <! [CDATA []]> for?
The CDATA serves to indicate that the text within its area is a common text and cannot be interpreted as part of the XML markup. This is useful when a part of the text of a particular element can be…
-
8
votes1
answer80
viewsA: How to differentiate "001" from "1" in PHP?
Something tells me that there is already an answer to this but as the search returns nothing, it goes: The comparison ends up being made by coercion and both are converted to number, so 1 is equal…
-
2
votes4
answers4241
viewsA: How to get the amount of records in a query in Sqlite?
What you’re trying to do is not feasible. It’s not that you can’t do (it can’t even, directly) it’s that doing it would be a mistake. You are potentially provoking a running condition, that is,…
-
8
votes3
answers441
viewsA: Why is it not very common to use do/while?
The two constructions are completely different, they don’t do the same thing. So this probably explains why one is more used than the other. Probably the second form is less necessary than the…
-
62
votes3
answers21607
viewsA: What are the concepts of cohesion and coupling?
The two concepts, although different, are related. And they are very important. A lot of the stuff you see out there about what to do with the code is detailing about these two concepts.…
-
5
votes3
answers11643
viewsA: How to convert code block into single line?
I believe that the best you will achieve is to make a "Replace" killing the line breaks. Usually composed by the characters of Carriage Return and line feed (\r\n).…
-
1
votes1
answer1484
viewsA: Apply filter to Datagrid populated with List without changing the Datasource
Directly in the list there is no way. What you can do is create a DataView connecting the list to her. Has a response in the OS showing how to do this (through a DataTable). An alternative would be…
-
3
votes1
answer1030
viewsA: Convert String to monetary value in ASP.NET MVC
If you have a property that will have the string manually mounted does not have to use a number formatting attribute, so you do not need this: [DisplayFormat(ApplyFormatInEditMode = false,…
-
5
votes2
answers282
viewsA: What are isomorphic applications?
You must be talking of that page. It is one of those terms that a group of developers want to paste, only time will tell what will happen. The meaning seems like you already know. It’s a technique…
-
3
votes1
answer957
viewsA: How to save text in XML or txt or HTML file?
The question does not give details but the simplest way to do this is by using the WriteAllText(): File.WriteAllText(caminhoCompletoDoArquivo, seuRichTextBox.Text); This method is ready for what you…
-
6
votes2
answers208
viewsA: How do I force entry into "while"?
You are not restarting the tab counter every time you change your number. I took the opportunity to have an organized code. There are some conceptual errors about the table that I took to solve.…
-
2
votes1
answer97
viewsA: Query to SQL database in text saved by Tinymce
There’s not much information but basically what you need to do is treat HTML as a special way. You should decide whether to convert HTML to common text before saving it to the database or convert…
-
17
votes4
answers5703
viewsA: Schedule process execution in C#
There is a great possibility that you just need to schedule a task on the operating system that calls something you need, eventually communicating with your application. In Windows, for example, you…
-
12
votes1
answer3246
views -
9
votes1
answer330
viewsA: Is it recommended to use C# 6 in Visual Studio 2013?
It is recommended to use Visual Studio 2015 (or newer), there is no other solution. And all the indications are you won’t, there’s a few tricks but it’ll get bad. There is no way to use Visual…
-
11
votes6
answers1655
viewsA: Heritage and Polymorphism
Several tables There are two ways to solve this with several tables. Related tables There are also two ways to organize this way. This is the way normalized. Don’t forget that if the employee…
-
9
votes1
answer197
views -
7
votes1
answer1008
viewsA: Install database together with C#
Mysql gives, in thesis. The work is monumental and complex. But I’m talking just out of curiosity, it’s not what you want. What is used in these cases is the Sqlite. You have to lower the Assembly…
-
11
votes1
answer1047
viewsA: What is the cardinality between a request and the services included in it?
Depends on what these services are. If the services are specific to this request, that is, they are line items that the request should have, then it is 1-N. For each request you have multiple…
-
2
votes2
answers257
viewsA: Simulate browser without HTML5 support
The best way is to install an old version of a browser. Change the user-agent does not solve in most cases. At least if you do Feature Detection which is correct. Another possibility is use an…
-
6
votes1
answer743
viewsA: How to change a property during a LINQ query?
It’s even possible but you need to understand that the idea of LINQ is the functional programming style that preaches immutability. And the name itself demonstrates this. Q is from query, of…
-
23
votes4
answers1510
viewsA: Why in PHP does the expression "2 + '6 apples'" equal 8?
Because PHP tries to do a type coercion on operations of different types. When he tries to convert the first one, he finds a digit in the text and can convert it to number, after he finds characters…
-
28
votes1
answer1107
viewsA: What is Null Byte Injection? How to avoid it?
It is the sending of a byte null (0) as a text that will later be used in some part of the application that will likely give access to some resource that should not be accessed. How common strings…
-
4
votes1
answer315
viewsA: How to use Javascript JSON to recover C result?
JSON is a data format. One of the things it is used for is communication between the client and the server web. Each side doesn’t need to know the technology that’s on the other side, so there are…
-
48
votes2
answers1031
views -
17
votes2
answers14936
viewsA: What is Event-Oriented Programming?
Terminology The term is usually used event-oriented programming. In this "paradigm" the execution flow of the code is determined by triggered events, that is, some state changes or some behavior…
-
4
votes2
answers1552
viewsA: SQL query with array type in Postgresql
The contains() will not work even, need to use a more suitable function, the any(), as Cantoni said or use the operator that searches in columns of type array: SELECT * FROM X WHERE Y @>…
-
23
votes3
answers2778
viewsA: What is the purpose of "continue" in C?
The continue is a language command and not a function. This distinction is important. When the code reaches continue he will be diverted to the final of the loop it is at the moment. Of the…
-
42
votes5
answers7270
viewsA: What is the difference between a "branch" and a "tag"?
To tag is only a brand, in general, in a branch specific marking a situation at a given time. The branch traditional should be something experimental, something in parallel, something that will…
-
4
votes1
answer1600
views -
14
votes3
answers25171
viewsA: How to write multiple lines in Python?
Triple quotes: print("""linha1 linha2 linha3 """) Behold working in the ideone. And in the repl it.. Also put on the Github for future reference. You can use single quotes as long as they are…
-
11
votes2
answers1835
viewsA: What is the difference between 'string' and r'string in Python?
A better example would be (yours makes no difference using the r): r'^articles\2003' This works the way it is. The r indicates that the string is crude, it is so and does not consider special…
-
9
votes2
answers15912
viewsA: How do I join a list in Python?
You can just add the two: a = [1, 2, 3] b = [4, 5, 6] print (a + b) Behold working in the ideone. And in the repl it.. Also put on the Github for future reference. Python overloads operators as much…
-
7
votes2
answers5604
viewsA: How do I repeat a string in Python?
This is enough for you? str = 'StackOverflow' print ((str[:13] + ' ') * 5) Behold working in the ideone. And in the repl it.. Also put on the Github for future reference. To repetition occurs with…