Skip to content

Instantly share code, notes, and snippets.

View anjalibhavan's full-sized avatar

Anjali Bhavan anjalibhavan

View GitHub Profile
@akshilshah
akshilshah / python-2.7-purge.sh
Created October 4, 2020 05:24
Remove python 2.7 from ubuntu 18.04
# Source: https://stackoverflow.com/questions/44602191/how-to-completely-uninstall-python-2-7-13-on-ubuntu-16-04
# Remove python2
sudo apt purge -y python2.7-minimal &&
sudo ln -s /usr/bin/python3 /usr/bin/python &&
sudo apt install -y python3-pip &&
sudo ln -s /usr/bin/pip3 /usr/bin/pip
@singhrahuldps
singhrahuldps / recsys.py
Last active June 1, 2019 08:05
An implementation of a basic Recommendation System built using Embedding Matrices in a Neural Net
# required libraries - numpy, pandas, pytorch
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.optim as optim
import random
# laoding the table as a pandas dataframe
ratings = pd.read_csv('ratings.csv')
@sharavsambuu
sharavsambuu / pretrained_word2vec_lstm_gen.py
Created April 17, 2018 03:50 — forked from maxim5/pretrained_word2vec_lstm_gen.py
Text generator based on LSTM model with pre-trained Word2Vec embeddings in Keras
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
__author__ = 'maxim'
import numpy as np
import gensim
import string
@wojteklu
wojteklu / clean_code.md
Last active November 16, 2024 22:03
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@sharmaeklavya2
sharmaeklavya2 / CP1.md
Last active May 10, 2023 21:26
Getting started with Competitive Programming

Starting out with Competitive Programming

(This guide is meant for beginners. If you have solved 100+ problems and are looking for guidance on how to solve problems involving algorithms and data structures, this document is not for you.)

Competitive Programming is an interesting activity which mixes problem solving with programming. It is not only enjoyable but also very demanded in placements. Competitive programming will make you very good at writing efficient programs quickly.

@karpathy
karpathy / min-char-rnn.py
Last active November 16, 2024 23:10
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)