Archive for the 'Uncategorized' Category

Rediscover QQ/TM

QQ, formerly known as OICQ was set out to be a localized version of ICQ. I don’t remember when Tencent released the very first version but it began to gain popularity when I was in high school. Back then it was a real exciting thing to chat with friends and strangers online. You can query based on QQ (in China it is also referred to the numerical ID of your QQ account, other than the client itself), nickname, city, etc., in order to find a stranger to chat. This might seem a bit weird nowadays but back then it was a good way to escape from reality.

The earlier version of QQ was very lite. The setup file was only 700kB and can easily fit onto a floppy disk. But it had done its job well. I liked it so much that I purchased one year of premium membership, which gave me a chance to select some special QQ id along with a bunch of other benefits. I selected a 6-digit QQ with the last three being my birthday. By the way, even now a lot of people would be amazed by special QQ id (i.e., 88888888, 123456789) and are willing to pay a premium for it.

After a couple years of evolution, Tencent has expanded its platform. There was this notion of costumes that you can use to customize your avatar. Some of those were free while the fancier ones would cost money. They don’t deal with cash directly but you purchase QQ cash instead. Since the exchange rate is 1:1 for Chinese Yuan (not sure about now), QQ cash has become a very popular currency in the QQ community. But that’s not all, QQ has incorporated QQ games, anti-virus, browser, QQ space, downloader, etc. It almost as if the only thing Tencent did not have is its own operating system. As a result the client got very bulky and slowed down my computer quite a bit. I checked if there’s a way of not installing the unnecessary components but came up with no solution (not sure about how it is now). I also got very tired/bored of being harassed by strangers, and finally gave up QQ for MSN messenger. MSN (now renamed to Windows Live Messenger), interestingly, seems to follow the same path of QQ by trying to incorporate many community services and most annoying of all, flash advertisements (I don’t think even QQ has this “feature”). It is consuming a lot more memory than it used to be (and I started to favor Google Talk), more on that probably in another post.

What I do like are two of the features QQ provides: group chat and resumable file transfer. You can basically establish groups and invite people to join, and the group remains there until if the owner wants to delete it. The whole idea is for a group of people sharing the same interests to have a common ground to, well, have conversation. I know that MSN had the feature of inviting people to start group chat long time ago, but only recently did Windows Live Messenger incorporate the feature of groups. And of all IMs I have used, I don’t know any clients other than QQ that support resumable file transfer. To make things even more cumbersome (perhaps only for me }:-), many people now use those “one-for-all” type of IMs: Pidgin, Adium, Meebo (web-based) or IM within Gmail. This on one hand makes it really convenient for communicating with different IM accounts, but on the other hand you give up all the nice features of the particular IM clients: drag-n-drop file transferring, video/audio chat, screen-sharing (iChat). Nonetheless, it really boils down to personal preference, if my friends like it that way I just have to live with sending files as email attachments.

Although I abandoned QQ for quite a while, I have to admit that QQ has a significant success of marketing in China (considering ICQ almost dead in US). Furthermore, they are trying to improve. There is another IM client sharing the same account but with only the essential features of QQ, called Tencent Messenger (TM). It is “designed for communications among business people” hence those unnecessary components were stripped away. Couple of years ago Tencent finally released the English version of QQ and TM, this was a push for me to restart using my QQ id with TM (I mainly use English OS with US regional settings). QQ now also has versions for Linux and OS X (links to Chinese website, English website only has download for Windows version) it also finds its way to other mobile platforms as well. Particularly, I was amazed when I found out that the developers have ported QQ to iPhone OS. Although the clients on all the other platforms are not full-fledged – the interfaces look simple and the features are limited, I think they’ve made good effort and progress in trying to transport QQ onto other platforms.

Another interesting feature that I would like to emphasize is screen-grabbing during chats. Basically you click on the button and it enters screenshot mode, you drag the mouse to determine a region and then double click. The image will be copied to your sending box (where you type your messages, since it can now include images, it is not quite accurate to be called “textbox”), hence sharing information couldn’t be more easier (this works in both individual chat and group chat). Imagine if you want to send a piece of code for some one to read, with this you can send a nicely formatted version with a few clicks (if you want to argue that you cannot copy-n-paste directly from IM window to wherever else, meh, I am just illustrating an example here). I really like this feature and I don’t see any other IMs have it (actually one of the reasons I started to use TM again).

There are still improvements that can be made. First of all, the TM client (not sure about QQ) does not work well in multiple monitor setup. The main window automatically attaches to the right edge of the left screen (and “hides” itself in the right screen) if you try to drag it to your right screen. You will not be able to maximize the chat window in the secondary screen (the chat window will just disappear but not closed) and the screen-grabbing feature does not work on the secondary screen. Lastly, I would love it if QQ/TM saves chat histories on the servers (just like Gtalk/Gmail) since from time to time I do need access to them. Not everyone wants this though (especially when they are more of keep-it-off-the-record type of people).

I never thought I’d say this, but I do feel very proud of the developers of QQ/TM. For some of you who are interested, I highly recommend you to try it out and let your friends know about it. The English version can be downloaded here (Windows only, I will check if OS X and Linux version have English language option).

gtest + CMake + Visual Studio

I should have posted this sooner, but all kinds of things got in the way and… Okay, that was just some lame excuse, it is because my laziness that this site has been left unattended.

I suddenly felt the urge of writing this post because the other day I saw my friend Dat was trying to get gtest to work with Visual Studio but ended up getting cryptic messages from linking errors. This has happened to me before, and I have investigated this issue.

In fact, using gtest library with CMake is fairly easy and straightforward. All you need to do is to find the corresponding library and the include path, and then link the gtest library against the executable. This works without a problem in Linux. However, it becomes a bit tricky when used in Windows (as expected?).

The main issue is the Runtime Library setting in Visual Studio:

By default, it tries to load DLL, but I was feeding it LIB file. No wonder it complains. Suppose I am building in debug mode, I need to specify gtestd.lib to be my target library and select “Multi-threaded Debug (/MTd)” as the runtime library, whereas in release mode gtest.lib needs to be specified and “Multi-threaded (/MT)” should be selected.

So, is there any workarounds to avoid this manual hassle? Sure, simply do

SET(CMAKE_CXX_FLAGS_DEBUG "/MTd")

in the CMakeLists.txt, and it will be set automatically (somehow I was under the impression that I have tested this before and it was not working, but it did work just now).

Of course, you can specifically indicate that you want a DLL to be built in gtest. Yet so far I haven’t found a way to utilize the DLL (such that it can work with /MD or /MDd), I would have to defer this problem to some C++ gurus, i.e. George Toderici (if Google Alert ever alerts him about the existence of this post), to answer.

In support of WordPress

With the release of firmware v2.0, playing the iPhone is more enjoyable than ever. Although the popularity of web applications is continously increasing, I just don’t feel like having to open Safari every time I need to do something on my iPhone because the responsiveness of the web applications is limited even under wifi connection.

Now that WordPress has released the iPhone version of its blogging tool, I am trying it out without any hesitation (which is what I am doing right now), just to show my support. The writing tool is very neat, and I can also attach images at the end of this blog post. Unfortunately, due to the lack of copy-n-paste function on the iPhone, I don’t think you can insert hyperlinks in the text (nor did I find the option for doing so) and nor can you insert images from a URL. As the time of writing I just found out that the source of WordPress for iPhone is made available via their SVN server, throwing Apple’s SDK NDA right back in its face. It is interesting to see how Apple would respond.

It might also be worth noting that AT&T’s 3G coverage is still under construction, at least here in Houston. For instance, I don’t have any 3G signal at home and little on campus (as can be seen from the screenshot attached). I have to manually disable 3G network to not waste my battery and to ensure the quality of my phonecalls. So basically I am using an iPhone 2.5G with a white finish (I am no fan of GPS).

Since this post is dedicated to WordPress I am going to save my comments on iPhone 3G for the next one.

photo

A couple of good/exciting news

Out of no where (at least for me), Blizzard announced Diablo 3, the long waited successor of the famous Diablo series. Of course, I would assume (at least) another year and half before it going into beta, taking into consideration that even StarCraft 2 does not have a beta yet. Blizzard is “notorious” of postponing delivery of the final products, as they always claim that they want to take as much time as needed to achieve certain level of perfection.

Another piece of exciting news is that a bunch of Google developers have initiated the Google C++ Testing Framework project. I am not a fanatic fan of unit testing like Dat, but I do appreciate the merits of test driven development (TDD). Previously there was (there still is now) CppUnit, but it was not so straightforward to configure to work with Visual Studio. This can be attested by both Dat and me. Judging from the README and samples of googletest, everything should be as easy as in Ruby and Java. I will try it out when I finish the work at hand. The very first thing I need to do, however, is to figure out how to write the CMakeLists.txt to incorporate the test framework in a new project.

