Blazor (WebAssembly)

What is Blazor?

Blazor is a framework for building interactive client-side web UI with .NET. Blazor is based on open web standards. It is being developed by Microsoft.

As long as the browsers support those open web standards, they will also support Blazor.

Even if Blazor disappears, you will be able to transfer a lot of knowledge that you gain by learning Blazor to other technologies. HTML and CSS are technologies that are around for 20+ years, and there is no sign that they will disappear anytime soon.

Also, C# is a very popular programming language that can be used for building many different types of applications, not only Blazor web applications.

Use:
Create rich interactive UI with C#
Render UI as HTML and CSS
Integrate with modern hosting platform ( Docker)
Can be shared and distributed as Razor class libraries or NuGet packages.

Blazor WebAssembly:
-Blazor WebAssembly is a single-page app (SPA) framework for building interactive client-side web apps with .NET.
-Running .NET code inside web browsers is made possible by WebAssembly
-WebAssembly is a compact bytecode format optimized for fast download and maximum execution speed

How it works?
When a Blazor WebAssembly app is built and run in a browser:
-C# code files and Razor files are compiled into .NET assemblies.
-The assemblies and the .NET runtime are downloaded to the browser.
-Blazor WebAssembly bootstraps the .NET runtime and configures the runtime to load the assemblies for the app
-The Blazor WebAssembly runtime uses JavaScript interop to handle DOM manipulation and browser API calls

Questions –
What is docker?

Artificial intelligence (AI)

Artificial intelligence (AI)

Artificial intelligence (AI) is intelligence demonstrated by machines. AI refers to the simulation of human intelligence in machines that are programmed to think like humans and mimic their actions.

Artificial intelligence is a theory and development of computer systems that can perform tasks that normally require human intelligence. Speech recognition, decision-making, visual perception etc.

Types of AI

Reactive AI

It is programmed to provide a predictable output based on the input it receives
For example Chess/email spam filters.

Limited Memory AI
Limited memory AI learns from the past and builds experiential knowledge by observing actions or data.
For example, autonomous vehicles use limited memory AI to observe other cars’ speed and direction, helping them “read the road” and adjust as needed.

Theory of Mind AI
With this type of AI, machines will acquire true decision-making capabilities that are similar to humans. Machines with theory of mind AI will be able to understand and remember emotions, then adjust behavior based on those emotions as they interact with people.

Self-aware AI
The most advanced type of artificial intelligence is self-aware AI. When machines can be aware of their own emotions, as well as the emotions of others around them, they will have a level of consciousness and intelligence similar to human beings. This type of AI will have desires, needs, and emotions as well.

AI vs Machine learning

Artificial intelligence is a technology that enables a machine to simulate human behavior. Machine learning is a subset of AI which allows a machine to automatically learn from past data without programming explicitly. The goal of AI is to make a smart computer system like humans to solve complex problems.

How Artificial Intelligence and Machine Learning are Revolutionizing Software Development

 

Differences Between .NET Framework, .NET Core, and .NET Standard

.NET is a developer platform made up of tools, programming languages, and libraries for building many different types of applications.

.NET Framework

.NET Framework is the original implementation of .NET. It supports running websites, services, desktop apps, and more on Windows. .NET Framework 4.8 is the last version of .NET Framework

.NET Core 

.NET Core is a cross-platform implementation for running websites, services, and console apps on Windows, Linux, and macOS. .NET is open source on GitHub.

Version Latest Version Visual Studio
.NET 5 VS 2019
.NET Core 3.x – latest VS 209
.NET Core 2.x VS 2017, 2019
.NET Core 1.x VS 2017

Both, .NET 3.1, and .NET Core 2.1 will have long term support.
.NET Core 3.x applications only run on .NET Core Framework.
.NET Core 2.x applications run on .NET Core as well as .NET Framework.

.NET Standard

.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.

.Net Framework and .Net core have different BCLs, hence .Net Framework library is not compatible with .Net core and vice versa. To solve this problem Microsoft introduced .Net standard.

