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 pymongo import Connection | |
import datetime | |
setPath="ec2-54-248-156-148.ap-northeast-1.compute.amazonaws.com" | |
setDBS="ehanlin_103_jhs_db" | |
conn=Connection(setPath,27017) | |
db = conn[setDBS] |
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
rm(list=ls()) | |
tic<-Sys.time() | |
############################################################################ | |
setDate<-"20150430" | |
############################################################################ |
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
library(shiny) | |
library(rJava) | |
if (!require('Rwordseg')) { | |
install.packages("Rwordseg",repos = 'http://R-Forge.R-project.org') | |
} | |
library(Rwordseg) | |
if (!require('tm')) { | |
install.packages('tm') | |
} | |
library(tm) |
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
rm(list=ls(all=TRUE)) | |
library(rJava) | |
library(Rwordseg) | |
library(tm) | |
library(tmcn) | |
library(wordcloud) | |
library(XML) | |
library(RCurl) | |
library(googlesheets) |
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
library(shiny) | |
library(dplyr) | |
library(rmongodb) | |
library(googleVis) | |
library(rPython) | |
sethost<-"" | |
setdb_platform<-"" | |
setdb_exam<-"" | |
setdb_sim<-"" |
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
library(shiny) | |
library(dplyr) | |
library(rmongodb) | |
library(googleVis) | |
sethost<-"" | |
setdb_platform<-"" | |
setdb_103exam<-"" | |
setdb_102exam<-"" | |
setdbUser<-"" |
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
library(ggplot2) | |
library(maptools) | |
library(xlsx) | |
countyDat<-data.frame(Eng=c("Taipei","Taipei City","Taoyuan","Taichung","Taichung City","Tainan", | |
"Tainan City","Kaohsiung","Kaohsiung City","Ilan","Hsinchu","Miaoli", | |
"Changhwa","Nantou","Yunlin","Chiayi","Pingtung","Taitung","Hualien", | |
"Penghu","Keelung City","Hsinchu","Chiayi","Kinmen","Lienchiang" | |
), |
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
rm(list=ls()) | |
library(rvest) | |
webwiki <- html("https://zh.wikipedia.org/wiki/%E8%87%BA%E7%81%A3%E8%A1%8C%E6%94%BF%E5%8D%80%E4%BA%BA%E5%8F%A3%E5%88%97%E8%A1%A8") | |
population <- webwiki %>% | |
html_nodes("#bodyContent table") %>% | |
html_table() | |
#View(population[[1]]) |
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
import numpy as np | |
import pandas as pd | |
import string , random | |
def randomword(length): | |
return ''.join(random.choice(string.uppercase[0:5]) for i in range(length)) | |
df1 = pd.DataFrame(list(randomword(50)),columns=['user']) | |
df2 = pd.DataFrame(np.random.randint(100, size=(50,2)),columns=['G1','G2']) |
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
rm(list=ls()) | |
library(mongolite) | |
setAWSPath <- "ec2-54-238-68-224.ap-northeast-1.compute.amazonaws.com" | |
setDate <- c("") | |
m<-mongo(db = "ehanlin_104", | |
collection = "ExamAnswer", |
OlderNewer