What is an exception? How do you catch one? How do you define an exception class? How do you throw one? How do you get an exception’s properties? This time I’m summarizing what CLR via C# says about the exception mechanism.
Lazy_V's Blog|
LeetCode-547. Friend Circles#
Difficulty: Medium
Problem Description#
There are N students in a class. Some of them are friends, while some are not. Their friendship is transitive: if A is a friend of B, and B is a friend of C, then A is also considered a friend of C. A friend circle is a group of students who are all friends.
Given an N * N matrix M representing the friend relationships between students in the class, if M[i][j] = 1, then the i-th and j-th students are known to be friends with each other; otherwise it’s unknown. You must output the total number of known friend circles among all students.
Sample Input and Output#
Example 1:
Input:
[[1,1,0],
[1,1,0],
[0,0,1]]
Output: 2
Explanation: Students 0 and 1 are known to be friends, so they are in one friend circle.
Student 2 is in a friend circle by himself. So return 2.Example 2:
Key chapters of CLR via C#.
I collected the questions that come up in CLR via C# and turned them into a Q&A.
C++, C# and Java all have a new keyword. What are the differences between the three?
You use new all the time, so you probably think of it as an old friend.
But do you really know it?

DevTerm is a post-modern, digital, minimalist way of life. At the size of a sheet of A5 paper, it combines full PC functionality with retro style: a 6.8-inch ultra-wide screen, a classic QWERTY keyboard, the essential ports, high-speed wireless connectivity, long battery life, and even a handy thermal printer.
DevTerm is now up for pre-order on the Clockwork website, with shipping expected to start before April 2021.
A whole page of CLR via C#, p110, is devoted to “how the CLR controls the layout of a type’s fields”.
Let’s take a careful look at the concrete use cases for each of the different LayoutKind options in StructLayoutAttribute.
Before we got to know the .NET Framework, we’d already seen all kinds of DLL files. They might have been compiled from C++.
After getting to know the .NET Framework, we learned that an assembly can be exported as a DLL file.
Both have the .DLL extension, so are there differences and connections between a dynamic link library (DLL) and a .NET Framework assembly?
Imagine you’ve defined your own Point struct:
public struct Point
{
private readonly float m_x;
private readonly float m_y;
private readonly float m_z;
//Equals is not overridden
}How many boxing operations happen in the following code?
var p1 = new Point();
var p2 = new Point();
if (p1.Equals(p2))
{
Console.WriteLine("-------");
}Now take a look at the IL:

So how many boxings do you think there are? One? Two? Something else?
How does Unity manage to be cross-platform? What exactly is the relationship between Mono and the .NET Framework? What is IL? And what are CIL and CLI, those two lookalikes?
In this post I’ll explain these questions that a lot of people are curious about.