Last but not the least, I think I found a hole in AT&T’s iPhone 3G upgrade plan. According its policy, ineligible AT&T users need to pay $399/$499 for the 8G/16G model, but users who are currently on an iPhone plan are by default eligible for the upgrade price ($199/$299). Thus, before July 11th, which is the date when iPhone 3G goes on sale, if you can somehow get a hold of the first generation of iPhone, you can insert a new SIM card and activate it with your current number, which will upgrade your plan to an iPhone plan. Unless you have to show that you have an original iPhone when purchasing the new 3G model, you are qualified to upgrade just as other iPhone users.

I am not sure how AT&T countermeasure this kind of “hand-me-down” abuse. Maybe they do, but another ironic fact is that even if you start another new plan and pay for the early cancellation fee ($175), that will be only 175 + 199 = 374 for you to get an iPhone without a plan. Adding one month service fee, it is still less than $599 (price to get an iPhone 3G without signing a 2-year contract). What the heck were you thinking, AT&T?

Yay! CUDA SDK is running properly!

Although my work is not closely related to high performance computing, I just had this inherent obsession of optimizing programs to make them run faster (which I consider to be another expression of speed obsession). Last night I finally couldn’t stand waiting endlessly for NVIDIA to deliver the VS 2008-compatible CUDA toolkit and wanted to see for myself the cool examples CUDA SDK provides. Another key factor is that I still have my XP partition, which is something I can afford to screw up.

I then installed VS 2005 on it, but before I can run the examples I also need to install CUDA-enabled driver ( I tried without the driver, it didn’t work). Anyway, the driver version is 177.35 as the time of writing and when I ran setup.exe it prompted that my hardware is not supported in this driver. Hey, what’s up with that? I thought all 8-series graphic cards are CUDA-enabled (mine is 8800 GT by the way), this statement does not stand if I cannot install the CUDA-enabled driver which is required to run CUDA programs.

Googled a little bit, I soon learned that 177.35 was designed for the newest GTX 200 series (280 and 260) and I also found a workaround. Basically by replacing the original nv4_disp.inf (nv_disp.inf in Vista) with a modified one, I tell the installer that my graphic card should also be entitled to use this driver.

After a restart all the examples in the SDK are running properly. Then I plan to move a little further – install the toolkit and SDK on my MacBook Pro (with a 8600M GT). The process was painless except I need to add CUDA to my $PATH. Also worth noting is that only CUDA 1.1 is compatible with OS X (CUDA 2.0 beta2 for most of other platforms), hence there are less examples in the SDK.

One more thing, I still need a CMake module in order to generate my CUDA project files. Luckily some guru has already worked on it (even better, there is also FindCg.cmake). But since I have not tested it yet, I cannot guarantee it will function properly.

One other book that I actually finished

I set out to write this post right after I finished the book (approximately a month ago), but it seemed that I had a little problem keeping up with a good habit of blogging consistently. Anyway the book I am talking about is The Cg Tutorial: The Definitive Guide to Programmable Real-Time Graphics from NVIDIA.

The Cg Tutorial

I became obsessed with hardware-accelerated real-time rendering when GT showed me the beauty and the power of Cg language while I was taking the computer graphics course. As I decided to implement the rendering of some fogged terrain using Cg for my term project, I got this Cg tutorial and had it with me wherever I went for some time. To be honest, the project did not benefit much from this book since the techniques adopted were quite simple and fundamental – barely enough for me to have a taste of its awesomeness. However, what I like about the book is its readability. For beginners like me, the adequate introduction and well explained examples are very easy to comprehend (although an advanced user might find it naive and too verbose on obvious stuff). I finished Chapter 2 through Chapter 9 half a year ago and did not pick up the rest chapters (1 and 10) until recently (I have my reasons).

At first I did have some complaints about the fact that book did not include a basic yet important tutorial on how to connect the Cg programs with the C/C++ programs. They were gone by the time I reached Appendix B, which was exactly what I was looking for. Thus in my opinion, if you are into harnessing the power of the GPU for real-time rendering and are looking for a place to start, this book is definitely worth your attention. Plus, NVIDIA just made it available online and it is free!

