Dixin's Blog
Microsoft Most Valuable Professional (CodingOnWheels.com) & Photographer (PicturesOnWheels.com). Code examples: GitHub.com/Dixin/Blog.
-
C# 8.0 in-depth: Setup C# 8.0 and .NET Core 3.0
Currently, Microsoft has the second preview of C# 8.0 and .NET Core 3.0, with a lot of new features and new APIs. This part of C# 8.0 series demonstrates how to setup the environment.
-
Functional Programming and LINQ via C#
C#, .NET Core, Azure, Functional Programming, Lambda Calculus, Category Theory, LINQ, LINQ to Objects, LINQ to XML, Parallel LINQ, LINQ to Entities, Entity Framework Core, Azure SQL Database.
-
Linq.IndexRange: The package to enable C# 8.0 index and range featues for LINQ and IEnumerable<T> types
LINQ operators to enable C# 8.0 index and range new features working with LINQ queries and any type that implements
IEnumerable<T>
. -
Upload any file to FTP server via C#
Microsoft has a C# example of uploading file to FTP server in MSDN https://msdn.microsoft.com/en-us/library/ms229715(v=vs.100).aspx and Microsoft docs https://docs.microsoft.com/en-us/dotnet/framework/network-programming/how-to-upload-files-with-ftp:
-
Setup passive FTP server in Azure virtual machine
This article demonstrates how to setup a passive FTP server in a Azure virtual machine running Windows.
-
Run Hyper-V and VMware virtual machines on Windows 10
I use Windows’ Hyper-V to run virtual machines for long time. Recently I need to run a VMware virtual machine to test something. I installed VMware Player, which is free for non-commercial usage. However, the virtual machine cannot started, with an error:
-
Build custom Windows 10 PE
Windows PE (WinPE) is a small version of Windows, which can be used to boot up computers from CD or USB disk drive. It is very useful to deploy or repair the desktop or server edition of Windows. For many years I have tried many options to build a WinPE image and create a bootable media, including the Microsoft official approach. The easiest way I found, is to use a third party tool called “Win10PE SE project”. I am sharing this tool with a post, because it is not easy to be found when searching WinPE related keywords.
-
Category Theory via C# (23) Performance
In functional programming, there are many powerful tools and patterns, like lambda expression, purity, deferred execution, immutability, fluent LINQ query composition, … But everything has a cost. As Alan Perlis said:
-
Category Theory via C# (22) More Monad: Continuation Monad
In C#, callback is frequently used. For example, a very simple Add function, without asynchrony:
-
Category Theory via C# (21) More Monad: Writer< , > Monad
Unlike the Reader< , > monad, the Writer< , > monad output contents with a sequence of functions:
-
Category Theory via C# (20) More Monad: Reader< , > Monad
Sometimes there are functions work with a shared environment. Typical examples are:
-
Category Theory via C# (19) More Monad: State< , > Monad
State machine (or finite state machine) represents a abstract machine with one state or a number of state. C# use state machine a lot. For example:
-
Category Theory via C# (18) More Monad: IO<> Monad
As mentioned in a previous part, in purely functional programming, functions cannot have side effects. For example, when defining LINQ queries, laziness and purity are expected. So, how should the impure actions be managed in purely functional programming or LINQ? For example:
-
Category Theory via C# (17) Monad-like Tuple<>, Task<>, IQueryable<> And IQbservable<>
Theoretically, Tuple<> should be counted as the Id<> monad. However, it is lack of laziness. In the context of C# and LINQ, it is only monad-like.
-
Category Theory via C# (16) More Monads: Lazy<>, Func<>, Nullable<>, ParallelQuery<> And IObservale<>
Again, Lazy<> is the simplest monad, it is just the lazy version of Tuple<>, and should be considered as the Id<> monad. This is the implementation of its SelectMany:
-
Category Theory via C# (15) IEnumerable<> Monad And LINQ: SelectMany For All
Previous part introduced SelectMany for monad IEnumerable<>. Actually SelectMany is more than meets the eye, and can be used to implement other LINQ queries.
-
Category Theory via C# (14) Monad And IEnumerable<>
A previous part showed endofunctor category is a monoid (the entire category itself). An endofunctor In the endofunctor category can be monoid too. This kind of endofunctor is called monad. Formally, monad is an endofunctor of category C, equipped with 2 natural transformations:
-
Category Theory via C# (13) Monoidal Functor-like Tuple<> And Task<>
Theoretically, Tuple<> should be counted as the Id<> monoidal functor. However, as previously mentioned, it is lack of laziness.
-
Category Theory via C# (12) More Monoidal Functors: Lazy<>, Func<> And Nullable<>
Lazy<> should be the simplest monoid functor - it is just the lazy version of Tuple<>. And in these posts it will be considered as the Id<> monoidal functor.
-
Category Theory via C# (11) Monoidal Functor And IEnumerable<>
Given monoidal categories (C, ⊗, IC) and (D, ⊛, ID), a monoidal functor (or lax monoidal functors) is a functor F: C → D equipped with: