Dixin's Blog
Microsoft Most Valuable Professional (CodingOnWheels.com) & Photographer (PicturesOnWheels.com). Code examples: GitHub.com/Dixin/Blog.
-
C# functional programming in-depth (3) Local Function and Closure
C# 7.0 introduces local function, which allows defining and calling a named, inline function inside a function member’s body. Unlike a local variable, which has to be used after being defined, a local function can be called before or after it is defined:
-
C# functional programming in-depth (2) Named function and function polymorphism
In C#, the most intuitive functions are method members of class and structure, including static method, instance method, and extension method, etc. These methods have names at design and are called by name, so they are named functions. Some other method-like members, including static constructor, constructor, finalizer, conversion operator, operator overload, property, indexer, event accessor, are also named functions, with specific name generated by at compiled time. This chapter discusses named functions in C#, how these named functions are defined, and looks into how they work. Method member’s name is available at design time, which some other function members’ name are generated at compile time.
-
C# functional programming in-depth (1) C# language fundamentals
C# 1.0 was initially released in 2002, as its first language specification says at the beginning, C# is a “simple, modern, object oriented, and type-safe” programming language for general purpose. Now C# has evolved to 7.2. During the years, a lot of great language features, especially rich functional programming features, has been added to C#. Now C# language has been productive and elegant, imperative and declarative, object-oriented and functional. With frameworks like .NET Framework, .NET Core, Mono, Xamarin, Unity, etc., C# is used by millions of people cross different platforms, including Windows, Linux, Mac, iOS, Android, etc.
-
Functional Programming and LINQ Paradigm (3) Programming Paradigms and Functional Programming
Programming paradigm is the fundamental style of programming. There are many paradigms for programming, for example:
-
Functional Programming and LINQ Paradigm (2) LINQ Overview
As fore mentioned, LINQ consists of syntax in languages and APIs in libraries:
-
Functional Programming and LINQ Paradigm (1) Getting Started with .NET/Core, C# and LINQ
This is a tutorial of functional programming and LINQ in C# language. The contents was initially based on my LINQ via C# talks. Hope it helps.
-
Remote desktop connection authentication error due to CredSSP encryption oracle remediation
Recently, when connecting to another Windows machine with RD, I got the following RDP authentication error due to CredSSP encryption oracle remediation:
-
End-to-end: Setup PHP Debugging for Visual Studio Code on Windows
This is a quick tutorial of minimum installation and configurations of development environment for PHP programming, including Apache, PHP, and Visual Studio Code (VSCode) on 64 bit Windows.
-
Port Microsoft Concurrency Visualizer SDK to .NET Standard and NuGet
I uploaded a NuGet package of Microsoft Concurrency Visualizer SDK: ConcurrencyVisualizer. Microsoft Concurrency Visualizer is an extension tool for Visual Studio. It is a great tool for performance profiling and multithreading execution visualization. It also has
a SDK library to be invoked by code and draw markers and spans in the timeline. I used it to visualize sequential LINQ and Parallel LINQ (PLINQ) execution in my Functional Programming and LINQ tutorials. For example, array.Where(…).Select(…) sequential LINQ query and array.AsParallel().Where(…).Select(…) Parallel LINQ query can be visualized as following spans: -
Entity Framework and LINQ to Entities (4) Query Methods
This part discusses how to query SQL database with the defined mapping classes. Entity Framework and LINQ to Entities supports most of the extension methods provided by Queryable class:
-
Debugging Classic ASP with Modern Visual Studio
Recently I tried to show my Mom some websites I built when I was a kid. Those ASP code, some in VBScript while some in JavaScript, are more than 10 years old. They were running fine in PWS, but now they didn’t run in IIS 8.5. I have no idea what’s the problem. It seems a little debugging has to be done.
-
Shrink Virtual Hard Disk Image (VHD and VHDX) Files
Virtual hard disk image files (VHD and VHDX files) grow bigger during the usage. For instance, this is a 20G virtual disk file for a Windows XP virtual machine:
-
Paste code from Visual Studio 2015 to Windows Live Writer
Now it is close to the end of 2015, but Windows Live Writer 2012 is still the best Windows blogging tool. For years I use a Windows Live Writer plugin called VSPaste for code snippets. With VSPaste, any code in any language can be copied from Visual Studio, and paste into Windows Live Writer with 100% accurate syntax highlighting.
However, VSPaste has a problem with Visual Studio 2015 RTM (not with RC) – the pasted HTML code always has a white background: <span style=”background: white;”>code</span>. To quickly fix this, the easiest way is to decompile the source code of VSPaste.
VSPaste is a small dll located in Windows Live Writer’s plugin directory: C:\Program Files (x86)\Windows Live\Writer\Plugins\VSPaste.dll. It can be decompiled to a project with source code, by .NET reflector free trial version:
-
Download Liked Posts from Tumblr.com
After using tumblr.com for years, a lot of posts have been liked. It would be easier to look up if the contents of these posts are stored to local. Fortunately, tumblr has provided a set of APIs to make this easy, and even an API console to play with these APIs. The API client is also provided in:
-
Query Operating System Processes in C#
.NET framework provides some process APIs in System.Diagnostics.Process class. Only some basic information of process can be queried with these APIs. .NET does not have APIS for other information, for example, a process’s parent process/child processes. There are some options to query process informations, like performance counter, P/Invoke, etc. Querying Win32_Process class of WMI could be an easier way.
-
C# 6.0 Exception Filter and when Keyword
C# 6.0 introduces a new feature exception filter and a new keyword when. Many C# features/keywords are syntactic sugars, but exception filter/when keyword is not.
-
Configure Git for Visual Studio 2015
After installing Git, the initial Git configurations can be viewed with git config –list:
-
Batch Processing Compression Archives with Different Formats (RAR, ISO, 7z, Zip, …) in C#
Recently I need to batch process some compressed files in several hard disk drives - Some RAR/ISO/7z files need to unified to zip format; And some compression archives has to be extracted; etc..
-
Entity Framework and LINQ to Entities (6) Deferred Execution, Laziness Loading and Eager Loading
In LINQ to Objects, query methods returning IEnumerable<T> implements deferred execution. Similarly, in LINQ to Entities, query methods returning IQueryable<T> implements deferred execution too.
-
Convert HTML to Well-Formatted Microsoft Word Document
Recently I wanted to convert my LINQ via C# tutorial into a Word document (.doc). The tasks are: