Escreva quase tudo no singular, é mais fácil.
- project: singular
- app: singular
- model: singular
- field: singular
- FK related_name: plural
- url: plural
- views: singular
from os import path | |
import pickle | |
from google.auth.transport.requests import Request | |
from google_auth_oauthlib.flow import InstalledAppFlow | |
from googleapiclient.discovery import build | |
# IF YOU MODIFY THE SCOPE DELETE THE TOKEN.TXT FILE | |
SCOPES = ['https://www.googleapis.com/auth/calendar.events', | |
'https://www.googleapis.com/auth/calendar'] |
Escreva quase tudo no singular, é mais fácil.
# data from http://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/population-distribution-demography/geostat | |
# Originally seen at http://spatial.ly/2014/08/population-lines/ | |
# So, this blew up on both Reddit and Twitter. Two bugs fixed (southern Spain was a mess, | |
# and some countries where missing -- measure twice, submit once, damnit), and two silly superflous lines removed after | |
# @hadleywickham pointed that out. Also, switched from geom_segment to geom_line. | |
# The result of the code below can be seen at http://imgur.com/ob8c8ph | |
library(tidyverse) |
library(XML) | |
library(tm) | |
library(SnowballC) | |
library(wordcloud) | |
url <- "http://jota.uol.com.br/o-discurso-de-dilma-rousseff-no-julgamento-impeachment-no-senado" | |
pagina <- xmlRoot(htmlParse(readLines(url))) | |
texto_paragrafos <- xpathSApply(pagina, "//div[@class = 'first-letter']/p", xmlValue) | |
texto <- c() | |
for (i in 1:length(texto_paragrafos)){ |
People
:bowtie: |
😄 :smile: |
😆 :laughing: |
---|---|---|
😊 :blush: |
😃 :smiley: |
:relaxed: |
😏 :smirk: |
😍 :heart_eyes: |
😘 :kissing_heart: |
😚 :kissing_closed_eyes: |
😳 :flushed: |
😌 :relieved: |
😆 :satisfied: |
😁 :grin: |
😉 :wink: |
😜 :stuck_out_tongue_winking_eye: |
😝 :stuck_out_tongue_closed_eyes: |
😀 :grinning: |
😗 :kissing: |
😙 :kissing_smiling_eyes: |
😛 :stuck_out_tongue: |
## Helper file to geocode address using Google Geocoder | |
import urllib, urllib2, simplejson | |
from django.utils.encoding import smart_str | |
def get_lat_lng(location): | |
# Reference: http://djangosnippets.org/snippets/293/ | |
location = urllib.quote_plus(smart_str(location)) |
#!/bin/bash | |
#geocode a CSV file using both Google and Yahoo! APIs, send output to either KMl or ESRI Shapefile | |
# example Yahoo geocode request: http://where.yahooapis.com/geocode?q=950+main+street,+Worcester,+ma&appid=[yourappidhere] | |
# example Google geocode request: http://maps.googleapis.com/maps/api/geocode/xml?address=950+main+st,+worcester,+MA&sensor=true | |
# get working directory | |
WORKING_DIR=`pwd` |