Archive for 八月, 2007

Glib Simple XML Subset Parser

Glib有提供一個輕量級的XML parser,不過文件似乎有提到用於非well format的XML文件可能會有些不可預期的問題 ( GMarkup is not guaranteed to signal an error on all invalid XML; the parser may accept documents that an XML parser would not. However, XML documents which are not well-formed are not considered valid GMarkup documents.),幸好我並不挑剔~哈哈

typedef struct {
void (*start_element) (GMarkupParseContext *context, const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer user_data, GError **error);
void (*end_element) (GMarkupParseContext *context, const gchar *element_name, gpointer user_data, GError **error);
void (*text) (GMarkupParseContext *context, const gchar *text, gsize text_len, gpointer user_data, GError **error);
void (*passthrough) (GMarkupParseContext *context, const gchar *passthrough_text, gsize text_len, gpointer user_data, GError**error);
void (*error) (GMarkupParseContext *context, GError *error, gpointer user_data);
} GMarkupParser;

很顯然的這個結構定義了一些function pointer可以讓我們自己要實作的function掛上去。然後呼叫以下函式…

gboolean g_markup_parse_context_parse (GMarkupParseContext *context, const gchar *text, gssize text_len, GError **error);

就會進行XML 解析的動作,很簡單吧~

詳細資料可以參考http://developer.gimp.org/api/2.0/glib/glib-Simple-XML-Subset-Parser.html

張貼留言

Shockwave (A.I. Assault)

shockwave.jpg

很扯爛的片子(前一陣子cinemax有播),一個碟子加上幾根腳就變成高智慧的終極殺人武器,看著一個碟子追著人車跑來跑去,真擔心這個怪物一跌倒會讓碟子上的醬油、大蒜流出來 (糟糕…我想到河童了@@)

建議觀看重點:看前五分鐘的精彩片段,接下來都可以快轉,不過千萬不能錯過裡頭部分的戰鬥情節,因為非常的匪夷所思、非常好笑。

連imdb都沒有這部片子的劇照,這種片子怎能錯過呢!

張貼留言

虐狗的Michael Vick在上完法院後說的話,讓我覺得聽起來很熟悉…沒錯,MacElroy也是用這招低!

Michael Vick: I’m more disappointed in myself than anything because of all the young people, young kids that I’ve let down who look at Michael Vick as a role model. To have to go through this and put myself in this situation, I hope every young kid out there in the world right now watching this, who has been following the case, will use me as an example to use better judgment, make better decisions.

I feel like we all make mistakes. I made a mistake in using bad judgment and making bad decisions. Those things just can’t happen. Dog fighting is a terrible thing and I didn’t reject it. I’m upset with myself and through this situation I’ve found Jesus and asked him for forgiveness and turned my life over to God, and I think that’s the right thing to do as of right now.

參考資料 Grrr! Vick Finds Jesus in Record Time

macelroy.jpg

Jimmy MacElroy: Fans, friends, esteemed members of the committee, don’t know what I can say, but I pray you can all forgive me. More than that, I pray the children can forgive me. Oh, my God. I place my future in their tiny hands.
God bless you. God bless everyone.
Thank you.

張貼留言

A Slit-Mouthed Woman 裂口女

slitmouthedwoman.jpg

很出名的恐怖傳奇,不過變成了電影就有點抱歉了

裂口女動作遲緩,有點像殭屍,也不太會說話(這點實在是很遺憾)

雖然片中有些鏡頭處理的還不錯,不過整體說節奏掌握的不是很好,除了嘴巴外,實在沒有很嚇人的感覺(其實他張嘴的時候,我還一直笑勒)

松崎老師的記憶有點糟糕,山下老師的智能有點問題,  這讓我想起了驚聲尖笑,唉~

張貼留言

The King of Kong: A Fistful of Quarters

嗚嗚嗚…好想看喔~

官網

imdb

參考資料

張貼留言

Blades of Glory

blades_of_glory.jpg

前一陣子美國才上的新片,由Will Ferrel(曾演過Talladega Nights 王牌飆風)跟Jon Heder(曾演過Napoleon Dynamite 拿破崙炸藥)主演,內容主要是兩個被滑冰界終生禁賽單人滑冰的高手為了東山再起,決定專法條漏洞,兩人合作參加雙人滑冰賽….

至於他們兩個人有多麼需要彼此呢? “This is Rice without Montana, Ali without Frasier, Han Solo without Chubaka”

非常好笑的片子, 最近心情有點悶,看了之後開心的不少~哈哈哈!!

張貼留言

Opera Mini vs. iPhone

我個人對於蘋果的那種自以為高尚的廣告方式總是感到厭煩….

下面是Opera Mini的廣告,老實說~還有點好笑。

張貼留言

報告頭目,一切都在掌握之中!

在一個團體裡頭,笨措施總有其延續性,從管理者的角度來看,這樣子的作法可是最輕鬆、簡單的呢,而被奴化已久的部屬自然也不會有啥奇怪的反應,所以一切都在掌握之中!

張貼留言

Psycoacoustics

人對聲音的感受有一些奇妙的特性(所以在數位類比的處理上就有很多相關技術,例如dither等),下面這篇文章整理了主要的五個特性,

high frequency limit

absolute threshold of hearing

absolute threshold of pain

temporal masking

simultaneous masking

有興趣的可以看看~

How audio codecs work – Psycoacoustics

張貼留言

Sub-Band Coding (SBC) Tutorial

SBC是Bluetooth A2DP所規範必須要實作的Codec,下面的網址有SBC的相關介紹…

Sub-Band Coding Tutorial

留言數(1)

較舊的文章 »