In this blog I have some posts about F# because this language seems to be interesting and is becoming popular in some companies. In this post I want to show you the reduce Function in F#.
Category: .NET
.NET (dotnet) is a developer platform made up of tools, programming languages, and libraries for building many different types of applications.
So, there are various implementations of .NET (dotnet). Each implementation allows .NET code to execute in different places—Linux, macOS, Windows, iOS, Android, and many more. This framework has two main versions:
- Framework is the original implementation of .NET. It supports running websites, services, desktop apps, and more on Windows.
- Core is a cross-platform implementation for running websites, services, and console apps on Windows, Linux, and macOS. .NET Core is open source on GitHub.
Then, Xamarin/Mono is a .NET (dotnet) implementation for running apps on all the major mobile operating systems, including iOS and Android.
The .NET Standard is a formal specification of the APIs that are common across .NET implementations. This allows the same code and libraries to run on different implementations.
Therefore, the two major components of .NET (dotnet) Framework are the Common Language Runtime and the .NET Framework Class Library.
- The Common Language Runtime (CLR) is the execution engine that handles running applications. It provides services like thread management, garbage collection, type-safety, exception handling, and more.
- The Class Library provides a set of APIs and types for common functionality. It provides types for strings, dates, numbers, etc. The Class Library includes APIs for reading and writing files, connecting to databases, drawing, and more.
Summarize, .NET (dotnet) applications are written in the C#, F#, or Visual Basic programming language. Code is compiled into a language-agnostic Common Intermediate Language (CIL). Compiled code is stored in assemblies—files with a .dll or .exe file extension.
At the end, when an app runs, the CLR takes the assembly and uses a just-in-time compiler (JIT) to turn it into machine code that can execute on the specific architecture of the computer it is running on.
Digital transformation scenario with Azure, Visual Studio and Git
In a company prospective, what digital transformation is about? In this post I explain my point of view
Create Azure Function in C# Script and Service Bus
How to create an Azure Function in C# Script using as input and output a message from and to Service Bus Queue step by step
Creating Azure Function in F#
Installing these templates will add a bunch of new options to dotnet new for both C# and F#
Create a project for Azure Function in F# and Visual Studio 2019
How to create a solution and a project for Azure Functions in F# with Visual Studio 2019
Adapting to Enterprise and B2E Xamarin Forms App Development
Enterprise or Business to Employee (B2E) mobile apps can be quite different from their B2C counterparts. B2C apps, tend to focus on a small number of screens or feed for their main usage, and additional screens are not as frequently used, but there to serve ancillary functionality as needed. B2E apps, are focused on function, normally recording or accessing data for their day to day job. Many of them are replacing hand written recordings, for digital records, that are automatically synchronized to the main database. The fact that these users…
Xamarin Forms Dependency Injection
Calling native platform code in your portable class library (PCL) is achievable via Dependency Injection. It’s a common question for people starting out, who are using a PCL or .NET Standard Library for developing their Xamarin apps. Dependency Injection involves creating an interface that can be commonly applied across all native platforms, then coding the actual implementation, or the native platform code, on each platform. This interface and instance is then given to a container. The PCL or .NET Standard Library, then goes to the container with only the interface…
Working with CarouselView in Xamarin Forms
Xamarin.Forms code runs on multiple platforms – each of which has its own filesystem. This means that reading and writing files is most easily done using the native file APIs on each platform. Alternatively, embedded resources are a simpler solution to distribute data files with an app. CarouselView CarouselView is available in Xamarin.Forms 4.3. However, it is currently experimental and can only be used by adding the following line of code to your AppDelegate class on iOS, or to your MainActivity class on Android, before calling Forms.Init: Prerequisites Visual Studio…
Use Azure Resource Groups: A Simple Explanation
A simple explanation how to use Azure Resource Group
Create a console application in F# interactive
We’ll develop an application for drawing pie charts. The application loads data from a comma-separated value (CSV) file and performs pre-processing in order to calculate the percentage of every item in the data source.
Using functions as values in F#
In my previous post, we discussed about immutable data structure. Now, imagine that we want to write a method similar to SumList but that multiplies the numbers rather than adding them. Making this change looks quite easy: we can copy the SumList method and tinker with it. There are only two changes in the modified method: The first change is that we’re using multiplication instead of addition in the branch that does the recursive call ❷. The second change is that the value returned for an empty list is now 1 instead of 0 ❶. This solution works,…
Using immutable data structures in F#
An immutable data structure (or object) is a structure whose value doesn’t change after it’s created. When you declare a data structure that contains some values, you store these values in slots, such as a field or value declaration.
Nested Function Declarations in F#
Implement a nested function in F#. The function prints squares of the last two arguments using the first argument to format the output
Configuring Push Notifications For Xamarin Forms
How to configure in your Xamarin Forms project the push notification for iOS and Android
New Xamarin Application Developed to Track and Manage COVID-19 in Real-time
Volunteers re-engineer cancer treatment software to monitor coronavirus pandemic using Microsoft’s Xamarin mobile framework with Azure Mobile Angel has released a new mobile application built on the Xamarin platform to manage potential and at-risk coronavirus patients in real-time. The free application monitors patients in clinics across the country through self-reported symptoms and prioritizes them in a triage list based on fever and other symptoms. With built-in telemedicine features, clinic staff can directly monitor patients while reducing in-person visits and potential exposure. The application also aggregates reports across the country so…
Generate WRX from BlogML
BlogML is an XML format for storing the entire content of a blog. How to generate the WRX from BlogML to import it into WordPress?
Xamarin build error: defining a default interface method requires –min-sdk-version >= 24
I added to my project Xam.Plugins.Android.ExoPlayer and then I received this error: java/lang/Object;I)V: defining a default interface method requires –min-sdk-version >= 24 (currently 13) for interface methods: com.google.android.exoplayer2.Player$EventListener.onTimelineChanged : (Lcom/google/android/exoplayer2/Timeline;Ljava/lang/Object;I)V Looking around, I discovered that other people had the same issue and the problem sits in the Android Options in Project Properties. No Dex compiler was specified, select D8 Dex compiler in the Android project properties: In code: <AndroidDexTool>d8</AndroidDexTool> Happy coding!
Using an in-memory repository. Keys will not be persisted to storage. – ASP.NET Core under IIS
One of the main benefits of building a new .NET project using .NET Core is cross platform deployment, however, IIS will still be a common home for ASP.NET Core web applications.
Accessing the OIDC tokens in ASP.NET Core 2.0
In ASP.NET Core 1.1 So, for example, in ASP.NET Core 1.x, if you wanted to access the tokens (id_token, access_token and refresh_token) from your application, you could set the SaveTokens property when registering the OIDC middleware: 1 2 3 4 5 6 7 8 // Inside your Configure method app.UseOpenIdConnectAuthentication(new OpenIdConnectOptions(“Auth0”) { // Set all your OIDC options… // and then set SaveTokens to save tokens to the AuthenticationProperties SaveTokens = true }); You would then subsequently be able to retrieve those tokens by calling GetAuthenticateInfoAsync inside your controllers, and…
GitHub Package Registry
GitHub Package Registry, a package management service that makes it easy to publish public or private packages next to your source code
Lifetime Managers in Unity Container
The unity container manages the lifetime of objects of all the dependencies that it resolves using lifetime managers. Unity container includes different lifetime managers for different purposes. You can specify lifetime manager in RegisterType() method at the time of registering type-mapping. For example, the following code snippet shows registering a type-mapping with TransientLifetimeManager. var container = new UnityContainer() .RegisterType<ICar, BMW>(new TransientLifetimeManager()); The following table lists all the lifetime managers: Lifetime Manager Description TransientLifetimeManager Creates a new object of requested type every time you call Resolve or ResolveAll method. ContainerControlledLifetimeManager Creates…
ARM \ Logic App Deployment with Azure DevOps
Microsoft’s documentation refers to Logic Apps as being iPaaS or integration Platform-as-a-Service. The “i” in iPaaS indicates the strength of Logic Apps; not only are Azure systems integrated but external and third-party systems can be included in your Logic Apps, including Twitter, Slack, Office 365, and many others. This integration is done using a set of Microsoft-provided connectors. However, if a connector does not exist, then you can still integrate your logic app to external systems via their APIs. Go to the Azure portal https://portal.azure.com and create the logic app.…
Azure WebJobs API
This API is accessed the same way as the git endpoint. e.g. if your git URL is https://yoursite.scm.azurewebsites.net/yoursite.git, then the API to get the list of deployments will be https://yoursite.scm.azurewebsites.net/deployments. The credentials you use are the same as when you git push. See Deployment-credentials for more details. List all web jobs GET /api/webjobs Triggered Jobs List all triggered jobs GET /api/triggeredwebjobs Response [ { name: “jobName”, runCommand: “…\run.cmd”, type: “triggered”, url: “https://…/triggeredwebjobs/jobName”, history_url: “https://…/triggeredwebjobs/jobName/history”, extra_info_url: “https://…/”, scheduler_logs_url: “https://…/vfs/data/jobs/triggered/jobName/job_scheduler.log”, settings: { }, using_sdk: false, latest_run: { id: “20131103120400”, status: “Success”, start_time:…
Adding an external Microsoft login to IdentityServer4
This article shows how to implement a Microsoft Account as an external provider in an IdentityServer4 project using ASP.NET Core Identity with a SQLite database. Setting up the App Platform for the Microsoft Account To setup the app, login using your Microsoft account and open the My Applications link https://apps.dev.microsoft.com/?mkt=en-gb#/appList Click the Add an app button. Give the application a name and add your email. This app is called microsoft_id4_enrico. After you clicked the create button, you need to generate a new password. Save this somewhere for the application configuration.…
Adding Swagger to Web API project
Adding Swagger to your Web API project does not replace ASP.NET Web API help pages. Or maybe yes? Here how to implement Swagger in your apps