# Calories Calculation

### Calories Calculation

##### Daily average intake:

Average daily intake can be anywhere from 1,800-2,400kcals.

##### What is 1 kg of fat equal to calories?

There are 7,700kcals (kcal=calorie) worth of energy in 1kg of fat. That means in order to burn 1kg of fat, you must have a calorie deficit of 7,700.

##### 1000 Calories Is Equal to How Many Kgs?

1000 calories are equal to 0.129598 kg. Hence, if you have a daily energy expenditure of 1000 calories daily, it will take you around eight days to burn off 1 kilogram of body fat.

##### Exercises:

Walking 300-400 calories per hour/150 calaries 30 minutes/25 calories in 5 minutes
Cycling 600 calories per hour/300 calories 30 minutes/50 calories in 5 minutes
Jump roping 1000+ calories per hour/500 calories 30 minutes/83 calories in 5 minutes
Running 600 calories per hour/300 calories 30 minutes/50 calories in 5 minutes
Swimming 600 calories per hour/300 calories 30 minutes/50 calories in 5 minutes

##### Basal metabolic rate (BMR)

The BMR refers to the amount of energy your body needs to maintain homeostasis. Your BMR is largely determined by your total lean mass, especially muscle mass, because lean mass requires a lot of energy to maintain. Anything that reduces lean mass will reduce your BMR.
Your BMR is the minimum number of calories that your body needs to function at rest. You may think you only need energy to exercise or complete tasks, but your body has a specific energy need just to complete basic functions like breathing and regulating your hormone levels.

Your BMR is what energy your body needs to perform basic functions, while RMR is the amount of calories that your body burns while at rest.

##### Food and calories:

Poha 180-250 calories
Upma 200 calories
Rice 150-250 calories
sabji
1 glass milk
Fruits
Biscuts
1 Idli 33 calories
idli (2 pieces), sambar and chutney – 90 calories
Burger 295 calories
Pizaa 266 calories
1 Pav 130 calories
Pav Bhaji gives 400 calories
1 slice of Bread 82 calories
A bowl of dry sabzi of bhindi, potatoes or cauliflower :150 calories
Aloo Parantha:210 calories
100 grams of curd contains about 100 calories

##### BMR calculation example

BMR 1,758 kcal/day
Exercise 3 Mets
Walking distance
4 km =2.5 mile
Calories burned
220 kcal
For 10,000 steps,
82 minutes per day
The METS values are provided by “The Compendium of Physical Activities 2011”.
Calorie(Kcal) ＝ BMR x Mets / 24 x hour

Excess calorie (Average): calorie intake−calorie burned≒300kcal/day
Walking 10,000 steps a day will burn about 300 Kcal.

# Robotic Process Automation(RPA)

## Robotic Process Automation(RPA)

RPA is the technique of automating an actual business process to complete a task without the intervention of human beings. An RPA developer is a trained professional who has expertise in the field of software development, and not just any software. The basic work of an RPA developer is to deploys hardware-oriented software that deploys codes that are responsible for automating repetitive tasks.

Robotic – Robots are entities developed to complete tasks performed by human.
Process – Process is a sequence of tasks combined to perform a meaningful action.
Automation – Automation is done to perform tasks without human intervention.

RPA Tools :
Blue Prism
UiPath
Automation Anywhere

Life Cycle Of RPA Project :

Identify
Analyse
Design
Develop
Test
Implement

Roles & Responsibilities
-They identify and develop the most effective automated processes for any business organization.
-They aim to increase the efficiency of the workflow in any management.
-Proper monitoring is always required to access the output of the process that is being automated.
-The developers are also responsible for creating detailed outlines of all the processes and study the data to make sure that the required production is being met with the use of an automation system
-Quality assurance

Required skills:
1. Programming Skills
2. Scripting Languages like HTML and JavaScript
3. SQL
4. Knowledge of AI and ML concepts
5. Familiarity with Automation Tools
6. Required Analytical and Soft skills

Improved Quality –
Reduced Time –
Cost Efficient –

Applications Of RPA :

Data migration and Data entry.
Data validation.
Extracting data from PDF and other scanned documents.
Regular report generation.
Creating and developing invoices.
Generating mass emails.
Updating CRM.
Automated testing.
Expense management.

# Microservices Architecture

## Microservices Architecture

