Category Archives: 技术

Windows VNC Viewer connecting to Mac OS X Lion

I have a Mac Mini as a Home Theater PC, which is running Mac OS X Lion. And I also have a laptop with Window 7 Home Basic SP1.

I have tried to use Real VNC Viewer to connect to my Mac Mini before, but failed.

Today I tried again, by searching from web and found there is a solution now.

On Lion,

1. System Preferences->Users & Groups->Login Options, set “Automatic Login” to off.
2. System Preferences->Sharing, turn on “Screen Shareing” and click on “Computer Settings” button, set a password for “VNC Viewers may control screen with password:”.

On Windows,

1. Try to download “Ultra VNC Free Viewer“.

Then it will work for you. Many people said “Tight VNC Free Viewer” and “Real VNC Free Viewer” do not work well as the Ultra one.

Reference:
Apple Support Communities: TightVNC (or other windows VNC viewer) connecting to OS LION

看来N8还可以再用一阵子了

Nokia N8最早出来的时候是Symbian^3,公司这边发的是北欧版的,不支持中文,想看中文页面只能用Opera

本来最近想换个手机的,正好Belle发布了,今天更新了一下,原来的中文文件名的.mp3文件可以显示了,网页浏览器也可以看中文了,可以查看中文短信啊了。Symbian手机终于也算是个智能机了,有时间再试试中文输入法,不过目前的情况可以再用一阵子了。

2月20日备注:装上QQ的输入法之后,修改一下设置,然后重启机器,可以输入中文了。

国内游戏公司Mac的开发水平都很差么?

原本支持Mac OS X的游戏进入中国,特色了一下就不支持了,不知道国内的游戏公司有什么魔力?

之前以为网易会比九城好一些。

参考链接:
魔兽世界官方论坛:国服什么时候才能有MAC OS的客户端啊?
星际争霸2官方论坛:国服什么时候能出MAC版的客户端啊

2012年2月8日备注:
Blizzard大神亲自解决了这个问题,至少有人确认了15211这个版本可以用Mac客户端登陆国服,希望网易不要让人太失望。

2012年2月13日备注:
Lion 10.7.3中测试了一下,我的WOW国服客户端好像升级没有完全,到Mac下Launcher被升级了,然后用上面链接中的32位客户端可以登录,Launcher中的关于32位/64位的选项是不可选的,手工将32位的改为其它名字,把64位的改成默认的名字可以登录。

More syntax highlight files for Qt Creator

In Qt Creator, you could use the syntax highlight definition files from Kate, more details in Qt Creator Doc: Semantic Highlighting.

Where could we get more?

Here it is: KDE-FILES.org: Kate Highlighting. Just download one, and move it into ~/.config/Nokia/qtcreator/generic-highlighter, restart your Qt Creator, it works.

Want to write your own?

This is a good material to read, Kate: Writing a Syntax Highlighting File.

Building a Sandy Bridge CustoMac: Buyer’s Guide(Norway and China)

The original link: tonymacx86: Building a Sandy Bridge CustoMac: Buyer’s Guide

CustoMac Mini 2011

CPU Intel Core i3-2105 Komplett-1050NOK
Motherboard Gigabyte GA-H67N-USB3-B3 Komplett-839NOK 360Buy-899CNY
RAM CORSAIR 8GB DDR3 Komplett-329NOK 360Buy-299CNY
Case + Power Supply APEX MI-008 Mini-ITX 360Buy-239CNY(金河田 炫豪-2061B)
Total Komplett-2218+NOK 360Buy-1437+CNY

CustoMac Budget Build

CPU Intel Core i3-2105 Komplett-1050NOK
Motherboard Gigabyte GA-Z68MA-D2H-B3 Komplett-949NOK 360Buy-799CNY(GA-Z68M-D2H)
RAM CORSAIR 8GB DDR3 Komplett-329NOK 360Buy-299CNY
Case Cooler Master 341 Komplett-445NOK(Cooler Master Elite 310) 360Buy-179CNY(Cooler Master 342)
Power Supply Corsair 430w Komplett-489NOK 360Buy-359CNY
Total Komplett-3262NOK 360Buy-1636+CNY

CustoMac Pro Builds #1

CPU Intel Core i5-2500K Komplett-1695NOK 360Buy-1599CNY
Motherboard Gigabyte GA-Z68X-UD3H-B3 Komplett-1090NOK 360Buy-1399CNY(GIGABYTE GA-Z68XP-UD3R)
Graphics Card AMD Radeon HD 6850 Komplett-1199NOK 360Buy-899CNY
Case Corsair Carbide Series 400R Komplett-945NOK 360Buy-599CNY
RAM 16GB Corsair 1600Mhz DDR3 Komplett-749NOK 360Buy-778CNY
Power Supply Corsair 650watt Komplett-1046NOK 360Buy-799CNY
Total Komplett-6724NOK 360Buy-6073CNY

CustoMac Pro Builds #2

CPU Intel Core i7-2600K Komplett-2299NOK 360Buy-2359CNY
Motherboard Gigabyte GA-Z68XP-UD3 Komplett-1049NOK 360Buy-1399CNY(GIGABYTE GA-Z68XP-UD3R)
Graphics Card AMD Radeon HD 6870 Komplett-1295NOK 360Buy-1299CNY
mSATA SSD 60GB OCZ Nocti Series SATA 3Gb/s 360Buy-899CNY
Case Corsair Carbide Series 400R Komplett-945NOK 360Buy-599CNY
RAM 16GB Corsair 1600Mhz DDR3 Komplett-749NOK 360Buy-778CNY
Power Supply Corsair 650watt Komplett-1046NOK 360Buy-799CNY
Total Komplett-7383+NOK 360Buy-8132CNY

Operating System

Mac OS X Lion Application Mac App Store(Norway) Mac App Store(China)
Mac OS X Lion USB Thumb Drive Apple.com(Norway) Apple.com(China)

Graphics Cards

NVIDIA GeForce 9400 GT
NVIDIA GeForce 9500 GT
NVIDIA GeForce 9600 GT
NVIDIA GeForce 9800 GT (NO HDMI)
NVIDIA GeForce GT 210 Komplett-279NOK 360Buy-249CNY(GA GV-N210SL-1GI)
NVIDIA GeForce GT 220 360Buy-249CNY(GA GT220 GV-N220OC-1GI)
NVIDIA GeForce GT 240
NVIDIA GeForce GTS 250 (NO HDMI)
NVIDIA GeForce GTX 260
NVIDIA GeForce GTX 275
NVIDIA GeForce GTX 285
NVIDIA GeForce GT 430 Komplett-490NOK 360Buy-419CNY
NVIDIA GeForce GTS 450 Komplett-749NOK 360Buy-599CNY
NVIDIA GeForce GTX 460 360Buy-939CNY
NVIDIA GeForce GTX 470
NVIDIA GeForce GTX 480
NVIDIA Quadro FX 4000 for Mac Komplett-7559NOK
NVIDIA Quadro FX 4800 for Mac Komplett-13549NOK
ATI Radeon HD 5570
ATI Radeon HD 5770 Komplett-1085NOK
ATI Radeon HD 5850 Komplett-1199NOK
ATI Radeon HD 5870
AMD Radeon HD 6670 Komplett-550NOK 360Buy-479CNY
AMD Radeon HD 6850 Komplett-1199NOK 360Buy-899CNY
AMD Radeon HD 6870 Komplett-1295NOK 360Buy-1299CNY

Motherboards

Gigabyte GA-Z68A-D3H-B3 ATX, VGA, DVI, HDMI, USB 3.0 360Buy-999CNY
Gigabyte GA-Z68M-D2H mATX, VGA, DVI, HDMI 360Buy-799CNY
Gigabyte GA-Z68MA-D2H-B3 mATX, VGA, DVI, HDMI, USB 3.0 Komplett-949NOK
Gigabyte GA-Z68MX-UD2H-B3 mATX, VGA, DVI, HDMI, DP, USB 3.0, eSATA Komplett-1149NOK
Gigabyte GA-Z68P-DS3 ATX, HDMI, eSATA 360Buy-849CNY
Gigabyte GA-Z68X-UD3H-B3 ATX,VGA, DVI, HDMI, DP, USB 3.0 Komplett-1090NOK
Gigabyte GA-Z68X-UD7-B3 ATX, No Onboard Video, USB 3.0, eSATA, 2x PCIe x16
Gigabyte GA-Z68XP-UD3 ATX, HDMI, mSATA, USB 3.0, FireWire Komplett-1049NOK 360Buy-1399CNY(GA-Z68XP-UD3R)
Gigabyte GA-Z68XP-UD3-iSSD ATX, HDMI, mSATA + SSD, USB 3.0, FireWire 360Buy-1899CNY
Gigabyte GA-Z68XP-UD4 ATX, HDMI, USB 3.0, eSATA, FireWire Komplett-1390NOK
Gigabyte GA-Z68XP-UD5 ATX, HDMI USB 3.0, eSATA, FireWire Komplett-2090NOK

