Skip to content

Instantly share code, notes, and snippets.

View sagarkar10's full-sized avatar
:octocat:
Data Science and Machine Learning Enthusiast

Sagar Kar sagarkar10

:octocat:
Data Science and Machine Learning Enthusiast
View GitHub Profile
@sagarkar10
sagarkar10 / MultiThreadingVsMultiProcessing.py
Created July 14, 2019 18:10
Comparison between Python MultiProcessing and MultiThreading
import os
import math
import time
import sys
from multiprocessing import Process
from threading import Thread
from multiprocessing.pool import ThreadPool as TPool
from multiprocessing import Pool as MPool
from loguru import logger
@sagarkar10
sagarkar10 / Jupyterlab-code-snippets.py
Created July 5, 2019 12:27
This gist is to hold my frequently used code snippets and load them directly into my notebook
# use black extension for each cell execution automatically
# msut have nb_black and black installed
# just run this magic in the first line of the code
%load_ext nb_balck
# show all output from the running cell
# available options : 'all', 'last', 'last_expr', 'none', 'last_expr_or_assign'
# default: 'last_expr'
from IPython.core.interactiveshell import InteractiveShell
@sagarkar10
sagarkar10 / preprocessor_fun.h
Created December 17, 2016 15:05 — forked from aras-p/preprocessor_fun.h
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,