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
{ | |
"details": { | |
"name": "Create user API", | |
"description": "Creates user", | |
"creation_date": "21/01/2019", | |
"author": "SS Chakraborty" | |
}, | |
"specification": { | |
"method": "GET/POST/PUT/DELETE", | |
"path": "/some/path/with/:pathParam/:pathParam/or/without/params", |
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
Setting up Spring Framework with Maven | |
Required dependencies are: | |
Log4j | |
jUnit | |
spring-webmvc | |
spring-jdbc | |
jackson-databind | |
javax.servlet-api | |
Components from architectural viewpoint |
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 Fenwick: | |
def __init__(self, size): | |
self.size = size | |
self.array = [0] * size | |
def add(self, index, value): | |
while index >= 1 and index <= self.size: | |
self.array[index - 1] += value | |
index += (index & -index) | |
def get(self, index): | |
s = 0 |
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
import java.io.IOException; | |
import java.io.PrintWriter; | |
import java.io.OutputStreamWriter; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.ThreadPoolExecutor; | |
/* | |
* SAMPLE OUTPUT | |
* Parallel Multiplication: 19648 millisecs | |
* Naive Multiplication: 45219 millisecs |
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
1) Extract Hadoop as hadoop-2.9.1 | |
2) Extract Hive inside Hadoop Directory | |
3) Set JAVA_HOME to JDK installation folder | |
4) Set HADOOP_HOME to hadoop extracted directory | |
5) Set HIVE_HOME to hive extracted directory | |
6) Add $HIVE_HOME/bin to PATH env var | |
7) Verify MySQL installation | |
8) Create hive-site.xml inside $HIVE_HOME/conf directory and put contents as given below | |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
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
Introduction to DBMS | |
Data / DBMS | |
DBA / Database Designer / End User | |
Data Abstraction | |
Advantages of DBMS | |
Architecture of DBMS | |
Schemas (Descriptions) | |
Physical / Internal | |
Logical / Conceptual |
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
#include <stdio.h> | |
#include <sys/types.h> | |
#define BIT_STRING int32_t | |
int horizontal_parity(BIT_STRING b) { | |
int p = 0; | |
while(b > 0) { | |
p ^= (b & 0x1); | |
b >>= 1; |
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
#include <stdio.h> | |
#include <sys/types.h> | |
#define BIT_STRING int32_t | |
int main(int argc, char** argv) { | |
BIT_STRING b; | |
fscanf(stdin, "%d", &b); | |
// The logic for parity checking |
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
// This is a very trivial implementation of | |
// Banker's algorithm | |
// Refer to https://www.geeksforgeeks.org/operating-system-bankers-algorithm/ | |
import java.io.PrintWriter; | |
import java.io.OutputStreamWriter; | |
public class Banker { | |
/* | |
* The below function takes in the max and allocation |
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
public class PriorityQueue { | |
private static class MaxHeap { | |
private int size; | |
private Long[] array; | |
public MaxHeap(int size) { | |
this.size = 0; | |
this.array = new Long[size]; | |
} | |
NewerOlder