CPUs

Intel Core i3-2105 3.1Ghz 2 Cores / 4 Threads Komplett-1050NOK
Intel Core i3-2125 3.3Ghz 2 Cores / 4 Threads
Intel Core i5-2405S 2.5Ghz 4 Cores / 4 Threads, Turbo
Intel Core i5-2500K 3.3Ghz 4 Cores / 4 Threads, Turbo Unlocked for Overclocking Komplett-1695NOK 360Buy-1599CNY
Intel Core i7-2600K 3.4Ghz 4 Cores / 8 Threads, Turbo Unlocked for Overclocking Komplett-2299NOK 360Buy-2359CNY
Intel Core i7-2700K 3.5Ghz 4 Cores / 8 Threads, Turbo Unlocked for Overclocking Komplett-2595NOK

Drives

500GB Hitachi Deskstar SATA 3Gb/s 360Buy-659CNY
500GB Seagate Barracuda SATA 6Gb/s 360Buy-589CNY
1TB Seagate Barracuda SATA 6Gb/s Komplett-1399NOK 360Buy-829CNY
60GB Corsair Force Series 3 SATA 6Gb/s Komplett-825NOK 360Buy-799CNY
120GB Corsair Force Series 3 SATA 6Gb/s Komplett-1295NOK 360Buy-1399CNY
240GB Corsair Force Series 3 SATA 6Gb/s Komplett-2695NOK
120GB OCZ Agility 3 SATA 6Gb/s 360Buy-1199CNY
240GB OCZ Agility 3 SATA 6Gb/s 360Buy-3199CNY
8GB USB Flash Drive Komplett-75NOK 360Buy-69CNY
Optical Drive Sony Optiarc Komplett-219NOK 360Buy-138CNY

Accessories

Apple Wired Keyboard Komplett-429NOK 360Buy-378CNY
Apple Wireless Keyboard Komplett-590NOK 360Buy-498CNY
Apple Magic Trackpad Komplett-590NOK 360Buy-498CNY
Apple Magic Mouse Komplett-590NOK 360Buy-498CNY
Jabra A320S USB Bluetooth Adapter 360Buy-199CNY(Jabra A335W)
Mini-PCIe to PCI-e Adapter (For Native Wifi Card) Broadcom Mini-PCIe Card Not Included Taobao-39CNY Atheros AR9280加转接卡套餐-189CNY

Create your own train monitor for Norway!

Jernbaneverket provided this solution for us! The announcement is here, Monitorvisning i nettleseren. The registration form is here, you have option for English in top-right corner.

After registration, you could create your own monitor, please choose a station, Departure or Arrival, and how many rows. After click “Save”, try to “Show” it, then you got the url for this monitor, for example, my “Oslo S-Departure” monitor is http://rtd.jbv.no/rt/display/faf2d9be57ae94ce548ebfd61e26f61a45e487e3.

For Mac users, launch Safari, open the above url, adjust the display windows, then click “File”->”Open in Dashboard”, select the area which you want to show in the Dashboard, then click “Add” button in top-right corner of Safari.

告别MAMP

大学时代,玩过一阵子Apache+PHP+MySQL,一般是在Linux上,也用过一次FreeBSD。

后来自己的服务器也就一直放在Mac上,之前偷懒,就在网上下载了MAMP凑合着用了。

这次升级到Lion,很不幸,MAMP中的Apache不能起来了,我也没有查看日志。网上搜索了一下,Lion中已经自带Apache2和PHP 5.3了,”System Preferences”->”Sharing”->”Web Sharing”就是Apache2的启动选项,配置文件在/etc/apache2/httpd.conf,把下面这行取消注释就可以启用PHP了:

Lion里已经不自带MySQL了,估计是因为Oracle的原因,所以我根据这篇文章安装了MySQL和phpMyAdmin。并且还安装了MySQLStartItem.pkg,这样在”System Preferences”->”MySQL”中就可以控制MySQL了。

