Category Archives: 技术

Setup your own CommaFeed on OpenShift as Google Reader replacement

Yes, Google Reader will be dead soon, Google Blog: A second spring of cleaning.

I just read a few blogs which talked about the alternatives. Then just a few days ago, one of my friend told me there are inoreader and CommaFeed. And found this article, jasonwryan.com: Replacing Google Reader.

CommaFeed is an opensource solution(Note: it’s in maintenance when I started to write this blog), source code is on github.

Steps

Signup on OpenShift

Go to OpenShift, signup

Add JBoss 6.0 application

Go to OpenShift: Get Started, then click “WEB”, a bit down, clike “Open the Console and Create an Application”, in “Mangement Console” page, click “Create Application”, find “JBoss Enterprise Application Platform 6.0”, and install it, you need to set the “Public URL”, for example: http://mygooglereader-enjoylife.rhcloud.com , click “Create Application”.

You can add a public ssh key in next page.

(Note: I am not sure how much I will pay for that service based on “JBoss Enterprise Application Platform 6.0 is based on a premium cartridge. It costs an additional $0.03 per gear hour after the first 3 gears.”)

Install mysql 5.1

Back to OpenShift: Get Started, click “COMMAND LINE”, follow the steps in “Install the client tools on:”, for me, it’s “Mac OS X”. Then “Setup your enviroment”, command is “rhc setup”, there it will help you to create a ssh key and set up it. “rhc add-cartridge mysql-5.1 –app mygooglereader” will help you install mysql into the application. Please remember to keep the secret information like root username, password and etc.

Deploy CommaFeed to OpenShift

In OpenShift: My Applications/Mygooglereader, found the url of your git repo:

You need to make a local clone of CommaFeed and merge it with your openshift application, then push it:

If you find sth like following, then it works fine:

You can goto Your Own Google Reader, use the default user “admin” and password “admin” to login, change the password and create your own account.

Apply Goolge client ID and etc

Go to Google Code: API Console, create project, and click “API Access”, click “Create an OAuth 2.0 client ID…”. In the popup, input “Product name: mygooglereader”, “Home Page URL: http://mygooglereader-enjoylife.rhcloud.com”, click “Next” button, Then “Create client ID” button.

Then “Edit settings…”, in “Edit client settings” popup, “Authorized Redirect URIs” is “http://mygooglereader-enjoylife.rhcloud.com/google/import/callback”, “Authorized JavaScript Origins” is “http://mygooglereader-enjoylife.rhcloud.com”, click “Update” button. And found “Client ID” and “Client secret”.

Application settings in CommdFeed

Go to Your Own Google Reader, use “admin” to login. Then go to Settings page, set “Public URL” to “http://mygooglereader-enjoylife.rhcloud.com”, and also “Google client ID”, “Client secret”. Click “Save”.

Import your subscriptions from Google Reader

Go to Your Own Google Reader, use your own account, click the arrow button near the “Subscribe”, select “Import”. In “Import” popup, click “Google Reader”, then log in your google account, and wait about several minutes. All will be fine.

TODO

  • Update CommaFeed from upstream.
  • Backup mysql database.

Reference

How to embed an Info.plist into arbitrary binaries

For an application on OS X, the Info.plist file is very common. But could we embed it into the binaries?

Yes, we can. There is a compiler option “–sectcreate __TEXT __info_plist Info.plist”.

One example is the .pro file for qmlplugindump in qtdeclrative, change 4d173d5f16c103f640d4089feed44a74b14e9004.

I learned it from ariya‘s commit in phantomjs: 71425850f61ad85e33741ed5a59364327532f6a8.

And today I read an article: Gimmedebugah: how to embedded a Info.plist into arbitrary binaries, which also mentioned this. And it gives me the Apple documentation for that, Code Signing Tasks: Adding an Info.plist to Single-File Tools.

Memo: Mac OS X Internals

Recently just started to read a few pages in this book, Mac OS X Internals: A Systems Approach, by Amit Singh. It’s a bit old, too much contents about the old PPC.

Then yesterday found an interesting video about same topic, YouTube: Inside the Mac OS X Kernel [24c3]. (Note: some people can’t access it.) This video was public recently, but it’s also a bit old, Dec. 2007. It’s from 24th Chaos Communication Congress: Inside the Mac OS X Kernel, by lucy. (You can find the slides there.)

请点击查看视频

And I am not sure whether one sentence in the presentation is still correct or not now, “The Mac OS X kernel is not 64 bit.”

Nokia is still working on some Qt projects

Yes, Digia accquired Qt from Nokia last year. But it’s very interesting to see Nokia is still working on some Qt projects.

How do I know it?

Go to Nokia: See the latest career opportunities. Input “qt” in “Keywords” field, and select “Research & Development” in “Job Category” field, click “Search for Jobs” button. At least I got 9 positions, one in US and 8 in Berlin, Germany. It looks like the projects are about Automotive and using Qt and QML.

