This file contains 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
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
This file contains 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
/* | |
Read the problem statement from here: https://www.spoj.com/problems/AGGRCOW/ | |
*/ | |
#include<bits/stdc++.h> | |
using namespace std; | |
bool isPossible(int arr[], int n, int interval, int C){ | |
C--; | |
int start = arr[0]; |
This file contains 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
/* | |
Given two words Word1 and Word2 find minimum number of operations required to convert Word1 to Word2. | |
You have the following 3 operations permitted on a word: | |
Insert a character | |
Delete a character | |
Replace a character | |
*/ | |
// minimum of three numbers | |
int min(int x, int y, int z) |
/*
===================== GCD (GREATEST COMMON DIVISOR) =====================
FINDING THE GREATEST COMMON DIVISOR EFFICIENTLY USING EUCLID'S FORMULA.
GCD(a,b) = GCD(b, a%b)
*/
int GCD (int a, int b){
Typescript is basically the superset of Javascript which gives (Classes, Interfaces, Types etc.). It is strongly typed language. It cannot be run in the browser, it gets compiled to javascript.
Angular serves the index.html page as the single page for the project
- Null Safety
- Safe Call Operator ( ?. )
- Elvis operator ( ?: )
- Not-null assertion operator ( !! )
A variable that doesn't refers to anything, refers to null. Null is a keyword to allow a variable refer to nothing or to check if it exists (comparison can be done with == or !=)
Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.
NOTE: This logic can be extended to more than two accounts also. :)
The setup can be done in 5 easy steps: