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
#!/bin/bash | |
#title :wildfly-install.sh | |
#description :The script to install Wildfly 8.x | |
#more :http://sukharevd.net/wildfly-8-installation.html | |
#author :Dmitriy Sukharev | |
#date :20141129 | |
#usage :/bin/bash wildfly-install.sh | |
WILDFLY_VERSION=8.2.0.Final | |
WILDFLY_FILENAME=wildfly-$WILDFLY_VERSION |
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
otoshidama <- function(x) { | |
rank <- c("一等?", "二等?", "三等!", "三等!", "外れ") | |
tosen <- c(97085, 2344, 72, 74) | |
result <- NULL | |
for (i in x) { | |
tmp <- grep(sprintf(".*%s$", i), tosen) | |
tmp <- ifelse(length(tmp) == 0, 5, tmp) | |
result <- c(result, tmp) | |
} | |
cat("当選番号:", tosen, fill=TRUE) |
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) | |
t1 <- as.table(Titanic[1:3,,2,2]) | |
fortify.table <- function(model, ...) { | |
data <- reshape2::melt(model) | |
return(data) | |
} | |
p1 <- ggplot(data=t1) |
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
(n <- 1.4 * 45) | |
#=> [1] 63 | |
(n <- n %% 6) | |
#=> [1] 3 | |
as.character(n) | |
#=> [1] "2.99999999999999" | |
as.integer(n) | |
#=> [1] 2 | |
as.integer(round(n)) | |
#=> [1] 3 |
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
setRefClass("TextImporter", | |
fields = c("widget", "win", "filepath", "data"), | |
methods = list( | |
initialize = function(...) { | |
initFields(...) | |
data <<- NULL | |
if(class(win)[[1]] == "uninitializedField") { | |
win <<- NULL | |
} | |
encode.label <- gtkLabelNew(gettext("Character code")) |
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
legend2 <- legend | |
body(legend2)[[49]] <- quote( | |
invisible(list(rect = list(w = w, h = h, left = left, top = top), | |
text = list(x = xt, y = yt), points = list(x = x1, y = y1))) | |
) | |
plot(-100:100, -100:100, type = "b") | |
myLegend <- legend2(1, .8, bty = 'n', c('sugar','citrus','none'), pch = 21, | |
pt.bg = 'white', pt.lwd = 0, lty = c(1, 2, 3), lwd = 1.5, title = "Condition", |
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("XLConnect") | |
library("RSQLite") | |
table1 <- readNamedRegionFromFile("tables.xlsx", "table1") | |
driver <- dbDriver("SQLite") | |
conn <- dbConnect(driver, dbname = "foo.sqlite3") | |
dbWriteTable(conn, "table1", table1, row.names=FALSE) | |
dbDisconnect(conn) |
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
theme_JPR <- function(base_size = 12, base_family = ""){ | |
theme( | |
line = element_line(colour = "black", size = 0.5, linetype = "solid", lineend = "butt"), | |
rect = element_rect(fill = "white", colour = "black", size = 0.5, linetype = "solid"), | |
text = element_text(family = base_family, face = "plain", colour = "black", size = base_size, hjust = 0.5, vjust = 0.5, angle = 0, lineheight = 0.9), | |
axis.title.x = element_text(vjust = 0), | |
axis.title.y = element_text(vjust = 0, angle = 90), | |
axis.text = element_text(size = rel(1)), | |
axis.text.x = element_text(vjust = 1), | |
axis.text.y = element_text(hjust = 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
library(shiny) | |
library(RFinanceYJ) | |
library(quantmod) | |
shinyServer(function(input, output) { | |
output$plot <- reactivePlot(function() { | |
data <- quoteStockXtsData(sprintf("%s.t", input$code), | |
since=input$since, | |
date.end=input$date.end, |
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) | |
shinyUI(pageWithSidebar( | |
headerPanel("株価"), | |
sidebarPanel( | |
numericInput("code", "code:", 6758), | |
textInput("since", "since:", as.character(Sys.Date()-60)), | |
textInput("date.end", "date.end:", as.character(Sys.Date())), |
NewerOlder