What to Read?

Stateful Serverless: Long-Running Workflows with Durable Functions

Great post by Jeremy Likness on how to use Durable Functions in Azure Functions to create a long-running workflows. Yes, a serverless service can be used for long-running application. Some of the pattern implemented are: fan-out-fan-in, human interaction, etc. Although the example given is a game, it can definitely be applied in many Enterprise situation.


What’s the big deal with IAsyncEnumerable in .NET Core 3.0?

Ever wonder how you can stream data asynchronously? Now you can with IAsyncEnumerable<T>, a new feature in C# 8.0 and .NET Core 3.0.


Create dependent pipelines in your Azure Data Factory

One of the very common scenarios in data integration and movement is the dependency of one task to another. Azure Data Factory now offers option to run triggers based on dependency of another trigger. You can even specify offset and dependency size of a trigger.


The guide to Visual Studio Code shortcuts, higher productivity and 30 of my favourite shortcuts you need to learn

Want to code faster in Visual Studio Code, this will help you.


Solving Cold-Start disturbs serverless’ definition and it’s okay

Serverless has its advantage but cold-start is not one of them. With Azure Premium Functions, you can solve cold-start issue although technically, it’s no longer a serverless. Maxime made an argument when to use serverless or not.


Advertisements

What to Read this Week?

Integrating Cosmos DB with OData (Part 1)

Azure Cosmos DB is great, but what if you need expose it as OData standard, including the query in URI convention? Well, you integrate it with OData. Hassan covers the basic of Cosmos DB, what is it and how to set it up, and how to integrate it with OData.

40 Visual Studio Code Plugins I Have

One can never has enough Visual Studio Code plugins. Here’s another 40 for you.

Open Neural Network Exchange (ONNX)

Machine learning is on the rise and everyone develops their own standard. ONNX (read `onix`) is an open standard model for machine learning. This explains what is it in more details as well as where to get the pre-build ONNX models (model zoo).

Introduction to Big O Notation and Time Complexity (Data Structures & Algorithms #7)

CSDojo explains Big O Notation in a simple, easy to understand way and how time and space complexity are calculated. There are some maths involved, but they are pretty basic.

C# Data Structures

And along with Big O Notation, these articles go over the data structures that are available in C#. Learning and knowing when to use these data structures are important in building the fast algorithm.

This Week Reading List

Want to learn any programming language? — Write These 3 Simple Apps!

https://medium.com/@samuel.fare/want-to-learn-any-programming-language-write-these-3-simple-apps-5af8cd119921

Very good read if you want to learn new programming langugage. Sam Fare challenges you to build 3 simple apps with a new programming langauge: Hello World, Anagram and Pizza app. I’ll throw in one more as a bonus: a Todo app.

 


How to Become a Better Software Developer by Digging & Climbing

https://dmitripavlutin.com/become-better-software-developer-digging-climbing/

Even if you are an experienced developer, it’s still a very good read. Dmitri shares what he did to become a better developer (and we always have room to become a better developer). It’s a conceptual idea, which is why it’s a very good read, with some practical examples.

 


Event-driven analytics with Azure Data Lake Storage Gen2

https://azure.microsoft.com/en-us/blog/event-driven-analytics-with-azure-data-lake-storage-gen2/

If you are dealing with big data, the ingestion, processing, storage, consumption and ETL stuff, add this to your reading list. It outlines a way to use event-driven technique using Azure services to build data for analytics.

 


Azure solution architectures

https://azure.microsoft.com/en-us/solutions/architecture/

One of my favorites. This is more of a reference than a reading. Microsoft docs provides cloud architecture solutions (based on Azure services) for different scenarios and needs. Definitely check it out when you need to design and build a new system.

 


The Azure Infrastructure Architect Map

https://techcommunity.microsoft.com/t5/Azure-Developer-Community-Blog/The-Azure-Infrastructure-Architect-Map/ba-p/766268

Yet another good resource for a reference. This guides you through way-too-many Azure services based on your needs, sorta help you to decide what Azure service to use for a specific scenario. There’s also Solution Architect map and Security Architect map. Links are in the article.

 


Pipeline Pattern Implementations in C# .NET – Part 1

https://michaelscodingspot.com/pipeline-pattern-implementations-csharp/

Part 1 of 2 where Michael explains how to implement pipeline pattern in C#. This is not about `System.IO.Pipelines` library, but rather,
Part 2 – https://michaelscodingspot.com/pipeline-pattern-tpl-dataflow/

Fair Distribution Algorithm

Given 5 boxes with different weight [24, 27, 17, 15, 17], distribute the weight as even as possible among 3 trucks of the same size. The trucks can fit unlimited number of boxes. The weight of the boxes can’t be transferred, for example move 4 from box 1 (originally weight 24) and transfer to box 2.

What if we have more boxes with different weight, let’s say 6 boxes with weight of [1, 2, 17, 21, 7, 6].

What if the number of truck change to 5 trucks?

What’s the most effective algorithm to distribute the boxes evenly (in weight) within all the trucks?

ECMAScript 2015 Destructuring and Spread

Destructuring

Destructuring is a way to unpack values from arrays, or properties from objects, into its own variables.

var o = {p: 42, q: true};
var {p: foo, q: bar} = o;

console.log(foo); // 42
console.log(bar); // true

Spread

Spread allows collection to be expanded in places where zero or more arguments are expected (in function), or elements are expected (in array literals), or key-value pairs are expected (in object literals).

function sum(x, y, z) {
  return x + y + z;
}

const numbers = [1, 2, 3];

console.log(sum(...numbers));
// expected output: 6

console.log(sum.apply(null, numbers));
// expected output: 6

Reference

 

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax

Memoization, huh?

Memoization

To put it simply, it’s caching. In a fancy term.

Memoization is usually being used in function. In other words, memoization is caching in the scope of Function. The purpose of memoization is to avoid doing computation that’s needed to be done repeatedly. This essentially to save time and resources.

The way functions achieve memoization is by caching the result and returning the result if it has been computed previously.

Couple use cases of memoization

  • Pure functions that require intensive computation and called repeatedly.
  • Pure and recursive Function.

See Fibonacci example in the link reference.

Reference

https://medium.com/@chialunwu/wtf-is-memoization-a2979594fb2a

NgRx Entity

NgRx Entity

NgRx Entity is a library to handle entity within NgRx framework. The entity in the context is defined as the application’s domain objects, like User, Employee, etc.

The purposes of NgRx Entity are basically:

  • Reduce boilerplate code.
  • Search and sort entities quickly.

The first thing we need to use NgRx Entity is to create an entity adapter, like so:

const adapter = createEntityAdapter();

NgRx Entity also defines `EntityState<>` interface. The interface is also extensible should the additional properties in the application state are needed,

The shape of EntityState is something like this:

interface EntityState {
  ids: string[];
  entities: { [id: string]: V };
}

What this allows us to do is:

  • Find entity quickly using `entities` dictionary.
  • Maintain order of the list, good for use in sorting.

Some boilerplate codes that are reduced when using NgRx Entity:

  • No need to specify properties of the state interface.
  • Add, remove, update of entities in the state are handled by entity adapter.
  • Entity adapter has most commonly used selectors.

Reference

https://medium.com/ngrx/introducing-ngrx-entity-598176456e15