hirax.net::Keywords::「XML」のブログ



2009-10-28[n年前へ]

Mathematica からRuby on Railsのモデルを使う 

  Using Ruby on Rails Models with Mathematica

Mathematica lets you connect to databases using DatabaseLink. When this feature was introduced it was a very exciting feature. You no longer depended on text files to get you data into Mathematica. In recent years, a new web development framework called Ruby on Rails has been gaining popularity very fast. Rails includes a component called ActiveRecord which allows you to get access to your data and define relationships without need to write SQL.

 When you want to do complex analysis of your data using Mathematica you may benefit by accessing your data from your ActiveRecord models instead of the bare database.

2013-09-10[n年前へ]

Yahoo!雨雲ズームレーダの天気情報を取得してみよう!? 

 東京近辺の降雨状況情報提供サイトの定番と言えば、「東京あめっしゅ」です。細かな地域毎・時間毎に降雨変化を知る事ができて、その推移を眺めることもできて、実に便利です。…そんな東京あめっしゅよりも、Yahoo!雨雲ズームレーダの方が良い・面白い、という話を聞いたので、早速使ってみることにしました。

 Yahoo! デベロッパーネットワークトップ > YOLP(地図) > 気象情報API から、アプリケーションIDを登録した上で、気象情報APIのリクエストURLに「気象情報を知りたい緯度・経度」を投げると、過去・現在・未来(予報)の気象情報が返されます。たとえば、Mathematicaでこんなコードを書くと、気象情報が入ったXMLを得ることができて、

data = Import[
  "http://weather.olp.yahooapis.jp/v1/place?coordinates=hoge, "XML"]
そのXMLをパースすると、たとえば下のような(横軸が時間=分、縦軸が降雨量を示した)降雨量推移・予測グラフを描くことができます。5〜10分刻みの(過去の)降雨量推移や、あるいは未来の予報を知ることができるなら、日々刻々の私たちの判断も、それに応じて(ほんの少しだけ)最適化されていくかもしれないですね。

Yahoo!雨雲ズームレーダの天気情報を取得してみよう!?








■Powered by yagm.net