Browsing 7239 questions and answers with Jon Skeet
You never populate the packet with any useful data: byte[] buf = new byte[256]; String msg = stdIn.readLine(); packet = new DatagramPacket(buf, buf.length, address, 4445); socket.send(packet); You've just posted a byte array with 256... more 10/16/2014 7:45:01 PM
That overload was introduced in .NET 4. So as you were targeting .NET 2.0, it wasn't present. When in doubt, check the "Version information" section at the bottom of the documentation. Admittedly I'd normally be at least slightly nervous... more 10/16/2014 6:42:34 PM
It usually makes sense to put the differentiator at the start. For example: TextReader / StreamReader / StringReader Stream / FileStream / MemoryStream / NetworkStream It's like having an adjective to provide more detail: "the red... more 10/16/2014 5:39:54 PM
No, if two threads call contains() at the same time, that will call iterator() twice which will create two separate iterators. If you were trying to share an iterator between two threads, that would not be a good idea. Note that if you... more 10/16/2014 4:59:44 PM
You need to specify it as a surrogate pair - two UTF-16 code units. For example, if you copy and paste the character into my Unicode explorer you can see that U+1F174 is represented in UTF-16 code units as U+D83C U+DD74. (You can work... more 10/16/2014 3:12:55 PM
This is basically JSON encoded as a JSON string - after doctoring the end of your string very slightly, as per comments. It's not too hard to handle that in Json.NET, using JToken.Parse to effectively unescape first, then parsing the... more 10/16/2014 2:06:58 PM
in what case i can use this. You can't. Ever. The main point of static typing is so that you can rely on the value of a variable being compatible with the type you've declared. So if you declare a variable as: DerivedClass C; then... more 10/16/2014 11:55:56 AM
Your group emp.Email by new { emp.EmpId, emp.Type } means that each element of the group will have a key of the anonymous type, and an "element type" of List<string>. You're then propagating that element type using Emails =... more 10/16/2014 10:42:23 AM
It looks to me like you want a new row for each ItemGroupData element, not each ItemData element. I would expect something like: foreach (var itemGroup in doc.Root.Elements("ItemGroupData")) { var row = patDt.NewRow(); ... more 10/16/2014 9:39:32 AM
I would personally read in the assets, populating an ILookup<int, XElement> and removing the ContractNo element afterwards (as it's just slightly simpler in LINQ to XML). Then read the contracts, populating the assets from the... more 10/16/2014 6:00:33 AM