2008年9月22日月曜日

Joomla

・ 管理メニューで Top Menu が表示されない
->   モジュール管理 にて Top Menu を有効にする

- インストール時に サンプル を選択しないと、 jos_menu_types  に seed data が登録されないことが原因
joomlaj\installation_\sql\mysql\sample_data_sql
INSERT INTO `#__menu_types` VALUES
(2, 'usermenu', 'User Menu', 'A Menu for logged in Users'),
(3, 'topmenu', 'Top Menu', 'Top level navigation'),
(4, 'othermenu', 'Resources', 'Additional links'),
(5, 'ExamplePages', 'Example Pages', 'Example Pages'),
(6, 'keyconcepts', 'Key Concepts', 'This describes some critical information for new Users.');


・ 最終更新 の日付の日の部分が %d のまま表示される。
/language/ja-JP/ja-JP.ini の以下を変更(結局スペースを追加)
DATE_FORMAT_LC2=%Y年  %B %d日(%A) %H:%M
#DATE_FORMAT_LC2=%Y年%B%d日(%A) %H:%M


無料Joomla!テンプレー          http://www.joomlashack.jp/content/view/4/9/
Joomla ジャパン                    http://www.joomla.jp/
Joomla Template Tutorial    http://dev.joomla.org/content/view/1136/79/


Joomla! 1.5 変更部分
・ メニューの構築手順
  外部ファイルの取り込みがエクステンションに一元化
・ テンプレートではtemplateDetails.xml の役割
  モジュールポディションの設定、テンプレートパラメータの設定が可能
  テンプレート側にポディション

・ 特定のメニューから呼び出されたページに対し、テンプレートを指定することができる
  セクションと、その配下にカテゴリーの2層構造でしかコンテンツを管理することができない
  --->  メニューと組み合わせが必要
  Assign 対応していない template もある。



・ Joomla! 1.5.3 でタイトルタグにサイト名を表示させるための変更

・  機能拡張     http://extensions.joomla.org/
    Joomla! 1.5 Template Tutorials Project


・ Zend Framework の動作


・phpフレームワーク・オブジェクト指向入門 http://phpc2.seesaa.net/
PHP5の新機能(クラス関係) http://www.atmarkit.co.jp/fcoding/articles/php5/02/php502a.html
・引数の値渡しと参照渡し http://ww7.tiki.ne.jp/~inabah/php/004_002.htm

Home Developer Manual 11. API Reference [REVIEW] database->loadAssocList

Tutorial:Developing a Model-View-Controller Component - Part 1

2008年9月19日金曜日

Uploading index definitions Error


何日かぶりに appcfg.py update xxxx/ で更新しようとしたところ以下のエラーで先に進まなくなってしまった。
タイミングとして新しいイメージファイルをいくも追加したので、それが原因かと思ったが、そうではないらしい。

Uploading index definitions.
Error 400: --- begin server output ---
Building a composite index failed: ApplicationError: 3
--- end server output ---

Issue 287:Explosion with >100 indexes


To vacuum your indexes: 
1. Create a backup of your index.yaml specification
2. Remove the definitions of the indexes in Error from your index.yaml file
3. Run appcfg.py vacuum_indexes your_app_dir/
4. Replace the modified version of your index.yaml file with the original
5. Run appcfg.py update your_app_dir/


を参考に まず index.yaml をクリアしてから vacuum すると、

This index is no longer defined in your index.yaml file.

ancestor: true
kind: Timeline
properties: []

Are you sure you want to delete this index? (N/y/a): y

ときかれるので、N として、いかにも不要そうな複合インデックスをいくつか削除して
appcfg.py vacuum_indexes your_app_dir/

にて今度は Y にて削除した。
いくつも削除したため、ダッシュボードでみると index の delete のタスクが走りだした。このタスク中に appcfg.py update xxxx/ すると
Server Error (500) A server error has occured.
となる。しばらく、時間をおいたところ無事 update できたが、その直後から今度はindex 作成のタスクがいくつも走りだした。




http://code.google.com/appengine/docs/datastore/queriesandindexes.html#Big_Entities_and_Exploding_Indexes

To handle "Error" indexes, first remove them from your index.yaml file and run appcfg.py vacuum_indexes. Then, either reformulate the index definition and corresponding queries or remove the entities that are causing the index to "explode." Finally, add the index back to index.yaml and run appcfg.py update_indexes.

2008年9月13日土曜日

Google Visualization API その2


Visualization APIを用いたプログラミング 
を参考に SpreadSheet からの Timeline の描画を行なってみた


Chart API だとすぐにぶつかるデータ数の壁をあっさりクリアしてしまった。
おそるべき JavaScript 。


・メモ
- spreadsheet は Share Anyone can this document WITHOUT LOGGING IN
 にしておくこと
