LPIC 101/102考試可以選中文版
05/18/2009, 23:34 - LPI
看了一下LPI的認證LPIC-101/102可以選考中文版本,這是一件好事,但是看了LPI台灣的網頁,就令人搖頭了。
LPIC-1 Exam 101詳細目標網頁中,出現了“會激活或者禁止集成外設"、"能正確的設定由BIOS管理的 IRQ,DMA和I/O地址以及錯誤句柄(error handling)."、“會設定串口的速率 “。LPIC-102的“從源代碼定制“、"引導管理器"。

如果是考用這種中文的試題,大部份人應該會考得比英文糟吧,至少我就一定會考得不好!要考的人,若是對這種中文不是很強的人,還是考英文吧,不然還得學這種強翻的科技中文!再說“JoyStick" 應該比“好玩的棒子“或"快樂的棍“、“喜樂莖“、"樂棒"要容易說、記、寫、讀,而且沒有誤會吧,雖然我有時也會輸入成"Joe's Dick"。

LPI台灣的網頁,粗看好像是由台灣人負責,但看到負責人的頭銜頭是“大中華..."就可以了解了,台灣只是順便而已。這整個網頁事實上是簡體中文轉成繁體中文而已,字詞全部照原來的簡體。這樣子的網頁及內容是不及格的。當然我沒看過中文試題內容,不過已經可想而知了。

還有說到要加考SQL,我是不知道LPI的真正用意,是要測試對Linux使用的熟悉度,還是為要找工作的人多一份證件而已。這種什麼都考,通過後可能還是什麼都不會。而且現在Linux上使用最多的SQL Server MySQL因Sun Microsystem和Oracle合併,已經增加了不少變數,有可能變成 None Free 或 Not Open Source,這樣還會有多少人用呢?而且我認為考Linux認證,就是只考Linux的部份就好,SQL這種東西,
不是人人都需要,我用了Linux/BSD十多年,也還是很少用到SQL,反而是如何Compile Open Source的程式比較常用,而且SQL這種東西,也不是一個簡單考試就可以考出來的,還是給別的專門SQL的認證比較好吧。


發表回應 發表回應 ( 703預覽 )   |  [ 0 引用 ]   |  permalink   |   ( 3 / 378 )

挨了兩拳的 WinTel
05/15/2009, 09:50 - 想到的
最近的 Microsoft 和 Intel 挨了歐盟左右連續兩拳。那最近微軟的軟體和使用 Intel chip 的產品不知道會不會漲價呢,用台灣官員的說法,成本提高了,而法定盈餘不足,所以漲價是市埸機制下一定要作的!
發表回應 發表回應 ( 596預覽 )   |  [ 0 引用 ]   |  permalink   |   ( 2.9 / 246 )

綠卡...綠的好!
05/15/2009, 08:51 - 原來如此
又一位政府駐美官員在工作之餘,利用空閒去申請美國綠卡,而且通過了,被發現之後才又說放棄。還大聲是說美國政府用計陷他於不義,說這句話時,是真的拿我們當豬騙嗎?你不去排隊、簽名、面談、申請辦綠卡,誰可以自動給你一張呢?為何就沒有寄一張給我,來陷害一下呢?綠卡還真的是政府官員的最愛啊。在朝的、在位的辦一張,進出美國快又爽,下台,退休搬到美國,將台灣胡搞瞎搞,搞爛了,干他屁事啊。高級的人的有張綠卡,才配得上身份啊,不過最好有本美國護照更棒,不然加拿大的也不錯,至少的也要有澳洲或紐西蘭的,才是真正高級人。從退位的總統夫人(去位後終生住在美國)及其家人,現任總統、部長、民意代表、到公務人員,小歌星、大演員...族繁不及備載,人手一張綠卡、一本護照,還敢大聲說“愛台灣“。連退休警察、將官退休後,都可直接搬到美國,不然也至少會到美國生個美國小孩。每個公務單位都有人辦,美國的綠卡還真是隨便發,阿貓阿狗都可以辦!這麼多人在辦,不知道在公務機關是否有定期辦理移民講習呢?所以說原來綠色真的是他們的最愛啊!我到過幾次美國工作,發現去時機位一位難求,班班客滿,但回程時,空位多到可以躺著睡還有剩,人都到那𥚃去了呢?原來是上次胡市長說出真話,"回家了啊"!