Because I was so into graphics by then, I also got myself a brand new GPU Gems 3. Unfortunately, it was for more advanced CG (computer graphics) practitioners and I don’t have any clue about some code snippets (as in what kind of language is this or what is this file format). If somebody has got experience with this book, I would really appreciate it if he/she can share the knowledge.

Moving ahead doesn’t always gaurantee a superior position

OK, I admit it, I don’t really know why Visual Studio 2008 is better than 2005 and I am also aware of the fact that Windows Vista is running slower than Windows XP. I did the switch only for the sake of upgrade, as I have this unexplained compulsion to become up-to-date, and visual satisfaction from the inherent fanciness of the successors.

The consequence, as one might expect, is possible negative impact on productivity. Although I was lucky to finally have workarounds (by workaround I don’t mean reinstalling the compatible version) for the projects I am actually involved in, the time spent to search for solutions is substantial.

From what I have experienced so far, there are three scenarios in which using VS2008 and Vista could be annoying.

  1. Before the recent release of Qt 4.4, VS 2008 was not officially supported by Qt 4.3. This basically means that you might be able to use Qt 4.3 without a problem, yet on the other hand it could have driven you crazy after you spent hours to debug only to find it to be a compatibility issue (I started using 4.4 when it was still a snapshot so I only speculated what would happend). This usually causes the mildest annoyance as you might not run into problems at all.
  2. Before the recent release of MySQL 5.0.51b, it had some known bugs when installed on Vista (as well as on Leopard). What makes this scenario better than the last one is that you have workarounds (thanks to Google), and at the same time a newer version often tends to be released soon and fix the bug. Another example is Warcraft III, which started to run properly on Vista after applying the latest patch.
  3. Last but perhaps the most disturbing thing, is having to wait for the software/SDK to have support for VS 2008 without any specific time frame, as in “we currently don’t have plan to support Visual Studio 2008″. CUDA, for instance, does not support Vista until the latest release of 2.0 beta. To make it even worse, this version of toolkit does not work in VS 2008. Fortunately I only wanted to play around with it.

I was actually quite surprised by these incompatibility issues since Vista has been out for two years already. Yet apparently some software developers are more rational than I do. Thus in cases when the Vista-incompatible libraries and/or applications are mission-critical, unless you find a fix and meanwhile is willing to go through the trouble, stick with VS 2005 and/or XP.

Qt 4 + CMake + Visual Studio rules now

Thanks to Bill from Kitware Inc., who responded my previous post in a very timely manner and helped me solve the compilation issues as well as the execution error.  CMake and Visual Studio 2008 are now back in the triangle.

The compilation problem lies the source code of the Qt demo. Two other classes were declared in two of the class definition .cpp files so that either moc’ing the sources or moc’ing the headers will leave some of Q_OBJECT classes un-moc’ed, which causes the linking errors. On the other hand, qmake handles this implicitly so the project file it generates doesn’t have this problem. After moving those declarations to the header files, everything compiled nicely and quietly.

As for the debug execution problem, Bill also suggested that the commercial evaluation version of Qt 4 binary I downloaded might be built with VS 2005. If that is the case, there is no way I can execute in debug mode the program linked against the Qt 4 libraries. I was just being so naive to make the assumption that the binaries should be of no difference if QMAKESPEC is the same.

After downloading and compiling the source of Qt 4.4 beta (boy, that compilation DID take QUITE a while), everything went back to normal. I am now happily “CMaking” my projects again.

Qt 4.3.4 + CMake + Visual Studio 2008 doesn’t work

Hoping to create a nice GUI for the project I am currently working on, I downloaded the commercial version of Qt 4.3.4. It installed fine, with the option of integrating with Visual Studio disabled since the integration with VS 2008 is not officially supported yet. Trolltech has already announced to support this in the upcoming version of 4.4, though.

The demo that comes with the package looks really appealing, just like how I like it: simple, themed design and fluent animated transition, which together provide the user with maximum visual satisfaction.

Trolltech is generous enough to have included all the source code of the demo so that we can play around and figure out how to mimic those fancy effects. At first I planned to use CMake to generate the project file (.sln file in the case of Visual Studio) for the demo, in accordance with all other projects that I am working on. There are also examples of CMakeLists.txt for Qt 4 projects (here is one). Despite it seemed that everything should be easily done without any hustle, it soon turned out not to be the case this time.