For example, to develop a library that supports .NetFramework 4.5.1 and .Net Core 1.0, we need to target .Net Standard 1.2 i.e. the lowest .NetStandard version that the 2 frameworks implement.

Xamarin/Mono 

Xamarin/Mono is a .NET implementation for running apps on all the major mobile operating systems, including iOS and Android.

C# Version History

Version .NET Framework Visual Studio Important Features
C# 1.0 .NET Framework 1.0/1.1 Visual Studio .NET 2002 First release of C#
C# 2.0 .NET Framework 2.0 Visual Studio 2005
  • Generics
  • Partial types
  • Anonymous methods
  • Nullable types
  • Iterators
  • Covariance and contravariance
C# 3.0 .NET Framework 3.0\3.5 Visual Studio 2008
  • Auto-implemented properties
  • Anonymous types
  • Query expressions
  • Lambda expression
  • Expression trees
  • Extension methods
C# 4.0 .NET Framework 4.0 Visual Studio 2010
  • Dynamic binding
  • Named/optional arguments
  • Generic covariant and contravariant
  • Embedded interop types
C# 5.0 .NET Framework 4.5 Visual Studio 2012/2013
  • Asynchronous members
  • Caller info attributes
C# 6.0 .NET Framework 4.6 Visual Studio 2013/2015
  • Static imports
  • Exception filters
  • Property initializers
  • Expression bodied members
  • Null propagator
  • String interpolation
  • nameof operator
  • Dictionary initializer
C# 7.0 .NET Core Visual Studio 2017
  • Improved performance and productivity
  • Azure Support
  • AI Support
  • Game development
  • Cross platform
  • Mobile App Development
  • Window App Development

 

List of .NET Dependency Injection Frameworks

What is Dependency injection?

Dependency injection is a design pattern in which an object receives other objects that it depends on. It is way of doing loosely coupled programming. It separates concern of constructing an object. It is technique to achieve inversion of control between classes and their objects.

List of .NET Dependency Injection Frameworks

Castle Windsor – Castle Windsor is best of breed, mature Inversion of Control container available for .NET and Silverlight. Windsor is part of an entire stack which includes Monorail, Active Record, etc. NHibernate itself builds on top of Windsor.
Unity – Lightweight extensible dependency injection container with support for constructor, property, and method call injection. Supported by Microsoft.
Spring.Net – Spring.NET is an open source application framework that makes building enterprise .NET applications easier.
VS MEF – Managed Extensibility Framework (MEF) implementation used by Visual Studio.

Other frameworks
Autofac ,DryIoc, Ninject, Lamar ,LightInject,Simple Injector,Microsoft.Extensions.DependencyInjection,Scrutor,TinyIoC,Stashbox, Structure Map

Apache Kafka Introduction

Apache Kafka Introduction

Apache Kafka is an event streaming platform.
3 features –
To publish (write) and subscribe to (read) streams of events
To store streams of events durably and reliably for as long as you want
To process streams of events as they occur or retrospectively.

What is event streaming?
It is way of capturing data in real-time from event sources like databases, sensors, mobile devices, s/w applications etc.
-storing these events
-processing these events
-routing these events
Event streaming thus ensures a continuous flow and interpretation of data so that the right information is at the right place, at the right time.

Uses :
To capture and analyze sensor data from IoT devices in factories
To capture payments
To capture financial transactions
To track and monitor cars, trucks, shipment etc.

Working:
Kafka is a distributed system consisting of servers and clients that communicate via a high-performance TCP network protocol.
Servers: Kafka is run as a cluster of one or more servers that can span multiple datacenters or cloud regions. Some of these servers form the storage layer, called the brokers
-Other servers run Kafka Connect to continuously import and export data
Clients: They allow you to write distributed applications and microservices that read, write, and process streams of events in parallel, at scale, and in a fault-tolerant manner even in the case of network problems or machine failures.

When some event happens that is recorded. It is also called record or message. Event will have key, value and timestamp.
Event key: “Prakash”
Event value: “Paid Rs.100 to Vijay”
Event timestamp: “May. 25, 2022 at 7:06 p.m.”

Producers are those client applications that publish (write) events to Kafka, and consumers are those that subscribe to (read and process) these events.
Events are organized and durably stored in topics. (folders in filesystem and events are files in that folders).
Topics are partitioned, meaning a topic is spread over a number of “buckets” located on different Kafka brokers.
APIs
-The Admin API to manage and inspect topics, brokers, and other Kafka objects.
-The Producer API to publish (write) a stream of events to one or more Kafka topics.
-The Consumer API to subscribe to (read) one or more topics and to process the stream of events produced to them.
-The Kafka Streams API to implement stream processing applications and microservices.
-The Kafka Connect API to build and run reusable data import/export connectors that consume (read) or produce (write) streams of events from and to external systems and applications so they can integrate with Kafka.

 

Cloud Computing

Cloud Computing

-Pay for what you need
-Cloud computing is the on-demand delivery of IT resources over the internet with pay-as-you-go pricing
-300 virtual servers or 2000 terabytes of storage

The three cloud computing deployment models are cloud-based, on-premises, and hybrid.

Cloud-based

Run all parts of the application in the cloud.
Migrate existing applications to the cloud.
Design and build new applications in the cloud.

on-premises

On-premises deployment is also known as a private cloud deployment.
In this model, resources are deployed on premises by using virtualization and resource management tools.
For example, you might have applications that run on technology that is fully kept in your on-premises data center. Though this model is much like legacy IT infrastructure, its incorporation of application management and virtualization technologies helps to increase resource utilization.

hybrid

Connect cloud-based resources to on-premises infrastructure.
In a hybrid deployment, cloud-based resources are connected to on-premises infrastructure. You might want to use this approach in a number of situations.
For example, you have legacy applications that are better maintained on premises, or government regulations require your business to keep certain records on premises.

Advantages:
-Cost saving
-Stop spending money to run and maintain data centers
-No need to guess capacity
-Increase speed and agility

Cloud computing service categories:

Saas (Software as a Service)

In this case third party providers host applications and make them available to customers on internet
Examples: Salesforce, Concur

Pass (Platform as a Service)

In this case third party providers hosts application development platforms and tools on its own infrastructure and make them available to customers on internet.

Examples: Google App Engine, AWS Elastic Beanstalk

Iaas (Infrastructure as a Service)

In this case third party providers host servers, storage and other virtual resources and make them available to customers on internet.

EC2

When you’re working with AWS, those servers are virtual and service you use to gain access to virtual servers is called Ec2. EC2 runs on top of physical host machines managed by AWS using virtualization technology. When you spin up an EC2 instance, you aren’t necessarily taking an entire host to yourself. Instead, you are sharing the host with multiple other instances, otherwise known as virtual machines. When you provision an EC2 instance, you can choose the operating system based on either Windows or Linux. You can provision thousands of EC2 instances on demand

Advantage

-Cost effective
-highly flexible
-Quick
-You can easily stop or terminate the EC2 instances

Different types of EC2 instances

The different instance families in EC2 are general purpose, compute optimized, memory optimized, accelerated computing, and storage optimized.

General purpose instances provide a good balance of compute, memory, and networking resources, and can be used for a variety of diverse workloads like web service or code repositories.

application servers
gaming servers
backend servers for enterprise applications
small and medium databases

Compute optimized instances are ideal for compute-intensive tasks like gaming servers, high performance computing or HPC, and even scientific modeling.

memory optimized instances are good for memory-intensive tasks. Accelerated computing are good for floating point number calculations, graphics processing, or data pattern matching, as they use hardware accelerators.

Storage optimized instances are designed for workloads that require high, sequential read and write access to large datasets on local storage. Examples of workloads suitable for storage optimized instances include distributed file systems, data warehousing applications, and high-frequency online transaction processing (OLTP) systems.

 

System Design – Application like Twitter

Whenever we thing of designing a system we need to understand the requirement. We need to look at existing applications in market. Application cannot be created in one night. It needs proper planning on requirement, resource availability, time duration ,funds for the project etc.

Lets talk about twitter. What is twitter?