It is approach to create loosely coupled services which can be developed, deployed, and maintained independently. Each of these services is responsible for discrete task and can communicate with other services through simple APIs to solve a larger complex business problem.

Key Benefits of a Microservices Architecture
-Small teams can work independently if required
-Can deployed independently
-improved fault isolation
– Service can be deployed only for the respective service instead of redeploying an entire application.
-technology stack can be different.

#### Some points to think about

1. How to Decompose
Create services based on business capabilities.
For example, the business capabilities for an online shopping application might include the following..

● Product Catalog Management
● Inventory Management
● Order Management
● Delivery Management
● User Management
● Product Reviews Management

2. Design the Individual Services Carefully
-When designing the services, carefully define them and think about what will be exposed, what protocols will be used to interact with the service, etc.

Example -We are taking a service (Service 1) and storing all of the information needed by the service to a database. When another service (Service 2) is created which needs that same data, we access that data directly from the database.
Now if schema needs to change, flexibility to make change is lost.
Alternate way – Service 2 should access Service 1 and avoid going directly to the database, therefore preserving utmost flexibility for various schema changes that may be required

3. Building and Deploying
-Creating services using best suited technology.
-Automated test cases
-Deploy services.

4. Deploy
It’s important to write Consumer Driven Contracts for any API that is being depended upon. This is to ensure that new changes in that API don’t break your API.
Two models for deployment
1. multiple microservices per operating system
2. One Microservice Per Operating System (using Hypervisors whereby multiple virtual machines are provisioned on the same host). Docker is one implementation of that model

Making Changes to Existing Microservice APIs While In Production
-version your API (Downside: maintain versions. Any new changes or bug fixes must be done in both the versions)
-Another way another end point is implemented in the same service when changes are needed.

5. Decentralize Things
– Have one team who develop, deploy, maintain and support it
-Another way is developer who needs changes in a service can check out the code, work on a feature, and get it reviewed instead of waiting for the service owner to pickup and work on needed changes.

6. Making Standards
-Best practices
-Error handling

Service Dependencies
In a microservices architecture, over time, each service starts depending on more and more services. This can introduce more problems as the services grow, for example, the number of service instances and their locations (host+port) might change dynamically. Also, the protocols and the format in which data is shared might vary from service to service.

7. Failure
What’s critical with a microservices architecture is to ensure that the whole system is not impacted or goes down when there are errors in an individual part of the system.
-patterns like Bulkhead (ship compartment) and Circuits Breaker(trip based on threshold)

# SQL Server

SQL server slow performance
Poor Normalization – Flat wide tables or over normalization
Redundant data in databases
Bad referential integrity (foreign keys and constraints)
Wide composite primary keys (and clustered indexes)
No stress testing of schema robustness adhering growth patterns

#2: Inefficient T-SQL Queries
Using NOT IN or IN instead of NOT EXISTS or EXISTS
Using cursors or white loop instead of INSERT…SELECT or SELECT…INTO TABLE
Using SELECT * instead of only necessary column names
Nesting of subqueries creating a complex execution plan
Using functions on Indexed Column in WHERE clause
Datatype mismatch in predicates (where condition or joins)
Interchanging usage of UNION vs UNION ALL
Unnecessary using DISTINCT everywhere
Dynamic SQL

#3: Poor Indexing Strategies
Indexing every single foreign key
Indexing every column in the table
Many single-column indexes
Preferring Heap Table over the Clustered index

#4: Incorrect Server settings
Keeping Maximum Degree of Parallelism to 0
Not setting the index level to fill factor
Lower Filegrwoth
Single TempDB files
Hosting SQL Server data and log files together
Running antivirus on SQL Server files
Incorrect value in Max Memory Configuration
High latency for your log files

#5: Hardware issue

Why is my SQL Server Query Suddenly Slow?
1. Look for most expensive queries running in SQL Server, over the period of slowdown
2. Check the query plan and query execution statistics and wait types for those query
3. Review the Query history over the period to see where performance changed
4. Check usage over the periods of “normal” and “bad” performance, and see what changed.
5. Diagnosis and query tuning

Index scan vs Index seek
Index scan means it retrieves all the rows from the table and index seek means it retrieves selective rows from the table. INDEX SCAN: Index Scan touches every row in the table it is qualified or not, the cost is proportional to the total number of rows in the table.