First, the solution file generated by CMake just won’t compile (unless it’s a single main.cpp, in which case I got it to work) if there are other Q_OBJECT classes present. I tried both QT4_AUTOMOC and QT4_WRAP_CPP, all ended up with “error LNK2019: unresolved external symbol“:

SET(SRCS src/main.cpp src/mainwindow.cpp)
SET(HDRS include/mainwindow.h)

and either

QT4_AUTOMOC(${SRCS})
ADD_EXECUTABLE(demoGUI ${SRCS} ${HDRS})

or

QT4_WRAP_CPP(MOC_SRCS ${HDRS})
ADD_EXECUTABLE(demoGUI ${SRCS} ${HDRS} ${MOC_SRCS})

Correct me if I am doing anything wrong above. After googling a bit I figured that something is wrong with the moc’ing process, but I haven’t yet found a solution. Thus I am taking CMake out of the equation temporarily.

A nice thing about qmake that comes with the Qt package is that just like CMake it can generate project files for different platforms, with an equivalent of CMakeLists.txt, projectname.pro file. With the command

qmake -tp vc -spec win32-msvc2005

one can easily get the project file (.vcproj/.sln) for Visual Studio 2005 to use. The project compiled under VS 2008 without any error, but when running under debug mode I get either “This application has failed to start because the application configuration is incorrect” if the solution file is generated by qmake or “The application failed to initialize properly (0xc0150002)” if it is created by CMake (remember I had one single main.cpp compiled). However, the release builds executed correctly.

Again I googled for a while and found out the problem might lie in the manifest files of the Qt core dll’s. Since the QMAKESPEC is set to win32-msvc2005, the manifest files of the dll’s have VS 2005 info (Microsoft.VC80.DebugCRT) embedded. When the program compiled with VS 2008 (VC90) and linked against those dll’s tries execute, there’s a conflict in configuration. Unfortunately, none of the solutions I found worked.

Now it is quite clear that for now I cannot (at least easily) debug the Qt4 programs in VS 2008. VS 2005, on the other hand, is working as advertised both in debug and release mode. Guess I would have to stick with VS 2005 for a while before Qt 4.4 is released.

An alternative plan would be trying out the 4.4 beta to see if it is a solution, while using qmake to generate the Makefile, from which to see how the CMakeLists.txt should be written.

New Google Calender feature: sync with Microsoft Outlook

Just now when I was creating an event in my Google Calender (GCal) I happened to notice that Google is offering a synchronization service between GCal and MS Outlook.

Aside from this topic itself, I would have to say that Google does have some unique style of “announcing” new features. I don’t know about the situation of technology-savvy people who subscribe to Google’s announcement, but for me I don’t hear rumors, I don’t see official news, I don’t receive email notifications – the advent of a new feature is displayed merely in bold red font in the top toolbar of Google sites, and believe me there is a pretty good chance that it would be overlooked. So it is highly likely to lead to “Hmm, since when did Google begin to have this?” when you are just performing your regular routines with any Google service.

Now back to the new feature GCal offers: 2-way syncing with Microsoft Outlook. Isn’t that great? Previously we were only able to subscribe the GCal’s (assuming multiple calenders serving difference purposes) in Outlook to view them. Event editing had to be done on the server side, but now you can create and edit whichever side you want. On top of that, it is a free service.

That suddenly reminded me that I paid $65 for Spanning Sync for my Mac, which essentially (and only) performs 2-way syncing between GCal and iCal. It is simple but it does its job very well and the customer service has been very responsive. Yet truth to be told, I think $65 is a little bit too expensive for this feature. There is also a subscription option available for $25 a year, but I am just no subscription guy (part of the reason I didn’t buy .mac).

Anyway, since Google released Outlook syncing service. It could indicate that a free iCal syncing service is also in the future plan, which means I might have wasted my bucks.

Not so fast. I downloaded and installed Google Calendar Sync as instructed, but found that only my primary calender in GCal got its way to Outlook. Not surprisingly, I found this when I checked again the Getting Started page:

Keep in mind that it’s not possible to sync events on secondary calendars at this time. Google Calendar Sync will only sync events from your primary Google Calendar and your default Microsoft Outlook calendar.

Hence great new feature for one-calender-for-all users! Good news for multi-calender users because now you know at least Google is working on this 2-way syncing issue. Users who purchased Spanning Sync or BusySync (latest beta added support for 2-way syncing between iCal and GCal, for a cheaper price than Spanning Sync), let’s hope Google does not have support for iCal in the development plan.

Next Page »