Archive for 六月 2008
生活的全部意义在于扯蛋呀
9到12号的rest time都奉献给可爱又可恨的Google App Engin鸟
依然是淫荡的XML+XSLT架构
话说google的webapp的确有点恶。。。
不过database的API有点好玩,非关系型数据库,有点xxx的感觉
然后是那个user的api,尤其的奇怪
根本没有跟google同步嘛。。。虽然这样做也属合理
总之作为一个Python的Farm,appspot很萌了
希望在我滚蛋前不要像page或site被河蟹掉
这个标题的原因是:
(续。。。)
惊喜的发现自己在10天后才来续。。。
那个理由我已经忘记了 Orz
我现在被困于一个名为期末复习的悖论中
越发觉得生活的荒诞啦。。。
T_T
这学期就要over了
感觉看书不多,爱也减少了
哭。。。
最近去以前经常呆着的论坛,物是人非
感慨啊。。。
Firefox与disable-output-escaping之间的纠结。。。
(最近在琢磨Google Appengine,难免有所脑残,谁让我一向喜欢淫荡架构,去碰XSLT的结果就是。。。)
话说这个世界只有IE的时候还是美好的,程序员可以写出一段有爱的XML
<?xml version=”1.0″ encoding=”utf-8″?>
<?xml-stylesheet type=’text/xsl’ href=’t.xsl’ media=”all” version=’1.0′?>
<channel>
<item>
<title>《哆啦A梦剧场版全集》(Doraemon movies collection)[1980-2007剧场版][清晰版][6.10重发1994][RMVB]</title>
<link>http://www.verycd.com/topics/270597/</link>
<description><![CDATA[<img src="http://image-6.verycd.com/6d8078dfa512365af6ad24ba08407d0f73190(280x)/thumb.jpg" alt="《哆啦A梦剧场版全集》(Doraemon movies collection)[1980-2007剧场版][清晰版][6.10重发1994][RMVB]” style=”float:right;padding:0 0 10px 10px;” />中文名称:哆啦A梦剧场版全集<br />英文名称:Doraemon movies collection<br />别名:ドラえもん<br />资源类型:RMVB<br />版本:[1980-2007剧场版][清晰版][6.10重发1994]<br />导演:藤子·F·不二雄<br />演员:哆啦A梦<br /> 野比大雄<br /> 源静香<br /> 刚田武<br /> 骨川哲夫<br /> 哆啦美<br />地区:日本<br />语言:日语<br />简介:<br />【片名】 哆啦A梦剧场版合集<br />【字幕】 中文内嵌<br />【格式】 RMVB<br />说明:94的出来和前阵91一样的问题,已重发,请重下,95的也出了问题,先别下<br />【内容介绍】<br />继卡通之后,哆啦A梦电影的诞生,再度把哆啦A梦系列推向一个新境界。本作题材非常新颖,设计冒险舞台的那想象力真是叹为观止,不失为一部优秀作品。<br /><a href=’http://www.verycd.com/topics/270597/’>查看完整资源页</a><br />]]></description>
</item>
</channel>
然后轻松的使用这样一段xslt让访问者浏览的时候哦看上去High一点
<?xml version=”1.0″ encoding=”utf-8″?>
<xsl:stylesheet xmlns=”http://www.w3.org/1999/xhtml” xmlns:xsl=”http://www.w3.org/1999/XSL/Transform” xmlns:dc=”http://purl.org/dc/elements/1.1/” version=”1.0″>
<xsl:output method=”html” doctype-system=”http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd” doctype-public=”-//W3C//DTD XHTML 1.0 Strict//EN”/>
<xsl:template match=”/channel”>
<html>
<head>
<script type=”text/javascript” src=”mop-up.js”></script>
</head>
<body”>
<div id=”page-contents”>
<h3><a href=”{item/link}”><xsl:value-of select=”item/title”/></a></h3>
<xsl:value-of select=”item/description” disable-output-escaping=”yes” />
<hr />
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
可是该死的Firefox搅局了,你发现当使用Fx浏览的时候,那段description仍然被escaping了,HTML代码性感的裸露在外
于是乎,你去mozilla.org报告这个disable-output-escaping不工作的bug,发现早在2001年就有人提交这个问题了
https://bugzilla.mozilla.org/show_bug.cgi?id=98168#c11
(看懂了,然后绝望了,你咒骂Firefox,甚至对Opera加深了好感,因为它正常)
然后,你决定寻求别的解决方法
比如。。。<xsl:copy-of select=”item/description” />取代<xsl:value-of select=”item/description” disable-output-escaping=”yes” /> (参照http://carey.geek.nz/doc/xslt-cdata-escaping/)
为此你必须剥离<![CDATA[]],但别高兴的太早,很快你会发现去掉<![CDATA[]]是非常SB的决定,因为这意味着你必须在<description></description>中使用严格的XML格式。如果打算放在其中的HTML代码还有诸如<br>之类的化石级东西,你就绝望吧,就算你可以生成完美的XHTML,一个 也足以让一切都SB了
崩溃。。。。。。。。。。。。
最终解决方法:(参考的VeryCD,但是应该不是它原创,sburke@cpan.org, Sean M. Burke.这个人是原作)
一段Js
// A workaround for XSL-to-XHTML systems that don’t
// implement XSL ‘disable-output-escaping=”yes”‘.
//
// sburke@cpan.org, Sean M. Burke.
// – I hereby release this JavaScript code into the public domain.
var is_decoding;
var DEBUG = 0;
function complaining (s) { alert(s); return s; }
if(!(document.getElementById && document.getElementsByName))
throw complaining(“Your browser is too old to render this page properly.”
+ ” Consider going to getfirefox.com to upgrade.”);
function check_decoding () {
var d = document.getElementById(‘comeTestMe’);
if(!d) {
throw complaining(“Can’t find an id=’comeTestMe’ element?”);
} else if(!(‘textContent’ in d)) {
// It’s a browser with a halfassed DOM implementation (like IE6)
// that doesn’t implement textContent! Assume that if it’s that
// dumb, it probably doesn’t implement disable-content-encoding.
} else {
ampy = d.textContent;
if(DEBUG > 1) { alert(“Got ” + ampy); }
if(ampy == undefined) throw complaining(“‘comeTestMe’ element has undefined text content?!”);
if(ampy == ” ) throw complaining(“‘comeTestMe’ element has empty text content?!” );
if (ampy == “\x26″ ) { is_decoding = true; }
else if (ampy == “\x26amp;” ) { is_decoding = false; }
else { throw complaining(‘Insane value: “‘ + ampy + ‘”!’); }
}
var msg =
(is_decoding == undefined) ? “I can’t tell whether the XSL processor supports disable-content-encoding!D”
: is_decoding ? “The XSL processor DOES support disable-content-encoding”
: “The XSL processor does NOT support disable-content-encoding”
;
if(DEBUG) alert(msg);
return msg;
}
function go_decoding () {
check_decoding();
if(is_decoding) {
DEBUG && alert(“No work needs doing — already decoded!”);
return;
}
var to_decode = document.getElementsByName(‘decodeable’);
if(!( to_decode && to_decode.length )) {
DEBUG && alert(“No work needs doing — no elements to decode!”);
return;
}
var s;
for(var i = to_decode.length – 1; i >= 0; i–) {
s = to_decode[i].textContent;
if(
s == undefined ||
(s.indexOf(‘&’) == -1 && s.indexOf(‘<’) == -1)
) {
// the null or markupless element needs no reworking
} else {
to_decode[i].innerHTML = s; // that’s the magic
}
}
return;
}
//End
再修改一下那个xslt
<?xml version=”1.0″ encoding=”utf-8″?>
<xsl:stylesheet xmlns=”http://www.w3.org/1999/xhtml” xmlns:xsl=”http://www.w3.org/1999/XSL/Transform” xmlns:dc=”http://purl.org/dc/elements/1.1/” version=”1.0″>
<xsl:output method=”html” doctype-system=”http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd” doctype-public=”-//W3C//DTD XHTML 1.0 Strict//EN”/>
<xsl:template match=”/channel”>
<html>
<head>
<script type=”text/javascript” src=”mop-up.js”></script>
</head>
<body onload=”go_decoding();”>
<div id=”comeTestMe” style=”display: none;”><xsl:text disable-output-escaping=”yes” >&</xsl:text></div>
<div id=”page-contents”>
<h3><a href=”{item/link}”><xsl:value-of select=”item/title”/></a></h3>
<p name=”decodeable”>
<xsl:value-of select=”item/description” disable-output-escaping=”yes” />
</p>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Firefox下正常了,Opera和IE就来就正常。。。
不纠结了。。。
继续玩Google Appengine去
PS:无论什么方法,KHTML内核的Konqueror都是不鸟你的,而WebKit内核则一直表现很好,可见一切都是Fx的错。。。哼。。。
The island . . . . . . Homework
If we all lived in the area in which clones lived, were we able to find the truth? If we got the ability to create new organs, should we do that? Can human beings resist the attraction of living forever, or living forever is the ultimate aim of our technology? I think much after this movie. I’ve read some stories about organs business. In my idea, it’s unacceptable, because it will make the poor become organ-store of the rich, which is against with the most basic moral. While it comes to clones, if we can get organs from our copy who may not be a man in law, I think it’s unacceptable either. Because I think the life begins at the time of embryo, and its right of living should be respected. Creating a man and thinking of it as a tool and killing him finally must be a crazing idea in my eyes. While were I to really face the choice someday, I would doubt how long I can insist.
I marked 8 rating for this movie in IMDb, and I think it’s only Hollywood that can combine such a fantastic idea with excellent scenes, but it has nothing special in line of story, just like normal Hollywood-style film, justice wins at the end. I love this sentence “One thing I can tell you about people, is that they’ll do anything to survive.”
I believe the desire of freedom and truth can’t be limited, so the clones in movie got freedom finally, and we continue improving our science technology, but I think there are some places where we’d better not touch before we know it enough, such as clone, especially use as business product too early.
Jun 4, 国内博客的声音, BBC, Deutsche Welle, VOA, Yahoo.HK
决定用中文写
昨天是什么日子无须多言,至于为什么在今天放出这篇post主要是想收集尽量多的媒体对于此次事件及其纪念的报道,但是一直比较奇怪的AOL中文似乎至今无所反应,国内的媒体自然集体沉默了,但是仍有一些私人博客发表了纪念文章。
河蟹上岸 http://www.hexieshangan.com/
首页上一张比较隐晦的图片,我也曾用过2的6次方暗指六四事件,同时有基本一整页的相关文章,截图
(注:此blog疑似被河蟹)
可能吧 http://www.kenengba.com/
为此 可能吧 被河蟹30分钟 – -!
—————————-安全起见,国内blog不引用具体文章——————————–
BBC中文网 http://news.bbc.co.uk/chinese/simp/hi/default.stm
中国丛谈
6月4日,这是第19个让纪念者伤心流泪、让统治者防范担忧的日子。
烛光追思
香港第举办六四烛光悼念晚会,悼念六四和四川地震死难者……
德国之声中文网 http://www.dw-world.de/dw/0,,293,00.html
美国之音中文网 http://www.voanews.com/chinese/June_4th_19_Years_Anniversary.cfm
雅虎香港 http://www.yahoo.com.hk
我无限度地尊重所有人对此事件的所有观点,所以,我也要表达我自己的观点:
其一,中国(此指中华人民共和国)最后一次获取自由民主的机会葬送于此
其二,假若中国之后有可能出现军政府的情形,请了解,种子已经于此埋下
呓语:
这个世界没有什么偶然,一切都是必然
无知也许是一种幸福
6.1 儿童节背后的故事
捷克的利迪策村距首都布拉格20公里。 1939年,英法德意签署《慕尼黑协定》,捷克随后沦为法西斯德国的保护国。掌管捷克摩拉维亚地区的海德里希是个刽子手。到捷克后,他立即逮捕了包括捷克 总理艾里阿什在内的多位爱国人士,枪杀了四百多人。此时,流亡在英国的捷克斯洛伐克政府决定对他实施刺杀行动。1942年5月,库比什和加布契克的两名捷 克伞兵从英国出发空降捷克,在战友的帮助下,成功得到了海德里希的活动计划,在他从郊区别墅驶往市中心的途中,将其暗杀。
海德里希的死立刻在纳粹德国引起了轰动。希特勒指令对捷克人展开疯狂的报复。继任海德里希的达吕格利用一封来历不明的信件,一口咬定布拉格郊区利迪策村 的村民支持了暗杀活动。6月4日,盖世太保们包围了村子并开始大肆搜捕。6月9日,他们把173个16岁以上的男性村民全部集中到村长霍拉克的院子中,并 于次日以10人为一组进行枪决。
全村的成年男子无一幸免都被枪杀,妇女和88名儿童被押往集中营,村里的房舍、建筑物均被烧毁。为了悼念利迪策村和全世界所有在法西斯侵略战争中死难的 儿童,1949年11月在莫斯科召开的国际民主妇女联合会上,参加会议的代表提出了每年的6月1日为国际儿童节的建议。从此以后,每年的6月1日各国儿童 举行集会,庆祝自己的节日。





