Archive for the 'Programming' Category
Parallel build in Visual Studio

In Visual Studio IDE, we can easily get benefits from the power of multi-cores CPU. Here is the instruction:

1. In Configuration Properties->C/C++ -> Command Line,
    add the following option:
    /MP[x]
    x is the number of cores/cpus in your system.
    For example, if you have two quad-core CPUs, you can simply put /MP8 here.
2. Turn off “Minimal Rebuild” in C/C++ -> Code Generation.

Now, when you build the solution, Visual Studio will utilize as much as CPU power to build your code!
cpuusage

auto bi calculator loan weekly
bdsm machine fuck
wet n wild girls
little boys erection
little red riding hood
bad ass gothic layouts for myspace
traci lords porn
naked supermodels
pussy fucked by machines
cute blond twink
gay muscle hunks
upskirt fucking
bi swingers in africa
hentai fucked by monsters
blonde swallow cum
free sexcams no e-mail
tube porn
hot old red heads
jizz on girlfriend
young lesbo orgies
sexy girlfriend
cartoon vagina
hairless vaginas
best male orgasms
upskirt hidden cam
naked muscle men
zyban advantage smoking pill prescription quit
fetish corset
ffm finger
sex with a dog
big black whores
skinny chicks free
interracial bukkake
cartoon vagina
marc jacobs nylon bag
wife and lingerie contest
amy winehouse nude
chicago breast enlargement surgery
strip video
naked young men
redhead puss
slut of the day
play sex games
mens leather boots
office suck
spanking twinks
young male cocksuckers
mom daughter porn
women ass
ebony models in thongs
swinger parties in houston
global underground deep dish
sexy photos
gay male celebrities nude
paparazzi nude celeb photos
jetsons nude
free sexcam florida
naked army studs
large objects in pussy
free oriental sex
free blow job videos
Mom Got Ass CD-2
brunette ass hard
young tan stud
asian oriental hardcore lesbian giant gangbang
biker party girls
Cum On My Hairy Pussy-4 CD-1
girl shitting
olsen twin nude
big ass porn
bridal shower menu
pics of thong contests
brown eyed girl
naked women in public
msn photo swap messenger
Milf Lessons-12 CD-2
gay men naked
big muscular black studs fucking
acer usb tablet boot
ewa bien lingerie
under age girls in thongs
fuck me in the ass
young sucking
large busty women
shemale group
girls swimsuits
totally free live sexcams
free incest movies
clean and dirty jokes
women masturbation clips
gothic myspace birthday wishes
web sexcam
sexcam fun
little redhead girls
gang bang sluts
tattoo ideas for girls
female military tattoo
asian girls in thongs
hairless twink
gothic lolita bible extra scans
used car grants pass
ass to mouth girls
shemale seduction
alternative sex
nipple flash
dirty talk cum
sesame street orgy
shaved teen
accutane centre military and veterans law legal education
Big Dicks Little Asians-2 CD-1
bree olsen gang bang
private military contractors
gay ass fuck amateur free
teen smoking statistics
nikki cox nude
myfriends hot mom
free handjob in nylon
bbw nurse brunette
male erotic massage
detroit 60 series smoking
two girls caught on hidden camera
skinny puppy pics
babes with big boobs and boots
porn movie galleries
transvestites stockings
sexy horny moms
free xxx hardcore
hawaiian porn
celeb fuck
health insurance international student travel cover
redhead fucks
the simpsons sex
mom suck
Twisted Vision-5 CD-2
stocking porn galleries
gothic adult webcam
horny hitchhikers
masturbation fun
free lesbian sex movies
korean shemale
free swinger sites
moms fuking son
nipple stretch
spanish fuck
teen latina ass
live cams in florida
gorgeous male models
tight tshirt
oriental carpet carpet pad
throat popping swallow
do wealthy people join the military
18 gay college studs
hot teen thong
boss forcing employees sex
watch masterbation
enormous busty anime
students fuck teachers
barnyard sexcom
give a female an orgasm
moms boy
teen dog
giant animals in cartoons
gay gag cum
teenage sex orgy
bose wave radio sexcam
international student travel medical insurance
extreme oriental bondage
fuckinf machines
hawaiian porn
amatuer bbw
coeds fucking movie galleries
ebony oral sex
paypal sexcams
free xxx video
paypal sexcams
job bank where do you live
dirty doctor
cock gag mature
24/7 ebony sex
women masturbating alone
asian sexcam philippines
nudist chat masturbation
free female masturbation videos
brunette blow
shaving women
barn swallow nest
Reform School Girls CD-1
pussy fucked by machines
big hairy dicks
granny grandson fucking
mom horny
medical bondage nurses
nylon sleepwear
mouth torture
play sex games
hot petite jizz
nude marykate and ashley olsen
dog houses for large dogs
red head preteens
celeb fuck
big boob orientals
cunt finder
milk nipple
mexican stop smoking no prescription needed
asian sucking cock
korean schoolgirl
penis large
crossdressing chat
do wealthy people join the military
crossdressing sites
skinny brunette girls
girls next door stockings
tamil sex chat
college male stud galleries
dirty sex jokes
japanese schoolgirl panties
bree olsen video stripping
naked vaginas
gay hunks having sex
largest male penis

Mac常用軟體/文章整理

最近剛好在重建Mac下的工作環境,順手整裡了一些常用的工具,以及某些問題的處理方式…

Application:
1.NuFile:按右鍵後可New出不同的檔案

http://growlichat.com/NuFile.php

2.AppTrap:可以徹底移除軟體的好工具

http://konstochvanligasaker.se/apptrap/

3.Perian:Video/Audio decoder pack

http://perian.org/

4.Fan Control:控制溫度與風扇速度

http://www.macupdate.com/info.php/id/23137

5.TranslateIt:Mac下首選的翻譯軟體

http://www.gettranslateit.com/

6.OpenVanilla:香草/酷音輸入法

http://openvanilla.sourceforge.net/

7.LiquidCD:簡易燒錄軟體

http://www.maconnect.ch/index.php?page=liquidcd〈=en

8.Flip4Mac:Mac下mediaplayer的網頁plug-in,WMV decoder

http://www.flip4mac.com/

9. Magic Mail Folder: Gmail方便的工具

http://mmfolder.blogspot.com/

10. SVN Client

http://www.syncrosvnclient.com/

11. Maperture

http://www.ubermind.com/products/maperture.php

12. Bookdog

http://www.sheepsystems.com/products/bookdog/

Widget:
1.iStat pro:系統狀況一目了然

http://www.apple.com/downloads/dashboard/status/istatpro.html

2.PEMDAS:可取代內建計算機

http://www.apple.com/downloads/dashboard/calculate_convert/pemdas.html

文章:
1.Safari下中文字型粗細不同的問題:

http://www.mobile01.com/topicdetail.php?f=177&t=145141&p=1

2.Convert Outlook mail to Apple Mail

http://guides.macrumors.com/

Moving_Email_from_PC_Outlook_to_Apple_Mail

也是一篇開箱文…MacBook Pro!

先前訂的Macbook pro終於到了,7/6下訂到8/9拿到貨,整整等了一個月.(很想買的東西好像都不太容易馬上拿到)~ 攝影技術不好,以下就加減看圖聽故事吧~

包裝紙盒

電腦主機,變壓器,螢幕轉接線,Apple remote…

Macbook pro左側面特寫,後面是Mac mini和Nike+

前方面板的紅外接收器及主機蓋開關

前方的吸入式光碟機

右側面特寫:USB2.0,Firewire 400,800,Gigabit網路孔及dual-link DVI輸出

主機背面,乾淨俐落,中間的小白按鈕按下之後,旁邊的LED燈會顯示蓄電量.

主機全貌

鍵盤佈置

MacBook Pro 這幾個字還真值錢阿

螢幕頂端的iSight

再來一張左側面特寫:MagSafe,USB2.0,Audio光纖輸入/輸出,ExpressCard/34 slot.

MagSafe充電時顯示橘色的燈號

