Skip to content

Instantly share code, notes, and snippets.

View abdul-rehman-2050's full-sized avatar
🎯
Focusing

Abdul Rehman abdul-rehman-2050

🎯
Focusing
View GitHub Profile
@abdul-rehman-2050
abdul-rehman-2050 / bag-of-word-vectors.py
Created October 6, 2019 14:22 — forked from edubey/bag-of-word-vectors.py
Code to generate bag of word vectors in Python
# import statments
import numpy
import re
'''
Tokenize each the sentences, example
Input : "John likes to watch movies. Mary likes movies too"
Ouput : "John","likes","to","watch","movies","Mary","likes","movies","too"
'''
def tokenize(sentences):
@abdul-rehman-2050
abdul-rehman-2050 / Raspberry Pi Ultrasonic HC-SR04
Created January 12, 2018 16:56
Raspberry Pi Lesson: Ultrasonic HC-SR04
import RPi.GPIO as GPIO
import time
TRIG = 24
ECHO = 23
GPIO.setmode(GPIO.BCM)
GPIO.setup(TRIG,GPIO.OUT)
GPIO.setup(ECHO,GPIO.IN)
package pl.kpob.utils.extensions
import android.app.Activity
import android.content.Context
import android.graphics.Color
import android.support.v4.content.ContextCompat
import android.view.WindowManager
import flow.Flow
import org.jetbrains.anko.AlertDialogBuilder
import pl.sisms.gminformix.utils.extensions.supportsLollipop
@abdul-rehman-2050
abdul-rehman-2050 / classify.py
Created April 19, 2016 03:28 — forked from yosemitebandit/classify.py
OCR with OpenCV - KNN methods from Abid Rahman
''' classify
after training, classify a sample image with K-Nearest Neighbor
annotated from Abid Rahman's post: http://stackoverflow.com/a/9620295/232638
'''
import cv2
import numpy as np
# load the data we generated previously
samples = np.loadtxt('general-samples.data', np.float32)