This file contains hidden or 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
function excode_filter($content) { | |
return preg_replace_callback('/(\\[?)(\\[excode ([^\\]]*?)\\])\\]?/', function($m) { | |
if ($m[1]) return $m[2]; | |
$out = '[' . 'code'; | |
$pairs = preg_split("/\s+/", $m[3]); | |
foreach ($pairs as $pair) { | |
list($key, $value) = explode('=', $pair); | |
if ($key == 'src') $src_url = preg_replace('/["\']/', '', $value); | |
elseif ($key == 'link') $link_url = preg_replace('/["\']/', '', $value); |
This file contains hidden or 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
/* | |
* Code snippet to post a HTML5 Canvas image to Facebook | |
* H. Nagata | |
* | |
* Variables: | |
* accessToken: Facebook access token | |
* targetID: Posting target id such as user id or album id | |
* canvas: HTMLCanvasElement | |
* base64.decode: c.f. https://github.com/hnagata/js-base64 | |
* |
This file contains hidden or 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
#include <sstream> | |
#include <string> | |
template<typename T, typename U, typename... R> | |
void Join(std::stringstream& ss, const T& sep, const U& head, const R&... follows) { | |
ss << head << sep; | |
Join(ss, sep, follows...); | |
} | |
template<typename T, typename U> |
This file contains hidden or 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) | |
library(RgoogleMaps) | |
options(scipen=1) | |
dat.column <- read.csv("column.csv", head=FALSE, fileEncoding="UTF-8", colClasses="character") | |
dat <- read.csv("data.csv", fileEncoding="UTF-8", colClasses=dat.column[, 3]) | |
dat <- dat[!duplicated(cbind(dat$price, dat$lat, dat$lon)), ] | |
dat$price[dat$id == "300056150013621013622"] <- NA # 価格の桁間違い? | |
dat$area[dat$id %in% c("300054130041305041305", "300105420003450004117")] <- NA # 面積の桁間違い? | |
dat$latitude[dat$id == "300059820006005006005"] <- NA # 緯度不正 |
This file contains hidden or 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) | |
library(glmnet) | |
library(msgps) | |
options(scipen=1) | |
dat.column <- read.csv("column.csv", head=FALSE, fileEncoding="UTF-8", colClasses="character") | |
varnames <- dat.column[, 2] | |
names(varnames) <- dat.column[, 1] | |
dat <- read.csv("data.csv", fileEncoding="UTF-8", colClasses=dat.column[, 3]) |
This file contains hidden or 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
## grid / ggplot ---- | |
library(ggplot2) | |
library(grid) | |
make.grid <- function(row, col) { | |
grid.newpage() | |
l <- grid.layout(row, col) | |
v <- viewport(layout=l) | |
pushViewport(v) | |
} | |
print.at <- function(o, i, j) { |
This file contains hidden or 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
## grid / ggplot ---- | |
library(ggplot2) | |
library(grid) | |
make.grid <- function(row, col) { | |
grid.newpage() | |
l <- grid.layout(row, col) | |
v <- viewport(layout=l) | |
pushViewport(v) | |
} | |
print.at <- function(o, i, j) { |
This file contains hidden or 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
Const SETTINGS_SHEET_NAME = "実行" | |
Const CONNECT_STRING_ADDRESS = "C5" | |
Const CALL_ADDRESS = "C8" | |
Const INPUT_SHEET_PREFIX = "入力 " | |
Const CHECK_SHEET_PREFIX = "出力 " | |
Const NULL_MARK = "$NULL" | |
Const EMPTY_MARK = "$EMPTY" | |
Const ANY_MARK = "$ANY" |