16:10, 1440×900的”非”鏡面LED背光螢幕,螢幕亮度也會隨著環境光源做適當的明亮調整

除了LED背光,鍵盤也有背光的元件,當周圍光源昏暗時,會適時調亮keyboard光源!

心得:這台mbp教育價大概需要80張小朋友才扛的回來,如果在搭配ipod方案可在少個6千;Santa Rosa機種,15.4 inch, 2.4 Core 2 Duo, 160G SATA, Geforce 8600M GT, 2GB (up to 4GB) ram,重量約2.4kg;以這樣的規格及價格來看,這次Apple算是稍微有良心,同等級的台系主機約6萬,日系則7~9萬不等.由於接下來的工作會與3D graphics/visualization相關,這樣的電腦應該夠當我的隨身機一陣子了.

VisualStudio.NET下新增Qt專案…

要利用Visual Studio.NET來編輯Qt的專案,通常有兩種方式:

1. Qt Visual Studio Integration

2. 在VS.NET中手動設定Qt專案

方法1只要裝qt-vs-integration套件,寫Qt的程式就像寫其他視窗程式一樣.不過Qt的Open Source Edition並沒有提供此套件.

我傾向利用方法2,首先,它不過是對VS.NET做些簡單設定,自己處理反而能對Qt的編譯流程有更清楚的認識.更能自由的安排Qt專案目錄,以及編譯時的intput/output,這對於跨開發平台,或是專案後續的維護都相當重要.

步驟如下:

1. VS.NET中新增一個專案,選擇Win32 Console Application即可.在Application Setting對話窗中,直接點選Empty project.

p1-1.png

2. 接著將你的source code複製到VS.NET為你造出來的專案目錄中:

p3.png

3. 並利用Solution Explorer將source code加到專案中.在範例中,三個.cpp是implementation files,兩個.h是header files,CGLPWndUI.ui是利用Qt Designer編輯的資源檔.

p4.PNG

4. 接著要對這個solution作一些細部設定.以下都是Debug version的設定,Release version的設定也類似,但有一些define或link的lib版本須修改;首先在Solution Explorer中,右鍵點選專案的名稱,選擇Properties.進入solution的屬性設定.

4-a. 在C/C++,General底下的Additional Include Directories中,加入此專案將要include的目錄路徑,一般來說會需要Qt目錄下的”\include”,”\include\QtCore”,”\include\QtGui”,其他就得視需求自行增加,例如此範例中,我有用到有關QtOpenGL的相關元件,就得再加入”\include\QtOpenGL”.

p5.png

4-b. 再來切換到C/C++下的Preprocessor,在”Preprocessor Definitions”中增加Qt相關定義,與include的lib類似,在此我加了三個Qt的關鍵字:

p7.png

4-c.到[Linker-General]下的Additional Library Directories中填入Qt library的目錄,例如:

$(QTDIR)\lib

4-d.到[Linker-Input]下的Additional Directories中填入此專案需要引用的library的目錄,例如:

qtmain(d).lib, QtCore(d)4.lib, QtGui(d)4.lib, QtOpenGL(d)4.lib, opengl32.lib, glu32.lib 後面加上d表示for debug verson.

p9.png

4-e.到[Linker-System]下的SubSystem中,選擇Windows作為SubSystem.

5. 回到Solution Explorer,分別針對檔案中有Q_OBJECT敘述的.h檔以及.ui檔,做個別的編譯動作,按右鍵選擇Properties:

p11.PNG

5-a.先處理.h檔案,到[Custom Build Step-General]中,做該檔案的編譯設定:

p12-1.png

Command Line: $(QTDIR)\bin\moc.exe -DWIN32 -D_DEBUG -D_CONSOLE -DQT_CORE_LIB -DQT_GUI_LIB -DQT_OPENGL_LIB -I”.\GeneratedFiles” -I”.” -I”$(QTDIR)\include” -I”$(QTDIR)\include\QtCore” -I”$(QTDIR)\include\QtGui” -I”$(QTDIR)\include\QtOpenGL” “.\CGLPWnd.h” -o “.\GeneratedFiles\Debug\moc_CGLPWnd.cpp”

