This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script> | |
<script type="text/javascript">// <![CDATA[ | |
if (navigator.geolocation) { | |
navigator.geolocation.getCurrentPosition(function(position) { | |
//s = position.coords.latitude+","+position.coords.longitude; | |
//document.getElementById('latlng').innerHTML = s; | |
var geocoder; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p id="chiristmas" style="font-size: xx-large;"> </p> | |
<script type="text/javascript">// <![CDATA[ | |
var now =new Date(); | |
var new_year = new Date("Dec 25, 2012 0:0:0"); | |
var num_of_yoi = 1+( new_year.getTime() - now.getTime())/ 86400000; | |
field= document.getElementById('chiristmas'); | |
var yois = ""; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p id="countdown_death_per" style="font-size: x-large;"> </p> | |
<script type="text/javascript">// <![CDATA[ | |
function tokei_death_per(){ | |
var now =new Date(); | |
var birth_year = new Date("Apr 23, 1980 0:0:0"); | |
var sec = -( birth_year.getTime() - now.getTime())/1000; | |
var per = sec/31556926/80.37 *100; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding: utf-8 -*- | |
require "MeCab" | |
require "twitter" | |
require "open-uri" | |
require "uri" | |
require "kconv" | |
require "ir_b" | |
list =Twitter.list_timeline("tomo3141592653", "met",:per_page=>300) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 ガリヴァー旅行記 | |
2 アイルランドの貧民の子供たちが両親及び国の負担となることを防ぎ、国家社会の有益なる存在たらしめるための穏健なる提案 | |
3 アーサー王宮廷のコネチカット・ヤンキー | |
4 ファウンデーションシリーズ(アシモフ) | |
5 トリフィド時代 | |
6 星を継ぐものシリーズ | |
7 思考の道具箱(ルディーラッカー) | |
8 人間はどこまでチンパンジーか?/銃 病原菌 鉄/文明崩壊 | |
9 ニンジャスレイヤー | |
10 精子戦争 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding: utf-8 -*- | |
require 'rubygems' | |
require 'mechanize' #gem install mechanize | |
require 'uri' | |
def item2url(item) | |
item = item.split("(").first | |
item = item.split("/").first | |
item_escape = URI.escape(item) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/ruby -Ku | |
#usage: | |
#type to terminal "ruby xlsx_to_tsv.rb hoge.xlsx" and then hoge.tsv will be made in the current folder. | |
#or you can also use wildcard ex "ruby xlsx_to_tsv.rb *.xlsx" | |
#YOU SHULD NOTE THAT *.tsv in current folder will be overwritten. | |
#data is assumed to be only in first sheet. | |
require 'rubygems' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import math | |
def gcd(a, b): | |
while b: | |
a, b = b, a % b | |
return a | |
count_coprime = 0 | |
count_all = 0 | |
while(1): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# usage: | |
# install exiftool from http://www.sno.phy.queensu.ca/~phil/exiftool/ | |
# set folder name as yyyymmdd(ex.20060801) | |
# and type | |
# ls | ruby exif_edit.rb | |
while gets | |
folder = $_.chomp | |
date = folder[0..3] +":"+ folder[4..5] + ":" + folder[6..7] + " 12:0:0" | |
`exiftool -alldates=\'#{date}\' -overwrite_original #{folder}/*.JPG` | |
p folder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def get_z(arr): | |
return (np.median(arr) - arr.mean())/arr.std() | |
arr = (np.random.rand(101) * 10000).astype("int") | |
z = get_z(arr) | |
for ite in range(1000000): | |
i = int(np.random.rand()*101) |
OlderNewer