Skip to content

Instantly share code, notes, and snippets.

View tota's full-sized avatar

TAKATSU Tomonari tota

View GitHub Profile
http://ruby-gettext.github.io/
http://d.hatena.ne.jp/shom5w/20121009/1349792207
./audio/rubyripper/Makefile:BUILD_DEPENDS= rxgettext:${PORTSDIR}/devel/rubygem-gettext \
===> Building for rubyripper-0.6.2_2
cd /usr/ports/audio/rubyripper/work/rubyripper-0.6.2 && /usr/local/bin/ruby20 configure --update-lang
ruby-gettext is not found. Translations are disabled!
@tota
tota / patch-R-quoteStockTsData.R
Created June 11, 2013 10:21
patch to RFinanceYJ 0.2.0
--- R/quoteStockTsData.R.orig 2013-06-08 14:23:35.000000000 +0900
+++ R/quoteStockTsData.R 2013-06-11 19:17:29.000000000 +0900
@@ -99,7 +99,6 @@
#convert string formart date to POSIXct object
convertToDate <- function(date.string,time.interval)
{
- date.string <- iconv(date.string,"EUC-JP","UTF-8","")
#data format is different between monthly and dialy or weekly
if(any(time.interval==c('d','w'))){
result <- gsub("^([0-9]{4})([^0-9]+)([0-9]{1,2})([^0-9]+)([0-9]{1,2})([^0-9]+)","\\1-\\3-\\5",date.string)
@tota
tota / patch-R-quoteStockTsData.R
Created June 1, 2013 19:38
- Fix the result of xmlRoot because of changing the layout in table.yahoo.co.jp
--- R/quoteStockTsData.R.orig 2011-03-24 23:34:43.000000000 +0900
+++ R/quoteStockTsData.R 2013-06-02 04:03:12.000000000 +0900
@@ -56,7 +56,7 @@
try( r <- xmlRoot(htmlTreeParse(quote.url,error=xmlErrorCumulator(immediate=F))), TRUE)
if( is.null(r) ) stop(paste("Can not access :", quote.url))
- try( quote.table <- r[[2]][[1]][[1]][[16]][[1]][[1]][[1]][[4]][[1]][[1]][[1]], TRUE )
+ try( quote.table <- r[[2]][[1]][[1]][[13]][[1]][[1]][[1]][[4]][[1]][[1]][[1]], TRUE )
#
if( is.null(quote.table) ){
@tota
tota / gist:5626967
Created May 22, 2013 11:46
- Emphasize errors in Mailman 2.1.14.j7
--- Mailman/Cgi/admin.py.orig 2011-12-11 16:56:23.000000000 +0900
+++ Mailman/Cgi/admin.py 2013-05-22 20:30:30.000000000 +0900
@@ -1436,9 +1436,13 @@
doc.AddItem('<p>')
if subscribe_errors:
if subscribe_or_invite:
- doc.AddItem(Header(5, _('Error inviting:')))
+ doc.AddItem(Header(3, Bold(FontAttr(
+ _('Error inviting:'),
+ color='#ff0000', size='+2')).Format()))
@tota
tota / BatchFile.java.patch
Created May 13, 2013 08:52
日本語を含む Windowsバッチコマンドの実行の動作がおかしい件への対応(?) (ただし,Jenkins の Test がとおらなくなる) cf. http://d.hatena.ne.jp/miau/20100929/1285768041
core/src/main/java/hudson/tasks/BatchFile.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/core/src/main/java/hudson/tasks/BatchFile.java b/core/src/main/java/hudson/tasks/BatchFile.java
index 0943e91..4f4c63a 100644
--- a/core/src/main/java/hudson/tasks/BatchFile.java
+++ b/core/src/main/java/hudson/tasks/BatchFile.java
@@ -46,7 +46,7 @@ public class BatchFile extends CommandInterpreter {
}
library(gdata)
library(quantmod)
title <- c("Date", "Open", "High", "Low", "Close", "Settlement Price", "Equivalent Rate", "Divident Equivalent", "Trading Volume", "Open Interest")
pastNKYJPY <- read.xls("http://www.tfx.co.jp/mkinfo/document/nky.xls", pattern="20101122")
thisMonthNKYJPY <- read.xls("http://www.click365.jp/cfd/data/cfdfile.xls", sheet=3)[,1:11][,-7]
thisMonthNKYJPY <- thisMonthNKYJPY[1:nrow(thisMonthNKYJPY)-1,]
thisMonthNKYJPY <- na.omit(thisMonthNKYJPY)
names(pastNKYJPY) <- title
names(thisMonthNKYJPY) <- title
@tota
tota / N225VI.R
Last active December 15, 2015 17:38
日経平均ボラティリティー・インデックスのローソク足
library(quantmod)
url <- "http://indexes.nikkei.co.jp/nkave/historical/nikkei_stock_average_vi_daily_jp.csv"
df <- read.csv(url, fileEncoding="CP932")
N225VI <- as.xts(read.zoo(df[1:nrow(df)-1,]))
dimnames(N225VI)[[2]] <- c("Close", "Open", "High", "Low")
N225VI <- OHLC(N225VI)
candleChart(N225VI)
Index: Makefile
===================================================================
--- Makefile (revision 310488)
+++ Makefile (working copy)
@@ -43,7 +43,7 @@
@${FALSE}
.endif
-post-extract:
+post-patch:
@tota
tota / porttools-0.99_7.patch
Created December 27, 2012 12:31
Switch CVS to SVN in ports/ports-mgmt/porttools
Index: Makefile
===================================================================
--- Makefile (revision 309540)
+++ Makefile (working copy)
@@ -3,7 +3,7 @@
PORTNAME= porttools
PORTVERSION= 0.99
-PORTREVISION= 6
+PORTREVISION= 7
# util_diff
# port(1) helper script to generate a diff or a shar file
#
# $Id: util_diff.in,v 1.4 2009/09/09 19:58:30 skolobov Exp $
#
# Check if this script is run via port(1)
if [ "${PORTTOOLS}" = "" ]
then
echo "This script should be run via port(1) front-end"