Twitter we can say is social networking site where people communicate with each other with short messages. We call these messages as tweet. These tweets can contain text, videos, photos or links. It allows people to share there thoughts with other people.

Functional requirement:

  • Tweet
  • Re-tweet
  • Follow
  • Search

Non-Functional requirement:

  • Heavy reading
  • Fast rendering
  • Always available
  • Fast tweet
  • Scalable (Number of users, Daily tweet, Monthly tweet etc.)
  • Low latency

Different type of users:

  • Well known people ( Celebrity, Player, Politicians etc.) They have huge followers
  • Active users
  • Passive users
  • Online users ( Available at that point)
  • Inactive/Deleted

Components that we can think off:

  • Different services like
    • User service to get sign up/login or get user details
    • Analytics service to do analysis
    • Graph service
    • User live (notification) service
  • Different databases
    • RDBMS/No SQL
    • In memory (Redis)
    • Cassendra or Hbase for images
    • CDN for distributing data
  • Search functionality
    • Elastic search
  • Load balancer
  • Kafka
    • Used to build real-time streaming data pipelines and real-time streaming applications

System should be designed such that it is loosely coupled. Initially  if team size is small, you can think of monolithic architecture but you need to keep in mind that later it will be decoupled.

 

Different type of databases

What are different type of databases?

1. Relational databases
-SQL language
-They are compliant with ACID

Examples – SQL Server, Oracle Database, MySQL, PostgreSQL

2. Cloud databases
-Database that’s designed to run in the cloud.
-cloud databases offer flexibility and scalability, along with high availability
Examples: Azure SQL Database, Amazon Relational Database

3. NoSQL databases
-Non-relational database
-To store unstructured or semi-structured data
-One advantage of NoSQL databases is that developers can make changes to the database on the fly, without affecting applications that are using the database
Examples: MongoDB,Apache Cassandra,CouchDB, and CouchBase

4. Key-value databases
-NoSQL databases
-Key-value databases are highly scalable and can handle high volumes of traffic
-Caching values

Examples: Amazon DynamoDB, Redis

5. Columnar databases
-store data in columns rather than rows
– it essentially ignores all of the data that doesn’t apply to the query, because you can retrieve the information from only the columns you want
-Ever increasing data

Examples: Google BigQuery, Cassandra, HBase, MariaDB

6. Document databases
-document stores, use JSON-like documents to model data instead of rows and columns
-Document databases are simple and scalable, making them useful for mobile apps that need fast iterations.

Examples: MongoDB, Amazon DocumentDB, Apache CouchDB

7.Time series databases (Application pushing matrix)
-database optimized for time-stamped, or time series, data

Examples: InfluxDB, Druid,Open TS DB

8. Data ware house/Offline reporting
When you have lot of information for analysis
Example : Hadoop (Amazon/Uber data)

9. Search relevant text
Elastic search (search engine)
Solr

10. Distributed database
Distribute images to different server across globe
Example : CDN

11.Blob storage
Storing video’s/images (amazon/Netflix)
Example Amazon S3

Trip to Manali, Shimla and Chandigarh (6 Days)




Trip to Manali, Shimla and Chandigarh (2022)

Every person has some or other dream in life. I also had few things in my mind for long time. They were doing paragliding and river rafting. I knew some places in Maharashtra were that was possible but that plan was never executed. Finally got opportunity to travel to Manali were I knew these activities were possible and top of it enjoy snow activities and pleasant weather in hot summer.

Places to visit in Manali:
1. Manu Temple
2. Hadimba Temple
3. Manali Sanctuary
4. Arjun Gufa
5. Jagatsukh
6. Solang Valley
7. Tibetan Monastery
8. Vashist Village
9. Nehru Kund
10. Rohtang Pass (For snow point)
11. Atal tunnel ( 9.02 KM)
12. Koksar (For snow point)
13. Manikaran
14. Naggar Castle
15. Waterfalls
16. Mall road for shopping and local food.

Places to visit in Shimla:

  1. Kufri
  2. Mall road
  3. Himalayan Nature Park
  4. Scandal Point
  5. Jhakoo Temple

