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
| %% Alexander Napper | |
| clear all; | |
| clc; | |
| MIN_CHOICE = 15; % Really shouldn't hard code | |
| load Water_Data; | |
| choices_ = Water_Data.Properties.VarNames(3:end); | |
| choices_betternames = {'Freshwater suppled (million cubic meters)', 'Yearly precipitation (million cubic meters)', 'Renewable fresh water (million cuic meters)', 'Population percent with water', 'Population percent connected to waste water collection', 'Population percent conneted to water treatment'}; | |
| assert(length(choices_) == length(choices_betternames)); | |
| choice = menu('Data choices:', choices_betternames); |
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 praw | |
| r = praw.Reddit('Counting gilded/1.0') | |
| sub = r.get_submission(submission_id='28j8cz') | |
| sub.replace_more_comments(limit=None, threshold=0) | |
| sub = praw.helpers.flatten_tree(sub.comments) | |
| count = 0 | |
| for comment in sub: | |
| count += comment.gilded |