Microsoft takes on IFTTT with Flow

IFTTT is one of the most useful online services. Today, Microsoft is taking on IFTTT with its new service called “Flow”. The company is launching the preview of Flow today, and it works almost like IFTTT. Unlike IFTTT, Flow isn’t mostly focused on consumers — instead, it’s mostly focused on enterprise integrations. Flow lets you automate your workflow, and be more productive. With Flow, you can setup GitHub to automatically send a Slack notification and add a card in Trello when a new issue is submitted. Additionally, you can also…

Read More

Remove multiple line in the same file with C#

Read the file, remove the multiple line (but it saves one of them) in memory and put the contents back to the file (overwriting) and create a backup file with the original file.   using System; using System.Collections.Generic; using System.IO; using System.Linq; namespace DelMultiLine { class Program { static void Main(string[] args) { if (args.Count() == 0 || args.Count() > 2) { Console.WriteLine(“\nDelMultiLine (by Enrico Rossini – puresourcecode.com)”); Console.WriteLine(“———————————————————————–“); Console.WriteLine(“Remove duplicate line in a file\n”); Console.WriteLine(“Usage:”); Console.WriteLine(” delmultiline <Filename> <resultFilename>\n”); Console.WriteLine(“filename: define a full path for the file you want…

Read More

Under the hood of Microsoft’s Windows Subsystem for Linux

Bash on Windows 10 was one of the big reveals at Microsoft’s recent Build conference. Since then, there’s been a lot of speculation about what Microsoft did to make this possible. Microsoft is starting to provide more details via blog posts and a new Channel 9 video on what’s going on under the covers. Spoiler alert: There’s no secret Linux kernel hidden in Windows 10. Instead, it’s the Windows Subsystem for Linux (WSL) that was developed by the Windows Kernel team is what provides the foundation that enabled the Linux…

Read More

Dijkstra’s Algorithm in C# with Generics

I recently needed to to implement a shortest-path algorithm (to identify preferred domain controllers using site link costs) and I found Dijkstra’s Algorithm Path class using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DijkstraAlgorithm { public class Path<T> { public T Source { get; set; } public T Destination { get; set; } /// <summary> /// Cost of using this path from Source to Destination /// </summary> /// /// Lower costs are preferable to higher costs /// </remarks> public int Cost { get; set; } } }…

Read More

C# 7 Features Previewed

Over the last year we’ve shown you various features that were being considered for C# 7. With the preview of Visual Studio 15, Microsoft has decided to demonstrate the features to make it into the final release of C# 7. Tuple Value Types .NET has a tuple type, but in the context of C# there are a lot of problems. Being a reference type, you probably want to avoid using it in performance sensitive code as you have to pay for GC costs. And as they are immutable, while making…

Read More

DistinctBy in Linq (Find Distinct object by Property)

public class Size { public string Name { get; set; } public int Height { get; set; } public int Width { get; set; } } Consider that we have Size Class for advertisement which is having Heigth, Width and Name as property in it. Now Requirement is I have to find out the all product with distinct Name values. Size[] adv = { new Size { Name = “Leaderboard”, Height = 90, Width = 728 }, new Size { Name = “Large Rectangle”, Height = 280, Width = 336…

Read More

Data and data access technologies

In my previous post I spoke about key layers of distributed applications. Now we will go through the most crucial layer of any distributed application, the data layer. In this part, you will be introduced to various database technologies, along with .NET-related technologies. Data can be stored in a wide range of data sources such as relational databases, files on the local filesystems, on the distributed filesystems, in a caching system, in storage located on the cloud, and in memory. Relational databases (SQL server): This is the traditional data source…

Read More

Key layers of distributed applications

Every application that is going to be used by end users should be designed appropriately as users are expecting to process information from various data sources that might be geographically distributed. They are also expecting this information to be up-to-date and capable of being inflected very fast. Designing such applications is not an easy task and involves integration among different groups of components. Let’s review the layers that form a typical distributed application. The responsibilities in a distributed system can be divided into four layers: The data layer The business…

Read More