View test_nokogiri_xml.rb
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/local/bin/ruby | |
# coding: utf-8 | |
# | |
# Ruby script to verify the speed of xml parsing by Nokogiri. | |
# | |
# Copyright(C) 2015 mk-mode.com All Rights Reserved. | |
#--------------------------------------------------------------------------------- | |
#++ | |
require 'benchmark' | |
require 'nokogiri' |
View iso_3166_1.csv
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
English short name | Alpha-2 code | Alpha-3 code | Numeric | |
---|---|---|---|---|
Afghanistan | AF | AFG | 004 | |
Åland Islands | AX | ALA | 248 | |
Albania | AL | ALB | 008 | |
Algeria | DZ | DZA | 012 | |
American Samoa | AS | ASM | 016 | |
Andorra | AD | AND | 020 | |
Angola | AO | AGO | 024 | |
Anguilla | AI | AIA | 660 | |
Antarctica | AQ | ATA | 010 |
View iso_3166_2_jp.csv
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
3166-2 code | Subdivision name | Language code | |
---|---|---|---|
JP-01 | Hokkaido | en | |
JP-01 | Hokkaidô | ja | |
JP-02 | Aomori | ja | |
JP-03 | Iwate | ja | |
JP-04 | Miyagi | ja | |
JP-05 | Akita | ja | |
JP-06 | Yamagata | ja | |
JP-07 | Fukushima | en | |
JP-07 | Hukusima | ja |
View read_excel.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spreadsheet' | |
XLS = "./test.xls" | |
class ReadExcel | |
# 読み込み | |
def read | |
begin | |
# Excelファイルを読み込み | |
wb = Spreadsheet.open(XLS, 'r') |
View noaa_stations.rb
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
# *************************************** | |
# Ruby script to calculate a summary of | |
# the list of NOAA's weather stations. | |
# *************************************** | |
require 'open-uri' | |
class NoaaStations | |
FILE = "http://www.aviationweather.gov/static/adds/metars/stations.txt" | |
def initialize |
View noaa_weather_station.sh
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
#!/bin/bash | |
# 引数(ICAO コード)不正なら終了 | |
if [[ ! "$1" =~ [0-9A-Z]{4} ]]; then | |
echo "Wrong argument! - $1" | |
exit | |
fi | |
# 定数定義 | |
URL="http://www.aviationweather.gov/static/adds/metars/stations.txt" |
View test_maptools.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ライブラリの読み込み | |
library(maptools) | |
library(RColorBrewer) | |
# Shape ファイルのフルパス | |
shp <- '/path/to/shapefile.shp' | |
# Shape ファイルの読み込み | |
# map <- readShapePoly(shp) # これでもよい | |
map <- readShapeSpatial(shp) |
View test_maptools_ksj.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ライブラリの読み込み | |
library(gpclib) | |
library(ggplot2) | |
library(maptools) | |
# gpclib ライセンス警告表示の抑止 | |
gpclibPermit() | |
# Shape ファイルのフルパス | |
shp_file <- '/path/to/N03-140401_32_GML/N03-14_32_140401.shp' |
View earthquake.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 国土地理院・地球地図日本に地震情報をプロット | |
# ライブラリの読み込み | |
library(gpclib) | |
library(ggplot2) | |
library(maptools) | |
# gpclib ライセンス警告表示の抑止 | |
gpclibPermit() |
View GetHtml.cpp
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
/*********************************************************** | |
* HTML 取得(テキストファイル保存) | |
**********************************************************/ | |
#include <fstream> // for ofstream | |
#include <iostream> // for cout, endl | |
#include <stdio.h> // for fopen | |
#include <string.h> // for strlen | |
#include <curl/curl.h> // Require `libcurl4-openssl-dev` | |
#include <list> // list |
OlderNewer