Skip to content

Instantly share code, notes, and snippets.

Haruhisa Nagata hnagata

Block or report user

Report or block hnagata

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View DBProcTest.bas
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"
View seimitsu-total.R
## 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) {
View seimitsu.R
## 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) {
View lm-toyonaka.R
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])
View summary-toyonaka.R
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 # 緯度不正
View join.cc
#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>
@hnagata
hnagata / postcanvas.js
Created Mar 11, 2014
Code snippet to post a HTML5 Canvas image to Facebook
View postcanvas.js
/*
* 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
*
@hnagata
hnagata / functions.php
Last active Aug 29, 2015
excode_filter
View functions.php
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);
You can’t perform that action at this time.