Two plugins in one browser just makes trouble

Desktop July 27th, 2008

Today one website I usually visit requires me to upgrade the Adobe Flash player, and in fact, I just did recently n the emerge world. From the output of the Firefox about:plugins output, I seems to have more than one Flash player installed:
Two Flash plugins installed in Firefox

It is a little bit overkill to launch strace as Firefox considerately leaves the option to expose the full path by enabling plugin.expose_full_path in about:config, this is the screenshot after netscape-flash-9.0.124.0 is un-emerged:
One Flash plugin installed in Firefox with full path exposed

Seems I did manually install the flash-7.0r63 in the home directory that overrides the system-wide Flash plugin. Once it is removed, and 9.0.124.0 is re-emerged, everything works.

BTW, if you happen to be a Flash developer, and would need to install multiple versions of Flash player, it is may be worthy taking a look at Flash Switcher as well.

Is MobileMe the ONE?

Desktop June 12th, 2008

The 3G iPhone and the accompanied MobileMe service introduced in WWDC 2008 stirred the buzz in the blogosphere as ever. MobileMe logo The MobileMe tries to solve the long-lasting synchronization problem, which Microsoft have not figured out a panacea for both enterprise market and mass customers. Apple’s answer seems like an intuitive and elegant solution in the first impression, and we may wonder, is MobileMe the ONE?

I really doubt it, based on some common sense and reasonable guess as the service is not available so far, please correct me in your comment if I am wrong.

Push model may not cross the enterprise boundary
Push mail has been very successful in the enterprise world, but why there are no such things like push document, push worksheet? The instantaneous synchronization is just purely wasted in most cases, even not that inviting in the Corp net which is powered by Gigabit ethernet, let alone the consumers are using much slower high speed internet or 3G wireless connection.

There is no silver bullet to resolve conflicts
MobileMe supports family pack, so it is possible that one file is edited in different computers. The conflict has to be resolved however fast the synchronization is. We also need to track the version number because it is hard to tell which copy is the latest without network time synchronization, so ultimately MobileMe would be a version control system. But according to my personal experience, there is no more intuitive way to resolve the conflict than three-way diff. But this is less user-friendly and not an available option if you are working with images or videos.

Accessibility and Interoperability
These are not big issues for die hard Apple fans. I believe Bonjour would automatically configure the firewall and all made-by-Apple applications would talk to MobileMe without any problem. No idea whether Apple would release the protocol document, like Microsoft did recently, to encourage 3rd party interoperability.

I personally prefer SSH, RSync and SVN( maybe Mercury later), periodically back up to my friends in a different zip code for extra safety.

ID3 tag for programmers

Desktop February 7th, 2008

If you feel unease to do anything in a command line, or you have no idea about what regular expression is, please stop; I am quite sure this recipe is just not your cup of tea.

eyeD3util is a small, yet powerful IMHO, package that handles nasty ID3 tags that GUI may not offer. As the name suggests, it is based upon eyeD3, thanks to Travis’ great work. There are three apps targeting different etches:

eyeD3conv.py
eyeD3conv.py convert the ill-encoded tag, and convert them to Unicode. Check this for a full story. Though never tested other than Chinese GB2312, theoretically, it can handle the tag encoded in non-latin1 locale. Please leave a comment if you have a success story.

eyeD3ffn.py
What if no tag attached like Hanes? Well, if we could get the essential information, the track number and name, we may add other meta data using eyeD3. This script parses the filename via the regular expression to get all available meta data you need, for example:

eyeD3ffn.py “(?P<n>.*) - (?P<t>.*)\.mp3″ “02 - 祝我幸福.mp3″
Apply ID3 v2.3 tag to 02 - 祝我幸福.mp3
setTrackNum:  [‘02′, None]
setTitle:  祝我幸福

eyeD3validate.py
To be a perfectionist, I would rather check whether the MP3 file includes all essential information required: title, artist, album, track number, year of publish and genre. This script just did the minimum, nothing less, nothing more.

Comments? Feedbacks?

Migrate to MTP

Desktop, Gentoo December 15th, 2007

About nine months ago, I tried to embrace MTP since Creative Lab does not support their own proprietorial protocol(libnjb is the open source implementation) in Windows Vista, and I was really frustrated by the lame upgrade support.

Here is a chance for me to get a 2nd generation Zune which is powered by MTP. Although libmtp is still in very early stage to bridge the gap, we could predict its future from the history.

Amarok supports MTP if the USE flag mtp is enabled. However, the latest stable version 1.4.7-r2 has a bug when transfer file with CJK characters. The bug happens when interfacing with libmtp:

int ret = LIBMTP_Send_Track_From_File(
-        m_device, bundle.url().path().latin1(), trackmeta,
+        m_device, bundle.url().path().local8Bit(), trackmeta,
         progressCallback, this, parent_id
     );

The bug is fixed in SVN (ticket), but if we take non-utf8-locale users into account, for example, MagicLinux takes GB2312 as the default locale, local8Bit may have more flexibility than hard-coded utf8, and it also worked in the UTF8 environment.

Here is the patch , and as usual, an ebuild for Gentoo users (manual).

Small fix for libnjb to transfer Chinese tags

Desktop, Gentoo July 17th, 2007

I once mentioned that some Chinese characters are missing in Creative ZenMirco when using Amarok + libnjb. I checked the libnjb-2.4.4 source code and found that the text codec conversion from UTF-8/ISO8859-1 to UCS2 big-endian is home-brew instead of the standard libiconv, maybe the libiconv is overkill since only three codecs are really needed. According to the specification of UTF-8

U-00000000 – U-0000007F: 0xxxxxxx
U-00000080 – U-000007FF: 110xxxxx 10xxxxxx
U-00000800 – U-0000FFFF: 1110xxxx 10xxxxxx 10xxxxxx
U-00010000 – U-001FFFFF: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
U-00200000 – U-03FFFFFF: 111110xx 10xxxxxx 10xxxxxx 10xxxxxx
10xxxxxx
U-04000000 – U-7FFFFFFF: 1111110x 10xxxxxx 10xxxxxx 10xxxxxx
10xxxxxx 10xxxxxx

while the libnjb developers made a small mistake, so all 0×80xx characters are categorized as abnormal.

if (numbytes == 2 && str[i+1] > 0×80) {
                        … …
                } else if (numbytes == 3 && str[i+1] > 0×80 && str[i+2] > 0×80) {
                        … …
                } else {
                  /* Abnormal string character, just skip */

Here is a patch against libnjb-2.2.4, you may adapt it to libnjb-2.2.5 as well. For Gentoo users’ convenience, here is the ebuild.

I am just curious why this bug has been here for such a long time. How many Chinese Linux/BSD users take UTF-8 as the locale, transfer music to Creative ZenMicro? Are these three factors are really small that make this almost never gonna happen?