<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>taka&#039;s note</title>
	<atom:link href="http://cmwang.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://cmwang.wordpress.com</link>
	<description>about OSX, ubuntu, programming and more..</description>
	<lastBuildDate>Sun, 19 Dec 2010 06:40:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='cmwang.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>taka&#039;s note</title>
		<link>http://cmwang.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://cmwang.wordpress.com/osd.xml" title="taka&#039;s note" />
	<atom:link rel='hub' href='http://cmwang.wordpress.com/?pushpress=hub'/>
		<item>
		<title>XRDP on CentOS 5</title>
		<link>http://cmwang.wordpress.com/2009/07/14/xrdp-on-centos-5/</link>
		<comments>http://cmwang.wordpress.com/2009/07/14/xrdp-on-centos-5/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 10:48:45 +0000</pubDate>
		<dc:creator>cmwang</dc:creator>
				<category><![CDATA[CentOS5]]></category>
		<category><![CDATA[HowTo]]></category>

		<guid isPermaLink="false">http://cmwang.wordpress.com/?p=78</guid>
		<description><![CDATA[$ yum install gcc pam-devel openssl-devel $ wget http://ncu.dl.sourceforge.net/sourceforge/xrdp/xrdp-0.4.1.tar.gz $ tar -zxvf xrdp-0.4.1.tar.gz $ cd xrdp-0.4.1 $ make $ sudo make install $ ln /usr/local/xrdp/xrdp_control.sh /etc/init.d/xrdesktop $ gconftool-2 –type list –list-type=string –set /desktop/gnome/peripherals/keyboard/kbd/layouts [damnlayouts] # map keyboard layout $ sudo nano /etc/xrdp/sesman.ini change 127.0.0.1 to 0.0.0.0 $ /sbin/chkconfig &#8211;add xrdesktop $ /sbin/service xrdesktop start $ [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cmwang.wordpress.com&amp;blog=8250412&amp;post=78&amp;subd=cmwang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ yum install gcc pam-devel openssl-devel</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ wget http://ncu.dl.sourceforge.net/sourceforge/xrdp/xrdp-0.4.1.tar.gz</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ tar -zxvf xrdp-0.4.1.tar.gz</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ cd xrdp-0.4.1</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ make</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ sudo make install</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ ln /usr/local/xrdp/xrdp_control.sh /etc/init.d/xrdesktop</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ gconftool-2 –type list –list-type=string –set /desktop/gnome/peripherals/keyboard/kbd/layouts [damnlayouts] # map keyboard layout</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ sudo nano /etc/xrdp/sesman.ini</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">change 127.0.0.1 to 0.0.0.0</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ /sbin/chkconfig &#8211;add xrdesktop</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ /sbin/service xrdesktop start</div>
<p>$ yum install gcc pam-devel openssl-devel</p>
<p>$ wget http://ncu.dl.sourceforge.net/sourceforge/xrdp/xrdp-0.4.1.tar.gz</p>
<p>$ tar -zxvf xrdp-0.4.1.tar.gz</p>
<p>$ cd xrdp-0.4.1</p>
<p>$ make</p>
<p>$ sudo make install</p>
<p>$ ln /usr/local/xrdp/xrdp_control.sh /etc/init.d/xrdesktop</p>
<p>$ gconftool-2 –type list –list-type=string –set /desktop/gnome/peripherals/keyboard/kbd/layouts [damnlayouts] # map keyboard layout</p>
<p>$ sudo nano /etc/xrdp/sesman.ini</p>
<p>change 127.0.0.1 to 0.0.0.0</p>
<p>$ /sbin/chkconfig &#8211;add xrdesktop</p>
<p>$ /sbin/service xrdesktop start</p>
<div>
<div>[optional]</div>
<div>$ cp startwm.sh startwm.sh.bak</div>
<div>$ nano /usr/local/xrdp/startwm.sh // change login env</div>
<div>
<div>export LANG=zh_TW.UTF-8</div>
</div>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cmwang.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cmwang.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cmwang.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cmwang.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cmwang.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cmwang.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cmwang.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cmwang.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cmwang.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cmwang.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cmwang.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cmwang.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cmwang.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cmwang.wordpress.com/78/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cmwang.wordpress.com&amp;blog=8250412&amp;post=78&amp;subd=cmwang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cmwang.wordpress.com/2009/07/14/xrdp-on-centos-5/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e3c30b0e39ac372eebc003d8bbdb152d?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">taka</media:title>
		</media:content>
	</item>
		<item>
		<title>Install proftpd on CentOS5</title>
		<link>http://cmwang.wordpress.com/2009/07/14/install-proftpd-on-centos5/</link>
		<comments>http://cmwang.wordpress.com/2009/07/14/install-proftpd-on-centos5/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 07:50:12 +0000</pubDate>
		<dc:creator>cmwang</dc:creator>
				<category><![CDATA[CentOS5]]></category>
		<category><![CDATA[HowTo]]></category>

		<guid isPermaLink="false">http://cmwang.wordpress.com/?p=74</guid>
		<description><![CDATA[Source:http://www.centospub.com/make/proftpd.html $ nano /etc/yum.repos.d/dag.repo　 // create dag.repo [dag] name=Dag RPM Repository for Red Hat Enterprise Linux baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag gpgcheck=1 enabled=1 $ rpm &#8211;import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt　// import non-official GPG $ yum install proftpd $ nano /etc/proftpd.conf Change ServerName change DefaultRoot ~ $ nano /etc/xinetd.d/xproftpd Change “DURATION USERID” to “HOST PID” Change “USERID” to “HOST” Change &#8220;disable = yes&#8221; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cmwang.wordpress.com&amp;blog=8250412&amp;post=74&amp;subd=cmwang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Source:http://www.centospub.com/make/proftpd.html</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ nano /etc/yum.repos.d/dag.repo　 // create dag.repo</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">[dag]</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">name=Dag RPM Repository for Red Hat Enterprise Linux</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">gpgcheck=1</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">enabled=1</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ rpm &#8211;import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt　// import non-official GPG</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ yum install proftpd</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ nano /etc/proftpd.conf</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Change ServerName</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">change DefaultRoot ~</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ nano /etc/xinetd.d/xproftpd</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Change “DURATION USERID” to “HOST PID”</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Change “USERID” to “HOST”</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Change &#8220;disable = yes&#8221; to 　&#8221;disable = no&#8221;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ /sbin/chkconfig xproftpd on</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ /sbin/chkconfig &#8211;list xproftpd</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ /etc/rc.d/init.d/xinetd restart</div>
<p><a href="http://www.centospub.com/make/proftpd.html" target="_blank">Source:</a></p>
<p><span style="color:#008000;">$ nano /etc/yum.repos.d/dag.repo</span> // create dag.repo</p>
<p><span style="color:#00ccff;">[dag]</span></p>
<p><span style="color:#00ccff;">name=Dag RPM Repository for Red Hat Enterprise Linux</span></p>
<p><span style="color:#00ccff;">baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag</span></p>
<p><span style="color:#00ccff;">gpgcheck=1</span></p>
<p><span style="color:#00ccff;">enabled=1</span></p>
<p><span style="color:#008000;">$ rpm &#8211;import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt</span> // import non-official GPG</p>
<p><span style="color:#008000;">$ yum install proftpd</span></p>
<p><span style="color:#008000;">$ nano /etc/proftpd.conf</span></p>
<p>Change ServerName</p>
<p><span style="color:#ff0000;"><strong>Change ServerType to inetd</strong></span></p>
<p>change DefaultRoot ~</p>
<p><span style="color:#008000;">$ nano /etc/xinetd.d/xproftpd </span></p>
<p>Change “DURATION USERID” to “HOST PID”</p>
<p>Change “USERID” to “HOST”</p>
<p>Change &#8220;disable = yes&#8221; to 　&#8221;disable = no&#8221;</p>
<p><span style="color:#008000;">$ /sbin/chkconfig xproftpd on </span></p>
<p><span style="color:#008000;">$ /sbin/chkconfig &#8211;list xproftpd</span></p>
<p><span style="color:#008000;">$ /etc/rc.d/init.d/xinetd restart </span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cmwang.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cmwang.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cmwang.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cmwang.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cmwang.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cmwang.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cmwang.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cmwang.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cmwang.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cmwang.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cmwang.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cmwang.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cmwang.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cmwang.wordpress.com/74/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cmwang.wordpress.com&amp;blog=8250412&amp;post=74&amp;subd=cmwang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cmwang.wordpress.com/2009/07/14/install-proftpd-on-centos5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e3c30b0e39ac372eebc003d8bbdb152d?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">taka</media:title>
		</media:content>
	</item>
		<item>
		<title>Install oracle 11g x64 on CentOS5.3</title>
		<link>http://cmwang.wordpress.com/2009/07/14/install-oracle-11g-x64-on-centos5-3/</link>
		<comments>http://cmwang.wordpress.com/2009/07/14/install-oracle-11g-x64-on-centos5-3/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 06:46:20 +0000</pubDate>
		<dc:creator>cmwang</dc:creator>
				<category><![CDATA[CentOS5]]></category>
		<category><![CDATA[HowTo]]></category>

		<guid isPermaLink="false">http://cmwang.wordpress.com/?p=68</guid>
		<description><![CDATA[Source: http://wiki.oracle.com/page/Installing+Oracle+11g+on+CentOS+under+VMWare+on+a+Macbook 1. Check packages $ rpm -q grep binutils-2.*    \ elfutils-libelf-0.*        \ glibc-2.*                  \ glibc-common-2.*           \ libaio-0.*                 \ libgcc-4.*                 \ libstdc++-4.* [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cmwang.wordpress.com&amp;blog=8250412&amp;post=68&amp;subd=cmwang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Source: http://wiki.oracle.com/page/Installing+Oracle+11g+on+CentOS+under+VMWare+on+a+Macbook</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">1. Check packages</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ rpm -q grep binutils-2.*    \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">elfutils-libelf-0.*        \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">glibc-2.*                  \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">glibc-common-2.*           \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">libaio-0.*                 \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">libgcc-4.*                 \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">libstdc++-4.*              \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">make-3.*                   \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">compat-libstdc++-33        \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">elfutils-libelf-devel-0.*  \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">glibc-devel-2.*            \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">gcc-4.*                    \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">gcc-c++-4.*                \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">libaio-devel-0.*           \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">libstdc++-devel-4.*        \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">unixODBC-2.*               \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">unixODBC-devel-2.*         \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">sysstat-7.*</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">2. Create Oracle account</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ /usr/sbin/groupadd oinstall</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ /usr/sbin/groupadd dba</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ /usr/sbin/useradd -m -g oinstall -G dba oracle</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ id oracle</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">(uid=501(Oracle) gid=501(oinstall) groups=501(oinstall),502(dba))</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ passwd oracle</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">3. Modified the sysctl.conf</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ cat &gt;&gt; /etc/sysctl.conf &lt;&lt; EOF</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">kernel.sem=1055 32000 100 128</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">kernel.shmmax=2147483648</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">kernel.shmall = 2097152</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">net.ipv4.tcp_sack = 0</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">net.ipv4.tcp_timestamps = 0</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">net.ipv4.conf.default.rp_filter = 0</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">net.core.optmem_max = 65535</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">net.core.rmem_default = 4194304</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">net.core.wmem_default = 262144</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">net.core.rmem_max = 4194304</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">net.core.wmem_max = 262144</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">fs.file-max = 6553600</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">net.ipv4.ip_local_port_range = 1024 65000</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">EOF</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">3.a Check parameters</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ /sbin/sysctl -p</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">4. Modified the limits.conf (Shell limits for oracle user)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ cat &gt;&gt; /etc/security/limits.conf &lt;&lt; EOF</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">*     soft      nproc          2047</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">*     hard      nproc         16384</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">*     soft      nofile         1024</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">*     hard      nofile        65536</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">EOF</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">5. Modified the login</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"># cat &gt;&gt; /etc/pam.d/login &lt;&lt; EOF</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">session    required     /lib/security/pam_limits.so</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">session    required     pam_limits.so</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">EOF</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">6. Modified the config</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ nano /etc/selinux/config</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">(Leave the following two lines only)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">SELINUX=disabled</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">SELINUXTYPE=disabled</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">7. Create Directories</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">mkdir -p /u01</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">mkdir -p /opt/oracle</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">mkdir –p /opt/oracle/product</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">chown -R oracle:oinstall /u01</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">chown -R oracle:oinstall /opt/oracle</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">chmod -R 775 /u01</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">chmod -R 775 /opt/oracle</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">chmod -R 775 /opt/oracle/product</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">8. For network configuration requirements (important!)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">modified /etc/hosts to actual ip address</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">9. Change ownership to oracle</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ chown oracle:oinstall linux.x64_11gR1_database_1013.zip</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">10. Log in as oracle (GUI)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ cd /opt/oracle</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ unzip linux.x64_11gR1_database_1013.zip</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ cd database</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ ./runInstaller</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">=====In the first screen========</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">a. /opt/oracle/ (ORACLE BASE LOCATIONS)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">b. /opt/oracle/product/11.1.0/db_1 (ORACLE HOME LOCATIONS)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">c. Change the UNIX DBA group from dba to oinstall</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">d. Create Starter Database</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">====In the second screen====</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">a. /opt/oracle/product/oraInventory (INVETORY LOCATIONS)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">b. leave the group name oinstall</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">===In the complete screen===</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Do not forget to execute two scripts</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Note: connect from osx</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">./sqlplus sys/password@oracle as SYSDBA</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Maintenance</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">To shut down everything Oracle:</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>$ . oraenv</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>&lt;enter your SID&gt;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>$ sqlplus “/ as sysdba”</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>SQL&gt; shutdown immediate</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>SQL&gt; exit</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>$ lsnrctl</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>LSNRCTL&gt; stop</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>LSNRCTL&gt; exit</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>$ cd $ORACLE_HOME/bin</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>./emctl stop dbconsole</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">To start up everything Oracle:</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>$ . oraenv</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>&lt;enter your SID&gt;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>$ sqlplus “/ as sysdba”</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>SQL&gt; startup</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>SQL&gt; exit</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>$ lsnrctl</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>LSNRCTL&gt; start</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>LSNRCTL&gt; exit</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>$ cd $ORACLE_HOME/bin</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>./emctl start dbconsoleSource: http://wiki.oracle.com/page/Installing+Oracle+11g+on+CentOS+under+VMWare+on+a+Macbook</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">1. Check packages</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ rpm -q grep binutils-2.*    \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">elfutils-libelf-0.*        \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">glibc-2.*                  \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">glibc-common-2.*           \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">libaio-0.*                 \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">libgcc-4.*                 \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">libstdc++-4.*              \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">make-3.*                   \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">compat-libstdc++-33        \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">elfutils-libelf-devel-0.*  \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">glibc-devel-2.*            \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">gcc-4.*                    \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">gcc-c++-4.*                \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">libaio-devel-0.*           \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">libstdc++-devel-4.*        \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">unixODBC-2.*               \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">unixODBC-devel-2.*         \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">sysstat-7.*</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">2. Create Oracle account</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ /usr/sbin/groupadd oinstall</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ /usr/sbin/groupadd dba</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ /usr/sbin/useradd -m -g oinstall -G dba oracle</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ id oracle</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">(uid=501(Oracle) gid=501(oinstall) groups=501(oinstall),502(dba))</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ passwd oracle</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">3. Modified the sysctl.conf</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ cat &gt;&gt; /etc/sysctl.conf &lt;&lt; EOF</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">kernel.sem=1055 32000 100 128</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">kernel.shmmax=2147483648</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">kernel.shmall = 2097152</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">net.ipv4.tcp_sack = 0</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">net.ipv4.tcp_timestamps = 0</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">net.ipv4.conf.default.rp_filter = 0</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">net.core.optmem_max = 65535</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">net.core.rmem_default = 4194304</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">net.core.wmem_default = 262144</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">net.core.rmem_max = 4194304</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">net.core.wmem_max = 262144</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">fs.file-max = 6553600</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">net.ipv4.ip_local_port_range = 1024 65000</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">EOF</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">3.a Check parameters</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ /sbin/sysctl -p</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">4. Modified the limits.conf (Shell limits for oracle user)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ cat &gt;&gt; /etc/security/limits.conf &lt;&lt; EOF</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">*     soft      nproc          2047</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">*     hard      nproc         16384</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">*     soft      nofile         1024</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">*     hard      nofile        65536</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">EOF</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">5. Modified the login</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"># cat &gt;&gt; /etc/pam.d/login &lt;&lt; EOF</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">session    required     /lib/security/pam_limits.so</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">session    required     pam_limits.so</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">EOF</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">6. Modified the config</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ nano /etc/selinux/config</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">(Leave the following two lines only)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">SELINUX=disabled</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">SELINUXTYPE=disabled</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">7. Create Directories</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">mkdir -p /u01</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">mkdir -p /opt/oracle</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">mkdir –p /opt/oracle/product</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">chown -R oracle:oinstall /u01</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">chown -R oracle:oinstall /opt/oracle</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">chmod -R 775 /u01</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">chmod -R 775 /opt/oracle</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">chmod -R 775 /opt/oracle/product</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">8. For network configuration requirements (important!)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">modified /etc/hosts to actual ip address</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">9. Change ownership to oracle</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ chown oracle:oinstall linux.x64_11gR1_database_1013.zip</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">10. Log in as oracle (GUI)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ cd /opt/oracle</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ unzip linux.x64_11gR1_database_1013.zip</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ cd database</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ ./runInstaller</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">=====In the first screen========</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">a. /opt/oracle/ (ORACLE BASE LOCATIONS)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">b. /opt/oracle/product/11.1.0/db_1 (ORACLE HOME LOCATIONS)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">c. Change the UNIX DBA group from dba to oinstall</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">d. Create Starter Database</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">====In the second screen====</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">a. /opt/oracle/product/oraInventory (INVETORY LOCATIONS)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">b. leave the group name oinstall</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">===In the complete screen===</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Do not forget to execute two scripts</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Note: connect from osx</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">./sqlplus sys/password@oracle as SYSDBA</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Maintenance</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">To shut down everything Oracle:</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>$ . oraenv</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>&lt;enter your SID&gt;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>$ sqlplus “/ as sysdba”</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>SQL&gt; shutdown immediate</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>SQL&gt; exit</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>$ lsnrctl</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>LSNRCTL&gt; stop</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>LSNRCTL&gt; exit</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>$ cd $ORACLE_HOME/bin</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>./emctl stop dbconsole</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">To start up everything Oracle:</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>$ . oraenv</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>&lt;enter your SID&gt;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>$ sqlplus “/ as sysdba”</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>SQL&gt; startup</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>SQL&gt; exit</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>$ lsnrctl</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>LSNRCTL&gt; start</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>LSNRCTL&gt; exit</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>$ cd $ORACLE_HOME/bin</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>./emctl start dbconsoleSource: http://wiki.oracle.com/page/Installing+Oracle+11g+on+CentOS+under+VMWare+on+a+Macbook</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">1. Check packages</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ rpm -q grep binutils-2.*    \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">elfutils-libelf-0.*        \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">glibc-2.*                  \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">glibc-common-2.*           \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">libaio-0.*                 \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">libgcc-4.*                 \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">libstdc++-4.*              \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">make-3.*                   \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">compat-libstdc++-33        \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">elfutils-libelf-devel-0.*  \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">glibc-devel-2.*            \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">gcc-4.*                    \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">gcc-c++-4.*                \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">libaio-devel-0.*           \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">libstdc++-devel-4.*        \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">unixODBC-2.*               \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">unixODBC-devel-2.*         \</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">sysstat-7.*</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">2. Create Oracle account</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ /usr/sbin/groupadd oinstall</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ /usr/sbin/groupadd dba</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ /usr/sbin/useradd -m -g oinstall -G dba oracle</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ id oracle</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">(uid=501(Oracle) gid=501(oinstall) groups=501(oinstall),502(dba))</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ passwd oracle</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">3. Modified the sysctl.conf</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ cat &gt;&gt; /etc/sysctl.conf &lt;&lt; EOF</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">kernel.sem=1055 32000 100 128</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">kernel.shmmax=2147483648</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">kernel.shmall = 2097152</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">net.ipv4.tcp_sack = 0</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">net.ipv4.tcp_timestamps = 0</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">net.ipv4.conf.default.rp_filter = 0</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">net.core.optmem_max = 65535</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">net.core.rmem_default = 4194304</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">net.core.wmem_default = 262144</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">net.core.rmem_max = 4194304</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">net.core.wmem_max = 262144</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">fs.file-max = 6553600</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">net.ipv4.ip_local_port_range = 1024 65000</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">EOF</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">3.a Check parameters</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ /sbin/sysctl -p</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">4. Modified the limits.conf (Shell limits for oracle user)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ cat &gt;&gt; /etc/security/limits.conf &lt;&lt; EOF</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">*     soft      nproc          2047</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">*     hard      nproc         16384</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">*     soft      nofile         1024</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">*     hard      nofile        65536</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">EOF</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">5. Modified the login</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"># cat &gt;&gt; /etc/pam.d/login &lt;&lt; EOF</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">session    required     /lib/security/pam_limits.so</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">session    required     pam_limits.so</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">EOF</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">6. Modified the config</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ nano /etc/selinux/config</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">(Leave the following two lines only)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">SELINUX=disabled</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">SELINUXTYPE=disabled</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">7. Create Directories</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">mkdir -p /u01</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">mkdir -p /opt/oracle</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">mkdir –p /opt/oracle/product</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">chown -R oracle:oinstall /u01</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">chown -R oracle:oinstall /opt/oracle</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">chmod -R 775 /u01</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">chmod -R 775 /opt/oracle</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">chmod -R 775 /opt/oracle/product</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">8. For network configuration requirements (important!)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">modified /etc/hosts to actual ip address</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">9. Change ownership to oracle</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ chown oracle:oinstall linux.x64_11gR1_database_1013.zip</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">10. Log in as oracle (GUI)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ cd /opt/oracle</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ unzip linux.x64_11gR1_database_1013.zip</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ cd database</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">$ ./runInstaller</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">=====In the first screen========</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">a. /opt/oracle/ (ORACLE BASE LOCATIONS)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">b. /opt/oracle/product/11.1.0/db_1 (ORACLE HOME LOCATIONS)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">c. Change the UNIX DBA group from dba to oinstall</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">d. Create Starter Database</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">====In the second screen====</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">a. /opt/oracle/product/oraInventory (INVETORY LOCATIONS)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">b. leave the group name oinstall</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">===In the complete screen===</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Do not forget to execute two scripts</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Note: connect from osx</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">./sqlplus sys/password@oracle as SYSDBA</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Maintenance</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">To shut down everything Oracle:</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>$ . oraenv</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>&lt;enter your SID&gt;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>$ sqlplus “/ as sysdba”</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>SQL&gt; shutdown immediate</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>SQL&gt; exit</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>$ lsnrctl</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>LSNRCTL&gt; stop</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>LSNRCTL&gt; exit</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>$ cd $ORACLE_HOME/bin</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>./emctl stop dbconsole</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">To start up everything Oracle:</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>$ . oraenv</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>&lt;enter your SID&gt;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>$ sqlplus “/ as sysdba”</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>SQL&gt; startup</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>SQL&gt; exit</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>$ lsnrctl</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>LSNRCTL&gt; start</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>LSNRCTL&gt; exit</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>$ cd $ORACLE_HOME/bin</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>./emctl start dbconsole</div>
<div>
<div><a href="http://wiki.oracle.com/page/Installing+Oracle+11g+on+CentOS+under+VMWare+on+a+Macbook" target="_blank">Source: </a></div>
<h2>1. Check packages</h2>
<div><span style="color:#008000;">$ rpm -q grep binutils-2.*    \</span></div>
<div><span style="color:#008000;">elfutils-libelf-0.*        \</span></div>
<div><span style="color:#008000;">glibc-2.*                  \</span></div>
<div><span style="color:#008000;">glibc-common-2.*           \</span></div>
<div><span style="color:#008000;">libaio-0.*                 \</span></div>
<div><span style="color:#008000;">libgcc-4.*                 \</span></div>
<div><span style="color:#008000;">libstdc++-4.*              \</span></div>
<div><span style="color:#008000;">make-3.*                   \</span></div>
<div><span style="color:#008000;">compat-libstdc++-33        \</span></div>
<div><span style="color:#008000;">elfutils-libelf-devel-0.*  \</span></div>
<div><span style="color:#008000;">glibc-devel-2.*            \</span></div>
<div><span style="color:#008000;">gcc-4.*                    \</span></div>
<div><span style="color:#008000;">gcc-c++-4.*                \</span></div>
<div><span style="color:#008000;">libaio-devel-0.*           \</span></div>
<div><span style="color:#008000;">libstdc++-devel-4.*        \</span></div>
<div><span style="color:#008000;">unixODBC-2.*               \</span></div>
<div><span style="color:#008000;">unixODBC-devel-2.*         \</span></div>
<div><span style="color:#008000;">sysstat-7.*</span></div>
<h2>2. Create Oracle account</h2>
<div><span style="color:#008000;">$ /usr/sbin/groupadd oinstall</span></div>
<div><span style="color:#008000;">$ /usr/sbin/groupadd dba</span></div>
<div><span style="color:#008000;">$ /usr/sbin/useradd -m -g oinstall -G dba oracle</span></div>
<div><span style="color:#008000;">$ id oracle</span></div>
<div>(uid=501(Oracle) gid=501(oinstall) groups=501(oinstall),502(dba))</div>
<div><span style="color:#008000;">$ passwd oracle</span></div>
<h2>3. Modified the sysctl.conf</h2>
<div><span style="color:#008000;">$ cat &gt;&gt; /etc/sysctl.conf &lt;&lt; EOF</span></div>
<div>kernel.sem=1055 32000 100 128</div>
<div>kernel.shmmax=2147483648</div>
<div>kernel.shmall = 2097152</div>
<div>net.ipv4.tcp_sack = 0</div>
<div>net.ipv4.tcp_timestamps = 0</div>
<div>net.ipv4.conf.default.rp_filter = 0</div>
<div>net.core.optmem_max = 65535</div>
<div>net.core.rmem_default = 4194304</div>
<div>net.core.wmem_default = 262144</div>
<div>net.core.rmem_max = 4194304</div>
<div>net.core.wmem_max = 262144</div>
<div>fs.file-max = 6553600</div>
<div>net.ipv4.ip_local_port_range = 1024 65000</div>
<div>EOF</div>
<h2>3.a Check parameters</h2>
<div><span style="color:#008000;">$ /sbin/sysctl -p</span></div>
<h2>4. Modified the limits.conf (Shell limits for oracle user)</h2>
<div><span style="color:#008000;">$ cat &gt;&gt; /etc/security/limits.conf &lt;&lt; EOF</span></div>
<div>*     soft      nproc          2047</div>
<div>*     hard      nproc         16384</div>
<div>*     soft      nofile         1024</div>
<div>*     hard      nofile        65536</div>
<div>EOF</div>
<h2>5. Modified the login</h2>
<div><span style="color:#008000;"># cat &gt;&gt; /etc/pam.d/login &lt;&lt; EOF</span></div>
<div>session    required     /lib/security/pam_limits.so</div>
<div>session    required     pam_limits.so</div>
<div>EOF</div>
<div>6. Modified the config</div>
<div><span style="color:#008000;">$ nano /etc/selinux/config</span></div>
<div><span style="color:#ff0000;">(Leave the following two lines only)</span></div>
<div>SELINUX=disabled</div>
<div>SELINUXTYPE=disabled</div>
<h2>7. Create Directories</h2>
<div><span style="color:#008000;">$ mkdir -p /u01</span></div>
<div><span style="color:#008000;">$ mkdir -p /opt/oracle</span></div>
<div><span style="color:#008000;">$ mkdir –p /opt/oracle/product</span></div>
<div><span style="color:#008000;">$ chown -R oracle:oinstall /u01</span></div>
<div><span style="color:#008000;">$ chown -R oracle:oinstall /opt/oracle</span></div>
<div><span style="color:#008000;">$ chmod -R 775 /u01</span></div>
<div><span style="color:#008000;">$ chmod -R 775 /opt/oracle</span></div>
<div><span style="color:#008000;">$ chmod -R 775 /opt/oracle/product</span></div>
<h2>8. For network configuration requirements (important!)</h2>
<div><span style="color:#ff0000;">modified <strong>/etc/hosts</strong> to actual ip address</span></div>
<h2>9. Change ownership to oracle</h2>
<div><span style="color:#008000;">$ chown oracle:oinstall linux.x64_11gR1_database_1013.zip</span></div>
<h2>10. Log in as oracle (GUI)</h2>
<div><span style="color:#008000;">$ cd /opt/oracle</span></div>
<div><span style="color:#008000;">$ unzip linux.x64_11gR1_database_1013.zip</span></div>
<div><span style="color:#008000;">$ cd database</span></div>
<div><span style="color:#008000;">$ ./runInstaller</span></div>
<div>=====In the first screen========</div>
<div>a. <strong>/opt/oracle/ </strong>(ORACLE BASE LOCATIONS)</div>
<div>b. /<strong>opt/oracle/product/11.1.0/db_1 </strong>(ORACLE HOME LOCATIONS)</div>
<div>c. Change the UNIX DBA group from <strong>dba</strong> to<strong> oinstall</strong></div>
<div>d. Create Starter Database</div>
<div>====In the second screen====</div>
<div>a. <strong>/opt/oracle/product/oraInventory</strong> (INVETORY LOCATIONS)</div>
<div>b. leave the group name <strong>oinstall</strong></div>
<div>===In the complete screen===</div>
<div><span style="color:#ff0000;"><strong>Do not forget to execute two scripts</strong></span></div>
<h2>Note: connect from osx (download client software)</h2>
<div><span style="color:#008000;">./sqlplus sys/password@oracle as SYSDBA</span></div>
<h2>Maintenance</h2>
<h3>To shut down everything Oracle:</h3>
<div><span style="color:#008000;">$ . oraenv</span></div>
<div>&lt;enter your SID&gt;</div>
<div><span style="color:#008000;">$ sqlplus “/ as sysdba”</span></div>
<div>SQL&gt; shutdown immediate</div>
<div>SQL&gt; exit</div>
<div><span style="color:#008000;">$ lsnrctl</span></div>
<div>LSNRCTL&gt; stop</div>
<div>LSNRCTL&gt; exit</div>
<div><span style="color:#008000;">$ cd $ORACLE_HOME/bin (optional)</span></div>
<div><span style="color:#008000;">./emctl stop dbconsole</span></div>
<h3>To start up everything Oracle:</h3>
<div><span style="color:#008000;">$ . oraenv</span></div>
<div>&lt;enter your SID&gt;</div>
<div><span style="color:#008000;">$ sqlplus “/ as sysdba”</span></div>
<div>SQL&gt; startup</div>
<div>SQL&gt; exit</div>
<div><span style="color:#008000;">$ lsnrctl</span></div>
<div>LSNRCTL&gt; start</div>
<div>LSNRCTL&gt; exit</div>
<div><span style="color:#008000;">$ cd $ORACLE_HOME/bin (optional)</span></div>
<div>./emctl start dbconsole</div>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cmwang.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cmwang.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cmwang.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cmwang.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cmwang.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cmwang.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cmwang.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cmwang.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cmwang.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cmwang.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cmwang.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cmwang.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cmwang.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cmwang.wordpress.com/68/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cmwang.wordpress.com&amp;blog=8250412&amp;post=68&amp;subd=cmwang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cmwang.wordpress.com/2009/07/14/install-oracle-11g-x64-on-centos5-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e3c30b0e39ac372eebc003d8bbdb152d?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">taka</media:title>
		</media:content>
	</item>
		<item>
		<title>OO summary</title>
		<link>http://cmwang.wordpress.com/2009/07/10/oo-summary/</link>
		<comments>http://cmwang.wordpress.com/2009/07/10/oo-summary/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 18:01:18 +0000</pubDate>
		<dc:creator>cmwang</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Note]]></category>

		<guid isPermaLink="false">http://cmwang.wordpress.com/?p=65</guid>
		<description><![CDATA[Class and Object Relationship OO concept Class new constructor overload constructor overload this static package &#38; import access control extends override final Object toString equals Casting upcasting downcasting Polymorphism abstract interface implements Class and Object Relationship OO concept Class new constructor overload constructor overload this static package &#38; import access control extends override final Object [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cmwang.wordpress.com&amp;blog=8250412&amp;post=65&amp;subd=cmwang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Class and Object</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Relationship</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">OO concept</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Class</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">new</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>constructor</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">overload</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>constructor overload</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">this</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">static</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">package &amp; import</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">access control</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">extends</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">override</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">final</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Object</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>toString</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>equals</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Casting</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>upcasting</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>downcasting</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Polymorphism</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">abstract</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">interface</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>implements</div>
<ul>
<li>Class and Object</li>
<li>Relationship</li>
<li>OO concept</li>
<li>Class</li>
<li>new
<ul>
<li>constructor</li>
</ul>
</li>
<li>overload
<ul>
<li>constructor overload</li>
</ul>
</li>
<li>this</li>
<li>static</li>
<li>package &amp; import</li>
<li>access control</li>
<li>extends</li>
<li>override</li>
<li>final</li>
<li>Object
<ul>
<li>toString</li>
</ul>
<ul>
<li>equals</li>
</ul>
</li>
<li>Casting
<ul>
<li>upcasting</li>
</ul>
<ul>
<li>downcasting</li>
</ul>
</li>
<li>Polymorphism</li>
<li>abstract</li>
<li>interface
<ul>
<li>implements</li>
</ul>
</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cmwang.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cmwang.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cmwang.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cmwang.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cmwang.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cmwang.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cmwang.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cmwang.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cmwang.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cmwang.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cmwang.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cmwang.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cmwang.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cmwang.wordpress.com/65/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cmwang.wordpress.com&amp;blog=8250412&amp;post=65&amp;subd=cmwang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cmwang.wordpress.com/2009/07/10/oo-summary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e3c30b0e39ac372eebc003d8bbdb152d?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">taka</media:title>
		</media:content>
	</item>
		<item>
		<title>Array in Java</title>
		<link>http://cmwang.wordpress.com/2009/07/07/array-in-java/</link>
		<comments>http://cmwang.wordpress.com/2009/07/07/array-in-java/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 09:50:09 +0000</pubDate>
		<dc:creator>cmwang</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Note]]></category>

		<guid isPermaLink="false">http://cmwang.wordpress.com/?p=49</guid>
		<description><![CDATA[array除了宣告外，亦需要初始化 靜態 &#8211; 數據類型 變數名 [] = {元素值列舉} - int a [] = {10, 20, 30}; 值一樣可以改變 動態 - 1. 宣告 &#8211; 數據類型 變數名 [] 2. 創建 &#8211; 變數名 = new 數據類型 [元素個數] 3. 賦值 &#8211; 變數名[元素下標] = 元素值 array超過boundary在執行時才會錯誤(編譯會過) 值一樣可以改變 可以重新創建(不用重新宣告)，舊的會被GC array除了宣告外，亦需要初始化 array超過boundary在執行時才會錯誤(編譯會過) 值可以改變，也可以重新創建(不用重新宣告)，舊的會被GC 一維靜態 &#8211; 數據類型 變數名 [] = {元素值列舉}  // int a [] [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cmwang.wordpress.com&amp;blog=8250412&amp;post=49&amp;subd=cmwang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">array除了宣告外，亦需要初始化</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">靜態 &#8211; 數據類型 變數名 [] = {元素值列舉}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>- int a [] = {10, 20, 30};</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>值一樣可以改變</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">動態 -</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">1. 宣告 &#8211; 數據類型 變數名 []</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">2. 創建 &#8211; 變數名 = new 數據類型 [元素個數]</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">3. 賦值 &#8211; 變數名[元素下標] = 元素值</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">array超過boundary在執行時才會錯誤(編譯會過)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">值一樣可以改變</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">可以重新創建(不用重新宣告)，舊的會被GC</div>
<ul>
<li>array除了宣告外，<span style="color:#ff0000;">亦需要初始化</span></li>
<li><span style="color:#ff0000;">array超過boundary在執行時才會錯誤(編譯會過)</span></li>
<li>值可以改變，也可以重新創建(不用重新宣告)，舊的會被GC</li>
</ul>
<ul>
<li><span style="color:#ff0000;">一維靜態</span> &#8211; 數據類型 變數名 [] = {元素值列舉}  <span style="color:#008000;">// int a [] = {10, 20, 30};</span>
<ul style="padding-left:30px;">
<li><strong>值一樣可以改變</strong></li>
</ul>
</li>
<li><span style="color:#ff0000;">一維動態</span> -
<ol>
<li>宣告 &#8211; <strong>數據類型 變數名 []</strong> <span style="color:#008000;">// int a [];</span></li>
</ol>
<ol>
<li>創建 &#8211; <strong>變數名 = new 數據類型 [元素個數]</strong><span style="color:#008000;"> // a = new [5];</span></li>
</ol>
<ol>
<li>賦值 &#8211; <strong>變數名[元素下標] = 元素值</strong> <span style="color:#008000;">// a[0] = 32;</span></li>
</ol>
</li>
<li><span style="color:#008000;"><span style="color:#000000;">拷貝 &#8211; <span style="color:#ff0000;">System.arraycopy(來源，起點，目標，起點，拷貝個數)</span></span></span>
<ul>
<li>int b [] = new int [6];</li>
<li>int c [] = [12, 5, 33];</li>
<li><span style="color:#000000;">System.arraycopy(c, 0, b, 1, c.length);</span></li>
</ul>
</li>
<li><span style="color:#008000;"><span style="color:#000000;">二維靜態 &#8211; int a [] []  = {{2,4}, {3, 5, 7}}; </span> </span></li>
<li><span style="color:#008000;"><span style="color:#000000;">二維動態 &#8211; </span></span>
<ol>
<li>
<ol>
<li><span style="color:#008000;"><span style="color:#008000;">a = new int [2] [];  // 先分配行</span></span></li>
<li><span style="color:#008000;"><span style="color:#008000;">a[0] = new int [2]; // 逐行分配列數</span></span></li>
<li><span style="color:#008000;"><span style="color:#008000;">a[1] = new int [3]; // 逐行分配列數</span></span></li>
</ol>
</li>
</ol>
<ul>
<li><span style="color:#008000;"><span style="color:#000000;">宣告 -<span style="color:#008000;"> int a [] []</span></span></span></li>
<li><span style="color:#008000;"><span style="color:#ff0000;">創建 &#8211; 分成兩步(若不是矩陣)</span></span></li>
</ul>
<ul>
<li><span style="color:#008000;"><span style="color:#000000;">賦值 &#8211; a<span style="color:#008000;">[0][2] = 3;</span></span></span></li>
</ul>
</li>
<li><span style="color:#008000;"><span style="color:#ff0000;">arrray.length : 返回行數</span></span></li>
<li><span style="color:#008000;"><span style="color:#ff0000;">arrat[2].length : 返回第二行的列數</span></span></li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cmwang.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cmwang.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cmwang.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cmwang.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cmwang.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cmwang.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cmwang.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cmwang.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cmwang.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cmwang.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cmwang.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cmwang.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cmwang.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cmwang.wordpress.com/49/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cmwang.wordpress.com&amp;blog=8250412&amp;post=49&amp;subd=cmwang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cmwang.wordpress.com/2009/07/07/array-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e3c30b0e39ac372eebc003d8bbdb152d?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">taka</media:title>
		</media:content>
	</item>
		<item>
		<title>Basic OO in Java</title>
		<link>http://cmwang.wordpress.com/2009/06/24/oo-note1/</link>
		<comments>http://cmwang.wordpress.com/2009/06/24/oo-note1/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 07:23:10 +0000</pubDate>
		<dc:creator>cmwang</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Note]]></category>

		<guid isPermaLink="false">http://cmwang.wordpress.com/?p=31</guid>
		<description><![CDATA[OO特性：封裝、繼承、多態 高級特性：static, final, abstract, interface Class: 具有相同屬性和行為的抽象集合 Object: an instance of a class [modified] class class_name{ type attribute_name // attribute return_type method_name (parameters)[{method}] // method } parameter可省，但括號必須保留 method實做可省 Constructor method:對obj初始化 沒有return_type，與class_name相同，new時用 Local variable: in method membership varaible: in class OO特性：封裝、繼承、多型 高級特性：static, final, abstract, interface Class: 具有相同state和behavior的抽象集合 Object: an instance of a class Syntax method的parameter可省，但括號必須保留; method的實做可省 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cmwang.wordpress.com&amp;blog=8250412&amp;post=31&amp;subd=cmwang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">OO特性：封裝、繼承、多態</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">高級特性：static, final, abstract, interface</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Class: 具有相同屬性和行為的抽象集合</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Object: an instance of a class</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">[modified] class class_name{</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>type attribute_name // attribute</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;"><span style="white-space:pre;"> </span>return_type method_name (parameters)[{method}]<span style="white-space:pre;"> </span>// method</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">}</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">parameter可省，但括號必須保留</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">method實做可省</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Constructor method:對obj初始化</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">沒有return_type，與class_name相同，new時用</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Local variable: in method</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">membership varaible: in class</div>
<ul>
<li>OO特性：<span style="color:#ff0000;"><strong>封裝、繼承、多型</strong></span></li>
<li>高級特性：static, final, abstract, interface</li>
<li>Class: 具有相同state和behavior的抽象集合</li>
<li>Object: an instance of a class</li>
</ul>
<p><strong>Syntax</strong></p>
<ul>
<li>method的parameter可省，但括號必須保留; method的實做可省</li>
<li><span style="color:#ff0000;">member variable </span>(in class) &amp; <span style="color:#ff0000;">local variable</span> (in method), no global varaible</li>
</ul>
<p style="padding-left:30px;"><span style="color:#339966;">[modified] <strong>class</strong> <em>class_name</em>{</span></p>
<p style="padding-left:30px;"><span style="white-space:pre;"><span style="color:#339966;"> </span></span><span style="color:#339966;"><span style="text-decoration:underline;">type</span> <em>attribute_name</em> <span style="color:#000000;">// member variable declaration</span></span></p>
<p style="padding-left:30px;"><span style="white-space:pre;"><span style="color:#339966;"> </span></span><span style="color:#339966;"><span style="text-decoration:underline;">return_type</span> <em>method_name</em> (parameters)[{method}]</span><span style="white-space:pre;"><span style="color:#339966;"> </span></span><span style="color:#000000;">// method declaration</span></p>
<p style="padding-left:30px;"><span style="color:#339966;">}</span></p>
<ul>
<li>賦值或相等
<ul>
<li>&#8220;=&#8221;:  (primitive) assignment / (obj) reference to the same obj</li>
<li>&#8220;==&#8221;: (primitive) equal / (obj) reference to the same obj?</li>
</ul>
</li>
</ul>
<ul>
<li>equals <strong>method</strong>
<ul>
<li><strong><span style="color:#00ff00;">Wrapper Class</span></strong>: equals () // the same value?</li>
<li><strong><span style="color:#ff0000;">Class: equals (==) // reference to the same obj?</span></strong></li>
<li>primitive: equals (x) // 不能使用method</li>
</ul>
</li>
</ul>
<ul>
<li>Initialization種類:</li>
</ul>
<ol>
<li>constructor method: 沒有return_type，與class_name相同，new時才能使用</li>
<li>default: 定義class時直接指定，固定</li>
<li>lazy init (empty): setter/getter</li>
</ol>
<ul>
<li><strong>Initialization順序 (important</strong>):</li>
</ul>
<ol>
<li>member variable // it can be used in all method(include constructor method)</li>
<li>constrictor method</li>
<li>general method在使用時才會初始化</li>
</ol>
<ul>
<li><strong>Method Overload</strong>: the same method_name, different parameters (e.g. multiple constructors)</li>
</ul>
<ul>
<li>Object
<ul>
<li>toString : override</li>
<li>equals :</li>
</ul>
</li>
</ul>
<ol>
<li>
<ol>
<li>
<ol>
<li>primitive 跟 == 一樣</li>
<li>obj</li>
</ol>
</li>
</ol>
</li>
</ol>
<ul>
<li>casting:
<ul>
<li>upcasting時，不可訪問子類新增加的成員屬性/方法</li>
</ul>
</li>
</ul>
<p style="padding-left:60px;"><span style="white-space:pre;"> </span>Animal a = new Cat(&#8220;Garfi&#8221;); // upcasting</p>
<ul>
<li>
<ul>
<li>downcasting時(特化)，需要強制轉型<span style="white-space:pre;"> </span></li>
</ul>
</li>
<li>polymorphism/dynamic binding (execution time)</li>
</ul>
<p style="padding-left:30px;">根據實際類型調用方法</p>
<p><span style="white-space:pre;"></p>
<ol>
<li>
<ol>
<li><span style="white-space:normal;">inherit</span></li>
<li><span style="white-space:normal;">override</span></li>
<li><span style="white-space:normal;"> super reference to sub object</span></li>
</ol>
</li>
</ol>
<p></span></p>
<p style="padding-left:60px;">雷電範例<span style="white-space:pre;"> </span></p>
<ul>
<li>abstract:
<ul>
<li>有abstract method，此class也必須定義為abstract</li>
<li>不能實體化</li>
</ul>
</li>
<li>final:  不能改變/重寫/繼承</li>
<li>interface:
<ul>
<li>一種特殊的抽象類:</li>
</ul>
</li>
</ul>
<ol>
<li>
<ol>
<li>
<ol>
<li>只有public final static常數 (不寫修飾也是)</li>
<li> public方法定義(沒有實現)</li>
</ol>
</li>
</ol>
</li>
</ol>
<ul>
<li>
<ul>
<li>一樣可以使用多型</li>
<li>可以實做多個介面</li>
<li>不同類可以實做單一介面</li>
<li>介面可以繼承介面</li>
</ul>
</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cmwang.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cmwang.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cmwang.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cmwang.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cmwang.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cmwang.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cmwang.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cmwang.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cmwang.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cmwang.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cmwang.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cmwang.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cmwang.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cmwang.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cmwang.wordpress.com&amp;blog=8250412&amp;post=31&amp;subd=cmwang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cmwang.wordpress.com/2009/06/24/oo-note1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e3c30b0e39ac372eebc003d8bbdb152d?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">taka</media:title>
		</media:content>
	</item>
		<item>
		<title>Primitive Data Type of python</title>
		<link>http://cmwang.wordpress.com/2009/06/11/primitive-data-type-of-python/</link>
		<comments>http://cmwang.wordpress.com/2009/06/11/primitive-data-type-of-python/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 14:54:00 +0000</pubDate>
		<dc:creator>cmwang</dc:creator>
				<category><![CDATA[Note]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://cmwang.wordpress.com/2009/06/11/primitive-data-type-of-python/</guid>
		<description><![CDATA[Dictionary # 並沒有順序的概念，事實上是hash table的一個實例 d = {&#8220;server&#8221;:&#8221;mpilgrim&#8221;, &#8220;database&#8221;:&#8221;master&#8221;, 3: 500} # key and value, 可用key取值，卻不能用value取key # 可用數字，字串跟tuple為key，但不能用list，因為list可以改變 調用: d["server"] # Key是大小寫敏感的 修改: d["server"] = &#8220;mac&#8221; # 可以隨時加入新的kv, 但如果使用同key，會蓋掉value 刪除: del d["database"] 清空: d.clear() dictionary如何排序？ List # 有序元素，可以&#8221;重複&#8221;，類比Java的Arraylist li = ["a", "b", "mpilgrim", "z", "example"] 調用: li[0], li[-1] # 最後一個元素等於li[len(li)-1] 切片: li[0:3] # 只有三個元素，並不含li[3]，切出第一個想要跟第一個不想要 切片簡寫: li[:3], [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cmwang.wordpress.com&amp;blog=8250412&amp;post=19&amp;subd=cmwang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div><span class="Apple-style-span" style="font-weight:bold;"><span class="Apple-style-span"><span class="Apple-style-span" style="color:rgb(255,0,0);">Dictionar</span></span><span class="Apple-style-span" style="color:rgb(255,0,0);">y</span></span> <span class="Apple-style-span" style="color:rgb(0,102,0);"># 並沒有順序的概念，事實上是hash table的一個實例</span></div>
<div>d = {&#8220;server&#8221;:&#8221;mpilgrim&#8221;, &#8220;database&#8221;:&#8221;master&#8221;, 3: 500}</div>
<div><span class="Apple-style-span" style="color:rgb(0,102,0);"># key and value, 可用key取值，卻不能用value取key</span></div>
<div><span class="Apple-style-span" style="color:rgb(0,102,0);"># 可用數字，字串跟tuple為key，但不能用list，因為list可以改變<br /></span></div>
<div><span class="Apple-style-span" style="font-weight:bold;">調用</span>: d["server"] <span class="Apple-style-span" style="color:rgb(0,102,0);"># Key是大小寫敏感的</span></div>
<div><span class="Apple-style-span" style="font-weight:bold;">修改</span>: d["server"] = &#8220;mac&#8221; <span class="Apple-style-span" style="color:rgb(0,102,0);"># 可以隨時加入新的kv, 但如果使用同key，會蓋掉value</span></div>
<div><span class="Apple-style-span" style="font-weight:bold;">刪除</span>: del d["database"]</div>
<div><span class="Apple-style-span" style="font-weight:bold;">清空</span>: d.clear()</div>
<div></div>
<div>dictionary如何排序？</div>
<div></div>
<div>
<div><span class="Apple-style-span" style="font-weight:bold;"><span class="Apple-style-span" style="color:rgb(255,0,0);">List</span></span> <span class="Apple-style-span" style="color:rgb(0,102,0);"># 有序元素，可以&#8221;重複&#8221;，類比Java的Arraylist</span></div>
<div>li = ["a", "b", "mpilgrim", "z", "example"]</div>
<div><span class="Apple-style-span" style="font-weight:bold;">調用</span>: li[0], li[-1] <span class="Apple-style-span" style="color:rgb(0,102,0);"># 最後一個元素等於li[len(li)-1]</span></div>
<div><span class="Apple-style-span" style="font-weight:bold;">切片</span>: li[0:3] <span class="Apple-style-span" style="color:rgb(0,102,0);"># 只有三個元素，並不含li[3]，切出第一個想要跟第一個不想要</span></div>
<div><span class="Apple-style-span" style="font-weight:bold;">切片簡寫</span>: li[:3], li[3:], li[:] <span class="Apple-style-span" style="color:rgb(0,102,0);"># 拷貝一個新的list</span></div>
<div><span class="Apple-style-span" style="font-weight:bold;">加入元素</span>: li.append(&#8220;apple&#8221;), li.append(2,&#8221;mac&#8221;) <span class="Apple-style-span" style="color:rgb(0,102,0);"># 將mac加到li[2]的位置, 無傳回</span></div>
<div><span class="Apple-style-span" style="font-weight:bold;">連接串列</span>: li.extend(li), li.extend([a,b]) <span class="Apple-style-span" style="color:rgb(0,102,0);"># 無傳回值</span></div>
<div><span class="Apple-style-span" style="color:rgb(0,102,0);"># extend只接受一個參數list，將裡面的元素加入，但append會將整個list當成一個元素</span></div>
<div><span class="Apple-style-span" style="font-weight:bold;">搜尋</span>: li.index(&#8220;mac&#8221;)<span class="Apple-style-span" style="color:rgb(0,102,0);"> # 傳回位置，如果沒找到會傳回異常</span></div>
<div><span class="Apple-style-span" style="font-weight:bold;">存在</span>: &#8220;apple&#8221; in li <span class="Apple-style-span" style="color:rgb(0,102,0);"># 傳回布林值，此例是False</span></div>
<div><span class="Apple-style-span" style="font-weight:bold;">刪除</span>: li.remove(&#8220;mac&#8221;) <span class="Apple-style-span" style="color:rgb(0,102,0);"># 刪除第一次出現的mac，如果有兩個mac，無此值會異常</span></div>
<div><span class="Apple-style-span" style="font-weight:bold;">pop</span>: out = li.pop() <span class="Apple-style-span" style="color:rgb(0,102,0);"># 會刪除li[-1]並回傳它，可以指定位置</span></div>
<div><span class="Apple-style-span" style="font-weight:bold;">運算</span>: newl = li + li; new1 = li * 2 <span class="Apple-style-span" style="color:rgb(0,102,0);"># 效果等於extend，但會傳回新字串，較extend慢</span></div>
<div><span class="Apple-style-span" style="color:rgb(0,102,0);"><br /></span></div>
<div><span class="Apple-style-span" style="color:rgb(0,102,0);"><span class="Apple-style-span" style="font-weight:bold;"><span class="Apple-style-span" style="color:rgb(255,0,0);">Tuple</span></span> </span><span class="Apple-style-span" style="color:rgb(0,102,0);"># 是不可變的 list。一旦創建了一個 tuple，就不能以任何方式改變它。</span></div>
<div><span class="Apple-style-span" style="color:rgb(0,102,0);">tupe用小括號，但沒有method，如remove, pop，append 也不能更改它</span></div>
<div><span class="Apple-style-span" style="color:rgb(0,102,0);">但是tuple速度比list快</span></div>
<div></div>
<div>如何tuple跟list互轉</div>
<div></div>
<div><span class="Apple-style-span" style="font-weight:bold;"><span class="Apple-style-span" style="color:rgb(255,0,0);">類似enum的作法</span></span></div>
<div>
<div>(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY) = range(7)</div>
<div></div>
<div>
<div><span class="Apple-style-span" style="font-weight:bold;"><span class="Apple-style-span" style="color:rgb(255,0,0);">布林值</span></span> <span class="Apple-style-span" style="color:rgb(0,102,0);"># 注意是大寫</span></div>
<div><span class="Apple-style-span" style="color:rgb(0,102,0);">0, &#8220;&#8221;, [], (), {} 都是False</span></div>
<div><span class="Apple-style-span" style="color:rgb(0,102,0);">任意value, list, tuple, dictionary都是True</span></div>
<div></div>
<div>待續</div>
</div>
</div>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cmwang.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cmwang.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cmwang.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cmwang.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cmwang.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cmwang.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cmwang.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cmwang.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cmwang.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cmwang.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cmwang.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cmwang.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cmwang.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cmwang.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cmwang.wordpress.com&amp;blog=8250412&amp;post=19&amp;subd=cmwang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cmwang.wordpress.com/2009/06/11/primitive-data-type-of-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e3c30b0e39ac372eebc003d8bbdb152d?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">taka</media:title>
		</media:content>
	</item>
		<item>
		<title>Multiple arguments(keyword assignment) and factory method</title>
		<link>http://cmwang.wordpress.com/2009/06/11/multiple-argumentskeyword-assignment-and-factory-method/</link>
		<comments>http://cmwang.wordpress.com/2009/06/11/multiple-argumentskeyword-assignment-and-factory-method/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 14:53:00 +0000</pubDate>
		<dc:creator>cmwang</dc:creator>
				<category><![CDATA[Note]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://cmwang.wordpress.com/2009/06/11/multiple-argumentskeyword-assignment-and-factory-method/</guid>
		<description><![CDATA[class Cheese(): def __init__(self, *args, **kwargs): #args &#8212; tuple of anonymous arguments #kwargs &#8212; dictionary of named arguments self.num_holes = kwargs.get(&#8216;num_holes&#8217;,random_holes()) to explain better concept of *args and **kwargs (you can actually change these names): def f(*args, **kwargs): print &#8216;args: &#8216;, args, &#8216; kwargs: &#8216;, kwargs &#62;&#62;&#62; f(&#8216;a&#8217;) args: (&#8216;a&#8217;,) kwargs: {} &#62;&#62;&#62; f(ar=&#8217;a') args: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cmwang.wordpress.com&amp;blog=8250412&amp;post=18&amp;subd=cmwang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div>class Cheese():</div>
<div>def __init__(self, <span class="Apple-style-span" style="color:rgb(255,0,0);">*args, **kwargs</span>):</div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);">#args &#8212; tuple of anonymous arguments</span></div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);">#kwargs &#8212; dictionary of named arguments</span></div>
<div>self.num_holes = kwargs.get(&#8216;num_holes&#8217;,random_holes())</div>
<div></div>
<div>to explain better concept of *args and **kwargs (<span class="Apple-style-span" style="color:rgb(255,0,0);">you can actually change these names</span>):</div>
<div></div>
<div>def f(*args, **kwargs):</div>
<div>print &#8216;args: &#8216;, args, &#8216; kwargs: &#8216;, kwargs</div>
<div></div>
<div>&gt;&gt;&gt; f(&#8216;a&#8217;)</div>
<div>args: (&#8216;a&#8217;,) kwargs: {}</div>
<div>&gt;&gt;&gt; f(ar=&#8217;a')</div>
<div>args: () kwargs: {&#8216;ar&#8217;: &#8216;a&#8217;}</div>
<div>&gt;&gt;&gt; f(1,2,param=3)</div>
<div>args: (1, 2) kwargs: {&#8216;param&#8217;: 3}</div>
<div></div>
<div><a href="http://stackoverflow.com/questions/682504/what-is-a-clean-pythonic-way-to-have-multiple-constructors-in-python/682513#682513">Source</a> <a href="http://stackoverflow.com/questions/456672/class-factory-in-python">Factory Class</a> Also, Learning python adv OO</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cmwang.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cmwang.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cmwang.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cmwang.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cmwang.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cmwang.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cmwang.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cmwang.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cmwang.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cmwang.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cmwang.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cmwang.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cmwang.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cmwang.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cmwang.wordpress.com&amp;blog=8250412&amp;post=18&amp;subd=cmwang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cmwang.wordpress.com/2009/06/11/multiple-argumentskeyword-assignment-and-factory-method/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e3c30b0e39ac372eebc003d8bbdb152d?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">taka</media:title>
		</media:content>
	</item>
		<item>
		<title>Return sorted indices</title>
		<link>http://cmwang.wordpress.com/2009/06/11/return-sorted-indices/</link>
		<comments>http://cmwang.wordpress.com/2009/06/11/return-sorted-indices/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 14:52:00 +0000</pubDate>
		<dc:creator>cmwang</dc:creator>
				<category><![CDATA[Note]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://cmwang.wordpress.com/2009/06/11/return-sorted-indices/</guid>
		<description><![CDATA[Source 1, Source 2 Input: spam = [2,3,1,4,5] Output: list(index for index, item in sorted(enumerate(spam), key=lambda item:item[1])) list(index for index, item in sorted(enumerate(spam), key=lambda item:item[1], reverse=True)) Hint: Using the new key = parameter. sorted(d.items(), key=lambda (k,v): (v,k)) key returns the &#8220;sort key&#8221; that sort will do the comparison on.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cmwang.wordpress.com&amp;blog=8250412&amp;post=17&amp;subd=cmwang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div><span class="Apple-style-span" style="color:rgb(0,102,0);"><span class="Apple-style-span" style="color:rgb(0,0,0);">
<div><a href="http://mail.python.org/pipermail/python-list/2005-May/320867.html">Source 1</a>, <a href="http://code.activestate.com/recipes/52306/">Source 2</a></div>
<div></div>
<div>Input:</div>
<p></span></span></div>
<div><span class="Apple-style-span" style="color:rgb(0,102,0);">spam = [2,3,1,4,5]</span></div>
<div>Output:</div>
<div><span class="Apple-style-span" style="color:rgb(0,102,0);">list(index for index, item in sorted(enumerate(spam), key=lambda item:item[1]))</span></div>
<div></div>
<div><span class="Apple-style-span" style="color:rgb(0,102,0);">list(index for index, item in sorted(enumerate(spam), key=lambda item:item[1], reverse=True))</span></div>
<div></div>
<div>Hint:</div>
<div>Using the new key = parameter.</div>
<div>sorted(d.items(), key=lambda (k,v): (v,k))</div>
<div>key returns the &#8220;sort key&#8221; that sort will do the comparison on.</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cmwang.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cmwang.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cmwang.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cmwang.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cmwang.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cmwang.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cmwang.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cmwang.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cmwang.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cmwang.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cmwang.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cmwang.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cmwang.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cmwang.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cmwang.wordpress.com&amp;blog=8250412&amp;post=17&amp;subd=cmwang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cmwang.wordpress.com/2009/06/11/return-sorted-indices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e3c30b0e39ac372eebc003d8bbdb152d?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">taka</media:title>
		</media:content>
	</item>
		<item>
		<title>A byte of python (Quick note)</title>
		<link>http://cmwang.wordpress.com/2009/06/11/a-byte-of-python-quick-note/</link>
		<comments>http://cmwang.wordpress.com/2009/06/11/a-byte-of-python-quick-note/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 14:51:00 +0000</pubDate>
		<dc:creator>cmwang</dc:creator>
				<category><![CDATA[Note]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://cmwang.wordpress.com/2009/06/11/a-byte-of-python-quick-note/</guid>
		<description><![CDATA[Source Executable python #!/usr/bin/env python $ chmod a+x filename.py String raw string ignore the escape symbol r&#8221;This is raw \n&#8221; unicode string u&#8221;いい天氣です&#8221; Long String &#8220;&#8221;"something new today &#8220;&#8221;" Explicit line join print \ i equivalent to print i Operator // (floor division, return the floor) % (modulo, return the remainder) &#38;&#124;^~ (and, or, xor, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cmwang.wordpress.com&amp;blog=8250412&amp;post=16&amp;subd=cmwang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div><a href="http://www.ibiblio.org/swaroopch/byteofpython/files/120/byteofpython_120.pdf"><span class="Apple-style-span">Source</span></a></div>
<div><span class="Apple-style-span" style="font-weight:bold;"><br /></span></div>
<div><span class="Apple-style-span" style="font-weight:bold;">Executable python</span></div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);">#!/usr/bin/env python</span></div>
<div><span class="Apple-style-span" style="color:rgb(0,102,0);">$ chmod a+x filename.py</span></div>
<div></div>
<div><span class="Apple-style-span" style="font-weight:bold;">String</span></div>
<div>raw string ignore the escape symbol</div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);">r&#8221;This is raw \n&#8221;</span></div>
<div>unicode string</div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);">u&#8221;いい天氣です&#8221;</span></div>
<div>Long String</div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);">&#8220;&#8221;"something new</span></div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);">today</span></div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);">&#8220;&#8221;"</span></div>
<div><span class="Apple-style-span" style="font-weight:bold;">Explicit line join</span></div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);">print \</span></div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);">i</span></div>
<div>equivalent to</div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);">print i</span></div>
<div></div>
<div><span class="Apple-style-span" style="font-weight:bold;">Operator</span></div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);">//</span> (floor division, return the floor)</div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);">%</span> (modulo, return the remainder)</div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);">&amp;|^~</span> (and, or, xor, not) bit operator</div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);">!=</span> (not equal to)</div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);">and</span> (short-circuit evaluation, boolean AND)</div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);">or</span> (short-circuit evaluation, boolean OR)</div>
<div></div>
<div>
<div><span class="Apple-style-span" style="font-weight:bold;">Control Flow</span></div>
<div>
<ul>
<li>if(elif,else)</li>
<li>for (else optional)</li>
<li>while (else optional)</li>
<li>break (a<span class="Apple-style-span" style="font-style:italic;">lso break the </span><span class="Apple-style-span" style="font-weight:bold;"><span class="Apple-style-span" style="font-style:italic;">else</span></span><span class="Apple-style-span" style="font-style:italic;"> clause</span>, can be used with <span class="Apple-style-span" style="font-weight:bold;">if</span>, <span class="Apple-style-span" style="font-weight:bold;">for</span> and <span class="Apple-style-span" style="font-weight:bold;">while</span>)</li>
<li>continue ( skip the rest of the statements in the current loop block and to continue to the next iteration of the loop, can be used with <span class="Apple-style-span" style="font-weight:bold;">for</span> and <span class="Apple-style-span" style="font-weight:bold;">while</span>)</li>
</ul>
</div>
<div><span class="Apple-style-span" style="font-weight:bold;">Some built-in function</span></div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);">int(raw_input(&#8220;prompt you like : &#8220;))</span></div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);">len()</span></div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);">range()</span></div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);"><br /></span></div>
<div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);">for i in range(1,5) <span class="Apple-style-span" style="color:rgb(0,0,0);">#1,2,3,4 (5 is not included)</span></span></div>
<div>which is equivalent to c syntax</div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);">for (int i= 1; i &lt; 5; i++)</span></div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);"><br /></span></div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);">for i in range(1,5,2) # 1, 3</span></div>
<div></div>
<div>
<div><span class="Apple-style-span" style="font-weight:bold;">Function</span></div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);">def func():</span><span class="Apple-tab-span" style="white-space:pre;"> </span># no parameters function</div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);">def func(a, b=5, c=10): </span># default argument values</div>
<div>Calling as follow:</div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);">func(3,7)</span></div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);">func(25, c = 24)</span></div>
<div><span class="Apple-style-span" style="color:rgb(255,0,0);">func(c = 40, a = 100)</span> <span class="Apple-style-span" style="font-weight:bold;"># use keyword arguments</span></div>
<div>Note the terminology: argument and parameter</div>
<div></div>
<div><span class="Apple-style-span" style="font-weight:bold;">Global variables</span></div>
<div>global x</div>
<div>x = 2</div>
<div></div>
<div><span class="Apple-style-span" style="font-weight:bold;">Return statement</span></div>
<div>Every function implicitly contains a <span class="Apple-style-span" style="color:rgb(255,0,0);">return None</span> statement at the end unless you have written your own return statement.</div>
<div>The <span class="Apple-style-span" style="color:rgb(255,0,0);">pass</span> statement is used in Python to indicate an empty block of statements.</div>
<div><span class="Apple-style-span" style="font-weight:bold;"><br /></span></div>
<div><span class="Apple-style-span" style="font-weight:bold;">DocString</span></div>
<div>First line: sentense; <span class="Apple-style-span"><span class="Apple-style-span" style="font-weight:bold;">Second line: blank</span></span>; The others: detailed explanation</div>
<div>We can access it using the dot attribute such as <span class="Apple-style-span" style="color:rgb(255,0,0);">print </span><span class="Apple-style-span" style="color:rgb(255,0,0);">printMax.<span class="Apple-style-span" style="font-weight:bold;">__doc__ </span></span></div>
<div></div>
<div>others</div>
<div></div>
</div>
</div>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cmwang.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cmwang.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cmwang.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cmwang.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cmwang.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cmwang.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cmwang.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cmwang.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cmwang.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cmwang.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cmwang.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cmwang.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cmwang.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cmwang.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cmwang.wordpress.com&amp;blog=8250412&amp;post=16&amp;subd=cmwang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cmwang.wordpress.com/2009/06/11/a-byte-of-python-quick-note/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e3c30b0e39ac372eebc003d8bbdb152d?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">taka</media:title>
		</media:content>
	</item>
	</channel>
</rss>