一些中文学习资料总结

iOS应用程序

汉字描红

我现在一般用“自定义”:“大”,每字6行,每行5次描红,打印笔顺,正好一页一字。

备注

  • 2013年2月20日:上述写字贴中的“力”的笔顺有误,汇报给网站,2月21日已经修复。
  • 2013年9月18日:上述写字贴中的“那”的笔顺无法生成,汇报给网站,9月23日已经修复。

教材

书法

参考

问题

备注: 以后会保持更新,大家如果有其它内容推荐,请回复,谢谢。

How to debug into Qt library in Qt Creator with CDB

OS: Windows 7 64bit SP1 (Note: need to have .Net 4 installed)

SDK: Windows SDK 7.1 x86_64 (Note: remember to have “Visual C++ Compilers” and “Debugging Tools for Windows” installed)

Qt Creator: Qt Creator 2.6.2 in qt-windows-opensource-5.0.1-msvc2010_32-x86-offline-2013-01-30-426.exe (Note: I am testing 5.0.1 daily build packages, 5.0.0 release doesn’t ship with .pdb files)

Qt Creator 2.6.2 could detect the compiler and cdb correctly from above environments after installed. What you need to do are only two things:

  1. Tools->Options->Debugger->CDB, In the Symbol paths field, open the Insert menu and select Symbol Server, just use default value and click OK
  2. Tools->Options->Debugger->General, in Source Paths Mapping part, click Add, set Source path field to q:\qt5_workdir\w\s and Target path field to C:\Qt\Qt5.0.1\5.0.1\Src

Then you can debug into Qt library in your applications.

Reference:

Update:

Some information about CI and build, release in qt-project

Just some information, not details:

Last night, I was back to 1998

Hi, friend, it’s a “title party” blog. The original word is 标题党, and “title party” was translated from Google Translate. I really don’t think 标题党 is “forum spammer” here.

Back to my blog, it’s about running Caesar III on my MacBook Air 2012 13″ via CrossOver.

Caesar III is one of my faviourite games during university. (Sorry, I used a crached version at that time. And it’s still in one of my hard disks, just haven’t played it for years.)

I tried Caesar IV several years ago, but I don’t like the 3D in that game.

Caesar III only has windows version.

Last week, I got a deal, CodeWeavers: Flock The Vote: 2012, a free CrossOver for Mac and Linux.

First application which I want to run, Caesar III, popped up in my mind. Googled “CrossOver Caesar III” and got this page WHAT RUNS: Caesar III, looks like it’s possbile. Then I found some people is using GOG version.

What’s GOG? Good Old Games

It’s only $5.99 and digital downloadable version! I bought it.

But I can’t run it successfully at the first time. The display is garbled after running it. But sound is ok, and ESC could trigger the Quit dialog, the dialog works.

I gave up at that night. And posted a thread in forum.

After checking my thread for days, didn’t get any reply.

Last night, got some spare time after my daughter went to sleep. I found an irc channel for CrossOver, irc.freenode.net/#crossover .

Haha, got some suggestions from Axylus.

Remove the current installed CrossOver and Caesar III:

Then install CrossOver, and Caesar III(use Windows98 bottle).

Before running the game, Configure->Manage Bottles, select “setup_caesar_3.exe” in left, and choose “Control Panel” in right, choose “Wine Configuration”, and click “Launch Selected Item”. In “Graphics” tab, check “Emulate a virtual desktop”, Desktop size could be 800×600 and 1024×768, but for 1024×768, you should also enter the game to set it in Options->Display Settings.

It works this time! (though it’s not in full-screen mode.)

I was back to 1998!

Some other tips for CrossOver:

Clues of Qt on Android and iOS

Just for who are interested in the status of Qt on Android and iOS, and want to contribute to it.

Qt on Android

Mainstream: Qt 4.8 and QtBase(Qt 5.0)

Run the following command in 4.8 branch of Qt repo and master branch in QtBase repo:

Folk: Necessitas

There is a folk, Necessitas, which is based on Qt 4.x.

Note: At least by now, it is not merged into mainline.

If you want to contribute to it, please read KDE Necessitas project: Get involved. You can find bug reports, todo list, mailing list and irc channel.

The most important one is code repository.

Qt on iOS

Mainstream 1: Qt 4.8 and QtBase(Qt 5.0)

Run the following command in 4.8 branch of Qt repo and master branch in QtBase repo:

Mainstream 2: iOS branch in QtBase(Qt 5.0)

Here is the commit history of ios branch.

Note:

How to find the changes which people are working on? Search this in codereview:

Reference: gerrit doc: Searching Changes

Update:
2012-11-08 Digia: Necessitas Android Port Contributed to the Qt Project

To be updated in future.