Skip to content

Instantly share code, notes, and snippets.

#! usr/bin/env python
#! -*-coding: utf-8-*-
#author@Shoichi Otomo
import urllib2
url = 'https://joa.epi.bz/api/prcavg?token=aaa&date=2012-08-01&lat=30.2&lon=130.5'
response = urllib2.urlopen(url)
the_page = response.read()

###1st step

  • confirm echo$SHELL
#!/bin/bash
  • 変数事始 echo "hello world" exit 0は、作法的なもので、異常終了していないことを明示する
#!/usr/bin/python
#!coding: utf-8
from BeautifulSoup import BeautifulStoneSoup
doc = open('watersupplysites.xml')
soup = BeautifulStoneSoup(''.join(doc))
for ln in soup:
#!/bin/bash
#!coding: utf-8
#!Author@Shoichi Otomo

for i in `seq {range}`
do
	echo convert -flip f$i.png f$i\_flip.png
	convert -flip f$i.png f$i\_flip.png
done
@geojackass
geojackass / index.html
Last active August 29, 2015 14:04
advent calender foss4g #2014 geo people
<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="author" content="Shoichi Otomo">
<head>
<title>qgis_book</title>
<style type="text/css">
#canvas {
width: 80%;
height: 80%;
margin: 0;
itokawa <- read.table("itokawa_f0049152.txt", skip=1, nrow=25350)
x <- itokawa[,2]
y <- itokawa[,3]
z <- itokawa[,4]
#package rglを呼び出す
library(rgl)
#lim指定を行う
plot3d(x = x, y = y, z = z, xlim=c(-0.4, 0.4), ylim=c(-0.4, 0.4), zlim=c(-0.4, 0.4))
@geojackass
geojackass / aggregate.R
Last active August 29, 2015 14:17
集合演算
# original
A B
1 1 2
2 1 3
3 2 3
4 3 5
5 3 6
# For example:
A B
@geojackass
geojackass / get_steephill_data.py
Created May 6, 2015 14:19
steephillからとりあえずデータを取得する。##TODOタグをよく確認して、BeautifulSoupでstartlistを作成する。
In [5]:
import urllib
url = "http://www.steephill.tv/giro-d-italia/"
res = urllib.urlopen(url)
html = res.read()
html
Out[5]:
@geojackass
geojackass / euro_sport_watcher.md
Last active August 29, 2015 14:24
euro sportのサーバーから配信される、ストリームのポップアップ広告どうにかならないか問題の解決に向けた実験計画

作業メモ

IPアドレスによる配信先国別に内容の変化を有無を調査する
  1. StealthyでIPを発信元国もしくはEU圏に偽装してみる
  2. 表示される内容をブラウザで確認する
各種モダンブラウザ別にストリームの内容を確認する
  1. switcherで各種モダンブラウザを用いた場合の挙動を確認する
  2. 表示される内容をブラウザで確認してみる
@geojackass
geojackass / pct_change_corr.py
Last active August 29, 2015 14:26
calc corr
spx_px = close_px_all["SPX"]
spx_rets = spx_px / spx_px.shift(1) -1
returns = close_px.pct_change()
corr = pd.rolling_corr(returns, spx_rets, 125, min_periods=100)