Browsing 7239 questions and answers with Jon Skeet
Look at your loop: while(current_index != target) { holding_stack.Push(stack.Pop()); } How do you expect that loop to ever finish? You don't change either target or current_index in the body of the loop... Perhaps you meant to... more 2/5/2015 9:50:55 PM
You can use BitConverter.ToInt32 or BitConverter.ToSingle to convert part of an array: byte[] bytes = Convert.FromBase64String(); int[] ints = new int[bytes.Length / 4]; for (int i = 0; i < ints.Length; i++) { ints[i] =... more 2/5/2015 9:40:46 PM
If you want an executable, that suggests you don't want a web application which is what the Web Developer Express targets. Instead, download and install the "Visual Studio Express 2013 For Windows Desktop" version. That will let you... more 2/5/2015 7:56:26 PM
There's no need to create any lists (which will pull a load of data from the database, if this is LINQ to SQL or EF) - you can just use: var c1 = context.Employee.Sum(x => x.Amount + x.Adjusted); That's assuming you don't need the... more 2/5/2015 7:32:35 PM
It's the null conditional operator. It basically means: "Evaluate the first operand; if that's null, stop, with a result of null. Otherwise, evaluate the second operand (as a member access of the first operand)." In your example, the... more 2/5/2015 7:12:35 PM
Both of your attempts so far are treating the file as if it were in UTF-8. In the best case, that's going to take twice as much memory - and it's very likely to be invalid data (as UTF-8), basically. You should try specifying the... more 2/5/2015 5:41:43 PM
No, it's not doing it concurrently at all. It creates the object, then calls the method - and then assigns the result of the method call to the variable. So it's equivalent to this: var tmp = new Image<Bgr,... more 2/5/2015 1:38:57 PM
Simple: don't use the deprecated new Date(String) constructor. Instead, create a SimpleDateFormat with the right format, and use the parse method. DateFormat format = new SimpleDateFormat("yyyy-MM-dd",... more 2/5/2015 11:10:13 AM
Well once you get rid of time zone anomalies, you can probably just assume that every day starts at midnight, so use: LocalDateTime localDateTime = localDate.toLocalDateTime(LocalTime.MIDNIGHT); It's not clear why you wanted to end up... more 2/5/2015 10:31:27 AM
In C, the return type of printf is int - the number of characters written. Also in C, an if condition can be any non-void data type, basically. Compare that with C# and .NET, where Console.WriteLine has a return type of void, and the... more 2/5/2015 10:09:40 AM