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
| { | |
| "estados": [ | |
| { | |
| "sigla": "AC", | |
| "nome": "Acre", | |
| "cidades": [ | |
| "Acrelândia", | |
| "Assis Brasil", | |
| "Brasiléia", | |
| "Bujari", |
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 mysql.connector | |
| from mysql.connector import Error | |
| import tweepy | |
| import json | |
| from dateutil import parser | |
| import time | |
| import os | |
| import subprocess | |
| #importing file which sets env variable |
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
| # imports | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from sklearn.linear_model import LinearRegression | |
| from sklearn.metrics import mean_squared_error, r2_score | |
| # generate random data-set | |
| np.random.seed(0) | |
| x = np.random.rand(100, 1) | |
| y = 2 + 3 * x + np.random.rand(100, 1) |
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
| library(rJava) | |
| library(coreNLP) | |
| initCoreNLP() | |
| #in this case, 'test' is a data frame with a col named 'text' | |
| for (i in 1:dim(test)[1]) { | |
| cat(paste0(i / dim(test)[1] * 100, '% completed')) | |
| ann <- annotateString(paste(test$text[i]), format = c("obj"), outputFile = NA, includeXSL = FALSE) | |
| gd <- getDependency(ann) |
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
| library(rJava) | |
| library(coreNLP) | |
| initCoreNLP() | |
| #in this case, 'test' is a data frame with a col named 'text' | |
| for (i in 1:dim(test)[1]) { | |
| cat(paste0(i / dim(test)[1] * 100, '% completed')) | |
| ann <- annotateString(paste(test$text[i]), format = c("obj"), outputFile = NA, includeXSL = FALSE) | |
| gd <- getDependency(ann) |
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
| # Proof of concept of using V8 to parse HTML in R | |
| # Example taken from rvest readme | |
| # Jeroen Ooms, 2015 | |
| library(V8) | |
| stopifnot(packageVersion("V8") >= "0.4") | |
| # Get Document | |
| html <- paste(readLines("http://www.imdb.com/title/tt1490017/"), collapse="\n") |
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
| <!DOCTYPE qgis_style> | |
| <qgis_style version="2"> | |
| <symbols> | |
| <symbol name="qartoon" force_rhr="0" clip_to_extent="1" alpha="1" type="fill"> | |
| <layer class="SimpleFill" enabled="1" locked="0" pass="0"> | |
| <prop v="3x:0,0,0,0,0,0" k="border_width_map_unit_scale"/> | |
| <prop v="0,0,0,255" k="color"/> | |
| <prop v="round" k="joinstyle"/> | |
| <prop v="1,1" k="offset"/> | |
| <prop v="3x:0,0,0,0,0,0" k="offset_map_unit_scale"/> |
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
| const URL = 'https://public.tableau.com/views/PPV_15924847800480/ppv_db?%3Aembed=y&%3AshowVizHome=no&%3Adisplay_count=y&%3Adisplay_static_image=n&%3AbootstrapWhenNotified=true&%3Alanguage=en&:embed=y&:showVizHome=n&:apiID=host0'; | |
| const puppeteer = require('puppeteer'); | |
| // Below, largely cribbed from Thomas Dondorf at https://stackoverflow.com/questions/52969381/how-can-i-capture-all-network-requests-and-full-response-data-when-loading-a-pag | |
| (async () => { | |
| const browser = await puppeteer.launch(); | |
| const [page] = await browser.pages(); |
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
| from fastcore.utils import * | |
| host = 8888,'localhost' | |
| sock = start_server(*host) | |
| print(f'Serving on {host}...') | |
| while True: | |
| conn,addr = sock.accept() | |
| with conn: | |
| data = conn.recv(1024) | |
| print(data.decode()) |
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
| ############################################################################################### | |
| ## ## | |
| ## Setup ## | |
| ## ## | |
| ############################################################################################### | |
| # install.packages("Rfacebook") # from CRAN | |
| # install.packages("Rook") # from CRAN | |
| # install.packages("igraph") # from CRAN |
OlderNewer