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
SELECT user.user_id,user.user_touched,user.user_registration, user.user_editcount,user_properties.up_value,user_rights.ur_rights,MAX(revision.rev_timestamp) FROM user_properties LEFT JOIN user ON user.user_id = user_properties.up_user LEFT JOIN user_rights ON user.user_id = user_rights.ur_user INNER JOIN revision ON user.user_id = revision.rev_user WHERE user_properties.up_property = 'gender' AND user.properties.up_value IS NOT NULL |
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
mysql -u research -h db67.pmtpa.wmnet -p enwiki -e "SELECT | |
user.user_id, | |
MAX(revision.rev_timestamp), | |
user.user_touched, | |
user.user_registration, | |
user.user_editcount, | |
user_properties.up_value, | |
user_rights.ur_rights FROM | |
(((user_properties LEFT JOIN user ON user.user_id = user_properties.up_user) LEFT JOIN user_rights ON user.user_id = user_rights.ur_user) INNER JOIN revision ON user.user_id = revision.rev_user) WHERE user_properties.up_property = 'gender' AND user_properties.up_value IS NOT NULL" > gendergap.tsv |
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
SELECT recentchanges.rc_user, | |
(CASE WHEN user_properties.up_value IN (1,'nostalgia') THEN 'nostalgia' | |
WHEN user_properties.up_value IN (2,'cologneblue') THEN 'cologneblue' | |
WHEN user_properties.up_value = 'myskin' THEN 'myskin' | |
WHEN user_properties.up_value = 'simple' THEN 'simple' | |
WHEN user_properties.up_value = 'standard' THEN 'standard' | |
WHEN user_properties.up_value = 'modern' THEN 'modern' | |
WHEN user_properties.up_value = 'monobook' THEN 'monobook' | |
WHEN user_properties.up_value = 'chick' THEN 'chick' | |
ELSE 'vector' END) AS skin |
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
SELECT recentchanges.rc_user AS revs, | |
(CASE WHEN user_properties.up_value IN (1,'nostalgia') THEN 'nostalgia' | |
WHEN user_properties.up_value IN (2,'cologneblue') THEN 'cologneblue' | |
WHEN user_properties.up_value = 'myskin' THEN 'myskin' | |
WHEN user_properties.up_value = 'simple' THEN 'simple' | |
WHEN user_properties.up_value = 'standard' THEN 'standard' | |
WHEN user_properties.up_value = 'modern' THEN 'modern' | |
WHEN user_properties.up_value = 'monobook' THEN 'monobook' | |
WHEN user_properties.up_value = 'chick' THEN 'chick' | |
ELSE 'vector' END) AS skin |
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
entropy.df <- subset( | |
tickets.df[ | |
1:nrow( | |
tickets.df | |
) | |
%in% which( | |
outer( | |
subset( | |
tickets.df, | |
period == "hadean" |
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
rc.df <- read.delim (file.path(getwd(), "Vpocalypse", "RecentChanges", "recentchanges.tsv"), header = TRUE, na.strings='NULL', as.is = TRUE, colClasses=c("user_editcount"="numeric")) | |
test <- grep( | |
pattern = " | |
(^revert\ to.+using) | |
| (^reverted\ edits\ by.+using) | |
| (^reverted\ edits\ by.+to\ last\ version\ by) | |
| (^bot\ -\ rv.+to\ last\ version\ by) | |
| (-assisted\ reversion) | |
| (^(revert(ed)?|rv).+to\ last) |
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
data.fun <- function(db67p) { | |
if (exists("db67p"==TRUE){ | |
dbh <- "MySQL" | |
db67 <- "db67.pmtpa.wmnet" | |
db67u <- "research" | |
db67db <- "enwiki" | |
return(dbh) | |
} else { | |
print("you need a password, jackass") | |
} |
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
SELECT | |
substring(revision.rev_timestamp,1,8) AS rev_timestamp, | |
revision.rev_comment AS reason, | |
revision.rev_sha1 as sha | |
FROM revision | |
WHERE revision.rev_timestamp > 20130609235959; |
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
SELECT COUNT( | |
SELECT COUNT(*) AS edits, | |
substring(rev_timestamp,1,6) AS month, | |
rev_user AS user | |
FROM revision | |
WHERE rev_user > 0 | |
GROUP BY substring(rev_timestamp,1,6),rev_user | |
HAVING edits >= 5) | |
GROUP BY month |
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
#Data on registrations | |
registrations.fun <- function(x, graphname, filename){ | |
#Aggregate | |
aggregate.data <- as.data.frame( | |
table(x$registration_date | |
) | |
) | |
#Plot registrations |
OlderNewer