<?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/"
	>

<channel>
	<title>Eyoung&#039;s Blog &#187; Technology</title>
	<atom:link href="http://blog.ehomy.net/archives/category/technology/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.ehomy.net</link>
	<description>On the way...</description>
	<lastBuildDate>Wed, 08 Sep 2010 08:09:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>HAProxy的安装和部署</title>
		<link>http://blog.ehomy.net/archives/153</link>
		<comments>http://blog.ehomy.net/archives/153#comments</comments>
		<pubDate>Thu, 02 Sep 2010 10:48:46 +0000</pubDate>
		<dc:creator>Eyoung</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.ehomy.net/?p=153</guid>
		<description><![CDATA[考虑公司当前服务器的并发量，最终还是选定了HAProxy来实现负载均衡，相较于其他的负载均衡系统，HAProxy的配置和使用还是比较简单的。
下面是自己安装和部署haproxy的记录，比较重要的一点是解决了haproxy + syslog-ng的日志输出问题。
PS: 这个问题费了我好大神:-&#124;]]></description>
			<content:encoded><![CDATA[<p>考虑公司当前服务器的并发量，最终还是选定了HAProxy来实现负载均衡，相较于其他的负载均衡系统，HAProxy的配置和使用还是比较简单的。<br />
下面是自己安装和部署haproxy的记录，比较重要的一点是解决了haproxy + syslog-ng的日志输出问题。<br />
PS: 这个问题费了我好大神:-|</p>
<p><img class="aligncenter" title="HAProxy " src="http://haproxy.1wt.eu/img/haproxy-pmode.png" alt="" width="363" height="290" /><br />
<strong>PLATFORM: SUSE Linux Enterprise Server 11 (x86_64)</strong></p>
<h3>1. haproxy的编译安装</h3>
<p><strong>获取haproxy的源代码</strong><br />
官方地址：http://haproxy.1wt.eu/<br />
目前最新的版本：http://haproxy.1wt.eu/download/1.4/src/haproxy-1.4.8.tar.gz</p>
<p>命令：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>haproxy.1wt.eu<span style="color: #000000; font-weight: bold;">/</span>download<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.4</span><span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>haproxy-1.4.8.tar.gz</pre></div></div>

<p>考虑到版本的更新，具体的安装属性可能会稍有改变，建议在安装前可以大致浏览下haproxy目录下的README和Makefile两个文件。</p>
<p><strong>编译haproxy</strong><br />
进入解压后的haproxy的目录，用下列命令进行编译：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #007800;">TARGET</span>=os <span style="color: #007800;">ARCH</span>=<span style="color: #c20cb9; font-weight: bold;">arch</span> <span style="color: #007800;">CPU</span>=cpu <span style="color: #007800;">USE_xxx</span>=<span style="color: #000000;">1</span> ...</pre></div></div>

<p>这里着重说明几个常用的选项。</p>
<p>TARGET<br />
指定对目标操作系统在编译的时候进行优化，可选择如下值之一：<br />
Generic, linux22, linux24, linux24e, linux26, solaris, freebsd, openbsd,<br />
Cygwin, custom。<br />
如果不确定目标系统，可以保留默认值generic。</p>
<p>CPU<br />
指定对特定的CPU进行优化，可选择如下值之一：generic, i586, i686, ultrasparc, custom。默认值为generic。</p>
<p>ARCH<br />
指定ARCH值可强制编译生成针对一个特定系统架构的程序。通常用于在一个系统架构的平台上生成针对另一个不同架构平台的程序，比如在一个64位架构的目标系统上编译生成一个32位的程序。</p>
<p>当前可选的值有：x86_64, i386, i486, i586, i686。<br />
注：若选择上述其中的一个值，”-m32”或”-m64”会被添加到CFLAGS和LDFLAGS选<br />
项中。</p>
<p>DEBUG<br />
指定生成调试信息，可通过指定DEBUG=-DDEBUG_xxx对特定的代码部分生成调试信息。<br />
当前定义的DEBUG宏有：DEBUG_FULL, DEBUG_MEMORY, DEBUG_FSM, DEBUG_HASH和<br />
DEBUG_AUTH。<br />
USE_PCRE, USE_STATIC_PCRE 选项可通过指定”USE_xxx=1”表示使用，指定”USE_xxx=”表示禁用。</p>
<p>指定是否使用libpcre库中的正则表达式实现来代替系统的libc库中的实现，考虑到使用libpcre库的效率要比libc高，因此推荐使用此选项。</p>
<p>注：<br />
因libpcre还没有广泛普及，因此在动态链接的时候，需确保目标系统安装有libpcre的动态库。因libpcre还没有广泛普及，因此在动态链接的时候，需确保目标系统安装有libpcre的动态库。针对上面的问题，可以使用USE_STATIC_PCRE，指定静态链接libpcre。<br />
使用libpcre库编译时，需先确保系统已安装libpcre库。若不使用libpcre，则默认使用系统libc库中的标准正则表达式实现。强烈推荐使用static_pcre。</p>
<p>PREFIX<br />
指定安装目录，默认为/usr/local，其他诸如文档之类的文件将会在PREFIX指定的相应目录下。</p>
<p>DESTDIR<br />
指定安装目录，默认没有设置，如果想将haproxy安装一个沙盒中则可以指定该属性。<br />
考虑到我们的系统为Linux，内核2.6+版本的，CPU为x86_64的，可以使用如下命令编译：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #007800;">TARGET</span>=linux26 <span style="color: #007800;">USE_STATIC_PCRE</span>=<span style="color: #000000;">1</span></pre></div></div>

<p><strong>安装 HAProxy</strong><br />
可以直接将生成的haproxy程序拷贝到你想安装到的目录。或者执行命令安装到之前指定或默认的目录：<br />
sudo make install</p>
<h3>2. 配置 HAProxy</h3>
<p>Doc/目录下提供了一些文档，具体的配置说明可以参考在configuration.txt文件。<br />
下面主要说明下配置过程中日志输出问题和一些需要注意的配置选项。</p>
<p><strong>1). 日志的输出问题。</strong></p>
<p>根据说明，haproxy的日志输出使用了系统的日志程序，比如syslogd, syslog-ng。这两个日志系统使用上其主要的区别就是其配置文件的格式不同，考虑syslog-ng算是syslog的一个升级版，在性能和功能性上都要优于syslogd，因此这里主要介绍的是配置syslog-ng来实现haproxy的日志输出。<br />
我的机器环境，一如既往：SUSE Linux Enterprise Server 11 (x86_64)，<br />
日志程序默认是syslog-ng。</p>
<p>I. 编辑系统日志服务的配置文件/var/sysconfig/syslog，查看SYSLOG_DAEMON的值，这个值指定了所要使用的日志服务程序，默认为空，表示自动检测，如果不确定，可以显式指定SYSLOG_DAEMON = &#8220;syslog-ng&#8221;。</p>
<p>II. 编辑syslog-ng的配置文件/var/syslog-ng/syslog-ng.conf，在末尾添加如下代码：</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"># for supporting the logging of <span style="color: #933;">&quot;HAProxy&quot;</span>
&nbsp;
source my_src <span style="">&#123;</span>
    #
    # process log messages from network:
    #
    udp<span style="">&#40;</span>ip<span style="">&#40;</span><span style="color: #933;">&quot;0.0.0.0&quot;</span><span style="">&#41;</span> port<span style="">&#40;</span><span style="">514</span><span style="">&#41;</span><span style="">&#41;</span><span style="color: #666666; font-style: italic;">;</span>
<span style="">&#125;</span><span style="color: #666666; font-style: italic;">;</span>
&nbsp;
filter f_local0 <span style="">&#123;</span> facility<span style="">&#40;</span>local0<span style="">&#41;</span><span style="color: #666666; font-style: italic;">; };</span>
filter custom <span style="">&#123;</span> program<span style="">&#40;</span><span style="color: #933;">&quot;haproxy&quot;</span><span style="">&#41;</span><span style="color: #666666; font-style: italic;">; };</span>
&nbsp;
destination d_haproxy <span style="">&#123;</span> file<span style="">&#40;</span><span style="color: #933;">&quot;/var/log/haproxy.log&quot;</span><span style="">&#41;</span><span style="color: #666666; font-style: italic;">; };</span>
&nbsp;
log <span style="">&#123;</span> source<span style="">&#40;</span>my_src<span style="">&#41;</span><span style="color: #666666; font-style: italic;">; filter(f_local0); destination(d_haproxy); };</span>
#log <span style="">&#123;</span> source<span style="">&#40;</span>my_src<span style="">&#41;</span><span style="color: #666666; font-style: italic;">; filter(custom); destination(d_haproxy); };    # OK, work too</span></pre></div></div>

<p>注：这里指定了日志输出到/var/log目录下，工作正常，若指定输出到/home等其他子目录下却会失败，具体原因不详，待查。另，haproxy的日志也可通过此方法将其发送到某个日志服务器用于统一处理，具体可查看syslog-ng的相关文档。</p>
<p>III. 重启syslog服务，使用如下命令：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">service syslog restart</pre></div></div>

<p>IV. 编辑haproxy的配置文件，假定名为haproxy.cfg<br />
在所需要做日志记录的模块（比如，global, default等）添加如下代码：</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"># 使用系统的syslog记录日志（通过udp，默认端口号为<span style="">514</span>）
log 127.0.0.1 local0</pre></div></div>

<p>注：local0 在两个配置文件中的一致。</p>
<p>这会查看日志基本上就OK了。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>haproxy.log</pre></div></div>

<p>注：其他须解决的日志相关问题<br />
a. haproxy当前的日志全部记录在一个文件中，考虑按日期将其分段成不同文件存储；<br />
b. 日志不能输出到除/var/log/外的其他目录</p>
<p><strong>2). 一些常用配置选项的说明</strong></p>
<p>如下是我使用的一个配置文件，常用的选项说明都已经注释了，需要更全面的描述请查阅configuration.txt文件。</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">#########################################################################
# HAProxy 配置文件
#########################################################################
&nbsp;
global
# 使用系统的syslog记录日志（通过udp，默认端口号为<span style="">514</span>）
log 127.0.0.1 local0 # info <span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>err warning info debug<span style="">&#93;</span></span>
chroot /home/bmc/haproxy
&nbsp;
#限制单个进程的最大连接数
maxconn <span style="">65535</span>
&nbsp;
# 让进程在后台运行，即作为守护进程运行，正式运行的时候开启，此处先禁止，等同于在命令行添加参数 -D
# daemon
# 指定作为守护进程运行的时候，要创建多少个进程，默认只创建一个，需要daemon开启模式
# nbproc <span style="">1</span>
&nbsp;
# 设置debug模式运行，与daemon模式只能互斥，等同于在命令行添加参数 -d
# debug
pidfile /home/bmc/haproxy/logs/haproxy.pid    # not work
&nbsp;
defaults
# 在连接失败或断开的情况下，允许当前会话被重新分发
option redispatch
# 设置在一个服务器上链接失败后的重连次数
retries <span style="">2</span>
# 设置服务器分配算法
balance roundrobin
&nbsp;
# 不记录空连接
option dontlognull
&nbsp;
# 设置等待连接到服务器成功的最大时间
timeout connect 5000ms
# 设置客户端的最大超时时间
timeout client 1800000ms
# 设置服务器端的最大超时时间
timeout server 1800000ms
&nbsp;
# Enable the sending of TCP keepalive packets on both sides, clients and servers
# NOTE: 在服务器CPU强劲的情况下，最好不要开启保活，这样可减少资源消耗
#option tcpka
&nbsp;
##############################统计页面配置##################################
&nbsp;
listen admin_stat
# 监听端口
bind *:<span style="">8011</span>
# http的<span style="">7</span>层模式
mode http
option httplog
log global
# 统计页面自动刷新时间
stats refresh 30s
# 统计页面URL
stats uri /admin?stats
# 统计页面密码框上提示文本
stats realm Haproxy\ Statistics
# 统计页面用户名和密码设置
stats auth admin:admin
# 隐藏统计页面上HAProxy的版本信息
stats hide-version
&nbsp;
###########################TCP连接的监听配置################################
&nbsp;
listen  tcp-in
bind *:<span style="">8012</span>
mode tcp
# 日志记录选项
option tcplog
log global
&nbsp;
# 后台服务器
# weight  -- 调节服务器的负重
# check -- 允许对该服务器进行健康检查
# inter  -- 设置连续的两次健康检查之间的时间，单位为毫秒<span style="">&#40;</span>ms<span style="">&#41;</span>，默认值 <span style="">2000</span><span style="">&#40;</span>ms<span style="">&#41;</span>
# rise  -- 指定多少次连续成功的健康检查后，即可认定该服务器处于可操作状态，默认值 <span style="">2</span>
# fall  -- 指定多少次不成功的健康检查后，认为服务器为当掉状态，默认值 <span style="">3</span>
# maxconn  -- 指定可被发送到该服务器的最大并发连接数
server localhost 0.0.0.0:<span style="">9999</span> weight <span style="">3</span> check inter <span style="">2000</span> rise <span style="">2</span> fall <span style="">3</span>
server 211.100.66.6 211.100.66.6:<span style="">9999</span> weight <span style="">3</span> check inter <span style="">2000</span> rise <span style="">2</span> fall <span style="">3</span>
server hyb 203.86.46.51:<span style="">9999</span> weight <span style="">3</span> check inter <span style="">2000</span> rise <span style="">2</span> fall <span style="">3</span>
&nbsp;
#########################HTTP连接的监听配置################################
&nbsp;
listen  http-in
bind *:<span style="">8013</span>
mode http
option httplog
log global
&nbsp;
# 设置健康检查模式
#option httpchk OPTIONS * HTTP/<span style="">1.1</span>\r\nHost:\ www
#option smtpchk
&nbsp;
# 后台服务器
server localhost 0.0.0.0:<span style="">9998</span> weight <span style="">3</span> check inter <span style="">2000</span> rise <span style="">2</span> fall <span style="">3</span>
server 211.100.66.6 211.100.66.6:<span style="">9998</span> weight <span style="">3</span> check inter <span style="">2000</span> rise <span style="">2</span> fall <span style="">3</span>
server hyb 203.86.46.51:<span style="">9998</span> weight <span style="">3</span> check inter <span style="">2000</span> rise <span style="">2</span> fall <span style="">3</span></pre></div></div>

<p>在这个配置文件中，使用了listen块，而没有用frontend和backend。listen块定义了一个完整的代理过程，同时包含了前端的监听套接字和后台的服务器描述，从这个层面考虑，使用frontend和backend，似乎显得条理要清楚点。不过测试发现使用listen块的时候，输出的日志会记录下后台服务器的健康状况，而使用frontend和backend则不会。<br />
对于健康检查，推荐开开启比较好，否则当后台服务器当掉的时候，haproxy将不会将连接重定向到下一个可用的服务器上。</p>
<p>关于属性<br />
pidfile /home/bmc/haproxy/logs/haproxy.pid<br />
暂且还不能正常工作，原因待查。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ehomy.net/archives/153/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>安装SCIM中文输入法</title>
		<link>http://blog.ehomy.net/archives/88</link>
		<comments>http://blog.ehomy.net/archives/88#comments</comments>
		<pubDate>Sat, 06 Sep 2008 05:59:23 +0000</pubDate>
		<dc:creator>Eyoung</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[SCIM]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.ehomy.net/blog/?p=88</guid>
		<description><![CDATA[最近开始学习Linux，现开始一点点的做个笔记。下为在Ubuntu系统中安装SCIM 中文输入法的过程。相较于Windows下的输入法安装，这个过程对一般人来说显然烦了不少，特别是在别人不熟悉的情况下。从这点来看，Linux想要普及大众，还真得再加把劲了。 1. 安装SCIM SCIM 其实只是一个输入法平台。最近发布的Ubuntu系统默认安装完成都已经安装好了SCIM，对于没有安装SCIM的Linux系统，只要输入下面的命令也就可以安装了 sudo apt-get install scim （前提是要设置好安装源地址，具体见http://wiki.ubuntu.org.cn/%E5%BF%AB%E9%80%9F%E8%AE%BE%E7%BD%AE%E6%8C%87%E5%8D%97, 有些高校自己内部也有源的，好好找找） 2. 安装输入法 因为SCIM只是一个输入法平台，还要在上面安装输入法（或者码表）。例如，下面的命令可以安装上智能拼音输入法 sudo apt-get install scim-chinese 如果使用五笔，就要安装scim-tables-zh，命令如下： sudo apt-get install scim-tables-zh 这样同时也安装了二笔，仓颉之类的输入法，可以scim设置中将不用的输入法关闭，将需要用的输入法，如拼音，五笔激活。不然切换时会很辛苦。 3. 修改locale 根据SCIM的文档说明，装SCIM最好用UTF-8的locale。（你也可以使用GB2312以及GBK的locale，使用scim都一样的） 对于装好的系统如果设置语言为中文，则默认SCIM使用的就是UTF-8的locale（这样也才能输入中文）。 如果选择其他的系统语言，则需要修改locale 方法如下： 利用Gedit打开 /etc/environment 文件，命令为： sudo gedit /etc/environment 把LANG = en_US （其他语言不同）改为 LANG=en_US.UTF-8 或者 LANG=zh_CN.UTF-8 4. 配置文件 完成了以上步骤，在使用之前还要先配置一个文件，配置方法很简单，在/etc/X11/Xsession.d/里新建一个名叫95xinput的文件，命令为： sudo gedit /etc/X11/Xsession.d/95xinput 在其中添加如下内容： /usr/bin/scim -d # ?? [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://scim.sourceforge.net/logo/scim_logo_new.jpg" alt="" align="left" />最近开始学习Linux，现开始一点点的做个笔记。下为在Ubuntu系统中安装<a href="http://www.scim-im.org/">SCIM</a> 中文输入法的过程。相较于Windows下的输入法安装，这个过程对一般人来说显然烦了不少，特别是在别人不熟悉的情况下。从这点来看，Linux想要普及大众，还真得再加把劲了。</p>
<p><strong>1. 安装SCIM</strong></p>
<p>SCIM 其实只是一个输入法平台。最近发布的Ubuntu系统默认安装完成都已经安装好了SCIM，对于没有安装SCIM的Linux系统，只要输入下面的命令也就可以安装了</p>
<blockquote><p>sudo apt-get install scim</p></blockquote>
<p>（前提是要设置好安装源地址，具体见http://wiki.ubuntu.org.cn/%E5%BF%AB%E9%80%9F%E8%AE%BE%E7%BD%AE%E6%8C%87%E5%8D%97, 有些高校自己内部也有源的，好好找找）</p>
<p><strong>2. 安装输入法</strong></p>
<p>因为SCIM只是一个输入法平台，还要在上面安装输入法（或者码表）。例如，下面的命令可以安装上智能拼音输入法</p>
<blockquote><p>sudo apt-get install scim-chinese</p></blockquote>
<p>如果使用五笔，就要安装scim-tables-zh，命令如下：</p>
<blockquote><p>sudo apt-get install scim-tables-zh</p></blockquote>
<p>这样同时也安装了二笔，仓颉之类的输入法，可以scim设置中将不用的输入法关闭，将需要用的输入法，如拼音，五笔激活。不然切换时会很辛苦。</p>
<p><strong>3. 修改locale</strong></p>
<p>根据SCIM的文档说明，装SCIM最好用UTF-8的locale。（你也可以使用GB2312以及GBK的locale，使用scim都一样的）<br />
对于装好的系统如果设置语言为中文，则默认SCIM使用的就是UTF-8的locale（这样也才能输入中文）。<br />
如果选择其他的系统语言，则需要修改locale</p>
<p>方法如下：<br />
利用Gedit打开 /etc/environment 文件，命令为：</p>
<blockquote><p>sudo gedit /etc/environment</p></blockquote>
<p>把LANG = en_US （其他语言不同）改为<br />
LANG=en_US.UTF-8 或者 LANG=zh_CN.UTF-8<br />
<span id="more-88"></span><br />
<strong> 4. 配置文件</strong></p>
<p>完成了以上步骤，在使用之前还要先配置一个文件，配置方法很简单，在/etc/X11/Xsession.d/里新建一个名叫95xinput的文件，命令为：</p>
<blockquote><p>sudo gedit /etc/X11/Xsession.d/95xinput</p></blockquote>
<p>在其中添加如下内容：</p>
<blockquote><p>/usr/bin/scim -d        # ??<br />
export XMODIFIERS=@im=SCIM     # 设置应用于所有的X应用程序<br />
export GTK_IM_MODULE=scim    # 设置GTK的默认输入<br />
export QT_IM_MODULE=scim    # 设置QT的默认输入</p></blockquote>
<p>注：建议按以上所示加上最后两行，即使必须的支持可能在你现有的系统中不存在，因为对你的系统并不没有什么影响。</p>
<p>确认内容无误后，保存文件。</p>
<p><strong>5. 重启X Window</strong></p>
<p>方法：退出X后运行exit命令重新login一次，再进入X的时候就可以用Ctrl+Space调出SCIM了，或者直接Ctrl+Alt+Backspace。</p>
<p>补充：<br />
在GTK中使用SCIM</p>
<p>虽然在以上配置中有了对GTK的支持，但想要在GTK中使用还需要安装一个模块scim-gtk2-immodule，命令如下：</p>
<blockquote><p>sudo apt-get install scim-gtk2-immodule</p></blockquote>
<p>（这个命令会根据依赖关系自动安装 scim-server-socket, scim-frontend-socket, scim-config-socket，如果没有安装scim，也会自动安装）</p>
<p>安装后无须重启X，只要重新打开基于GTK的软件就可以使用SCIM了！</p>
<p>参考链接<br />
<a href="http://www.scim-im.org/wiki/documentation/installation_and_configuration/all/system_configuration">http://www.scim-im.org/wiki/docu &#8230; ystem_configuration</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ehomy.net/archives/88/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Just in Works</title>
		<link>http://blog.ehomy.net/archives/64</link>
		<comments>http://blog.ehomy.net/archives/64#comments</comments>
		<pubDate>Tue, 18 Dec 2007 11:39:25 +0000</pubDate>
		<dc:creator>Eyoung</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[MFC]]></category>
		<category><![CDATA[VC]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.ehomy.net/blog/?p=64</guid>
		<description><![CDATA[MFC开发中，利用LoadCursor（该函数有两个，一个是SDK的，一个是类CWinApp中的）来加载光标。 1.使用系统预设的光标： HCURSOR hCursor = ::LoadCursor(NULL, IDC_ARROW); 第一个参数须为NULL。注意，传递IDC_HAND（设置手形的光标）的时候，如果系统是Windows 98/Me, Windows 2000/XP，须在 #include &#60;afxwin.h&#62; 语句前加上 #define WINVER 0&#215;0500 （主要是用来指明所运行的系统类别），方得以成功编译并实现手形光标的加载。 2.使用自定义的光标，假如已在资源中建立ID为 IDC_MYCURSOR 的光标， HCURSOR hCursor = ::LoadCursor(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDC_MYCURSOR)); 据同事及网上的朋友介绍，他们以前这样用基本上都是没问题的。不过在我的程序中，就奇了怪了，获得的hCursor 值一直为空。经测试，AfxGetInstanceHandle() 返回的值正确，下面考虑是不是MAKEINTRESOURCE()这个宏里出了问题，具体有待解决。 替代方案： HCURSOR hCursor = AfxGetApp()-&#62;LoadCursor(IDC_MYCURSOR); // OK, no problem here! 疑惑，这里又有点不明白。按理说，类中的LoadCursor在底层实现的时候还是要调用SDK的LoadCursor&#8230; Next a problem 在网上讨论了一阵，还是没有解决，最后还是冷静地停了下来，仔细地想了想，就这样，也竟然发现了问题的根源。 关于所建资源的ID号，外加引号的问题。经证实，若某个资源ID号的定义并不在该资源文件所包含的头文件中时，系统（这里指VC++6）会自动给该资源ID加上引号。一旦加上引号，貌似有些调用就得修改了，具体情况似乎得具体对待。当然也可以自行加上引号，然后一切按字符串方式传递。 有时觉得自己在钻牛角尖，也经常犹豫，在想这些繁多而琐碎的细节到底值不值得去花时间关注。对于这样的工作，细节的问题不可避免，但一直这样，总觉得难成气候，但如果不去解决，工作就会受阻，总之挺烦人的。 可能是我还没平衡好吧，希望这只是暂时的&#8230; 没有什么是放之四海而皆准的，写程序时也是，最好把各个接口的条件给限制好了，当然也得说明清楚！]]></description>
			<content:encoded><![CDATA[<p>MFC开发中，利用LoadCursor（该函数有两个，一个是SDK的，一个是类CWinApp中的）来加载光标。</p>
<p>1.使用系统预设的光标：</p>
<blockquote><p>    HCURSOR hCursor = ::LoadCursor(NULL, IDC_ARROW);</p></blockquote>
<p>第一个参数须为NULL。注意，传递IDC_HAND（设置手形的光标）的时候，如果系统是Windows 98/Me, Windows 2000/XP，须在 #include &lt;afxwin.h&gt; 语句前加上 #define WINVER 0&#215;0500 （主要是用来指明所运行的系统类别），方得以成功编译并实现手形光标的加载。</p>
<p>2.使用自定义的光标，假如已在资源中建立ID为 IDC_MYCURSOR 的光标，</p>
<blockquote><p>HCURSOR hCursor = ::LoadCursor(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDC_MYCURSOR));</p></blockquote>
<p>据同事及网上的朋友介绍，他们以前这样用基本上都是没问题的。不过在我的程序中，就奇了怪了，获得的hCursor 值一直为空。经测试，AfxGetInstanceHandle()  返回的值正确，下面考虑是不是MAKEINTRESOURCE()这个宏里出了问题，具体有待解决。</p>
<p>替代方案：</p>
<blockquote><p>HCURSOR hCursor = AfxGetApp()-&gt;LoadCursor(IDC_MYCURSOR);    // OK, no problem here!</p></blockquote>
<p>疑惑，这里又有点不明白。按理说，类中的LoadCursor在底层实现的时候还是要调用SDK的LoadCursor&#8230;</p>
<p>Next a problem<br />
在网上讨论了一阵，还是没有解决，最后还是冷静地停了下来，仔细地想了想，就这样，也竟然发现了问题的根源。</p>
<blockquote><p>关于所建资源的ID号，外加引号的问题。经证实，若某个资源ID号的定义并不在该资源文件所包含的头文件中时，系统（这里指VC++6）会自动给该资源ID加上引号。一旦加上引号，貌似有些调用就得修改了，具体情况似乎得具体对待。当然也可以自行加上引号，然后一切按字符串方式传递。</p></blockquote>
<p>有时觉得自己在钻牛角尖，也经常犹豫，在想这些繁多而琐碎的细节到底值不值得去花时间关注。对于这样的工作，细节的问题不可避免，但一直这样，总觉得难成气候，但如果不去解决，工作就会受阻，总之挺烦人的。<br />
可能是我还没平衡好吧，希望这只是暂时的&#8230;</p>
<p>没有什么是放之四海而皆准的，写程序时也是，最好把各个接口的条件给限制好了，当然也得说明清楚！</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ehomy.net/archives/64/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IT面试十大忌讳</title>
		<link>http://blog.ehomy.net/archives/36</link>
		<comments>http://blog.ehomy.net/archives/36#comments</comments>
		<pubDate>Thu, 05 Apr 2007 07:07:08 +0000</pubDate>
		<dc:creator>Eyoung</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.ehomy.net/blog/?p=36</guid>
		<description><![CDATA[最近在准备找工作，网上看到的一篇有关面试的文章。这年头，IT方面工作不好找，所以面试的时候可能就更得注意些了。希望能找到一份满意的工作。 Late to the interview means late on projects and deadlines 面试迟到不仅是礼貌问题，更重要的是会让面试官觉得你将来不可能按时完成工作。 Lack of enthusiasm means you don&#8217;t care about your work 面试的时候要表现出对此工作的热情，而不是我不愿意干这个，不愿意干那个。 Little to no company knowledge means you lack research skills 知己知彼百战不殆，面试前要做好功课，对这个公司多了解一点你的胜算就增加一点。 Inappropriate dress translates to inappropriate work 面试衣着不要走极端，要跟公司文化符合，最好面试前能去看一眼这个公司员工的着装，给自己一个参考。还要注意一点的是，有些IT精英面试的时候上身穿的很整洁，结果桌子下面却是破旧的牛仔和&#8221;锃亮&#8221;的皮鞋。 Too negative is too much: Spells P-R-O-B-L-E-M 不管你现在工作如何糟糕，现在环境如何恶劣，都不要在面试中表现出过分的消极和过度的抱怨，因为这样会给人以“问题雇员”的印象。 Arrogance or dominating the interview signals [...]]]></description>
			<content:encoded><![CDATA[<p>最近在准备找工作，网上看到的一篇有关面试的文章。这年头，IT方面工作不好找，所以面试的时候可能就更得注意些了。希望能找到一份满意的工作。</p>
<ol>
<li><strong>Late to the interview means late on projects and deadlines</strong><br />
面试迟到不仅是礼貌问题，更重要的是会让面试官觉得你将来不可能按时完成工作。</li>
<li><strong>Lack of enthusiasm means you don&#8217;t care about your work</strong><br />
面试的时候要表现出对此工作的热情，而不是我不愿意干这个，不愿意干那个。</li>
<li><strong>Little to no company knowledge means you lack research skills</strong><br />
知己知彼百战不殆，面试前要做好功课，对这个公司多了解一点你的胜算就增加一点。</li>
<li><strong>Inappropriate dress translates to inappropriate work</strong><br />
面试衣着不要走极端，要跟公司文化符合，最好面试前能去看一眼这个公司员工的着装，给自己一个参考。还要注意一点的是，有些IT精英面试的时候上身穿的很整洁，结果桌子下面却是破旧的牛仔和&#8221;锃亮&#8221;的皮鞋。</li>
<li><strong>Too negative is too much: Spells P-R-O-B-L-E-M</strong><br />
不管你现在工作如何糟糕，现在环境如何恶劣，都不要在面试中表现出过分的消极和过度的抱怨，因为这样会给人以“问题雇员”的印象。<span id="more-36"></span></li>
<li><strong>Arrogance or dominating the interview signals conflict on teams</strong><br />
面试表现出自信是应该的，但是走向极端的自信就变成了自大，要记住你是来面试的，保持专业的态度很重要。</li>
<li><strong>Too quiet means you lack confidence in your work</strong><br />
一个人钻在小黑屋编程的时代已经过去了，现在需要的是商业敏感和技术卓越，在面试中要表现的适当外向，毕竟将来你要跟客户交流。另外面试中和面试官的眼神交流也是很重要的。</li>
<li><strong>Misstating qualifications means, well, you&#8217;re a liar</strong><br />
你简历中提到的所有技能和资历都要诚实，不要夸大，比如你只懂Java Script就声称自己有Java经验等，如果被揭穿的话，后果就不用说了。</li>
<li><strong>Speaking only tech-ese means you won&#8217;t work well with others</strong><br />
不要处处卖弄术语来显示你的专业，要学会使自己说话方式灵活，能被不同类型的人接受，从人力资源到CTO，因为你将来面对的最终客户也是不同类型的。</li>
<li><strong>Not saying thank you is not welcome</strong><br />
要记得面试结束后写一封感谢信，毕竟就是一个email的问题，不过要记得拼写检查一下哦。有位面试官说一个面试者给其很深的印象是因为他不但写了感谢信，而且在感谢信中把面试中觉得回答的不好的问题又回答了一遍，这招你也可以借鉴一下。</li>
</ol>
<p>Translate by <a href="http://neoshi.dreamz.org">neoshi</a> From <a href="http://www.eweek.com/article2/0,1895,2011140,00.asp">10 Avoidable IT Interview Flubs</a> in Eweek</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ehomy.net/archives/36/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>22 Ways to Overclock Your Brain</title>
		<link>http://blog.ehomy.net/archives/10</link>
		<comments>http://blog.ehomy.net/archives/10#comments</comments>
		<pubDate>Tue, 23 Jan 2007 15:58:14 +0000</pubDate>
		<dc:creator>Eyoung</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[health]]></category>

		<guid isPermaLink="false">http://www.ehomy.net/blog/?p=10</guid>
		<description><![CDATA[&#8220;I just found out that the brain is like a computer. If that’s true, then there really aren’t any stupid people. Just people running DOS.&#8221; - Anonymous The brain is a three-pound supercomputer. It is the command and control center running your life. It is involved in absolutely everything you do. Your brain determines how [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>&#8220;I just found out that the brain is like a computer. If that’s true, then there really aren’t any stupid people. Just people running DOS.&#8221;</p>
<p align="right">- Anonymous</p>
</blockquote>
<p>The brain is a three-pound supercomputer. It is the command and control center running your life. It is involved in absolutely everything you do. Your brain determines how you think, how you feel, how you act, and how well you get along with other people. Your brain even determines the kind of person you are. It determines how thoughtful you are; how polite or how rude you are. It determines how well you think on your feet, and it is involved with how well you do at work and with your family. Your brain also influences your emotional well being and how well you do with the opposite sex.</p>
<p><img src="http://68.142.214.43/100/287575341_c5714052e0_m.jpg" alt="Brain Power" align="right" />Your brain is more complicated than any computer we can imagine. Did you know that you have one hundred billion nerve cells in your brain, and every nerve cell has many connections to other nerve cells? In fact, your brain has more connections in it than there are stars in the universe! Optimizing your brain’s function is essential to being the best you can be, whether at work, in leisure, or in your relationships.</p>
<p>It’s simple, your brain is at the center of everything you do, all you feel and think, and every nuance of how you relate to people. It’s both the supercomputer that runs your complex life and the tender organ that houses your soul. And while you may run, lift weights, or do yoga to keep your body in good condition, chances are you ignore your brain and trust it to do its job.</p>
<p>No matter what your age, mental exercise has a global, positive effect on the brain. So, here are 22 ways to boost your brain power:<span id="more-10"></span></p>
<p><strong>1. Run Up Your Brain Cells</strong></p>
<blockquote><p>Research suggests that people who get plenty of physical exercise can wind up with better brains. Scientists at the Salk Institute for Biological Studies in La Jolla, Calif., found that adult mice who ran on an exercise wheel whenever they felt like it gained twice as many new cells in the hippocampus, an area of the brain involved in learning and memory, than mice who sat around all day discussing Lord of the Rings in Internet chat rooms. The researchers weren’t sure why the more active rodents’ brains reacted the way they did, but it’s possible that the voluntary nature of the exercise made it less stressful and therefore more beneficial. Which could mean that finding ways to enjoy exercise, rather than just forcing yourself to do it, may make you smarter &#8211; and happier, too.</p>
<p>So, play a sport, train for an event such as a marathon, triathlon or “fun run,” or work out with a buddy to help keep things interesting.</p></blockquote>
<p><strong>2. Exercise Your Mind</strong></p>
<blockquote><p>It isn’t just physical exercise that gets those brain cells jumping. Just like those head-pumped cabbies and piano jockeys, you can build up various areas of your brain by putting them to work. Duke University neurobiology professor Lawrence C. Katz, Ph.D., co-author of <a href="http://www.amazon.com/exec/obidos/ASIN/0761110526/theririanproj-20/" onclick="javascript:urchinTracker('/outbound/www.amazon.com');"><font color="#da1071">Keep Your Brain Alive</font></a>, says that finding simple ways to use aspects of your brain that may be lagging could help maintain both nerve cells and dendrites, branches on the cells that receive and process information. Just as a new weightlifting exercise builds up underused muscles, Katz says that novel ways of thinking and viewing the world can improve the functioning of inactive sections of the brain.</p>
<p>Experience new tastes and smells; try to do things with your nondominant hand; find new ways to drive to work; travel to new places; create art; read that Dostoyevsky novel; write a buddy comedy for Ted Kennedy and Rush Limbaugh &#8211; basically, do anything you can to force yourself out of your mental ruts.</p></blockquote>
<p><strong>3. Ask Why</strong></p>
<blockquote><p>Our brains are wired to be curious. As we grow up and “mature” many of us stifle or deny our natural curiosity. Let yourself be curious! Wonder to yourself about why things are happening. Ask someone in the know. The best way to exercise our curiosity is by asking “Why?” Make it a new habit to ask “why?” at least 10 times a day. Your brain will be happier and you will be amazed at how many opportunities and solutions will show up in your life and work.</p></blockquote>
<p><strong>4. Laugh</strong></p>
<blockquote><p>Scientists tell us that laughter is good for our health; that it releases endorphins and other positively powerful chemicals into our system. We don’t really need scientists to tell us that it feels good to laugh. Laughing helps us reduce stress and break old patterns too. So laughter can be like a “quick-charge” for our brain’s batteries. <a href="http://ririanproject.com/2006/09/18/10-reasons-why-you-should-smile-more-often/"><font color="#da1071">Laugh more, and laugh harder</font></a>.</p></blockquote>
<p><strong>5. Be A Fish Head</strong></p>
<blockquote><p>Omega-3 oils, found in walnuts, flaxseed and especially fish, have long been touted as being healthy for the heart. But recent research suggests they’re a brain booster as well, and not just because they help the circulation system that pumps oxygen to your head. They also seem to improve the function of the membranes that surround brain cells, which may be why people who consume a lot of fish are less likely to suffer depression, dementia, even attention-deficit disorder. Scientists have noted that essential fatty acids are necessary for proper brain development in children, and they’re now being added to baby formulas. It’s possible that your own mental state, and even your intelligence, can be enhanced by consuming enough of these oils.</p>
<p>Eating at least three servings a week of fish such as salmon, sardines, mackerel and tuna is a good start.</p></blockquote>
<p><strong>6. Remember</strong></p>
<blockquote><p>Get out an old photo album or high school yearbook. Your brain is a memory machine, so give it a chance to work! Spend time with your memories. Let your mind reflect on them and your mind will repay you in positive emotions and new connections from the memories to help you with your current tasks and challenges.</p></blockquote>
<p><strong>7. Cut The Fat</strong></p>
<blockquote><p>Can “bad” fats make you dumb? When researchers at the University of Toronto put rats on a 40-percent-fat diet, the rats lost ground in several areas of mental function, including memory, spatial awareness and rule learning. The problems became worse with a diet high in saturated fats, the kind that’s abundant in meat and dairy products. While you may never be called upon to navigate a little maze in search of a cheddar cube, these results could hold true for you as well, for two reasons: Fat can reduce the flow of oxygen-rich blood to your brain, and it may also slow down the metabolism of glucose, the form of sugar the brain utilizes as food.</p>
<p>You can still get up to 30 percent of your daily calories in the form of fat, but most of it should come from the aforementioned fish, olive oil, nuts and seeds. Whatever you do, stay away from trans fats, the hardened oils that are abundant in crackers and snack foods.</p></blockquote>
<p><strong>8. Do A Puzzle</strong></p>
<blockquote><p>Some of us like jigsaw puzzles, some crossword puzzles, some logic puzzles &#8211; it really doesn’t matter kind you choose to do. Doing puzzles in your free time is a great way to activate your brain and keep it in good working condition. Do the puzzle for fun, but do it knowing you are exercising your brain.</p></blockquote>
<p><strong>9. The Mozart Effect</strong></p>
<blockquote><p>A decade ago Frances Rauscher, a psychologist now at the University of Wisconsin at Oshkosh, and her colleagues made waves with the discovery that listening to Mozart improved people’s mathematical and spatial reasoning. Even rats ran mazes faster and more accurately after hearing Mozart than after white noise or music by the minimalist composer Philip Glass. Last year, Rauscher reported that, for rats at least, a Mozart piano sonata seems to stimulate activity in three genes involved in nerve-cell signalling in the brain.</p>
<p>This sounds like the most harmonious way to tune up your mental faculties. But before you grab the CDs, hear this note of caution. Not everyone who has looked for the Mozart effect has found it. What’s more, even its proponents tend to think that music boosts brain power simply because it makes listeners feel better &#8211; relaxed and stimulated at the same time &#8211; and that a comparable stimulus might do just as well. In fact, one study found that listening to a story gave a similar performance boost.</p></blockquote>
<p><strong>10. Improve Your Skill At Things You Already Do</strong></p>
<blockquote><p>Some repetitive mental stimulation is ok as long as you look to expand your skills and knowledge base. Common activities such as gardening, sewing, playing bridge, reading, painting, and doing crossword puzzles have value, but push yourself to do different gardening techniques, more complex sewing patterns, play bridge against more talented players to increase your skill, read new authors on varied subjects, learn a new painting technique, and work harder crossword puzzles. Pushing your brain to new heights help to keep it healthy.</p></blockquote>
<p><strong>11. Be A Thinker, Not A Drinker</strong></p>
<blockquote><p>The idea that alcohol kills brain cells is an old one, but the reality is a bit more complicated. In fact, a study of 3,500 Japanese men found that those who drank moderately (in this case, about one drink per day) had better cognitive functioning when they got older than those who didn’t drink at all. Unfortunately, as soon as you get beyond that “moderate” amount, your memory, reaction time is all likely to decline. In the same study, men who had four or more drinks a day fared worst of all.</p>
<p>Just as bad is the now common practice of “binge drinking,” otherwise known as getting hammered on the weekend. Research on rats found that those who consumed large amounts of alcohol had fewer new cells in their brains’ hippocampus region immediately after the binge, and virtually none a month later. This suggests that the alcohol not only damaged the rats’ brains, but kept them from repairing themselves later on &#8211; in human terms, that means you shouldn’t expect to pass the Mensa entrance exam any time soon.</p></blockquote>
<p><strong>12. Play</strong></p>
<blockquote><p>Take time to play. Make time to play. Play cards. Play video games. Play board games. Play Ring Around the Rosie. Play tug of war. It doesn’t matter what you play. Just play! It is good for your spirit and good for your brain. It gives your brain a chance to think strategically, and keeps it working.</p></blockquote>
<p><strong>13. Sleep On It</strong></p>
<blockquote><p>Previewing key information and then sleeping on it increases retention 20 to 30 percent. You can leave that information next to the bed for easy access, if it is something that won’t keep you awake. If you are kept awake by your thoughts, writing everything down sometimes gets it “out of your mind,” allowing you to sleep (so keep a pen and paper nearby).</p></blockquote>
<p><strong>14. Concentration</strong></p>
<blockquote><p>Concentration can increase brainpower. Obvious, perhaps, but the thieves of concentration are not always so obvious. Learn to notice when you are distracted. Often the cause is just below consciousness. If there is a phone call you need to make, for example, it might bother you all morning, sapping your ability to think clearly, even while you are unaware of what is bothering you.</p>
<p>Get in the habit of stopping to ask “What is on my mind right now”. Identify it and deal with it. In the example given, you could make the phone call, or put it on tomorrow’s list, so your mind is comfortable letting it go for now. This leaves you in a more relaxed state where you can think more clearly. Use this technique to increase your brainpower now.</p></blockquote>
<p><strong>15. Make Love For Your Brain</strong></p>
<blockquote><p>In a series of studies by Winnifred B. Cutler, PhD and colleagues at the University of Pennsylvania and later at Stanford University it was found that regular sexual contact had an important impact on physical and emotional well being of women. Sexual contact with a partner at least once a week led to more fertile, regular menstrual cycles, shorter menses, delayed menopause, increased estrogen levels, and delayed aging. Brain imaging studies at UCLA have shown that decreased estrogen levels are associated with overall decreased brain activity and poor memory. Enhancing estrogen levels for women through regular sexual activity enhances overall brain activity and improves memory.</p>
<p>In Dr. Cutler’s study the occurrence of orgasm was not as important as the fact that sex was with another person. Intimacy and emotional bonding may be the most influential factors in the positive aspects of sex. As a psychiatrist I have seen many people withhold sex as a way to show hurt, anger, or disappointment. Dr. Cutler’s research suggests that this is self-defeating behavior. The more you withhold the worse it may be for you. Appropriate sex is one of the keys to the brain’s fountain of youth.</p></blockquote>
<p><strong>16. Play With Passion!</strong></p>
<blockquote><p>You can’t do great work without personal fulfillment. When people are growing through learning and creativity, they are much more fulfilled and give 127% more to their work. Delight yourself and you delight the world. Remember what you loved to do as a child and bring the essence of that activity into your work. This is a clue to your genius; to your natural gifts and talents. da Vinci, Edison, Einstein and Picasso all loved to play and they loved to explore.</p></blockquote>
<p><strong>17. Cycles Of Consciousness</strong></p>
<blockquote><p>Your consciousness waxes and wanes throughout the day . For most it seems to go through 90 minute cycles, with 30 minutes of lower consciousness. Watch yourself to recognize this cycle. If you learn to recognize and track your mental state, you can concentrate on important mental tasks when your mind is most “awake”. For creative insight into a problem, do the opposite. Work on it when you are in a drowsy state, when your conscious mind has slowed down.</p></blockquote>
<p><strong>18. Learn Something New</strong></p>
<blockquote><p>This one might seem obvious. Yes, we capitalize on our brain’s great potential when we put it to work learning new things. You may have a specific topic for work or leisure that you want to learn more about. That’s great.</p>
<p>Go learn it. If you don’t have a subject in mind right now, try learning a new word each day. There is a strong correlation between working vocabulary and intelligence. When we have new words in our vocabulary, our minds can think in new ways with greater nuances between ideas. Put your mind to work learning. It is one of the best ways to re-energize your brain.</p></blockquote>
<p><strong>19. Write To Be Read</strong></p>
<blockquote><p>I am a big proponent of <a href="http://ririanproject.com/2006/09/22/10-reasons-to-keep-a-journal/"><font color="#da1071">writing in a journal to capture ideas and thoughts</font></a>. There is certainly great value in writing for yourself. I continue to find that my brain is greatly stimulated by writing to be read. The greatest benefit of writing is what it does to expand your brain’s capacity. Find ways to write to be read – by writing things for your friends to read, by capturing the stories of your childhood, starting your own blog or whatever – just write to be read.</p></blockquote>
<p><strong>20. Try Aroma Therapy To Activate Your Brain</strong></p>
<blockquote><p>One day, as I was falling asleep, while listening to endless speeches at a conference, my brain suddenly perked up when I caught a whiff of lemon from someone’s cologne. I immediately felt alert and found it much easier to pay attention to the presenter. I discovered aroma therapy really is useful and I have used it ever since revitalize or to relax.</p>
<p>Energizers include peppermint, cypress and lemon. Relaxants: ylang ylang, geranium and rose. A few drops of essential oils in your bath or in a diffuser will do the trick. You can also put a drop or two in a cotton ball or hanky and inhale. One caveat for the workplace; make sure no-one is allergic to the oils before you use them.</p></blockquote>
<p><strong>21. Drugs To Increase Brainpower</strong></p>
<blockquote><p>Coffee and other drinks containing caffeine help students consistently score higher on tests. Since caffeine restricts blood vessels in the brain, it isn’t clear what the longer-term effects may be when it comes to your brainpower. So instead of coffee breaks try gingko biloba and gotu kola herbal teas. Ginkgo biloba has been shown to increase blood flow to the brain, and improve concentration.</p></blockquote>
<p><strong>22. Build A Brain Trust</strong></p>
<blockquote><p>Surround yourself with inspiring people from a wide variety of fields who encourage you and stimulate your creativity. Read magazines from a wide variety of fields. Make connections between people, places and things, to discover new opportunities, and to find solutions to your problems.</p></blockquote>
<p>Remember that no matter what your age or your occupation; your brain needs to be constantly challenged to be at its peak in terms of performance. Whether it’s doing logic puzzles, memorizing lines from Shakespeare, or learning a new skill, <strong>keep your brain busy</strong>, if you don’t want it to rust away like a car in a junkyard.</p>
<p>PS:This article is from <a href="http://ririanproject.com/2006/11/03/22-ways-to-overclok-your-brain/" target="_blank">ririanproject</a>, only for the knowledge and English Learning!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ehomy.net/archives/10/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://www.54tk.com/files/97304.mp3" length="0" type="video/x-ms-wma" />
<enclosure url="http://bbs.21www.net.cn/music/mp3/1167706035_217685%5B1%5D.mp3" length="10727707" type="audio/mpeg" />
		</item>
	</channel>
</rss>
