www.fluxiom.com
2005年11月26日(土) 09:25
www.fluxiom.com
「日本のZope情報」経由「最速インターフェース研究会」より。
まだ、サービスは始まっていないし、実際にどういうことになるのかは不明。
ただし、トップページのデモを見る限りかなりやばいものであることは確かだ。
実際、何がやばいかっていうと、このサービスが何で出来ているかというところだったりする。
「あぁ、そう、やっぱりね」と言われてしまうかもしれないが「Rails + prototype.js + script.aculo.us」で出来ているそうだ。
で、だから何がやばいかっていうと、Flexなんて使ってのんびりしていていいのかというところ。
FlexとRemoteService使ってJavaでごりごりやると、なんて楽ちんなことか(Flash的つらさはあるが)。
結局、何がやばいかって、フレームワーク作ってサービス展開しないと技術力・総合力がへぼいままってことだ。
#結論がおかしいぞ。。。
「日本のZope情報」経由「最速インターフェース研究会」より。
まだ、サービスは始まっていないし、実際にどういうことになるのかは不明。
ただし、トップページのデモを見る限りかなりやばいものであることは確かだ。
実際、何がやばいかっていうと、このサービスが何で出来ているかというところだったりする。
「あぁ、そう、やっぱりね」と言われてしまうかもしれないが「Rails + prototype.js + script.aculo.us」で出来ているそうだ。
で、だから何がやばいかっていうと、Flexなんて使ってのんびりしていていいのかというところ。
FlexとRemoteService使ってJavaでごりごりやると、なんて楽ちんなことか(Flash的つらさはあるが)。
結局、何がやばいかって、フレームワーク作ってサービス展開しないと技術力・総合力がへぼいままってことだ。
#結論がおかしいぞ。。。
script.aculo.us
2005年11月24日(木) 09:52
話題のscript.aculo.usを使ってみた。
FlexのAccordionみたいな感じでなかなか良いぞ。
サイドバーのカテゴリとか書いてある部分をクリックしてみてください。
Effect.SlideUpとかを使っています(/js/everes.jsでSlideUpとSlideDownを切り替えています)。FlexのAccordionみたいな感じでなかなか良いぞ。
J2ASTask
2005年11月22日(火) 12:14
JavaのクラスからFlexのRemote Service用のActionScriptを生成するantタスクをRevDBから切り出しました(バージョンアップもしてます0.1→0.2)。
Remote Serviceで用いるJavaとのマッピングActionScriptは、プロパティとマッピング指定のみが必要で、かつ面倒くさい単純作業となるため作成しました。
Use of the J2ASTask is different from the tremendous J2AS, it is Remote Service limitation of the Macromedia Flex.
Only the property and mapping appointment being necessary, at the same time because it becomes troublesome monotonous work, it drew up the mapping ActionScript of the Java which is used with the Remote Service.
機能(Function)
The ant task which forms the ActionScript for the Remote Service of the
Flex from class of Java was quarried out from the RevcDb, (doing also
version rise, 0.1 where it increases -> 0.2).
(ものすごいJ2ASは、ここではなくて、こっちです。)
Remote Serviceで用いるJavaとのマッピングActionScriptは、プロパティとマッピング指定のみが必要で、かつ面倒くさい単純作業となるため作成しました。
Use of the J2ASTask is different from the tremendous J2AS, it is Remote Service limitation of the Macromedia Flex.
Only the property and mapping appointment being necessary, at the same time because it becomes troublesome monotonous work, it drew up the mapping ActionScript of the Java which is used with the Remote Service.
機能(Function)
- 特定のパッケージに含まれる全てのJavaクラスをActionScriptに変換する
All Java classes which are included in the package of specification are converted to the ActionScript
- JavaクラスのパッケージをActionScript上のパッケージに変換する
The package of Java class is converted to the package on the ActionScript
- Javaの型をなんとなくActionScriptの型にする
Type of the Java how it is not and makes type of the ActionScript
- ActionScriptのプロパティ宣言の直上にJavaの型をコメントでメモとして出力する
It outputs type of the Java to just above of property declaration of the ActionScript with comment as memo
- ActionScriptファイルはワークディレクトリに書き出す(毎回上書きする)
It writes out the ActionScript file in the work directory, (each time it superscribes)
- log4j-1.2.9.jar
- commons-logging.jar
- commons-io-1.1.jar
- commons-collections-3.1.jar
- velocity-1.4.jar
antから使用します。
You use from the ant.
j2asタスクをbuild.xmlに宣言します
J2as task is declared to the build.xml
<taskdef name="j2as"
classname="net.everes.j2as.ant.J2AsTask">
<classpath>
<pathelement location="./lib/J2AsTask-0.2.jar" />
<pathelement location="./lib/log4j-1.2.9.jar" />
<pathelement location="./lib/commons-logging.jar" />
<pathelement location="./lib/commons-io-1.1.jar" />
<pathelement location="./lib/commons-collections-3.1.jar" />
<pathelement location="./lib/velocity-1.4.jar" />
</classpath>
</taskdef>
j2asタスクをtargetに指定します
J2as task is appointed to the target<target name="j2as.model">
<j2as
work="./work"
classDir="./classes"
targetPackage="net.everes.j2as.model"
projectName="j2as"
packageMapping="net.everes.j2as.model:model,net.everes.j2as.data:data"
/>
</target>
※親クラスを自動的にリバースしたりはしませんので、必要なだけj2asタスクタグを使用してください。
- work: ワークディレクトリ。ここにActionScriptファイルが生成されます。
Work directory. The ActionScript file is formed here.- classDir: 対象のクラスの含まれるディレクトリを指定する(パッケージは含まない。クラスパス)
Appoints the directory where class of object is included (the package is not included. CLASSPATH)- targetPackage: 対象のパッケージを指定する
The package of the object is appointed- projectName: (省略可)JavaのプロパティがNumber,Boolean,Date,Listにマッピングできなかった場合に、Javaのクラス名に projectNameのパッケージが見つかった場合は、そのパッケージ文字列以降をActionScriptのクラス名としてマッピングする。
(Abbreviation yes) the property of the Java when when in the Number, the Boolean, the Date and the List mapping it is not possible, the package of the projectName is found in class name of the Java, mapping it does with after that package character string as a class name of the ActionScript.- packageMapping:(省略可)JavaのクラスパッケージとActionScriptのクラスパッケージのマッピング情報を指定する。「:」で区切られたJavaのパッケージとActionScriptのパッケージペアを「,」で区切って複数指定可能
(Abbreviation yes) mapping information of the package of the Java and the package of the ActionScript is appointed. ": " With ", " with dividing the package of the Java which was divided and the package pair of the ActionScript, plural designated possibilities
It's not reverses super class automatically, please use as much as the necessary j2as task tag.
※変換されるプロパティは、publicなアクセサを持つものだけです The property which is converted is the public just those which have accesser method.
生協の白石さんCM
2005年11月20日(日) 23:59
生協の白石さんガンダムCM限定公開
21日~30日までの期間限定でネット公開になってるんだけれど、メディアがWindowsメディアで、ネタが読めん。
あのー、みなさんウィンドウズメディアやめてQuickTimeにしませんか?
圧倒的に画質が違うんですが・・・ねぇ
21日~30日までの期間限定でネット公開になってるんだけれど、メディアがWindowsメディアで、ネタが読めん。
あのー、みなさんウィンドウズメディアやめてQuickTimeにしませんか?
圧倒的に画質が違うんですが・・・ねぇ
RhacoのTemplateParserについてのメモ
2005年11月19日(土) 08:17
RhacoのO/Rで動的にmodel系phpコードをジェネレートするために、Rhacoのテンプレートシステムを復習(ノードキュメントだからな、今のところ)。
RhacoのUnitTestを使用して、test.txtを処理してみた。
やはりWeb系のテンプレートを主に指向しているので、sgml系でないものを処理しようとするとちょっとテンプレートの見た目がビミョー。
以下超簡易サンプルコード
タグパーサ系のクラス
- tag.TagParser: テンプレートの基底クラス。read/writeやキャッシュを制御する。
- tag.TemplateParser: TagParserを継承したクラス。ループ等を制御する。
- tag.HtmlParser: TemplateParserを継承したクラス。htmlに特化したinputタグ等の制御を行う。
RhacoのUnitTestを使用して、test.txtを処理してみた。
やはりWeb系のテンプレートを主に指向しているので、sgml系でないものを処理しようとするとちょっとテンプレートの見た目がビミョー。
以下超簡易サンプルコード
- TemplateTest.php
<?php
define("RHACO_DIR","/open/workspace/rhaco/");
require_once(RHACO_DIR."rhaco.php");
define("LOG_DISP_LEVEL", "debug");
Rhaco::import("test/UnitTest");
Rhaco::import("tag/TemplateParser");
class TemplateTest extends UnitTest {
var $templateParser;
function setUp() {
$this->templateParser = new TemplateParser();
}
function testTemplateExec() {
$list = array();
$list[] = "x";
$list[] = "y";
$list[] = "z";
$arg["testData"] = $list;
$this->templateParser->setRequest($arg);
print $this->templateParser->write("test/test.txt");
}
}
new TemplateTest();
?>
- test/test.txt
test text for TemplateParser
<loop class="testData" id="data">
<if pattern="{$data} == 'x'">
It's X!
<else>
It's not X!
</if>
{$data}:
</loop>
end
- 実行結果
[Debug 2005/11/19 22:07:46]:[templateparser] view file [test/test.txt]
test text for TemplateParser
It's X!
x:
It's not X!
y:
It's not X!
z:
end
COREBlogのアーカイブリンクをシンプルにする
2005年11月17日(木) 08:32
COREBlogのアーカイブリンクをシンプルにする。
アーカイブへの月毎リンクが結構な数になってしまったので、シンプルにしてみた。いつも通りDTMLをごにょごにょしてごまかそうとした所、DTMLは変数をぐりぐりすることが出来ないことに気づく(今頃かい・・・)。
ついにCOREBlogのソースコードをいじってしまった。
※COREBlog1.2を対象にしています。
参考にして壊れても知りません。
またZopeのコード記述に関する定石も知らないので、いい加減なコードです。
まず、modulesのarchivesをZMI上でコピーペースとしてarchives2というDTMLMethod?を作る。
archives2
<dtml-unless module_item_count>
<dtml-call "REQUEST.set('module_item_count',15)">
</dtml-unless>
<dtml-let prev_year="0">
<h3><dtml-if "_.len(document_title)>0"><dtml-var document_title><dtml-else>ARCHIVES</dtml-if></h3>
<ul>
<dtml-in prefix="year_loop" expr="month_archive_items2(count=36)">
<dtml-if year_loop_odd><li class="odd">
<dtml-elif year_loop_even><li class="even">
</dtml-if>
<dtml-in prefix="month_loop" expr="year_loop_item" mapping reverse>
<dtml-if expr="month_loop_number == 1">
<dtml-var year>:
</dtml-if>
<a href="<dtml-var blogurl>/monthlist_html?year=<dtml-var year>&month=<dtml-var month>"><dtml-var month></a>
</dtml-in>
</li>
</dtml-in>
</ul>
</dtml-let>
COREBlogのCOREBlog.pyを修正する。
def month_archive_items(self,count=1,start_year=0,start_month=0):のメソッドの下あたりに追記する。
security.declareProtected(View, 'month_archive_items2')COREBlog.pyへの変更を反映するために、リフレッシュかZopeの再起動をする。
def month_archive_items2(self,count=1,start_year=0,start_month=0):
""" Return list of year/month archive. """
count = r2i(count,1)
start_year = r2i(start_year,0)
start_month = r2i(start_month,0)
if start_year == 0 or start_month == 0 or start_day == 0:
#Base date is today
t = localtime(time())
year = t[0]
month = t[1]
else:
year = year
month = month
ret_l = []
ret_d = {}
cnt = 100 #limitter
while cnt > 0 and count > 0:
if not self.datemap.has_key(year):
cnt = cnt - 1
month = 12
year = year - 1
continue
year_s = self.datemap[year]
if year_s.has_key(month):
if ret_d.has_key(year):
ret_l = ret_d[year]
else:
ret_l = []
ret_d[year] = ret_l
ret_l.append({"year":year,"month":month})
count = count - 1
month = month - 1
if month < 1:
month = 12
year = year - 1
cnt = cnt - 1
ret_x = []
for k in ret_d:
ret_x.append(ret_d[k])
return ret_x
modulesのindex_htmlにあるdtml-varをarchiveからarchive2に変更する。
終わり
django 0.9 release
2005年11月16日(水) 07:45
ついにdjangoのファーストリリース(ただし0.9)が出ました。
subversion経由のダウンロードが不要になりましたので、subversionのインストールのために避けていたかたには朗報では。
ただし、1.0になるまでは後方互換を考慮しないようなので、実用は避けた方がよろしいかと。
Introducing Django 0.90
subversion経由のダウンロードが不要になりましたので、subversionのインストールのために避けていたかたには朗報では。
ただし、1.0になるまでは後方互換を考慮しないようなので、実用は避けた方がよろしいかと。
Introducing Django 0.90
arax?
2005年11月14日(月) 10:24
Ajaxを超える「Arax」・・・
確かに、ajaxはコードを書きたくない。
スマクラ(C#)はサーバが嫌。
JavaWebStart?Swingありえないでしょ。
OpenLaszloは、見た目がねぇ。
Flexは高すぎる。
業務系の本命はスマクラかFlexなんだろうけど、サービス系やフリー系はOpenLaszloとAraxの戦いになるのかな?
Eclipseで開発できるOpenLaszloにAraxがどこまで対抗できるか?
実は、現時点で一番アピールできるのはコンポーネントの見た目かも。実物みたいなぁ。
#セミナー、誰か行ってくれ!
確かに、ajaxはコードを書きたくない。
スマクラ(C#)はサーバが嫌。
JavaWebStart?Swingありえないでしょ。
OpenLaszloは、見た目がねぇ。
Flexは高すぎる。
業務系の本命はスマクラかFlexなんだろうけど、サービス系やフリー系はOpenLaszloとAraxの戦いになるのかな?
Eclipseで開発できるOpenLaszloにAraxがどこまで対抗できるか?
実は、現時点で一番アピールできるのはコンポーネントの見た目かも。実物みたいなぁ。
#セミナー、誰か行ってくれ!
ラーメンを家で食す
2005年11月06日(日) 02:07
お昼に家で食べるラーメンを探しに、ピーコックへ行ったらご当地ラーメンと並んで、生麺が数種類とスープが数種類並べてあった。
蕎麦やうどんは、麺とつゆが別で自由に組み合わせる物だと思っていたけれど、ラーメンまでこうなっていたとは・・・(考えてみれば麺系は組み合わせ自由が多いよね)。
自分用に細縮れ麺(大盛り)と嫁用の卵入り中華麺、スープはこってり醤油と本格味噌を購入。
文章にするとさっぱりしているけれど、実際に選ぶときは興奮してました。いや、これは楽しい。
#しかも思った通りのラーメンが出来たのでかなりうれしい
これははまるかも(スーパーじゃ商品が限られているので、ネットで製麺屋を発見)。
スーパーに行けば、チャーシュー各種や味卵各種も売ってますよー
蕎麦やうどんは、麺とつゆが別で自由に組み合わせる物だと思っていたけれど、ラーメンまでこうなっていたとは・・・(考えてみれば麺系は組み合わせ自由が多いよね)。
自分用に細縮れ麺(大盛り)と嫁用の卵入り中華麺、スープはこってり醤油と本格味噌を購入。
文章にするとさっぱりしているけれど、実際に選ぶときは興奮してました。いや、これは楽しい。
#しかも思った通りのラーメンが出来たのでかなりうれしい
これははまるかも(スーパーじゃ商品が限られているので、ネットで製麺屋を発見)。
スーパーに行けば、チャーシュー各種や味卵各種も売ってますよー
hibernateで行ロック
2005年11月01日(火) 23:15
hibernateで行ロックを行う方法のメモ
やりたいこと:更新対象のレコードをロックして、更新する。
すぐに思いつくのが、Session#lock(Object, LockMode)。
やりたいこと:更新対象のレコードをロックして、更新する。
すぐに思いつくのが、Session#lock(Object, LockMode)。
- Objectはhibernateのマッピングオブジェクトな訳だけれど、Sessionに存在しない(newされたオブジェクト)を使用すると、org.hibernate.TransientObjectExceptionが発生する。
- DAO#get(key, session)で取得したオブジェクトを使用すると、次のようなSQLが投げられる。
select PK from TABLE where PK =? for update
getしてからlockをするまでの間に、別トランザクションで直にレコードを更新をすることができるので、ロックのかけ方がおかしい(もう一度getすれば良さそうだが)。
- 誤ってDAO#get(key, session)で取得したオブジェクトを第一引数に使用すると、org.hibernate.PersistentObjectException(既 にsessionに関連づけられたオブジェクトを再びsessionに登録しようとしたというエラー)が発生する(当然)。
- 正しく、マッピングクラス.classを第一引数に入れ、SerializableにPKの値を入れ、LockModeに
LockMode.UPGRADEを入れると、次のようなSQLが投げられ、マッピングクラスの値オブジェクトがリターンされる(やりたいことにマッチし
ているのはこれかな?)。
select A , B from TABLE where PK=? for update