之后我就把原来的MySQL数据库覆盖了过来,位置在/usr/local/mysql/data。

之后把WordPress目录复制到相应位置,修改/etc/apache2/extra/httpd-vhosts.conf,为了让WordPress能正常工作,注意添加Directory以及如下一行:

对于PHP,还有一项:

修改其中一行:

然后就基本都搞定了。

目前还差的就是升级WordPress和WordPress MU 2.x到最新的3.2.1了。

Clang Static Analyzer with Qt

1. OS: Snow Leopard 64bit

2. Qt: 4.8

cd ~/qt
git clone git://gitorious.org/qt/qt.git work
cd work
git checkout -b origin/4.8 4.8
cp -rf mkspecs/unsupported/macx-clang mkspecs/unsupported/macx-checker

Note: a patch for mkspecs/unsupported/macx-checker/qmake.conf: http://pastebin.com/u7mnkhue

3. Clang Static Analyzer: checker-256

cd ~/dev/packages
wget http://clang-analyzer.llvm.org/checker/checker-256.tar.bz2
tar zxvf checker-256.tar.bz2
cd checker-256
rm bin/clang
rm bin/clang++
cd /usr/local/bin
ln -s /Users/liangqi/dev/packages/checker-256/bin/clang-3.0 clang
ln -s /Users/liangqi/dev/packages/checker-256/bin/clang-3.0 clang++

4. Build

cd ~/build
mkdir qt-48-clang
cd qt-48-clang
export PATH=/usr/local/bin:/Users/liangqi/dev/packages/checker-256:$PATH
/Users/liangqi/qt/work/configure -platform unsupported/macx-checker -nokia-developer -no-webkit -no-qt3support -no-declarative -no-xmlpatterns -no-script -no-scripttools -no-phonon -no-multimedia -nomake tools -nomake demos -nomake examples -fast -verbose -no-framework
scan-build make

5. Output

In the end of the output, you will find a command like “scan-build: Run ‘scan-view /var/folders/QB/QBTpJfK+HfqtpmxTOms2nU+++TI/-Tmp-/scan-build-2011-07-20-3’ to examine bug reports.”, do it!

NOTE: the above way doesn’t work with checker-257!

How to run autotests in Qt for Symbian on Linux and Mac?

Here is the official article for it, Installing Qt for the Symbian platform using Linux (experimental).

The basic idea is same on Linux and Mac OS X.

1. For phone, you need to install Application TRK

S60 5.0/Symbian^1 – s60_5_0_app_trk_3_2_7.sisx
Symbian^3 – s60_tb_9_2_app_trk_3_2_8.sisx

2. Use usb cable to connect your phone and computer, Linux or Mac OS X. Remember to set to “PC Suite” mode or “Nokia Ovi Suite” mode on your phone. Then launch your Application TRK via “RnD Tools”->”TRK”.

3. About the device name for your phone on computer

For Linux, see more details in Configuring the USB Serial Driver on the Linux System. After that, you will find /dev/ttyUSBx and maybe another /dev/ttyUSBy, better to “sudo chmod 777 /dev/ttyUSB*” for them(some Linux distribution do not give the access to normal users for it, like Ubuntu).

For Mac, you could find sth like /dev/cu.usbmodemfaXx and /dev/cu.usbmodemfaXy.

4. To build runonphone, you need to have libusb installed.

For Linux, just follow that documentation, “sudo apt-get install libusb-dev” should be ok for Debian/Ubuntu.

For Mac, “sudo brew install libusb-compat” works for me.

5. Build runonphone, use the qmake in your desktop Qt.

cd ~/qt/qt/tools/runonphone
/usr/bin/qmake
make

6. Build and run your autotests, please check previous blog for the EPOCROOT and PATH environments settings.

cd qt/qt/tests/auto/qdatetime
~/build/s3_gcce/bin/qmake -spec ~/qt/qt/mkspecs/symbian-gcce -o Makefile ~/qt/qt/tests/auto/qdatetime/qdatetime.pro
make sis
~/qt/qt/tools/runonphone/runonphone -p /dev/cu.usbmodemfa44 –sis ~/qt/qt/tests/auto/qdatetime/qdatetime.sis qdatetime.exe

NOTE: Here the /dev/cu.usbmodemfa44 is the device on Mac for me. And for Linux, the device is sth like /dev/ttyUSB1.

Enjoy it!