Skip to content

Instantly share code, notes, and snippets.

View automactic's full-sized avatar

ChrisLi automactic

View GitHub Profile
@dineshviswanath
dineshviswanath / python_web_dev_flask_environment_setup.md
Last active July 19, 2024 19:55
How to install python and Flask on Mac OS X

#Starting Python Web development in Mac OS X#

Objective: Getting started with Python Development Operating System: Mac OS X Python version installed: 3.5 (5th December 2015)

Downoad the lastest Python from https://www.python.org/downloads/

var fetchedResultsProcessingOperations: [NSBlockOperation] = []
private func addFetchedResultsProcessingBlock(processingBlock:(Void)->Void) {
fetchedResultsProcessingOperations.append(NSBlockOperation(block: processingBlock))
}
func controller(controller: NSFetchedResultsController, didChangeObject anObject: AnyObject, atIndexPath indexPath: NSIndexPath?, forChangeType type: NSFetchedResultsChangeType, newIndexPath: NSIndexPath?) {
switch type {
case .Insert:
@ameyavilankar
ameyavilankar / preprocess.py
Last active January 25, 2023 10:19
Removing Punctuation and Stop Words nltk
import string
import nltk
from nltk.tokenize import RegexpTokenizer
from nltk.corpus import stopwords
import re
def preprocess(sentence):
sentence = sentence.lower()
tokenizer = RegexpTokenizer(r'\w+')
tokens = tokenizer.tokenize(sentence)