Skip to content

Instantly share code, notes, and snippets.

@abicky
abicky / anything-R.el.patch
Created April 15, 2012 10:43
patch for anything-R.el
--- anything-R.el.orig 2012-04-15 18:44:10.000000000 +0900
+++ anything-R.el 2012-04-15 19:41:11.000000000 +0900
@@ -44,43 +44,76 @@
(require 'anything)
(require 'ess-site)
+(defvar anything-R-default-limit
+ anything-candidate-number-limit)
+
+(defvar anything-R-help-limit
@abicky
abicky / ess-r-d.el.patch
Created April 15, 2012 10:05
patch for ess-r-d.el (ESS 12.0.4)
--- ess-r-d.el.orig 2012-04-06 08:02:29.000000000 +0900
+++ ess-r-d.el 2012-04-14 22:20:21.000000000 +0900
@@ -511,10 +511,15 @@
(when (and ess-current-process-name
(get-process ess-current-process-name)
(not (ess-process-get 'busy)))
- (let* ((funname (or (and ess-eldoc-show-on-symbol ;; aggressive completion
- (ess-get-object-at-point))
- (car (ess--funname.start))))
- (doc (cadr (ess-function-arguments funname))))
@abicky
abicky / cumsum.pl
Created January 14, 2012 13:22
output the cumulative sum of the input data
#!/usr/bin/env perl
use strict;
use warnings;
use Getopt::Long;
my (@keys, @values, $HELP, $TEST);
GetOptions('keys=i{,}' => \@keys, 'values=i{,}' => \@values, 'help' => \$HELP, 'test' => \$TEST);
sub usage {
print STDERR <<USAGE;
usage: $0 --keys key_fields --values value_fields
@abicky
abicky / Runit
Last active September 29, 2015 09:28
command line tool for RUnit, which is a unit test framework for R
#!/usr/bin/env Rscript
#---------------------------------------------------------------------------
# command line tool for RUnit, which is a unit test framework for R
#
# Copyright 2012- Takeshi Arabiki
# License: MIT License (http://opensource.org/licenses/MIT)
#
# See also: http://d.hatena.ne.jp/a_bicky/20120109/1326074730 [in Japanese]
#---------------------------------------------------------------------------
@abicky
abicky / RJSONIO_0.96-0.patch
Created January 3, 2012 19:09
patch for RJSONIO_0.96-0
diff -cr RJSONIO.orig/src/libjson/JSONOptions.h RJSONIO/src/libjson/JSONOptions.h
*** RJSONIO.orig/src/libjson/JSONOptions.h 2011-10-23 02:00:32.000000000 +0900
--- RJSONIO/src/libjson/JSONOptions.h 2012-01-05 01:54:00.000000000 +0900
***************
*** 79,85 ****
* means that libjson supports the full array of unicode characters, but also takes
* much more memory and processing power.
*/
! //#define JSON_UNICODE
@abicky
abicky / twitteR.patch
Created November 19, 2011 14:23
patch for twitteR package
diff -cr twitteR.orig/R/base.R twitteR/R/base.R
*** twitteR.orig/R/base.R 2011-11-09 07:15:21.000000000 +0900
--- twitteR/R/base.R 2011-11-19 23:29:19.000000000 +0900
***************
*** 1,7 ****
setRefClass('twitterObj',
contains='VIRTUAL',
methods = list(
! toDataFrame = function(row.names=NULL, optional=FALSE) {
fields <- names(.self$getRefClass()$fields())
@abicky
abicky / ROAuth.patch
Created November 19, 2011 14:23
patch for ROAuth package
diff -cr ROAuth.orig/R/ROauth.R ROAuth/R/ROauth.R
*** ROAuth.orig/R/ROauth.R 2011-06-03 13:10:28.000000000 +0900
--- ROAuth/R/ROauth.R 2011-11-19 19:13:36.000000000 +0900
***************
*** 128,146 ****
auth <- signRequest(url, params, consumerKey, consumerSecret,
oauthKey=oauthKey, oauthSecret=oauthSecret,
httpMethod="POST", signMethod=signMethod)
opts <- list(...)
-brief
-cat
-chgrp
-chmod
-chown
-copyFromLocal
-copyToLocal
-count
-cp
-dot
test.parseSpec <- function() {
checkEquals(c(hoge = "l"), parseSpec("hoge"))
checkEquals(c(hoge = "!"), parseSpec("hoge!"))
checkEquals(c(hoge = "+"), parseSpec("hoge+"))
checkEquals(c(hoge = "i"), parseSpec("hoge=i"))
checkException(parseSpec("hoge|fuga=s+"))
checkEquals(c(hoge = "s@", fuga = "s@"), parseSpec("hoge|fuga=s@"))
}
test.checkType <- function() {
parseSpec <- function(spec) {
vars <- strsplit(spec, "\\|")[[1]]
if (any(grepl("\\s", vars))) {
stop()
}
#lastvar <- sub("([^=:]+)([=:])?", "\\1 \\2 ", vars[length(vars)])
lastvar <- sub("([^=:]+)(=)?", "\\1 \\2 ", vars[length(vars)])
lastvar.elems <- strsplit(lastvar, " ")[[1]]
strlen <- nchar(lastvar.elems[1])
if (substring(lastvar.elems[1], strlen) %in% c("!", "+")) {