517 大家不要忘了,為了他們這些高級的人,這些年來的努力,"幫他們加油打氣"。
發表回應 發表回應 ( 541預覽 )   |  [ 0 引用 ]   |  permalink   |   ( 3 / 381 )

Mac OS X 10.5.7 upgrade
05/13/2009, 11:24 - 今天
已更新,有圖為證!建議在更新之前先用yasuCocktail先整理一下,重開機之後再作更新,比較保險!


順便 Safari 也換了 4.0 Public Beta了。
發表回應 發表回應 ( 552預覽 )   |  [ 0 引用 ]   |  permalink   |   ( 3 / 532 )

沙小
05/04/2009, 12:04 - 有的沒的
今天和同事抬槓,說了一句"沙小",
結果被回了一句
"殺很大"

... 真是無言!
1 回應 1 回應 ( 851預覽 )   |  [ 0 引用 ]   |  permalink   |   ( 3.2 / 380 )

OMNeT++ 加上 inet-framework
04/30/2009, 11:41 - Network
使用 OMNeT++ 是一個網路的 simulator 而 inet 是外加的 framework. inet-framework 提供了 OMNeT++ Ethernet, ip,TCP,UDP,MPLS 等功能. 但是若照 inet 的 INSTALL 方式,則要使用 inet-framework 必需要在 inet-framework 的目錄下,或者是將 inet-framework 整個 copy ,這樣很不方便.

經過測試之後發現可以先 compile 好 inet-fraework 再到 out/gcc-debug 目錄下,將 libinet.so copy 到 omnetpp 安裝的目錄下的 lib 中. 這樣就可以了.

再來每次要用到 inet-framework 時先在 omnetpp.ini 中指定 NEDPATH 至 inet 就可以了.

omnetpp.ini
[General]
ned-path= /usr/local/omnetpp/inet/src;.

在產生 Makefile 時要指定 library
opp_makemake -f -linet

好像還不夠,因為 C++ 用的 h 檔還是要處找,
所以在 inet 下建立一個 include 目錄
用 find . -name *.h -exec cp {} include \;
在產生 Makefile 時再加上指定 include 的目錄

opp_makemake -f -lint -I/usr/local/omnetpp/inet/include

這樣就 OK 了!
但是這個 library 的size 有 41471914 bytes
strip 之後變成 7502240 bytes
也許有別的方法吧,不過我沒有用 OMNeT++ 的 IDE 所以...

發表回應 發表回應 ( 1034預覽 )   |  [ 0 引用 ]   |  permalink   |   ( 2.9 / 344 )

某家 DVR 破解
04/16/2009, 22:25 - Open Source
因朋友的硬體需求,需要將原來的監視系統換至不同的機器,但原來的 DVR 系統是放在 Flash 的 IDE 硬碟中,不是很方便,所以就花了一點時間,將系統直接裝到硬碟中。

先用有 grub 的 Live CD 開機
準備好新的硬碟
fdisk /dev/hdb
建兩個 partition,因為 Flash IDE HDD 只有 64MB,而第一個 partition 只是用來放系統設定,所不用太大,而第二個就是 64MB 減去第一個 partition 的大小就可以了。
mke2fs /dev/hdv1
mke2fs /dev/hdb2
mkdir /mnt/hdb1
mkdir /mnt/hdb2

mount /dev/hdb1 /mnt/hdb1
mount /dev/hdb2 /mnt/hdb2

把 Flash IDE disk mount 起來,準備 copy
mount /dev/hda1 /mnt/hda1
mount /dev/hda2 /mnt/hda2

