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
/* | |
* 台詞を発言者を現すクラスを指定したタグで括る。 | |
* 事前条件:双司の台詞と希の台詞が空行を挟んで交互に並んでいること。 | |
* | |
* 1:双司の台詞 | |
* 2:空行 | |
* 3:希の台詞 | |
* ... | |
* 2n+1: 双司の台詞 | |
* 2n+2: 空行 |
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
# 『関数プログラミング実践入門』のリストモナドの例をRで実装してみる。 | |
# Rはベクトルが基本計算単位だから、常にリストモナドみたいなものだと思いついたので、その確認。 | |
# lessThanは見た目も近い | |
lessThan <- function(n) { | |
0:(n-1) | |
} | |
# plusMinusもほぼ同様。 | |
plusMinus <- function(a, b) { |
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") | |
entries <- data.frame(label=factor(c("小説", "読書", "漫画", "新書"), | |
levels=c("小説", "読書", "漫画", "新書")), | |
num=c(69, 34, 17, 3)) | |
g <- ggplot(entries, aes(x=label, y=num, fill=label)) | |
p <- g + geom_bar() | |
p <- p + xlab("ラベル") + ylab("投稿数") + ggtitle("2012年に読んだ本") + theme(legend.position = "none") |
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") | |
p# acquire | |
# 下記形式のinterval.csvから日付を取得 | |
# "number","start","end" | |
# "1","2013-1-1","2013-1-31" | |
interval <- read.csv(file="interval.csv", as.is=TRUE) | |
# parse | |
interval$start <- as.Date(interval$start) |
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
// Example of ajax | |
TestCase('AjaxExample', { | |
'test makes a GET request for todo items':sinon.test(function(stub) { | |
this.stub($, 'ajax'); | |
getTodos(42, sinon.spy()); | |
assertTrue($.ajax.calledWithMatch({url: '/todo/42/items'})); | |
}) | |
}); |
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
// コンストラクタを構成するモジュール | |
MYAPP.namespace('MYAPP.utilities.Array'); | |
// 使い方 | |
// var arr = new MYAPP.utilities.Array(obj); | |
MYAPP.utilities.Array = (function () { | |
// 依存関係 | |
var upbj = MYAPP.utilities.object, | |
ulang = MYAPP.utilities.lang, | |
// プライベートのプロパティとメソッド |
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
/** | |
* Make a line chart with the data exported from iOS App SimppleDiet to Google Docs Spreadsheet. | |
*/ | |
function addLineGraph() { | |
var sheets = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet = sheets.getSheets()[0]; | |
var allRange = sheet.getDataRange(); | |
var range = sheet.getRange(1, 1, allRange.getLastRow(), 2); | |
var chart = sheet.newChart().asLineChart() |
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") | |
entries <- data.frame(label=factor(c("小説", "読書", "漫画", "新書"), | |
levels=c("小説", "読書", "漫画", "新書")), | |
num=c(64, 48, 44, 2)) | |
g <- ggplot(entries, aes(x=label, y=num, fill=label)) | |
p <- g + geom_bar() | |
p <- p + xlab("ラベル") + ylab("投稿数") + ggtitle("2013年に読んだ本") + theme(legend.position = "none") |
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
// 選択行に連番を降るサクラエディタマクロ | |
autoFill = (function(){ | |
var i = 0, | |
lines = '', | |
firstLine = 0, | |
length = 0, | |
digit = 0; | |
lines = Editor.GetSelectedString(/* API仕様の固定値 */0); | |
if (lines === '') { |
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
<redpen-conf lang="ja"> | |
<validators> | |
<!--Rules on sentence length--> | |
<validator name="SentenceLength"> | |
<property name="max_len" value="100"/> | |
</validator> | |
<validator name="CommaNumber" /> | |
<!--Rules on expressions--> | |
<validator name="ParagraphNumber"/> |
OlderNewer