- packages:["annotatedtimeline"]
 にSpreadSheet から 123.4 のように少数点付きの値を
 データとして与える場合 123.*100/100 のように一度 乗算して除算しないとなぜかうまくいか
 なかった。 ( javascript を理解していない? ためか  これには苦労した)
-  query.setQuery("select C, J from `Sheet 1` order by C");
 Sheet 1 を Sheet 2 に変えても、先頭のシートしか参照できない。 要調査

2008年9月12日金曜日

Google Visualization API


Google Visualization API
Gallery

Google Finance で使用されているものが登録されていた
さっそく Google App Engine と組み合わせ、使用したところ動作した
けれども、どうもデータの表示範囲のスクロールがなぜかうまくいかなかった。
原因はデータのラインの本数で、折れ線グラフが1本だけだと、下部分の
スクロール機能が動作しない仕様らしい。




2008年9月8日月曜日

Google Chart API で日本語

日本語を使用するには urllib.quote() 
u' 日本語'  はNG

import urllib

chart_ttile = '日本語'

      url2 = '<img src="http://chart.apis.google.com/chart?'
      url2+= 'chs=600x200'
      url2+= '&chtt=' + urllib.quote(chart_title)


Memo

2008年9月7日日曜日

Timeout Error

GAE で今まで動作していたアプリが動作しなくなった。

TemplateSyntaxError: Caught an exception while rendering:

テンプレートが重いのが問題かと 表示内容をけづっていったところ
動作したり、しなかったり。

  File "/base/python_lib/versions/1/google/appengine/api/datastore.py", line 1627, in _ToDatastoreError
raise errors[err.application_error](err.error_detail)
Timeout
同様の現象の報告もあり、様子をみることに。

http://groups.google.com/group/google-appengine/browse_thread/thread/53e7e0a34f3bec89/37b2a5a033ee0ac0?hl=en&lnk=gst&q=timeout+error#37b2a5a033ee0ac0

つい先日も  login: admin  の設定の URL ではログインできなかったが、翌日は復活していた。

2008年9月5日金曜日

Property XXX must be a str or unicode instance, not a tuple

val = "test",

aa = Img( p1 = val )
aa.put()

不要なカンマがある場合などでもこのエラーとなる
BadValueError: Property p1 must be a str or unicode instance, not a tuple

2008年9月3日水曜日

トランザクション エラー Nested transactions are not supported.

1. get_or_insert  自体がトランザクションなのでこれを含めたトランザクションを
  作成しようとするとエラーとなる。

File "C:\Program Files\Google\google_appengine\google\appengine\api\datastore.py",
   line 1386, in RunInTransaction'Nested transactions are not supported.')
BadRequestError: Nested transactions are not supported.


2.動作確認


First up is batch writes. You can now include entities in different entity groups in a single db.put() or db.delete() call. Entity modifications are only atomic within each entity group, but a single call that spans entity groups will be more efficient than a call for each group, which was required before.


以下は SDK だと Cannot operate on different entity groups in a transaction:
となるが Cloud では動作した。

class Dummy2(db.Model):
d1 = db.StringProperty()

class Dummy(db.Model):
d1 = db.StringProperty()

def tran():
d2 = Dummy2(d1 = "aaab")
d1 = Dummy(d1 = "aaab")

d1.put()
d2.put()

tran()


3. その他

   トランザクションの中で検索は実行できない。
  Can't query inside a transaction

2008年9月1日月曜日

YouTube API

http://code.google.com/apis/youtube/articles/youtube_api_appengine.html
に従い進めた。

Developer Key の取得の際は自分でどのように利用するか簡単に記述。
(どこかから値を持ってきて登録するのではない)

けれども、検索するだけであれば
self.developer_key = 'ADD YOUR DEVELOPER KEY HERE'
この部分は不要だった。

チュートリアルのSourceは以下にあるが、これらを特にダウンロードするまでの必要はなかった。
http://code.google.com/p/hello-youtube/source/browse/#svn/trunk/03_hello_youtube_search_query
http://code.google.com/p/hello-youtube/source/browse/#svn/trunk/04_hello_user_input

gdata 関連の設定は既に spredsheet などにアクセスするために導入してあったので
素直に検索を行なうことができた。

Youtube は検索言語の設定により、検索結果がかなり異なるので
http://code.google.com/apis/youtube/reference.html#Query_parameter_definitions
を参考に lr は追加しておいた。

query.vq = search_term
query.max_results = '5'
query.lr = 'ja'

* ja 以外の設定にして "japanese" で検索するとひどい結果になるとの指摘を最近みかけたので。

また、以下の値は検索キーによっては値が得られないことがあるため分岐が必要となる。
rating.average 
 if entry.rating:

Unityでドアの開閉はAnimatorそれともiTween?

Mac Mini M2 の Unity で Sketchup のデータを復元したつづき。 以前、苦労して作成したドアの開閉が動作しないので修復する。 どうやって動かしていたのか、また忘れそうなので記録しておく。             Animator 左右のドア PlaneL,...