2009年11月30日月曜日

Google Maps API V3の MVCObject.bindTo()の使用例

Google Maps API v3のMVCObject.bindTo()メソッドは、他のMVCObjectのプロパティを連動させることができます。
これを利用して、チェックボックスのチェックが変化すると、マーカーのvisibleプロパティが変化するようにしています。

うまく使えば便利、なのかな?設計的にかっこよくはある。

via ひひーん!

GMapKitAPIは廃止されるらしい

GMapKit.Googleマップ 拡張ライブラリ 「GMapKitAPI」

GMapKitAPI は、近い将来廃止されます。
代わりのライブラリをgmaps-utility-library-dev でサポートする予定です

あらら。残念&期待。

via ひひーん!

携帯の各キャリアで表示できる画像フォーマット

携帯は各会社の端末ごとに表示できる画像の形式が違います。携帯サイトで画像を使う場合には、画像のサイズや種類(jpeg・jpg、gif、png)に注意しないといけません。

なるほど

via ひひーん!

substr()と substring()

文字列 "Standard" から "and" という文字を切り出したい場合は、PHPなら
substr("Standard", 2,3)と文字の始まりのインデックスと切り取るバイト数を渡しますが、JAVAなら話は違って
"Standard".substring(2,5)と2つの引数共に文字列のインデックスを渡します。

JavaScriptのsubstr()とsubstring()の違いと同じだね。

via ひひーん!

2009年11月29日日曜日

Twitter Stream APIで特定のキーワードの Tweetを受信する

track

Specifies keywords to track. Keywords are specified by a comma separated list. Queries are subject to Track Limitations, described in Track Limiting and subject to access roles, describe in the statuses/filter method. Track keywords are case-insensitive logical ORs. Terms are exact-matched, and also exact-matched ignoring punctuation. Phrases, keywords with spaces, are not supported. Keywords containing punctuation will only exact match tokens. Some UTF-8 keywords will not match correctly- this is a known temporary defect.

 

Track examples: The keyword Twitter will match all public statuses with the following comma delimited tokens in their text field: TWITTER, twitter, "Twitter", twitter., #twitter and @twitter. The following tokens will not be matched: TwitterTracker and http://www.twitter.com,  The phrase, excluding quotes, "hard alee" won't match anything. The keyword "helm's-alee" will match helm's-alee but not #helm's-alee.

 

Values: Strings separated by commas. Each string must be between 1 and 30 bytes, inclusive.

Methods: statuses/filter

Example: Create a file called 'tracking' that contains, exactly and excluding the quotation marks: "track=basketball,football,baseball,footy,soccer". Execute: curl -d @tracking http://stream.twitter.com/1/statuses/filter.json -uAnyTwitterUser:Password.You will receive JSON updates about various crucial sportsball topics and events.

1つのキーワードにつき30バイトまで。キーワード数は200まで。
昔は日本語駄目だったけど今は堂なんだろう?

via ひひーん!

firehoseとは

statuses/firehose

Returns all public statuses. The Firehose is not a generally available resource. Few applications require this level of access. Creative use of a combination of other resources and various access levels can satisfy nearly every application use case.

 

URL: http://stream.twitter.com/1/statuses/firehose.>format

Formats: xml, json

Method(s): GET

Parameters: count, delimited

Returns: stream of status elements

Tiwtter Stream APIで全てのTweetを得られるAPI、だけど提携企業しか使えない。

via ひひーん!

2009年11月27日金曜日

Firefoxの select要素のクリックイベントには罠があるらしい

onclick=”javascript:arguments[0].stopPropagation();

何の呪文だろう?
調査しないと

via ひひーん!

ListCampの 「Googleのサービス」

Googleのサービス

googleweb
since 2008/08/14

12 個の情報

12個どころじゃないでしょう

via ひひーん!

IE8で Google Mapsのクリックした位置がずれる問題は解消しないらしい

"At this time we do not plan on fixing this issue in the IE8 time frame. We appreciate the report, but unfortunately we are at a stage where need to choose what we work on to maximize the value for customers and web developers. We will track the issue and hope to address it in a future version of IE. " http://connect.microsoft.com/IE/feedback/ViewFeedback.aspx?FeedbackID=362142

Microsoftとしてはこれを解決するよりIE9に注力したいと。
Google Maps側では対処が難しい問題なんだろう。(Chrome Frameとか?)

via ひひーん!

