<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Flying Eagle's BLOG</title>
	<atom:link href="http://www.peterzl.net/en/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.peterzl.net/en</link>
	<description></description>
	<pubDate>Wed, 02 Dec 2009 04:52:01 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
	<language>en</language>
			<item>
		<title>Hey roommate, heads up!</title>
		<link>http://www.peterzl.net/en/?p=100</link>
		<comments>http://www.peterzl.net/en/?p=100#comments</comments>
		<pubDate>Thu, 21 May 2009 01:20:31 +0000</pubDate>
		<dc:creator>eagle</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.peterzl.net/en/?p=100</guid>
		<description><![CDATA[/me is looking for roommate during Akademy from 3rd to 12th July.
Or if someone is willing to sleep on the street with me, feel free to call me brother!
]]></description>
			<content:encoded><![CDATA[<p>/me is looking for roommate during Akademy from 3rd to 12th July.</p>
<p>Or if someone is willing to sleep on the street with me, feel free to call me brother!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterzl.net/en/?feed=rss2&amp;p=100</wfw:commentRss>
		</item>
		<item>
		<title>Building Your Amarok Script Interface with .UI files!</title>
		<link>http://www.peterzl.net/en/?p=99</link>
		<comments>http://www.peterzl.net/en/?p=99#comments</comments>
		<pubDate>Mon, 24 Nov 2008 03:56:40 +0000</pubDate>
		<dc:creator>eagle</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.peterzl.net/en/?p=99</guid>
		<description><![CDATA[The new Amarok scripting interface only supports Qt script. But with the help of Qt Bindings, you can ultimate the scripting usage. Here&#8217;s a simple example of using .ui files in a script.






From My ScreenShot



A clip from my encoding fixer script, you can grab the full version from amarok/playground/src/script/encoding_fixer/:
Importer.loadQtBinding( &#8220;qt.core&#8221; );
Importer.loadQtBinding( &#8220;qt.gui&#8221; );
Importer.loadQtBinding( &#8220;qt.uitools&#8221; ); [...]]]></description>
			<content:encoded><![CDATA[<p>The new Amarok scripting interface only supports Qt script. But with the help of Qt Bindings, you can ultimate the scripting usage. Here&#8217;s a simple example of using .ui files in a script.</p>
<table style="width:auto;" border="0">
<tbody>
<tr>
<td><a href="http://picasaweb.google.com/lh/photo/-hknuYqehJc5eOcSovhOtA"><img src="http://lh5.ggpht.com/_9veQZdDYWQM/SSgiA1Oh-LI/AAAAAAAADQg/0JDsg_CQah8/s400/snapshot2.png" alt="" /></a></td>
</tr>
<tr>
<td style="font-family:arial,sans-serif; font-size:11px; text-align:right">From <a href="http://picasaweb.google.com/peterzhoulei/MyScreenShot">My ScreenShot</a></td>
</tr>
</tbody>
</table>
<p>A clip from my encoding fixer script, you can grab the full version from amarok/playground/src/script/encoding_fixer/:</p>
<blockquote><p>Importer.loadQtBinding( &#8220;qt.core&#8221; );<br />
Importer.loadQtBinding( &#8220;qt.gui&#8221; );<br />
Importer.loadQtBinding( &#8220;qt.uitools&#8221; ); <strong>//load the qt binding</strong></p>
<p>function readConfiguration()<br />
{<br />
if ( Amarok.Script.readConfig( &#8220;simple_Chinese&#8221;, &#8220;false&#8221; ) == &#8220;false&#8221; )<br />
mainWindow.children()[1].children()[1].checked = false; <strong>//uncheck the checkbox</strong><br />
else<br />
mainWindow.children()[1].children()[1].checked = true; <strong>//check the checkbox</strong><br />
}</p>
<p>function onConfigure()<br />
{<br />
mainWindow.show();<br />
}</p>
<p>var UIloader = new QUiLoader( this );<br />
var uifile = new QFile ( Amarok.Info.scriptPath() + &#8220;/main.ui&#8221; );<br />
uifile.open( QIODevice.ReadOnly );<br />
mainWindow = UIloader.load( uifile, this); <strong>//load the ui file</strong><br />
uifile.close();</p>
<p>readConfiguration();<br />
mainWindow.children()[0].accepted.connect( saveConfiguration ); <strong>//when OK button is clicked</strong><br />
mainWindow.children()[0].rejected.connect( readConfiguration ); <strong>//call the function when Cancel button is clicked</strong></p>
<p>Amarok.Window.addSettingsMenu( &#8220;configencoding&#8221;, &#8220;Encoding Fixer Settings&#8230;&#8221; ); <strong>//add the configuration menu</strong><br />
Amarok.Window.SettingsMenu.configencoding.triggered.connect( onConfigure ); <strong>//add a signal</strong></p></blockquote>
<p>Heads up! Amarok 2.0 is about to release. <img src='http://www.peterzl.net/en/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
I will be really happy to see more scripts ready on kde-apps.org. And I am impressed that there are 10+ scripts out there already even before the release of our RC version.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterzl.net/en/?feed=rss2&amp;p=99</wfw:commentRss>
		</item>
		<item>
		<title>Amarok Encoding Problem</title>
		<link>http://www.peterzl.net/en/?p=98</link>
		<comments>http://www.peterzl.net/en/?p=98#comments</comments>
		<pubDate>Mon, 24 Nov 2008 02:11:59 +0000</pubDate>
		<dc:creator>eagle</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.peterzl.net/en/?p=98</guid>
		<description><![CDATA[The mp3 tag encoding is always a problem for the non-latin language users. And the problem will remain for Amarok 2.0.0 final. I feel sorry but we have to postpone the fix till the next release. Anyway, I&#8217;d like to show you what is our approach now to this issue and what&#8217;s the plan for [...]]]></description>
			<content:encoded><![CDATA[<p>The mp3 tag encoding is always a problem for the non-latin language users. And the problem will remain for Amarok 2.0.0 final. I feel sorry but we have to postpone the fix till the next release. Anyway, I&#8217;d like to show you what is our approach now to this issue and what&#8217;s the plan for next.</p>
<p>1. There is an encoding detector from mozilla implemented in Amarok. And the detector code is also in KDE 4.2 trunk now. The detector can detect the encoding from a string. Since there&#8217;s not much information from the track meta data, the confidence of the result cannot be very high. From my own experience, I got 70%-80% of the correctness from my collection scan.</p>
<p>2. We&#8217;ve tried to use the detector on every type of the tracks, and most people complained on that case. So I limited the functionality for MP3 tag id3v1 only. The assumption is, all id3v2 tags were encoded in UTF-8 and all id3v1 tags were encoded in non-UTF-8.</p>
<p>3. So the 70%-80% correctness is for all non-UTF-8 tracks, but the detector some of the time cannot even detect if it is a UTF-8 string. so the correctness can drop to 50% for some cases, which is not acceptable!</p>
<p>Since Amarok is in feature freeze, I&#8217;d add functions to solve this issue someday&#8230;</p>
<p>Here is the plan:</p>
<p>1. We really do need to find a way to improve the accuracy of the detector. I&#8217;ll look into the code to see if there&#8217;s a way.</p>
<p>2. Tracks with the same artist or album should be put together to increase the string length</p>
<p>2. System locale should count. It could provide some clue.</p>
<p>3. Filenames should count. You can tell the title of a track from its filename for most of the cases.</p>
<p>4. I am writing a script, which compare the decoded result with the online search engines.</p>
<p>Sometime I just feel the work is not worth it, since there are not many non-latin language users out there. But how can we attract more mid-east and Asian users without fixing the encoding issues, can&#8217;t we?</p>
<p>But hell, mp3 tag encoding is not a KDE bug anyway&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterzl.net/en/?feed=rss2&amp;p=98</wfw:commentRss>
		</item>
		<item>
		<title>KDE China 4th Meeting</title>
		<link>http://www.peterzl.net/en/?p=97</link>
		<comments>http://www.peterzl.net/en/?p=97#comments</comments>
		<pubDate>Thu, 20 Nov 2008 04:44:44 +0000</pubDate>
		<dc:creator>eagle</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.peterzl.net/en/?p=97</guid>
		<description><![CDATA[We agreed to increase our efforts on promoting KDE in China as we always do agree that KDE rocks. And we also do aware of the project&#8217;s lack of exposure in Chinese market. We need change.  
We finally made several decisions on 15th Nov.
1. www.kdecn.org will be used not only for KDE China&#8217;s index [...]]]></description>
			<content:encoded><![CDATA[<p>We agreed to increase our efforts on promoting KDE in China as we always do agree that KDE rocks. And we also do aware of the project&#8217;s lack of exposure in Chinese market. We need change. <img src='http://www.peterzl.net/en/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>We finally made several decisions on 15th Nov.</p>
<p>1. <a title="www.kdecn.org" href="http://www.kdecn.org" target="_blank">www.kdecn.org</a> will be used not only for KDE China&#8217;s index page, but we will startup a brunch of new modules, like the Chinese wiki, forum, planet, and probably the Chinese version of the dot. ( I&#8217;ve explained why we need a server within mainland China instead of using the European servers. The current one is in Beijing, so it might be a bit slow for those visitors outside China. )</p>
<p>2. We are setting up a promotion team lead by <a title="www.kdecn.org" href="http://www.kdecn.org" target="_blank">Freeflying</a> ( Hou Zhengpeng ), responsible for arranging meetings, doing promotion events in colleges, and managing all promotion related stuffs. <a title="http://shuizhuyuanluo.blog.163.com/" href="http://shuizhuyuanluo.blog.163.com/" target="_blank">nihui</a> is responsible for the KDE China news writing and reviewing.</p>
<p>3. Development team will be set up to group the potential developers to involve in KDE development. The team is currently lead by me, peterzl ( ZHOU Lei ).</p>
<p>4. l10n/i18n team will be lead by Lie_Ex. Responsible for translation, including the KDE programs, some news and webpages.</p>
<p>5. The three team leaders will propose their working plans, and the KDE China community council will be formed some time in the future.</p>
<p>It is a great move that we actually made things happened here, and I guess a bright future is ahead. I really like to give thanks to those who are contributing. Like Qi Liang, yuanjiayj, Funda Wang, and many more people that behand the scene.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterzl.net/en/?feed=rss2&amp;p=97</wfw:commentRss>
		</item>
		<item>
		<title>OpenSource Event in Mainland China</title>
		<link>http://www.peterzl.net/en/?p=93</link>
		<comments>http://www.peterzl.net/en/?p=93#comments</comments>
		<pubDate>Thu, 23 Oct 2008 05:14:00 +0000</pubDate>
		<dc:creator>eagle</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.peterzl.net/en/?p=93</guid>
		<description><![CDATA[I went to Beijing last weekend for the three-days GNOME Asia event. I was there not only for promoting KDE, but also to promote open source concept in mainland China.
Open source communities in mainland China are not as active as the European communities, neither GNOME nor KDE has a very good growing environment there. I&#8217;d [...]]]></description>
			<content:encoded><![CDATA[<p>I went to Beijing last weekend for the three-days GNOME Asia event. I was there not only for promoting KDE, but also to promote open source concept in mainland China.<br />
Open source communities in mainland China are not as active as the European communities, neither GNOME nor KDE has a very good growing environment there. I&#8217;d rather regard it as an open source in general event in mainland China instead of a GNOME Asia summit.</p>
<p>Around 300 attenders went to the talks and BoFs, about 90% of them were local Chinese. There were employees from SUN, Novel, Nokia, Motorola, Redhat, and some Chinese local companies. There were students and opensource community members, and most of them were using open source operating systems. Although there are half of the talks and BoFs were introducing pure open source concept, histories and current situations, it is rather understandable that Asia people, especially mainland Chinese need this kind of education. As I introduced the scripting concept in Plasma and Amarok, there were also speakers focused on development and improvement of the current projects. About 30% of the speeches related to GNOME applications. ( the schedule is here: <a title="http://www.gnome.asia/en/schedule/" href="http://www.gnome.asia/en/schedule/">http://www.gnome.asia/en/schedule/</a> )</p>
<p>When talking about GNOME, many KDE guys may regard it slow and ugly, but I still enjoyed sharing ideas and different perspectives with the GNOME developers. KDE and GNOME are not really competing with each other. We learn from each other, and we fight for freedom together, especially now in China.</p>
<p>Freeflying and I talked about we would probably hold KDE Asia or KDE Asia Pacific some time appropriate in the future. We would learn from the failure and successful experience from GNOME Asia community and we should introduce the beauty of KDE to the Asia users definitely.</p>
<p>I found the &#8220;western developers&#8221; or the &#8220;far east users&#8221; actually didn&#8217;t communicate well, I will write more English blogs for the KDE guys to introduce the situation in Asia as I wrote many Chinese blogs to promote KDE. I&#8217;d like to share my point of view from the perspective of a local Chinese KDE developer.</p>
<p>Here are some photos token by the volunteers during the two-days-event, and token by me for the last day Beijing trip.</p>
<p>Booth area with people</p>
<table style="width:auto;" border="0">
<tbody>
<tr>
<td><a href="http://picasaweb.google.com/lh/photo/GrIUlwSs2XjvRz1bHgVGag"><img src="http://lh3.ggpht.com/peterzhoulei/SP_2PJwLEEI/AAAAAAAACew/78bxcNfTAOI/s400/DSC_2131.JPG" alt="" /></a></td>
</tr>
<tr>
<td style="font-family:arial,sans-serif; font-size:11px; text-align:right">From <a href="http://picasaweb.google.com/peterzhoulei/GNOMEAsia2008Beijing">GNOME Asia 2008, Beijing</a></td>
</tr>
</tbody>
</table>
<p>Firefox and Sun in the booth area</p>
<table style="width:auto;" border="0">
<tbody>
<tr>
<td><a href="http://picasaweb.google.com/lh/photo/1phS9uvqAKA3YrRosdm7Pg"><img src="http://lh3.ggpht.com/peterzhoulei/SP_2k_W0UTI/AAAAAAAACe4/unTX4jRiKqo/s400/IMG_2433.jpg" alt="" /></a></td>
</tr>
<tr>
<td style="font-family:arial,sans-serif; font-size:11px; text-align:right">From <a href="http://picasaweb.google.com/peterzhoulei/GNOMEAsia2008Beijing">GNOME Asia 2008, Beijing</a></td>
</tr>
</tbody>
</table>
<p>Talks in a small conference room</p>
<table style="width:auto;" border="0">
<tbody>
<tr>
<td><a href="http://picasaweb.google.com/lh/photo/TjXNdE6lLOpT-_Ymv-wgFA"><img src="http://lh6.ggpht.com/peterzhoulei/SP_2D_ezS-I/AAAAAAAACeo/3LUKFRZZIrw/s400/DSC_2241.JPG" alt="" /></a></td>
</tr>
<tr>
<td style="font-family:arial,sans-serif; font-size:11px; text-align:right">From <a href="http://picasaweb.google.com/peterzhoulei/GNOMEAsia2008Beijing">GNOME Asia 2008, Beijing</a></td>
</tr>
</tbody>
</table>
<p>The conference rooms were awesome. And from the European standard, you cannot imagine how cheap they cost.</p>
<table style="width:auto;" border="0">
<tbody>
<tr>
<td><a href="http://picasaweb.google.com/lh/photo/K2T1ojNS8t6ovcWLQnT4Bg"><img src="http://lh4.ggpht.com/peterzhoulei/SP_2Jin6zMI/AAAAAAAACes/z_Ey3MZIGSY/s400/DSC_2074.jpg" alt="" /></a></td>
</tr>
<tr>
<td style="font-family:arial,sans-serif; font-size:11px; text-align:right">From <a href="http://picasaweb.google.com/peterzhoulei/GNOMEAsia2008Beijing">GNOME Asia 2008, Beijing</a></td>
</tr>
</tbody>
</table>
<p>Stormy Peters in her talk</p>
<table style="width:auto;" border="0">
<tbody>
<tr>
<td><a href="http://picasaweb.google.com/lh/photo/tgOx9iam29BBiG8S_pPNCg"><img src="http://lh3.ggpht.com/peterzhoulei/SP_61gnVWFI/AAAAAAAACg0/CqlZfupgfQI/s400/DSC_2094.JPG" alt="" /></a></td>
</tr>
<tr>
<td style="font-family:arial,sans-serif; font-size:11px; text-align:right">From <a href="http://picasaweb.google.com/peterzhoulei/GNOMEAsia2008Beijing">GNOME Asia 2008, Beijing</a></td>
</tr>
</tbody>
</table>
<p>Kate was promoting Maemo ( hey guys, n810s <img src='http://www.peterzl.net/en/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> )</p>
<table style="width:auto;" border="0">
<tbody>
<tr>
<td><a href="http://picasaweb.google.com/lh/photo/iDpSl-PyArpMGkX1cFvS9Q"><img src="http://lh4.ggpht.com/peterzhoulei/SP_2A2GFdeI/AAAAAAAACek/721NUgaJmNg/s400/DSC_2221.JPG" alt="" /></a></td>
</tr>
<tr>
<td style="font-family:arial,sans-serif; font-size:11px; text-align:right">From <a href="http://picasaweb.google.com/peterzhoulei/GNOMEAsia2008Beijing">GNOME Asia 2008, Beijing</a></td>
</tr>
</tbody>
</table>
<p>I was promoting KDE, HAHA.</p>
<table style="width:auto;" border="0">
<tbody>
<tr>
<td><a href="http://picasaweb.google.com/lh/photo/IhJcVp5xsuKP7wPnBkOMAw"><img src="http://lh5.ggpht.com/peterzhoulei/SP9L7WJ8n-I/AAAAAAAACec/aikYVBiPULk/s400/DSCF6954.JPG" alt="" /></a></td>
</tr>
<tr>
<td style="font-family:arial,sans-serif; font-size:11px; text-align:right">From <a href="http://picasaweb.google.com/peterzhoulei/GNOMEAsia2008Beijing">GNOME Asia 2008, Beijing</a></td>
</tr>
</tbody>
</table>
<p>One day trip in Beijing</p>
<table style="width:auto;" border="0">
<tbody>
<tr>
<td><a href="http://picasaweb.google.com/lh/photo/uDZRcuwj0UeiIApKP8Lz6A"><img src="http://lh5.ggpht.com/peterzhoulei/SP_3r8j-HJI/AAAAAAAACfc/L9eIc99X118/s400/IMG_2465.jpg" alt="" /></a></td>
</tr>
<tr>
<td style="font-family:arial,sans-serif; font-size:11px; text-align:right">From <a href="http://picasaweb.google.com/peterzhoulei/GNOMEAsia2008Beijing">GNOME Asia 2008, Beijing</a></td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.peterzl.net/en/?feed=rss2&amp;p=93</wfw:commentRss>
		</item>
		<item>
		<title>GSoC Week 6: Amarok Scripting Interface</title>
		<link>http://www.peterzl.net/en/?p=92</link>
		<comments>http://www.peterzl.net/en/?p=92#comments</comments>
		<pubDate>Mon, 14 Jul 2008 14:13:08 +0000</pubDate>
		<dc:creator>eagle</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.peterzl.net/en/?p=92</guid>
		<description><![CDATA[Hey, I have a lot things to demo since we were moving very fast In the past two weeks!
I&#8217;ve added a lot of QtScript API functions, including GUI, Playlist, Collection, Music Engine and Scriptable Service.
Here are some small pieces from the whole cake:
one of the engine signals:
function TrackChanged()
{
print( &#8220;Dude! Do something! The track changed!&#8221; );
}
Engine.trackChanged.connect( [...]]]></description>
			<content:encoded><![CDATA[<p>Hey, I have a lot things to demo since we were moving very fast In the past two weeks!</p>
<p>I&#8217;ve added a lot of QtScript API functions, including GUI, Playlist, Collection, Music Engine and Scriptable Service.</p>
<p>Here are some small pieces from the whole cake:</p>
<p>one of the engine signals:</p>
<p>function TrackChanged()<br />
{<br />
print( &#8220;Dude! Do something! The track changed!&#8221; );<br />
}<br />
Engine.trackChanged.connect( TrackChanged );</p>
<p>Track Meta Info:<br />
var TrackInfo = Amarok.Engine.TrackInfo;<br />
StatusBar.shortMessage( &#8220;You are listening to album: &#8221; + TrackInfo.Album );</p>
<p>Collection and Playlist Access:<br />
var totalTrack = Amarok.Collection.totalTracks;<br />
Amarok.Playlist.clearPlaylist;</p>
<p>I&#8217;ve almost finished the DBus interface by supporting MPRIS standard ( <a title="http://wiki.xmms2.xmms.se/wiki/MPRIS" href="http://wiki.xmms2.xmms.se/wiki/MPRIS">http://wiki.xmms2.xmms.se/wiki/MPRIS</a> ). Now the script manager could handle script errors, write them to log files and correctly start/stop scripts. A simple demo script and a scriptable service QtScript called &#8220;Cool Stream&#8221; was released with Amarok Alpha 1.</p>
<p><img src="http://lh3.ggpht.com/peterzhoulei/SHgOyRhBnAI/AAAAAAAAB-A/UQFKwOgjBfc/snapshot1.jpg?imgmax=720" alt="" width="500" height="295" /></p>
<p>Everyone loves eye candy, the API implementation and bug fixing are mostly behind the scene. So I decided to make some candy for non-latin character users :).<br />
I grabbed the charset detector code from Mozilla, merged them into Amarok. Now, the wolf recognizes non-UTF8 tags:</p>
<p><img src="http://lh6.ggpht.com/peterzhoulei/SHgOyT-wuuI/AAAAAAAAB-I/3II93SfTjJI/snapshot2.jpg?imgmax=720" alt="" width="499" height="295" /></p>
<p>The summer of code project seems always stuck on some building system stuff. The charset detector didn&#8217;t compatible with cmake 2.4.8, and the Qt bindings generator was needed to be ported from qmake to cmake. ( thanks &#8220;compiling king&#8221; Ian for helping me <img src='http://www.peterzl.net/en/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  )</p>
<p>The SoC project will be ended in one month. And we still have some work to do. Ladies and Gentlemen, let&#8217;s wait for the finalized script API, and the brand new script manager!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterzl.net/en/?feed=rss2&amp;p=92</wfw:commentRss>
		</item>
		<item>
		<title>GSoC Week Four</title>
		<link>http://www.peterzl.net/en/?p=91</link>
		<comments>http://www.peterzl.net/en/?p=91#comments</comments>
		<pubDate>Sat, 28 Jun 2008 20:11:33 +0000</pubDate>
		<dc:creator>eagle</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.peterzl.net/en/?p=91</guid>
		<description><![CDATA[AH! Some big progresses and decisions have been made this week. So let&#8217;s take a quick glance at the new Amarok Scripting interface. Here we go!
var Engine;
Engine = Amarok.Engine;
Engine.Stop( true );
Engine.Play();
Engine.Seek ( 60*1000 );

You can run the QtScript code using the script manager. Is the code simple enough for you? Using the code above, you [...]]]></description>
			<content:encoded><![CDATA[<p>AH! Some big progresses and decisions have been made this week. So let&#8217;s take a quick glance at the new Amarok Scripting interface. Here we go!</p>
<p>var Engine;<br />
Engine = Amarok.Engine;<br />
Engine.Stop( true );<br />
Engine.Play();<br />
Engine.Seek ( 60*1000 );</p>
<p><a href="http://picasaweb.google.com/peterzhoulei/MyScreenShot/photo#5216830425266434770"><img src="http://lh3.ggpht.com/peterzhoulei/SGXnob90stI/AAAAAAAAB8Y/tr_KKyA3eWE/snapshot1.jpg?imgmax=640" alt="" width="513" height="301" /></a></p>
<p>You can run the QtScript code using the script manager. Is the code simple enough for you? Using the code above, you can control the music engine of Amarok. For the current track info, just use AttriVal = Amarok.Engine.TrackInfo.someAttr.</p>
<p>No need to import libs for using any APIs. Besides, you will also be able to use the entire Qt APIs in the near future!</p>
<p>Now, let&#8217;s add two menu objects under the &#8220;Tool&#8221; menu:</p>
<p>function Menu1Clicked()<br />
{<br />
print (&#8221;hey, I am menu1!&#8221;);<br />
}</p>
<p>function Menu2Clicked()<br />
{<br />
print (&#8221;hey, I am menu2!&#8221;);<br />
}</p>
<p>Amarok.Window.addSeparator();<br />
Amarok.Window.addMenu( &#8220;testMenu1&#8243; ); //you are creating a new object here!<br />
Amarok.Window.addMenu( &#8220;testMenu2&#8243; );</p>
<p>Amarok.Window.Menu.testMenu1.triggered.connect(Menu1Clicked); //then we can play with the new toy <img src='http://www.peterzl.net/en/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Amarok.Window.Menu.testMenu2.triggered.connect(Menu2Clicked);</p>
<p><a href="http://picasaweb.google.com/peterzhoulei/MyScreenShot/photo#5216830430552786754"><img src="http://lh4.ggpht.com/peterzhoulei/SGXnovqMB0I/AAAAAAAAB8g/lnI2uFSaxao/snapshot2.jpg?imgmax=640" alt="" width="511" height="300" /></a></p>
<p>Finally, you can control the OSD and the statusbar widget (in the right bottom corner of the main window)  using the code below:</p>
<p>var OSD = Amarok.OSD;<br />
OSD.setText( &#8220;Hey there!&#8221; );<br />
OSD.show();</p>
<p>var StatusBar = Amarok.Window.Statusbar;<br />
StatusBar.shortMessage( &#8220;Hey there!&#8221; );</p>
<p><a href="http://picasaweb.google.com/peterzhoulei/MyScreenShot/photo#5216830437696756002"><img src="http://lh6.ggpht.com/peterzhoulei/SGXnpKRcWSI/AAAAAAAAB8o/hHvm6tvlsUE/snapshot3.jpg?imgmax=640" alt="" width="519" height="305" /></a></p>
<p>Still a young wolf ah? A lot more APIs need to be implemented, like the playlist, collection, services, some GUI control, and networking APIs&#8230;</p>
<p>I am really happy as I am growing with Amarok. Let&#8217;s pray for an another productive week, and wait for more magics pop up! <img src='http://www.peterzl.net/en/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterzl.net/en/?feed=rss2&amp;p=91</wfw:commentRss>
		</item>
		<item>
		<title>GSoC Week Three</title>
		<link>http://www.peterzl.net/en/?p=90</link>
		<comments>http://www.peterzl.net/en/?p=90#comments</comments>
		<pubDate>Mon, 23 Jun 2008 16:27:14 +0000</pubDate>
		<dc:creator>eagle</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.peterzl.net/en/?p=90</guid>
		<description><![CDATA[I&#8217;ve been at home for three weeks, was with my family and had a three-weeks-leisure-break.
Finally, I am sitting here to talk about my summer of code project. I am sorry about the first three weeks break, I really do. But I did try to get familiar with the development environment and tried to hack some [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been at home for three weeks, was with my family and had a three-weeks-leisure-break.</p>
<p>Finally, I am sitting here to talk about my summer of code project. I am sorry about the first three weeks break, I really do. But I did try to get familiar with the development environment and tried to hack some code. I am going back to campus in Hong Kong in two days, I can thus concentrate on my SoC project.</p>
<p>For a long time, I was trying to understand what is going on there. Trying to think what the other developers think. For the first month I joined the community, I was amazed that amarok folks are so in love with what they are doing, and have so much passion on it. Different from my past projects, amarok is a rather large project, different developers had different views on the future way.</p>
<p>For the first time, I am feeling myself being pulled to the bleeding edge. I compiled QT for four times in two different platforms (How many times for kdelibs and kdeRunTime? :)). I realized it is sure a though learning process. Playing with the fresh new hot stuffs, I am pretty happy with this.</p>
<p>In the first week, I was busy with my exams, and cleaned up the existing dbus interface.</p>
<p>For the second and third week, I had a slight trip with my girl friend, set up a new Leopard development environment, tested the MPRIS support, and made my first commitment to KDE svn server.</p>
<p>I did some paper work, studied a little with scripts, and I am now quite clear with my goals for the coming busy July.</p>
<p>I made my mind to immigrate everything to qtscript from dbus. I would keep the <a title="http://wiki.xmms2.xmms.se/wiki/MPRIS" href="http://wiki.xmms2.xmms.se/wiki/MPRIS" target="_blank">MPRIS</a> stuffs (PlayerDBusHandler, RootDBusHandler, TracklistDBusHandler) for dbus interface. And the other functions will be scriptable through qtscript. (both ruby and python need additional runtime dependencies, but not qtscript. The simpler the better :))</p>
<p>Compare to the current functions, I will add more signals since the signal machanism are rather easy to be acheived using slots and signals. For example, signals like trackEnd ,trackChange, SeekingTime, configurationChange and etc. would be added.</p>
<p>The second change I will make is the scriptable GUI. You will be able to add buttons, menus, lists using scripts.</p>
<p>Before my visiting to Belgium, I will make a easier use script manager which include upgrade checking, simple dependency checking (to check amarok version and optional packages for amarok which will be also needed by scripts).</p>
<p>I am so looking forward to the coming working days and nights. Hopfully, I can work out a brand new scripting interface in one and half months and thus I can start a new script project during my visit to Europe.</p>
<p>Happy hacking <img src='http://www.peterzl.net/en/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterzl.net/en/?feed=rss2&amp;p=90</wfw:commentRss>
		</item>
		<item>
		<title>How many cores do we have?</title>
		<link>http://www.peterzl.net/en/?p=86</link>
		<comments>http://www.peterzl.net/en/?p=86#comments</comments>
		<pubDate>Fri, 11 Apr 2008 18:45:08 +0000</pubDate>
		<dc:creator>eagle</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.peterzl.net/en/?p=86</guid>
		<description><![CDATA[We developed single core CPUs, then we have developed dual cores, now we have multi-core CPUs&#8230; Do anyone knows how many cores do we have in our brains?
We can watch movies while eating although some persons may have difficulty eating while watching hot girls; We may listen to musics while reading&#8230; And we know that [...]]]></description>
			<content:encoded><![CDATA[<p>We developed single core CPUs, then we have developed dual cores, now we have multi-core CPUs&#8230; Do anyone knows how many cores do we have in our brains?</p>
<p>We can watch movies while eating although some persons may have difficulty eating while watching hot girls; We may listen to musics while reading&#8230; And we know that there are several parts of the brain having different functionality. Is it really means we are multi-core thinking machines?</p>
<p><strong>No! I do believe we are single-&#8221;CPU&#8221; animals.</strong> Of course, we are much more creative than machines.</p>
<p>Here&#8217;s how human brain works:</p>
<p>First of all, human body should supports interrupts. In the example of watching hot girls/guys, our brain asks the mouth to eat, and then keep focusing on the hot person. It will get a signal after the mouth finishes its job. Then it controls the eyes to look at your remaining food to get another bite. OK, if you are too concentrating on the girl/guy, you will not be able to respond the interrupt generated by the month. You will thus look stupid.</p>
<p>Now, after we learned the mechanism of our mind, we should conclude some principles in order to be a smart man.</p>
<p><strong>Principle ONE: Do remember to respond your internal interrupts!</strong></p>
<p>Yes, our mind is powerful, it not only supports sequential interrupt processing, it also supports nested interrupt processing! But It is still in some versions between beta and release candidate&#8230;</p>
<p>You were looking at a girl while eating, what if another even hotter girl pass through? Your eyes should immediately interrupt your mind to move attention to the other one! When doing this, you are supposed to move your attention back to the first girl after the second girl leaves. But why you still do like this? You stare at nothing as if the first girl does not even exists!</p>
<p><img src="http://www.gameblog.fr/images/blog/Chat%2002.jpg" alt="" width="299" height="222" /></p>
<p>Here&#8217;s <strong>Principle TWO: Since the features of nested interrupts mechanism is still in some beta versions, use it carefully!</strong></p>
<p>At last, our mind supports embedded virtual thinking! This is really an advantage that our human has over machines!</p>
<p>Guess why you stared at the wall, forgot other girls, and even forgot eating. This is called the function of embedded virtual debugging. You were doing a test run. I don&#8217;t know what you ran, cuz different persons should have different results, this is called the &#8220;various architecture phenomenon&#8221;, like x86 and ppc platforms&#8230; different persons will generate different virtual environment to have the virtual run.</p>
<p>It is still under debugging why nested interrupt will always related to the internal embedded virtual debugging.</p>
<p><strong>Principle Three: Use your virtual debugger well, or you will always look like this:</strong></p>
<p><img src="http://paper.people.com.cn/smsb/images/2006-05/30/1148915830078S9B0530001_b.jpg" alt="" width="300" height="303" /></p>
<p>This bug is a high priority bug! But human race suffered this for thousands of years! However, if we have multi-cores in our mind, these principles will not be necessary.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterzl.net/en/?feed=rss2&amp;p=86</wfw:commentRss>
		</item>
		<item>
		<title>Hello world!</title>
		<link>http://www.peterzl.net/en/?p=1</link>
		<comments>http://www.peterzl.net/en/?p=1#comments</comments>
		<pubDate>Thu, 10 Apr 2008 06:17:17 +0000</pubDate>
		<dc:creator>eagle</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://peterzl.u9.1358.net/en/?p=1</guid>
		<description><![CDATA[HEY! Home sweet home!
Helloworld()
{
RegisterDomain(peterzl.net);
RegisterDomain(peterzl.org);
RegisterDomain(peterzl.com);
InstallWordPress(MYHOME);
RocknRoll();
}
I am not going to maintain my MSN Space blog anymore. Its stability, speed and yet functionalities are unacceptable&#8230;
Actually, M$ did do me a favor, it only saved three years archive of my blogs! This reduced my workload of exporting/importing I guess&#8230; SHIT&#8230;!
This page will be mainly used for development related blogs. [...]]]></description>
			<content:encoded><![CDATA[<p>HEY! Home sweet home!</p>
<p>Helloworld()</p>
<p>{</p>
<p>RegisterDomain(peterzl.net);</p>
<p>RegisterDomain(peterzl.org);</p>
<p>RegisterDomain(peterzl.com);</p>
<p>InstallWordPress(MYHOME);</p>
<p>RocknRoll();</p>
<p>}</p>
<p>I am not going to maintain my MSN Space blog anymore. Its stability, speed and yet functionalities are unacceptable&#8230;</p>
<p>Actually, M$ did do me a favor, it only saved three years archive of my blogs! This reduced my workload of exporting/importing I guess&#8230; SHIT&#8230;!</p>
<p>This page will be mainly used for development related blogs. And my Chinese Blog is located here:<br />
<a href="http://www.peterzl.net/cn">http://www.peterzl.net/cn</a></p>
<p>RSS Feed: <a title="http://www.peterzl.net/en/?feed=rss2" href="http://www.peterzl.net/en/?feed=rss2" target="_blank">http://www.peterzl.net/en/?feed=rss2</a></p>
<p>Have a nice weekend^_^</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterzl.net/en/?feed=rss2&amp;p=1</wfw:commentRss>
		</item>
	</channel>
</rss>
