|
honey the codewitch wrote: Nice. I love it when I learn stuff.
I thought you might find that interesting. And yes, agreed! Learned new stuff!
|
|
|
|
|
Every single one of those "tricks" is documented in the C# online documentation. This is simply someone who didn't bother to read the C# language documentation. Not impressed.
|
|
|
|
|
var errorCodes = new Dictionary<int, string>
{
[404] = "Page not Found",
[302] = "Page moved, but left a forwarding address.",
[500] = "The web server can't come out to play today."
};
that got my attention !
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
BillWoodruff wrote: var errorCodes = new Dictionary<int, string>
{
[404] = "Page not Found",
[302] = "Page moved, but left a forwarding address.",
[500] = "The web server can't come out to play today."
};
It's a syntactic side effect of the Add and Item methods. If you set a value of a dictionary via the Item method and the key doesn't exist the class will add the key and value. It is a very nice and clean way of writing:
var errorCodes = new Dictionary<int, string>
{
{[404], "Page not Found"},
{[302], "Page moved, but left a forwarding address."},
{[500], "The web server can't come out to play today."}
};
As I stated previously, there is nothing in this guy's blog that isn't directly the result of the C# and dotNet framework class documentation.
|
|
|
|
|
Who reads the entire documentation?
|
|
|
|
|
I think we have bots for that
|
|
|
|
|
He hints at it but doesn't show what you can do with the LINQ pattern. You can do fun stuff like this:
void Main()
{
var notACollection = new MyClass();
var x = from a in notACollection
where a.DoesntMatter == 5
select "Greetings Earthling";
<pre>
x.Dump();
}
class MyClass
{
string _msg;
public int DoesntMatter;
public MyClass Where(Func<MyClass, bool> _)
{
_msg = "Hello, World!";
return this;
}
public string Select(Func<MyClass, string> _)
{
return _msg.ToUpperInvariant();
}
}</pre>
Truth,
James
|
|
|
|
|
Literally only this one article worth to read. Everything else in this so called "blog" just a water.
|
|
|
|
|
... yeah, helps a lot.[^]
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Wow - that turned out to be helpful! That less-common COVID symptom, increased heart rate - I was sitting the other day and my heart rate was unusually high - like 85.
Still, it didn't really distract me from enjoying the porn . . .
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Why were you measuring your heart rate while watching ... on second thoughts, I really don't want to know.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
You wool find it interesting that it is not uncommon, in humans at least, to be able to feel when one's heart is racing.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Must not have been very good if you could take the time to measure your heart rate.
|
|
|
|
|
Different "strokes" for different "folks".
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
So basically, crying is the cure of COVID-19?
That explains why I haven't got it yet... I've spent the last 6 months working on some code I wrote 3 years ago.
|
|
|
|
|
|
Reminds me of the joke about the time traveler.
He lands, says he comes from a about 1,000 years in the future...
And is looking forward to seeing things as they are...
Asks what year it is...
The person says "2020"...
He replies "Er. Good luck with that, I gotta go!"
ROTFLMAO...
Makes one think. If time travel could be used for Punishment. Would 2020 be a misdemeanor or a felony?
|
|
|
|
|
Quiet character transformed licked nuts (6, 4)
modified 2-Jul-20 11:49am.
|
|
|
|
|
Quiet character transformed licked nuts (6,4)
[definition] [anagram] (lickednuts)
silent duck Sadly, I guess I'm up again tomorrow.
|
|
|
|
|
|
Where's the CCC?
@GregUtas
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OriginalGriff wrote: GregUtas Turns out he's a spammer.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
with a friend, when a cow approached me and started chit-chatting.
When she left, my friend asked me if I knew her.
I answered "No, I never met herbivore".
It's too hot for a coat, I will just leave
GCS d--(d+) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
|
I swear I didn't see it
GCS d--(d+) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|