cp -ifR /mnt/hda1/* /mnt/hdb1/.
cp -ifR /mnt/hdb2/* /mnt/hdb2/.

用 grub 建立 boot
grub
root (hd1,1)
setup (hd1)

修改 Linux 開機 root directory 的設定
/mnt/hdb2/etc/fstab
/mnt/hdb/boot/grub/menu.lst

將 Live CD 移除,重開機。

就可以了。
下次再試試改成光碟開機。

2 回應 2 回應 ( 908預覽 )   |  [ 0 引用 ]   |  permalink   |   ( 3 / 370 )

GNUstep on MS-Windows test
04/01/2009, 10:58 - Open Source
測試了一下 GNUstep 在 Windows 上的可行性,可以用,不過因為 DLL 等問題,要作到 portable 還很不方便。

選用 MinGW32 作為基礎,再加裝需要的程式上去。

Install GNUstep in MS-Windows with MinGW

This required a long time in Windows, so make a cup of tea or coffee or some beer as well.

Start: install MinGW binary from http://mingw.sf.net
install MinGW
install MSYS
install MSYSDTS
unarchive MSYSCORE
open MSYS shell

export CFLAGS="-I/usr/include -L/usr/lib"
export CXXFLAGS=$CFLAGS
export CPPFLAGS=$CFLAGS

Install required library
install ffcall
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-threads --enable-shared --enable-ipv6 --disable-nls --disable-debug --with-gnu-ld
make
make install

install libffi
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-threads --enable-shared --enable-ipv6 --disable-nls --disable-debug --with-gnu-ld
make
make install

install libiconv-1.9.2
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-threads --enable-shared --enable-ipv6 --disable-nls --disable-debug --with-gnu-ld --enable-static
make
make install


install zlib
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
make
make install

install libxml2
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-threads --enable-shared --enable-ipv6 --disable-nls --disable-debug --with-gnu-ld --enable-static --with-zlib=/usr
make
make install

install libxslt
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-threads --enable-shared --enable-ipv6 --disable-nls --disable-debug --with-gnu-ld --enable-static
make
make install

install gettext-0.17
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-threads --enable-shared --enable-static --enable-ipv6 --disable-nls --disable-debug --with-gnu-ld --enable-cxx --enable-threads=win32 --with-libiconv-prefix=/usr
make

After show the gettext-tools has error
cd gettext-0.17
cd gettext-runtime
make install
This step is only install the gettext runtime library include libintl, and the gettext-tools has "can not found iconv.h" in "gnulib-lib/libxml/encoding.h", so...
cd gettext-tools
cp /usr/include/iconv.h .

make
cd ..
make

install jpeg-6b
./configure --prefix=/usr --enable-shared --enable-static
make
make install

install tiff
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-threads --enable-shared --enable-ipv6 --disable-nls --enable-static --disable-debug --with-gnu-ld --disable-jpeg
make
make install

install libpng-1.2.35
vi configure
search a line
/ac_cv_lib_z_zlibVersion=no
change no to yes
ac_cv_lib_z_zlibVersion=yes
./configure --prefix=/usr --enable-shared --enable-static

vi Makefile
change
LIBS = -lz
to
LIBS = -L/usr/lib -lz
change
CFLAGS = -g -O2
to
CFLAGS = -g -O2 -I/usr/include

make
make install

install sqlite
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-threads --enale-shared --enable-static --disable-debug --disable-nls --with-gnu-ld
make
make install

install wxWidgets
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-threads --enale-shared --enable-static --disable-debug --disable-nls --with-gnu-ld --enable-gui -enable-monolithic --enable-plugins --enable-objc_uniquifying --enable-compat26 --enable-intl --with-msw --enable-unicode --enable-offical_build
make
make install

install gdb-6.8
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-threads --enale-shared --enable-static --disable-debug --disable-nls --with-gnu-ld --enable-obj-gc
make
make install


Download GNUstep source from http://www.gnustep.org
install gnustep-make
./configure --prefix=/usr/GNUstep --sysconfdir=/etc --localstatedir=/var --enable-threads --enable-shared --enable-ipv6 --disable-nls --disable-debug --with-gnu-ld

make
make install

vi /etc/profile
add under lines to file /etc/profile
export GNUSTEP_MAKEFILES=/usr/GNUstep/System/Library/Makefiles
export PATH=$PATH:/usr/GNUstep/System/Tools:/usr/GNUstep/Local/Tools:/usr/GNUstep/bin
export CFLAGS="-I/usr/include -I/usr/GNUstep/System/Library/Headers -I/usr/GNUstep/Local/Library/Headers -L/lib -L/usr/lib -L/usr/local/lib -L/usr/GNUstep/System/Library/Libraries -L/usr/GNUstep/Local/Library/Libraries"

source /etc/profile

chmod 755 /usr/GNUstep/System/Library/Makefiles/GNUstep.sh
/usr/GNUstep/System/Library/Makefiles/GNUstep.sh

install gnustep-objc
./configure --prefix=/usr/GNUstep --sysconfdir=/etc --localstatedir=/var --enable-threads --enable-shared --enable-static --enable-ipv6 --disable-nls --disable-debug --with-gnu-ld
make
make install

check /etc/GNUstep/GNUstep.conf

# This is the GNUstep configuration file.

# Any line starting with a '#' is a comment.
# Empty lines are ignored.
# Every other line in this file must be of the form
# XXX=YYY
# where there should be no spaces around the '=' (this is because we
# include this file in shell scripts and makefiles, and sh syntax
# requires no spaces around the '=').
#
# Standard sh quotes can be used in YYY but only at runtime; they can
# not be used while building.

# GNUstep can use up to 4 domains at the same time. They are System,
# Local, Network and User. You can install your programs / resources
# in any of these domains. This file mostly deals with configuring
# how the domains map to your filesystem.

# IMPORTANT: Don't delete lines from this file unless you want
# the values hardcoded in the packages to be used. If you want
# to suppress the network domain, set all its paths to be the same
# as the system domain. If you want to suppress the local domain,
# set all its paths to be the same as the network domain. If you
# want to suppress the user domain, set its paths to be the same
# as the local domain. You can not suppress the system domain.

# The paths should not include a '/' at the end.

# These GNUSTEP_*_ROOT variables are obsolete, and will be removed.
GNUSTEP_SYSTEM_ROOT=/usr/GNUstep/System
GNUSTEP_LOCAL_ROOT=/usr/GNUstep/Local
GNUSTEP_NETWORK_ROOT=/usr/GNUstep/Network

# The name of the user config file. This file can override
# some settings in this file. Usually used by users that want
# to install things into their GNUstep user domain and/or have
# many such domains.
GNUSTEP_USER_CONFIG_FILE=.GNUstep.conf

# The name of the user directory, if any. This is obsolete,
# and will be removed.
GNUSTEP_USER_DIR=GNUstep

# The name of the user directory where defaults (eg, preferences) are
# stored. If it does not start with a '/', it will be considered
# relative to the user home directory.
GNUSTEP_USER_DEFAULTS_DIR=GNUstep/Defaults


# This is where the gnustep-make Makefiles are installed.
# Traditionally, this is /usr/GNUstep/System/Library/Makefiles
#GNUSTEP_MAKEFILES=/usr/GNUstep/share/GNUstep/Makefiles
GNUSTEP_MAKEFILES=/usr/GNUstep/System/Library/Makefiles


# This is where the user home directories are. Only used to provide
# NSUserDirectory in gnustep-base. Never used anywhere else.
GNUSTEP_SYSTEM_USERS_DIR=/home
GNUSTEP_NETWORK_USERS_DIR=/home
GNUSTEP_LOCAL_USERS_DIR=/home


# This is where System GUI Applications get installed.
# Traditionally it is /usr/GNUstep/System/Applications.
#GNUSTEP_SYSTEM_APPS=/usr/GNUstep/lib/GNUstep/Applications
GNUSTEP_SYSTEM_APPS=/usr/GNUstep/System/Applications

# This is where System GUI Applications that only the
# Administrator can use get installed.
# Traditionally it is /usr/GNUstep/System/Applications/Admin.
#GNUSTEP_SYSTEM_ADMIN_APPS=/usr/GNUstep/lib/GNUstep/Applications
GNUSTEP_SYSTEM_ADMIN_APPS=/usr/GNUstep/System/Applications/Admin

# This is where System Web Applications (GSWeb, SOPE) get
# installed.
# Traditionally it is /usr/GNUstep/System/Library/WebApplications.
#GNUSTEP_SYSTEM_WEB_APPS=/usr/GNUstep/lib/GNUstep/WebApplications
GNUSTEP_SYSTEM_WEB_APPS=/usr/GNUstep/System/Library/WebApplications

# This is where System Command-Line Tools get installed.
# Traditionally it is /usr/GNUstep/System/Tools.
#GNUSTEP_SYSTEM_TOOLS=/usr/GNUstep/bin
GNUSTEP_SYsTEM_TOOLS=/usr/GNUstep/System/Tools

# This is where System Command-Line Tools that only the
# Administrator can use get installed. Important: this
# should not be in the PATH of normal users.
# Traditionally it is /usr/GNUstep/System/Tools/Admin.
#GNUSTEP_SYSTEM_ADMIN_TOOLS=/usr/GNUstep/sbin
GNUSTEP_SYSTEM_ADMIN_TOOLS=/usr/GNUstep/System/Tools/Admin

# This is where System resources get installed. This directory will
# contain a lot of executable code since *step traditionally likes to
# bundle executables and resources together.
# Traditionally it is /usr/GNUstep/System/Library.
#GNUSTEP_SYSTEM_LIBRARY=/usr/GNUstep/lib/GNUstep
GNUSTEP_SYSTEM_LIBRARY=/usr/GNUstep/System/Library

# This is where System headers get installed. They are the
# library .h headers.
# Traditionally it is /usr/GNUstep/System/Library/Headers.
#GNUSTEP_SYSTEM_HEADERS=/usr/GNUstep/include
GNUSTEP_SYSTEM_HEADERS=/usr/GNUstep/System/Library/Headers

# This is where System libraries get installed. By libraries we mean
# the shared/static object files that you can link into programs.
# Traditionally it is /usr/GNUstep/System/Library/Libraries.
#GNUSTEP_SYSTEM_LIBRARIES=/usr/GNUstep/lib
GNUSTEP_SYSTEM_LIBRARIES=/usr/GNUstep/System/Library/Libraries

# This is where System documentation get installed. This is known
# not to contain any executable, so we keep it separate.
# Traditionally it is /usr/GNUstep/System/Library/Documentation.
#GNUSTEP_SYSTEM_DOC=/usr/GNUstep/share/GNUstep/Documentation
GNUSTEP_SYSTEM_DOC=/usr/GNUstep/System/Library/Documentation

# This is where System man pages get installed.
# Traditionally it is /usr/GNUstep/System/Library/Documentation/man.
#GNUSTEP_SYSTEM_DOC_MAN=/usr/GNUstep/share/man
GNUSTEP_SYSTEM_DOC_MAN=/usr/GNUstep/System/Library/Documentation

# This is where System info pages get installed.
# Traditionally it is /usr/GNUstep/System/Library/Documentation/info.
#GNUSTEP_SYSTEM_DOC_INFO=/usr/GNUstep/share/info
GNUSTEP_SYSTEM_DOC_INFO=/usr/GNUstep/System/Library/Documentation/info


GNUSTEP_NETWORK_APPS=/usr/GNUstep/Network/Applications
GNUSTEP_NETWORK_ADMIN_APPS=/usr/GNUstep/Network/Applications
GNUSTEP_NETWORK_WEB_APPS=/usr/GNUstep/Network/WebApplications
GNUSTEP_NETWORK_TOOLS=/usr/GNUstep/Network/Tools
GNUSTEP_NETWORK_ADMIN_TOOLS=/usr/GNUstep/Network/Admin
GNUSTEP_NETWORK_LIBRARY=/usr/GNUstep/Network/Library
GNUSTEP_NETWORK_HEADERS=/usr/GNUstep/Network/Library/Headers
GNUSTEP_NETWORK_LIBRARIES=/usr/GNUstep/Network/Library/Libraries
GNUSTEP_NETWORK_DOC=/usr/GNUstep/Network/Documentation
GNUSTEP_NETWORK_DOC_MAN=/usr/GNUstep/Nework/Documentation/man
GNUSTEP_NETWORK_DOC_INFO=/usr/GNUstep/Network/Documentation/info

GNUSTEP_LOCAL_APPS=/usr/GNUstep/Local/Applications
GNUSTEP_LOCAL_ADMIN_APPS=/usr/GNUstep/Local/Applications/Admin
GNUSTEP_LOCAL_WEB_APPS=/usr/GNUstep/Local/Applications/WebApplications
GNUSTEP_LOCAL_TOOLS=/usr/GNUstep/Local/Tools
GNUSTEP_LOCAL_ADMIN_TOOLS=/usr/GNUstep/Tools/Admin
GNUSTEP_LOCAL_LIBRARY=/usr/GNUstep/Local/Library
GNUSTEP_LOCAL_HEADERS=/usr/GNUstep/Local/Library/Headers
GNUSTEP_LOCAL_LIBRARIES=/usr/GNUstep/Local/Library/Libraries
GNUSTEP_LOCAL_DOC=/usr/GNUstep/Local/Documentation
GNUSTEP_LOCAL_DOC_MAN=/usr/GNUstep/Local/Documentations/man
GNUSTEP_LOCAL_DOC_INFO=/usr/GNUstep/Local/Documentations/info

# Important: settings in the User should normally be relative paths,
# and will be interpreted as relative to the user's directory. This
# allows each user to have their own domain to install things. You
# can set them to be absolute, mostly if you want to disable them
# by setting them equal to the ones in the Network domain.
GNUSTEP_USER_DIR_APPS=GNUstep/Applications
GNUSTEP_USER_DIR_ADMIN_APPS=GNUstep/Applications/Admin
GNUSTEP_USER_DIR_WEB_APPS=GNUstep/WebApplications
GNUSTEP_USER_DIR_TOOLS=GNUstep/Tools
GNUSTEP_USER_DIR_ADMIN_TOOLS=GNUstep/Tools/Admin
GNUSTEP_USER_DIR_LIBRARY=GNUstep/Library
GNUSTEP_USER_DIR_HEADERS=GNUstep/Library/Headers
GNUSTEP_USER_DIR_LIBRARIES=GNUstep/Library/Libraries
GNUSTEP_USER_DIR_DOC=GNUstep/Library/Documentation
GNUSTEP_USER_DIR_DOC_MAN=GNUstep/Library/Documentation/man
GNUSTEP_USER_DIR_DOC_INFO=GNUstep/Library/Documentation/info


cd /usr/GNUstep/System/Library/Libraries
ln -s /usr/lib/libxml2.a .
ln -s /usr/lib/libxml2.la .
ln -s /usr/lib/libxml2.dll.a .

ln -s /usr/lib/libxslt.a .
ln -s /usr/lib/libxslt.la .

ln -s /usr/lib/libiconv.a .
ln -s /usr/lib/libiconv.la .
ln -s /usr/lib/libiconv.dll.a .

ln -s /usr/lib/libcallback.a .
ln -s /usr/lib/libcallback.la .

ln -s /usr/lib/libavcall.a .
ln -s /usr/lib/libavcall.la .

link others library in /usr/lib to /usr/GNUstep/System/Library/Libraries

install gnustep-base
./configure --prefix=/usr/GNUstep --sysconfdir=/etc --localstatedir=/var --enable-threads --enable-shared --enable-ipv6 --enable-nls --enable-static --disable-debug --with-gnu-ld --enable-pass-arguments --enable-ffcall --disable-ffi --disable-xml

install gnustep-gui
./configure --prefix=/usr/GNUstep --sysconfdir=/etc --localstatedir=/var --enable-threads --enable-shared --enable-ipv6 --enable-nls --enable-static --disable-debug --with-gnu-ld --with-jpeg-library=/usr/lib --with-jpeg-include=/usr/include
make
make install

install gnustep-back
./configure --prefix=/usr/GNUstep --sysconfdir=/etc --localstatedir=/var --enable-threads --enable-shared --enable-ipv6 --enable-nls --enable-static --disable-debug --with-gnu-ld --enable-graphics=winlib --enable-server=win32
make
make install

install Performance
make
make install

Install DevelopmentTool

install gorm
make
make install

install ProjectCenter
make
make install

install GWorkspace
./configure --prefix=/usr/GNUstep --enable-shared --enable-static
make
make install


寫了個簡單的程式 test1.m 測試一下。

#import <Foundation/Foundation.h>

int main(int argc, char *argv[])
{
NSAutoreleasePool *pool=[[NSAutoreleasePool alloc] init];

register unsigned int j,k;

NSString *s=[[NSString alloc] init];
NSNumber *i=[[NSNumber alloc] init];
NSMutableArray *table=[[NSMutableArray alloc] init];

s=[NSString stringWithString:@"This is a book!"];
i=[NSNumber numberWithInt:10];

NSLog(@"argc=%d",argc);
for(j=0;j<argc;j++){
[table addObject:[NSString stringWithCString:argv[j]]];
NSLog(@"argv[%d]=%@",j,[NSString stringWithCString:argv[j]]);
}

NSLog(@"i=%d s=%s",i,s);
#ifndef DARWIN
NSLog(@"i=%d s=%s",[i intValue],[s cString]);
#else
NSLog(@"i=%d s=%@",[i intValue],s);
#endif

if((k=[[NSString stringWithCString:argv[1]] intValue])<=0)
k=5;

NSLog(@"k=%d",k);

for(j=0;j<k;j++){
i=[NSNumber numberWithInt:j];
NSLog(@"j=%d i=%@",j,i);
}

[s retain];
[i retain];
[table retain];

[pool release];
return 0;
}


這個 Makefile 可以在有裝 XCode 的 OS X 或 Linux 裝 GNUstep 及 MS-Windows 裝 MinGW 下使用。

#
CC=gcc
#
OS_VERSION=$(shell uname -s)
CFLAGS=-I/usr/include -L/usr/lib
#
ifeq ($(OS_VERSION),Darwin)
export CFLAGS+=-DDARWIN -framework Foundation
else
GNUSTEP_DIR=/usr/GNUstep
GNUSTEP_SYSTEM_DIR=$(GNUSTEP_DIR)/System
GNUSTEP_LOCAL_DIR=$(GNUSTEP_DIR)/Local
#
export CFLAGS+=-I$(GNUSTEP_SYSTEM_DIR)/Library/Headers
export CFLAGS+=-I$(GNUSTEP_LOCAL_DIR)/Library/Headers
export CFLAGS+=-L$(GNUSTEP_SYSTEM_DIR)/Library/Libraries
export CFLAGS+=-L$(GNUSTEP_LOCAL_DIR)/Library/Libraries

ifeq ($(OS_VERSION),MINGW32_NT-5.1)
export CFLAGS+=-L/mingw/lib
export LIBS+=$(GNUSTEP_SYSTEM_DIR)/Library/Libraries/libobjc.dll.a
export LIBS+=$(GNUSTEP_LOCAL_DIR)/Library/Libraries/libgnustep-base.dll.a
export LDFLAGS+="-Wl,--enable-auto-import"
else
export CFLAGS+=-lgnustep-base -lobjc
endif

export CFLAGS+=-fconstant-string-class=NSConstantString
# For GCC-4.0 and upper only
# export CFLAGS+=-fobjc-call-cxx-cdtors
export CFLAGS+=-static-libgcc
endif

export CFLAGS+=-lstdc++

all:
$(CC) $(LDFLAGS) $(CFLAGS) test1.m $(LIBS) -o test1

clean:
rm -fr *.o *.exe
rm -fr test1



不過看來離我要的東西,還很遠。
對了 GNUstep 的 Gorm.app 就等於 XCode 的 Interface Builder 及 ProjectCenter.app 就是 XCode。

發表回應 發表回應 ( 1532預覽 )   |  [ 0 引用 ]   |  permalink   |   ( 3 / 349 )

iPhone OS 3.0
03/18/2009, 02:33 - Apple
iPhone OS 3.0 可以免費 upgrade 但 iPod Touch 要 $9.95 ? 要六月才會有,不過 dev tool 今天就可以 download 了!不過...


會有跑跑卡丁車的方式玩了,就可能Game軟體免費,但是只有基本配備。可以線上購買配備。也就是說玩FPS時打不過,一直接關,這時就會 popup 出來問要不要買一支火力大一點的。東西是假的,但錢可是只收真的。
發表回應 發表回應 ( 561預覽 )   |  [ 0 引用 ]   |  permalink   |   ( 3 / 400 )

Android Source
03/03/2009, 02:59 - Open Source
跟著Android source download 用 repo 的方法一直會有 python 執行 import md5 需要改用 hashlist 的問題。所以就自已想了個辦法。先用 git 將 repo 同步回來,而不用 curl 。這樣就可以了。


cd ~
mkdir repo
cd repo
git clone git://android.git.kernel.org/tools/repo.git
cd ..
mkdir android
cd android
../repo/repo init -u git://android.git.kernel.org/platform/manifest.git
../repo/repo sync

就可以 download source code 及 make 了。
發表回應 發表回應 ( 939預覽 )   |  [ 0 引用 ]   |  permalink   |   ( 3 / 409 )


<<開始 <前一頁 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 下一頁> 最後>>