2009年11月26日木曜日

Google AJAX API にAuto-Loading機能が追加されたらしい

Auto-Loading New!

It is possible to auto-load a list of APIs or Javascript libraries when including the loader script. This can be done in order to reduce the load time in many cases by eliminating a single Javascript request at load time. This advanced feature can be difficult to implement, depending on the exact situation. Therefore, we recommend that auto-loading only be considered in specific cases when a reduction in latency is crucial.

To use this feature, you can start with the configuration wizard. To use it manually, the list of APIs to load is specified in the initial <script> tag, rather than a separate google.load call for each.

使いどころが分からない。1ミリ秒でも早くしたい場合とか???

via ひひーん!

google.load()で Google Maps API v3がロードできるらしい

Google AJAX API を使用して、

google.load("maps", "3.x", {"other_params":"sensor=false"});

のように、バージョン3のMapsAPIを呼んでみましたが、

英語版の公式リファレンス( http://code.google.com/intl/en/apis/ajax/documentation/#GoogleLoad )にもないが、もう使えるらしい

via ひひーん!

Google Maps API V3で未実装のOverviewコントロールを自力で実装

http://koti.mbnet.fi/ojalesa/v3/overview_v3.htm

It is an interesting experiment to see the binding of two MVC objects.
It works both ways. You can drag either of the maps.

すごいなー

via ひひーん!

Google Maps API V3でイベントをハンドリングするサンプル

  google.maps.event.addListener(map, 'click', function(event) {
    placeMarker
(event.latLng);
 
});

event.latLngのLngのLが大文字なので注意!

via ひひーん!

Google Maps API の英語版ドキュメント(マニュアル)の充実ぶり

V3のリファレンスもあるし。
というか日本語版が放置されているのか

via ひひーん!

Blogger (blogspot)のページタイトルでエントリーのタイトルを先にする方法

そこで、Bloggerを使っている方々にとって重要なのは、個別記事のタイトル部分を「記事タイトル:ブログ名(ブログタイトル)」となるように、変更してしまう事だ。
しかし、Bloggerにはクリック一つでタイトル部分を入れ替える方法は無い。
そこで、直接HTMLソースを変えてしまおうというわけだ。

pageNameって隠し設定か?(違うのかな)

via ひひーん!

DELLから 超小型デスクトップPCが出るらしい

発売した「インスパイロン Zino HD」は通常のデスクトップパソコンと同じCPU(中央演算処理装置)やグラフィック機能を備えており、フルハイビジョン動画や3次元ゲームなどをスムーズに再生できる。大きさは縦と横がそれぞれ約20センチメートルと小型で、場所を選ばずに設置できる。

ちょっとしたサーバにちょうどいいかも。静音性とかどうなんだろ?

via ひひーん!

RT: 子供と二人で毎日過ごしてた時

自転車に乗って帰ろうと思っていたら、店から出てきたさっきの人とは違う、知らないおじさんが「気にするなよ」と言って笑いかけてくれた。「ありがとうございます」と言って泣きながら頭を下げたら「子供が泣くのは当たり前だから!がんばれよー!」と言って、おじさんはニコニコ手を振って車に乗って帰っていった。

そういう人に私もなりたい

via ひひーん!

2009年11月25日水曜日

CakePHPの GetTextで poファイルのファイル名を default以外にする方法

ドメインとはファイル名のdefault.poの拡張子を除いた値に該当します。

例として、

__d('sample', 'This is a message');  

とすると、指定言語のフォルダのsample.poファイルからmsgidが'This is a message'の対訳を取得します。

こういうことだったのか。分類ごとにpoファイルを分割するときに使うのかな?

via ひひーん!

CakePHPの i18nで作った potファイルを更新した時に poファイルにマージする方法

今後の作業でテキストの追加等を行った場合は、
「cake i18n」 コマンドでまた、default.pot を作成し、
Poeditで「カタログ」→「POTファイルを元に更新します」→default.potを指定すると、変更点がマージされます。

Poeditを使えば楽なんだ!

via ひひーん!

CakePHP 3って

1行まとめ CakePHP1.3 PHP4&5, CakePHP2 PHP5専用,Cake3 PHP5.3以上、0から再設計。ライブラリとしても利用可能、例外にも対応

CakePHP1.3の間違いかと思った。
ゼロから再設計って、それもうCakeじゃない

via ひひーん!

ブログ アーカイブ

カテゴリー