Posts by carlosfigueira • 7,785 points
168 posts
-
17
votes1
answer204
viewsA: What does the "OR" operator do in an Enum?
This is not the logical operator "or" (which is represented by ||). This is the operator of "bitwise or" ("or all bits"), and it performs this operation on the numbers. 1 = 0000 0001 (binário) 2 =…
-
2
votes1
answer127
viewsA: Convert Windows application to Windows Phone - C# (Httpwebresponse and Httpwebrequest)
The methods of network access on the Windows Phone platform are all asynchronous - you’ll have to use the asynchronous version of GetResponse, as in the example below: public void Foo() { var…
-
4
votes3
answers1504
viewsA: Copy file with progress
This function cannot be used to show progress (it basically calls the native function - Win32 API - CopyFile kernel32.dll). There is no function in the class File make the copy with progress…
-
2
votes1
answer948
viewsA: Return only filled fields in the web service
To prevent object fields from being serialized in XML (or JSON), you can use the property EmitDefaultValue of the attribute [DataMember]. If she has the value false, numbers with value 0, bool…
-
2
votes2
answers3488
viewsA: Customer Facilities, WCF or Web API?
As always, the answer is "depends". What do you mean by "facilitate" customers? What features are needed for the service? How the service will be exposed, especially in relation to security issues?…
-
6
votes1
answer326
viewsA: C#. Net blocking or non-blocking?
The asynchronous calls are non-blocking - it is not the case that each socket will be using one thread particular. You can check this with a simple test (see below): on the server you print the…
-
5
votes1
answer846
viewsA: JSON or Sqlite?
The main difference of these two approaches is that if you are going to use JSON (and write to a local file using Phonegap’s I/O Apis), you are responsible for deciding how to store / read this…
-
5
votes1
answer187
viewsA: Class protected and public
A "top-level" class (defined directly in the namespace) cannot be protected - is a build error. You can only define classes protected if they are defined within other classes (such as nested…
-
1
votes2
answers526
viewsA: Problem with Nsdate
If you want to print an object of type NSDate, you must use a NSDateFormatter. In Formatter you can set the time zone (time zone) which should be used to convert the date to a string:…
-
0
votes1
answer464
viewsA: Ajax between domains - how to do?
Who will decide whether the call between domains will be possible is the server. There are basically two ways the server release calls cross-Domain. JSONP is one of them, where the server returns…
-
6
votes2
answers1181
viewsA: Why don’t browsers implement HTTP’s PUT and DELETE protocols?
That is not true. All modern browsers (i.e., IE, Chrome, Firefox, Safari that have been released in the last 3 years, possibly more) support all HTTP methods. GET is supported in multiple scopes, as…
-
3
votes1
answer95
viewsA: Unable to read Beyond the end of the stream
Your problem is that the format of the written message on socket (java code) is different from the format expected in the reader (code in C#). The call to ee.println("Hello!"); will write the bytes…
-
5
votes1
answer2652
viewsA: Web Api Client in Windows Forms
The main difference is that the first option (using await) will not block the thread where it is called from (the compiler will divide the method by registering a callback to be called when the…
-
1
votes2
answers2318
viewsA: Exclude character in a given position?
Use a regular expression that holds the first n - 1 characters, check the character n is what you want, and save the remaining characters. echo "abcdef nao sera removido a,cdef será removido A,BCD…
-
1
votes1
answer71
viewsA: "Node is read only" error when trying to encrypt XML
To load XML into a XmlDocument you must use the LoadXml instead of using the property InnerText: private void Desencriptar() { try { //dado encriptado xmlDadosCartao = new XmlDocument();…
-
2
votes1
answer67
viewsA: Is there a race condition problem in my code?
It depends. Whether the method Stop of the object state can only be called once (which is not clear in the question), so yes, there is a possibility, however small, of more than one thread calling…
-
2
votes1
answer179
viewsA: Collection does not allow foreach
The type of property Thumb of your item is not an image collection; it is an image only, so it cannot be used in a @foreach. As you said you have an image collection relative to the first loop item,…
-
1
votes2
answers368
viewsA: Override Xmltextwriter - Serialize Class for XML absolutely all attributes
having in mind the alert of @Ciganomorrisonmendez (which <Nome xsi:nil="true"><Nome> is different from <Nome></Nome>), if this is really what you want (assume that the null…