Places to Visit in Chandigarh

  1. Rock garden (Must visit)
  2. Rose Garden
  3. Sukhana lake

 

Tips for Rohtang pass/snow point:

  1. Recommendation is to carry winter dress, shoes from Manali on rent. (250/- per person)
  2. No need to book any activity. Don’t buy socks from them even though they insist you
  3. Go to snow point and then decide.
  4. Carry socks, Sweater, Jacket, winter cap on your own.
  5. Rohtang pass is charged at 500/- for car. But driver will ask you anything between 3000 – 5000/- depending on Rush.

Tips for Kufri:

  1. For Horse ride they charge 500 per person. If we walk 100 mtrs towards top, charges will come down.
  2. Do not book any activity at start point. Go to top and see what you want to enjoy.
  3. Personally I did not like anything except zipline
  4. Children will enjoy telescope ride (but you need to bargain for cost)

Day 1: Pune to Chandigarh (2.5 hrs)

We had booked car from Chandigarh for complete trip. Driver came in time to pick up us and we started our journey at 6:30 AM toward the road to the beautiful hill station of Manali (2000 meters above sea level).

Located in the Beas River Valley, Manali is a very popular hill station visited by tourists from across the country. Manali can be reached from the national highway that leads to the Ladakh region.

Before Manali near Bhuntar we stopped for Paragliding and Water rafting around 2 PM. It was one of the best experience in life. For Paragliding they will take you to start point in their vehicle and you will dive from there along with guide. Then they will pick you and take you back. Same way for boat ride.

After that we reached hotel by 8:45 PM.

Day 2:

We were very fortunate on second day as we came to know Rohtang pass was opened for tourist. Rohtang pass is closed for 7-8 months and opened in May. It is place were you can enjoy snow and even snow fall sometimes(if very lucky). We planned to go there. Driver took the required pass as vehicles are not allowed without pass. While going we took snow dress and shoes on rent. We also booked some snow activities there but that was mistake as same can be done after reaching Rohtang snow point.

We enjoyed snow activities for 1.5 hrs and started our journy back around 12:30 PM. It takes around 2 -2.5 hrs to reach there from Manali.

While return we saw Nehru Kund, Vashist Temple, Van Vihar, Tibettian Monetary and Mall road.

Day 3:

We visited Hadimba temple and then went to see Naggar castle. There we also visited Nicholos Rorich art gallery. We returned to Hotel by 2 PM and took some rest. In evening went to Club house and menu temple.

Day 4:

We started our journey at 8:15 AM after breakfast towards Manikaran, the hottest Sulphur Spring Waters in the world. We visited Gurudwar and hot water spring. This religious site is visited by both Hindus and Sikhs in large numbers.

We started towards shimla around 11:30 AM. Set in beautiful hills, meandering streets and mystical
woods, Shimla treats honeymooners and families to captivating natural beauty. What also attracts tourists here is the chance to go trekking, mountaineering, skiing and other adventure activities.

Day 5:

We started towards Kufri around 8:30 AM. Kufri is hill station and weather is quite pleasant. There you need to ride on horse or you should have some trekking experience to reach to top. There you will see lot of activities like zip line, walking on ropes etcs. Also you can see apple garden, valley and village.

Day 6:

We started towards Chandigarh at 8:30 AM and reached by 11:30 AM. We visited  Sukhana lake, Rock garden and Rose garden. That was end of trip.

Driver dropped us to Airport and we came back to Pune by 11:30 PM.

Charges for Paragliding and Boat rafting: 

  1. Paragliding cost between 2000- 2500/- including video
  2. Boat river rafting cost between 2000-5000/-
  3. More people in group more you can bargain.

Cost of trip for 6 days 5 nights : (60 k to 96 k for 2 people)

Hotel booking : 3 k to 4 k per day = 15k to 20k

Flight: 5k to 9k = 20 k to 36 k for 2 person

Cab: 16k to 22K

Activities – 8k to 14K

Meals/Food – 2k to 4k