Browsing 7239 questions and answers with Jon Skeet
It sounds like you just want: private void methodAsync(Action action) { new Task(() => { writeMessage("Task started"); action(); writeMessage("Task completed"); }).Start(); } In other words, you're not... more 11/27/2013 7:50:50 AM
The problem is that you're passing in lastkey.ToCharArray() as the list of characters to trim. That includes the character s, so the s of Fonts is being trimmed as well. (Ditto the backslash.) From the docs for TrimEnd: The TrimEnd... more 11/27/2013 7:44:09 AM
Basically multiple from clauses contribute SelectMany calls. So your code is something like: var x = db.Client .SelectMany(c => db.Prospects, (c, p) => new { c, p }) .SelectMany(z => db.Countys, (z, ct) =>... more 11/26/2013 5:42:00 PM
You're looking for an element called title - but it's actually an attribute. The same code would fail on desktop too. You want: title = (string)el.Attribute("title") It's not really clear why you need an anonymous type here - you could... more 11/26/2013 11:33:47 AM
Basically this is the wrong way round: for (; result.next(); i <= rsmd.getColumnCount()) It should possibly be: for (; i <= rsmd.getColumnCount(); result.next()) Although more likely, you actually want: while (result.next())... more 11/25/2013 9:59:05 PM
There's no actual casting here - just an implicit conversion from Stack<Integer> to Iterable<Integer> because Stack<E> implements Iterable<E> (implicitly, by extending Vector<E>, which extends... more 11/25/2013 5:08:41 PM
I suspect this is the problem - it's at least a problem: XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new ByteArrayInputStream(document.getBytes())); That call to getBytes will use the... more 11/25/2013 2:03:57 PM
LINQ is your friend: List<string> names = Color1.Select(x => x.Name).ToList(); Or using List<T>.ConvertAll: List<string> names = Color1.ConvertAll(x => x.Name); Personally I prefer using LINQ as it then works... more 11/25/2013 1:25:05 PM
File.ReadAllText is meant to take a filename on a file system - not a URL. You'll need to fetch it with something like WebClient.DownloadString: string text; using (WebClient client = new WebClient()) { text =... more 11/25/2013 11:46:36 AM
No - this is fundamentally a limitation of most file systems. I would recommend the approach you're suggesting (selective copying from the original file to a new file) but then just rename the files rather than copying back over the top... more 11/25/2013 11:39:44 AM