Archive for 7月, 2012

 

エラーじゃないけど、function, lineNumberを取得する : javascript

7月 24th, 2012

開発中にエラーじゃないけど、エラー時のように関数、行番号を取得する。  console.log( (new Error()).stack ); Error    at Object.init (chrome-extension://—/js/webdb.js:17:32)    at chrome-extension://—/js/background.js:41:6 な感じになります。

Read full article | コメントは受け付けていません。

google plus著者情報を入れてみる。

7月 24th, 2012

googleの検索結果に最近良く出てくるので、 http://support.google.com/webmasters/bin/answer.py?hl=ja&answer=1408986 <a href=”[profile_url]?rel=author”>author’s gplus profile</a> こんなリンクタグを入れるだけです。プロフィールURLに ref=authorを付けるだけです。 ↓ プロフィール 確認 http://www.google.com/webmasters/tools/richsnippets に公開したURLを入れてみると 下に検索サンプルがでました。 こんな感じになりました。

Read full article | コメントは受け付けていません。

jquery selector

7月 23rd, 2012

良く忘れる。 http://api.jquery.com/category/selectors/

Read full article | コメントは受け付けていません。

json utf-8 shift_jis ?

7月 23rd, 2012

jsonデータは、utf-8が基本ですね sjisのページで、javascript内に日本語を使い場合は、sjisに変換しておく必要があります。 jsonで取得したデータは? shift_jisのページで外部からutf8で取得したjsonデータから日本語を表示するとちゃんと表示出来ました。(chrome) ブラウザが上手く処理してくれているのでしょうね メニューなどのキーワードもjson形式にして保存して底から取得すると良いようです。 どちらにしてもshift_jis変換かjsonencodeする必要があるので手間は変わりませんが、元データがutf8で統一出来るのは一つのメリットですね。

Read full article | コメントは受け付けていません。

github javascriptメモを載せた。

7月 21st, 2012

https://github.com/junichi-otake/javascript-common-use 未だに自分で使うjavascriptをいまいち整理していないので、よく使う物を適当にまとめていこうかと

Read full article | コメントは受け付けていません。

vim javascript indent用 plugin

7月 19th, 2012

http://www.vim.org/scripts/script.php?script_id=2765 javascript.zipを .vim以下に展開。 $ tree -L 3 .vim .vim ├── indent │   └── javascript.vim └── syntax    └── javascript.vim

Read full article | コメントは受け付けていません。

github.com使ってみた。公開してみた。

7月 18th, 2012

Andreessen Horowitz、GitHubに1億ドルを出資 http://japan.cnet.com/news/business/35019055/ gitは少し使ってきてなれてきたのですが、 OSSなど、いくつかのプロジェクトがgithubで公開されているのを利用させてもらったことはありますが 個人や会社で使う理由はわかりませんが、とりあえず使ってみます。 https://help.github.com/articles/create-a-repo まずは空のリポジトリを作ると説明が出ます。 Global setup: Set up git  git config –global user.name “Your Name”  git config –global user.email junichi.otake@gmail.com Add your public key       Next steps:  mkdir hello  cd hello  git init  touch README  git add README  git commit -m ‘first commit’  git remote add origin git@github.com:junichi-otake/hello.git  git […]

Read full article | コメントは受け付けていません。

kyototycoon get_bulk 複数レコードを処理する。

7月 17th, 2012

[http://fallabs.com/kyototycoon/spex.html] /rpc/get_bulk Retrieve records at once. input: DB: (optional): the database identifier. input: atomic: (optional): to perform all operations atomically. If it is omitted, non-atomic operations are performed. input: (optional): arbitrary keys which trail “_”. output: num: the number of retrieved reocrds. output: (optional): arbitrary keys which trail the character “_”. status code: 200. 配列を渡すようにget_bulk。 […]

Read full article | コメントは受け付けていません。

kyototycoon play_scriptをphpから利用する。

7月 15th, 2012

前回 play_scriptの部分を書く前だったので play_scriptの部分を 資料 [http://fallabs.com/kyototycoon/spex.html] /rpc/play_script Call a procedure of the script language extension. input: name: the name of the procedure to call. input: (optional): arbitrary records whose keys trail the character “_”. output: (optional): arbitrary keys which trail the character “_”. status code: 200, 450 (arbitrary logical error). ということで、前のクラスにplay_scriptを追加  public function play_script($name, $inmap){   […]

Read full article | コメントは受け付けていません。

kyototycoon PHPから利用する

7月 13th, 2012

[http://fallabs.com/blog-ja/promenade.cgi?id=99] 複雑なことはしないので、簡単に書いてみる。set get play_script outくらい class Data_Kyoto{  protected $host = ‘localhost';  protected $port = ‘50311’;  protected $timeout = 3;  protected $baseUrl = ”;  protected $kt ;  public function __construct(){    $this->setBase();  }  protected function setBase(){    $this->baseUrl = ‘http://’.$this->host.':’.$this->port.’/rpc/';  }  public function get($key,$db=null){    $api = $this->baseUrl.’get';    $params = array(‘key’=>$key );    if($db) $params['DB']=$db; […]

Read full article | コメントは受け付けていません。