Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Titanium mobile “early” Advent Calendar 2012で紹介したMoment.jsのサンプル
# 最近、CoffeeScript使って書いてるので、元のcoffeeも載せておきます
moment = require('lib/moment.min')
momentja = require('lib/momentja')
mainWindow = Ti.UI.createWindow
title:'Moment.js Sample'
barColor:'#59BB0C'
# 書く内容は自由だけど「小ネタ」限定でスゴい記事書いたら空気読めない人
# 扱いされるので、WebAPIとか使わずにローカルのJSONを利用 ;)
itemsJSON = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory,"items.json")
items = JSON.parse(itemsJSON.read().toString())
tableView = Ti.UI.createTableView
backgroundColor:'#ededed'
separatorColor: '#999'
zIndex:2
width:320
left:0
top:0
rows = []
for json in items
row = Ti.UI.createTableViewRow
width:320
borderWidth:2
color:'#999'
borderColor:'#ededed',
height:100
createdDate = moment(json.created_at,"YYYY-MM-DD HH:mm:ss Z").fromNow()
updateTime = Ti.UI.createLabel
font:
fontSize:10
color:'#666'
right:0
top:5
width:60
height:15
text:createdDate
row.add updateTime
iconImage = Ti.UI.createImageView
width:40
height:40
top:5
left:5
image:json.user.profile_image_url
row.add iconImage
handleName = Ti.UI.createLabel
width:200
height:15
top:5
left:60
color:"#333"
font:
fontSize:12
fontWeight:'bold'
text:json.user.url_name + "が投稿しました"
row.add handleName
textLabel = Ti.UI.createLabel
width:240
height:20
top:25
left:60
color:'#4BA503'
font:
fontSize:16
fontWeight:'bold'
text:json.title
row.add textLabel
bodySummary = Ti.UI.createLabel
width:240
height:50
left:60
top:45
color:"#444"
font:
fontSize:12
text:json.body.replace(/<\/?[^>]+>/gi, "")
row.add bodySummary
rows.push row
tableView.setData rows
mainWindow.add tableView
mainWindow.open()
var bodySummary, createdDate, handleName, iconImage, items, itemsJSON, json, mainWindow, moment, momentja, row, rows, tableView, textLabel, updateTime, _i, _len;
moment = require('lib/moment.min');
momentja = require('lib/momentja');
mainWindow = Ti.UI.createWindow({
title: 'Moment.js Sample',
barColor: '#59BB0C'
});
itemsJSON = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, "items.json");
items = JSON.parse(itemsJSON.read().toString());
tableView = Ti.UI.createTableView({
backgroundColor: '#ededed',
separatorColor: '#999',
zIndex: 2,
width: 320,
left: 0,
top: 0
});
rows = [];
for (_i = 0, _len = items.length; _i < _len; _i++) {
json = items[_i];
row = Ti.UI.createTableViewRow({
width: 320,
borderWidth: 2,
color: '#999',
borderColor: '#ededed',
height: 100
});
createdDate = moment(json.created_at, "YYYY-MM-DD HH:mm:ss Z").fromNow();
updateTime = Ti.UI.createLabel({
font: {
fontSize: 10
},
color: '#666',
right: 0,
top: 5,
width: 60,
height: 15,
text: createdDate
});
row.add(updateTime);
iconImage = Ti.UI.createImageView({
width: 40,
height: 40,
top: 5,
left: 5,
image: json.user.profile_image_url
});
row.add(iconImage);
handleName = Ti.UI.createLabel({
width: 200,
height: 15,
top: 5,
left: 60,
color: "#333",
font: {
fontSize: 12,
fontWeight: 'bold'
},
text: json.user.url_name + "が投稿しました"
});
row.add(handleName);
textLabel = Ti.UI.createLabel({
width: 240,
height: 20,
top: 25,
left: 60,
color: '#4BA503',
font: {
fontSize: 16,
fontWeight: 'bold'
},
text: json.title
});
row.add(textLabel);
bodySummary = Ti.UI.createLabel({
width: 240,
height: 50,
left: 60,
top: 45,
color: "#444",
font: {
fontSize: 12
},
text: json.body.replace(/<\/?[^>]+>/gi, "")
});
row.add(bodySummary);
rows.push(row);
}
tableView.setData(rows);
mainWindow.add(tableView);
mainWindow.open();
[{"id":10480,"uuid":"a1af6e9b5eb69d5469b7","user":{"name":"Gen Tamura","url_name":"GenTamura84","profile_image_url":"https://si0.twimg.com/profile_images/2378845729/j5hs3slgh54kg6fkpqnp_normal.png"},"title":"Rails\u306e\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u306bhttps(SSL)\u3092\u5c0e\u5165\u3059\u308b\u65b9\u6cd5","body":"<p>\u74b0\u5883\u306f\u3001rails 3.2.6\u3001ruby 1.9.3\u3001Google Chrome 22.0\u3001Mac 10.7.5 \u3067\u3059\u3002</p>\n\n<hr>\n\n<p>\u4e00\u884c\u76ee\u306e<code>ruby.exe</code>\u3092<code>ruby</code>\u3068\u5909\u66f4\u3057<code>script/sslrails</code>\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<br>\n\uff08\u30c7\u30d5\u30a9\u30eb\u30c8\u3067<code>script/rails</code>\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u305d\u308c\u3068\u306f\u5225\u306b\u8ffd\u52a0\u3057\u307e\u3059\uff09<br>\n\u203b\u4f59\u8ac7\u3067\u3059\u304c\u3001\u79c1\u306f\u30a8\u30c7\u30a3\u30bf\u3092Esppresso\u3092\u5229\u7528\u3057\u3066\u3044\u307e\u3057\u3066\u3001Esppresso\u4e0a\u3067<code>script/rails</code>\u3092\u8907\u88fd\u3092\u3057\u305f\u3089\u3001Unix\u5b9f\u884c\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u8907\u88fd\u3055\u308c\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u306a\u306e\u3067\u3001Finder\u3067\u8907\u88fd\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002<code>sslrails</code>\u306f\u300cUnix\u5b9f\u884c\u30d5\u30a1\u30a4\u30eb\u300d\u3067\u306a\u3044\u3068\u52d5\u4f5c\u3057\u307e\u305b\u3093\u306e\u3067\u3001\u3054\u6ce8\u610f\u4e0b\u3055\u3044\u3002</p>\n<div class=\"code-frame\"><div class=\"code-lang\"><span class=\"bold\">script/sslrails</span></div><div class=\"highlight\"><pre><span class=\"c1\">#!/usr/bin/env ruby</span>\n<span class=\"c1\"># This command will automatically be run when you run &quot;rails&quot; with Rails 3 gems installed from the root of your application.</span>\n\n<span class=\"no\">APP_PATH</span> <span class=\"o\">=</span> <span class=\"no\">File</span><span class=\"o\">.</span><span class=\"n\">expand_path</span><span class=\"p\">(</span><span class=\"s1\">&#39;../../config/application&#39;</span><span class=\"p\">,</span> <span class=\"bp\">__FILE__</span><span class=\"p\">)</span>\n<span class=\"nb\">require</span> <span class=\"no\">File</span><span class=\"o\">.</span><span class=\"n\">expand_path</span><span class=\"p\">(</span><span class=\"s1\">&#39;../../config/boot&#39;</span><span class=\"p\">,</span> <span class=\"bp\">__FILE__</span><span class=\"p\">)</span>\n\n<span class=\"nb\">require</span> <span class=\"s1\">&#39;rubygems&#39;</span>\n<span class=\"nb\">require</span> <span class=\"s1\">&#39;rails/commands/server&#39;</span>\n<span class=\"nb\">require</span> <span class=\"s1\">&#39;rack&#39;</span>\n<span class=\"nb\">require</span> <span class=\"s1\">&#39;webrick&#39;</span>\n<span class=\"nb\">require</span> <span class=\"s1\">&#39;webrick/https&#39;</span>\n<span class=\"nb\">require</span> <span class=\"s1\">&#39;webrick/ssl&#39;</span>\n\n<span class=\"k\">module</span> <span class=\"nn\">Rails</span>\n <span class=\"k\">class</span> <span class=\"nc\">Server</span> <span class=\"o\">&lt;</span> <span class=\"o\">::</span><span class=\"no\">Rack</span><span class=\"o\">::</span><span class=\"no\">Server</span>\n <span class=\"k\">def</span> <span class=\"nf\">default_options</span>\n\n <span class=\"c1\"># cn \u3068 comment \u3092\u9069\u5f53\u306b\u8a2d\u5b9a</span>\n <span class=\"n\">cn</span> <span class=\"o\">=</span> <span class=\"o\">[[</span> <span class=\"s2\">&quot;CN&quot;</span><span class=\"p\">,</span> <span class=\"no\">WEBrick</span><span class=\"o\">::</span><span class=\"no\">Utils</span><span class=\"o\">::</span><span class=\"n\">getservername</span><span class=\"o\">]]</span> \n <span class=\"n\">comment</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;Generated by Ruby/OpenSSL&quot;</span> \n <span class=\"n\">cert</span><span class=\"p\">,</span> <span class=\"n\">rsa</span> <span class=\"o\">=</span> <span class=\"no\">WEBrick</span><span class=\"o\">::</span><span class=\"no\">Utils</span><span class=\"o\">::</span><span class=\"n\">create_self_signed_cert</span><span class=\"p\">(</span><span class=\"mi\">1024</span><span class=\"p\">,</span> <span class=\"n\">cn</span><span class=\"p\">,</span> <span class=\"n\">comment</span><span class=\"p\">)</span>\n <span class=\"n\">ssl_certificate</span> <span class=\"o\">=</span> <span class=\"n\">cert</span><span class=\"o\">.</span><span class=\"n\">to_s</span>\n <span class=\"n\">ssl_private_key</span> <span class=\"o\">=</span> <span class=\"n\">rsa</span><span class=\"o\">.</span><span class=\"n\">to_s</span>\n\n <span class=\"k\">super</span><span class=\"o\">.</span><span class=\"n\">merge</span><span class=\"p\">({</span>\n <span class=\"ss\">:Port</span> <span class=\"o\">=&gt;</span> <span class=\"mi\">443</span><span class=\"p\">,</span>\n <span class=\"ss\">:environment</span> <span class=\"o\">=&gt;</span> <span class=\"p\">(</span><span class=\"no\">ENV</span><span class=\"o\">[</span><span class=\"s1\">&#39;RAILS_ENV&#39;</span><span class=\"o\">]</span> <span class=\"o\">||</span> <span class=\"s2\">&quot;development&quot;</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"n\">dup</span><span class=\"p\">,</span>\n <span class=\"ss\">:daemonize</span> <span class=\"o\">=&gt;</span> <span class=\"kp\">false</span><span class=\"p\">,</span>\n <span class=\"ss\">:debugger</span> <span class=\"o\">=&gt;</span> <span class=\"kp\">false</span><span class=\"p\">,</span>\n <span class=\"ss\">:pid</span> <span class=\"o\">=&gt;</span> <span class=\"no\">File</span><span class=\"o\">.</span><span class=\"n\">expand_path</span><span class=\"p\">(</span><span class=\"s2\">&quot;tmp/pids/server.pid&quot;</span><span class=\"p\">),</span>\n <span class=\"ss\">:config</span> <span class=\"o\">=&gt;</span> <span class=\"no\">File</span><span class=\"o\">.</span><span class=\"n\">expand_path</span><span class=\"p\">(</span><span class=\"s2\">&quot;config.ru&quot;</span><span class=\"p\">),</span>\n <span class=\"ss\">:SSLEnable</span> <span class=\"o\">=&gt;</span> <span class=\"kp\">true</span><span class=\"p\">,</span>\n <span class=\"ss\">:SSLVerifyClient</span> <span class=\"o\">=&gt;</span> <span class=\"no\">OpenSSL</span><span class=\"o\">::</span><span class=\"no\">SSL</span><span class=\"o\">::</span><span class=\"no\">VERIFY_NONE</span><span class=\"p\">,</span>\n <span class=\"ss\">:SSLPrivateKey</span> <span class=\"o\">=&gt;</span> <span class=\"no\">OpenSSL</span><span class=\"o\">::</span><span class=\"no\">PKey</span><span class=\"o\">::</span><span class=\"no\">RSA</span><span class=\"o\">.</span><span class=\"n\">new</span><span class=\"p\">(</span><span class=\"n\">ssl_private_key</span><span class=\"p\">),</span>\n <span class=\"ss\">:SSLCertificate</span> <span class=\"o\">=&gt;</span> <span class=\"no\">OpenSSL</span><span class=\"o\">::</span><span class=\"no\">X509</span><span class=\"o\">::</span><span class=\"no\">Certificate</span><span class=\"o\">.</span><span class=\"n\">new</span><span class=\"p\">(</span><span class=\"n\">ssl_certificate</span><span class=\"p\">),</span>\n <span class=\"ss\">:SSLCertName</span> <span class=\"o\">=&gt;</span> <span class=\"n\">cn</span>\n <span class=\"p\">})</span>\n <span class=\"k\">end</span>\n <span class=\"k\">end</span>\n<span class=\"k\">end</span>\n\n<span class=\"nb\">require</span> <span class=\"s1\">&#39;rails/commands&#39;</span>\n</pre>\n</div>\n</div>\n<p>\u6b21\u306b\u3001<code>config/environments/development.rb</code>\u306b\u3001<code>config.force_ssl = true</code>\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<br>\n\u203b\u3053\u306e\u72b6\u614b\u306f\u3001http\u3067http\u306e\u30dd\u30fc\u30c8\u3068\u3068\u3082\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3088\u3046\u3068\u3057\u3066\u3082\u3001\u5f37\u5236\u7684\u306b\u3059\u3079\u3066https\u306b\u306a\u308a\u307e\u3059\u3002</p>\n\n<p>\u6700\u5f8c\u306b\u3001\u30ed\u30fc\u30ab\u30eb\u30b5\u30fc\u30d0\u30fc\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002<br>\n<code>script/sslrails server webrick</code><br>\n\u3059\u308b\u3068\u3001<strong>\u3053\u306e\u30b5\u30a4\u30c8\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u8a3c\u660e\u66f8\u306f\u4fe1\u983c\u3067\u304d\u307e\u305b\u3093</strong>\u3068\u771f\u3063\u8d64\u3067\u30c9\u30ad\u30c3\u3068\u3057\u305f\u753b\u9762\u304c\u767b\u5834\u3057\u307e\u3059\u304c\u3001\u6c17\u306b\u305b\u305a\u7d9a\u884c\u3057\u3066\u4e0b\u3055\u3044\u3002</p>\n\n<p>https:\u3067\u30b5\u30a4\u30c8\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308c\u3070\u3001\u5b8c\u4e86\u3067\u3059\u3002</p>\n\n<hr>\n\n<p>via <a href=\"http://d.hatena.ne.jp/ikad/20110610/1307693546\">http://d.hatena.ne.jp/ikad/20110610/1307693546</a><br>\n\u5927\u5909\u53c2\u8003\u306b\u3055\u305b\u3066\u3044\u305f\u3060\u304d\u307e\u3057\u305f\u3002\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\u3002</p>\n","created_at":"2012-11-05 00:08:40 +0900","updated_at":"2012-11-05 00:35:53 +0900","created_at_in_words":"7\u6642\u9593\u524d","updated_at_in_words":"7\u6642\u9593\u524d","tags":[{"name":"Rails","url_name":"Rails","icon_url":"http://qiita.com/system/tags/icons/000/000/034/thumb/Ruby_on_Rails_logo.jpeg?1320170723","item_count":487,"follower_count":468,"versions":[]},{"name":"Ruby","url_name":"Ruby","icon_url":"http://qiita.com/system/tags/icons/000/000/003/thumb/ruby.jpeg?1316130908","item_count":853,"follower_count":2897,"versions":[]},{"name":"Ssl","url_name":"Ssl","icon_url":"http://qiita.com/icons/thumb/missing.png","item_count":9,"follower_count":0,"versions":[]}],"stock_count":1,"stock_users":["eccyan"],"comment_count":0,"url":"http://qiita.com/items/a1af6e9b5eb69d5469b7","gist_url":"https://gist.github.com/4012226","tweet":false,"private":false,"created_at_as_seconds":1352041720},{"id":10479,"uuid":"7619b7692a33ae3d4605","user":{"name":"nyampire","url_name":"nyampire","profile_image_url":"https://si0.twimg.com/profile_images/2412206482/tkwid6y7rg9x6o8b2wfm_normal.png"},"title":"OSM Tracker\u306e\u30ab\u30b9\u30bf\u30de\u30a4\u30ba","body":"<p>OpenStreetMap\u306f\u73fe\u5730\u8abf\u67fb\u304c\u30ad\u30e2\u3067\u3059\u3002<br>\n\u3067\u3001\u305d\u306e\u305f\u3081\u306e\u30c4\u30fc\u30eb\u306e\u4e00\u3064\u3068\u3057\u3066\u3001OSMTracker\u3068\u3044\u3046Android\u30a2\u30d7\u30ea\u304c\u3042\u308a\u307e\u3059\u3002</p>\n\n<p>\u3053\u308c\u306f\u3001\u81ea\u5206\u304c\u79fb\u52d5\u3057\u305f\u7d4c\u8def\u3092GPX\u5f62\u5f0f\u3067\u8a18\u9332\u3057\u3001\u306a\u304a\u304b\u3064\u305d\u3053\u306b\u30dd\u30a4\u30f3\u30c8\u30c7\u30fc\u30bf\u3068\u3057\u3066\u30c6\u30ad\u30b9\u30c8\u3084\u5199\u771f\u3001\u97f3\u58f0\u3067\u30e1\u30e2\u3092\u6b8b\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u3001\u3063\u3066\u3044\u3046\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3067\u3059\u3002</p>\n\n<p>\u3067\u3001\u306a\u3093\u304b\u6700\u8fd1\u3053\u308c\u3001OSM\u306b\u9650\u3089\u305a\u3001\u5b66\u8853\u7cfb\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u8abf\u67fb\u8a18\u9332\u30a2\u30d7\u30ea\u3068\u3057\u3066\u4f7f\u3048\u308b\u3093\u3058\u3083\u306d\u30fc\u306e\uff1f\u3063\u3066\u3044\u3046\u6c17\u304c\u3057\u3066\u304d\u307e\u3057\u305f\u3002<br>\n\u643a\u5e2f\u3084\u30bf\u30d6\u30ec\u30c3\u30c8\u306eGPS\u7cbe\u5ea6\u3092\u4f7f\u3046\u306e\u3067\u7cbe\u5ea6\u306f\u30a2\u30ec\u3067\u3059\u304c\u3001\u305d\u3053\u306f\u3069\u3046\u306b\u3067\u3082\u88dc\u6b63\u3067\u304d\u308b\u7bc4\u56f2\u3067\u3059\u3057\u3002</p>\n\n<p>\u3042\u3068\u3001\u643a\u5e2f\u96fb\u8a71\u3060\u3068\u30a4\u30de\u30a4\u30c1\u96fb\u6c60\u306e\u6301\u3061\u304c\u60aa\u3044\u3067\u3059\u3051\u3069\u3001\u30d0\u30c3\u30c6\u30ea\u30fc\u30926\u3064\u304f\u3089\u3044\u6301\u3061\u6b69\u3051\u3070\u3001\u5c71\u9593\u90e8\u8abf\u67fb\u3067\u30822\u65e5\u304f\u3089\u3044\u306f\u4fdd\u3061\u307e\u3059\u3002<br>\n\u3069\u3053\u307e\u3067\u5b9f\u7528\u3067\u304d\u308b\u304b\u306a\u30fc\u3001\u3063\u3066\u306e\u306f\u3001\u3068\u3066\u3082\u6c17\u306b\u306a\u308a\u307e\u3059\u3002</p>\n\n<p>\u3053\u306e\u30a2\u30d7\u30ea\u306e\u3044\u3044\u3068\u3053\u308d\u306f\u305d\u306e\u67d4\u8edf\u3055\u3067\u3001<br>\n* \u3088\u304f\u4f7f\u3046\u6587\u5b57\u5217\u3084\u30bf\u30b0\u3092\u4e8b\u524d\u306b\u30dc\u30bf\u30f3\u3067\u767b\u9332\u3057\u3066\u304a\u3051\u308b\u3068\u3053\u308d<br>\n* \u5199\u771f\u3084\u97f3\u58f0\u3001\u30d5\u30ea\u30fc\u30c6\u30ad\u30b9\u30c8\u3067\u3082\u6b8b\u3057\u3066\u304a\u3051\u308b\u3068\u3053\u308d<br>\n\u3042\u305f\u308a\u306b\u3042\u308a\u307e\u3059\u3002<br>\n\u30dc\u30bf\u30f3\u914d\u7f6e\u306e\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u306f\u5358\u306bXML\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u4e00\u3064\u66f8\u304f\u3060\u3051\u306a\u306e\u3067\u3001\u305d\u3093\u306a\u306b\u96e3\u3057\u3044\u3053\u3068\u3067\u306f\u306a\u304f\u3002</p>\n\n<p>\u3044\u307e\u306e\u3068\u3053\u308d\u80cc\u666f\u5730\u56f3\u304cOSM\u56fa\u5b9a\u306a\u3093\u3060\u3051\u3069\u3001\u3061\u3087\u3063\u3068\u30cf\u30c3\u30af\u3059\u308c\u3070Openlayer\u306e\u5730\u56f3(\u57fa\u76e4\u5730\u56f3\u60c5\u5831\u3068\u304b)\u3092\u8aad\u307f\u8fbc\u3080\u3053\u3068\u3082\u3067\u304d\u308b\u3093\u3058\u3083\u306a\u3044\u304b\u306a\u3041\u3001\u3068\u304b\u601d\u3063\u3066\u307f\u305f\u308a\u3002</p>\n","created_at":"2012-11-04 23:37:31 +0900","updated_at":"2012-11-04 23:37:31 +0900","created_at_in_words":"8\u6642\u9593\u524d","updated_at_in_words":"8\u6642\u9593\u524d","tags":[{"name":"OpenStreetMap","url_name":"OpenStreetMap","icon_url":"http://qiita.com/icons/thumb/missing.png","item_count":4,"follower_count":2,"versions":[]}],"stock_count":0,"stock_users":[],"comment_count":0,"url":"http://qiita.com/items/7619b7692a33ae3d4605","gist_url":null,"tweet":false,"private":false,"created_at_as_seconds":1352039851},{"id":10478,"uuid":"e204fd483ff7508bcf8d","user":{"name":"awakia","url_name":"awakia","profile_image_url":"https://secure.gravatar.com/avatar/c9b46fd431b733b14acac138015f0210?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"title":"Ruby\u529b\u3092\u4e00\u6bb5\u30a2\u30c3\u30d7\u3059\u308b\u305f\u3081\u306b\u8aad\u3093\u3060\u307b\u3046\u304c\u826f\u3044\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u96c6","body":"<p>Ruby\u306e\u8a00\u8a9e\u4ed5\u69d8\u3067\u91cd\u8981\u306a\u3082\u306e\u3092\u30d4\u30c3\u30af\u30a2\u30c3\u30d7\u3002</p>\n\n<h2>Class</h2>\n\n<p><a href=\"http://www.ruby-doc.org/core-1.9.3/Class.html\">http://www.ruby-doc.org/core-1.9.3/Class.html</a></p>\n\n<p>Ruby\u3067\u306fClass\u306fClass\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u3057\u3066\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u3002</p>\n<div class=\"code-frame\"><div class=\"code-lang\"><span class=\"bold\">methods</span></div><div class=\"highlight\"><pre>::new #allocate #inherited #new #superclass\n</pre>\n</div>\n</div>\n<p>\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\u306b\u95a2\u4fc2\u3059\u308b</p>\n\n<blockquote>\n<p>::new, #new, #allocate</p>\n</blockquote>\n\n<p>\u3068\u7d99\u627f\u306b\u95a2\u4fc2\u3059\u308b</p>\n\n<blockquote>\n<p>#superclass, #inhereted</p>\n</blockquote>\n\n<p>\u3057\u304b\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u306a\u3044\u3002</p>\n\n<p>\u305d\u306e\u4ed6\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u3059\u3079\u3066\u30b9\u30fc\u30d1\u30fc\u30af\u30e9\u30b9\u3067\u3042\u308bModule\u306b\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u3002Class\u306f\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\u3067\u304d\u308bModule\u3068\u8003\u3048\u308c\u3070\u826f\u3044\u3002</p>\n\n<h3>SuperClass\u306e\u95a2\u4fc2</h3>\n<div class=\"code-frame\"><div class=\"code-lang\"><span class=\"bold\"></span></div><div class=\"highlight\"><pre><span class=\"o\">[</span>1<span class=\"o\">]</span> pry<span class=\"o\">(</span>main<span class=\"o\">)</span>&gt; Class.superclass\n<span class=\"o\">=</span>&gt; Module\n<span class=\"o\">[</span>2<span class=\"o\">]</span> pry<span class=\"o\">(</span>main<span class=\"o\">)</span>&gt; Module.superclass\n<span class=\"o\">=</span>&gt; Object\n<span class=\"o\">[</span>3<span class=\"o\">]</span> pry<span class=\"o\">(</span>main<span class=\"o\">)</span>&gt; Object.superclass\n<span class=\"o\">=</span>&gt; BasicObject\n<span class=\"o\">[</span>4<span class=\"o\">]</span> pry<span class=\"o\">(</span>main<span class=\"o\">)</span>&gt; BasicObject.superclass\n<span class=\"o\">=</span>&gt; nil\n<span class=\"o\">[</span>5<span class=\"o\">]</span> pry<span class=\"o\">(</span>main<span class=\"o\">)</span>&gt; nil.superclass\nNoMethodError: undefined method <span class=\"sb\">`</span>superclass<span class=\"err\">&#39;</span> <span class=\"k\">for </span>nil:NilClass\n<span class=\"o\">[</span>6<span class=\"o\">]</span> pry<span class=\"o\">(</span>main<span class=\"o\">)</span>&gt; NilClass.superclass\n<span class=\"o\">=</span>&gt; Object\n</pre>\n</div>\n</div>\n<h3>Class\u306e\u95a2\u4fc2</h3>\n<div class=\"code-frame\"><div class=\"code-lang\"><span class=\"bold\"></span></div><div class=\"highlight\"><pre><span class=\"o\">[</span>1<span class=\"o\">]</span> pry<span class=\"o\">(</span>main<span class=\"o\">)</span>&gt; Class.class\n<span class=\"o\">=</span>&gt; Class\n<span class=\"o\">[</span>2<span class=\"o\">]</span> pry<span class=\"o\">(</span>main<span class=\"o\">)</span>&gt; Module.class\n<span class=\"o\">=</span>&gt; Class\n<span class=\"o\">[</span>3<span class=\"o\">]</span> pry<span class=\"o\">(</span>main<span class=\"o\">)</span>&gt; Object.class\n<span class=\"o\">=</span>&gt; Class\n<span class=\"o\">[</span>4<span class=\"o\">]</span> pry<span class=\"o\">(</span>main<span class=\"o\">)</span>&gt; BasicObject.class\n<span class=\"o\">=</span>&gt; Class\n<span class=\"o\">[</span>5<span class=\"o\">]</span> pry<span class=\"o\">(</span>main<span class=\"o\">)</span>&gt; nil.class\n<span class=\"o\">=</span>&gt; NilClass\n<span class=\"o\">[</span>6<span class=\"o\">]</span> pry<span class=\"o\">(</span>main<span class=\"o\">)</span>&gt; NilClass.class\n<span class=\"o\">=</span>&gt; Class\n</pre>\n</div>\n</div>\n<h3>Module\u3082\u542b\u3081\u305f\u7956\u5148</h3>\n<div class=\"code-frame\"><div class=\"code-lang\"><span class=\"bold\"></span></div><div class=\"highlight\"><pre><span class=\"o\">[</span>1<span class=\"o\">]</span> pry<span class=\"o\">(</span>main<span class=\"o\">)</span>&gt; Class.ancestors\n<span class=\"o\">=</span>&gt; <span class=\"o\">[</span>Class, Module, Object, PP::ObjectMixin, Kernel, BasicObject<span class=\"o\">]</span>\n</pre>\n</div>\n</div>\n<p>\u3053\u3053\u3067\u3001<code>PP::ObjectMixin</code>\u306f<code>pry</code>\u304c\u51fa\u529b\u306e\u6574\u5f62\u7528\u306b\u52dd\u624b\u306b\u7a81\u3063\u8fbc\u3093\u3060\u3082\u306e\u3002\u901a\u5e38\u306f\u5165\u3063\u3066\u3044\u306a\u3044\u3002</p>\n<div class=\"code-frame\"><div class=\"code-lang\"><span class=\"bold\"></span></div><div class=\"highlight\"><pre>irb<span class=\"o\">(</span>main<span class=\"o\">)</span>:001:0&gt; Class.ancestors\n<span class=\"o\">=</span>&gt; <span class=\"o\">[</span>Class, Module, Object, Kernel, BasicObject<span class=\"o\">]</span>\n</pre>\n</div>\n</div>\n<h2>Module</h2>\n\n<p><a href=\"http://www.ruby-doc.org/core-1.9.3/Module.html\">http://www.ruby-doc.org/core-1.9.3/Module.html</a></p>\n<div class=\"code-frame\"><div class=\"code-lang\"><span class=\"bold\">methods</span></div><div class=\"highlight\"><pre>::constants ::nesting ::new #&lt; #&lt;= #&lt;=&gt; #== #=== #&gt; #&gt;= #alias_method #ancestors #append_features #attr #attr_accessor #attr_reader #attr_writer #autoload #autoload? #class_eval #class_exec #class_variable_defined? #class_variable_get #class_variable_set #class_variables #const_defined? #const_get #const_missing #const_set #constants #define_method #extend_object #extended #freeze #include #include? #included #included_modules #instance_method #instance_methods #method_added #method_defined? #method_removed #method_undefined #module_eval #module_exec #module_function #name #private #private_class_method #private_instance_methods #private_method_defined? #protected #protected_instance_methods #protected_method_defined? #public #public_class_method #public_instance_method #public_instance_methods #public_method_defined? #remove_class_variable #remove_const #remove_method #to_s #undef_method\n</pre>\n</div>\n</div>\n<p>\u57fa\u672c\u6a5f\u80fd</p>\n\n<ul>\n<li>\u6bd4\u8f03\u95a2\u4fc2</li>\n</ul>\n\n<blockquote>\n<p>#&lt; #&lt;= #&lt;=&gt; #== #=== #&gt; #&gt;= </p>\n</blockquote>\n\n<ul>\n<li>\u6587\u5b57\u5217\u5316</li>\n</ul>\n\n<blockquote>\n<p>#name #to_s</p>\n</blockquote>\n\n<ul>\n<li>freeze</li>\n</ul>\n\n<blockquote>\n<p>#freeze</p>\n</blockquote>\n\n<p>Constants\u95a2\u4fc2</p>\n\n<blockquote>\n<p>::constants ::nesting #const_defined? #const_get #const_missing #const_set #constants #remove_const</p>\n</blockquote>\n\n<p>Module\u6a5f\u80fd</p>\n\n<blockquote>\n<p>::new\u3000#ancestors</p>\n</blockquote>\n\n<ul>\n<li>autoload</li>\n</ul>\n\n<blockquote>\n<p>#autoload #autoload?</p>\n</blockquote>\n\n<ul>\n<li>include</li>\n</ul>\n\n<blockquote>\n<p>#append_features #include #include? #included #included_modules</p>\n</blockquote>\n\n<ul>\n<li>extend</li>\n</ul>\n\n<blockquote>\n<p>#extend_object #extended</p>\n</blockquote>\n\n<p>Class\u95a2\u4fc2</p>\n\n<ul>\n<li>class_variables (<code>@@foo</code> etc.)</li>\n</ul>\n\n<blockquote>\n<p>#class_variable_defined? #class_variable_get #class_variable_set #class_variables #remove_class_variable</p>\n</blockquote>\n\n<ul>\n<li>methods</li>\n</ul>\n\n<blockquote>\n<p>#alias_method #define_method #method_added #method_defined? #method_removed #method_undefined #remove_method #undef_method</p>\n\n<p>#instance_methods</p>\n\n<p>#module_function</p>\n</blockquote>\n\n<ul>\n<li>attr</li>\n</ul>\n\n<blockquote>\n<p>#attr #attr_accessor #attr_reader #attr_writer</p>\n</blockquote>\n\n<ul>\n<li>eval, exec</li>\n</ul>\n\n<blockquote>\n<p>#class_eval #class_exec #module_eval #module_exec</p>\n</blockquote>\n\n<p>private,protected,public\u306e\u30b9\u30b3\u30fc\u30d7\u6982\u5ff5\u306e\u5c0e\u5165</p>\n\n<blockquote>\n<p>#private #private_class_method #private_instance_methods #private_method_defined?</p>\n\n<p>#protected #protected_instance_methods #protected_method_defined?</p>\n\n<p>#public #public_class_method #public_instance_method #public_instance_methods #public_method_defined?</p>\n</blockquote>\n\n<h2>Object</h2>\n\n<p><a href=\"http://www.ruby-doc.org/core-1.9.3/Object.html\">http://www.ruby-doc.org/core-1.9.3/Object.html</a></p>\n<div class=\"code-frame\"><div class=\"code-lang\"><span class=\"bold\">methods</span></div><div class=\"highlight\"><pre>#!~ #&lt;=&gt; #=== #=~ #class #clone #define_singleton_method #display #dup #enum_for #eql? #extend #freeze #frozen? #hash #inspect #instance_of? #instance_variable_defined? #instance_variable_get #instance_variable_set #instance_variables #is_a? #kind_of? #method #nil? #object_id #public_method #public_send #remove_instance_variable #respond_to? #respond_to_missing? #send #singleton_class #singleton_methods #taint #tainted? #tap #to_enum #to_s #trust #untaint #untrust #untrusted?\n</pre>\n</div>\n</div>\n<p>\u57fa\u672c\u6a5f\u80fd</p>\n\n<ul>\n<li>\u6bd4\u8f03\u95a2\u4fc2</li>\n</ul>\n\n<blockquote>\n<p>#!~ #&lt;=&gt; #=== #=~ #eql? #nil?</p>\n</blockquote>\n\n<ul>\n<li>\u6587\u5b57\u5217\u5316</li>\n</ul>\n\n<blockquote>\n<p>#to_s #inspect</p>\n</blockquote>\n\n<ul>\n<li>Enum\u95a2\u4fc2</li>\n</ul>\n\n<blockquote>\n<p>#enum_for #to_enum #tap</p>\n</blockquote>\n\n<ul>\n<li>copy</li>\n</ul>\n\n<blockquote>\n<p>#clone #dup</p>\n</blockquote>\n\n<ul>\n<li>Hash\u5024, Object\u5024</li>\n</ul>\n\n<blockquote>\n<p>#hash #object_id</p>\n</blockquote>\n\n<ul>\n<li>display</li>\n</ul>\n\n<blockquote>\n<p>#display</p>\n</blockquote>\n\n<ul>\n<li>freeze</li>\n</ul>\n\n<blockquote>\n<p>#freeze #frozen?</p>\n</blockquote>\n\n<ul>\n<li>\u30de\u30fc\u30af\u4ed8\u3051</li>\n</ul>\n\n<blockquote>\n<p>#taint #tainted? #untaint<br>\n #trust #untrust #untrusted?</p>\n</blockquote>\n\n<p>Instance\u6a5f\u80fd</p>\n\n<ul>\n<li>class\u3068\u306e\u95a2\u4fc2\u6027\u30c1\u30a7\u30c3\u30af</li>\n</ul>\n\n<blockquote>\n<p>#instance_of? #is_a? #kind_of? #class</p>\n</blockquote>\n\n<ul>\n<li>instance_valiable (<code>@foo</code> etc.)</li>\n</ul>\n\n<blockquote>\n<p>#instance_variable_defined? #instance_variable_get #instance_variable_set #instance_variables #remove_instance_variable</p>\n</blockquote>\n\n<ul>\n<li>method check</li>\n</ul>\n\n<blockquote>\n<p>#method #public_method<br>\n #respond_to? #respond_to_missing?</p>\n</blockquote>\n\n<ul>\n<li>method call</li>\n</ul>\n\n<blockquote>\n<p>#send #public_send</p>\n</blockquote>\n\n<ul>\n<li>extend</li>\n</ul>\n\n<blockquote>\n<p>#extend</p>\n</blockquote>\n\n<ul>\n<li>singleton_method\u3001singleton_class</li>\n</ul>\n\n<blockquote>\n<p>#define_singleton_method #singleton_class #singleton_methods</p>\n</blockquote>\n\n<p>\u3053\u308c\u306f\u65e5\u672c\u8a9e\u3067\u306f\u7279\u7570\u30e1\u30bd\u30c3\u30c9\u3001\u7279\u7570\u30af\u30e9\u30b9\u3068\u547c\u3070\u308c\u3066\u3044\u308b\u3002\u3053\u308c\u306e\u89e3\u8aac\u306f\u4ee5\u4e0b\u304c\u308f\u304b\u308a\u6613\u304b\u3063\u305f\u3002<br>\n<a href=\"http://blog.livedoor.jp/sasata299/archives/51497378.html\">\u7d50\u5c40\u3001Ruby\u306e\u7279\u7570\u30e1\u30bd\u30c3\u30c9\u3063\u3066\u4f55\u306a\u306e\uff1f - (\uff9f\u2200\uff9f)o\u5f61 sasata299&#39;s blog</a><br>\n\u3053\u308c\u3092\u8aad\u3081\u3070\u3001<code>class &lt;&lt; self</code>\u3068\u304b\u306e\u610f\u5473\u3082\u308f\u304b\u308b\u306f\u305a\uff01</p>\n\n<h2>BasicObject</h2>\n\n<p><a href=\"http://www.ruby-doc.org/core-1.9.3/BasicObject.html\">http://www.ruby-doc.org/core-1.9.3/BasicObject.html</a></p>\n\n<p>\u3059\u3079\u3066\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u5171\u901a\u3067\u4f7f\u3048\u308b\u3001Object\u306e\u89aa\u306b\u5f53\u305f\u308b\u30af\u30e9\u30b9\u3002Kernel\u30e2\u30b8\u30e5\u30fc\u30eb\u304cinclude\u3055\u308c\u3066\u3044\u306a\u3044\u306e\u304c\u7279\u5fb4\u3002</p>\n<div class=\"code-frame\"><div class=\"code-lang\"><span class=\"bold\">methods</span></div><div class=\"highlight\"><pre>::new #! #!= #== #__id__ #__send__ #equal? #instance_eval #instance_exec #method_missing #singleton_method_added #singleton_method_removed #singleton_method_undefined\n</pre>\n</div>\n</div>\n<ul>\n<li>\u6bd4\u8f03\u95a2\u4fc2</li>\n</ul>\n\n<blockquote>\n<p>#! #!= #== #equal? </p>\n</blockquote>\n\n<ul>\n<li>eval, exec</li>\n</ul>\n\n<blockquote>\n<p>#instance_eval #instance_exec</p>\n</blockquote>\n\n<ul>\n<li>method_missing</li>\n</ul>\n\n<blockquote>\n<p>#method_missing</p>\n</blockquote>\n\n<ul>\n<li>singleton_method\u306e\u30c1\u30a7\u30c3\u30af\u95a2\u4fc2</li>\n</ul>\n\n<blockquote>\n<p>#singleton_method_added #singleton_method_removed #singleton_method_undefined</p>\n</blockquote>\n\n<ul>\n<li>\u305d\u306e\u4ed6</li>\n</ul>\n\n<blockquote>\n<p># ::new <code>#__id__</code> <code>#__send__</code></p>\n</blockquote>\n\n<h2>Kernel</h2>\n\n<p><a href=\"http://www.ruby-doc.org/core-1.9.3/Kernel.html\">http://www.ruby-doc.org/core-1.9.3/Kernel.html</a></p>\n\n<p>open, system, eval, exit, raise, puts\u306a\u3069\u306eprint\u7cfb\u95a2\u6570, Array, Integer, String\u306a\u3069\u306e\u30ad\u30e3\u30b9\u30c8\u306e\u3088\u3046\u306a\u95a2\u6570\u306a\u3069\u3001\u4e00\u822c\u7684\u306a\u8a00\u8a9e\u3067\u30e1\u30bd\u30c3\u30c9\u3067\u306f\u306a\u304f\u95a2\u6570\u3068\u3057\u3066\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u306a\u3001\u57fa\u672c\u7684\u306a\u52d5\u4f5c\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u30e2\u30b8\u30e5\u30fc\u30eb\u3002</p>\n\n<p>\u3053\u3053\u306b\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u3059\u3079\u3066\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u4e00\u5ea6\u898b\u3066\u304a\u304f\u3068\u826f\u3044\u3060\u308d\u3046\u3002</p>\n\n<h2>Proc/Method</h2>\n\n<p><a href=\"http://www.ruby-doc.org/core-1.9.3/Proc.html\">http://www.ruby-doc.org/core-1.9.3/Proc.html</a><br>\n<a href=\"http://www.ruby-doc.org/core-1.9.3/Proc.html\">http://www.ruby-doc.org/core-1.9.3/Proc.html</a></p>\n\n<p>Block\u3092\u4f7f\u3046\u6642\u306a\u3093\u304b\u306b\u3082\u5fc5\u8981\u3002Proc/Method, block/proc/lambda\u306e\u9055\u3044\u306b\u3064\u3044\u3066\u306f\u4ee5\u4e0b\u304c\u308f\u304b\u308a\u6613\u304b\u3063\u305f\u3002<br>\n<a href=\"http://d.hatena.ne.jp/vividcode/20100813/1281709854\">Ruby \u306e Proc \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068 Method \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u9055\u3044 (proc, lambda, \u30d6\u30ed\u30c3\u30af, \u30e1\u30bd\u30c3\u30c9\u306b\u3064\u3044\u3066) - vivid memo</a></p>\n\n<h2>\u305d\u306e\u4ed6\u3001\u57fa\u672c\u578b</h2>\n\n<p>String/Symbol</p>\n\n<ul>\n<li><a href=\"http://www.ruby-doc.org/core-1.9.3/String.html\">http://www.ruby-doc.org/core-1.9.3/String.html</a></li>\n<li><a href=\"http://www.ruby-doc.org/core-1.9.3/Symbol.html\">http://www.ruby-doc.org/core-1.9.3/Symbol.html</a></li>\n</ul>\n\n<p>Number/Math</p>\n\n<ul>\n<li><a href=\"http://www.ruby-doc.org/core-1.9.3/Fixnum.html\">http://www.ruby-doc.org/core-1.9.3/Fixnum.html</a></li>\n<li><a href=\"http://www.ruby-doc.org/core-1.9.3/Bignum.html\">http://www.ruby-doc.org/core-1.9.3/Bignum.html</a></li>\n<li><a href=\"http://www.ruby-doc.org/core-1.9.3/Integer.html\">http://www.ruby-doc.org/core-1.9.3/Integer.html</a></li>\n<li><a href=\"http://www.ruby-doc.org/core-1.9.3/Float.html\">http://www.ruby-doc.org/core-1.9.3/Float.html</a></li>\n<li><a href=\"http://www.ruby-doc.org/core-1.9.3/Rational.html\">http://www.ruby-doc.org/core-1.9.3/Rational.html</a></li>\n<li><a href=\"http://www.ruby-doc.org/core-1.9.3/Complex.html\">http://www.ruby-doc.org/core-1.9.3/Complex.html</a></li>\n<li><a href=\"http://www.ruby-doc.org/core-1.9.3/Numeric.html\">http://www.ruby-doc.org/core-1.9.3/Numeric.html</a></li>\n<li><a href=\"http://www.ruby-doc.org/core-1.9.3/Math.html\">http://www.ruby-doc.org/core-1.9.3/Math.html</a></li>\n</ul>\n\n<p>Boolean</p>\n\n<ul>\n<li><a href=\"http://www.ruby-doc.org/core-1.9.3/TrueClass.html\">http://www.ruby-doc.org/core-1.9.3/TrueClass.html</a></li>\n<li><a href=\"http://www.ruby-doc.org/core-1.9.3/FalseClass.html\">http://www.ruby-doc.org/core-1.9.3/FalseClass.html</a></li>\n</ul>\n\n<p>\u96c6\u5408\u95a2\u4fc2</p>\n\n<ul>\n<li><a href=\"http://www.ruby-doc.org/core-1.9.3/Enumerable.html\">http://www.ruby-doc.org/core-1.9.3/Enumerable.html</a></li>\n<li><a href=\"http://www.ruby-doc.org/core-1.9.3/Range.html\">http://www.ruby-doc.org/core-1.9.3/Range.html</a></li>\n<li><a href=\"http://www.ruby-doc.org/core-1.9.3/Array.html\">http://www.ruby-doc.org/core-1.9.3/Array.html</a></li>\n<li><a href=\"http://www.ruby-doc.org/core-1.9.3/Hash.html\">http://www.ruby-doc.org/core-1.9.3/Hash.html</a></li>\n<li><a href=\"http://www.ruby-doc.org/stdlib-1.9.3/libdoc/set/rdoc/Set.html\">http://www.ruby-doc.org/stdlib-1.9.3/libdoc/set/rdoc/Set.html</a></li>\n</ul>\n\n<p>Time/Date</p>\n\n<ul>\n<li><a href=\"http://www.ruby-doc.org/core-1.9.3/Time.html\">http://www.ruby-doc.org/core-1.9.3/Time.html</a></li>\n<li><a href=\"http://www.ruby-doc.org/stdlib-1.9.3/libdoc/date/rdoc/Date.html\">http://www.ruby-doc.org/stdlib-1.9.3/libdoc/date/rdoc/Date.html</a></li>\n<li><a href=\"http://www.ruby-doc.org/stdlib-1.9.3/libdoc/date/rdoc/DateTime.html\">http://www.ruby-doc.org/stdlib-1.9.3/libdoc/date/rdoc/DateTime.html</a></li>\n</ul>\n","created_at":"2012-11-04 23:34:20 +0900","updated_at":"2012-11-04 23:34:20 +0900","created_at_in_words":"8\u6642\u9593\u524d","updated_at_in_words":"8\u6642\u9593\u524d","tags":[{"name":"Ruby","url_name":"Ruby","icon_url":"http://qiita.com/system/tags/icons/000/000/003/thumb/ruby.jpeg?1316130908","item_count":853,"follower_count":2897,"versions":[]}],"stock_count":3,"stock_users":["cucation","VienosNotes","yancya"],"comment_count":0,"url":"http://qiita.com/items/e204fd483ff7508bcf8d","gist_url":null,"tweet":false,"private":false,"created_at_as_seconds":1352039660},{"id":10477,"uuid":"4865e4f974f0277a4407","user":{"name":"Hiraku","url_name":"Hiraku","profile_image_url":"https://si0.twimg.com/profile_images/1100290432/daemonicons_normal.jpg"},"title":"TypeScript\u306e\u30b3\u30f3\u30d1\u30a4\u30eb\u3092\u81ea\u52d5\u5316\u3059\u308b","body":"<div class=\"code-frame\"><div class=\"code-lang\"><span class=\"bold\">Shell script, \u30b3\u30de\u30f3\u30c9</span></div><div class=\"highlight\"><pre>tsc -w file1.ts file2.ts <span class=\"c\">#...</span>\n</pre>\n</div>\n</div>\n<p>tsc\u306b\u306f\u30d5\u30a1\u30a4\u30eb\u3092\u30a6\u30a9\u30c3\u30c1\u3057\u3066\u81ea\u52d5\u7684\u306b\u30b3\u30f3\u30d1\u30a4\u30eb\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u3042\u308b\u3088\u3046\u3067\u3059\u3002<br>\n-w\u3067\u30d7\u30ed\u30bb\u30b9\u3092\u7acb\u3061\u4e0a\u3052\u3066\u304a\u304f\u3068\u3001\u30a6\u30a9\u30c3\u30c1\u5bfe\u8c61\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u4e0a\u66f8\u304d\u3055\u308c\u305f\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u81ea\u52d5\u7684\u306b\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u307e\u3059\u3002</p>\n\n<p>tsc\u306f\u6bce\u5ea6\u7acb\u3061\u4e0a\u3052\u308b\u3068\u5c11\u3057\u9045\u3044\u306e\u3067\u3001\u6d3b\u7528\u3059\u308b\u3068\u9762\u767d\u305d\u3046\u3002</p>\n","created_at":"2012-11-04 22:59:57 +0900","updated_at":"2012-11-04 22:59:57 +0900","created_at_in_words":"8\u6642\u9593\u524d","updated_at_in_words":"8\u6642\u9593\u524d","tags":[{"name":"TypeScript","url_name":"TypeScript","icon_url":"http://qiita.com/system/tags/icons/000/001/296/thumb/typescript.png?1351736555","item_count":4,"follower_count":11,"versions":[]}],"stock_count":1,"stock_users":["shohei909"],"comment_count":0,"url":"http://qiita.com/items/4865e4f974f0277a4407","gist_url":null,"tweet":false,"private":false,"created_at_as_seconds":1352037597},{"id":10476,"uuid":"5cbb1c6a811cddda46c3","user":{"name":"NAKAMURA, Hisashi","url_name":"martini3oz","profile_image_url":"https://secure.gravatar.com/avatar/1bf16b77ec749b4e6beb58b9ae6e9274?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"title":"GitHub Pages\u306e\u5185\u5bb9\u3092 JSDuck\u3092\u4f7f\u3063\u3066\u51fa\u529b","body":"<h2>GitHub \u3068 JSDuck</h2>\n\n<p>JSDuck\u3067\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u51fa\u529b\u3059\u308b\u3088\u3046\u306a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u304c\u3042\u3063\u3066\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4e2d\u3067\u3001JSDuck\u3092\u4f7f\u3063\u3066\u81ea\u52d5\u7684\u306b\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u751f\u6210\u3057\u307e\u3059\u3002\u305d\u3053\u3067\u51fa\u529b\u3055\u308c\u305f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092GitHub Pages\u3067\u898b\u3089\u308c\u308b\u3088\u3046\u306b\u3059\u308b\u6642\u306e\u8a2d\u5b9a\u65b9\u6cd5\u3067\u3059\u3002</p>\n\n<p>\u4eca\u56de\u306f </p>\n\n<p>someProject<br>\n |-- project<br>\n |-- out<br>\n |-- public_html</p>\n\n<p>\u3068\u3044\u3046\u69cb\u6210\u3067\u8003\u3048\u307e\u3059\u3002\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u5909\u66f4\u304c\u3042\u3063\u305f\u3089\u3001\u6b21\u306e\u51e6\u7406\u3092\u3057\u307e\u3059\u3002</p>\n\n<ul>\n<li>out\u306e\u4e0b\u306bJSDuck\u304c\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u5410\u304d\u51fa\u3057\u307e\u3059\u3002</li>\n<li>\u305d\u3057\u3066\u3001out\u306e\u5185\u5bb9\u3092GitHub Pages\u7528\u306epublic_html\u306b\u30b3\u30d4\u30fc\u3057\u307e\u3059\u3002</li>\n</ul>\n\n<p>\u3053\u308c\u3089\u306e\u51e6\u7406\u306f\u3001Makefile\u306b\u66f8\u3044\u3066\u51e6\u7406\u3055\u305b\u3066\u3044\u307e\u3059\u3002\u76f4\u63a5\u3001GitHub Pages\u7528\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306bJSDuck\u3067\u51fa\u529b\u3057\u306a\u3044\u306e\u306f\u3001JSDuck\u3067\u306f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u6d88\u3057\u3066\u304b\u3089\u51fa\u529b\u3059\u308b\u3088\u3046\u3067\u3001.git\u3082\u4e00\u7dd2\u306b\u6d88\u3048\u3061\u3083\u3046\u304b\u3089\u3067\u3059\u3002</p>\n\n<p>out\u30d5\u30a9\u30eb\u30c0\u30fc\u306f\u3001.gitignore\u306e\u4e2d\u3067\u3001\u5bfe\u8c61\u5916\u306b\u6307\u5b9a\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002</p>\n\n<h2>GitHub Pages \u3092\u4f5c\u6210</h2>\n\n<p>\u516c\u5f0f\u30da\u30fc\u30b8\u306e<a href=\"https://help.github.com/articles/creating-project-pages-manually\">Creating Project Pages manually</a>\u306b\u8f09\u3063\u3066\u3044\u308b\u624b\u9806\u3067\u3001\u30c0\u30df\u30fc\u306ePages\u3092\u4f5c\u308a\u307e\u3059\u3002</p>\n<div class=\"code-frame\"><div class=\"highlight\"><pre>git checkout --orphan gh-pages\ngit rm -rf .\necho &quot;pages&quot; &gt; index.html\ngit add .\ngit commit -a -m &quot;First pages commit&quot;\npush origin gh-pages\n</pre>\n</div>\n</div>\n<p>\u3053\u308c\u3067\u3001</p>\n<div class=\"code-frame\"><div class=\"highlight\"><pre>http://&lt;username&gt;.github.com/&lt;reponame&gt;/\n</pre>\n</div>\n</div>\n<p>\u3067\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002</p>\n\n<h2>gh-pages\u30d6\u30e9\u30f3\u30c1\u3092\u30b5\u30d6\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u3059\u308b</h2>\n\n<p>master \u30d6\u30e9\u30f3\u30c1\u306b\u623b\u308a\u3001gh-pages\u30d6\u30e9\u30f3\u30c1\u3092submoule\u3067\u8ffd\u52a0\u3057\u307e\u3059\u3002</p>\n<div class=\"code-frame\"><div class=\"highlight\"><pre>git submodule add -b gh-pages git@github.com:&lt;username&gt;/&lt;reponame&gt;.git public_html\n</pre>\n</div>\n</div>\n<p>\u30b5\u30d6\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u521d\u671f\u5316\u3092\u3057\u307e\u3059\u3002</p>\n<div class=\"code-frame\"><div class=\"highlight\"><pre>git submodlude init\ngit submodlule update\n</pre>\n</div>\n</div>\n<p>\u3053\u308c\u3067\u3001someProject\u306e\u4e0b\u306bpublic_html\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304c\u3067\u304d\u3066\u3001\u305d\u306e\u5185\u5bb9\u306f\u3001\u5148\u307b\u3069\u4f5c\u3063\u305f\u3001GitHub Pages\u306e\u30c0\u30df\u30fcindex.html\u304c\u3042\u308b\u72b6\u614b\u306b\u306a\u308a\u307e\u3059\u3002</p>\n\n<h2>\u30b3\u30f3\u30c6\u30f3\u30c4\u306e\u4f5c\u6210</h2>\n\n<p>\u3053\u3053\u3067\u3001JSDuck\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002\u305d\u3057\u3066\u3001\u305d\u306e\u5185\u5bb9\u3092public_html\u306b\u30b3\u30d4\u30fc\u3057\u307e\u3059\u3002</p>\n<div class=\"code-frame\"><div class=\"highlight\"><pre>all:\n jsduck \\\n --title &quot;\u30bf\u30a4\u30c8\u30eb&quot; \\\n --guides ./guide.json \\\n --output ./out/;\n cp -Rf out/* public_html;\n.PHONY: all\n</pre>\n</div>\n</div>\n<p>\u3068\u3042\u308b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306eMakefile\u3067\u3059\u3002\u5b9f\u884c\u3059\u308b\u3068 public_html \u306b\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u304c\u3067\u304d\u3042\u304c\u308a\u307e\u3059\u3002someProject \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067 commit - push \u3059\u308b\u306e\u3068\u540c\u6642\u306bpublic_html \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067 commit - push \u3059\u308b\u3068\u3001GitHub Pages \u306e\u30da\u30fc\u30b8\u304c\u66f4\u65b0\u3055\u308c\u307e\u3059\u3002</p>\n","created_at":"2012-11-04 17:51:13 +0900","updated_at":"2012-11-04 17:51:13 +0900","created_at_in_words":"14\u6642\u9593\u524d","updated_at_in_words":"14\u6642\u9593\u524d","tags":[{"name":"Vim","url_name":"Vim","icon_url":"http://qiita.com/system/tags/icons/000/000/008/thumb/vim-editor_logo.png?1316130850","item_count":203,"follower_count":2406,"versions":[]},{"name":"JavaScript","url_name":"JavaScript","icon_url":"http://qiita.com/system/tags/icons/000/000/015/thumb/images.jpeg?1316130454","item_count":623,"follower_count":4464,"versions":[]}],"stock_count":1,"stock_users":["noromanba@github"],"comment_count":0,"url":"http://qiita.com/items/5cbb1c6a811cddda46c3","gist_url":null,"tweet":false,"private":false,"created_at_as_seconds":1352019073},{"id":10475,"uuid":"6ece44845eaeae60cd4a","user":{"name":"s-yamaz","url_name":"s-yamaz@github","profile_image_url":"https://secure.gravatar.com/avatar/47066474fbb5761fa95328cf7f26926e?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"title":"Play framework 2\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb","body":"<h2>1. Play framework\u3068\u306f?</h2>\n\n<p>Play framework(\u4ee5\u964d\u306fPlay)\u306f\u30d5\u30e9\u30f3\u30b9\u306eZenexity\u304c\u958b\u767a\u3057\u305fScala\u3068Java\u5411\u3051\u306eWeb\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3002<br>\n&quot;\u578b\u5b89\u5168\u3067\u9ad8\u901f\u306aRails&quot;\u3068\u3044\u3046\u611f\u899a\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3089\u3057\u3044\u3002<br>\n(\u3082\u3061\u308d\u3093\u3001\u4e0a\u8a18\u306f\u8aa4\u89e3\u3092\u542b\u3093\u3067\u3044\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u304c\u3001\u8aa4\u89e3\u3092\u6050\u308c\u305a\u306b\u3044\u3046\u306a\u308c\u3070\u3001&quot;\u578b\u5b89\u5168\u3067\u9ad8\u901f\u306aRails&quot;)</p>\n\n<h2>2. \u74b0\u5883\u69cb\u7bc9</h2>\n\n<p>\u306a\u306b\u306f\u3068\u3082\u3042\u308c\u3001\u74b0\u5883\u3064\u304f\u3063\u3066\u904a\u3093\u3067\u307f\u308b\u3002</p>\n\n<p>Mac\u3067\u3042\u308c\u3070Homebrew\u3092\u4f7f\u3063\u3066<code>brew install play</code>\u3067\u3082\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u53ef\u80fd\u3060\u304c\u3001\u4eca\u56de\u306f<a href=\"http://www.playframework-ja.org/documentation/2.0.3/Installing\">Play!Japan\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806</a>\u3092\u53c2\u8003\u306b\u74b0\u5883\u3092\u69cb\u7bc9\u3002</p>\n\n<p>\u524d\u63d0\u3068\u3057\u3066\u3001JDK 6\u4ee5\u964d\u304c\u5fc5\u8981\u306a\u306e\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3057\u3066\u304a\u304f\u3002</p>\n\n<p><a href=\"http://www.playframework-ja.org/\">Play!Japan</a>\u304b\u3089\u3001\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3(2012.11.04\u6642\u70b9\u30672.0.4)\u306ezip\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3002</p>\n\n<p>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u304d\u305fzip\u3092\u5c55\u958b\u3059\u308b\u3002\u5c55\u958b\u5148\u306f\u3001\u66f8\u304d\u8fbc\u307f\u6a29\u9650\u306e\u3042\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306a\u3089\u3001\u3069\u3053\u3067\u3082\u3088\u3044\u3068\u601d\u3046\u3002<br>\n(\u3069\u3053\u3067\u3082\u3088\u3044\u3068\u3044\u3063\u3066\u3082\u3001\u5e38\u8b58\u7684\u306a\u3068\u3053\u308d\u306b\u3002\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3067\u306f/opt\u4ee5\u4e0b\u306b\u306f\u5c55\u958b\u3057\u306a\u3044\u307b\u3046\u304c\u3088\u3044\u3068\u66f8\u3044\u3066\u3042\u308b\u3002/opt\u4ee5\u4e0b\u306f\u66f8\u304d\u8fbc\u307f\u6a29\u9650\u306a\u3044\u3088\u3063\u3066\u8b66\u544a\u3067\u308b\u304b\u3089\u304b\u306a\u3002)<br>\n\u4eca\u56de\u306f\u3001/usr/local/\u306bplay\u3092\u5c55\u958b\u3059\u308b\u3002<br>\n(\u3082\u3061\u308d\u3093\u30db\u30fc\u30e0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u4e0b\u3067\u3082\u3088\u3044\u3068\u601d\u3046\u3002)</p>\n\n<p>\u5c55\u958b\u3057\u305f\u3089\u3001\u5c55\u958b\u5148\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u30d1\u30b9\u3092\u901a\u3057\u3066\u304a\u304f\u3002<br>\n\u4eca\u56de\u306f/usr/local\u4ee5\u4e0b\u306b\u5c55\u958b\u3057\u305f\u306e\u3067\u3001.zsh_profile\u306b\u4ee5\u4e0b\u3092\u8ffd\u52a0\u3002</p>\n<div class=\"code-frame\"><div class=\"code-lang\"><span class=\"bold\">.zsh_profile</span></div><div class=\"highlight\"><pre>export PATH = $PATH:/usr/local/play-2.0.4\n</pre>\n</div>\n</div>\n<p>\u66f8\u304d\u8fbc\u3093\u3060\u3089\u3001.zsh_profile\u3092\u518d\u8aad\u307f\u8fbc\u307f\u3002</p>\n<div class=\"code-frame\"><div class=\"highlight\"><pre>source ~/.zsh_profile\n</pre>\n</div>\n</div>\n<p><code>play help</code>\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u305f\u304b\u78ba\u8a8d\u3002\u4e0b\u306e\u3088\u3046\u306a\u8868\u793a\u304c\u3067\u308c\u3070OK!\u3002</p>\n<div class=\"code-frame\"><div class=\"highlight\"><pre> _ _ \n _ __ | | __ _ _ _| |\n| &#39;_ \\| |/ _&#39; | || |_|\n| __/|_|\\____|\\__ (_)\n|_| |__/ \n\nplay! 2.0.4, http://www.playframework.org\n\nWelcome to Play 2.0!\n\nThese commands are available:\n-----------------------------\nlicense Display licensing informations.\nnew [directory] Create a new Play application in the specified directory.\n\nYou can also browse the complete documentation at http://www.playframework.org.\n</pre>\n</div>\n</div>","created_at":"2012-11-04 17:36:26 +0900","updated_at":"2012-11-04 17:41:48 +0900","created_at_in_words":"14\u6642\u9593\u524d","updated_at_in_words":"14\u6642\u9593\u524d","tags":[{"name":"Scala","url_name":"Scala","icon_url":"http://qiita.com/system/tags/icons/000/000/035/thumb/scala-logo.png?1329750745","item_count":51,"follower_count":224,"versions":[]}],"stock_count":0,"stock_users":[],"comment_count":0,"url":"http://qiita.com/items/6ece44845eaeae60cd4a","gist_url":null,"tweet":false,"private":false,"created_at_as_seconds":1352018186},{"id":10474,"uuid":"4ef605dbed3cfb6f79db","user":{"name":"nakajijiji","url_name":"nakajijiji","profile_image_url":"https://secure.gravatar.com/avatar/96a6f91114dce3ba9da1753fb319407b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png"},"title":"Mapper/Reducer \u66f8\u3044\u305f\u3088\u30fc","body":"<div class=\"code-frame\"><div class=\"code-lang\"><span class=\"bold\">mapper.rb</span></div><div class=\"highlight\"><pre><span class=\"c1\">#### mapper function</span>\n<span class=\"n\">env</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;develop&quot;</span>\n<span class=\"n\">data</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;&quot;</span>\n<span class=\"n\">output_file</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;map1.txt&quot;</span>\n<span class=\"k\">if</span> <span class=\"n\">env</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;develop&quot;</span><span class=\"c1\">## in development env</span>\n <span class=\"n\">path</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;dataset&quot;</span>\n <span class=\"n\">file_name</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;data1.txt&quot;</span>\n <span class=\"n\">f</span> <span class=\"o\">=</span> <span class=\"nb\">open</span><span class=\"p\">(</span><span class=\"n\">path</span> <span class=\"o\">+</span> <span class=\"s2\">&quot;/&quot;</span> <span class=\"o\">+</span> <span class=\"n\">file_name</span><span class=\"p\">)</span>\n <span class=\"k\">while</span> <span class=\"n\">line</span> <span class=\"o\">=</span> <span class=\"n\">f</span><span class=\"o\">.</span><span class=\"n\">gets</span>\n <span class=\"n\">data</span> <span class=\"o\">+=</span> <span class=\"n\">line</span><span class=\"o\">+</span><span class=\"s2\">&quot;</span><span class=\"se\">\\n</span><span class=\"s2\">&quot;</span>\n <span class=\"k\">end</span>\n<span class=\"k\">else</span> <span class=\"c1\">### in real env</span>\n <span class=\"n\">data</span> <span class=\"o\">=</span> <span class=\"no\">STDIN</span>\n<span class=\"k\">end</span>\n<span class=\"c1\">## output</span>\n<span class=\"n\">o</span> <span class=\"o\">=</span> <span class=\"nb\">open</span><span class=\"p\">(</span><span class=\"n\">path</span> <span class=\"o\">+</span> <span class=\"s2\">&quot;/&quot;</span> <span class=\"o\">+</span> <span class=\"n\">output_file</span><span class=\"p\">,</span><span class=\"s2\">&quot;w&quot;</span><span class=\"p\">)</span>\n<span class=\"c1\">## mapper</span>\n<span class=\"n\">data</span><span class=\"o\">.</span><span class=\"n\">each_line</span> <span class=\"k\">do</span> <span class=\"o\">|</span><span class=\"n\">line</span><span class=\"o\">|</span>\n <span class=\"n\">words</span> <span class=\"o\">=</span> <span class=\"n\">line</span><span class=\"o\">.</span><span class=\"n\">split</span><span class=\"p\">(</span><span class=\"s2\">&quot; &quot;</span><span class=\"p\">)</span>\n <span class=\"n\">words</span><span class=\"o\">.</span><span class=\"n\">each</span> <span class=\"k\">do</span> <span class=\"o\">|</span><span class=\"n\">word</span><span class=\"o\">|</span>\n <span class=\"n\">o</span><span class=\"o\">.</span><span class=\"n\">puts</span> <span class=\"n\">word</span> <span class=\"o\">+</span> <span class=\"s2\">&quot;</span><span class=\"se\">\\t</span><span class=\"s2\">&quot;</span> <span class=\"o\">+</span> <span class=\"s2\">&quot;1&quot;</span> \n <span class=\"k\">end</span>\n<span class=\"k\">end</span>\n<span class=\"n\">f</span><span class=\"o\">.</span><span class=\"n\">close</span>\n<span class=\"n\">o</span><span class=\"o\">.</span><span class=\"n\">close</span>\n</pre>\n</div>\n</div><div class=\"code-frame\"><div class=\"code-lang\"><span class=\"bold\">reducer.rb</span></div><div class=\"highlight\"><pre><span class=\"c1\">#### reducer</span>\n<span class=\"n\">env</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;develop&quot;</span>\n<span class=\"n\">data</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;&quot;</span>\n<span class=\"k\">if</span> <span class=\"n\">env</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;develop&quot;</span>\n <span class=\"n\">path</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;dataset&quot;</span>\n <span class=\"n\">file_name</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;map1.txt&quot;</span>\n <span class=\"n\">f</span> <span class=\"o\">=</span> <span class=\"nb\">open</span><span class=\"p\">(</span><span class=\"n\">path</span> <span class=\"o\">+</span> <span class=\"s2\">&quot;/&quot;</span> <span class=\"o\">+</span> <span class=\"n\">file_name</span><span class=\"p\">)</span>\n <span class=\"k\">while</span> <span class=\"n\">line</span> <span class=\"o\">=</span> <span class=\"n\">f</span><span class=\"o\">.</span><span class=\"n\">gets</span>\n <span class=\"n\">data</span> <span class=\"o\">+=</span> <span class=\"n\">line</span> \n <span class=\"k\">end</span>\n<span class=\"k\">else</span>\n <span class=\"n\">data</span> <span class=\"o\">=</span> <span class=\"no\">STDIN</span>\n<span class=\"k\">end</span>\n<span class=\"n\">h</span> <span class=\"o\">=</span> <span class=\"p\">{}</span>\n<span class=\"n\">prev_word</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;&quot;</span>\n<span class=\"n\">data</span><span class=\"o\">.</span><span class=\"n\">each_line</span> <span class=\"k\">do</span> <span class=\"o\">|</span><span class=\"n\">line</span><span class=\"o\">|</span>\n <span class=\"n\">m</span> <span class=\"o\">=</span> <span class=\"n\">line</span><span class=\"o\">.</span><span class=\"n\">split</span><span class=\"p\">(</span><span class=\"s2\">&quot;</span><span class=\"se\">\\t</span><span class=\"s2\">&quot;</span><span class=\"p\">)</span>\n <span class=\"k\">if</span> <span class=\"n\">m</span><span class=\"o\">[</span><span class=\"mi\">0</span><span class=\"o\">]</span> <span class=\"o\">!=</span> <span class=\"n\">prev_word</span>\n <span class=\"n\">h</span><span class=\"o\">[</span><span class=\"n\">m</span><span class=\"o\">[</span><span class=\"mi\">0</span><span class=\"o\">]]</span> <span class=\"o\">=</span> <span class=\"n\">m</span><span class=\"o\">[</span><span class=\"mi\">1</span><span class=\"o\">].</span><span class=\"n\">to_i</span>\n <span class=\"k\">else</span>\n <span class=\"n\">h</span><span class=\"o\">[</span><span class=\"n\">m</span><span class=\"o\">[</span><span class=\"mi\">0</span><span class=\"o\">]]</span> <span class=\"o\">+=</span> <span class=\"n\">m</span><span class=\"o\">[</span><span class=\"mi\">1</span><span class=\"o\">].</span><span class=\"n\">to_i</span>\n <span class=\"k\">end</span>\n <span class=\"n\">prev_word</span> <span class=\"o\">=</span> <span class=\"n\">m</span><span class=\"o\">[</span><span class=\"mi\">0</span><span class=\"o\">]</span>\n <span class=\"nb\">puts</span> <span class=\"n\">m</span><span class=\"o\">[</span><span class=\"mi\">1</span><span class=\"o\">]</span>\n<span class=\"k\">end</span>\n<span class=\"n\">h</span><span class=\"o\">.</span><span class=\"n\">each</span> <span class=\"k\">do</span> <span class=\"o\">|</span><span class=\"n\">key</span><span class=\"p\">,</span><span class=\"n\">value</span><span class=\"o\">|</span>\n <span class=\"nb\">puts</span> <span class=\"n\">key</span> <span class=\"o\">+</span> <span class=\"s2\">&quot;</span><span class=\"se\">\\t</span><span class=\"s2\">&quot;</span> <span class=\"o\">+</span> <span class=\"n\">value</span><span class=\"o\">.</span><span class=\"n\">to_s</span>\n<span class=\"k\">end</span>\n</pre>\n</div>\n</div>","created_at":"2012-11-04 16:41:28 +0900","updated_at":"2012-11-04 16:41:28 +0900","created_at_in_words":"15\u6642\u9593\u524d","updated_at_in_words":"15\u6642\u9593\u524d","tags":[{"name":"hadoop","url_name":"hadoop","icon_url":"http://qiita.com/system/tags/icons/000/000/179/thumb/hadoop-mini.png?1337321605","item_count":8,"follower_count":62,"versions":[]}],"stock_count":0,"stock_users":[],"comment_count":0,"url":"http://qiita.com/items/4ef605dbed3cfb6f79db","gist_url":null,"tweet":true,"private":false,"created_at_as_seconds":1352014888},{"id":10473,"uuid":"3b7d7035ae54cc48319c","user":{"name":"awakia","url_name":"awakia","profile_image_url":"https://secure.gravatar.com/avatar/c9b46fd431b733b14acac138015f0210?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"title":"Mac\u4e0a\u3067\u3001\u81ea\u5206\u306e\u30b5\u30a4\u30c8\u304ciPhone\u3067\u3069\u3046\u898b\u3048\u308b\u304b\u3092\u78ba\u8a8d\u3059\u308b","body":"<p>XCode\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002</p>\n\n<p>\u5f8c\u306f\u3001\u30b7\u30a7\u30eb\u3067</p>\n<div class=\"code-frame\"><div class=\"code-lang\"><span class=\"bold\">Terminal</span></div><div class=\"highlight\"><pre><span class=\"nv\">$ </span>open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone<span class=\"se\">\\ </span>Simulator.app/\n</pre>\n</div>\n</div>\n<p>\u3068\u53e9\u304f\u3060\u3051\u3002iPhoneSimulator\u304c\u8d77\u52d5\u3059\u308b\u3002</p>\n\n<p>Safari\u3092\u958b\u3044\u3066\u3001<code>localhost:3000</code>\u306a\u3069\u3068\u9069\u5f53\u306b\u6319\u52d5\u3092\u78ba\u8a8d\u3057\u305f\u3044URL\u3092\u5165\u308c\u308b\u3002</p>\n\n<p>iPhone\u30b7\u30df\u30e5\u30ec\u30fc\u30bf\u30fc\u306f\u3042\u304f\u307e\u3067\u30b7\u30df\u30e5\u30ec\u30fc\u30bf\u30fc\u3067\u305f\u307e\u306b\u5b9f\u969b\u3068\u6319\u52d5\u304c\u7570\u306a\u308b\u3053\u3068\u304c\u3042\u308b\u306e\u3067\u6ce8\u610f\u3002\u305f\u3060\u3001localhost\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3057\u3001\u7c21\u5358\u306b\u78ba\u8a8d\u3057\u305f\u3044\u6642\u306b\u306f\u5f79\u7acb\u3064\u306f\u305a\uff01</p>\n","created_at":"2012-11-04 13:25:40 +0900","updated_at":"2012-11-04 13:34:21 +0900","created_at_in_words":"18\u6642\u9593\u524d","updated_at_in_words":"18\u6642\u9593\u524d","tags":[{"name":"iPhone","url_name":"iPhone","icon_url":"http://qiita.com/system/tags/icons/000/000/019/thumb/k1014925770.jpeg?1316130246","item_count":166,"follower_count":2855,"versions":[]},{"name":"Mac","url_name":"Mac","icon_url":"http://qiita.com/system/tags/icons/000/000/042/thumb/logo_apple.jpeg?1317711132","item_count":220,"follower_count":400,"versions":[]}],"stock_count":1,"stock_users":["mryreplicant"],"comment_count":0,"url":"http://qiita.com/items/3b7d7035ae54cc48319c","gist_url":null,"tweet":false,"private":false,"created_at_as_seconds":1352003140},{"id":10472,"uuid":"3213e0c3b795d0040cff","user":{"name":"D.Aoki","url_name":"VienosNotes","profile_image_url":"https://si0.twimg.com/profile_images/1173973523/twitter_icon_jpg_normal.jpg"},"title":"\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u5927\u304d\u3055\u3092\u5236\u5fa1\u3059\u308b","body":"<p><code>bounds of window idx of application &quot;APPLICATION NAME&quot;</code>\u306e\u5024\u3092\u53c2\u7167\u3059\u308b\u3053\u3068\u3067\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u6301\u3064\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u3046\u3061\u3001\u524d\u304b\u3089idx\u756a\u76ee\u306e\u5927\u304d\u3055\u3068\u4f4d\u7f6e(rectangle)\u3092\u53d6\u5f97\u3059\u308b\u4e8b\u304c\u3067\u304d\u3001\u307e\u305f\u4e0a\u66f8\u304d\u3059\u308b\u3053\u3068\u3067\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u30b5\u30a4\u30ba\u3092\u5236\u5fa1\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002idx\u3092\u6307\u5b9a\u3057\u306a\u3044\u5834\u5408\u306f\u5168\u3066\u306e\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u30b5\u30a4\u30ba\u306e\u30ea\u30b9\u30c8\u304c\u8fd4\u3063\u3066\u304f\u308b\u306e\u3067\u3001\u7e8f\u3081\u3066\u5909\u66f4\u3057\u305f\u3044\u5834\u5408\u306f\u3053\u3061\u3089\u3092\u4f7f\u3046\u3068\u4fbf\u5229\u304b\u3082\u3057\u308c\u306a\u3044\u3002</p>\n\n<p>\u4ee5\u4e0b\u306b\u4f8b\u3068\u3057\u3066\u3001\u524d\u304b\u3089idx\u756a\u76ee\u306b\u3042\u308bGoogle Chrome\u306e\u5e45\u3092scale\u500d\u3059\u308bsetScale\u95a2\u6570\u3092\u793a\u3059(\u3053\u3053\u3067\u306f\u6700\u524d\u9762\u306e\u30a6\u30a3\u30f3\u30c9\u30a6\u5e45\u30923\u500d\u306b\u5f15\u304d\u4f38\u3070\u3057\u3066\u3044\u308b)\u3002</p>\n<div class=\"code-frame\"><div class=\"highlight\"><pre>on getCurrentSize(idx)\n bounds of the window idx of application &quot;Google Chrome&quot;\nend getCurrentSize\n\non setScale(idx, scale)\n set curSize to getCurrentSize(idx)\n set (item 3 of curSize) to (item 3 of curSize) * scale as integer\n set bounds of window idx of application &quot;Google Chrome&quot; to curSize\nend setScale\n\nsetScale(1, 3)\n</pre>\n</div>\n</div>","created_at":"2012-11-04 10:17:01 +0900","updated_at":"2012-11-04 10:28:47 +0900","created_at_in_words":"21\u6642\u9593\u524d","updated_at_in_words":"21\u6642\u9593\u524d","tags":[{"name":"AppleScript","url_name":"AppleScript","icon_url":"http://qiita.com/system/tags/icons/000/000/340/thumb/applescript.png?1336469507","item_count":4,"follower_count":16,"versions":[]},{"name":"Mac","url_name":"Mac","icon_url":"http://qiita.com/system/tags/icons/000/000/042/thumb/logo_apple.jpeg?1317711132","item_count":220,"follower_count":400,"versions":[]}],"stock_count":0,"stock_users":[],"comment_count":0,"url":"http://qiita.com/items/3213e0c3b795d0040cff","gist_url":null,"tweet":false,"private":false,"created_at_as_seconds":1351991821},{"id":10471,"uuid":"08c14999f7f731c858c2","user":{"name":"\u6c34\u57ce\u307f\u3064\u306f","url_name":"mituha","profile_image_url":"https://si0.twimg.com/profile_images/1745851032/image_normal.jpg"},"title":"mac\u521d\u5fc3\u8005\u306e\u30e1\u30e2","body":"<p>\u968f\u6642\u66f4\u65b0\u3002<br>\n\u308f\u304b\u3089\u306a\u304b\u3063\u305f\u4e8b\u3092\u7d20\u76f4\u306b\u9069\u5f53\u306b\u30e1\u30e2\u3057\u3066\u3044\u304f\u4e88\u5b9a\u3002<br>\n\u672c\u5f53\u306b\u66f8\u304d\u306a\u3050\u308a\u306e\u30e1\u30e2\u3067\u3059\u3002\u3054\u3081\u3093\u306a\u3055\u3044\u3002</p>\n\n<p>\u6280\u8853\u8005\u8996\u70b9\u3067\u306a\u304f\u3001\u672c\u6c17\u3067\u521d\u5fc3\u8005\u8996\u70b9</p>\n\n<h1>\u74b0\u5883</h1>\n\n<p>*mac mini 2011<br>\n*\u30de\u30a6\u30b9<br>\n \u305d\u306e\u8fba\u306b\u8ee2\u304c\u3063\u3066\u3044\u305fUSB\u30de\u30a6\u30b9<br>\n*\u30ad\u30fc\u30dc\u30fc\u30c9<br>\n\u30dd\u30b1\u30e2\u30f3\u30bf\u30a4\u30d4\u30f3\u30b0\u306e</p>\n\n<p>\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\u306b\u306f\uff1f<br>\nFinder\u304b\u3089\u306f\u65b0\u898f\u30d5\u30a9\u30eb\u30c0\u3057\u304b\u306a\u3044\u3002<br>\n\u6a19\u6e96\u3067\u306f\u306a\u3044\u3063\u307d\u3044\u3002<br>\nKobito\u3067\u306e\u30d5\u30a1\u30a4\u30eb\u9023\u643a\u306b\u652f\u969c\u304c\u3042\u308b\u306e\u3067\u3001\u3068\u308a\u3042\u3048\u305a\u3001Windows\u3067\u30d5\u30a1\u30a4\u30eb\u4f5c\u6210\u3002Dropbox\u306b\u7a81\u3063\u8fbc\u3080\u3002</p>\n\n<h2>\u6587\u5b57\u5165\u529b</h2>\n\n<p>\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u30de\u30fc\u30af(\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u30ad\u30fc)\u304c\u5909\u63db\u3067\u51fa\u306a\u3044\u3002<br>\n\u3072\u3089\u304c\u306a\u5165\u529b\u3067\u82f1\u5b57\u3092\u5165\u308c\u305f\u5834\u5408\u306e\u52d5\u4f5c<br>\n\u4f8b\u3048\u3070\u3001\u300cWindows\u300d\u3068\u304b\u3002<br>\n\u300c\u30a6\u30a3\u3093\u3069ws\u300d&lt;-\u3092\u300cWindows\u300d\u306b\u3057\u305f\u3044\u3002</p>\n\n<p>\u3043\u306fli\u3067\u306f\u306a\u304fxi</p>\n","created_at":"2012-11-04 06:52:59 +0900","updated_at":"2012-11-04 06:52:59 +0900","created_at_in_words":"1\u65e5\u524d","updated_at_in_words":"1\u65e5\u524d","tags":[{"name":"Mac","url_name":"Mac","icon_url":"http://qiita.com/system/tags/icons/000/000/042/thumb/logo_apple.jpeg?1317711132","item_count":220,"follower_count":400,"versions":[]}],"stock_count":0,"stock_users":[],"comment_count":0,"url":"http://qiita.com/items/08c14999f7f731c858c2","gist_url":null,"tweet":false,"private":false,"created_at_as_seconds":1351979579},{"id":10470,"uuid":"b4e45e2005aa38e90bcb","user":{"name":"taskie","url_name":"ctakise","profile_image_url":"https://secure.gravatar.com/avatar/15747303fab0c5682d3f88325ce2f158?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"title":"java.util.Arrays.binarySearch \u3067\u4e8c\u5206\u63a2\u7d22","body":"<p>\u8af8\u4e8b\u60c5\u306b\u3088\u308aJava\u3092\u4f7f\u308f\u306a\u304d\u3083\u3044\u3051\u306a\u304f\u306a\u3063\u305f\u3001\u305d\u3057\u3066\u4e8c\u5206\u63a2\u7d22\u304c\u3084\u308a\u305f\u304f\u306a\u3063\u305f\u306e\u3067\u30e1\u30e2\u3002\u591a\u5206java.util.Collections.binarySearch\u3067\u3082\u540c\u3058\u611f\u3058\u3002</p>\n\n<p><strong>java.util.Arrays.binarySearch</strong>\u306fint\u578b\u306e\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8 (<a href=\"http://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html\">Arrays (Java Platform SE 6)</a>) \u66f0\u304f\u3001</p>\n\n<blockquote>\n<p><strong>Returns:</strong><br>\nindex of the search key, if it is contained in the array; otherwise, (-(<em>insertion point</em>) - 1). The <em>insertion point</em> is defined as the point at which the key would be inserted into the array: the index of the first element greater than the key, or a.length if all elements in the array are less than the specified key. Note that this guarantees that the return value will be &gt;= 0 if and only if the key is found.</p>\n</blockquote>\n\n<p>\u9069\u5f53\u306b\u548c\u8a33\u3059\u308b\u3068\u3001</p>\n\n<blockquote>\n<p><strong>\u8fd4\u308a\u5024\uff1a</strong><br>\n\u914d\u5217\u304c\u691c\u7d22\u30ad\u30fc\u3092\u542b\u3080\u306a\u3089\u305d\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u8fd4\u3059\u3002\u542b\u307e\u306a\u3051\u308c\u3070\u3001 (-(<strong>\u633f\u5165\u4f4d\u7f6e</strong>) - 1) \u3092\u8fd4\u3059\u3002<strong>\u633f\u5165\u4f4d\u7f6e</strong>\u306f\u3001\u300c\u30ad\u30fc\u3092\u305d\u306e\u914d\u5217\u306b\u633f\u5165\u3059\u308b\u5834\u5408\u306e\u4f4d\u7f6e\u300d\u3068\u5b9a\u7fa9\u3055\u308c\u308b\u3002\u305d\u308c\u306f\u30ad\u30fc\u3088\u308a\u5927\u304d\u3044\u6700\u521d\u306e\u8981\u7d20\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3067\u3042\u308b\u304b\u3001\u305d\u306e\u914d\u5217\u306elength\u3067\u3042\u308b\uff08\u914d\u5217\u306e\u3059\u3079\u3066\u306e\u8981\u7d20\u304c\u6307\u5b9a\u3055\u308c\u305f\u30ad\u30fc\u3088\u308a\u5c0f\u3055\u3044\u5834\u5408\uff09\u3002\u3053\u308c\u306f\u300c\u30ad\u30fc\u304c\u898b\u3064\u304b\u3063\u305f\u6642\u306b\u306f\u8fd4\u308a\u5024\u306f0\u4ee5\u4e0a\u3068\u306a\u308a\u3001\u898b\u3064\u304b\u3089\u306a\u304b\u3063\u305f\u6642\u306b\u306f\u8fd4\u308a\u5024\u306f\u8ca0\u3068\u306a\u308b\u300d\u3053\u3068\u3092\u4fdd\u8a3c\u3059\u308b\u3001\u3068\u3044\u3046\u3053\u3068\u306b\u6ce8\u610f\u3002</p>\n</blockquote>\n\n<p>\u3064\u307e\u308a\u3001\u8fd4\u308a\u5024\u304c\u8ca0\u306a\u3089\u30d3\u30c3\u30c8\u5426\u5b9a\u3059\u308c\u3070\u633f\u5165\u4f4d\u7f6e\u3092\u5f97\u3089\u308c\u308b\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u306d\u3002</p>\n<div class=\"code-frame\"><div class=\"code-lang\"><span class=\"bold\">Java</span></div><div class=\"highlight\"><pre><span class=\"kt\">int</span><span class=\"o\">[]</span> <span class=\"n\">xs</span> <span class=\"o\">=</span> <span class=\"o\">{</span><span class=\"mi\">1</span><span class=\"o\">,</span> <span class=\"mi\">3</span><span class=\"o\">,</span> <span class=\"mi\">5</span><span class=\"o\">};</span>\n<span class=\"k\">for</span> <span class=\"o\">(</span><span class=\"kt\">int</span> <span class=\"n\">key</span> <span class=\"o\">=</span> <span class=\"mi\">0</span><span class=\"o\">;</span> <span class=\"n\">key</span> <span class=\"o\">&lt;=</span> <span class=\"mi\">6</span><span class=\"o\">;</span> <span class=\"o\">++</span><span class=\"n\">key</span><span class=\"o\">)</span>\n<span class=\"o\">{</span>\n <span class=\"kt\">int</span> <span class=\"n\">index</span> <span class=\"o\">=</span> <span class=\"n\">Arrays</span><span class=\"o\">.</span><span class=\"na\">binarySearch</span><span class=\"o\">(</span><span class=\"n\">xs</span><span class=\"o\">,</span> <span class=\"n\">key</span><span class=\"o\">);</span>\n <span class=\"k\">if</span> <span class=\"o\">(</span><span class=\"n\">index</span> <span class=\"o\">&lt;</span> <span class=\"mi\">0</span><span class=\"o\">)</span> <span class=\"n\">index</span> <span class=\"o\">=</span> <span class=\"o\">~</span><span class=\"n\">index</span><span class=\"o\">;</span>\n <span class=\"n\">System</span><span class=\"o\">.</span><span class=\"na\">out</span><span class=\"o\">.</span><span class=\"na\">println</span><span class=\"o\">(</span><span class=\"n\">index</span><span class=\"o\">);</span>\n<span class=\"o\">}</span>\n</pre>\n</div>\n</div>\n<p>\u51fa\u529b\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002</p>\n<div class=\"code-frame\"><div class=\"highlight\"><pre>0\n0\n1\n1\n2\n2\n3\n</pre>\n</div>\n</div>\n<p>\u914d\u5217\u304c\u6307\u5b9a\u30ad\u30fc\u3092\u8907\u6570\u542b\u3080\u5834\u5408\u3001\u5148\u982d\u306e\u65b9\u306b\u3042\u308b\u8981\u7d20\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u8fd4\u3063\u3066\u304f\u308b\u3068\u306f\u9650\u3089\u306a\u3044\uff08\u8981\u7d20\u304c1\u500b\u898b\u3064\u304b\u3063\u305f\u6642\u70b9\u3067\u63a2\u7d22\u306f\u6253\u3061\u5207\u3089\u308c\u308b\uff09\u306e\u3067\u3001C++\u306estd::lower_bound\uff08\u6307\u5b9a\u3057\u305f\u5024\u4ee5\u4e0a\u306e\u8981\u7d20\u304c\u521d\u3081\u3066\u51fa\u73fe\u3059\u308b\u5834\u6240\u3092\u53d6\u5f97\uff09\u306e\u3088\u3046\u306b\u306f\u4f7f\u3048\u306a\u3044\u3068\u3044\u3046\u3053\u3068\u306b\u6ce8\u610f\u3002</p>\n<div class=\"code-frame\"><div class=\"code-lang\"><span class=\"bold\">Java</span></div><div class=\"highlight\"><pre><span class=\"kn\">import</span> <span class=\"nn\">java.util.Comparator</span>\n\n<span class=\"kd\">class</span> <span class=\"nc\">LowerBoundComparator</span><span class=\"o\">&lt;</span><span class=\"n\">T</span> <span class=\"kd\">extends</span> <span class=\"n\">Comparable</span><span class=\"o\">&lt;?</span> <span class=\"kd\">super</span> <span class=\"n\">T</span><span class=\"o\">&gt;&gt;</span>\n<span class=\"kd\">implements</span> <span class=\"n\">Comparator</span><span class=\"o\">&lt;</span><span class=\"n\">T</span><span class=\"o\">&gt;</span>\n<span class=\"o\">{</span>\n <span class=\"kd\">public</span> <span class=\"kt\">int</span> <span class=\"nf\">compare</span><span class=\"o\">(</span><span class=\"n\">T</span> <span class=\"n\">x</span><span class=\"o\">,</span> <span class=\"n\">T</span> <span class=\"n\">y</span><span class=\"o\">)</span>\n <span class=\"o\">{</span>\n <span class=\"k\">return</span> <span class=\"o\">(</span><span class=\"n\">x</span><span class=\"o\">.</span><span class=\"na\">compareTo</span><span class=\"o\">(</span><span class=\"n\">y</span><span class=\"o\">)</span> <span class=\"o\">&gt;=</span> <span class=\"mi\">0</span><span class=\"o\">)</span> <span class=\"o\">?</span> <span class=\"mi\">1</span> <span class=\"o\">:</span> <span class=\"o\">-</span><span class=\"mi\">1</span><span class=\"o\">;</span>\n <span class=\"o\">}</span>\n<span class=\"o\">}</span>\n\n<span class=\"kd\">class</span> <span class=\"nc\">UpperBoundComparator</span><span class=\"o\">&lt;</span><span class=\"n\">T</span> <span class=\"kd\">extends</span> <span class=\"n\">Comparable</span><span class=\"o\">&lt;?</span> <span class=\"kd\">super</span> <span class=\"n\">T</span><span class=\"o\">&gt;&gt;</span>\n<span class=\"kd\">implements</span> <span class=\"n\">Comparator</span><span class=\"o\">&lt;</span><span class=\"n\">T</span><span class=\"o\">&gt;</span>\n<span class=\"o\">{</span>\n <span class=\"kd\">public</span> <span class=\"kt\">int</span> <span class=\"nf\">compare</span><span class=\"o\">(</span><span class=\"n\">T</span> <span class=\"n\">x</span><span class=\"o\">,</span> <span class=\"n\">T</span> <span class=\"n\">y</span><span class=\"o\">)</span>\n <span class=\"o\">{</span>\n <span class=\"k\">return</span> <span class=\"o\">(</span><span class=\"n\">x</span><span class=\"o\">.</span><span class=\"na\">compareTo</span><span class=\"o\">(</span><span class=\"n\">y</span><span class=\"o\">)</span> <span class=\"o\">&gt;</span> <span class=\"mi\">0</span><span class=\"o\">)</span> <span class=\"o\">?</span> <span class=\"mi\">1</span> <span class=\"o\">:</span> <span class=\"o\">-</span><span class=\"mi\">1</span><span class=\"o\">;</span>\n <span class=\"o\">}</span>\n<span class=\"o\">}</span>\n</pre>\n</div>\n</div>\n<p>\u306e\u3088\u3046\u306a\u30af\u30e9\u30b9\u3092\u4f5c\u3063\u3066\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092binarySearch\u306b\u5f15\u6570\u3068\u3057\u3066\u6e21\u305b\u3070\u305d\u308c\u3063\u307d\u3044\u3053\u3068\u306f\u3067\u304d\u308b\u307f\u305f\u3044\u3001\u3060\u304c\u2026\u2026\u3002</p>\n","created_at":"2012-11-04 06:40:43 +0900","updated_at":"2012-11-04 10:52:17 +0900","created_at_in_words":"1\u65e5\u524d","updated_at_in_words":"21\u6642\u9593\u524d","tags":[{"name":"Java","url_name":"Java","icon_url":"http://qiita.com/system/tags/icons/000/000/002/thumb/Java-Runtime-Environment-V6.0.260.png?1316130938","item_count":169,"follower_count":2117,"versions":[]}],"stock_count":0,"stock_users":[],"comment_count":0,"url":"http://qiita.com/items/b4e45e2005aa38e90bcb","gist_url":null,"tweet":false,"private":false,"created_at_as_seconds":1351978843},{"id":10469,"uuid":"f36607e11a7ac2129def","user":{"name":"\u6c34\u57ce\u307f\u3064\u306f","url_name":"mituha","profile_image_url":"https://si0.twimg.com/profile_images/1745851032/image_normal.jpg"},"title":"\u5c5e\u6027\u306e\u5f15\u6570\u306bdecimal\u3092\u4f7f\u7528\u3067\u304d\u306a\u3044\u4ed5\u69d8\u306b\u7d76\u671b\u3057\u305f","body":"<p>CS0182 \u306e\u300c\u5c5e\u6027\u5f15\u6570\u306f\u3001\u5b9a\u6570\u5f0f\u3001typeof \u5f0f\u3001\u307e\u305f\u306f\u5c5e\u6027\u30d1\u30e9\u30e1\u30fc\u30bf\u578b\u306e\u914d\u5217\u306e\u4f5c\u6210\u5f0f\u3067\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002\u300d\u306e\u30a8\u30e9\u30fc\u306b\u306a\u308b\u3002</p>\n\n<p><a href=\"http://msdn.microsoft.com/ja-jp/library/09ze6t76(VS.90).aspx\">http://msdn.microsoft.com/ja-jp/library/09ze6t76(VS.90).aspx</a></p>\n\n<p>(\u53e4\u3044\u60c5\u5831\u306e\u30b5\u30eb\u30d9\u30fc\u30b8\u4e2d)</p>\n","created_at":"2012-11-04 05:55:46 +0900","updated_at":"2012-11-04 05:55:46 +0900","created_at_in_words":"1\u65e5\u524d","updated_at_in_words":"1\u65e5\u524d","tags":[{"name":".NET","url_name":".NET","icon_url":"http://qiita.com/icons/thumb/missing.png","item_count":12,"follower_count":35,"versions":[]},{"name":"c#","url_name":"c%23","icon_url":"http://qiita.com/system/tags/icons/000/000/187/thumb/C_Sharp.png?1328867786","item_count":102,"follower_count":211,"versions":[]}],"stock_count":0,"stock_users":[],"comment_count":0,"url":"http://qiita.com/items/f36607e11a7ac2129def","gist_url":null,"tweet":false,"private":false,"created_at_as_seconds":1351976146},{"id":10468,"uuid":"16c979e6ca15d124141d","user":{"name":"\u6c34\u57ce\u307f\u3064\u306f","url_name":"mituha","profile_image_url":"https://si0.twimg.com/profile_images/1745851032/image_normal.jpg"},"title":"ComboBox\u3067OutOfMemoryException","body":"<p>System.OutOfMemoryException \u306f\u30cf\u30f3\u30c9\u30eb\u3055\u308c\u307e\u305b\u3093\u3067\u3057\u305f\u3002<br>\nMessage=&quot;\u30b3\u30f3\u30dc \u30dc\u30c3\u30af\u30b9\u306e\u9805\u76ee\u304c\u591a\u3059\u304e\u307e\u3059\u3002&quot;<br>\n\u3048\u3063\u3068\u3001\u610f\u5473\u304c\u308f\u304b\u308a\u307e\u305b\u3093\u3002</p>\n<div class=\"code-frame\"><div class=\"highlight\"><pre>using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Data;\nusing System.Drawing;\nusing System.Linq;\nusing System.Text;\nusing System.Windows.Forms;\n\nnamespace WindowsFormsApplication1\n{\n public partial class Form1 : Form\n {\n public Form1()\n {\n InitializeComponent();\n }\n\n private void button1_Click(object sender, EventArgs e)\n {\n this.comboBox1.Items.Add(new ErrorItem());\n }\n\n private class ErrorItem\n {\n public override string ToString()\n {\n return null;\n }\n }\n\n }\n}\n</pre>\n</div>\n</div>\n<p>ToString()\u3067null\u3092\u8fd4\u3059\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u7a81\u3063\u8fbc\u3080\u3068\u3053\u3093\u306a\u30a8\u30e9\u30fc\u306b\u306a\u308b\u3063\u307d\u3044\u3002</p>\n\n<p>(\u53e4\u3044\u60c5\u5831\u306e\u30b5\u30eb\u30d9\u30fc\u30b8\u4e2d)</p>\n","created_at":"2012-11-04 05:52:58 +0900","updated_at":"2012-11-04 05:52:58 +0900","created_at_in_words":"1\u65e5\u524d","updated_at_in_words":"1\u65e5\u524d","tags":[{"name":".NET","url_name":".NET","icon_url":"http://qiita.com/icons/thumb/missing.png","item_count":12,"follower_count":35,"versions":[]},{"name":"c#","url_name":"c%23","icon_url":"http://qiita.com/system/tags/icons/000/000/187/thumb/C_Sharp.png?1328867786","item_count":102,"follower_count":211,"versions":[]}],"stock_count":0,"stock_users":[],"comment_count":0,"url":"http://qiita.com/items/16c979e6ca15d124141d","gist_url":null,"tweet":false,"private":false,"created_at_as_seconds":1351975978},{"id":10467,"uuid":"e41d7864f0889a7d7a65","user":{"name":"\u6c34\u57ce\u307f\u3064\u306f","url_name":"mituha","profile_image_url":"https://si0.twimg.com/profile_images/1745851032/image_normal.jpg"},"title":"DataSet(DataTable)\u3067\u30e1\u30e2\u30ea\u30ea\u30fc\u30af","body":"<div class=\"code-frame\"><div class=\"highlight\"><pre>DataTable dt = new DataTable();\nDataRow dr = dt.NewRow();\ndr = null;\n</pre>\n</div>\n</div>\n<p>NewRow\u3067\u306e\u4f5c\u6210\u3068\u653e\u68c4\u3092\u7e70\u308a\u8fd4\u3059\u3068\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u3068\u306a\u308a\u307e\u3059\u3002</p>\n\n<p>\u300c\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u3068\u306f\u8a00\u3044\u307e\u305b\u3093\u300d\u3068\u304b\u3001\u300c\u4ed5\u69d8\u3067\u3059\u300d\u3068\u304b\u306f\u306a\u3057\u3067\u3002</p>\n\n<p>DataTable\u3092\u6c4e\u7528\u306e\u304a\u624b\u8efd\u306a\u30c7\u30fc\u30bf\u69cb\u9020\u3068\u3057\u3066\u4f7f\u7528\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u5f8c\u3005\u56f0\u3063\u305f\u4e8b\u306b\u2026<br><br>\n\u30b9\u30ec\u30c3\u30c9\u30bb\u30fc\u30d5\u306b\u3059\u308b\u306b\u3082DataTable\u5358\u4f4d\u3067\u30ed\u30c3\u30af\u304c\u5fc5\u8981\u3068\u304b\u3002</p>\n\n<p>(\u53e4\u3044\u60c5\u5831\u306e\u30b5\u30eb\u30d9\u30fc\u30b8\u4e2d)</p>\n","created_at":"2012-11-04 05:52:26 +0900","updated_at":"2012-11-04 05:52:26 +0900","created_at_in_words":"1\u65e5\u524d","updated_at_in_words":"1\u65e5\u524d","tags":[{"name":".NET","url_name":".NET","icon_url":"http://qiita.com/icons/thumb/missing.png","item_count":12,"follower_count":35,"versions":[]},{"name":"c#","url_name":"c%23","icon_url":"http://qiita.com/system/tags/icons/000/000/187/thumb/C_Sharp.png?1328867786","item_count":102,"follower_count":211,"versions":[]}],"stock_count":0,"stock_users":[],"comment_count":0,"url":"http://qiita.com/items/e41d7864f0889a7d7a65","gist_url":null,"tweet":false,"private":false,"created_at_as_seconds":1351975946},{"id":10466,"uuid":"f5093aabf3ed35fdaf1c","user":{"name":"garaemon","url_name":"garaemon","profile_image_url":"https://si0.twimg.com/profile_images/2620253983/5564B202-AD70-4BF9-A88D-7D907526B7D8_normal"},"title":"git\u306esubmodule\u306b\u5909\u66f4\u3092\u52a0\u3048\u308b\u3068diff\u304c\u751f\u3058\u308b\u306e\u3092\u7121\u8996\u3059\u308b","body":"<p>git\u306esubmodule\u306b\u5909\u66f4\u304c\u52a0\u308f\u308b\u3068\u3001diff\u304c\u751f\u3058\u3066\u3057\u307e\u3044\u307e\u3059\u304c\u3001commit\u3067\u304d\u306a\u304f\u3066<br>\n\u6c17\u6301\u3061\u60aa\u3044\u3067\u3059</p>\n<div class=\"code-frame\"><div class=\"highlight\"><pre>diff --git a/bootstrap b/bootstrap\n--- a/bootstrap\n+++ b/bootstrap\n@@ -1 +1 @@\n-Subproject commit 3b3dd3ac3c7b69d02406ede69bffcc4ee8a1ed6b\n+Subproject commit 3b3dd3ac3c7b69d02406ede69bffcc4ee8a1ed6b-dirty\n</pre>\n</div>\n</div>\n<p>\u3053\u308c\u3092\u7121\u8996\u3059\u308b\u306b\u306f\u3001<code>$project/.gitmodules</code>\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u3001<code>ignore = dirty</code>\u3092\u8ffd\u52a0\u3057\u307e\u3059</p>\n<div class=\"code-frame\"><div class=\"highlight\"><pre>[submodule &quot;bootstrap&quot;]\n path = bootstrap\n url = git://github.com/twitter/bootstrap.git\n ignore = dirty\n</pre>\n</div>\n</div>\n<p>\u3053\u308c\u3067diff\u304c\u51fa\u306a\u304f\u306a\u3063\u3066\u7cbe\u795e\u885b\u751f\u7684\u306b\u826f\u304f\u306a\u308a\u307e\u3059\u3002</p>\n","created_at":"2012-11-03 23:54:59 +0900","updated_at":"2012-11-03 23:54:59 +0900","created_at_in_words":"1\u65e5\u524d","updated_at_in_words":"1\u65e5\u524d","tags":[{"name":"git","url_name":"git","icon_url":"http://qiita.com/system/tags/icons/000/000/049/thumb/Git-Icon-1788C.png?1339654953","item_count":234,"follower_count":837,"versions":[]}],"stock_count":14,"stock_users":["watson1978","yaotti","yuyuchu3333","taka0125","repeatedly","ToQoz","naoty_k","ryu22e","rosylilly","3a3k","rkworks@github","xga","makisyu","noromanba@github"],"comment_count":0,"url":"http://qiita.com/items/f5093aabf3ed35fdaf1c","gist_url":null,"tweet":true,"private":false,"created_at_as_seconds":1351954499},{"id":10465,"uuid":"7a12ca611705017bcb0e","user":{"name":"Gen Tamura","url_name":"GenTamura84","profile_image_url":"https://si0.twimg.com/profile_images/2378845729/j5hs3slgh54kg6fkpqnp_normal.png"},"title":"Heroku\u306e\u672c\u756a\u74b0\u5883\u306bRails\u3067SSL(https)\u3092\u5c0e\u5165\u3059\u308b\u65b9\u6cd5","body":"<p>\u74b0\u5883\u306f\u3001rails 3.2.6\u3001ruby 1.9.3\u3001heroku-toolbelt/2.33.0 \u3067\u3059\u3002</p>\n\n<hr>\n\n<h1>\u79d8\u5bc6\u9375\u3092\u4f5c\u308b</h1>\n\n<p>\uff08\u53c2\u8003\uff09<a href=\"https://devcenter.heroku.com/articles/csr\">https://devcenter.heroku.com/articles/csr</a></p>\n<div class=\"code-frame\"><div class=\"highlight\"><pre>$ openssl genrsa -des3 -out server.orig.key 2048\n...\nEnter pass phrase for server.key: \u9069\u5f53\u306a\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u3002\nVerifying - Enter pass phrase for server.key: \u3082\u3046\u4e00\u5ea6\u540c\u3058\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u3002\n</pre>\n</div>\n</div>\n<p>WEB\u30b5\u30fc\u30d0\u30fc\u306b\u81ea\u52d5\u3067\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u305f\u3081\u306b\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5916\u3057\u3066\u304a\u304d\u307e\u3059\u3002</p>\n<div class=\"code-frame\"><div class=\"highlight\"><pre>$ openssl rsa -in server.orig.key -out server.key\n</pre>\n</div>\n</div>\n<p>\u7f72\u540d\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u4f5c\u308a\u307e\u3059</p>\n<div class=\"code-frame\"><div class=\"highlight\"><pre>$ openssl req -new -key server.key -out server.csr\nYou are about to be asked to enter information that will be incorporated\ninto your certificate request.\nWhat you are about to enter is what is called a Distinguished Name or a DN.\nThere are quite a few fields but you can leave some blank\nFor some fields there will be a default value,\nIf you enter &#39;.&#39;, the field will be left blank.\n-----\nCountry Name (2 letter code) [AU]:JP \u203b\u56fd\u540d\nState or Province Name (full name) [Some-State]:Hokkaido \u203b\u90fd\u9053\u5e9c\u770c\nLocality Name (eg, city) []:Hakodate \u203b\u5e02\u533a\u753a\u6751\nOrganization Name (eg, company) [Internet Widgits Pty Ltd]:Helply LLC. \u203b\u4f1a\u793e\u540d\nOrganizational Unit Name (eg, section) []: \u203b\u90e8\u7f72\uff08\u5165\u529b\u305b\u305a\uff09\nCommon Name (eg, YOUR name) []:www.helply.net \u203b\u8a3c\u660e\u66f8\u306b\u8868\u793a\u3055\u308c\u308b\u540d\u524d\nEmail Address []:gen.tamura@helply.net \u203b\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\n\nPlease enter the following &#39;extra&#39; attributes\nto be sent with your certificate request\nA challenge password []:\u203b\u5165\u529b\u305b\u305a\nAn optional company name []:\u203b\u5165\u529b\u305b\u305a\n</pre>\n</div>\n</div>\n<p>\u79c1\u306f\u4e0a\u8a18\u306e\u3088\u3046\u306b\u5165\u529b\u3057\u307e\u3057\u305f\u3002\u304a\u597d\u307f\u3067\u3044\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br>\n\u203b\u3061\u306a\u307f\u306b\u3053\u306e\u4e00\u9023\u306e\u4f5c\u696d\u306fRails\u306eapp\u3084config\u304c\u3042\u308b\u968e\u5c64\u3067\u4fdd\u5b58\u3057\u3066\u307e\u3059\u3002</p>\n\n<hr>\n\n<h1>\u8a3c\u660e\u66f8\u3092\u8cfc\u5165\u3059\u308b</h1>\n\n<p>\uff08\u53c2\u8003\uff09<a href=\"https://devcenter.heroku.com/articles/ssl-certificate\">https://devcenter.heroku.com/articles/ssl-certificate</a></p>\n\n<ol>\n<li><p>\u8a3c\u660e\u8a3c\u3092\u8cfc\u5165\u3057\u307e\u3057\u3087\u3046\u3002\u79c1\u306fHeroku\u304a\u3059\u3059\u3081\u306eDNSimple\u304b\u3089\u8cfc\u5165\u3057\u307e\u3057\u305f\u3002<br>\n<a href=\"https://dnsimple.com/\">https://dnsimple.com/</a></p></li>\n<li><p>\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u3064\u304f\u3063\u305f\u3089\u3001<strong>Domains</strong>\u306e<strong>Add a Domain</strong>\u304b\u3089\u5e0c\u671b\u306e\u30c9\u30e1\u30a4\u30f3\u3092\u8ffd\u52a0\u3057\u307e\u3057\u3087\u3046\u3002\uff08\u79c1\u306fhelply.net\u3092\u8ffd\u52a0\u3002\uff09</p></li>\n<li><p>\u8ffd\u52a0\u3057\u305f\u30c9\u30e1\u30a4\u30f3\u306e\u53f3\u7aef\u306b\u3042\u308b<strong>Manage</strong>\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002</p></li>\n<li><p>\u753b\u9762\u4e2d\u592e\u306e<strong>SSL Certificates</strong>\u306b\u3042\u308b<strong>Buy an SSL certificate</strong>\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002</p></li>\n<li><p>\u8cfc\u5165\u306b\u3042\u305f\u3063\u3066\u306e\u60c5\u5831\u3092\u5165\u529b\u3057\u307e\u3059\u3002<br>\n\u203b1\u70b9\u6ce8\u610f\u304c\u3042\u3063\u3066\u3001\u30b5\u30d6\u30c9\u30e1\u30a4\u30f3\u3092\u6307\u5b9a\u3059\u308b\u5834\u5408\u306f$20/\u5e74\u3067\u3001*\uff08\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\uff09\u3060\u3068$100/\u5e74\u3068\u306a\u308b\u306e\u3067\u3054\u6ce8\u610f\u4e0b\u3055\u3044\u3002</p></li>\n<li><p>\u6700\u5f8c\u306b\u300cPlease generate a private key and certificate signing request for me. Uncheck this box to provide the CSR yourself. If you generate your own CSR it must be valid.\u300d\u3068\u3042\u308a\u307e\u3059\u304c\u3001\u30c1\u30a7\u30c3\u30af\u306f\u3064\u3051\u305f\u307e\u307e\u3067\u767b\u9332\u3057\u307e\u3057\u3087\u3046\u3002<br>\n\uff08\u5916\u3059\u3068csr\u3092\u81ea\u5206\u3067\u4f5c\u3063\u3066\u306d\u3002\u3068\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u5916\u3059\u3068\u30cf\u30de\u308b\u6c17\u304c\u3057\u307e\u3059\uff09</p></li>\n<li><p>\u6b21\u306e\u30da\u30fc\u30b8\u306b\u3001\u300c<a href=\"mailto:admin@yourdomain.com\">admin@yourdomain.com</a>\u3001<a href=\"mailto:webmaster@yourdomain.com\">webmaster@yourdomain.com</a>\u3001<a href=\"mailto:root@yourdomain.com\">root@yourdomain.com</a>\u300d\u306a\u3069\u306e\u7ba1\u7406\u8005\u7528\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u9078\u629e\u3059\u308b\u753b\u9762\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u308c\u306f\u5f8c\u307b\u3069\u3001\u8a3c\u660e\u6a5f\u95a2\u304b\u3089\u627f\u8a8dURL\u3092\u53d7\u4fe1\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u3067\u3059\u3002\u8868\u8a18\u3055\u308c\u305f\u8a72\u5f53\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u6301\u3063\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u65b0\u305f\u306b\u8a72\u5f53\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u53d6\u5f97\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u3067\u3001\u3054\u6ce8\u610f\u4e0b\u3055\u3044\u3002</p></li>\n<li><p>\u5b8c\u4e86\u3059\u308b\u3068\u3001DNSimple\u304b\u3089\u300c8\u6642\u9593\u4ee5\u5185\u306b\u8a3c\u660e\u6a5f\u95a2\u304b\u3089\u3001\u8a3c\u660e\u66f8\u3092\u627f\u8a8d\u3059\u308b\u305f\u3081\u306e\u30ea\u30f3\u30af\u304c\u5c4a\u304d\u307e\u3059\u3002\u300d\u3068\u3044\u3046\u5185\u5bb9\u306e\u30e1\u30fc\u30eb\u304c\u5c4a\u304d\u307e\u3059\u3002\u5c11\u3057\u5f85\u3061\u307e\u3057\u3087\u3046\u3002\uff08\u79c1\u306f10\u5206\u3050\u3089\u3044\u3067\u5c4a\u304d\u307e\u3057\u305f\u3002\uff09</p></li>\n<li><p>\u3057\u3070\u3089\u304f\u3059\u308b\u3068\u3001GeoTrust\uff08\u8a3c\u660e\u6a5f\u95a2\uff09\u304b\u3089\u300cApprover Email\u304c\u5c4a\u304f\u304b\u3089\u3088\u308d\u3057\u304f\u306d\u3002\u300d\u306a\u308b\u30e1\u30fc\u30eb\u304c\u5c4a\u304d\u307e\u3059\u3002\u305d\u306e\u306e\u3061\u3001\u7ba1\u7406\u8005\u7528\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306b\u5c4a\u304f\u300cRapidSSL Certificate Request Confirmation<br>\n\u300d\u3092\u78ba\u8a8d\u3057\u3001\u300c\u3042\u306a\u305f\u306e\u304a\u540d\u524d requests that you come to the URL below to review and approve this certificate request:\u300d\u306e\u6587\u7ae0\u306e\u4e0b\u306e\u30ea\u30f3\u30af\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002</p></li>\n<li><p>\u3059\u308b\u3068\u65e5\u672c\u8a9e\u3067\u66f8\u304b\u308c\u305f\u300cRapidSSL\u00ae \u6ce8\u6587\u306e\u78ba\u8a8d\u304a\u3088\u3073\u627f\u8a8d\u300d\u3068\u3044\u3046\u66f8\u5f0f\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u306e\u3067\u3001\u4e00\u756a\u4e0b\u306e\u300c\u627f\u8a8d\u3057\u307e\u3059\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002</p></li>\n<li><p>\u3053\u308c\u3067\u8cfc\u5165\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002GeoTrust\u304b\u3089\u5b8c\u4e86\u30e1\u30fc\u30eb\u304c\u5c4a\u304d\u307e\u3059\u3002</p></li>\n</ol>\n\n<h1>\u8a3c\u660e\u66f8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b</h1>\n\n<p>\uff08\u53c2\u8003\uff09<a href=\"https://devcenter.heroku.com/articles/ssl-certificate\">https://devcenter.heroku.com/articles/ssl-certificate</a> \u306e Download certificate files\u4ee5\u4e0b</p>\n\n<ol>\n<li><p>DNSimple\u3092\u958b\u304d\u3001<strong>Domains</strong>\u2192<strong>SSL Certificates</strong>\u306e<strong>Details</strong>\u3092\u30af\u30ea\u30c3\u30af\u3002</p></li>\n<li><p>Status\u304c\u300cCertificate Issued\u300d\u3068\u306a\u3063\u3066\u3044\u308c\u3070\u3001\u300cPrivate Key:\u300d\u3068\u300cCertificate:\u300d\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u3002\u203b\u8cfc\u5165\u5b8c\u4e86\u3057\u3066\u304b\u3089\u3001\u5c11\u3057\u6642\u9593\u304c\u5fc5\u8981\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002</p></li>\n<li><p>\u3053\u3053\u3067\u300cCertificate:\u300d\u3092<code>server.orig.crt</code>\u306b\u4fdd\u5b58\u3057\u307e\u3059\u3002\u203b\u4fdd\u5b58\u306f\u6700\u521d\u306e\u300c-\u300d\u304b\u3089\u6700\u5f8c\u306e\u6539\u884c\u307e\u3067\u3067\u3059\u3002<br>\n<strong>\u203b\u3053\u3053\u306f\u672a\u78ba\u8a8d\u306a\u306e\u3067\u3059\u304c\u3001\u4ee5\u4e0b\u306bserver.key\u3092\u5229\u7528\u3059\u308b\u5834\u9762\u304c\u3067\u3066\u3053\u306a\u3044\u306e\u3067\u3001DNSimple\u5074\u306eserver.key\u306f\u4fdd\u5b58\u3057\u3066\u3044\u307e\u305b\u3093\u3002Heroku\u5074\u306e\u8aac\u660e\u3068\u306f\u7570\u306a\u308a\u307e\u3059</strong></p></li>\n<li><p>Heroku\u3067\u306f\u30b5\u30a4\u30c8\u8a3c\u660e\u66f8\u3068\u4e2d\u9593\u8a3c\u660e\u66f8\u3092\u4e00\u3064\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u307e\u3068\u3081\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br>\n\u305d\u3053\u3067\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002</p></li>\n</ol>\n<div class=\"code-frame\"><div class=\"highlight\"><pre>curl https://knowledge.rapidssl.com/library/VERISIGN/ALL_OTHER/RapidSSL%20Intermediate/RapidSSL_CA_bundle.pem &gt; rapidssl_bundle.pem\n cat server.orig.crt rapidssl_bundle.pem &gt; server.crt\n</pre>\n</div>\n</div>\n<hr>\n\n<h1>Heoku\u306eSSL\u5c0e\u5165</h1>\n\n<p>\\1. \u30a2\u30c9\u30aa\u30f3\u3092\u8ffd\u52a0\u3059\u308b</p>\n<div class=\"code-frame\"><div class=\"highlight\"><pre>$ heroku addons:add ssl\nAdding ssl on young-planet-6921... done, v1 ($20/mo)\nNext add your certificate with `heroku certs:add PEM KEY`.\nUse `heroku addons:docs ssl` to view documentation.\n</pre>\n</div>\n</div>\n<p>\\2. \u30c9\u30e1\u30a4\u30f3\u3092\u8a2d\u5b9a\u3059\u308b\uff08\u3059\u3067\u306b\u72ec\u81ea\u30c9\u30e1\u30a4\u30f3\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u4e0d\u8981\uff09</p>\n<div class=\"code-frame\"><div class=\"highlight\"><pre>$ heroku domains:add www.mydomain.com\nAdded www.mydomain.com to myapp... done\n</pre>\n</div>\n</div>\n<p>\\3. \u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u8ffd\u52a0\u3059\u308b</p>\n<div class=\"code-frame\"><div class=\"highlight\"><pre>$ heroku plugins:install https://github.com/heroku/heroku-ssl-doctor.git\n</pre>\n</div>\n</div>\n<p>\u203b\u5b9f\u306f4\u3067\u3069\u3046\u306b\u3082\u9032\u307e\u306a\u304f\u306a\u308a\u3001Heroku\u306e\u30b5\u30dd\u30fc\u30c8\u3078\u30e1\u30fc\u30eb\u3092\u3057\u305f\u3089\u3001\u3053\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u6559\u3048\u3066\u3082\u3089\u3044\u307e\u3057\u305f\u3002</p>\n\n<p>\\4. \u8a3c\u660e\u66f8\u3092\u8ffd\u52a0\u3059\u308b</p>\n<div class=\"code-frame\"><div class=\"highlight\"><pre>$ heroku certs:add server.crt server.key\nAdding SSL Endpoint to myapp... done\nmyapp now served by tokyo-2121.herokussl.com.\nCertificate details:\nExpires At: 2012-10-31 21:53:18 GMT\nIssuer: C=US; ST=CA; L=SF; O=Heroku; CN=www.mydomain.com\nStarts At: 2011-11-01 21:53:18 GMT\nSubject: C=US; ST=CA; L=SF; O=Heroku; CN=www.mydomain.com\nSSL certificate is self signed.\n</pre>\n</div>\n</div>\n<hr>\n\n<h1>DNS\u3092\u5909\u66f4\u3059\u308b</h1>\n\n<p>\\1. Heroku\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u78ba\u8a8d</p>\n\n<p>\u3055\u3063\u304d\u306e4\u3067\u8868\u793a\u3055\u308c\u305fEndpoint\u3092\u78ba\u8a8d\u3002<br>\n\u3053\u3053\u3067\u306f\u3001tokyo-2121.herokussl.com.</p>\n\n<p>\\2. \u3054\u5229\u7528\u306e\u30cd\u30fc\u30e0\u30b5\u30fc\u30d0\u30fc\u306b\u30ec\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3002</p>\n\n<p>\u300cwww.mydomain.com\u300d\u306a\u3069\u306e\u72ec\u81ea\u30c9\u30e1\u30a4\u30f3\u306b\u5bfe\u3057\u3066\u3001CNAME\u3067\u300chost tokyo-2121.herokussl.com\u300d\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002</p>\n\n<h1>Rails\u306e\u8a2d\u5b9a\u3092\u5909\u66f4\u3059\u308b</h1>\n\n<p>\u6700\u5f8c\u306bRails\u306e\u8a2d\u5b9a\u5909\u66f4\u3067\u3059\u3002<br>\n\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u3001\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u306b\u306a\u3063\u3066\u3044\u308b\u3068\u601d\u3046\u306e\u3067\u3001<br>\n\u30b3\u30e1\u30f3\u30c8\u30a4\u30f3\u3057\u307e\u3059\u3002false\u306a\u3089true\u3078\u3002</p>\n<div class=\"code-frame\"><div class=\"code-lang\"><span class=\"bold\">config/environments/production.rb</span></div><div class=\"highlight\"><pre><span class=\"n\">config</span><span class=\"o\">.</span><span class=\"n\">force_ssl</span> <span class=\"o\">=</span> <span class=\"kp\">true</span>\n</pre>\n</div>\n</div>\n<p>\u4ee5\u4e0a\u3067\u3001https\u3067\u306e\u30a2\u30af\u30bb\u30b9\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002</p>\n\n<hr>\n\n<p>\u307e\u3060\u307e\u3060\u521d\u5fc3\u8005\u306a\u306e\u3067\u3001\u3054\u6307\u6458\u3044\u305f\u3060\u3051\u308b\u3068\u52a9\u304b\u308a\u307e\u3059\u3002<br>\n\u3088\u308d\u3057\u304f\u304a\u9858\u3044\u3057\u307e\u3059\u3002</p>\n","created_at":"2012-11-03 19:40:26 +0900","updated_at":"2012-11-04 00:30:00 +0900","created_at_in_words":"1\u65e5\u524d","updated_at_in_words":"1\u65e5\u524d","tags":[{"name":"Rails","url_name":"Rails","icon_url":"http://qiita.com/system/tags/icons/000/000/034/thumb/Ruby_on_Rails_logo.jpeg?1320170723","item_count":487,"follower_count":468,"versions":[]},{"name":"Ruby","url_name":"Ruby","icon_url":"http://qiita.com/system/tags/icons/000/000/003/thumb/ruby.jpeg?1316130908","item_count":853,"follower_count":2897,"versions":[]},{"name":"Heoku","url_name":"Heoku","icon_url":"http://qiita.com/icons/thumb/missing.png","item_count":1,"follower_count":1,"versions":[]},{"name":"Ssl","url_name":"Ssl","icon_url":"http://qiita.com/icons/thumb/missing.png","item_count":9,"follower_count":0,"versions":[]}],"stock_count":7,"stock_users":["murajun1978","yujiym","awakia","yahihi@github","kanpou_","karim26","puriketu99"],"comment_count":0,"url":"http://qiita.com/items/7a12ca611705017bcb0e","gist_url":null,"tweet":false,"private":false,"created_at_as_seconds":1351939226},{"id":10464,"uuid":"db9ca99f3e1c407a83f1","user":{"name":"Yoshinori Kawasaki","url_name":"kawasy","profile_image_url":"https://secure.gravatar.com/avatar/9c548d5065a922a81fdc1dc3f62cad8d?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"title":"GitHub\u5185URL\u306eURL\u77ed\u7e2e\u30b5\u30fc\u30d3\u30b9git.io\u306e\u4f7f\u3044\u65b9","body":"<div class=\"code-frame\"><div class=\"highlight\"><pre>$ curl -i http://git.io -F &quot;url=http://github.com/wantedly&quot; -F &quot;code=wantedly&quot;\n</pre>\n</div>\n</div>\n<p>\u3067\u4ee5\u4e0b\u306e\u69d8\u306a\u77ed\u7e2eURL\u304c\u4f5c\u3089\u308c\u308b\u3002</p>\n\n<p><a href=\"http://git.io/wantedly\">http://git.io/wantedly</a></p>\n\n<p>code\u30d1\u30e9\u30e1\u30bf\u3092\u6307\u5b9a\u3057\u306a\u304b\u3063\u305f\u308a\u3001<a href=\"http://git.io\">http://git.io</a> \u3067\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u4f5c\u3063\u305f\u5834\u5408\u306f\u77ed\u7e2e\u540d\u306f\u9069\u5f53\u306a\u5024\u306b\u306a\u308b\u3002</p>\n\n<p>\u53c2\u7167: <a href=\"https://github.com/blog/985-git-io-github-url-shortener\">https://github.com/blog/985-git-io-github-url-shortener</a></p>\n","created_at":"2012-11-03 17:50:22 +0900","updated_at":"2012-11-03 17:50:22 +0900","created_at_in_words":"1\u65e5\u524d","updated_at_in_words":"1\u65e5\u524d","tags":[{"name":"Github","url_name":"Github","icon_url":"http://qiita.com/system/tags/icons/000/000/090/thumb/Octocat.jpg?1320170917","item_count":50,"follower_count":455,"versions":[]}],"stock_count":2,"stock_users":["awakia","_kachick"],"comment_count":0,"url":"http://qiita.com/items/db9ca99f3e1c407a83f1","gist_url":null,"tweet":false,"private":false,"created_at_as_seconds":1351932622},{"id":10463,"uuid":"8f6c179126af10f2ff0d","user":{"name":"Yoshinori Kawasaki","url_name":"kawasy","profile_image_url":"https://secure.gravatar.com/avatar/9c548d5065a922a81fdc1dc3f62cad8d?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"title":"GitHub Flavored Markdown\u3067\u4f7f\u3048\u308b\u7d75\u6587\u5b57\u4e00\u89a7","body":"<p>Pull request\u3084Issue\u3067\u4f7f\u3048\u308b\u7d75\u6587\u5b57\u306e\u30ea\u30b9\u30c8<br>\n<a href=\"http://www.emoji-cheat-sheet.com/\">http://www.emoji-cheat-sheet.com/</a></p>\n\n<p>\u6700\u8fd1autocomplete\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f(ruby\u306esymbol\u3092\u30b3\u30e1\u30f3\u30c8\u306b\u66f8\u3053\u3046\u3068\u3057\u3066autocomplete\u306b\u306a\u308b\u306e\u304c\u3061\u3087\u3063\u3068\u3046\u3056\u3044\u3051\u3069\u3002\u3002\u3002)<br>\n<a href=\"https://github.com/blog/1289-emoji-autocomplete\">https://github.com/blog/1289-emoji-autocomplete</a></p>\n\n<p>:+1: \u306f\u4f7f\u3044\u3084\u3059\u3044\u3067\u3059\u306d\u3002</p>\n\n<p>Qiita Flavored Markdown\u3067\u3082\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u307b\u3057\u3044\uff01</p>\n","created_at":"2012-11-03 17:22:43 +0900","updated_at":"2012-11-03 17:23:43 +0900","created_at_in_words":"1\u65e5\u524d","updated_at_in_words":"1\u65e5\u524d","tags":[{"name":"Github","url_name":"Github","icon_url":"http://qiita.com/system/tags/icons/000/000/090/thumb/Octocat.jpg?1320170917","item_count":50,"follower_count":455,"versions":[]}],"stock_count":2,"stock_users":["awakia","_kachick"],"comment_count":0,"url":"http://qiita.com/items/8f6c179126af10f2ff0d","gist_url":null,"tweet":false,"private":false,"created_at_as_seconds":1351930963},{"id":10462,"uuid":"7deeb7a887ffdfaf916f","user":{"name":"Yuichi Ikeda","url_name":"yuch_i","profile_image_url":"https://secure.gravatar.com/avatar/42d8e0e1ea97dd2f0da96d52856a7a6d?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"title":"nil\u30c1\u30a7\u30c3\u30af\u306e\u5206\u5c90\u3092\u305b\u305a\u306b\u6587\u5b57\u5217\u8868\u793a","body":"<p>Objective-C\u3067\u306fnil\u306b\u4f55\u3092\u9001\u3063\u3066\u3082nil\u306a\u306e\u3067nil\u30c1\u30a7\u30c3\u30af\u304c\u4e0d\u8981\u3067\u3059\u304c\u3001Ruby\u306f\u305d\u3046\u3067\u306f\u306a\u3044\u306e\u3067\u6587\u5b57\u5217\u3092\u8868\u793a\u3059\u308b\u5834\u5408\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5206\u5c90\u304c\u5fc5\u8981\u306b\u306a\u3063\u3066\u304d\u307e\u3059\u3002</p>\n<div class=\"code-frame\"><div class=\"code-lang\"><span class=\"bold\"></span></div><div class=\"highlight\"><pre>item.nil? &#39;&#39; ? item.created_at.strftime(&quot;%Y/%m/%d %H:%M&quot;)\n</pre>\n</div>\n</div>\n<p>\u3053\u3093\u306a\u306e\u6bce\u56de\u66f8\u3044\u3066\u305f\u3089\u3046\u3056\u3044\u306a\u30fc\u3002\u3044\u3061\u3044\u3061\u30e2\u30c7\u30eb\u306b\u8868\u793a\u7528\u306e\u30e1\u30bd\u30c3\u30c9\u5b9a\u7fa9\u3059\u308b\u306e\u3082\u3081\u3093\u3069\u3044\u306a\u30fc\u3002</p>\n\n<p>\u305d\u3093\u306a\u6642\u306e\u305f\u3081\u306bRails\u306b\u306ftry\u30e1\u30bd\u30c3\u30c9\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u3057\u305f\u3002</p>\n<div class=\"code-frame\"><div class=\"code-lang\"><span class=\"bold\"></span></div><div class=\"highlight\"><pre>item.created_at.try(:strftime, &quot;%Y/%m/%d %H:%M&quot;)\n</pre>\n</div>\n</div>\n<p>\u3088\u304b\u3063\u305f\u3002</p>\n","created_at":"2012-11-03 16:31:52 +0900","updated_at":"2012-11-03 16:33:20 +0900","created_at_in_words":"1\u65e5\u524d","updated_at_in_words":"1\u65e5\u524d","tags":[{"name":"Rails","url_name":"Rails","icon_url":"http://qiita.com/system/tags/icons/000/000/034/thumb/Ruby_on_Rails_logo.jpeg?1320170723","item_count":487,"follower_count":468,"versions":[]},{"name":"Ruby","url_name":"Ruby","icon_url":"http://qiita.com/system/tags/icons/000/000/003/thumb/ruby.jpeg?1316130908","item_count":853,"follower_count":2897,"versions":[]}],"stock_count":1,"stock_users":["yahihi@github"],"comment_count":0,"url":"http://qiita.com/items/7deeb7a887ffdfaf916f","gist_url":null,"tweet":false,"private":false,"created_at_as_seconds":1351927912},{"id":10461,"uuid":"40e7b50f0cce52f394b2","user":{"name":"tomykaira","url_name":"tomy_kaira","profile_image_url":"https://secure.gravatar.com/avatar/196fcecb9032f580dbed8d06a3aac090?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"title":"OCaml \u3092\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304b\u3089\u30d3\u30eb\u30c9\u3057\u305f\u3068\u304d\u3001ocamlbuild.cmx \u304c\u306a\u3044\u3068\u8a00\u308f\u308c\u308b","body":"<p>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304b\u3089\u30d3\u30eb\u30c9\u3057\u305f OCaml 4.0.0 \u3092\u4f7f\u3063\u3066\u3044\u3066\u3001 bisect \u3068\u3044\u3046 ocamlbuild \u3092\u5229\u7528\u3059\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30d3\u30eb\u30c9\u3057\u3088\u3046\u3068\u3057\u305f\u3068\u3053\u308d\u3001\u6b21\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u304c\u51fa\u305f\u3002</p>\n<div class=\"code-frame\"><div class=\"highlight\"><pre>+ /usr/local/bin/ocamlopt -I /usr/local/lib/ocaml/ocamlbuild unix.cmxa /usr/local/lib/ocaml/ocamlbuild/ocamlbuildlib.cmxa myocamlbuild.ml /usr/local/lib/ocaml/ocamlbuild/ocamlbuild.cmx -o myocamlbuild\nFile &quot;myocamlbuild.ml&quot;, line 1:\nError: Cannot find file /usr/local/lib/ocaml/ocamlbuild/ocamlbuild.cmx\nCommand exited with code 2.\n</pre>\n</div>\n</div>\n<p>ocamlbuild.cmx \u306f\u3075\u3064\u3046\u306b\u30d3\u30eb\u30c9\u3057\u305f\u3060\u3051\u3067\u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u306a\u3044\u69d8\u5b50\u3002</p>\n\n<p>ocaml \u306e make \u3092\u5b9f\u884c\u3059\u308b\u3068</p>\n<div class=\"code-frame\"><div class=\"highlight\"><pre> ./configure\n make world\n make opt\n make install\n</pre>\n</div>\n</div>\n<p>\u306e\u3088\u3046\u306b\u30d2\u30f3\u30c8\u304c\u51fa\u3066\u304f\u308b\u304c\u3001\u3053\u308c\u306b\u52a0\u3048\u3066</p>\n<div class=\"code-frame\"><div class=\"highlight\"><pre>make world.opt\nsudo make install\n</pre>\n</div>\n</div>\n<p>\u3092\u5b9f\u884c\u3057\u305f\u3089\u7121\u4e8b\u30d0\u30a4\u30ca\u30ea\u7248\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3001\u5192\u982d\u306e\u30a8\u30e9\u30fc\u3092\u89e3\u6d88\u3067\u304d\u305f\u3002</p>\n","created_at":"2012-11-03 14:26:17 +0900","updated_at":"2012-11-03 14:26:17 +0900","created_at_in_words":"1\u65e5\u524d","updated_at_in_words":"1\u65e5\u524d","tags":[{"name":"OCaml","url_name":"OCaml","icon_url":"http://qiita.com/icons/thumb/missing.png","item_count":3,"follower_count":32,"versions":["4.0.0"]}],"stock_count":0,"stock_users":[],"comment_count":0,"url":"http://qiita.com/items/40e7b50f0cce52f394b2","gist_url":null,"tweet":false,"private":false,"created_at_as_seconds":1351920377}]
// moment.js
// version : 1.7.0
// author : Tim Wood
// license : MIT
// momentjs.com
// moment.lang_ja.js
// このスクリプトは moment.js の表示文言部分を日本語でオーバーライドしたものです。
// ライセンスは本家を継承します。
// 本家moment.jsのあとに呼んでください。
// 例:
// <script src="moment.js"></script>
// <script src="moment.lang_ja.js"></script>
// 作成者:佐藤 毅 (株式会社ジーティーアイ http://gti.jp )
moment.lang('ja', {
// months : "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
months : "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),
// monthsShort : "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),
monthsShort : "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),
// weekdays : "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
weekdays : "日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),
// weekdaysShort : "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),
weekdaysShort : "(日)_(月)_(火)_(水)_(木)_(金)_(土)".split("_"),
// weekdaysMin : "Su_Mo_Tu_We_Th_Fr_Sa".split("_"),
weekdaysMin : "日_月_火_水_木_金_土".split("_"),
longDateFormat : {
LT : "h:mm A",
L : "MM/DD/YYYY",
LL : "MMMM D YYYY",
LLL : "MMMM D YYYY LT",
LLLL : "dddd, MMMM D YYYY LT"
},
meridiem : function (hours, minutes, isLower) {
if (hours > 11) {
return isLower ? 'pm' : 'PM';
} else {
return isLower ? 'am' : 'AM';
}
},
calendar : {
sameDay : '[Today at] LT',
nextDay : '[Tomorrow at] LT',
nextWeek : 'dddd [at] LT',
lastDay : '[Yesterday at] LT',
lastWeek : '[last] dddd [at] LT',
sameElse : 'L'
},
relativeTime : {
future : "%s後",
past : "%s前",
// s : "a few seconds",
s : "ちょっと",
// m : "a minute",
m : "約1分",
// mm : "%d minutes",
mm : "%d分",
// h : "an hour",
h : "約1時間",
// hh : "%d hours",
hh : "%d時間",
// d : "a day",
d : "1日",
// dd : "%d days",
dd : "%d日",
// M : "a month",
M : "1ヶ月",
// MM : "%d months",
MM : "%dヶ月",
// y : "a year",
y : "1年",
// yy : "%d years"
yy : "%d年"
},
ordinal : function (number) {
var b = number % 10;
return (~~ (number % 100 / 10) === 1) ? 'th' :
(b === 1) ? 'st' :
(b === 2) ? 'nd' :
(b === 3) ? 'rd' : 'th';
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.