楚人 的个人资料我本楚狂人日志网络 工具 帮助

日志


1月27日

风雪园游会

闲来无事,冒雪畅游植物园。顺便拍些照片给各位看官科普一下植物知识。
看了导游图,决定先去踏雪寻梅。
红梅花未开。
腊梅傲雪凌霜。
白梅迎风绽放。
绿萼梅俗称绿梅,因萼绿花白、小枝青绿而得名。
雪越下越大了,开始时如鸟毛般,现在如鹅毛般。去竹园看看。
笔直的水杉,路上空荡荡的,偶尔能看到一两个搞摄影的。
河边的垂柳。
独钓寒江雪,佩服啊。其实我更佩服那个看的,这么冷的天,你比我还无聊!
再来一些名字怪怪的树木。
猫乳:猫乳属,鼠李科,落叶乔木或灌木。
阔叶十大功劳,常绿灌木,小檗科,布于四川、湖北和浙江等省。
枳。芸香科,枳属。“橘生淮南则就橘,生于淮北则就枳”说的就是它。
植物就先看这么多了,最后再上一张动物照片。

1月21日

便民告示

明天下班去南站买票,有需要带票的请吱一声。

1月3日

Don’t encode your xml string twice

Fix two bugs today. One is caused by the character "&", the other is caused by "&" too.

  1. Cause: for xml clause in SQL Server 2005(Yukon) will encode the result as xml type.

    Code snip:

    declare @test as nvarchar(max)

    set @test = (select 'a & b' for xml path(''))

    select @test for xml path('')

    The string"a&b" if first encoded to "a & b", then "a &b". As a result, the character "&" is render as "&" on the web page

  2. Cause: The query () method of xml data type returns an instance of untyped XML, whereas the value () methods returns as scalar value.

    Code Snip:

    declare @test xml

    set @test =convert(xml,N'<book> <title >Harry &amp; Potter</title> <author>J K. Rowling</author> </book>')

    select @test.query('book/title/text()') --(query reslut: Harry &amp; Potter)

    To fix it:

     select @test.value('(book/title)[1]','nvarchar(200)') --(query result : Harry & Potter)