- Clean code is simple and elegant - reads like well-written prose
- Clean code is focused - each function, class, and module has a single responsibility
- Clean code is written by someone who cares - attention to detail is evident
- Clean code can be read and enhanced by others - not just the original author
- Clean code has meaningful names - variables, functions, and classes have intention-revealing names
- Clean code has no duplication - follows the DRY principle
- Clean code runs all tests - is thoroughly tested and works correctly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Performance */ | |
-- Do analysis using below queries | |
-- Also SQL logs in UI | |
- Open Azure Portal Homepage | |
- Search for Dedicated SQL pool | |
- Click on the Dedicated SQL Pool > Monitoring > metrice > filter DWU used - note down time | |
- Goto Query Activity and corelaetd the query executed in the above time | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node: | |
def __init__(self, value): | |
self.value = value | |
self.left = None | |
self.right = None | |
def BFS(self,root): | |
if root is None: return | |
queue = [root] | |
while queue: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Excercise for Async Multithreaded vs Normal | |
Problem : | |
1. To call 2 api | |
2. Get the response | |
3. Convert the response data into pandas Dataframe | |
RUN 1 : | |
Time take by Async multithreaded = 0.4613368511199951 |
-
Helm Chart : Package installer for kubernetes
-
Prometheus: Open-source monitoring and alerting toolkit ( A Prometheus deployment needs dedicated storage space to store scraping data)
-
Grafana : visualization, and observability in Prometheus
minikube start # minikube start --memory='12g' --cpus='4' -n 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
threading | |
1. No return | |
2. Can run seperatr function | |
concurrent.futures | |
1. Return | |
2. Only run 1 Function in 1 map | |
''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Calling Normal Function using Async Functions | |
1. to_thread | |
2. gather+to_thread | |
Calling ASync Function using Async Functions | |
1. No need of to_thread | |
2. only gather | |
''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
find max_duration, avg_duration for each CPID using Duration , round numbers to 2 deciaml places | |
ChargingEvent CPID StartDate StartTime EndDate EndTime Energy PluginDuration | |
16673806 AN11719 31/12/17 14:46:00 31/12/17 18:00:00 2.4 3.2333333333333334 | |
16670986 AN01706 31/12/17 11:25:00 31/12/17 13:14:00 6.1 1.8166666666666667 | |
3174961 AN18584 31/12/17 11:26:11 01/01/18 12:54:11 24 25.466666666666665 | |
16674334 AN00812 31/12/17 15:18:00 01/01/18 14:06:00 6.7 22.8 | |
3176831 AN24139 31/12/17 18:25:18 01/01/18 13:09:18 6.1 18.733333333333334 | |
16673920 AN03984 31/12/17 14:54:00 31/12/17 19:19:00 5.6 4.416666666666667 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
id,name,salary,boss | |
10,k,1500,50 | |
50,H,3000,10 | |
10,J,4500,20 | |
20,K,10000,NULL | |
70,J,1500,10 | |
60,Oliver,2000,70 | |
30,L,1501,50 |
NewerOlder