Category Archives: 技术

Will not buy Huawei Mobiles any more

I and my wife used iPhone 4S and iPhone 5 before. We think iPhone 6 is too expensive and want to have a try with Android.

There were some deals about Huawei Ascend P7 near 2015 new year. We got it at 1999NOK(the cheapest price should be 1699NOK). My wife used it a few weeks and decided to switch back to iPhone 5. Then I started to use it.

It is a flagship phone which was released on June, 2014. Huawei’s Richard Yu introduces the Ascend P7 in Paris on May 7, 2014. The software is Android 4.4.2 + EMUI 2.3.

And Google released Lollipop(Android 5.0) at November, 2014, and now it is June, 2015. I still can’t find any from System Update, it’s always “No updates found”. After some googling, I found “Huawei Fans Club“, and there is a sub forum for P7. I got more knowledge about P7. There are several models: L00 for China Unicom, L07 for China Mobile, L09 for China Telecom, and L10 for European area(which I am using) and etc.

L00/L07/L09 models got EMUI 3.0 update, but it is still Android 4.4.

There is a plan from Huawei to have some kind of public test release of Lollipop on P7 on July, 2015, but L10 is not included. So I think my P7-L10 will not have that update in a short period, I mean several months.

P7 was one of flagships from Huawei, and still in current status, can’t catch up the latest release of software in more than half year.

I will try more with my LG Nexus 5, but the GPS on it is some kind of crap when I played Ingress.

Reference:

How to search changes with string in commit message in gerrit

Recently started to do merges for Qt Project again, there are some mergers, then perhaps there are some duplicate work. Better to find them before creating new merges.

jkt in #gerrit channel on irc.freenode.net answered my question, “message” is for it.

Documentation in Gerrit Doc: Gerrit Code Review – Searching Changes.

For me, I could just try “message:”Merge remote-tracking branch””.

From MacBook Pro(15-inch, Late 2011) to MacBook Air(11-inch, Early 2014)

Did I change my Apple laptop? No.

My old work Apple laptop, MacBook Pro(15-inch, Late 2011), was something wrong after new year. The configuration is: Intel I7-2760QM 2.4G/8G/240G SSD/Intel HD Graphics 3000 + ATIRadeon HD 6770M 1G/15″ LCD 1680×1050 .

The machine will display some glitches on the screen and crash. I tried to google “macbook pro 2011 discrete graphics issue”, looks like it’s very common issue for those models.

It’s lucky that the service of it didn’t expire. I got it repaired after about 1 week. They said that the main board was replaced. But the funny thing is: it’s a “MacBook Air(11-inch, Early 2014)” in “About This Mac”, and it is still old status in “System Report”. I guess it’s a bug for Apple, ^_^.

Or perhaps both models use same type of main boards?

About_This_Mac
System_Report

The snapshot of Qt5 env at the time a commit was merged by CI

For example, I am reading Gunnar Sletta’s blog, New Scene Graph Renderer.

I guess the change is b480fa83, it’s already merged in stable(5.2.x). After talked with Gunnar, he mentioned that the result in lastest stable is perhaps very different with the blog, because there was another big change, v4, also already in stable.

I think I need to have the environment to reproduce the “scene” at that commit, b480fa83.

First, I had a look at the status of that change.

In the dependencies part, I found:

qtdeclarative depends on qtbase and qtxmlpatterns repo. For this example, just in case, we have an explicit sha1 in qtbase. It’s uncommon. Normally it’s just like the case for qtxmlpatterns, an empty string.

Next, the change in codereview.qt-project.org is this.

I found the latest information when that change was integrated, QtDeclarative_dev_Integration #719: SUCCESS.

In Qt CI results, the results for QtDeclarative_dev_Integration #719, I chose macx-clang_developer-build_OSX_10.8, then I am in this page.

Searching qtbase, you could find some information like:

I think I know what I should do for qtbase and qtxmlpatterns.

Now I could have a shadow build and play with it.

