Skip to content

Instantly share code, notes, and snippets.

View manojpandey's full-sized avatar
🎯
Focusing

Manoj Pandey manojpandey

🎯
Focusing
View GitHub Profile
@manojpandey
manojpandey / opencv-install.sh
Created June 11, 2016 17:59
Install OpenCV in Ubuntu
# Install script for opencv
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y cmake
sudo apt-get install -y libgtk2.0-dev
sudo apt-get install -y pkg-config
sudo apt-get install -y python-numpy python-dev
sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install -y libjpeg-dev libpng-dev libtiff-dev libjasper-dev
@manojpandey
manojpandey / gotchas.md
Last active August 31, 2021 14:52
Attack of Pythons

Attack of Pythons

Among computer programmers, a “gotcha” has become a term for a feature of a programming language that is likely to play tricks on you to display behavior that is different than what you expect.

Just as a fly or a mosquito can “bite” you, we say that a gotcha can “bite” you. So, let's proceed to examine some of Python's gotchas !

alt text


#List unique values in a DataFrame column
pd.unique(df.column_name.ravel())
#Convert Series datatype to numeric, getting rid of any non-numeric values
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True)
#Grab DataFrame rows where column has certain values
valuelist = ['value1', 'value2', 'value3']
df = df[df.column.isin(value_list)]
@manojpandey
manojpandey / delete_all_archives.rb
Created August 1, 2016 20:01
Delete all archives in an Amazon Glacier Vault
#!/usr/bin/env ruby
require 'aws-sdk'
require 'json'
# add credentials here
akid = ""
secret_key = ""
Aws.config.update({
@manojpandey
manojpandey / rgb2lab.py
Created August 12, 2016 10:34
RGB to CIELab color space conversion
# RGB to Lab conversion
# Step 1: RGB to XYZ
# http://www.easyrgb.com/index.php?X=MATH&H=02#text2
# Step 2: XYZ to Lab
# http://www.easyrgb.com/index.php?X=MATH&H=07#text7
def rgb2lab(inputColor):
@manojpandey
manojpandey / marks.txt
Last active August 4, 2017 23:10
my semester results with some statistics
## 1st Sem
Percentage= 74.69%
Total Credits Secured= 27
Credit Percentage= 71.74%
Marks Obtained= 971/1300
College Rank= 99
University Rank= 278
## 2nd Sem
Percentage= 69.58%
@manojpandey
manojpandey / hello_world.md
Created October 24, 2016 10:59 — forked from lava/hello_world.md
Hello, world: Analyzing a program to death.

Hello, world!

Please explain in detail what will happen if the following program is executed:

#include <iostream>

int main() {
    std::cout << "Hello, world!" << std::endl;
}
@manojpandey
manojpandey / devup_ama_notes_jalem_raj_rohit
Created October 24, 2016 11:00 — forked from sudhirkhanger/devup_ama_notes_jalem_raj_rohit
Notes from Jalem Raj Rohit AMA on devup.in
Competitions:-
https://www.kaggle.com/
https://www.hackerearth.com/
Books:-
Introduction to Algorithms By Thomas H Cormen
Pattern Recognition and Machine Learning By Christopher M. Bishop
Freakonomics By Steven D. Levitt and Stephen J. Dubner
@manojpandey
manojpandey / The Technical Interview Cheat Sheet.md
Created October 24, 2016 11:01 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@manojpandey
manojpandey / gotchas.ipynb
Last active August 11, 2017 23:23
PyCon Korea 2017 - Manoj Pandey (Attack of Pythons: Gotchas and Landmines in Python)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.