Couldn't find the text of this for a while...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import nltk | |
| with open('sample.txt', 'r') as f: | |
| sample = f.read() | |
| sentences = nltk.sent_tokenize(sample) | |
| tokenized_sentences = [nltk.word_tokenize(sentence) for sentence in sentences] | |
| tagged_sentences = [nltk.pos_tag(sentence) for sentence in tokenized_sentences] | |
| chunked_sentences = nltk.batch_ne_chunk(tagged_sentences, binary=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Genetic Algorithmn Implementation | |
| see: | |
| http://www.obitko.com/tutorials/genetic-algorithms/ga-basic-description.php | |
| """ | |
| import random | |
| class GeneticAlgorithm(object): | |
| def __init__(self, genetics): | |
| self.genetics = genetics | |
| pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import math | |
| import Image | |
| import Levenshtein | |
| class BWImageCompare(object): | |
| """Compares two images (b/w).""" | |
| _pixel = 255 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| This content has moved to https://github.com/arachsys/motifxf/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //============================================================================ | |
| // Name : OctaneCrawler.cpp | |
| // Author : Berlin Brown (berlin dot brown at gmail.com) | |
| // Version : | |
| // Copyright : Copyright Berlin Brown 2012-2013 | |
| // License : BSD | |
| // Description : This is the simplest possible web crawler in C++ | |
| // Uses boost_regex and boost_algorithm | |
| //============================================================================ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Matthew Jee's (mcjee) solution to the Mancala challenge on the HackerRank Back-to-School Hackathon | |
| def printNextMove(player, player1Mancala, player1Marbles, player2Mancala, player2Marbles) | |
| if player == 1 | |
| mymarbles = player1Marbles | |
| opmarbles = player2Marbles | |
| else | |
| mymarbles = player2Marbles | |
| opmarbles = player1Marbles | |
| end | |
Eric Bidelman has documented some of the common workflows possible with headless Chrome over in https://developers.google.com/web/updates/2017/04/headless-chrome.
If you're looking at this in 2016 and beyond, I strongly recommend investigating real headless Chrome: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md
Windows and Mac users might find using Justin Ribeiro's Docker setup useful here while full support for these platforms is being worked out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # | |
| # Very basic example of using Python and IMAP to iterate over emails in a | |
| # gmail folder/label. This code is released into the public domain. | |
| # | |
| # RKI July 2013 | |
| # http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/ | |
| # | |
| import sys | |
| import imaplib |
Attributions:
Edward O'Campo-Gooding's list of questions.
Julia Evans' blog post "Questions I'm asking in interviews".
Thanks to @bmastenbrook, @marcprecipice, @danluu, @kelseyinnis, @zmagg, @graue, and @ircolle for awesome question suggestions (per Julia).
OlderNewer