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
info = data[0].select('.//tr//td/text()').extract() | |
# Sukunimi ja etunimi on erotettu pilkulla, erottele nimet | |
names = info[0].split(',') | |
# Poistetaan välilyönnit nimistä | |
names = [name.strip() for name in names] |
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
puolue = Field() | |
puolue_lyh = Field() | |
etunimi = Field() | |
sukunimi = Field() | |
ammatti = Field() | |
kunta = Field() | |
vaalipiiri = Field() | |
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
# Author: Joona Lehtomäki <[email protected]> | |
# Updated: 13.11.2011 | |
# Version: 0.0.1 | |
if (!require("rgdal")) { | |
install.packages("rgdal") | |
} | |
if (!require("raster")) { | |
install.packages("raster") |
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
# Create some data | |
# Notice that all data is bound to specific range, you will have to adjust the | |
# polygon coordinates, the empty plot xlim/ylim and ablines according to your | |
# real data | |
# Polygon xy coordinates | |
x1 <- c(0, 2, 2, 0) | |
y1 <- c(2, 2, 0, 0) |
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
require(stringr) | |
#A helper function to remove @ symbols from user names... | |
trim <- function (x) sub('@','',x) | |
twapperkeeperCSVParse=function(fp){ | |
df = read.csv(fp, header=F) | |
df$from=sapply(df$V1,function(tweet) str_extract(tweet,"^([[:alnum:]_]*)")) | |
df$id=sapply(df$V1,function(tweet) str_extract(tweet,"[[:digit:]/s]*$")) | |
df$txt=sapply(df$V1,function(tweet) str_trim(str_replace(str_sub(str_replace(tweet,'- tweet id [[:digit:]/s]*$',''),end=-35),"^([[:alnum:]_]*:)",''))) |
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) | |
data <- data.frame('Puolue'=factor(c('A', 'B', 'C')), | |
'Kannatus'=c(4, 6, 8)) | |
p <- ggplot(data, aes(fill=Puolue, y=Kannatus, x=rev(Puolue))) | |
p + geom_bar(stat="identity") + | |
scale_x_discrete(breaks=data$Puolue, labels=rev(data$Puolue)) + coord_flip() |
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/python | |
# coding=utf-8 | |
from optparse import OptionParser | |
import os | |
import shutil | |
import sys | |
# Install GitPython (tested with 0.3.2.RC1) | |
# > easy_install GitPython |
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(reshape) | |
pop <- c("P","P","M","M") | |
C <- c(5,3,6,2) | |
Pr <- c(6,5,1,4) | |
Fr <- c(4,5,1,1) | |
Gr <- c(9,4,2,8) | |
mydata <- data.frame(pop=pop, C=C, Pr=Pr, Fr=Fr, Gr=Gr) | |
mdata <- melt(mydata, id=c("pop")) |
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 | |
# This goes to GIT_ROOT/.git/hooks | |
import os | |
import shutil | |
import sys | |
from ConfigParser import NoSectionError | |
try: |
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
[core] | |
repositoryformatversion = 0 | |
filemode = true | |
bare = false | |
logallrefupdates = true | |
[remote "origin"] | |
fetch = +refs/heads/*:refs/remotes/origin/* | |
url = [email protected]:louhos/soRvi-dev.git | |
[branch "master"] | |
remote = origin |
OlderNewer