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
license: mit |
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) | |
library(scales) | |
# データの読み込み | |
data <- read.csv("/path/to/activities.csv", header=T) | |
# 基本統計量 | |
summary(data$steps) | |
# グラフ(日ごとの推移) |
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
require 'withings' | |
require 'time' | |
include Withings | |
Withings.consumer_key = <CONSUMER KEY> | |
Withings.consumer_secret = <CONSUMER SECRET> | |
user_id = <USER ID> | |
access_token = <ACCESS TOKEN> | |
access_token_secret = <ACCESS_TOKEN_SECRET> |
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
require 'uri' | |
require 'net/http' | |
url = "http://amzn.to/hoge" | |
uri = URI.parse(url) | |
expanded_uri = Net::HTTP.new(uri.host, uri.port).get(uri.path).header['location'] |
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
#!/usr/bin/env ruby | |
$:.unshift(File.dirname(__FILE__)) | |
require 'twitter' | |
require 'mysql2-cs-bind' | |
require 'yaml' | |
require 'pagerank' | |
# parameter | |
DUMPING_FACTOR = 0.85 |
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
#!/usr/bin/env ruby | |
class PageRank | |
#parameter | |
EPS = 0.00001 | |
def initialize(matrix) | |
@dim = matrix.size | |
@p = [] |
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
<!DOCTYPE html> | |
<html lang='ja'> | |
<head> | |
<meta charset='utf-8' /> | |
<title>D3.js</title> | |
</head> | |
<body> | |
<script src="//d3js.org/d3.v3.min.js" charset="utf-8"></script> | |
<script type='text/javascript'> | |
window.onload = function(){ |
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
require 'json' | |
class CNN | |
#parameter | |
P = 0.75 | |
REPEAT = 200 | |
def initialize | |
@nodes = [{"name" => 0}] | |
@links = [] |