How to download Video contents from NRK website

I am planning to learn Norwegian again… NRK started to provide video contents online, and also subtitiles. Looks like a very good material to learn, but could I download it and not always be online?

I tried google “download nrk video” and found:

Great! At least I tested it on OS X 10.9, and a friend tested in Ubuntu, both works fine. It doesn’t support Windows yet.

And I set up a github repo for it:

Preparation:

  • Linux:

  • Mac:

You need to install GPAC-0.5.0-OSX-64bits.dmg and Mkvtoolnix-6.0.0_2013-01-20-f398.dmg manually. And the README-MAC.txt said it also need to have Xcode installed. I am not sure about the reason.

You could also get it from sourceforge files.

master(default) branch is for Linux. If you are using Mac, please checkout mac branch:

And copy the scripts into your bin directory or /usr/local/bin, for example:

  • Download

For example, there is De nominerte 1:5:

You will get a .mp4 file for it, with subtitles!

More details about how to use it:

Thanks to Falkeklubben, the author of NRK opptak.

Enjoy it!

OS X下最近浏览器变慢了

之前10.8,最近升级到10.9。浏览器打开网页总是很慢,有的时候觉得好像第一遍总是不能加载,然后刷新一下,还有希望成功,但都很慢,而且不是一个浏览器,Safari/Chrome/Firefox都试过,好像差不多。

打开了Activity Monitor看了看,有个acwebsecagent的进程占用了很多内存。杀掉它之后,浏览器里会好些,但它还是会自动重启的,过一会儿,就又慢了。

Google了一下,发现了这篇文章,Random Slowdown of Browsers in OS X Mountain Lion,原来是我安装的Cisco AnyConnect Secure Mobility Client导致的。重新运行安装程序,确保取消选中“Web Security”,然后就会删掉这个东东了,然后浏览器就正常了。

在这篇博文的回复中,还有一个更简单的方法:

备忘一下。

为什么iPhone 5c, 5s开始使用64位

苹果是一家软硬件都做的公司,所以让我们先来看看之前是个什么情况。

iOS以前就叫iPhone OS,刚开始的时候还没有iPad和iPod touch呢。

现在使用iOS的硬件也已经很多了,这里只拿iPhone系列来说说。

iPhone 发布时间 初始iOS版本 终结时间 最终iOS版本
iPhone 2007-06-29 1.0 2010-02-02 3.1.3
iPhone 3G 2008-07-11 2.0 2010-11-22 4.2.1
iPhone 3GS 2009-06-19 3.0 ? 6.1.3
iPhone 4 2010-06-24 4.0 ? 7.0+
iPhone 4S 2011-11-14 5.0 ? 7.0+
iPhone 5 2012-09-21 6.0 ? 7.0+
iPhone 5c, 5s 2013-09-20 7.0 ? 7.0+

注:发布时间是指硬件以及初始iOS软件的发布时间。终结时间是指该硬件所能升级到的最终iOS软件的发布时间。

大家可以看到,iPhone的硬件基本是每年一个版本,但是从之前的6、7月发布过渡到9-11月发布了。

苹果的一个iOS硬件平台的iOS软件的支持基本是可以跨2个大版本号的,例如,第一代iPhone最开始使用的是iOS 1.0,最后可以用到iOS 3.x,但不能升级到iOS 4.0。

同理,今年最新的5c和5s,开始使用iOS 7.0,但iOS 9.0还需要支持这一代设备,iOS 10.0的时候,它们就会被抛弃了。

iPhone 5也就是最后一代的32位设备,那么我们可以知道苹果计划在iOS 9.0中不再支持32位设备,而是进入纯64位时代,也就是软硬件都是64位。

但这个问题,诺基亚根本不会遇到。

参考

How to setup a mirror of Qt Project

There is a work from Oswald Buddenhagen, his change, qtrepotools: add mirror script.

Mirror Script

You need to have an account of codereview(gerrit) and set up the ssh keys well, more info in Contribute to Qt.

