Posts by Eric Lemes • 299 points
10 posts
-
1
votes1
answer1260
viewsA: Tab vs. spaces for code indentation
I do not know a standard recommendation for identation. Each language uses its own. What I usually practice is to follow the convention of each language. In general it is more common to use spaces…
-
1
votes1
answer234
viewsA: C# Mysql Connection thread-safe
It seems that a Connection pool would be a good idea. A suggestion to implement this (there must be several other answers to this problem), would be to create a class that manages the connections…
-
1
votes1
answer188
viewsA: Access to Mysql database via the/net connection
Have you checked if Mysql is accepting connections from other hosts? There is a configuration in Mysql that allows it to be accessed only from the machine that is installed, or from other hosts. It…
-
1
votes4
answers20874
viewsA: How to extract only numbers from a string?
Another solution: [TestMethod] public void TestGetOnlyNumbers() { Regex r = new Regex(@"\d+"); string result = ""; foreach (Match m in r.Matches("111.222.333-44")) result += m.Value;…
-
3
votes2
answers1834
viewsA: Updating object value of a Form by a thread
In windows, whoever "paints" the controls on the screen is the main message loop, in response to a windows event (WM_PAINT). That’s why you can’t update values in another thread’s controls. Only the…
-
0
votes1
answer58
viewsA: C# Stream.Beginsend
Depends on the size of the buffer. You read or write asynchronously when you want to take advantage of the available CPU cycles while you wait for information to be transferred over the network. In…
-
1
votes2
answers188
viewsA: C# Difference between Beginaccept and Acceptasync
None. One was made to meet an asynchronous programming "standard" and the other. Behold: http://msdn.microsoft.com/en-us/library/jj152938(v=vs.110). aspx The first "Begin" is to meet the APM…
-
0
votes3
answers14922
viewsA: Consume webservice dynamically
Another alternative is to use object orientation in its purest form, i.e., to define an interface. Ex.: public interface IMeuServicoExterno { IList<MeuResultado>…
-
2
votes1
answer392
viewsA: Monitor Email Inbox
In general, mailboxes have access via the "POP3" protocol. Unfortunately, and to my surprise too, I did not find in the Framework a "standard" implementation. Usually this comes ready. Luckily,…
-
13
votes8
answers3054
viewsA: When to use Waterfall and when to use Scrum?
For me, the dividing line is in "degree of certainty" that one has of the project. Projects that know exactly what to build, Waterfall fits very well (e.g., buildings). Projects where there is a…