Skip to content

Instantly share code, notes, and snippets.

View NISH1001's full-sized avatar
💭
Staring into the abyss...

Nish NISH1001

💭
Staring into the abyss...
View GitHub Profile
@NISH1001
NISH1001 / determinant.c
Created March 10, 2018 14:56
Find determinant of a NxN matrix (square matrix)
#include <stdio.h>
#include <stdlib.h>
/* 1 2 3 5
3 4 5 6
6 7 8 7
2 3 4 5
*/
int deterstandard(const int order,int **matrix)
{
int i,j,k,val=0;
@NISH1001
NISH1001 / create_dataset.py
Created February 16, 2018 15:13
create dataset
import os
import cv2
from shutil import copyfile
from random import randint,shuffle
import string
def create_dir(path):
if not os.path.exists(path):
os.makedirs(path)
@NISH1001
NISH1001 / api.py
Last active February 13, 2018 09:57
api
"""
Required modules/libraries:
- falcon
- falcon-cors
- falcon-multipart
- gunicorn
TO run the api:
gunicorn -b ip:port api:app
@NISH1001
NISH1001 / gwget
Created February 5, 2018 10:26
wget file from google drive
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILE_ID' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=FILE_ID" -O FILENAME && rm -rf /tmp/cookies.txt
@NISH1001
NISH1001 / paradoxicalencoder.py
Last active February 1, 2018 11:37
paradoxicalencoder.py
class ParadoxicalEncoder:
def __init__(self):
self.classes = set()
self.encodings = {}
def _updte_encodings(self, label):
try:
enc = self.encodings[label]
except KeyError:
self.encodings[label] = len(self.encodings)+1

Start Zookeeper Server

bin/zookeeper-server-start.sh config/zookeeper.properties 

Start Kafka Server

bin/kafka-server-start.sh config/server.properties
@NISH1001
NISH1001 / spark-tutorial-links
Last active November 23, 2017 10:32
Spark tutorials found in Github
@NISH1001
NISH1001 / SalesforceBulkAPIClient.java
Created October 6, 2017 06:36
bulk api for salesforce
package salesforceintegration.salesforce.salesforceclient;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.http.HttpEntity;
import org.apache.http.ParseException;
import org.apache.http.client.methods.CloseableHttpResponse;
@NISH1001
NISH1001 / sudokusolver.cpp
Created July 6, 2017 03:22
Solve sudoku using backtracking
#include <iostream>
#include <vector>
#include <cmath>
//just for unassigned location
enum
{
UNASSIGNED = 0,
};