|
Good call on returning an empty sequence. More in line with the standards in Linq for a collection. I have missed that one.
Vince
Remember the dead, fight for the living
|
|
|
|
|
Richard Deeming wrote:
found = list.Where(item => item != null && (string)info.GetValue(item, null) == text).ToList();
Do you really think you need to check the item for null here? It is, after all, a list of <T> , so no item in the list will/should be null (unless you're doing some really weird stuff in terms of removal).
".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: It is, after all, a list of <T> , so no item in the list will/should be null
There's no restriction on the generic type parameter, so it could quite easily be a reference type.
Lists of reference types can quite happily contain null items. No need for any "weird stuff"!
var listOfStrings = new List<string>();
listOfStrings.Add(null);
listOfStrings.Add(default(string));
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Damn! You're not as stupid as I look!
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Useful code, John, thanks ! Also a great discussion, the kind I most enjoy.
I second Kevin's suggestion you write this up as a tip/trick.
cheers, Bill
«There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008
modified 9-Jun-16 23:08pm.
|
|
|
|
|
Wow! I made something remarkably similar last night (i.e. string parsing) after having read Marc's post and having the need. Your solution has more elegance than mine me thinks.
Thanks to both of you.
|
|
|
|
|
|
Should be on the Insider News page. That's definitely worthy of being widely disseminated.
This space for rent
|
|
|
|
|
|
As was pointed out in the comments, BITS wasn't fooled. A program with admin access told BITS to do something and it did it. Once you have admin/root access, any accusations of compromise are specious.
|
|
|
|
|
Windows has become THE security risk.
All I want to know is - where is Borland?
|
|
|
|
|
It hasn't. Once you grant administrative access, you have no security. The same holds true for any OS. Windows is actually extremely secure and to rant that it isn't is naive and being misinformed.
|
|
|
|
|
Yes, and using BITS to do anything actually useful without admin access is so easy to implement.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
So I'm staying in an Extended Stay hotel while I work on a project for client.
Last night at 11:30 I was awoken with "entertainment" from the adjacent room... bed banging the wall, loud expressions of... well you get the idea..
So half an hour into this I decide to call the front desk. It's midnight at this point and I have to work in the morning. So I explain what's going on and the woman at the front desk says, while laughing, "Well we won't charge you for the entertainment package. I'll go up and talk to them". She never did.
Eventually, since all good things must come to and end, they stopped.
.
.
.
until 5:30 this morning when they woke me up AGAIN. Same thing.. bed banging the wall, woman going off.
This time I'm gonna raise hell.
If it's not broken, fix it until it is
|
|
|
|
|
My worst: A night in a hotel "up north" before a big meeting the next morning.
Midnight and I'm woken up by a huge amount of noise - it sound like someone is running a bunch of Pneumatic drills[^] outside my room. I look out the door - the corridor is clear (but noisy).
I look out the window - nothing.
I call reception.
"Ah. We're remodelling the hotel."
At night?
"Oh yes! It's so we don't inconvenience the guests..."
They moved me to a new room on the opposite side of the building, and I didn't get a bill...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Quote: They moved me to a new room on the opposite side of the building, and I didn't get a bill...
Yeah! Good for you! You shouldn't have to suffer the consequences of their moronic decisions!
Get me coffee and no one gets hurt!
|
|
|
|
|
Had the same thing happen to me on a cruise, only there was a lot of yelling and furniture being tossed prior to the "rendezvous." After several hours of this, I went next door and banged loudly on their door. It got deathly quiet, and there was no more noise until the next morning, which was departure day. That cabin's occupants were being escorted off of the ship.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Were they wearing complementary stainless steel bracelets from the local police?
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
Bang on the wall, and yell at them to either stop, or let you in on it.
|
|
|
|
|
Pic or it didn't happen!
(Well, I've been waiting for someone to say it, but you've all let me down!)
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
A pic of what?? The sound of someone's bed banging my wall??
If it's not broken, fix it until it is
|
|
|
|
|
I shouldn't be surprised if there's an app for that!
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
|
Are they sure that the update will get over in an hour's time? My internet connection is sooooo slow
|
|
|
|
|
THEY'LL NEVER GET ME ALIVEEEE!!! TO BATTLE! YAAAAARGHHH!!!
*Ta-da*
"Windows has finished installing updates."
What the...?
|
|
|
|