| Models | Examples |
|---|---|
| Display ads | Yahoo! |
| Search ads |
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 re | |
| import json | |
| # save the positive words into a list called p_list | |
| with open('positive.txt') as f: | |
| p_txt = f.read() | |
| p_txt = re.sub('[,\.()":;!@#$%^&*\d]|\'s|\'', '', p_txt) | |
| p_list = p_txt.replace('\n',' ').replace(' ',' ').lower().split(' ') | |
| # test if cool is in the list | |
| print 'cool is in the postive list: ', 'cool' in p_list |
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
| require 'net/http' | |
| require 'colorize' | |
| # find all available three-letter .io domains | |
| alph = ('a'..'z') | |
| # generate all three-character strings | |
| threes = alph.map { |a| alph.map { |b| alph.map { |c| "#{a}#{b}#{c}" } } }.flatten | |
| def io_available?(tld) | |
| url = URI.parse("http://www.nic.io/cgi-bin/whois?query=#{tld}.io") |