Here is the qt-codereview-mirror shell script in github.

I set up this mirror script on a Ubuntu 13.04 machine. You need to check following before to run it:

  • Install git and procmail package for git and lockfile:

  • Make sure you have /data/repos directory.

You could have a try run for the above script. If it works well for you, you can add it into your crontab, see also Ubuntu: CronHowto.

Git Daemon

Next is to run a git server on your machine. I use git-daemon for this task.

How to use your mirror?

  • For Qt 4:

If you need to push change to upstream, then you should set up gerrit remote.

  • For Qt 5:

init-repository will help you set up gerrit remote for each repo.

Distributed Compilation the build of Qt

Qt is a huge project, especially like the module, QtWebKit. If you happen to be in a computer farm, it is very useful to use distributed complation to speed up the build of Qt.

Here I suggest to use icecream on Linux and Mac OS X, and IncrediBuild on Windows(at least for Microsoft’s Visual Studio compilers). About IncrediBuild, more details perhaps will be updated in the future. See also qtrepotools: publish ibmake.bat, incredibuild xge wrapper for make/buildconsole.

Today, this blog is more about icecc/icecream.

Preparation

Linux

icecream is maintained by the SUSE people. Then there are less issues in OpenSUSE than in Ubuntu. But Ubuntu is more popular one. I just use Ubuntu as example here.

  • Install your compiler, like gcc and clang.
  • Install icecc and icemon(optional). icemon is the monitor of icecream build, better to check it when you setup the enviroments. It’s an GUI application based on Qt 4.8. Note: you need to install 0.9.8~git2012121601-0ubuntu2 and later version for icecc. More details in “icecc” package in Ubuntu.

  • For clang users, if you want to make icecream compiler package, better to do:
    • 13.04: $ sudo ln -s /usr/include/clang/3.2/include /usr/lib/clang/3.2/
    • 12.04: $ sudo ln -s /usr/include/clang /usr/lib/
  • Create compiler package: please do it. Here is the example for 13.04:

  • Enviroment settings before build:

  • Run icecc-scheduler in one of your Ubuntus:
    • Edit /etc/default/icecc, set START_ICECC_SCHEDULER="true".
  • Start icecc service: sudo /etc/init.d/icecc start, icecc-scheduler service also could be started with this. Not suggest to run multiple icecc-scheduler in same network with default values, you could edit /etc/icecc/icecc.conf with more options.
  • Stop icecc service(optional): sudo /etc/init.d/icecc stop

Mac OS X

  • Create a ‘qt’ user. Open System Preferences -> Users & Groups -> “+” under the list of users (you might need to click the lock icon first and type in your password), add a user “qt” with your standard password.
  • Install HomeBrew

  • Install XCode and command line tools.
  • Install icecc and icemon(optional).
  • Create compiler package: please do it. Here is the example for 10.8:

  • Enviroment settings before build: (Note: looks like it doesn’t work well with a compiler package. 2013-06-19)

  • Copy com.github.iceccd.plist into into /Library/LaunchDaemons .
  • sudo chown root /Library/LaunchDaemons/com.github.iceccd.plist
  • Start icecc service: sudo launchctl load /Library/LaunchDaemons/com.github.iceccd.plist
  • Stop icecc service(optional): sudo launchctl unload /Library/LaunchDaemons/com.github.iceccd.plist

Building Qt

Normally just do source ~/.icecc_rc, configure and make.

  • For clang build(both Linux and Mac OS X), please keep in mind to use -no-pch when configure.
  • For Qt4 build, the -arch argument that Qt 4 passes to the compiler confuses icecream. So for now, if you use Qt4, you need to patch your mkspec to not add that (if you build for your local architecture only), eg. in mkspecs/common/gcc-base-macx.conf.(Note: looks like it’s only on Mac OS X, I haven’t tried it yet.)

Known Issues

  • Using icecream currently screws up debug information for all object files that we compiled remotely!(Mac OS X only)

Thanks

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