|
...more to go!
Marc
|
|
|
|
|
When do you anticipate that you'll reach your lofty goal?
".45 ACP - because shooting twice is just silly" - JSOP, 2010
- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
John Simmons / outlaw programmer wrote: When do you anticipate that you'll reach your lofty and mysterious goal?
....just to keep the tension high...
|
|
|
|
|
Lofty, mysterious, and possibly illegal in 40 states.
There, I've enhanced it now
|
|
|
|
|
He better get to it fast, Intel and Android are catching up fairly quickly.
|
|
|
|
|
Nish Nishant wrote: He better get to it fast, Intel and Android are catching up fairly quickly.
I noticed that.
Marc
|
|
|
|
|
John Simmons / outlaw programmer wrote: When do you anticipate that you'll reach your lofty goal?
The goal is, by the end of the year.
Marc
|
|
|
|
|
2... Bugfixes? Because if that's the case you only have 79 more to go
|
|
|
|
|
Sander Rossel wrote: Because if that's the case you only have 79 more to go
I think that's optimistic.
Marc
|
|
|
|
|
I vaguely remember when you went past me, think that was quite a few years ago. I thought you were #1 now, and looked at the who's who just now. An ASP.NET community account is #1? Wow. And Android and Intel accounts are close on your heels. Maybe the who's who needs an IsIndividualHuman filter
|
|
|
|
|
Nish Nishant wrote: I thought you were #1 now, and looked at the who's who just now. An ASP.NET community account is #1 Only if you value quantity over quality
|
|
|
|
|
Jeremy Falcon
|
|
|
|
|
Nish Nishant wrote: I vaguely remember when you went past me, think that was quite a few years ago.
Yes, you were actually my inspiration/motivation (I'm quite serious.)
Nish Nishant wrote: An ASP.NET community account is #1?
Yes, but none of those, IMHO, count. They're entities, not people.
Nish Nishant wrote: Maybe the who's who needs an IsIndividualHuman filter
Exactly. But then...
Marc
|
|
|
|
|
Marc Clifton wrote:
Yes, you were actually my inspiration/motivation (I'm quite serious.)
Heh - feels nice to hear that
|
|
|
|
|
He probably meant as an example of bad practices not to follow
|
|
|
|
|
Well, I mean...
|
|
|
|
|
So I got the following declaration in a class:
public class ExpressionModel
{
public static readonly IEnumerable<string> ConditionOperators = new[] { "eq", "neq", "gt", "gte", "lt", "lte", "between" };
} I'm using it in one place as follows:
ExpressionModel.ConditionOperators.Contains(e.Operator) It went well a couple of times and then I got a NullReferenceException on ExpressionModel.ConditionOperators ...
I'm not even sure how ConditionOperators could EVER be null (even if I tried)...
|
|
|
|
|
Are you sure that it was not e.Operator that was null instead? I can hardly imagine how a static variable can lead to a NullReferenceException (since, by design, there is no instance needed).
You always obtain more by being rather polite and armed than polite only.
|
|
|
|
|
Yep, really sure.
ExpressionModel.ConditionOperators was null, hence the exception when trying to invoke Contains on it.
My first thought was that it should've been e too, but it wasn't.
I actually had it right there in the watch window: ExpressionModel.ConditionOperators: null
|
|
|
|
|
Do you have the problem if you use:
public static readonly List<string> ConditionOperators = new List<string>("eq", "neq", "gt", "gte", "lt", "lte", "between");
instead?
You always obtain more by being rather polite and armed than polite only.
|
|
|
|
|
Actually I don't have the problem at all anymore. It was a one time thing.
Why do you think the List<string> would be different than IEnumerable<string> string[]?
|
|
|
|
|
Don't know; the use of a fixed, identified type instead of an interface declaration, maybe. But that's really a blind shot.
You always obtain more by being rather polite and armed than polite only.
|
|
|
|
|
Get LINQPad - The .NET Programmer's Playground[^]
Then add the following code and run it.
Even if e.Operator is set to null (each time x is an odd number) then it never fails.
I blame Visual Studio!!!
void Main()
{
Console.WriteLine(ExpressionModel.ConditionOperators);
for (int x = 0; x<100;x++)
{
Console.WriteLine(ExpressionModel.ConditionOperators.Contains(null));
if (x % 2 == 0)
{
e.Operator = "eq";
}
else{
e.Operator = null;
}
Console.WriteLine(ExpressionModel.ConditionOperators.Contains(e.Operator));
}
}
public static class e{
public static String Operator;
static e()
{
Operator = null;
}
}
public class ExpressionModel
{
public static readonly IEnumerable<string> ConditionOperators = new[] { "eq", "neq", "gt", "gte", "lt", "lte", "between" };
}
Output
5String[] (7 items)4
eq
neq
gt
gte
lt
lte
between
False
True
False
False
False
True
False
False
False
True
...
|
|
|
|
|
Yeah, but e.Operator wasn't the problem
|
|
|
|
|
I know. I was showing that neither the original array was the problem nor the e.Operator was.
There was a question about whether it was null -- so I answered.
|
|
|
|