這邊是利用moc.exe來編譯Qt程式碼(因為Qt程式碼並非標準C/C++),上面的敘述中,moc.exe會參考CGLPWnd.h,產生moc_CGLPWnd.cpp檔案.

Description: 編譯時,VS.NET的output視窗將顯示的訊息.

Outputs:此步驟將產生哪個檔案, “.\GeneratedFiles\Debug\moc_CGLPWnd.cpp”意味著將產生moc_CGLPWnd.cpp,並存放到GeneratedFiles\Debug目錄下.

Additional Dependencies: 設定所有與此編譯動作相關的資源,以CGLPWnd.h檔案來說,我填入: $(QTDIR)\bin\moc.exe;.\CGLPWnd.h

所有與Qt Q_OBJECT相關的header file都需要經過上面的設定,以便產生適當的moc_xxx.cpp檔!

5-b.接著處理.ui資源檔,方法也差不多,下面就自己看了…

p13.png

所有由Qt Designer相關的resource file都需要經過上面的設定,以便產生適當的ui_xxx.h檔!

6. 接下來,利用Solution Explorer對每個.h與.ui檔作個別的Compile動作!

p14.PNG

7. 一切都沒錯的話,照理說專案目錄下應該會多出幾個檔案(moc_xxx.cpp和ui_xxx.h之類),最後一步就是再將這些檔案add到VS.NET的專案裡:

p15.PNG

這樣一來,我們就可以利用VS.NET來撰寫Qt程式,也可利用VS.NET強大方便的debug功能.

往後如有新的Qt原始碼,就重複利用步驟5,6,7來加到VS.NET專案裡.

Qt與Xcode的整合

Qt 4.0以後,qmake就支援自動產生Xcode格式的project設定檔.這表示Mac上的開發者能利用Xcode來進行程式的開發及除錯.

要產生Xcode的project檔,首先需確定目錄下已經產生(ex.qmake -project)正確的Qt project file (ex. GLPlayground.pro),接著輸入:
qmake -spec macx-xcode GLPlayground.pro

目錄下便產生Xcode的project:GLPlayground.xcodeproj,以及plist檔
fl.png

點兩下,便能繼續在Xcode下享受寫程式的樂趣…
xcode.png

如何在console下編譯Qt程式?

在console模式下編譯程式,通常需要撰寫Makefile,編譯器會針對Makefile裡面的指令來對原始碼做編譯,連結等動作.

但對Qt來說,它屬於相容於C/C++語法的meta language,因此所撰寫的程式碼並不是直接交由C/C++編譯器來編譯,而是先透過Meta Object Compiler (MOC)的轉換,將Qt程式碼轉換成真正的C/C++ code(這個過程Qt稱作moc-ing),然後再交由C/C++編譯器來編譯.

在console下要編譯Qt程式,最簡單的方法就是透過Qt的qmake來產生適當的Qt project file,再接著產生Makefile.

首先假設目錄GLPlayground下有這幾個檔案:
filelist.png

利用Terminal進入該目錄,做以下三步驟:
1. qmake -project –> 產生GLPlayground.pro (Qt project file)
2. qmake –> 透過GLPlayground.pro產生Makefile
3. make –> 開始編譯:moc-ing Qt source code and UI file, compile C++ source and link object file, build the executable file.
terminal.png

make過後如果沒錯誤,應該會出現執行檔~

ps:這時候檢視該目錄,除了.o檔以外(object files),還可發現多了幾個新檔案:
moc_CGLPWnd.cpp –> 由CGLPWnd.h/cpp moc-ing而來
moc_CGLWidget.cpp –> 由CGLWidget.h/cpp moc-ing而來
ui_CGLPWndUI.h –> 由CGLPWndUI.ui產生而來
當程式碼中有Qt signal/slot/emit等語法出現(class宣告中有加上Q_OBJECT)時,MOC會對這些程式碼做轉換.換句話說,程式碼中如果沒有這些特殊的操作,而只是單純的使用Qt中的元件,則MOC並不會處理該檔.