|
super wrote: was focusing on Honey for some reason
He's busy playing with nested classes.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
That's the problem with honey, once you are in it's difficult to get out.
|
|
|
|
|
In C#, this is valid:
class A<T> {
class B<TT> {
}
}
therefore, this is valid:
typeof(A<int>.B<int>)
The trouble is, there's absolutely nothing out there online I can find about representing such a nested generic typereference as a CodeTypeReference properly.
Which leads me to an arcane comment in Microsoft's reference sourcecode - the last hope of the desperate.
while (current >= 0)
{
if (typeName[current] == '[')
{
if (--unmatchedRightBrackets == 0) break;
}
else if (typeName[current] == ']')
{
++unmatchedRightBrackets;
}
else if (typeName[current] == ',' && unmatchedRightBrackets == 1)
{
if (current + 1 < subTypeNameEndIndex)
{
subTypeNames.Push(typeName.Substring(current + 1, subTypeNameEndIndex - current - 1));
}
subTypeNameEndIndex = current;
}
--current;
}
So now I get to figure out what this is doing, just so I can figure out how to properly use what it is implementing.
Microsoft Docs: Technically correct, but practically useless.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
I don't think that's quite the same thing is it?
The MS one is a Dictionary<string, List<int>> which isn't really "nested" in the same way as yours is.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Yeah you know, i figured that out about a minute ago. *headdesk*
which led me to this
var c = new CodeTypeReference();
c.BaseType = "A`1+B`1";
c.TypeArguments.Add(new CodeTypeReference("System.String"));
c.TypeArguments.Add(new CodeTypeReference("System.Int64"));
Console.WriteLine(CD.ToString(c));
which led me to figuring out kind of how it works, but it isn't pretty.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
honey the codewitch wrote: you know, i figured that out about a minute ago
"Great minds" and all that.
Or "fools seldom differ" - your choice!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I think that's a perspective thing. I feel like the C# language spec is laughing at me right now.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Quote: Microsoft Docs: Technically correct, but practically useless. Still far better than most of the 'competitors' ones.
|
|
|
|
|
While you're not wrong, that's more of a blanket condemnation of the industry than anything.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Yes, I know that.
|
|
|
|
|
Did you not mistake [ for ] ?
|
|
|
|
|
nope. that's microsoft's code
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Somehow, this is perfectly valid
var type = typeof(A<A<int>.B<string>>.B<A<A<string>.B<A<InsufficientMemoryException>>>>);
I have no idea how to read it, but Visual Studio is OK with it
I chose the InsufficientMemoryException because that's what whoever has to maintain this code will run into
|
|
|
|
|
now make me a CodeTypeReference instance that properly represents that.
I think I finally know how.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
honey the codewitch wrote: now make me a CodeTypeReference instance that properly represents that.
var x = new CodeTypeReference(...); The rest is an exercise for the reader.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
It's cruel to mess with a recently quitted smoker
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
I thought you'd quit quitting for the moment? Have you quit quitting quitting, or does it go deeper down the rabbit hole? Should I get myself a Red Pill?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I relapsed over thanksgiving but i'm back on the wagon
Though this code is liable to make me do so again. I just found a really obscure bug in one of microsoft's CodeDOM objects. /hipster
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
No? Then it's about time for that. But be careful, this is a synonym for a diabetical coma[^].
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
This "cake" has long traditions as a Christmas sweet in Norway. Everyone knows it by the name of "Delfiakake" - "Delfia" is a brand name for the hardened coconut fat. Wikipedia has descriptions in eight languages, and calls it "Hedgehog slice" in English. It seems like every language has its own names: I never heard any of the eight(!) Swedish names, the Danish, English or German names before.
We make it with unsweetened dark chocolate rather than milk chocolate, and we decorate it with jelly tops and sometimes walnuts, dried fruits and marzipan; some people put these things into the chocolate as well. We often add coffee as well. The amount of biscuits can change considerably. Some make it with 2-3 layers, three quarters of the volume is chocolate. Others make it with so much biscuit that the chocolate essentially serves as a glue between the layers. With unsweetened chocolate, a fair amount of biscuits and fruits it isn't that unhealthy (but don't overeat!).
Delfiakake was well established as a traditional Christmas cake in my childhood, in the 1960s. I wouldn't be surprised if it was made several decennies earlier.
|
|
|
|
|
Nougat. You forgot the nougat layer. And the Canadians probably would add a layer of nuts and maple sirup.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
So how the scene looks like now.
Google struck the wrong cord and gained the notoriety towards lack of data security.
It's got everything we need, the Google drive is so agile and swift gives a very good user experience.
But our big customers do not want any of the things be shared on google drives. In fact, nothing from google, right from Hangout to gmail. All blacklisted.
And then there's another guy Microsoft. Most of the customers pushing us towards using MS Teams & Sharepoint, but it's just still not very user-friendly.
Just a very basic need - I want to delete a document from a drive. I can understand, it would throw an exception when another user is using the document.
But even when all have logged out, signed off and got back home and sleeping, this stupid Sharepoint says, someone's still using the document and cannot delete or rename it. But wouldn't tell who's exactly using it. This is unbelievably screwing up productivity. But nobody cares and we need to continue to use these and drop off google from the daily use.
Moral of the story - Even if you are dumb, if you exhibited trust & integrity, customers would not leave you. On the other hand, you are the smartest a*se in the world but you break the trust, nobody's with you. Hope google learnt the lesson.
I still don't know which major data-security incident left the customers blacklist Google forever. I think it's a gradual/chronic one? Google kept collecting all the user data and put them to use for advanced AI/ML thing to push ads. I guess that's where it started. Bummer now!.
|
|
|
|
|
Google is an advertising company and its sole purpose is to mine user data for monetization. No need to look any further. End of story.
|
|
|
|
|
) Good verdict. lol
|
|
|
|
|
They don't buzz, but they are definitely insects! (7)
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|