C# 12 and .NET 8
1.
https://github.com/markjprice/cs12dotnet8
2.
The companion book, Apps and Services with .NET 8
3.
code --list-extensions
Visual Studio Code Extensions: C# Dev Kit
4.
dotnet --list-sdks
dotnet --info
dotnet new console --use-program-main
dotnet run
5.
namespace doesn't require the folder structure like Java, can remove namespace com.t1; and ran it directly
dotnet new sln --name Chapter01
dotnet new console --output HelloCS
dotnet sln add HelloCS
dotnet help new
6.
Console.WriteLine($"Namespace: {name}");
Console.WriteLine("Value is {0}",19.8);
#error version
7.
Scott Hanselman from Microsoft has an excellent YouTube channel about computer stuff
they didn’t teach you at school: http://computerstufftheydidntteachyou.com/.
8.
C# keywords use all lowercase. Although you can use all lowercase for your own type names,
you should not. With C# 11 and later, the compiler will give a warning if you do.
9.
You must prefix it with the @ symbol to use a verbatim literal string, as shown in the following code:
string filePath = @"C:\televisions\sony\bravia.txt";
10.
Raw string literals start and end with three or more double-quote characters, as shown in the following code:
string xml = """
Mark
""";
11.
float realNumber = 2.3f;
double anotherRealNumber = 2.3;
The double type is not guaranteed to be accurate
decimal c = 0.1M; // M suffix means a decimal literal value
decimal d = 0.2M;
object height = 1.88; // Storing a double in an object.
object name = "Amir"; // Storing a string in an object.
int length2 = ((string)name).Length;
dynamic something;//has impact on performance
Console.WriteLine($"something is a {something.GetType()}");
12.
Local variables are declared inside methods, and they only exist during the execution of that method.
Once the method returns, the memory allocated to any local variables is released.
This happens at compile time so using var has no effect on runtime performance.
13.
The Debug class is used to add logging that gets written only during development.
The Trace class is used to add logging that gets written during both development and runtime.
14.
Constant: The data never changes. The compiler literally copies the data into any code that reads it.
Read-only: The data cannot change after the class is instantiated, but the data can be calculated or loaded from an external source at the time of instantiation.
15.
private
The member is accessible inside the type only. This is the default.
internal
The member is accessible inside the type and any type in the same assembly.
protected
The member is accessible inside the type and any type that inherits from the type.
C# 11 introduced the required modifier. If you use it on a field or property,
the compiler will ensure that you set the field or property to a value when you instantiate it.
16.
When a parameter is passed into a method, it can be passed in one of several ways:
By value (this is the default): Think of these as being in-only
As an out parameter: Think of these as being out-only.They must be set inside the method
By reference as a ref parameter: Think of these as being in-and-out.
As an in parameter: Think of these as being a reference parameter that is read-only.
17.
Tuples are an efficient way to combine two or more values into a single unit.
public (string, int) GetFruit()
{
return ("Apples", 5);
}
(string, int) fruit = bob.GetFruit();
WriteLine($"{fruit.Item1}, {fruit.Item2} there are.");
You can explicitly specify the field names:
public (string Name, int Number) GetNamedFruit()
{
return (Name: "Apples", Number: 5);
}
var fruitNamed = bob.GetNamedFruit();
// Deconstruct the return value into two separate variables.
(string name, int number) = bob.GetNamedFruit();
// You can then access the separate variables.
WriteLine($"{name}, {number}");
18.
Local functions are the method equivalent of local variables. In other words, they are methods that are only
accessible from within the containing method in which they have been defined. In other languages, they are sometimes
called nested or inner functions.
19.
A property is simply a method (or a pair of methods) that acts and looks like a field when you want to get or set a value,
but it acts like a method, thereby simplifying the syntax and enabling functionality, like validation and calculation,
when you set and get a value.
20.
public class ImmutablePerson
{
public string? FirstName { get; init; }
public string? LastName { get; init; }
}
public record ImmutableVehicle
{
public int Wheels { get; init; }
public string? Color { get; init; }
public string? Brand { get; init; }
}
ImmutableVehicle car = new()
{
Brand = "Mazda MX-5 RF",
Color = "Soul Red Crystal Metallic",
Wheels = 4
};
ImmutableVehicle repaintedCar = car
with { Color = "Polymetal Grey Metallic" };
Two records with the same property values are considered equal.
21.
Stack memory is faster to work with but limited in size.
Heap memory is slower but much more plentiful.
When you define a type using record struct or struct, you define a value type. This means that the memory for the object itself is allocated to the stack.
22.
Publishing a single-file app
dotnet publish -r win10-x64 -c Release --no-self-contained /p:PublishSingleFile=true
If you prefer the .pdb file to be embedded in the .exe file, embedded
23.
from wsl
sudo sqlite3 Northwind.db < Northwind4SQLite.sql
sqlite3 Northwind.db
.tables -- List all tables
.schema -- Show all table schemas
SELECT COUNT(*) FROM Orders; -- Check if data exists
.quit -- Exit
24.
The EF Core database providers for SQLite and SQL Server are built on top of the ADO.NET libraries, so EF Core is always inherently slower
than ADO.NET.
Furthermore, ADO.NET can be used independently for better performance because the EF Core database providers are “closer to the metal.”
1.
Is a "new earth" arising, a world where the egoic state of consciousness in its insanely dysfunctional manifestations, both individual and collective, has dissolved or at least subsided, and where humans no longer create unnecessary suffering for themselves, one another, as well as other life forms on the planet?
2. subjugation
The subjugation of one race by another, the domination of women throughout thousands of years of patriarchy, and the devaluing of people based on social class are for growing numbers of us nightmares of the past.
3.
There is a growing awareness of the intrinsic oneness of everything that exists, so that more and more we are seeing an awareness of and deep concern for our fellow humans, the countless animals that are our traveling companions, and the planet itself.
4. affiliation
This diminishment of the ego gives rise to empathy and compassion beyond tribal, racial, national, or religious affiliations.
5. succumb
If you stay present and do not succumb to fear, if you do not believe the media when they tell you that you should be afraid, these things will not affect you deeply.
6. Acute
Acute crisis and dysfunction always precede or coincide with any evolutionary advancement or gain in consciousness.
7.
All life-forms need obstacles and challenges in order to evolve.
8. demise
Eventually, the ego brings about its own demise.
9.
Make sure the present moment is your friend, not your enemy. Honor it by giving it your fullest attention. Appreciate it by being thankful for it. Become internally aligned with it by allowing it to be as it is. That is the arising of the new earth.
1.
The C# compiler (named Roslyn) used by the dotnet CLI tool converts your C# source code into intermediate language (IL) code and stores the IL in an assembly (a DLL or EXE file). IL code statements are like assembly language instructions, which are executed by .NET’s virtual machine, known as CoreCLR.
At runtime, CoreCLR loads the IL code from the assembly, the just-in-time (JIT) compiler compiles it into native CPU instructions, and then it is executed by the CPU on your machine.
2.
In the Create a new project dialog, select the C# language
The books read at 2026
1. Atomic Habits, Feb 7
2. The Amazing Spider-Man, Mar 13
3. The Archer, Paulo Coelho, Mar 17
Reading it like a meditating
4. The old man and the sea, Mar 27
Reading this book reminds me the power of now. Say for the author's introduction chapter, the incident seems very unlucky, but the important is not the life situation, but the response/react to the life situation.
Also the author James Clear mentioned should focus on system instead of goal.
a. Winners and losers have the same goals.
b. Achieving a goal is only a momentary change.
c. Goals restric your happiness. When you fall in love with the process rather than the product, you don't have to wait to give yourself permission to be happy. You can be satified anytime your system is running. And a system can be successful in many different forms not just the one you first envision.
1.
I hope you'll forgive me if this sounds boastful.
2.
Habits are mental shortcuts learned from experience. Theultimate purpose of habits is to solve the problems of life with as little energy and effort as possible.
3.
How to create a good habit:
The 1st law (Cue) -> Make it obvious
The 2nd law (Craving) -> Make it attractive
The 3rd law (Response) -> Make it easy
The 4th law (Reward) -> Make it satisfying
How to break a bad habit:
Inversion of the 1st law (Cure) -> Make it invisible
Inversion of the 2nd law (Craving) -> Make it unatrractive
Inversion of the 3rd law (Response) -> Make it difficult
Inversion of the 4th law (Reward) -> Make it unsatisfying
4. Make it attractive
a. After I pull out my phone, I will do ten burpees (need).
b. After I do ten burpees, I will check Facebook (want).
5. Humans are herd animals. We want to fit in, to bond with others, and to earn the respect and approval of our peers. Such inclinations are essential to our survival. For most of our evolutionary history, our ancestors lived in tribes. Becoming separated from the tribe - or worse, being cast out - was a death sentence. "The lone wolf dies, but the pack survives.".
1. anesthetic
Many people use alcohol, sex, food, work, television, or even shopping as anesthetics in an unconscious attempt to remove the basic unease.
2. moderation
When this happens, an activity that might be very enjoyable if used in moderation becomes imbued with a compulsive or addictive quality, and all that is ever achieved through it is extremely short-lived symptom relief.
3. repression
It's okay to feel resentful; it's okay to be angry, irritated, moody, or whatever - otherwise, we get into repression, inner conflict, or denial.
4. subservient
When you have seen the limitations of your outer purpose, you give up your unrealistic expectation that it should make you happy, and you make it subservient to your inner purpose.
Wherever you are, be there totally. If you find your here and now intolerable and it makes you unhappy, you have three options: remove yourself from the situation, change it, or accept it totally. If you want to take responsibility for your life, you must choose one of those three options, and you must choose now. Then accept the consequences. No excuses. No negativity. No psychic pollution. Keep your inner space clear.
1.
Float like a cadillac Sting like a beemer
Lightning McQueen
Parody from Muhammad Ali's famous quote: Float like a butterfly, sting like a bee
2.
grim reaper with scythe
Under the dim sky
Are the presence of trees, birds, and cities
The rooftops and kids
Drugs and homeless people living on subway streets
This is what I see of the world
This is what I see of the world
People, a lot of persons
In jackets, hats, walking, driving
But always in their eyes they hide behind
A clutter of thoughts so important
Like only in total ignorance one can do
Maybe upon their bed of death
When finally they'll shake their heads
And look around for the last and first time
Welcome to Life, my friend, but welcome to death
I'm just sorry you couldn't see
How beautiful your simple room is on a Saturday morning
That tree that was always there
Standing, waitiing for your attention
What joy it can be just moving around and going to bed
The perfect stillness of night when even the sun has closed its eyes
And countless more things that you had missed
If only you had paid attention
If only you were simpler
and didn't mind nothing happening
If only those thoughts were really so important
If only I had written a better poem or two
If only the people around you weren't also consumed
Then everything would have been different
But for now, nothing still is, so won't you fly free bird into eternity
On behalf of you I promise to pass on the message for a new world
by Paul Peng, 11/14/2025
The .NET Framework 4.8 does not have a direct built-in equivalent to Java's -Djavax.net.debug=ssl:handshake for enabling SSL/TLS handshake debugging from the command line or via a simple configuration switch. However, you can achieve similar diagnostic output using the following approaches:
1. Enable System.Net Tracing (Recommended for .NET Framework)
You can configure System.Net tracing via your application's app.config or web.config file to log detailed information about network activity, including SSL/TLS handshakes.
Example app.config:
xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
This logs System.Net and System.Net.Sockets activity to a file (network.log).
While it doesn’t dump raw TLS handshake bytes like Java, it does show certificate validation, cipher suites negotiation (indirectly), and connection errors.
For more TLS-specific diagnostics, combine this with Windows-level tools (see below).
⚠️ Note: Tracing impacts performance—use only for debugging.
2. Use Windows Schannel Logging (OS-Level SSL Debugging)
.NET Framework uses the Windows Schannel (Secure Channel) security package for TLS. You can enable Schannel event logging via the Windows Event Log:
Open Event Viewer → Applications and Services Logs → Microsoft → Windows → Schannel.
Right-click Operational → Enable Log.
Reproduce your SSL issue; handshake errors and details will appear here.
1. Download the runnable yt-dlp
yt-dlp
2. Pass the music list and run the command to download all:
yt-dlp --ignore-errors --format bestaudio --extract-audio --audio-format mp3 --audio-quality 160K --output "%(title)s.%(ext)s" --yes-playlist "https://www.youtube.com/playlist?list=PLKTlJ5ZJ4UL5PQexL4eUTJ0fGzEFDR7wU"
1. morrow
Take no thought for the morrow; for the morrow shall take thought for the things of itself
2. plow
Nobody who puts his hands to the plow and looks back is fit for the Kingdom of God
3. reverence
A knowing that does not destory the sacredness and mystery of life but contains a deep love and reverence for all that is.
4. unwittingly
Be alert as you practice this so that you do not unwittingly transform clock time into psychological time.
5. Vibrancy
Your life then loses its vibrancy, its freshness, its sense of wonder.
6. obsession
The mind then creates an obsession with the future as an escape from the unsatisfactory present.
7. deadening
You are leaving behind the deadening world of mental abstraction, of time.
8. incisive
Should a situation arise that you need to deal with now, your action will be clear and incisive if it arises out of present-moment awareness.
9. imbued
When you act out of present-moment awareness, whatever you do becomes imbued with a sense of quality, care and love - even the most simple action.
10. consecrated
It is described as the path of "consecrated action.".
11. grim
Being free of psychological time, you no longer pursue your goals with grim dtermination, driven by fear, anger, discontent, or the need to become someone.
Everything is honored, but nothing matters. Forms are born and die, yet you are aware of the Eternal underneath the forms. You know that nothing real can be threatened. When this is your state of being, how can you not succeed? You have succeeded already.
1. obnoxious
Some pain-bodies are obnoxious but relatively harmless, for example like a child who won't stop whining.
2. perpetrator
Once the pain-body has taken you over, you want more pain. You become a victim or perpetrator.
3. vehemently
You are not conscious of this, of course, and will vehemently claim that you do not want pain.
4. momentum
Although you are no longer energizing it through your identification, it has a certain momentum, just like a spinning wheel that will keep turning for a while even when it is no longer being propelled.
5. strive
So they strive after possessions, money, success, power, recognition, or special relationship, basically so that they can feel better about themselves, feel more complete.
Death is a stripping away of all that is not you. The secret of life is to "die before you die" - and find that there is no death.
1. elation
With astonishment, disbelief, and elation, he saw that the box was filled with gold.
2. conjure
The word enlightment conjures up the idea of some superhuman accomplishment, and the ego likes to keep it that way, but it is simply your natural state of felt oneness with Being.
3. conviction: a strong persuasion or belief
By misuse, I mean that people who have never even glimpsed the realm of the scared, the infinite vastness behind that word, use it with great conviction, as if they knew what they are talking about.
3. affliction
Not to be able to stop thinking is a dreadful affliction, but we don't realize this because almost everybody is suffering from it, so it is considered normal.
4. trancelike
It is not a trancelike state. Not at all.There is no loss of consciousness here. THe opposite is the case.
5. topple
The mind is then toppled from its place of power and Being reveals itself as your true nature.
6. impulse
The mind then gives form to the creatvie impulse or insight.
7. subliminally
They have a strong emanation o anger that certain people pickup sublinally and that triggers their own latent anger.
8. exertion
...when the mind is rendered "speechless." sometimes triggered by great beauty, extreme phyical exertion, or even great danger.
9. aversion
As long as I am my mind, I am those cravings, those needs, wants, attachments, and aversions, and apart from filled potential, a seed that has not yet sprouted.