<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-19452600</id><updated>2012-02-16T15:08:47.452-08:00</updated><category term='finance stock'/><title type='text'>pipehappy</title><subtitle type='html'>Remember everyday, otherwise you never grow.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>48</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-19452600.post-3489935137885380018</id><published>2012-01-03T22:07:00.001-08:00</published><updated>2012-01-21T10:05:14.056-08:00</updated><title type='text'>machine learning tricks</title><content type='html'>&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Never use coordinate descent, use something like BFGS.&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-3489935137885380018?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/3489935137885380018/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=3489935137885380018' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/3489935137885380018'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/3489935137885380018'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2012/01/machine-learning-tricks.html' title='machine learning tricks'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-5471322997834622767</id><published>2011-12-28T14:16:00.000-08:00</published><updated>2011-12-31T12:26:34.318-08:00</updated><title type='text'>Mahout from zero</title><content type='html'>Mahout is the tools for machine learning built on Hadoop.&lt;br /&gt;&lt;br /&gt;--SequenceFile&lt;br /&gt;Hadoop is based on distributed Hash table and key for a hash is the key and value. And&amp;nbsp;SequenceFile is the&amp;nbsp;persistent&amp;nbsp;format to store this key and value pairs. As we may expect, Hadoop use&amp;nbsp;SequenceFile to store intermediate result. We never directly interact with&amp;nbsp;SequenceFile but use the &lt;a href="http://hadoop.apache.org/common/docs/current/api/org/apache/hadoop/io/SequenceFile.html" target="_blank"&gt;interface&lt;/a&gt;. There are reader, writer and sorter for the&amp;nbsp;SequenceFile&amp;nbsp;class. We never use writer directly but use the &lt;a href="http://hadoop.apache.org/common/docs/current/api/org/apache/hadoop/io/SequenceFile.html#createWriter(org.apache.hadoop.fs.FileSystem, org.apache.hadoop.conf.Configuration, org.apache.hadoop.fs.Path, java.lang.Class, java.lang.Class)" target="_blank"&gt;createWriter&lt;/a&gt;&amp;nbsp;to get the proper writer.&lt;br /&gt;&lt;br /&gt;--Mahout Vector&lt;br /&gt;Sometimes a vector is often used to represent a recode in real application. But anyway. &lt;a href="http://search-lucene.com/jd/mahout/math/org/apache/mahout/math/Vector.html" target="_blank"&gt;Vector&lt;/a&gt;&amp;nbsp;is the input format for most Mahout algorithms. There are two kinds of vector implementation, of course, &lt;a href="http://search-lucene.com/jd/mahout/math/org/apache/mahout/math/DenseVector.html" target="_blank"&gt;dense&lt;/a&gt; and sparse (including &lt;a href="http://search-lucene.com/jd/mahout/math/org/apache/mahout/math/RandomAccessSparseVector.html" target="_blank"&gt;random access&lt;/a&gt; and &lt;a href="http://search-lucene.com/jd/mahout/math/org/apache/mahout/math/SequentialAccessSparseVector.html" target="_blank"&gt;sequential access&lt;/a&gt;). So the idea is that no matter where we get our data and whats the format of the data, we have to convert data into Mahout vector format. Note that vector in Mahout is always float number. To store vector in SequenceFile for Mahout use, the key is the record id (row number, text id, you name it) and the value is the Mahout vector.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-5471322997834622767?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/5471322997834622767/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=5471322997834622767' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/5471322997834622767'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/5471322997834622767'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2011/12/mahout-from-zero.html' title='Mahout from zero'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-7163277205877846696</id><published>2011-12-28T12:48:00.000-08:00</published><updated>2011-12-28T12:48:53.728-08:00</updated><title type='text'>ssh tricks</title><content type='html'>1. To login without typing password, add client's id_rsa.pub to server's authorized_keys. Both under .ssh/&lt;br /&gt;2. To avoid ssh timeout, add two lines:&amp;nbsp;ServerAliveInterval 20 and&amp;nbsp;ServerAliveCountMax 100 to .ssh/config&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-7163277205877846696?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/7163277205877846696/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=7163277205877846696' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/7163277205877846696'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/7163277205877846696'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2011/12/ssh-tricks.html' title='ssh tricks'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-552686439364486115</id><published>2011-12-25T18:53:00.000-08:00</published><updated>2011-12-31T16:37:23.910-08:00</updated><title type='text'>Java Programming in one shot</title><content type='html'>Here is the place we can learn Java programming besides the language itself. Topics like, how to compile, run the program; how to unit test; how to write a makefile for your Java project will be covered here.&lt;br /&gt;&lt;br /&gt;----How to compile and run your Java program?&lt;br /&gt;Every programming language starts with HelloWorld examples. As far as I read it starts from "C Programming Language". Here is our version:&lt;br /&gt;&lt;br /&gt;HelloWorld.java:&lt;br /&gt;&lt;span style="background-color: #b6d7a8;"&gt;public class HelloWorld {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #b6d7a8;"&gt;&amp;nbsp; &amp;nbsp; public static void main(String[] args) {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #b6d7a8;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println("Hello World");&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #b6d7a8;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #b6d7a8;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #b6d7a8;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: white;"&gt;In the command line, you type:&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #9fc5e8;"&gt;bash$ javac HelloWorld.java&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: white;"&gt;to compile the java program and type:&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #9fc5e8;"&gt;bash$ java HelloWorld&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: white;"&gt;to see the result&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: white;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: white;"&gt;There are some alternatives to these commands we just see. For example, in gcc system, you may use &lt;/span&gt;&lt;span style="background-color: #9fc5e8;"&gt;gcj -C&lt;/span&gt;&lt;span style="background-color: white;"&gt;&amp;nbsp;and you may use &lt;/span&gt;&lt;span style="background-color: #9fc5e8;"&gt;java -jar&lt;/span&gt;&lt;span style="background-color: white;"&gt; to run a jar file.&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: white;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: white;"&gt;----How to write build file for Java project?&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: white;"&gt;When our Java project grows larger and larger, we may think put our source code into a directory tree and have build content in a separate place. Similar to make/Makefile build system, Ant build system for Java is the choice and lucky enough, it's included in the JDK. Instead of having Makefile, usually we have build.xml (Note that build file in Ant is written in XML. Ant has default to read build.xml as the build file. If you in case you want to use another build file name, use &lt;/span&gt;&lt;span style="background-color: #9fc5e8;"&gt;ant -buildfile&lt;/span&gt;&lt;span style="background-color: white;"&gt; option, or simply as &lt;/span&gt;&lt;span style="background-color: #9fc5e8;"&gt;ant -file&lt;/span&gt;&lt;span style="background-color: white;"&gt;|&lt;/span&gt;&lt;span style="background-color: #9fc5e8;"&gt;ant -f&lt;/span&gt;&lt;span style="background-color: white;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: white;"&gt;as the file for Ant. And like make/Makefile, you call on a task like: &lt;/span&gt;&lt;span style="background-color: #9fc5e8;"&gt;ant build&lt;/span&gt;&lt;span style="background-color: white;"&gt; if we have a target named build.&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: white;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: white;"&gt;Every build.xml should have one project elements, so we can start our build.xml like this:&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #b6d7a8;"&gt;&amp;lt;project basedir="." default="clean" name="HelloWorld"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #b6d7a8;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &amp;lt;target name="clean"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #b6d7a8;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        &amp;lt;delete dir="build"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #b6d7a8;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &amp;lt;/target&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #b6d7a8;"&gt;&amp;lt;/project&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: white;"&gt;We can see that there are 3 attributes for project, all of them are optional and their meaning is self-explained.&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: white;"&gt;This short build file also gives us clue about the structure of it.&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: white;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: white;"&gt;&amp;nbsp; --What's the structure of Ant build file?&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: white;"&gt;Since Ant build file use XML, we expect the tree structure. The top level is the project elements, the second level is the target elements and under target elements there are task elements. You can write your &lt;a href="http://ant.apache.org/manual/develop.html#writingowntask" target="_blank"&gt;own task elements&lt;/a&gt; or use &lt;a href="http://ant.apache.org/manual/tasklist.html" target="_blank"&gt;built-in ones&lt;/a&gt;. Besides these elements, people usually use property elements to refer to directory and property elements usually put under project elements along with targets.&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: white;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="background-color: white;"&gt;Using property to define directory to use is a common practice when write build file for Ant. For example, we can add following lines to the build file we already have:&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #b6d7a8;"&gt;&amp;lt;project ...&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #b6d7a8;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    ...&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #b6d7a8;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &amp;lt;property name="src.dir" value="src"/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #b6d7a8;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &amp;lt;property name="build.dir" value="build"/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #b6d7a8;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &amp;lt;property name="classes.dir" value="${build.dir}/classes"/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #b6d7a8;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &amp;lt;property name="jar.dir" value="${build.dir}/jar"/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #b6d7a8;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    ...&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #b6d7a8;"&gt;&amp;lt;/project&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: white;"&gt;The reason here is these directory may be used several times and you don't want to&amp;nbsp;hard code them. Problem can always be easier if we add another layer.&amp;nbsp;So we set property and use them later in targets. You can look up Web to check how to use &lt;a href="http://ant.apache.org/manual/Tasks/property.html" target="_blank"&gt;property&lt;/a&gt; and a list of &lt;a href="http://ant.apache.org/manual/properties.html" target="_blank"&gt;built-in property&lt;/a&gt;. Instead of using general property, you can also use path.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; --&amp;lt;path&amp;gt; or &amp;lt;pathelement&amp;gt;?&lt;br /&gt;path property usually stays at the same level as other property and can be composed of pathelements. While pathelement are usually component of other task, like classpath.&lt;br /&gt;&lt;br /&gt;To compile our Java project, we need include some jar files in classpath. We don't usually change CLASSPATH environment variable, since we prefer to have different classpath for each project. For compile process, javac task has parameter classpath, which we need to have a directory as its argument; or javac also has classpathref, which we can have a id contains path structure. For execution, java task usually have nested classpath elements composed of path structure.&lt;br /&gt;&lt;br /&gt;&amp;nbsp; --Wildcard in Ant?&lt;br /&gt;There are 3 wildcard in Ant: ?, * and **. ? is used least frequently as it matches any single character; * matches zero or more character, it's often used for wildcard of file names; ** is the wildcard for directory.&lt;br /&gt;&lt;br /&gt;----How to build unit test for Java project?&lt;br /&gt;Java has its default unit test framework JUnit.&lt;br /&gt;&lt;br /&gt;----Maven, more than Ant&lt;br /&gt;Maven is a project management system, including functions provided by Ant.&lt;br /&gt;&lt;span style="background-color: white;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-552686439364486115?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/552686439364486115/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=552686439364486115' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/552686439364486115'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/552686439364486115'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2011/12/java-programming-in-one-shot.html' title='Java Programming in one shot'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-1324440517540850897</id><published>2011-12-23T11:56:00.000-08:00</published><updated>2011-12-30T21:50:45.987-08:00</updated><title type='text'>Hadoop Facts: pros and cons</title><content type='html'>Hadoop Facts (for 0.20.2):&lt;br /&gt;&lt;br /&gt;This is the facts when I learn to use Hadoop. Some item is obvious but it's still good for hadoop learner.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Try to find what configuration you have? look at&amp;nbsp;&lt;a href="http://hadoop.apache.org/common/docs/current/core-default.html"&gt;http://hadoop.apache.org/common/docs/current/core-default.html&lt;/a&gt;,&amp;nbsp;&lt;a href="http://hadoop.apache.org/common/docs/current/hdfs-default.html"&gt;http://hadoop.apache.org/common/docs/current/hdfs-default.html&lt;/a&gt;,&amp;nbsp;&lt;a href="http://hadoop.apache.org/common/docs/current/mapred-default.html"&gt;http://hadoop.apache.org/common/docs/current/mapred-default.html&lt;/a&gt;&amp;nbsp;They are&amp;nbsp;corresponding&amp;nbsp;to core-site.xml, hdfs-site.xml and mapred-site.xml&lt;/li&gt;&lt;li&gt;Don't try to run multiple datanode/tasktracker on one machine. Hadoop will try to run multiple task&amp;nbsp;simultaneously. Look for&amp;nbsp;&lt;span style="background-color: white; font-family: Verdana, Helvetica, sans-serif; font-size: 13px;"&gt;mapred.tasktracker.{map|reduce}.tasks.maximum&lt;/span&gt;in&amp;nbsp;&lt;span style="background-color: white; font-family: 'Courier New', Courier, monospace; font-size: 14px; line-height: 15px; text-align: left;"&gt;conf/mapred-site.xml.&amp;nbsp;&lt;/span&gt;&amp;nbsp;That's the place to increase the number of parallel task if you think your machine is powerful enough.&lt;/li&gt;&lt;li&gt;If you don't want to try out HDFS but to use local file system. Use file:/// for fs.default.name in core-site.xml&lt;/li&gt;&lt;li&gt;HDFS and MapReduce is two components in Hadoop, you can try out them separately.&lt;/li&gt;&lt;li&gt;Be aware of zombie process when your namenode/jobtracker get killed by accident. All datanode/tasktracker will be zombie as there is no way to kill them all (otherwise you write some in-house script).&lt;/li&gt;&lt;li&gt;Hadoop log files are huge. Well, not that huge but definitely it's not for human reading. Change it by looking into hadoop-env.sh to alter HADOOP_LOG_DIR.&lt;/li&gt;&lt;li&gt;Who is the jobtracker/namenode? Usually it's determined by the machine where you run bin/start-all.sh&amp;nbsp;&lt;/li&gt;&lt;li&gt;bin/masters is NOT the place you put namenode/jobtracker. Instead, it's the place you tell Hadoop where should it starts secondarynamenode.&amp;nbsp;&lt;/li&gt;&lt;li&gt;No matter how the configuration file is organized in conf/. Hadoop always read all the XML files and get the configuration. (I haven't test this yet.)&lt;/li&gt;&lt;li&gt;Wondering the number of map jobs? "&lt;span style="background-color: white; font-family: Verdana, Helvetica, sans-serif; font-size: 13px; line-height: 15px; text-align: left;"&gt;The Hadoop MapReduce framework spawns one map task for each&amp;nbsp;&lt;/span&gt;&lt;span class="codefrag" style="background-color: white; font-family: 'Courier New', Courier, monospace; font-size: 14px; line-height: 15px; text-align: left;"&gt;InputSplit&lt;/span&gt;&lt;span style="background-color: white; font-family: Verdana, Helvetica, sans-serif; font-size: 13px; line-height: 15px; text-align: left;"&gt;&amp;nbsp;generated by the&amp;nbsp;&lt;/span&gt;&lt;span class="codefrag" style="background-color: white; font-family: 'Courier New', Courier, monospace; font-size: 14px; line-height: 15px; text-align: left;"&gt;InputFormat&lt;/span&gt;&lt;span style="background-color: white; font-family: Verdana, Helvetica, sans-serif; font-size: 13px; line-height: 15px; text-align: left;"&gt;&amp;nbsp;for the job.&lt;/span&gt;&amp;nbsp;"&lt;/li&gt;&lt;li&gt;Cannot start datanode? Some datanode starts and some cannot? Less and less datanodes can start? Check if we have formatted the namenode. Check if there is&amp;nbsp;&amp;nbsp;java.io.IOException: Incompatible namespaceIDs in datanodes' log file. If the answer is yes. Then we have the famous namenode format only problem. There are two solutions to this. Either delete datanode data storage path or update namespaceID in datanode to the current version from namenode.&lt;/li&gt;&lt;li&gt;Document about &lt;a href="http://hadoop.apache.org/common/docs/current/api/" target="_blank"&gt;Hadoop api&lt;/a&gt; and &lt;a href="http://hadoop.apache.org/hdfs/docs/current/api/index.html" target="_blank"&gt;HDFS api&lt;/a&gt; is separated.&lt;/li&gt;&lt;li&gt;Datanode need time to set up and namenode can accept service request after its own&amp;nbsp;initialization. So we should wait a short time for all HDFS nodes are up.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Often people run a hadoop job by the following command: hadoop jar job.jar job-parameter. What if you have dependency jar file? There are several ways to do this. we can use -libjars described &lt;a href="http://hadoop.apache.org/common/docs/r0.18.3/commands_manual.html#job" target="_blank"&gt;here&lt;/a&gt;. Or you can copy all your jar to $HADOOP_HOME/lib. If only tasknode use the jar, we also can use&amp;nbsp;HADOOP_TASKTRACKER_OPTS="-classpath &amp;lt;jars-separated-by-colon&amp;gt;"&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-1324440517540850897?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/1324440517540850897/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=1324440517540850897' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/1324440517540850897'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/1324440517540850897'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2011/12/hadoop-facts.html' title='Hadoop Facts: pros and cons'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-2774921897641969952</id><published>2011-12-22T19:13:00.000-08:00</published><updated>2011-12-31T16:35:49.603-08:00</updated><title type='text'>run Hadoop under Lava Workload Scheduler</title><content type='html'>Other title:&lt;br /&gt;run Hadoop in&amp;nbsp;constrained&amp;nbsp;environment&lt;br /&gt;run Hadoop in shared environment with only a user account&lt;br /&gt;run Hadoop with LSF&lt;br /&gt;&lt;br /&gt;Opportunity.neu.edu cluster at Northeastern U doesn't have hadoop yet and I can see it will not have it in the near future. So I am wondering whether I can run hadoop as a job under Lava. The plan is like this:&lt;br /&gt;Step 1: run hadoop in single mode as a job.&lt;br /&gt;Step 2: run hadoop as a parallel job after initializing tasktracker on assigned node (MapReduce).&lt;br /&gt;Step 3: run hadoop using full setting, add datanode on assigned node (HDFS).&lt;br /&gt;&lt;br /&gt;Step 1: This goal is just simple enough. You just need to follow the get started&amp;nbsp;&lt;a href="http://hadoop.apache.org/common/docs/current/#Getting+Started"&gt;http://hadoop.apache.org/common/docs/current/#Getting+Started&lt;/a&gt;&lt;br /&gt;link and You should be&amp;nbsp;OK. I try the pi example on the front node and it works.&lt;br /&gt;&lt;br /&gt;Step2: I want to first try out MapReduce for several reasons. First, most algorithms I commonly use actually is compute-oriented; Second, it's not necessary for MapReduce to deal with HDFS, I can run it with local file system. If something runs wrong, it's easier to kill processes than to clean up files; Third, it should be easy if we can get HDFS running after we understand how to make MapReduce work.&lt;br /&gt;&lt;br /&gt;After spending a day search on the Web and try out different configuration, I can run MapReduce under opportunity. First of all, following is the Python script I submit using bsub, configuration for Hadoop is also shown:&lt;br /&gt;&lt;br /&gt;bash$ bsub -J hadoop_test -o /home/yguan/ExpJobs/Jobs/exp103/log/hadoop_test.log -n 12 /home/yguan/ExpJobs/Jobs/exp103/template/hadoop_test.py&lt;br /&gt;&lt;br /&gt;hadoop_test.py:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;#!/usr/bin/python&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;import os&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;import sys&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;templateDir = sys.path[0]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;print(templateDir)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;machineFileDir = os.path.join(templateDir, 'hadoop_conf/slaves')&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;configDir = os.path.join(templateDir, 'hadoop')&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;hosts = os.environ["LSB_HOSTS"]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;hostList = hosts.split(' ')&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;hostList = list(set(hostList)) # remove duplicate host&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;# write to slaves files&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;fh = open(machineFileDir, 'w')&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;for host in hostList:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; fh.write(host)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; fh.write('\n')&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;fh.close()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;# get the network address for the jobtracker.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;import platform&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;nodeName = platform.node()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;mapredFileName = os.path.join(templateDir, "hadoop_conf/mapred-site.xml")&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;mapredFileNameBack = os.path.join(templateDir, "hadoop_conf/mapred-site.xml.back")&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;fhr = open(mapredFileName, 'r')&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;fhw = open(mapredFileNameBack, 'w')&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;# here we assume the second line after mapred.job.tracker line&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;# is the value line.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;mapredJobTrackerLine = False&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;for line in fhr:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; if "mapred.job.tracker&amp;lt;" in line:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mapredJobTrackerLine = True&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; elif mapredJobTrackerLine == True:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mapredJobTrackerLine = False&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fhw.write(" &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;value&gt;"+nodeName+":42312&lt;/value&gt;\n")&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; continue&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; fhw.write(line)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;fhr.close()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;fhw.close()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;os.remove(mapredFileName)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;os.rename(mapredFileNameBack, mapredFileName)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;# start hadoop/MapReduce part&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;hadoop_config = " --config " + os.path.join(templateDir, 'hadoop_conf')&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;hadoop_home = os.environ["HADOOP_HOME"]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;os.chdir(hadoop_home)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;startHadoop_comm &amp;nbsp;= "bin/start-mapred.sh "&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;[input, output, err] = os.popen3(startHadoop_comm + hadoop_config)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;for line in output:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; print line&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;for line in err:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; print line&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;# run the hadoop job&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;hadoop_command = "hadoop "&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;hadoop_run = " jar hadoop-0.20.2-examples.jar pi 100 100"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;#command = "bin/hadoop jar hadoop-0.20.2-examples.jar pi 2 100"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;command = hadoop_command + hadoop_config + hadoop_run&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;print(command)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;[input, output, err] = os.popen3(command)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;for line in output:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; print line&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;for line in err:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; print line&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;# shut down hadoop/mapreduce&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;stopHadoop_comm = "bin/stop-mapred.sh"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;[input, output, err] = os.popen3(stopHadoop_comm + hadoop_config)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;for line in output:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; print line&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;for line in err:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; print line&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;hadoop_conf/core-site.xml:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;configuration&gt;&lt;/configuration&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &lt;property&gt;&lt;/property&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;name&gt;hadoop.tmp.dir&lt;/name&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;value&gt;/scratch_global/hadoop-yguan/tmp&lt;/value&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &lt;property&gt;&lt;/property&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;name&gt;fs.default.name&lt;/name&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;value&gt;file:///&lt;/value&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;hadoop_conf/mapred-site.xml:&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&lt;configuration&gt;&lt;/configuration&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &lt;property&gt;&lt;/property&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;name&gt;mapred.child.tmp&lt;/name&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;value&gt;/scratch/hadoop-yguan/tmp&lt;/value&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &lt;property&gt;&lt;/property&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;name&gt;mapred.system.dir&lt;/name&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;value&gt;/scratch_global/hadoop-yguan/tmp/mapred/system&lt;/value&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &lt;property&gt;&lt;/property&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;name&gt;mapred.local.dir&lt;/name&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;value&gt;/scratch/hadoop-yguan/tmp/mapred/local&lt;/value&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &lt;property&gt;&lt;/property&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;name&gt;mapred.job.tracker&lt;/name&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;value&gt;compute-2-11.local:42312&lt;/value&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &lt;property&gt;&lt;/property&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;name&gt;mapred.tasktracker.map.tasks.maximum&lt;/name&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;value&gt;4&lt;/value&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &lt;property&gt;&lt;/property&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;name&gt;mapred.tasktracker.reduce.tasks.maximum&lt;/name&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;value&gt;4&lt;/value&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;The workflow here is simple enough. First we get the list of slaves as bsub will tell us the node we should run jobs on. Then we remove duplicate node. The reason is that you only need one datanode/tasktracker on one machine and mapred.tasktracker.{map|reduce}.tasks.maximum will determine the number of parallel JVM running on one machine. Then we replace mapred.job.tracker in mapred-site.xml to the node name our job running on. Now it's time to call bin/start-mapred.sh to set up jobtracker and populate work nodes with tasktrackers. Then we can run your Hadoop job. After the Hadoop is done. We call bin/stop-mapred.sh to stop jobtracker and tasktrackers.&lt;br /&gt;&lt;br /&gt;Step 3: Now it's time to make MapReduce and HDFS works. One thing special about HDFS other than MapReduce is that you need to format the file system first. When you type in shell command "bin/hadoop namenode -format", it will ask you for a "Y" to confirm. Thus I play a dirty trick here to have a file containing a "Y" and a newline and serve as the input for the format shell command. So here we have a new version of hadoop_test.py:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;#!/usr/bin/python&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;import os&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;import sys&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;templateDir = sys.path[0]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;print(templateDir)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;machineFileDir = os.path.join(templateDir, 'hadoop_conf/slaves')&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;configDir = os.path.join(templateDir, 'hadoop')&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;hosts = os.environ["LSB_HOSTS"]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;hostList = hosts.split(' ')&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;hostList = list(set(hostList)) # remove duplicate host&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;# write to slaves files&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;fh = open(machineFileDir, 'w')&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;for host in hostList:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; fh.write(host)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; fh.write('\n')&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;fh.close()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;# get the network address for the jobtracker.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;import platform&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;nodeName = platform.node()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;mapredFileName = os.path.join(templateDir, "hadoop_conf/mapred-site.xml")&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;mapredFileNameBack = os.path.join(templateDir, "hadoop_conf/mapred-site.xml.back")&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;fhr = open(mapredFileName, 'r')&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;fhw = open(mapredFileNameBack, 'w')&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;# here we assume the second line after mapred.job.tracker line&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;# is the value line.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;mapredJobTrackerLine = False&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;for line in fhr:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; if "mapred.job.tracker&amp;lt;" in line:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mapredJobTrackerLine = True&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; elif mapredJobTrackerLine == True:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mapredJobTrackerLine = False&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fhw.write(" &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;value&gt;"+nodeName+":42312&lt;/value&gt;\n")&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; continue&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; fhw.write(line)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;fhr.close()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;fhw.close()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;os.remove(mapredFileName)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;os.rename(mapredFileNameBack, mapredFileName)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;# get the network address for the namenode&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;hdfsFileName = os.path.join(templateDir, "hadoop_conf/core-site.xml")&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;hdfsFileNameBack = os.path.join(templateDir, "hadoop_conf/core-site.xml.back")&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;fhr = open(hdfsFileName, 'r')&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;fhw = open(hdfsFileNameBack, 'w')&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;hdfsLine = False&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;for line in fhr:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; if "fs.default.name&amp;lt;" in line:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; hdfsLine = True&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; elif hdfsLine == True:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; hdfsLine = False&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fhw.write(" &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;value&gt;hdfs://"+nodeName+"&lt;/value&gt;\n")&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; continue&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; fhw.write(line)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;fhr.close()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;fhw.close()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;os.remove(hdfsFileName)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;os.rename(hdfsFileNameBack, hdfsFileName)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;# format the newly created hdfs&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;hadoop_config = " --config " + os.path.join(templateDir, 'hadoop_conf')&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;hadoop_home = os.environ["HADOOP_HOME"]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;os.chdir(hadoop_home)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;format_comm = "bin/hadoop " + hadoop_config + " namenode -format &amp;lt; Y"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;[input, output, err] = os.popen3(format_comm)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;for line in output:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; print line&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;for line in err:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; print line&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;# start hadoop/HDFS part&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;starthdfs_comm = "bin/start-dfs.sh "&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;[input, output, err] = os.popen3(starthdfs_comm + hadoop_config)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;for line in output:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; print line&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;for line in err:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; print line&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;# start hadoop/MapReduce part&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;startHadoop_comm &amp;nbsp;= "bin/start-mapred.sh "&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;[input, output, err] = os.popen3(startHadoop_comm + hadoop_config)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;for line in output:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; print line&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;for line in err:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; print line&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;# run the hadoop job&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;hadoop_command = "hadoop "&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;hadoop_run = " jar hadoop-0.20.2-examples.jar pi 100 100"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;#command = "bin/hadoop jar hadoop-0.20.2-examples.jar pi 2 100"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;command = hadoop_command + hadoop_config + hadoop_run&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;print(command)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;[input, output, err] = os.popen3(command)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;for line in output:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; print line&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;for line in err:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; print line&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;# shut down hadoop/mapreduce&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;stopHadoop_comm = "bin/stop-mapred.sh"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;[input, output, err] = os.popen3(stopHadoop_comm + hadoop_config)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;for line in output:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; print line&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;for line in err:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; print line&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;# shut down hadoop/hdfs&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;stophdfs_comm = "bin/stop-dfs.sh"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;[input, output, err] = os.popen3(stophdfs_comm + hadoop_config)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;for line in output:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; print line&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;for line in err:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; print line&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;core-site.xml:&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&lt;configuration&gt;&lt;/configuration&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &lt;property&gt;&lt;/property&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;name&gt;hadoop.tmp.dir&lt;/name&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;value&gt;/scratch/hadoop-yguan/tmp&lt;/value&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &lt;property&gt;&lt;/property&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;name&gt;fs.default.name&lt;/name&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;value&gt;hdfs://compute-2-16.local&lt;/value&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;hdfs-site.xml:&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&lt;configuration&gt;&lt;/configuration&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &lt;property&gt;&lt;/property&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;name&gt;dfs.name.dir&lt;/name&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;value&gt;/scratch/yguan/hadoop/name&lt;/value&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &lt;property&gt;&lt;/property&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;name&gt;dfs.data.dir&lt;/name&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;value&gt;/scratch/yguan/hadoop/data&lt;/value&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;There are some limitation in this setting. For example, we have the maximum of parallel running job on a machine set to constant. In fact we can set it to the number assigned by LSF. And this requires each tasknode has its own configuration file.&lt;br /&gt;&lt;br /&gt;At this state, both components in Hadoop can be started and stopped under a job session.&lt;br /&gt;Note that Platform who produces LSF already has its own Hadoop support.&lt;br /&gt;Note that Hadoop has its own scheduler.&lt;br /&gt;&lt;br /&gt;However, I find some error after try this script several times. When you format the namenode, datanode is not aware of it and since we don't change the path where datanode stores the data. There is will be error like this:&lt;br /&gt;java.io.IOException: Incompatible namespaceIDs&lt;br /&gt;The solution is to &lt;span style="background-color: #f9cb9c;"&gt;remove the path on datanode completely&lt;/span&gt; which is fine for our case or update namespaceID on datanode. Searching web for&amp;nbsp;namespaceIDs will show this. To remove the directory, we can issue&lt;br /&gt;ssh datanode_name rm -rf /path/to/datanode/storage&lt;br /&gt;for every datanode.&lt;br /&gt;&lt;br /&gt;Another error comes up is when we run the script, datanode is starting but namenode already starts to accept service request. So it will come up with "&lt;span style="background-color: #f9cb9c;"&gt;file could only be replicated to 0 nodes, instead of 1&lt;/span&gt;". The solution to this problem is wait for a few seconds before submit job. As there is no easy way to check HDFS health, especially datanode status by program right now. On opportunity.neu.edu for example, in rush hour the wait time can be 30 seconds long. (Update: when I'm using 0.20, this error occur sometimes even I have time delayed long enough to wait for the datanode. After upgrade to a new version, this problem seems go away.)&lt;br /&gt;&lt;br /&gt;There are many places we can continue our studying about Hadoop. We can make us familiar with HDFS for example from the information at:&lt;br /&gt;&lt;a href="http://hadoop.apache.org/common/docs/r0.20.0/hdfs_shell.html"&gt;http://hadoop.apache.org/common/docs/r0.20.0/hdfs_shell.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-2774921897641969952?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/2774921897641969952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=2774921897641969952' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/2774921897641969952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/2774921897641969952'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2011/12/run-hadoop-under-lava-workload.html' title='run Hadoop under Lava Workload Scheduler'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-2687888136121990893</id><published>2011-12-22T14:00:00.000-08:00</published><updated>2011-12-24T13:55:08.140-08:00</updated><title type='text'>Pro Hadoop from Apress is a bad book</title><content type='html'>"Pro Hadoop" from Apress is a bad book.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;Hadoop is premature considering the lack of documents. &lt;strike&gt;There is no central place you can find how many configuration you can put in the variety of configuration XML files&lt;/strike&gt;(This is not true after I spend sometime with Hadoop on the network. You at least can get some hit about configuration of Hadoop using the default files online. The default configuration value URL is:&lt;br /&gt;&lt;a href="http://hadoop.apache.org/common/docs/current/hdfs-default.html"&gt;http://hadoop.apache.org/common/docs/current/hdfs-default.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hadoop.apache.org/common/docs/current/mapred-default.html"&gt;http://hadoop.apache.org/common/docs/current/mapred-default.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hadoop.apache.org/common/docs/current/core-default.html"&gt;http://hadoop.apache.org/common/docs/current/core-default.html&lt;/a&gt;&lt;br /&gt;). At least I want to learn it. So I want to grab some book to learn it. There are currently &lt;strike&gt;two &lt;/strike&gt;choice you can have. One is "Pro Hadoop" from Apress and "Hadoop: The Definite Guide" from Oreilly. (Actually, I realize that there is also a book "Hadoop in Action")&lt;br /&gt;&lt;br /&gt;&amp;nbsp;I start to read "Pro Hadoop" since I just get it first. Here is my reading experience:&lt;br /&gt;&lt;br /&gt;&amp;nbsp;I read through the book, from the very beginning. After the "bin/hadoop jar hadoop-*-examples.jar pi 2 2" example, I come across a section of sample code from book. I type one line by one line, try to see the meaning of every line. And after that I try to compile it. Of course, there is some error related to classpath. I fix and now the code still cannot get through. After a while, I realize the code cannot be compiled since it use a object before initialize it. Woo, no other choice but I have to switch to Oreilly book.....&lt;br /&gt;&lt;br /&gt;Story continues. I finally realize "Hadoop: The Definite Guide" is actually the right book to read for everyone newbie wants to learn about Hadoop. It's well organized and most importantly the thought flows well, especially compared to "Pro Hadoop".&lt;br /&gt;&lt;br /&gt;I suggest everyone wants to learn Hadoop has "Hadoop: The Definite Guide" at hands.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-2687888136121990893?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/2687888136121990893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=2687888136121990893' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/2687888136121990893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/2687888136121990893'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2011/12/pro-hadoop-from-apress-is-bad-book.html' title='Pro Hadoop from Apress is a bad book'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-3538599875004619029</id><published>2011-10-14T20:46:00.000-07:00</published><updated>2011-10-14T20:49:24.990-07:00</updated><title type='text'>swap ctrl capslock for windows caps-ctrl-swap.reg</title><content type='html'>REGEDIT4&lt;br /&gt;&lt;br /&gt;[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]&lt;br /&gt;"Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,1d,00,3a,00,3a,00,1d,00,00,00,00,00&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-3538599875004619029?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/3538599875004619029/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=3538599875004619029' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/3538599875004619029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/3538599875004619029'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2011/10/swap-ctrl-capslock-for-windows.html' title='swap ctrl capslock for windows caps-ctrl-swap.reg'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-6504064748877022313</id><published>2011-10-10T19:39:00.000-07:00</published><updated>2011-10-10T19:40:07.807-07:00</updated><title type='text'>nokia e73 model</title><content type='html'>documents:&lt;br /&gt;&lt;br /&gt;* JavaTM ME Developer's Library 2.3&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-6504064748877022313?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/6504064748877022313/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=6504064748877022313' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/6504064748877022313'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/6504064748877022313'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2011/10/nokia-e73-model.html' title='nokia e73 model'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-5938558457339349616</id><published>2011-08-10T00:01:00.000-07:00</published><updated>2011-12-25T20:28:02.111-08:00</updated><title type='text'>install atlas/lapack on cygwin</title><content type='html'>tar xjf atlas3.2.1.tar.bz2&lt;br /&gt;tar xzf lapack.tgz&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;../ATLAS/configure -b 32 -Ss flapack /home/yguan/temp/lapack/lapack-3.3.1/SRC&lt;br /&gt;COMMENT: here -b is the bit width&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;make&lt;br /&gt;make test&lt;br /&gt;make ptcheck&lt;br /&gt;make install&lt;br /&gt;&lt;br /&gt;all file is put into /usr/local/atlas&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-5938558457339349616?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/5938558457339349616/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=5938558457339349616' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/5938558457339349616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/5938558457339349616'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2011/08/install-atlaslapack-on-cygwin.html' title='install atlas/lapack on cygwin'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-7729828603218460149</id><published>2011-06-25T07:57:00.000-07:00</published><updated>2011-06-25T08:03:35.026-07:00</updated><title type='text'>rebase, rebase all</title><content type='html'>I don't care windows when toy programming and rely on cygwin when I have to.&lt;br /&gt;&lt;br /&gt;Mysterious error rise when deal some os related operation.&lt;br /&gt;&lt;br /&gt;Error has words like 'error in dll loading'.&lt;br /&gt;&lt;br /&gt;rebase package stop you from frustrating.&lt;br /&gt;&lt;br /&gt;Launch 'ash' from windows command line after close all cygwin running.&lt;br /&gt;&lt;br /&gt;Run rebaseall should then be sounding.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-7729828603218460149?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/7729828603218460149/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=7729828603218460149' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/7729828603218460149'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/7729828603218460149'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2011/06/rebase-rebase-all.html' title='rebase, rebase all'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-2503565939388748900</id><published>2010-09-20T12:24:00.000-07:00</published><updated>2010-09-20T12:53:11.884-07:00</updated><title type='text'>stock technical terms</title><content type='html'>SMA: simple moving average&lt;br /&gt;&lt;br /&gt;EMA: exponential moving average&lt;br /&gt;&lt;br /&gt;MACD: Moving Average Convergence Divergence&lt;br /&gt;&lt;br /&gt;KDJ Indicator:&lt;br /&gt;&lt;br /&gt;RSI: relative strength index&lt;br /&gt;&lt;br /&gt;Williams %R: &lt;br /&gt;&lt;br /&gt;BIAS: bias ratio&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-2503565939388748900?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/2503565939388748900/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=2503565939388748900' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/2503565939388748900'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/2503565939388748900'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2010/09/stock-technical-terms.html' title='stock technical terms'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-4953915321862476493</id><published>2010-07-19T22:25:00.000-07:00</published><updated>2010-07-19T22:27:34.048-07:00</updated><title type='text'>about DSLR</title><content type='html'>DSLR&lt;br /&gt;This is my guide for shopping DSLR (digital single lens reflector) lens and accessory. &lt;br /&gt;The target machine is Canon 500d/T1i, which is classified as consumer DSLR. Other option may be 550d/T2i, which is newer. This ASP-C cropped frame machine. Real focal length is 1.6x the focal length marked on lenses.&lt;br /&gt;I get 500d, which is best with EF-s lens. Here is a list of options I can upgrade the lens from the kit lens, which is EF-s 18-55 IS.&lt;br /&gt;&lt;br /&gt;In EF-S lens range, there are three options consider most widely here for an upgrade still in wide-mid-telephoto range:&lt;br /&gt;• EF-S 17-55mm f/2.8 IS USM, priced over $1,000. This is the best lens in this range. It provides the best IQ. But it lacks of range and also tagged high price. Note that this lens is the only constant aperture lens in the EF-s line. There is dust issue about this lens, but it can be solved by using UV filter.&lt;br /&gt;• EF-S 15-85mm f/3.5-5.6 IS USM, priced over $700. The corresponding hood is 78E, the diameter for the lens is 72mm. Cost for lens, hood and UV filter would be just under $800.&lt;br /&gt;• EF-S 17-85mm f/4-5.6 IS USM, priced over $400&lt;br /&gt;&lt;br /&gt;Among all these three lenses, 15-85 would be the proper one after judging price, focal length range and IQ. But 17-55 definitely has the best reputation for image quality. &lt;br /&gt;&lt;br /&gt;There are also wide to ultra-telephoto range lens, EF-S 18-135mm IS and EF-S 18-200mm IS. These lenses built quality is normal and believed comparable to kit lens 18-55 IS.&lt;br /&gt;&lt;br /&gt;There are several ways to buy the lens, including eBay online shopping, online store and local store. Here some local stores are listed while I don’t have hand on experience of shopping with them yet.&lt;br /&gt;&lt;br /&gt;First store I shall talk about is B&amp;H, its tag is fair and often regarded as the baseline for deals. It has both online and local store. The store has pretty long history through.&lt;br /&gt;&lt;br /&gt;Second, some reliable stores are 17photo.com, J&amp;R, Ritzcamera, Calumet, Willoughby’s, tristate and 42th street photo.&lt;br /&gt;&lt;br /&gt;There are also good online shopping stores like Amazon.com, beachcamera.com, newegg.com, dell.com, onecall.com, sigma4less.com, ibuydigital.com, samys.com and buy.com. Note that ibuydigital.com has the lowest tag for EF-S 15-85 while it may be a gray market item. All online store reputation can be checked on review site like, resellerrating.com, pricegrabber.com&lt;br /&gt;&lt;br /&gt;Another item that is popular with lens is UV filter (ultraviolet filter). It’s a piece of glass used to prevent ultraviolet light through, which may cause blue foggy image. In reality, UV filter is used to protect expensive lens, to prevent first contact with other surface in situation like accidentally dropping. UV filter is specified by its diameter. The diameter for EF-S 15-85mm f/3.5-5.6 IS USM is 72mm. There are several UV filter brand and people believe more expensive filter means better filter. Hoya, Tiffen, B+W are common brands for UV filters. The cost for a good multi-coat filter would be up to $60. &lt;br /&gt;&lt;br /&gt;Another protection to the lens and also good stuff for the photograph is the lens hood. The lens hood item number for EF-S 15-85mm f/3.5-5.6 IS USM is EW78E. Original brand hood is overpriced so get a cheap one.&lt;br /&gt;&lt;br /&gt;There are also other accessories that are necessary for everyday shooting with DSLR, like tripod, flash, fast lens, underwater gear and bag. And in the following paragraph, we will talk about specification about these items that can guide the shopping.&lt;br /&gt;&lt;br /&gt;Although tripod is not that important since the age of digital SLR, it’s still necessary for marginal light shooting or long time exposure. Any tripod will do the work, but more expensive tripod from Gitzo (best tripod), Bogen (best value/price) can provide better head which allows flexible adjustment and steady support.&lt;br /&gt;&lt;br /&gt;For Canon DSLR, current line of flash is made of Speedlite 580EX II, Speedlite 430EX II and Speedlite 270EX. For macro shooting there are MT-24EX and MR-14EX. 580 comes with weather seal.&lt;br /&gt;&lt;br /&gt;Below it’s a figure from Wikipedia which shows the common aperture size. Aperture controls the amount of light come through the lens. So aperture with larger size allows more light coming through so it allows shooting in dark place and faster shutter speed. Depth of field (DOF) is also determined by aperture, aperture with larger size will decrease depth of field. Aperture is often judged by speed and lens is called fast or slow by their aperture. Prime lens often has faster aperture than zoom lens. As far as I know, lens with aperture faster than f/2.8 can be considered as fast lens.&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Underwater gear is helpful when shooting with water. There are two kinds here. One is waterproof gear and the other one is underwater gear. The latter one is more expensive that is often listed over the price of the camera. It gives control for each button of the camera while waterproof gear often is a water sealed plastic bag with hard housing for attached lens.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-4953915321862476493?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/4953915321862476493/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=4953915321862476493' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/4953915321862476493'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/4953915321862476493'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2010/07/about-dslr.html' title='about DSLR'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-6067921728963547679</id><published>2010-07-10T12:01:00.000-07:00</published><updated>2010-07-11T20:11:02.745-07:00</updated><title type='text'>kernel develop from zero</title><content type='html'>from: &lt;br /&gt;http://www.julienlecomte.net/blog/2007/07/3/&lt;br /&gt;http://www.omninerd.com/articles/Installing_GRUB_on_a_Hard_Disk_Image_File&lt;br /&gt;http://kbarr.net/bochs&lt;br /&gt;http://thestarman.pcministry.com/asm/mbr/PartTables.htm&lt;br /&gt;http://members.iinet.net/~herman546/p20/GRUB2%20Bash%20Commands.html&lt;br /&gt;&lt;br /&gt;make a fire ready disk image:&lt;br /&gt;1. get a disk image file. There are two ways to get a empty disk image.&lt;br /&gt;One is:&lt;br /&gt;$ dd if=/dev/zero of=disk.img count=10080&lt;br /&gt;The other one if Bochs is installed:&lt;br /&gt;$ bximage: hd, flat, 1500, c.img&lt;br /&gt; cyl=3047&lt;br /&gt;  heads=16&lt;br /&gt;  sectors per track=63&lt;br /&gt;  total sectors=3071376&lt;br /&gt;  total size=1499.70 megabytes&lt;br /&gt;2. After having a disk image， we need partition table in it.&lt;br /&gt;$ fdisk disk.img&lt;br /&gt;&lt;br /&gt;   x     -&gt; Extra functionality&lt;br /&gt;   c 10  -&gt; 10 cylinders&lt;br /&gt;   h 16  -&gt; 16 heads&lt;br /&gt;   s 63  -&gt; 63 sectors per track&lt;br /&gt;   r     -&gt; Return to main menu&lt;br /&gt;   n     -&gt; Create a new partition&lt;br /&gt;   p     -&gt; Primary&lt;br /&gt;   1     -&gt; Partition #1&lt;br /&gt;   1     -&gt; First cylinder&lt;br /&gt;   10    -&gt; Last cylinder&lt;br /&gt;   a     -&gt; Set bootable flag&lt;br /&gt;   1     -&gt; Partition number&lt;br /&gt;   w     -&gt; Write partition to disk&lt;br /&gt;3. to setup the loop back device.&lt;br /&gt;first to find where the first partition start:&lt;br /&gt;$ fdisk -l -u disk.img&lt;br /&gt;&lt;br /&gt;  Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;disk.img1   *          63       10079        5008+  83  Linux&lt;br /&gt;&lt;br /&gt;Given one block is 512 bytes size.&lt;br /&gt;Then, 63 * 512 = 32256&lt;br /&gt;$ losetup -o 32256 /dev/loop0 disk.img&lt;br /&gt;4. format the disk image&lt;br /&gt;$ mkfs.ext2 /dev/loop0&lt;br /&gt;5. mount the disk&lt;br /&gt;$ mount -o loop /dev/loop0 /mnt&lt;br /&gt;6. install GRUB&lt;br /&gt;7. umount disk&lt;br /&gt;$ umount /mnt&lt;br /&gt;8. Detach the loopback device:&lt;br /&gt;$ losetup -d /dev/loop0&lt;br /&gt;9. Finish up the GRUB installation:&lt;br /&gt;$ grub --device-map=/dev/null&lt;br /&gt;&lt;br /&gt;   device (hd0) disk.img&lt;br /&gt;   geometry (hd0) 10 16 63&lt;br /&gt;   root (hd0,0)&lt;br /&gt;   setup (hd0)&lt;br /&gt;   quit&lt;br /&gt;10. Setup your .bochsrc file in the same directory as your disk image:&lt;br /&gt;megs: 32&lt;br /&gt;romimage: file=/usr/local/share/bochs/BIOS-bochs-latest, address=0xf0000&lt;br /&gt;vgaromimage: file=/usr/local/share/bochs/VGABIOS-elpin-2.40&lt;br /&gt;ata0-master: type=disk, path="disk.img", mode=flat, cylinders=10, heads=16, spt=63&lt;br /&gt;cpu: count=1, ips=15000000&lt;br /&gt;mouse: enabled=0&lt;br /&gt;log: out.bochs&lt;br /&gt;boot: disk&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-6067921728963547679?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/6067921728963547679/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=6067921728963547679' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/6067921728963547679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/6067921728963547679'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2010/07/kernel-develop-from-zero.html' title='kernel develop from zero'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-7969380347311498481</id><published>2010-06-26T15:40:00.000-07:00</published><updated>2010-06-26T15:43:54.858-07:00</updated><title type='text'>song</title><content type='html'>如果没有你&lt;br /&gt;往昔&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-7969380347311498481?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/7969380347311498481/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=7969380347311498481' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/7969380347311498481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/7969380347311498481'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2010/06/song.html' title='song'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-4957587929675082557</id><published>2010-06-06T08:08:00.000-07:00</published><updated>2010-06-15T10:35:58.723-07:00</updated><title type='text'>photography</title><content type='html'>卡尔•蔡司的历史&lt;br /&gt;&lt;br /&gt;卡尔·蔡司&lt;br /&gt;&lt;br /&gt;一个仅高中毕业的学徒工；德国古镇耶拿（Jena），卡尔·蔡司的故乡。当初也许谁也没有想到古镇上的这位学徒会成为世界光学巨子。&lt;br /&gt;&lt;br /&gt;因为多年对光学和化学的兴趣，在学徒期满之后，卡尔长期在当地的耶拿大学(粉不错的大学，度假的好地方，可惜计算机专业......)旁听。1846年，30岁的卡尔创办了一个工作室，早期产品是放大镜片和简单的显微镜。得益于两位大科学家恩斯特·阿贝和奥托·肖特（听说过光学玻璃中大名鼎鼎的“肖特”玻璃吗？开创者就是此老）的帮助，蔡司厂光学镜头的质量一直处于领先地位。二战以前设在德累斯顿的生产车间，是世界上生产规模最大的照相机工厂。&lt;br /&gt;&lt;br /&gt;一波三折的经历&lt;br /&gt;&lt;br /&gt;1945年2月14日晚上，灾难降临，德累斯顿（明年一定要去逛逛这个易北河畔的佛罗伦萨）照相机工厂被盟军炸毁。在二战将近结束时，巴顿将军的第三军团占领了耶拿，由于雅尔塔条约规定美军的位置必须后退向西移，德国被一分为二，耶拿和德累斯顿全部由苏军占领。对于这个光学巨人的财富，俄国人当然不会让“美帝国主义”染指，作为战争赔偿，苏军拆除了剩下94%的工厂设备。在基辅建立了现在的Kiev（ 基辅）照相机制造厂（借着这一丝血脉，俄罗斯镜头至今还能在光学领域占有一席之地）。但是德国人的技术好像抢不走，在耶拿大学的支持下“Carl Zeiss Jena”的标志很快又出现了。当初被巴顿掠走的126名蔡司关键管理人员和技师，在美国的支持下，也在联邦德国（西德）的奥伯考亨重新建厂。卡尔·蔡司在“资本主义”社会里也获得了新生，蔡司厂从此一分为二。&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;东德的产品冠名Carl Zeiss Jena（卡尔.蔡司.耶拿）史称“东蔡”，西德的产品冠名Carl Zeiss，史称“西蔡”，东、西蔡都标榜自己为是蔡司正宗，其实双方在设计上都秉承了蔡司传统。“塞翁失马，焉知非福”，正是这种竞争使得蔡司在光学技术上的更臻完美。&lt;br /&gt;&lt;br /&gt;两德统一后，东西德的蔡司厂又联系经营。总部仍在奥伯考亨，拥有员工3500名，同时在世界各地设有分厂。这时的蔡司双剑合壁，在光学领域已经是第一强者。在135领域还尚有康太克斯与徕卡抗衡（康太克斯采用卡尔蔡司），但到了120领域Carl   Zeiss 便称雄天下：哈苏、禄徕两大120巨头都使用卡尔蔡司镜头。进入数码时代，依靠蔡司的鼎力相助，原本是光学外行的索尼，摇身一变，成为消费级数码相机的业界老大之一。&lt;br /&gt;&lt;br /&gt;经典的缔造者&lt;br /&gt;&lt;br /&gt;蔡司开创了镜头工业中的诸多经典设计。蔡司的创始师保罗·鲁道夫就是镜头制造史上最有名的设计师之一。1890年，他设计出第一只消像散正光摄影镜（Anastigmat），开创了蔡司镜头的新纪元。1896年鲁道夫又发表了大名鼎鼎的普兰纳（Planar）双高斯结构的镜头，对各种镜头像差都进行了出色的纠正。此后，世界各地生产的各种品牌的标准镜头（包括徕卡）无不借鉴普兰纳镜头的设计。&lt;br /&gt;&lt;br /&gt;1902年，他又设计出四片三组的“鹰之眼”——天塞（Tessar）镜头，虽然结构简单、价格适中，成像质量惊世骇俗，明快锐利。&lt;br /&gt;&lt;br /&gt;其他诸如广角镜头的典范Holgon、大光圈镜头的典范Sonnar（索尼DSC-F828的镜头正是基于Sonnar镜头结构设计的）、专为旁轴相机设计的Bio-gon等等，都是蔡司创造的经典名镜。光学产品只要沾了蔡司镜头的边就有市场，这就是事实。&lt;br /&gt;&lt;br /&gt;  在蔡司、徕卡的耀眼光环下，罗敦司德（Rodenstock）和施奈德（Schneider）在外行人眼里变的默默无闻。其实在德意志百年的光学传统工业里曾经出现过大量的优秀品牌，但在蔡司、徕卡的垄断下大多凋零了，但罗敦司德和施奈德靠自己的一流的设计还坚强的存在。如果你看到哪款数码相机使用了罗敦司德和施奈德的镜头，其他的不说，光学性能尽可放心。虽然有传闻说数码相机用的德国镜头都只不过是德国设计甚至授权，但就算镜头在日本或其他什么地方OEM，德国人也会顾忌一点自己的面子，性能绝不会太离谱。&lt;br /&gt;&lt;br /&gt;150 年历史的卡尔蔡司生产世界上屈指可数的高品质透镜。以其独有的色彩还原和成像特点令世界摄影爱好者爱不释手。HandyCam 里装备了变焦镜头 (Vario-Sonnar)(Vario-Tessa)。分辩率及对比性高，颜色还原出色，几乎没有四角失真现象。忠实提供高画质量摄影。同时，透镜T*(T star)表面涂层，抑制无用反射光，使图像更鲜明。[Vario·Sonnar]达到MTF指标 ※ ，生产中为确保质量，在透镜块上编上序号，在严格的质量控制下逐一生产出来的。&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;MTF※ (Modulation Transfer Function) 用于图像清晰度的描述，是目前分析镜头的解像力跟反差再现能力的方法。 : &lt;br /&gt;&lt;br /&gt;Tessar镜头 &lt;br /&gt;&lt;br /&gt;1902 研制成功的“天塞”(Tessar)镜头以成像质量高、结构简单而风行世界， 享有“鹰眼”美誉。Handycam所配备的[Vario·Tessa]，是Carle Zeisse 公司很好地运用 Tessar Lens 的高质量技术所开发的产品。&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;卡尔蔡司镜头&lt;br /&gt;&lt;br /&gt;卡尔蔡司镜头是来自德国的品牌，是目前为数不多的非日系厂商。卡尔·蔡司是一家历史相当悠久的光学仪器厂商，其出品的镜头在传统相机领域向来都是“高贵”的代名词，许多色友以拥有卡尔·蔡司镜头为荣。索尼公司在自己的部分数码相机上使用了卡尔·蔡司镜头并以此为卖点。&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;卡尔蔡司镜头在业内一向享有良好的声誉，因其成像的超清晰能力而被称为“鹰之眼”，这种镜头一般情况下只有高端相机会配备这样的镜头。卡尔蔡司这家德国的老牌光学厂家已有一百多年的历史，生产世界上屈指可数的高品质透镜。以其独有的色彩还原和成像特点令全世界摄影家及爱好者爱不释手（但因其价格高高在上而敬而远之，望而却步）。分辩率高，颜色还原出色，几乎没有四角失真现象。忠实提供高画质摄影。其中带有红色T＊为标志的镜头更是卡尔.蔡司引以为豪的产品。玩单反机的朋友都知道，在德国，大名鼎鼎的蔡司和莱卡如雷贯耳。在135领域还尚有康太克斯与徕卡抗衡（著名的康太克斯采用卡尔蔡司），但到了120领域卡尔.蔡司便称雄天下：哈苏、禄徕两大120巨头都使用卡尔.蔡司镜头。进入数码时代，依靠蔡司的鼎力相助，原本是光学外行的索尼，摇身一变，成为消费级数码相机的业界老大之一。&lt;br /&gt;&lt;br /&gt;蔡斯历史&lt;br /&gt;&lt;br /&gt;Zeiss 今天也许已经没有如同过去般地辉煌，也许已经不在那麼热衷商业性的镜头（成本的考量），但在最顶尖的光 学领 域，她仍然是一枝独秀。 翻开这近百年来的光学设计史，彷佛就是一部活生生的蔡司史，几位大师级的科学家，如 E. Abbe, P. Rudolph, Otto Schott, H. Harting, C.P.Goerz, L.J.Bertele..等等都是光学设计史上的关键人物。 十九世纪末Robert Koch 博士利用蔡司显微镜发现杆菌是导致结核病的原因。1911年挪威探险家Roald Amundsen首开 人类 踏上南极大陆，他用蔡司望远镜看南极大陆。大到人造xxx的空照镜头，小至眼镜玻璃，Zeiss 对各种光学玻璃的 制作乃 至光学设计上的突破，都在在的显示她对人类科学的 贡献，成就非凡。&lt;br /&gt;&lt;br /&gt;【蔡司光学史 &amp; 年表】&lt;br /&gt;&lt;br /&gt;时至今日，世界上优良的光学系统很多，并非全然Zeiss 设计的系统就是最好，但所有经典的作品中Zeiss 所占的比例最重 却也是个公认的事实。以下仅例举几项最经典，也最被广为讨论的光学设计。 光学设计始於英国，但在E.Abbe之前几乎没有什麼很严格的理论基础，完全是尝试错误与经验的累积，而制造者多半是 机械工匠与玻璃师傅。&lt;br /&gt;&lt;br /&gt;1868 E.Abbe建立全新的设计理论，如 Sine relation；定义各种Distortion及Abberation， 并确立光学计算的方法。同年并制 造出史上第一支，经由理论计算的显微镜。&lt;br /&gt;&lt;br /&gt;1881 E.Abbe与Otto Schott 合作，开始有系统地研究并开发各种光学级的玻璃。&lt;br /&gt;&lt;br /&gt;1886 Schott公司出版史上第一本光学玻璃目录，生产44种不同特性的光学玻璃，并为往后的新光学设计打下基础。&lt;br /&gt;&lt;br /&gt;1890 Rudolph与Abbo 研发出史上第一支消散光像差的设计，Anastigmat，这项惊人的成就敲开了近代光学设计的大门，其 功劳不亚於贝尔发明电话。数年后推出商业化镜头，Zeiss Protar及Zeiss Planar。&lt;br /&gt;&lt;br /&gt;1902 Rudolph 改良 Anastigmat 而推出最著名的商业化镜头 Zeiss Tessar f6.3 1911 Zeiss Biotar f1.8，设计者为M.V.Rohr&lt;br /&gt;&lt;br /&gt;1919 第一次世界大战结束。&lt;br /&gt;&lt;br /&gt;1923 Zeiss APO-Tessar&lt;br /&gt;&lt;br /&gt;1929 Zeiss Biotar f1.0及f0.85 注： 在没有电脑辅助设计以前，大光圈的高速镜头设计是项很繁琐的工作，其「追迹」所计算的数学资料有时候必须要 好几千张才能完成。&lt;br /&gt;&lt;br /&gt;1932 Sonnar f1.5及f2.0，设计者为L.Bertele这是当时世界上结像品质最佳的高速镜头。&lt;br /&gt;&lt;br /&gt;1936 Sonnar 180mm f2.8这是史上第一支高速望远镜头。 Smakula 首开先例，在镜片上利用真空镀膜技术镀上一层低折射率的抗反射膜 Antireflection Coat-ings）T Coating&lt;br /&gt;&lt;br /&gt;1945 第二次世界大战结束。&lt;br /&gt;&lt;br /&gt;1948 西德蔡司成立 1952 R.Richter设计出18×18cm，90°视角之pleogon这是有史以来结像品质最佳的空照 镜。&lt;br /&gt;&lt;br /&gt;1954 L.Bertele设计出 90°视角，没有形变的超广角镜，这支Biogon真可算是光学设计 史上的艺术极品。 Biogon 21mm f4.5 for 35mm 片幅 Biogon 38mm f4.5 for 6×6 片幅 Biogon 53mm f4.5 for 6×9 片幅 Biogon 75mm f4.5 for 9×12片幅 1954 G.Lange 设计出全新5 片组的Planar 80mm f2.8（R-olleiflex）Planar 可算是中距离 镜头，大光圈光学设计的希望，时至今日有很多知名厂牌的 50mm f1.4或是 50mm f2 都是采用类似planar Double Gauss 的光学设计。&lt;br /&gt;&lt;br /&gt;1960 Planar 55mm f1.4 for Contarex&lt;br /&gt;&lt;br /&gt;1961 Zeiss 数学家E.Glatzel 发表全新电脑辅助光学设计方法。&lt;br /&gt;&lt;br /&gt;1964 Distagon 40mm f4 （哈苏6×6） 1966 Hologon 15mm f8 （35mm SLR） Planar 50mm f0.7（35mm SLR） Distagon 18mm f4 （35mm SLR）&lt;br /&gt;&lt;br /&gt;1972 Distagon 35mm f1.4（Contax）非球面 Planar 85mm f1.4（Contax） Planar 50mm f1.4（Contax） Distagon 15mm f3.5（Contax） 1974 电影机 35mm 用的Distagon 35mm f1.2 及Distagon25mm f1.2&lt;br /&gt;&lt;br /&gt;1976 再推出35mm电影机用的超广角超大光圈镜头Distagon18mm f1.2，你能想像它是 什麼可怕的模样吗？ Planar 110mm f2（哈苏）&lt;br /&gt;&lt;br /&gt;1982 浮动元件设计的Distagon 40mm f4（哈苏）&lt;br /&gt;&lt;br /&gt;1984 第二阶（Secondary Spectrum）完全消色差的Tele-Apotessar 300mm f2.8&lt;br /&gt;&lt;br /&gt;一个不得不提的名字---CONTAX&lt;br /&gt;&lt;br /&gt;CONTAX简史&lt;br /&gt;&lt;br /&gt;Saale河仍然流过德国工业城镇耶拿(Jena)，这是Carl Zeiss基金会的故乡，耶拿就像那河流一样，尽管时光流逝，容颜未改。&lt;br /&gt;&lt;br /&gt;1846年，Zeiss先生在这里创建了他的工作室，为耶拿大学制造高质量的放大镜片，就从这寒酸的陋室开始，Carl Zeiss作坊逐渐成长为世界上最大和最为领先的光学公司。&lt;br /&gt;Carl Zeiss于1816年9月11日出生在图林根州(Thuringia States)的魏玛市(Weimar)。他父亲是魏玛王朝时代一个车削车间的工厂管理人员。卡尔在魏玛高级中学就读，并完成了六级课程。毕业后不久，他自愿给Frederick Koerner博士做学徒，Koerner博士当时正在研究用于望远镜目镜的玻璃。在学徒期满后，卡尔被耶拿大学短期聘用，并作为大学的旁听生。&lt;br /&gt;&lt;br /&gt;从此，Zeiss开始了镜片制造的理论研究。在随后的几年里，Zeiss访问了斯图加特(Stuttgart)、达木斯塔特(Darmstadt)、韦恩(Wein)和柏林(Berlin)等城市里玻璃和镜片制造商，做了大量的笔记，内容涉及玻璃熔炼、材料、烧制温度和任何与玻璃制造、显微镜和其他光学仪器有关的题材。&lt;br /&gt;&lt;br /&gt;他回到曾经在那里学习化学和数学的耶拿大学后，1846年，Zeiss刚满30岁，他开始在耶拿建立了工作室，有20个雇员，早期产品是放大镜片和简单的显微镜。1858年开始生产复合型显微镜。Carl Zeiss赢得了高质量产品的声誉，并于1861年在图林根州的展览会上获得了金牌。&lt;br /&gt;&lt;br /&gt;Carl Zeiss所有的工作都是凭经验，既试错法来完成的。显然这种生产方法要消耗大量的时间和浪费大量的材料。Zeiss相信会有种科学的方法，能够更精确、可预见和更经济地生产镜片。Zeiss对此进行了五年的努力，最终无功而返。于是在1866年，他访问了耶拿大学，在那里遇到了当时在大学作讲师的Ernst Abbe.&lt;br /&gt;&lt;br /&gt;Ernst Karl Abbe生于1840年元月23日，出生在Eisenach。Abbe在21岁时就毕业于Goettengen大学，1863年到耶拿大学工作，于1870年成为物理和数学教授。1878年成为天文和气象台的主管。1866年Abbe就以研究导师的身份加入了Zeiss的工作室，两人开始研究生产光学产品的科学基础结构。经过六年对新型光学玻璃的研究，终于在1872年制造出无与伦比的复合显微镜。这台仪器是今天所有现代复合显微镜的鼻祖。&lt;br /&gt;&lt;br /&gt;在开始生产Carl Zeiss复合显微镜的第二年，1873年，Abbe发表了一篇科学论文，对如何设计完美的复合式显微镜的数学方法作了详细的描述，第一次详细地叙述了光学设计中的像差、衍射、慧型像差等内容。Abbe对光学过程描述得如此详细，以至于这篇论文成为了现代光学的基础。作为其发明的奖励，Carl Zeiss于1876年邀请Abbe作为合作者。&lt;br /&gt;1879年，Abbe邀请了第三个合作伙伴Freidrick Otto Schott加入其阵营，共同致力于改进显微镜。当时Freidrick Otto Schott正在研究将锂加入到一种新型的光学玻璃，并致函给Abbe，说明其进展。Abbe博士立刻对这种新型玻璃产生了兴趣，随即对玻璃进行了测试，并高度地赞扬了Schott的研究结果。他们两人很快见了面，并形成了维系他们后半生的协议。Schott专门生产用于新型Carl Zeiss显微镜的玻璃，1884年建立了一个全面的工厂，其所有权归属于Carl Zeiss、Ernst Abbe和Freidrick Otto Schott，称为Jena Schott &amp; Genossen光学工厂。Schott研制出100多种不同类型的光学玻璃，还有多种用于装饰及功能性玻璃。从此耶拿玻璃成为世界上最有名的玻璃。&lt;br /&gt;&lt;br /&gt;我们是不是一直向往用一个机身通用各厂镜头？其实不夸张说，这个想法三十年前就已经实现了,那就是——M42螺口系统！&lt;br /&gt;&lt;br /&gt;M42×1是三十年前风行一时的相机接口。它出现在二战前的德国，50年代起，由德国KW（Kamera-Werkstatten）推动此规格镜头盛行于世。许多著名相机生产厂都生产过M42×1接口镜头，如西德的Carl Zeiss、Schneider、Schacht、Enna、Rodenstock、Voigtlander、Kilfitt，东德的Carl Zeiss Jena、Meyer、Pentacon，法国的Angenieux，日本的Pentax、Fujica、Mamiya、Olympus、Yashica、Chinon、Cosina，美国的Vivitar等。目前俄罗斯和乌克兰还有M42螺口的镜头在生产，而且日本的Cosina公司又复古地推出了以Voigtlander为品牌的多款M42镜头和机身，看来，世界大一统的想法至今未绝。&lt;br /&gt;&lt;br /&gt;那个时代是机械相机技术发展、工艺完善的一个巅峰时代，不管是机身还是镜头，都把它当作工艺品一样精心制作。因为同用一种接口，所以竞争十分激烈。镜头手感或成像稍不满意，用户就会换用别家的镜头，所以各个镜头生产厂都不惜成本，只为在竞争中领先。不像现在各个厂家都是各自为政，各有各的卡口，只能自己和自己比，用户不满意就得连机身一起换系统。&lt;br /&gt;&lt;br /&gt;正是因为这个原因，M42时期的各个厂家生产的镜头基本上都是精品，做工考究，成像优良。那时的镜头，基本都是全金属结构，调焦手感极佳。成像嘛，现代镜头发展起来的是变焦技术，由此发展出了非球面镜和超低色散镜片。但这些技术对定焦镜头来说作用并不大，反而会大大增加成本，所以从成像质量来讲，30年前的定焦镜头表现已然十分优秀。&lt;br /&gt;&lt;br /&gt;那时的理念是用尽量少的镜片来设计出最优秀的镜头，关键在设计，所以出现了一批经典结构。而现在镜片是能加就加，甚至个别镜头的镜片组合达到20片以上！那时的镜头全部用的是光学玻璃，而现在是模铸的甚至是有机玻璃的，再镀以增透膜，制造成本要比从前低多了。比较起来，只有在抗眩光技术上，由于早期M42镜头缺少多层镀膜技术，所以比现代镜头明显差上一截。&lt;br /&gt;&lt;br /&gt;M42机身由于是三、四十年，甚至是五十年前的东西了，测光元件老化是一个普遍现象，而且那时用的电池目前早已不生产了，即使找到测光正常的机身，也得找现代电池替代。所以现在找二手的M42机身，不能苛求测光是否准确了，只能把它当纯手动相机来玩儿。我用过的M42机身有PENTAX SPF、FUJICA ST801、YASHICA TL ELECTRO X和最新出的Voigtlander Bessaflex TM。Voigtlander就不用说了，新机器嘛，各项指标都令人十分满意。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-4957587929675082557?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/4957587929675082557/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=4957587929675082557' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/4957587929675082557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/4957587929675082557'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2010/06/photography.html' title='photography'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-2016356953533704527</id><published>2010-04-02T17:54:00.001-07:00</published><updated>2010-04-02T17:54:35.428-07:00</updated><title type='text'>.vimrc</title><content type='html'>set nocompatible&lt;br /&gt;source $VIMRUNTIME/vimrc_example.vim&lt;br /&gt;&lt;br /&gt;set diffexpr=MyDiff()&lt;br /&gt;function MyDiff()&lt;br /&gt;  let opt = '-a --binary '&lt;br /&gt;  if &amp;diffopt =~ 'icase' | let opt = opt . '-i ' | endif&lt;br /&gt;  if &amp;diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif&lt;br /&gt;  let arg1 = v:fname_in&lt;br /&gt;  if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif&lt;br /&gt;  let arg2 = v:fname_new&lt;br /&gt;  if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif&lt;br /&gt;  let arg3 = v:fname_out&lt;br /&gt;  if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif&lt;br /&gt;  let eq = ''&lt;br /&gt;  if $VIMRUNTIME =~ ' '&lt;br /&gt;    if &amp;sh =~ '\&lt;cmd'&lt;br /&gt;      let cmd = '""' . $VIMRUNTIME . '\diff"'&lt;br /&gt;      let eq = '"'&lt;br /&gt;    else&lt;br /&gt;      let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'&lt;br /&gt;    endif&lt;br /&gt;  else&lt;br /&gt;    let cmd = $VIMRUNTIME . '\diff'&lt;br /&gt;  endif&lt;br /&gt;  silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' &gt; ' . arg3 . eq&lt;br /&gt;endfunction&lt;br /&gt;&lt;br /&gt;:filetype on&lt;br /&gt;set expandtab&lt;br /&gt;set sts=4&lt;br /&gt;set shiftwidth=4&lt;br /&gt;set foldcolumn=4&lt;br /&gt;set guifont=Consolas:h9:cANSI&lt;br /&gt;set guioptions=em&lt;br /&gt;:colorscheme murphy&lt;br /&gt;set lines=44&lt;br /&gt;set columns=126&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-2016356953533704527?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/2016356953533704527/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=2016356953533704527' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/2016356953533704527'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/2016356953533704527'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2010/04/vimrc.html' title='.vimrc'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-2549055241590110169</id><published>2010-03-08T12:21:00.000-08:00</published><updated>2010-03-08T12:24:24.044-08:00</updated><title type='text'>c++ copy constructor</title><content type='html'>#include &lt;iostream&gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;class obj&lt;br /&gt;{&lt;br /&gt;  public:&lt;br /&gt;    obj(int);&lt;br /&gt;    obj(const obj &amp;);&lt;br /&gt;    int getvalue(void);&lt;br /&gt;  private:&lt;br /&gt;    int value;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;obj::obj(int a)&lt;br /&gt;{&lt;br /&gt;  value = a;&lt;br /&gt;  cout &lt;&lt; "this is constructor" &lt;&lt; endl;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;obj::obj(const obj &amp; ab) // &lt;-- this is copy constructor format&lt;br /&gt;{&lt;br /&gt;  value = ab.value; // &lt;-- surprise!, in copy constructor you can use other obj's private value. real no surprise, thus other object is the same type. use a function will ruin the const prefix. &lt;br /&gt;  cout &lt;&lt; "this is copy constructor" &lt;&lt; endl;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int obj::getvalue(void)&lt;br /&gt;{&lt;br /&gt;  return value;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main(void)&lt;br /&gt;{&lt;br /&gt;  obj obj1 = obj(1); // &lt;-- this calls constructor&lt;br /&gt;  obj obj2(obj1); // &lt;-- this calls copy constructor&lt;br /&gt;  return 0;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-2549055241590110169?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/2549055241590110169/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=2549055241590110169' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/2549055241590110169'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/2549055241590110169'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2010/03/c-copy-constructor.html' title='c++ copy constructor'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-1948055433794540753</id><published>2010-03-07T00:04:00.000-08:00</published><updated>2010-03-07T00:59:32.074-08:00</updated><title type='text'>graph work flow in latex document preparation under linux</title><content type='html'>Graphs make document illustrative.&lt;br /&gt;&lt;br /&gt;Eps or pdf can be used in latex document preparation. But not both. Eps is great at vector graph and so is pdf while pdf can handle nature image as well but not for eps. So the choice is to use pdf as the output format for our document.&lt;br /&gt;&lt;br /&gt;Use&lt;br /&gt;\usepackage[pdftex]{graphicx}&lt;br /&gt;in the latex header part, and in the body part, use&lt;br /&gt;\includegraphics[width=2in]{graphname}&lt;br /&gt;graphname is the file name for the graph without the tail .pdf.&lt;br /&gt;&lt;br /&gt;There are two source of graph. One is computer generated, the other is natural image.&lt;br /&gt;For compute generated, we take diagram as example.&lt;br /&gt;&lt;br /&gt;1. Open Dia to draw the diagram.&lt;br /&gt;2. Save as .dia so we can modify the diagram later.&lt;br /&gt;3. Save as .eps so we still know the boundary.&lt;br /&gt;4. use convert to convert eps to pdf.&lt;br /&gt;5. Open the .pdf file in Inkscape. In page setup, use fit size to selected option after select the content box.&lt;br /&gt;6. Save the output .pdf from Inkscape.&lt;br /&gt;&lt;br /&gt;For the natural image&lt;br /&gt;1. Use convert command to convert other format to pdf.&lt;br /&gt;2. Use Inkscape again to trim the pdf to proper size.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-1948055433794540753?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/1948055433794540753/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=1948055433794540753' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/1948055433794540753'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/1948055433794540753'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2010/03/graph-work-flow-in-latex-document.html' title='graph work flow in latex document preparation under linux'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-8193587420930945189</id><published>2010-03-05T17:41:00.000-08:00</published><updated>2010-03-05T18:57:54.706-08:00</updated><title type='text'>emacs windows command and work flow</title><content type='html'>we cant split windows to have more windows and we can have different windows to have the same buffer or different buffers.&lt;br /&gt;&lt;br /&gt;splitting windows:&lt;br /&gt;cx 2 split vertically&lt;br /&gt;cx 3 split horizontally&lt;br /&gt;&lt;br /&gt;Using other windwos&lt;br /&gt;cx o select next window&lt;br /&gt;&lt;br /&gt;Displaying in another window&lt;br /&gt;cx 4 b select buffer in next window and move to the next window&lt;br /&gt;cx 4 co select buffer in next window&lt;br /&gt;cx 4 f open file in next window&lt;br /&gt;cx 4 d open dir in next window&lt;br /&gt;cx 4 m start composing a mail message in another window&lt;br /&gt;cx 4 . find a tag in the current tag table in another window&lt;br /&gt;cx 4 r open a file readonly in the next window.&lt;br /&gt;&lt;br /&gt;Deleting and Rearranging Windows&lt;br /&gt;cx 0 kill the current window&lt;br /&gt;cx 1 maximize the current window&lt;br /&gt;cx ^ make selected window taller&lt;br /&gt;cx } make selected window wider&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-8193587420930945189?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/8193587420930945189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=8193587420930945189' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/8193587420930945189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/8193587420930945189'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2010/03/emacs-windows-command-and-work-flow.html' title='emacs windows command and work flow'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-809376918235382442</id><published>2010-03-04T19:20:00.000-08:00</published><updated>2010-03-05T17:39:11.419-08:00</updated><title type='text'>emacs buffer command and work flow</title><content type='html'>every content part in emacs is in a buffer, it's not necessary to have a buffer corresponding to a file. Usually we have a lisp interpreter buffer, text buffer and help buffer. Here a list of command around buffer is listed.&lt;br /&gt;&lt;br /&gt;cx b switch buffers&lt;br /&gt;cx k close buffer&lt;br /&gt;cx 2 split buffer&lt;br /&gt;cx 1 make the buffer where cursor in the only visible buffer&lt;br /&gt;cx o Switch between the buffers on-screen&lt;br /&gt;cx 4 b select a buffer but open in another window.&lt;br /&gt;cx cb list existing buffer&lt;br /&gt;cx cq toggle read only of the buffer&lt;br /&gt;mx rename-buffer change the buffer name&lt;br /&gt;mx view-buffer scroll through the buffer&lt;br /&gt;cx k kill the buffer&lt;br /&gt;mx kill-some-buffers offer kill buffer one by one&lt;br /&gt;mx buffer-menu begin editing a buffer listing all emacs buffers, commands are:&lt;br /&gt;  d delete and move down, cd delete and move up, s save the buffer, ~ make buffer unmodified, x perform operation, u remove operation on current line and move down, &lt;br /&gt;&lt;br /&gt;1 Select the buffer in a full-screen window.&lt;br /&gt;2 set up two windows, with this buffer in one, and the previously selected buffer&lt;br /&gt;f select the buffer in place of the `*Buffer List*' buffer.&lt;br /&gt;o select the buffer in another window as if by C-x 4 b, leaving `*Buffer List*' visible.&lt;br /&gt;q select this buffer, and also display in other windows any buffers previously flagged with the m command. If there are no such buffers, this command is equivalent to 1.&lt;br /&gt;m Flag this buffer to be displayed in another window if the q command is used. The request shows as a `&gt;' at the beginning of the line. The same buffer may not have both a delete request and a display request.&lt;br /&gt;&lt;br /&gt;The following are some common work flow related to the buffer operation in the emacs.&lt;br /&gt;&lt;br /&gt;I have read a file and want to look if there is other buffer opened: cx cb&lt;br /&gt;then i want to switch back to let the working window has the full screen: cx 1&lt;br /&gt;if I get other file to open, and want to switch to other buffer: cx b&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-809376918235382442?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/809376918235382442/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=809376918235382442' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/809376918235382442'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/809376918235382442'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2010/03/emacs-buffer-command-and-work-flow.html' title='emacs buffer command and work flow'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-4151052532836043491</id><published>2010-03-04T17:28:00.000-08:00</published><updated>2010-03-04T18:27:00.859-08:00</updated><title type='text'>learning emacs</title><content type='html'>Learning Emacs, get to know the following command:&lt;br /&gt;&lt;br /&gt;program control:&lt;br /&gt;cx cf open or create a file&lt;br /&gt;cx cs save file&lt;br /&gt;cx s save all open buffers&lt;br /&gt;cx cw save file as&lt;br /&gt;cx cc exit &lt;br /&gt;cg cancel current command&lt;br /&gt;cl redisplay screen and center on cursor&lt;br /&gt;c/ undo action&lt;br /&gt;cx d open directory&lt;br /&gt;&lt;br /&gt;cursor movement&lt;br /&gt;cn next line&lt;br /&gt;cp previous line&lt;br /&gt;cf forward a line&lt;br /&gt;cb back a line&lt;br /&gt;ca beginning of line&lt;br /&gt;ce end of line&lt;br /&gt;cv page down&lt;br /&gt;av page up&lt;br /&gt;a&lt; move to beggining of file&lt;br /&gt;a&gt; move to end of file&lt;br /&gt;ax goto-line n go to line n&lt;br /&gt;&lt;br /&gt;Editing&lt;br /&gt;ck kill line&lt;br /&gt;cd erase next char&lt;br /&gt;ad drase word&lt;br /&gt;delete delete&lt;br /&gt;c&lt;space&gt; begin marking&lt;br /&gt;cw delete region from begin of mark to current cursor position. content is moved to kill ring buffer&lt;br /&gt;cy insert content of kill ring buffer at cursor position&lt;br /&gt;ay if typed after a cy, it goes through nay entries in the kill ring and replaces the cy insert with the next former kill ring entry&lt;br /&gt;aw copy content of region from marked begging to current cursor location into the kill ring buffer&lt;br /&gt;ct transpose characters on either side of cursor&lt;br /&gt;at transpose words on either side of cursor&lt;br /&gt;cq escape the special meaning of the next char, if want to insert a control into the code, you type cq cc.&lt;br /&gt;cc cc comment out a marked region&lt;br /&gt;cu cc cc uncomment out the marked region.&lt;br /&gt;&lt;br /&gt;Search and replace&lt;br /&gt;cs search for string starting at the cursor. The line at the botton of the window hs you type in the string you search for. The search is donw as you type. To look for the next occurannce, hit cs again, and your last entry is used as the default search string. if you hist the bottom of the buffer, you type cs again to go back to the top.&lt;br /&gt;cr reverse search. same as cs above, excpet it seraches backward from the cursor.&lt;br /&gt;ax replace-string works from current cursor locatin. begins a two part dialog, the bottom of the it first asks for the string you want to search for, and then asks for what you want to replace it with. This operation immediately works on the entire buffer.&lt;br /&gt;a% query replace string. works from current cursor location. begins a two part dialog, at the botton of the window it asks you waht you want to search for and then waht you want to search for and then waht want to replace it with. It then searches for each occurance of the string and highlights the match. If you want the replacement to occur, hit the space bar, if you want it to skip this match , hit the delete key.&lt;br /&gt;&lt;br /&gt;Buffers, Regions, Windows&lt;br /&gt;cx 2 split window into two equal sized buffers, one on top of the other&lt;br /&gt;cx 3 split window into two equal sized buffers, on to the left/right of the other.&lt;br /&gt;cx o move the cursor to the next buffer in the visible window&lt;br /&gt;cx 5 2 create a new window, with the contents of the current buffer in the new window as well.&lt;br /&gt;cx 1 if in a two buffer window, have the buffer that the cursor is in take up the entire window.&lt;br /&gt;cx 0 if in a two buffer window, have the buffer that the cursor is not in take up the entire window&lt;br /&gt;cx b shift back to the most recent buffer you were visiting prior to your current buffer&lt;br /&gt;cx b filename shift to the named filename bufer&lt;br /&gt;cx cb list all of the buffers currently perned. if the curosr is on a linein this buffer window, type an e will open that buffer in the current buffer, typing an o will open it in a second buffer in the current window.&lt;br /&gt;cx k kill the current buffer. If the buffer is not saved you will be prompted to save it.&lt;br /&gt;&lt;br /&gt;Printing&lt;br /&gt;ax print-buffer prints the current buffer&lt;br /&gt;ax print-region prints the current marked region&lt;br /&gt;&lt;br /&gt;Command Shell&lt;br /&gt;ax shell creates a command shell on the native os. all of emacs commands work within this shell for cutting and pasting.&lt;br /&gt;ap yank command from prior command history&lt;br /&gt;an next command from prior command history&lt;br /&gt;cx k kill buffer and the shell along with it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-4151052532836043491?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/4151052532836043491/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=4151052532836043491' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/4151052532836043491'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/4151052532836043491'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2010/03/learning-emacs.html' title='learning emacs'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-6624154255410591146</id><published>2010-02-20T19:51:00.000-08:00</published><updated>2010-02-20T19:54:42.312-08:00</updated><title type='text'>logitech usb head set burn down</title><content type='html'>I have used two logitech usb head set, the latest one is A-0374A. I plug into usb slot but the usb chip burn down. Two are burn down like this. That's so sad. I search the net and find no posts about this issue. I will try to figure our the problematic chip and try to find logitech to give me replacement.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-6624154255410591146?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/6624154255410591146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=6624154255410591146' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/6624154255410591146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/6624154255410591146'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2010/02/logitech-usb-head-set-burn-down.html' title='logitech usb head set burn down'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-309210846187826439</id><published>2010-02-17T20:27:00.000-08:00</published><updated>2010-02-17T20:28:37.509-08:00</updated><title type='text'>Uniform Spherical Distribution</title><content type='html'>&lt;a href="http://en.wikibooks.org/wiki/Mathematica/Uniform_Spherical_Distribution"&gt;http://en.wikibooks.org/wiki/Mathematica/Uniform_Spherical_Distribution&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: sans-serif; font-size: 22px; line-height: 32px; "&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;In this tutorial, we will plot a set of random, uniformly distributed, points on the surface of a sphere. This seems like a trivial task, but we will see that the "obvious" solution is actually incorrect. We will start off with this incorrect method, and then improve it to be correct.&lt;/p&gt;&lt;h2 style="color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; font-weight: normal; margin-top: 0px; margin-right: 0px; margin-bottom: 0.6em; margin-left: 0px; padding-top: 0.5em; padding-bottom: 0.17em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(170, 170, 170); font-size: 33px; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;span class="editsection" style="float: right; margin-left: 5px; font-size: 22px; "&gt;[&lt;a href="http://en.wikibooks.org/w/index.php?title=Mathematica/Uniform_Spherical_Distribution&amp;amp;action=edit&amp;amp;section=1" title="Edit section: Incorrect Method" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "&gt;edit&lt;/a&gt;]&lt;/span&gt;&lt;span class="mw-headline" id="Incorrect_Method"&gt;Incorrect Method&lt;/span&gt;&lt;/h2&gt;&lt;div class="thumb tright" style="margin-bottom: 0.5em; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: white; border-right-color: white; border-bottom-color: white; border-left-color: white; width: auto; clear: right; float: right; border-top-width: 0.5em; border-right-width: 0px; border-bottom-width: 0.8em; border-left-width: 1.4em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: white; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;div class="thumbinner" style="border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); padding-top: 3px !important; padding-right: 3px !important; padding-bottom: 3px !important; padding-left: 3px !important; background-color: rgb(249, 249, 249); font-size: 21px; text-align: center; overflow-x: hidden; overflow-y: hidden; width: 202px; "&gt;&lt;a href="http://en.wikibooks.org/wiki/File:Spherical_Coordinates_(Colatitude,_Longitude).svg" class="image" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;img alt="" src="http://upload.wikimedia.org/wikipedia/commons/thumb/5/51/Spherical_Coordinates_%28Colatitude%2C_Longitude%29.svg/200px-Spherical_Coordinates_%28Colatitude%2C_Longitude%29.svg.png" width="200" height="200" class="thumbimage" style="border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-width: initial; border-color: initial; vertical-align: middle; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); background-color: rgb(255, 255, 255); " /&gt;&lt;/a&gt;&lt;div class="thumbcaption" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-align: left; line-height: 1.4em; padding-top: 3px !important; padding-right: 3px !important; padding-bottom: 3px !important; padding-left: 3px !important; font-size: 19px; "&gt;&lt;div class="magnify" style="float: right; border-top-style: none !important; border-right-style: none !important; border-bottom-style: none !important; border-left-style: none !important; border-width: initial !important; border-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; background-position: initial initial !important; background-repeat: initial initial !important; "&gt;&lt;a href="http://en.wikibooks.org/wiki/File:Spherical_Coordinates_(Colatitude,_Longitude).svg" class="internal" title="Enlarge" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; display: block; border-top-style: none !important; border-right-style: none !important; border-bottom-style: none !important; border-left-style: none !important; border-width: initial !important; border-color: initial !important; background-position: initial initial !important; background-repeat: initial initial !important; "&gt;&lt;img src="http://bits.wikimedia.org/skins-1.5/common/images/magnify-clip.png" width="15" height="11" alt="" style="border-top-style: none !important; border-right-style: none !important; border-bottom-style: none !important; border-left-style: none !important; border-width: initial; border-color: initial; vertical-align: middle; display: block; border-width: initial !important; border-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: rgb(255, 255, 255); background-position: initial initial !important; background-repeat: initial initial !important; " /&gt;&lt;/a&gt;&lt;/div&gt;The Spherical Coordinate system we are using.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;In order to plot a point on a sphere's surface, we need two numbers: the colatitude, &lt;i&gt;φ&lt;/i&gt; and the longitude, &lt;i&gt;θ&lt;/i&gt;. We could use the latitude, which is given by 90°−&lt;i&gt;φ&lt;/i&gt;, but colatitude is the conventional quantiity to deal with.&lt;/p&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;Now, we will make the simplistic assumption that we can use a uniform distribution for both the colatitude and longitude. We will plot 6000 points over a half sphere only, as this will allow us to see the results more clearly.&lt;/p&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;Let's define these distributions:&lt;/p&gt;&lt;pre style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(249, 249, 249); line-height: 1.1em; "&gt;theta := RandomReal[ {0, Pi} ]; (* Uniform on [0,Pi], longitude, only goes halfway round*) phi   := RandomReal[ {0, Pi} ]; (* Uniform on [0,Pi], colatitude, from pole to pole *) &lt;/pre&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;You can easily alter the angle covered by changing the &lt;tt&gt;{0, Pi}&lt;/tt&gt; to your desired boundaries.&lt;/p&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;Notice that we have used the "set delayed" operator (&lt;tt&gt;:=&lt;/tt&gt;). We need this because when we build a table of the values in the next step, we want the &lt;tt&gt;Random[]&lt;/tt&gt; function to be called for each entry. If we do not do this, the values of &lt;tt&gt;theta&lt;/tt&gt; and &lt;tt&gt;phi&lt;/tt&gt; will be set above and never changed, resulting in 6000 identical points. We now make the table of data:&lt;/p&gt;&lt;pre style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(249, 249, 249); line-height: 1.1em; "&gt;dataPoints = Table[    {phi, theta},    {6000}]; &lt;/pre&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;Let's have a look at the distribution of the points:&lt;/p&gt;&lt;pre style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(249, 249, 249); line-height: 1.1em; "&gt;rectPlot = ListPlot[   dataPoints,   AxesLabel -&gt; {"\[Phi]", "\[Theta]"},   Ticks -&gt; {     {0, Pi/4, Pi/2, 3 Pi/4, Pi},     {0, Pi/4, Pi/2, 3 Pi/4, Pi}}   ] &lt;/pre&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;This produces the following output. We see that the points indeed appear to be uniformly distributed.&lt;/p&gt;&lt;div class="center" style="width: 1353px; text-align: center; "&gt;&lt;div class="floatnone" style="margin-left: auto; margin-right: auto; "&gt;&lt;a href="http://en.wikibooks.org/wiki/File:Uniform_Spherical_Distribution_1.png" class="image" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-left: auto; margin-right: auto; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;img alt="Uniform Spherical Distribution 1.png" src="http://upload.wikimedia.org/wikipedia/commons/0/01/Uniform_Spherical_Distribution_1.png" width="360" height="247" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; vertical-align: middle; margin-left: auto; margin-right: auto; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;We will now map these spherical coordinates into the Cartesian space. This transformation is standard:&lt;/p&gt;&lt;dl style="margin-top: 0.2em; margin-bottom: 0.5em; "&gt;&lt;dd style="line-height: 1.5em; margin-left: 2em; margin-bottom: 0.1em; "&gt;&lt;img class="tex" alt=" x = r \sin\phi \cos\theta \," src="http://upload.wikimedia.org/math/c/8/f/c8f8fcac7714767830e3f6a20016a343.png" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; vertical-align: middle; " /&gt;&lt;/dd&gt;&lt;dd style="line-height: 1.5em; margin-left: 2em; margin-bottom: 0.1em; "&gt;&lt;img class="tex" alt=" y = r \sin\phi \sin\theta \," src="http://upload.wikimedia.org/math/6/3/9/639a2ae4a7c591a5922c1a93d4957566.png" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; vertical-align: middle; " /&gt;&lt;/dd&gt;&lt;dd style="line-height: 1.5em; margin-left: 2em; margin-bottom: 0.1em; "&gt;&lt;img class="tex" alt=" z = r \cos\phi \," src="http://upload.wikimedia.org/math/2/5/1/2516a0e98b24ff2737e4f53d0bd39414.png" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; vertical-align: middle; " /&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;For our purposes, we will set &lt;i&gt;r&lt;/i&gt;=1. We make a function called &lt;tt&gt;sphericalToCartesian&lt;/tt&gt; to transform each two-element coordinate &lt;tt&gt;{φ,θ}&lt;/tt&gt; in the spherical system to a three-element coordinate,&lt;tt&gt;{x,y,z}&lt;/tt&gt;, in the Cartesian system.&lt;/p&gt;&lt;pre style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(249, 249, 249); line-height: 1.1em; "&gt;sphericalToCartesian[{phi_, theta_}] :=   {Sin[phi]*Cos[theta],    Sin[phi]*Sin[theta],    Cos[phi]}; &lt;/pre&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;We have a mapping, so all that remains is to apply it using the "map" operator, &lt;tt&gt;/@&lt;/tt&gt;, which will perform this on each point in &lt;tt&gt;dataPoints&lt;/tt&gt;:&lt;/p&gt;&lt;pre style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(249, 249, 249); line-height: 1.1em; "&gt;mappedPoints = sphericalToCartesian /@ dataPoints; &lt;/pre&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;Now that we have a set of points in the Cartesian system, we would like to see them. We make a set of points located at each point in&lt;tt&gt;mappedPoints&lt;/tt&gt; and show it. Here, we have the default view, and orthographic views from the top and front:&lt;/p&gt;&lt;pre style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(249, 249, 249); line-height: 1.1em; "&gt; points = Graphics3D[Point /@ mappedPoints];   Show[points]  Show[points, ViewPoint-&gt;{0,Infinity,0)}]  Show[points, ViewPoint-&gt;{0,0,Infinity)}] &lt;/pre&gt;&lt;table align="center" style="font-size: 22px; color: black; background-color: white; "&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;div class="center" style="width: 432px; text-align: center; "&gt;&lt;div class="floatnone" style="margin-left: auto; margin-right: auto; "&gt;&lt;a href="http://en.wikibooks.org/wiki/File:Uniform_Spherical_Distribution_2.png" class="image" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-left: auto; margin-right: auto; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;img alt="Uniform Spherical Distribution 2.png" src="http://upload.wikimedia.org/wikipedia/commons/thumb/9/96/Uniform_Spherical_Distribution_2.png/250px-Uniform_Spherical_Distribution_2.png" width="250" height="276" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; vertical-align: middle; margin-left: auto; margin-right: auto; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td&gt;&lt;div class="center" style="width: 432px; text-align: center; "&gt;&lt;div class="floatnone" style="margin-left: auto; margin-right: auto; "&gt;&lt;a href="http://en.wikibooks.org/wiki/File:Uniform_Spherical_Distribution_3.png" class="image" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-left: auto; margin-right: auto; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;img alt="Uniform Spherical Distribution 3.png" src="http://upload.wikimedia.org/wikipedia/commons/thumb/c/ce/Uniform_Spherical_Distribution_3.png/250px-Uniform_Spherical_Distribution_3.png" width="250" height="126" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; vertical-align: middle; margin-left: auto; margin-right: auto; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td&gt;&lt;div class="center" style="width: 432px; text-align: center; "&gt;&lt;div class="floatnone" style="margin-left: auto; margin-right: auto; "&gt;&lt;a href="http://en.wikibooks.org/wiki/File:Uniform_Spherical_Distribution_4.png" class="image" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-left: auto; margin-right: auto; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;img alt="Uniform Spherical Distribution 4.png" src="http://upload.wikimedia.org/wikipedia/commons/thumb/d/d1/Uniform_Spherical_Distribution_4.png/250px-Uniform_Spherical_Distribution_4.png" width="250" height="250" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; vertical-align: middle; margin-left: auto; margin-right: auto; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;We see that the points are certainly &lt;i&gt;not&lt;/i&gt; distributed evenly - they are much more dense at the poles. This is because the mapping from spherical to Cartesian coordinates does not preserve area - the spherical space is pinched and compressed at the poles by the mapping. In order to fix this, we must alter our original distributions.&lt;/p&gt;&lt;h2 style="color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; font-weight: normal; margin-top: 0px; margin-right: 0px; margin-bottom: 0.6em; margin-left: 0px; padding-top: 0.5em; padding-bottom: 0.17em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(170, 170, 170); font-size: 33px; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;span class="editsection" style="float: right; margin-left: 5px; font-size: 22px; "&gt;[&lt;a href="http://en.wikibooks.org/w/index.php?title=Mathematica/Uniform_Spherical_Distribution&amp;amp;action=edit&amp;amp;section=2" title="Edit section: The Correct Method" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "&gt;edit&lt;/a&gt;]&lt;/span&gt;&lt;span class="mw-headline" id="The_Correct_Method"&gt;The Correct Method&lt;/span&gt;&lt;/h2&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;In order to find the correct distribution for &lt;tt&gt;theta&lt;/tt&gt; and &lt;tt&gt;phi&lt;/tt&gt;, we must consider the &lt;a href="http://en.wikipedia.org/wiki/Jacobian_determinant" class="extiw" title="w:Jacobian determinant" style="text-decoration: none; color: rgb(51, 102, 187); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "&gt;Jacobian determinant&lt;/a&gt; of the mapping &lt;tt&gt;sphericalToCartesian&lt;/tt&gt;. This will tell us how the spherical space is pinched by the transformation at each point.&lt;/p&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;We must find the Jacobian matrix first. We will leave &lt;i&gt;r&lt;/i&gt; in for the moment, as Mathematica will be crunching the numbers. The evaluated Jacobian matrix is shown below, but we will let Mathematica work it out from the beginning.&lt;/p&gt;&lt;dl style="margin-top: 0.2em; margin-bottom: 0.5em; "&gt;&lt;dd style="line-height: 1.5em; margin-left: 2em; margin-bottom: 0.1em; "&gt;&lt;img class="tex" alt="J_F(r,\phi,\theta) =\begin{bmatrix} \dfrac{\partial x}{\partial r} &amp;amp; \dfrac{\partial x}{\partial \phi} &amp;amp; \dfrac{\partial x}{\partial \theta} \\[3pt] \dfrac{\partial y}{\partial r} &amp;amp; \dfrac{\partial y}{\partial \phi} &amp;amp; \dfrac{\partial y}{\partial \theta} \\[3pt] \dfrac{\partial z}{\partial r} &amp;amp; \dfrac{\partial z}{\partial \phi} &amp;amp; \dfrac{\partial z}{\partial \theta} \\ \end{bmatrix}=\begin{bmatrix}  	\sin\phi \cos\theta &amp;amp; r \cos\phi \cos\theta  &amp;amp; -r \sin\phi \sin\theta \\ 	\sin\phi \sin\theta &amp;amp;  r \cos\phi \sin\theta &amp;amp; r \sin\phi \cos\theta \\  	\cos\phi            &amp;amp; -r \sin\phi            &amp;amp;  0                     \end{bmatrix}. " src="http://upload.wikimedia.org/math/4/6/3/46343646150bcd055621dd9f51f03eb5.png" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; vertical-align: middle; " /&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;We will construct this matrix very easily using the &lt;tt&gt;Outer[]&lt;/tt&gt; function, which takes every possible combinations of each element except the first, and gives them as arguments to the function in the first element. Again, we must not evaluate this yet, as if we do, Mathematica will take the inputs &lt;tt&gt;f_&lt;/tt&gt; and &lt;tt&gt;x_&lt;/tt&gt; as "atomic," meaning that they cannot be broken down and therefore are unsuitable for inputs to &lt;tt&gt;Outer[]&lt;/tt&gt;.&lt;/p&gt;&lt;pre style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(249, 249, 249); line-height: 1.1em; "&gt;jacMat[f_, x_] := Outer[D, f, x] &lt;/pre&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;This statement will take a list of directions (i.e. &lt;i&gt;r&lt;/i&gt;, &lt;i&gt;φ&lt;/i&gt;, &lt;i&gt;θ&lt;/i&gt;), and a list of the same length of functions, which are the mappings taking these to the target space, in this case, Cartesian. This simple statement doesn't check that you have given it lists as inputs, and doesn't ensure they are same length. However, we know the lengths are right, so we won't bother with this.&lt;/p&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;We now define the list of directions. First, we must remove our previous definitions of &lt;tt&gt;phi&lt;/tt&gt; and &lt;tt&gt;theta&lt;/tt&gt;, (and &lt;tt&gt;r&lt;/tt&gt; for good measure) as at the moment, they will inject a single random number each into the above statement, rather than a symbolic quantity. We also define the list of functions, which can be obtained by giving our now-symbolic directions as arguments to &lt;tt&gt;sphericalToCartesian&lt;/tt&gt;.&lt;/p&gt;&lt;pre style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(249, 249, 249); line-height: 1.1em; "&gt;Remove[r, phi, theta] dirs = {r, phi, theta} map = sphericalToCartesian[{r, phi, theta}] &lt;/pre&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;In order to find the Jacobian matrix and determinant, we now put:&lt;/p&gt;&lt;pre style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(249, 249, 249); line-height: 1.1em; "&gt;jmat[map, dirs] Simplify[Det[%]] &lt;/pre&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;The output is:&lt;/p&gt;&lt;pre style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(249, 249, 249); line-height: 1.1em; "&gt;&lt;span style="color: gray; "&gt;{{Cos[theta] Sin[phi], -r Sin[phi] Sin[theta],  r Cos[phi] Cos[theta]},   {Sin[phi] Sin[theta],  r Cos[theta] Sin[phi],  r Cos[phi] Sin[theta]},   {Cos[phi],             0,                     -r Sin[phi]}}&lt;/span&gt; &lt;/pre&gt;&lt;pre style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(249, 249, 249); line-height: 1.1em; "&gt;&lt;span style="color: gray; "&gt;r^2 Sin[phi]&lt;/span&gt; &lt;/pre&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;We see that the Jacobian matrix is rearranged, but in Jacobians, it is exactly equivalent, as it just depends on the order of specification of the directions and functions. The Jacobian determinant is independent of the longitude, &lt;tt&gt;theta&lt;/tt&gt;, so our uniform distribution in spherical coordinates will be uniform in Cartesian space. However, &lt;tt&gt;phi&lt;/tt&gt; will not be, as as it changes, the Jacobian also changes. &lt;tt&gt;r&lt;/tt&gt; also does this, but as we can just deal with a unit sphere, we can cut it out of the equation now.&lt;/p&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;There exists a method called the "Inverse CDF Method" which allows us to generate samples of a given probability density function from a set of uniformly distributed numbers between 0 and 1 (just like Mathematica's &lt;tt&gt;Random[]&lt;/tt&gt;).&lt;/p&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;To use this method, we must first find the CDF of the PDF given by the Jacobian determinant. We normalise (to give a total probability of 1) by dividing by the area under the curve. &lt;&lt;tt&gt;&gt;t&lt;/tt&gt; is a dummy variable.&lt;/p&gt;&lt;pre style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(249, 249, 249); line-height: 1.1em; "&gt;area = Integrate[Sin[t], {t, 0, Pi}];(*Area under PDF*) cdf[y_] = Integrate[Sin[t]/area, {t, 0, y}](*CDF*) &lt;/pre&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;We now find the inverse of the CDF:&lt;/p&gt;&lt;pre style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(249, 249, 249); line-height: 1.1em; "&gt;Solve[x == cdf[y], y](*Get distribution transform*) &lt;/pre&gt;&lt;pre style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(249, 249, 249); line-height: 1.1em; "&gt;&lt;span style="color: gray; "&gt;{{y -&gt; -2 ArcSin[Sqrt[x]]}, {y -&gt; 2 ArcSin[Sqrt[x]]}}&lt;/span&gt; &lt;/pre&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;We take the positive solution, and we can now set our &lt;tt&gt;theta&lt;/tt&gt; and &lt;tt&gt;phi&lt;/tt&gt; distributions:&lt;/p&gt;&lt;pre style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(249, 249, 249); line-height: 1.1em; "&gt; theta := RandomReal[ {0, Pi} ]; (* Uniform on [0,Pi], longitude, only goes halfway round*)  phi   := 2 ArcSin[Sqrt[Random[]]]; (* Colatitude, from pole to pole *) &lt;/pre&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;We now plot the points exactly as before:&lt;/p&gt;&lt;pre style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(249, 249, 249); line-height: 1.1em; "&gt;dataPoints = Table[{phi, theta}, {6000}]; rectPlot = ListPlot[   dataPoints,   AxesLabel -&gt; {"\[Phi]", "\[Theta]"},   Ticks -&gt; {     {0, Pi/4, Pi/2, 3 Pi/4, Pi},     {0, Pi/4, Pi/2, 3 Pi/4, Pi}}   ] sphericalToCartesian[{phi_, theta_}] :=    {Sin[phi]*Cos[theta],     Sin[phi]*Sin[theta],     Cos[phi]};  mappedPoints = sphericalToCartesian /@ dataPoints; points = Graphics3D[Point /@ mappedPoints]; Show[points] Show[points, ViewPoint -&gt; {0, 0, Infinity}] Show[points, ViewPoint -&gt; {0, Infinity, 0}] &lt;/pre&gt;&lt;div class="center" style="width: 1353px; text-align: center; "&gt;&lt;div class="floatnone" style="margin-left: auto; margin-right: auto; "&gt;&lt;a href="http://en.wikibooks.org/wiki/File:Uniform_Spherical_Distribution_5.png" class="image" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-left: auto; margin-right: auto; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;img alt="Uniform Spherical Distribution 5.png" src="http://upload.wikimedia.org/wikipedia/commons/d/d6/Uniform_Spherical_Distribution_5.png" width="360" height="228" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; vertical-align: middle; margin-left: auto; margin-right: auto; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;We have reduced the distribution density around the poles.&lt;/p&gt;&lt;table align="center" style="font-size: 22px; color: black; background-color: white; "&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;div class="center" style="width: 432px; text-align: center; "&gt;&lt;div class="floatnone" style="margin-left: auto; margin-right: auto; "&gt;&lt;a href="http://en.wikibooks.org/wiki/File:Uniform_Spherical_Distribution_6.png" class="image" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-left: auto; margin-right: auto; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;img alt="Uniform Spherical Distribution 6.png" src="http://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Uniform_Spherical_Distribution_6.png/250px-Uniform_Spherical_Distribution_6.png" width="250" height="275" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; vertical-align: middle; margin-left: auto; margin-right: auto; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td&gt;&lt;div class="center" style="width: 432px; text-align: center; "&gt;&lt;div class="floatnone" style="margin-left: auto; margin-right: auto; "&gt;&lt;a href="http://en.wikibooks.org/wiki/File:Uniform_Spherical_Distribution_7.png" class="image" style="text-decoration: underline; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-left: auto; margin-right: auto; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;img alt="Uniform Spherical Distribution 7.png" src="http://upload.wikimedia.org/wikipedia/commons/thumb/8/8b/Uniform_Spherical_Distribution_7.png/250px-Uniform_Spherical_Distribution_7.png" width="250" height="126" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; vertical-align: middle; margin-left: auto; margin-right: auto; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;td&gt;&lt;div class="center" style="width: 432px; text-align: center; "&gt;&lt;div class="floatnone" style="margin-left: auto; margin-right: auto; "&gt;&lt;a href="http://en.wikibooks.org/wiki/File:Uniform_Spherical_Distribution_8.png" class="image" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-left: auto; margin-right: auto; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;img alt="Uniform Spherical Distribution 8.png" src="http://upload.wikimedia.org/wikipedia/commons/thumb/6/6e/Uniform_Spherical_Distribution_8.png/250px-Uniform_Spherical_Distribution_8.png" width="250" height="250" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; vertical-align: middle; margin-left: auto; margin-right: auto; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;We have now made it so that the points are evenly distributed over the spherical area.&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-309210846187826439?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/309210846187826439/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=309210846187826439' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/309210846187826439'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/309210846187826439'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2010/02/uniform-spherical-distribution.html' title='Uniform Spherical Distribution'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-3647428726128728040</id><published>2009-09-05T13:26:00.000-07:00</published><updated>2009-09-05T13:27:22.203-07:00</updated><title type='text'>cci</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Arial; font-size: 18px; font-weight: bold; "&gt;&lt;h1 style="margin-top: 5px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 19px; background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: transparent; font-weight: bold; background-position: initial initial; "&gt;&lt;span class="Apple-style-span" style="font-family: arial; font-size: 16px; font-weight: normal; "&gt;&lt;a href="http://www.ccivalve.com/" class="l" onmousedown="return clk(this.href,'','','res','6','&amp;amp;sig2=ADSNIt4tT_iorQpPt4g-ew')" style="color: rgb(85, 26, 139); "&gt;&lt;em style="font-weight: bold; font-style: normal; "&gt;CCI Control Components Inc&lt;/em&gt;&lt;/a&gt;&lt;/span&gt;&lt;/h1&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-3647428726128728040?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/3647428726128728040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=3647428726128728040' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/3647428726128728040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/3647428726128728040'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2009/09/cci.html' title='cci'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-3018755663054519325</id><published>2009-08-30T13:57:00.000-07:00</published><updated>2009-08-30T13:58:04.267-07:00</updated><title type='text'>pure php ssh2 lib</title><content type='html'>&lt;a href="http://phpseclib.sourceforge.net/"&gt;http://phpseclib.sourceforge.net/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-3018755663054519325?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/3018755663054519325/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=3018755663054519325' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/3018755663054519325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/3018755663054519325'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2009/08/pure-php-ssh2-lib.html' title='pure php ssh2 lib'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-3103470649385590719</id><published>2009-08-30T13:33:00.001-07:00</published><updated>2009-08-30T13:33:58.190-07:00</updated><title type='text'>interesting viewer</title><content type='html'>&lt;a href="http://www.simpleviewer.net/tiltviewer/"&gt;http://www.simpleviewer.net/tiltviewer/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-3103470649385590719?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/3103470649385590719/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=3103470649385590719' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/3103470649385590719'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/3103470649385590719'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2009/08/interesting-viewer.html' title='interesting viewer'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-2143028363494702550</id><published>2009-08-21T21:01:00.000-07:00</published><updated>2009-08-21T21:02:25.705-07:00</updated><title type='text'>Install PHP under Apache and Vista</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: 'Lucida Grande'; color: rgb(97, 99, 106); font-size: 11px; line-height: 15px; "&gt;&lt;p&gt;&lt;a href="http://senese.wordpress.com/2007/06/06/install-php-5-under-apache-22-and-windows-vista/"&gt;http://senese.wordpress.com/2007/06/06/install-php-5-under-apache-22-and-windows-vista/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;I initially tried the msi installer for PHP 5. Unfortunately, it installs only PHP under CGI, which although it has some performance and security issues, might be ok for a quick and dirty development environment.&lt;/p&gt;&lt;p&gt;But the installer is badly broken. You’ll get an error something like&lt;/p&gt;&lt;pre&gt;PHP Fatal error:  require_once()[function.require]: Failed opening required 'SAM/php_sam.php' (include_path='.;C:php5pear') in sam_factory on line 1&lt;/pre&gt;&lt;p&gt;After fighting this for a couple of hours, I ended up installing manually anyway. I used this procedure to get PHP 5 running under Vista:&lt;/p&gt;&lt;ol&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; "&gt;&lt;a href="http://senese.wordpress.com/2007/06/06/installing-apache-on-windows-vista/" style="color: rgb(54, 118, 156); text-decoration: none; "&gt;Install the Apache webserver.&lt;/a&gt;&lt;/li&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; "&gt;Get the current version of PHP 5 from&lt;a href="http://www.php.net/downloads.php#v5" style="color: rgb(54, 118, 156); text-decoration: none; "&gt;http://www.php.net/downloads.php#v5&lt;/a&gt;. (It’s 5.2.3 at this time). Get both the zip file and the PECL zip file (which includes extensions).&lt;/li&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; "&gt;Uninstall any previous installations of PHP 5 (Start &gt; Control Panel &gt; Programs and Features). You may have to reboot your machine.&lt;/li&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; "&gt;Disconnect from the Internet. Turn off your firewall. Turn off your virus checker.&lt;/li&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; "&gt;&lt;a href="http://senese.wordpress.com/2007/06/06/stop-user-account-control-under-vista" style="color: rgb(54, 118, 156); text-decoration: none; "&gt;Turn off User Account Control (UAC)&lt;/a&gt;.&lt;/li&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; "&gt;Get an administrator prompt by going to All Programs &gt; Accessories. Right-Click “Command Prompt” and choose “Run as Administrator”&lt;/li&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; "&gt;Use the command prompt to manually remove directories containing previous PHP installations (like C:\Program Files\PHP…)&lt;/li&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; "&gt;Go to the directory where you’ve downloaded the PHP5 and PECL zipfiles. Extract the PHP zipfile. Rename the extracted php directory (which has a name something like php-5.2.3-Win32) to c:\php. Extract the PECL zipfile into c:\php\ext.&lt;/li&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; "&gt;In the command prompt, type:&lt;pre&gt;cd c:\php mkdir upload mkdir session copy php.ini-recommended php.ini&lt;/pre&gt;&lt;/li&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; "&gt;Open php.ini in Notepad:&lt;ol&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; "&gt;There are many variables… the following are important. Notice that starting a line with a semicolon in the ini file comments it out.&lt;pre&gt;upload_tmp_dir="C:\php\upload" session.save_path="C:\php\session" cgi.force_redirect=0 extension_dir ="C:\php\ext" display_errors = Off log_errors = On error_log = "C:\php\error_log"&lt;/pre&gt;&lt;/li&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; "&gt;You might want to look at upload_max_filesize. I’ve set mine to 16M. I also set post_max_size = 16M.&lt;/li&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; "&gt;Enable the extensions you need by deleting the semicolon at the beginning of the line. These will depend on your application… I’m going to be using MySQL (which I’ve already installed) and Moodle (which I’ll install later). My list looks like the following:&lt;pre&gt;extension=php_bz2.dll extension=php_curl.dll extension=php_dba.dll extension=php_dbase.dll ;extension=php_exif.dll extension=php_fdf.dll extension=php_gd2.dll extension=php_gettext.dll ;extension=php_gmp.dll ;extension=php_ifx.dll ;extension=php_imap.dll ;extension=php_interbase.dll extension=php_ldap.dll extension=php_mbstring.dll extension=php_mcrypt.dll extension=php_mhash.dll extension=php_mime_magic.dll ;extension=php_ming.dll ;extension=php_msql.dll ;extension=php_mssql.dll extension=php_mysql.dll extension=php_mysqli.dll ;extension=php_oci8.dll extension=php_openssl.dll ;extension=php_pdo.dll ;extension=php_pdo_firebird.dll ;extension=php_pdo_mssql.dll ;extension=php_pdo_mysql.dll ;extension=php_pdo_oci.dll ;extension=php_pdo_oci8.dll ;extension=php_pdo_odbc.dll ;extension=php_pdo_pgsql.dll ;extension=php_pdo_sqlite.dll ;extension=php_pgsql.dll ;extension=php_pspell.dll extension=php_shmop.dll ;extension=php_snmp.dll extension=php_soap.dll extension=php_sockets.dll ;extension=php_sqlite.dll ;extension=php_sybase_ct.dll extension=php_tidy.dll extension=php_xmlrpc.dll extension=php_xsl.dll extension=php_zip.dll&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; "&gt;Right-Click on Start &gt; Computer. Choose “Properties”, then “Advanced”. Click on “Environment Variables”. Click on PATH, then Edit… and add “;C:\php;c:\php\ext” (without quotes) to the end of the variable.&lt;/li&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; "&gt;Open your Apache configuration file (All Programs &gt; Apache HTTP Server 2.2.x &gt; Configure Apache Server &gt; Edit the Apache httpd.conf Configuration File). Add the following lines:&lt;pre&gt;LoadModule php5_module "C:\php\php5apache2_2.dll" AddType application/x-httpd-php .php AcceptPathInfo on PHPIniDir "C:\php"&lt;/pre&gt;&lt;p&gt;Look for the DirectoryIndex line. Add ” index.php” (no quotes) to the end of that line.&lt;/p&gt;&lt;p&gt;Save the file.&lt;/p&gt;&lt;/li&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; "&gt;Create a file named test.php in your Apache htdocs directory, containing this text: &lt;?php phpinfo(); ?&gt;&lt;/li&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; "&gt;Reboot your machine.&lt;/li&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; "&gt;Browse to http://localhost/test.php. You should see tabulated information about your working PHP installation.&lt;/li&gt;&lt;/ol&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-2143028363494702550?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/2143028363494702550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=2143028363494702550' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/2143028363494702550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/2143028363494702550'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2009/08/install-php-under-apache-and-vista.html' title='Install PHP under Apache and Vista'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-1804934351565279872</id><published>2009-08-04T20:42:00.000-07:00</published><updated>2009-08-04T21:48:14.286-07:00</updated><title type='text'>from chrome to os</title><content type='html'>It's like a long time ago, I feel like the browser is another os, espeically when you use it in full screen mode. It's a network os but without dedicated compiling language. Ok, I admit that javascript is not standarded in fact and it's not like elegant as my favorate Python; due to the security problem, it has no access to the local files; it's in single process. But it do lead to some wonder land.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;People always have dreams when they are young while they don't know how to achieve the goal, achieve it in a proper way or do it in fashion. From ages ago, people either want to post something and don't care what others say or communicate through dedicated channel that all people have one but have their own. Slim client, net computer, grid, you figure the name that people build to express the enthusiastic on distributed work place and one data and processing center. Nowadays, one data and processing center has became the one central access point and clould is behind the point. Millions transactions are running on data center. But people still have to use simple network application around text.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There are something missing and some people will patch the problem, while some problem is hard to solve as far as I can see. To have fully functional web application, a platform, something like an OS is necessary. The browser is better than a OS in the sense that it has the function over user interface while OS (actually, I mean old-fashioned batch system) don't; browser has instancely useable standarded language, Javascript, while OS don't. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But the horn is still sounding on the battle field between the browser and OS. Browser don't have control over resource, it runs on OS; An extension to this problem is that browser cannot get more resource if it's single processed. Another externsion to the problem is that browser will do the same task with less speed than OS, so to win, browser must be fast. In the sense of human interface, browser is fine at 2D interaction, especially around forms and text, which have rich structure; OS can do great job in 3D animation however. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So, peopel in action. Google Chrome has take its lead. The browser has a Javascript interpretor that only store difference between objects, which makes it fast. A window is a process, which can eat up more resource. And it will step over OS by the Chrome OS, which is chrome + Linux. Ha, another slim client in this decade. Will we see 3D in browser as well? Not recently, I believe. There is some 3D extension for browser out there. But 3D function is a plus for the network gigant. I believe 99% business over the network is in 2D form. And that's their target. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Finally, there is one large problem about the browser is that all the Javascript code can be seen by the final user. The saving is to put all business logic behind on the servers. But it opposes the purpose to use as much as resource on the client side. To find aid from copy right law is out of options. Maybe one day browser will cover the source code but always gives the user the right to choose to run the application or not. At that time, everything will come back to as it today.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-1804934351565279872?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/1804934351565279872/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=1804934351565279872' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/1804934351565279872'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/1804934351565279872'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2009/08/from-chrome-to-os.html' title='from chrome to os'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-2519147271935721078</id><published>2009-07-24T10:48:00.000-07:00</published><updated>2009-07-24T15:44:12.873-07:00</updated><title type='text'>dom event</title><content type='html'>in dom level2 event:&lt;br /&gt;mouse event is defined.&lt;br /&gt;&lt;br /&gt;mouse event:&lt;br /&gt;&lt;b&gt;click&lt;/b&gt;&lt;br /&gt;&lt;b&gt;mousedown&lt;br /&gt;&lt;/b&gt;&lt;b&gt;mouseup&lt;br /&gt;&lt;/b&gt;&lt;b&gt;mouseover&lt;br /&gt;&lt;/b&gt;&lt;b&gt;mousemove&lt;br /&gt;&lt;/b&gt;&lt;b&gt;mouseout&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;context info:&lt;br /&gt;altKey&lt;br /&gt;button&lt;br /&gt;clientX&lt;br /&gt;clientY&lt;br /&gt;ctrlKey&lt;br /&gt;metaKey&lt;br /&gt;relatedTarget&lt;br /&gt;screenX&lt;br /&gt;screenY&lt;br /&gt;shiftKey&lt;br /&gt;&lt;br /&gt;keyboard event is in dom level3 events&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;make div like a input text field.&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.w3.org/WAI/GL/WCAG20/WD-WCAG20-TECHS/SCR29.html"&gt;http://www.w3.org/WAI/GL/WCAG20/WD-WCAG20-TECHS/SCR29.html&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-2519147271935721078?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/2519147271935721078/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=2519147271935721078' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/2519147271935721078'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/2519147271935721078'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2009/07/dom-event.html' title='dom event'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-2297251496480240941</id><published>2009-07-22T17:06:00.000-07:00</published><updated>2009-07-22T17:10:53.036-07:00</updated><title type='text'>javascript term</title><content type='html'>http://www.webessence.nl/projects/terminal/#help&lt;br /&gt;http://www.masswerk.at/jsuix/&lt;br /&gt;http://cb.vu/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-2297251496480240941?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/2297251496480240941/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=2297251496480240941' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/2297251496480240941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/2297251496480240941'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2009/07/javascript-term.html' title='javascript term'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-7450410102056796049</id><published>2009-07-21T22:11:00.000-07:00</published><updated>2009-07-21T22:12:18.024-07:00</updated><title type='text'>huge treasure</title><content type='html'>http://www.51cnnet.com&lt;br /&gt;&lt;br /&gt;Korean is great.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-7450410102056796049?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/7450410102056796049/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=7450410102056796049' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/7450410102056796049'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/7450410102056796049'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2009/07/huge-treasure.html' title='huge treasure'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-4205939648504080830</id><published>2009-07-21T18:29:00.001-07:00</published><updated>2009-07-21T18:29:23.045-07:00</updated><title type='text'>人老了</title><content type='html'>http://www.youtube.com/watch?v=sE-r_uLmp_c&amp;amp;feature=player_embedded&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-4205939648504080830?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/4205939648504080830/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=4205939648504080830' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/4205939648504080830'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/4205939648504080830'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2009/07/blog-post.html' title='人老了'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-3715021196750457948</id><published>2009-07-21T17:25:00.000-07:00</published><updated>2009-07-21T17:26:43.824-07:00</updated><title type='text'>CSS Properties To JavaScript Reference Conversion</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-size: 20px; "&gt;document.getElementById(&lt;i&gt;div_id&lt;/i&gt;).style.&lt;i&gt;JS_property_reference&lt;/i&gt; = &lt;i&gt;"new_CSS_property_value"&lt;/i&gt;;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-3715021196750457948?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/3715021196750457948/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=3715021196750457948' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/3715021196750457948'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/3715021196750457948'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2009/07/css-properties-to-javascript-reference.html' title='CSS Properties To JavaScript Reference Conversion'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-2108518150314399889</id><published>2009-07-17T22:28:00.000-07:00</published><updated>2009-07-17T22:29:49.028-07:00</updated><title type='text'>Screen Capture and Save as an Image</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: verdana; font-size: 13px; "&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;p&gt;&lt;span class="Apple-style-span"  style="color:#008000;"&gt;Suddenly came out this problem. The following is a search result.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"  style="color:#008000;"&gt;The code is from&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"  style="color:#008000;"&gt;&lt;a href="http://www.c-sharpcorner.com/UploadFile/perrylee/ScreenCapture11142005234547PM/ScreenCapture.aspx"&gt;http://www.c-sharpcorner.com/UploadFile/perrylee/ScreenCapture11142005234547PM/ScreenCapture.aspx&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"  style="color:#008000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#008000;"&gt;/* Author: Perry Lee&lt;br /&gt;* Submission: Capture Screen (Add Screenshot Capability to Programs)&lt;br /&gt;* Date of Submission: 12/29/03&lt;br /&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; System;&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; System.Drawing;&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; System.Drawing.Imaging;&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;using&lt;/span&gt; System.Runtime.InteropServices;&lt;br /&gt;&lt;span style="color:#008000;"&gt;// If you have any questions regarding functions (methods) imported from&lt;br /&gt;// GDI32.dll and User32.dll refer to 'msdn.microsoft.com'&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; GDI32&lt;br /&gt;{&lt;br /&gt;[DllImport("GDI32.dll")]&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;extern&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;bool&lt;/span&gt; BitBlt(&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; hdcDest,&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; nXDest,&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; nYDest,&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; nWidth,&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; nHeight,&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; hdcSrc,&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt;nXSrc,&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; nYSrc,&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; dwRop);&lt;br /&gt;[DllImport("GDI32.dll")]&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;extern&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; CreateCompatibleBitmap(&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; hdc,&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; nWidth, &lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; nHeight);[DllImport("GDI32.dll")]&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;extern&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; CreateCompatibleDC(&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; hdc);&lt;br /&gt;[DllImport("GDI32.dll")]&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;extern&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;bool&lt;/span&gt; DeleteDC(&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; hdc);&lt;br /&gt;[DllImport("GDI32.dll")]&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;extern&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;bool&lt;/span&gt; DeleteObject(&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; hObject);&lt;br /&gt;[DllImport("GDI32.dll")]&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;extern&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; GetDeviceCaps(&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; hdc,&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; nIndex);&lt;br /&gt;[DllImport("GDI32.dll")]&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;extern&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; SelectObject(&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; hdc,&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; hgdiobj);&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; User32&lt;br /&gt;{&lt;br /&gt;[DllImport("User32.dll")]&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;extern&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; GetDesktopWindow();&lt;br /&gt;[DllImport("User32.dll")]&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;extern&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; GetWindowDC(&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; hWnd);&lt;br /&gt;[DllImport("User32.dll")]&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;extern&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; ReleaseDC(&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; hWnd,&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; hDC);&lt;br /&gt;}&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; Example&lt;br /&gt;{&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; CaptureScreen(&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; fileName,ImageFormat imageFormat)&lt;br /&gt;{&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; hdcSrc = User32.GetWindowDC(User32.GetDesktopWindow()),&lt;br /&gt;hdcDest = GDI32.CreateCompatibleDC(hdcSrc),&lt;br /&gt;hBitmap = GDI32.CreateCompatibleBitmap(hdcSrc,&lt;br /&gt;GDI32.GetDeviceCaps(hdcSrc,8),GDI32.GetDeviceCaps(hdcSrc,10)); GDI32.SelectObject(hdcDest,hBitmap);&lt;br /&gt;GDI32.BitBlt(hdcDest,0,0,GDI32.GetDeviceCaps(hdcSrc,8),&lt;br /&gt;GDI32.GetDeviceCaps(hdcSrc,10),hdcSrc,0,0,0x00CC0020);&lt;br /&gt;SaveImageAs(hBitmap,fileName,imageFormat);&lt;br /&gt;Cleanup(hBitmap,hdcSrc,hdcDest);&lt;br /&gt;}&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; Cleanup(&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; hBitmap,&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; hdcSrc,&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; hdcDest)&lt;br /&gt;{&lt;br /&gt;User32.ReleaseDC(User32.GetDesktopWindow(),hdcSrc);&lt;br /&gt;GDI32.DeleteDC(hdcDest);&lt;br /&gt;GDI32.DeleteObject(hBitmap);&lt;br /&gt;}&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; SaveImageAs(&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; hBitmap,&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; fileName,ImageFormat imageFormat)&lt;br /&gt;{&lt;br /&gt;Bitmap image =&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; Bitmap(Image.FromHbitmap(&lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; IntPtr(hBitmap)),&lt;br /&gt;Image.FromHbitmap(&lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; IntPtr(hBitmap)).Width,&lt;br /&gt;Image.FromHbitmap(&lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; IntPtr(hBitmap)).Height);&lt;br /&gt;image.Save(fileName,imageFormat);&lt;br /&gt;}&lt;br /&gt;}&lt;/p&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;Explanation of methods:&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span style="color:#0000ff;"&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; CaptureScreen(&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; fileName,ImageFormat imageFormat)&lt;br /&gt;{&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; hdcSrc = User32.GetWindowDC(User32.GetDesktopWindow()), &lt;span style="color:#008000;"&gt;// Get a handle to the desktop window&lt;br /&gt;&lt;/span&gt;hdcDest = GDI32.CreateCompatibleDC(hdcSrc), &lt;span style="color:#008000;"&gt;// Create a memory device context&lt;br /&gt;&lt;/span&gt;hBitmap = GDI32.CreateCompatibleBitmap(hdcSrc, &lt;span style="color:#008000;"&gt;// Create a bitmap and place it in the memory DC&lt;br /&gt;&lt;/span&gt;GDI32.GetDeviceCaps(hdcSrc,8),GDI32.GetDeviceCaps(hdcSrc,10));&lt;br /&gt;&lt;span style="color:#008000;"&gt;// GDI32.GetDeviceCaps(hdcSrc,8) returns the width of the desktop window&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#008000;"&gt;// GDI32.GetDeviceCaps(hdcSrc,10) returns the height of the desktop window&lt;br /&gt;&lt;/span&gt;GDI32.SelectObject(hdcDest,hBitmap); &lt;span style="color:#008000;"&gt;// Required to create a color bitmap&lt;br /&gt;&lt;/span&gt;GDI32.BitBlt(hdcDest,0,0,GDI32.GetDeviceCaps(hdcSrc,8), &lt;span style="color:#008000;"&gt;// Copy the on-screen image into the memory DC&lt;br /&gt;&lt;/span&gt;GDI32.GetDeviceCaps(hdcSrc,10),hdcSrc,0,0,0x00CC0020);&lt;br /&gt;SaveImageAs(hBitmap,fileName,imageFormat); &lt;span style="color:#008000;"&gt;// Save the screen-capture to the specified file using the designated image format&lt;br /&gt;&lt;/span&gt;Cleanup(hBitmap,hdcSrc,hdcDest); &lt;span style="color:#008000;"&gt;// Free system resources&lt;br /&gt;&lt;/span&gt;}&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; Cleanup(&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; hBitmap,&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; hdcSrc,&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; hdcDest)&lt;br /&gt;{&lt;br /&gt;&lt;span style="color:#008000;"&gt;// Release the device context resources back to the system&lt;br /&gt;&lt;/span&gt;User32.ReleaseDC(User32.GetDesktopWindow(),hdcSrc);&lt;br /&gt;GDI32.DeleteDC(hdcDest);&lt;br /&gt;GDI32.DeleteObject(hBitmap);&lt;br /&gt;}&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; SaveImageAs(&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; hBitmap,&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; fileName,ImageFormat imageFormat)&lt;br /&gt;{&lt;br /&gt;&lt;span style="color:#008000;"&gt;// Create a bitmap from the Windows handle&lt;br /&gt;&lt;/span&gt;Bitmap image = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; Bitmap(Image.FromHbitmap(&lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; IntPtr(hBitmap)),&lt;br /&gt;Image.FromHbitmap(&lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; IntPtr(hBitmap)).Width,&lt;br /&gt;Image.FromHbitmap(&lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; IntPtr(hBitmap)).Height);&lt;br /&gt;image.Save(fileName,imageFormat);&lt;br /&gt;}&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-2108518150314399889?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/2108518150314399889/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=2108518150314399889' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/2108518150314399889'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/2108518150314399889'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2009/07/screen-capture-and-save-as-image.html' title='Screen Capture and Save as an Image'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-3947593325926770362</id><published>2009-07-12T11:41:00.000-07:00</published><updated>2009-07-12T13:59:38.013-07:00</updated><title type='text'>Meschach: Matrix computations in C</title><content type='html'>Since the I always suspect the speed of matlab. Today I start to look for the c/c++ liberary for matrix manipulation. And I find Meschach.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-3947593325926770362?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/3947593325926770362/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=3947593325926770362' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/3947593325926770362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/3947593325926770362'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2009/07/meschach-matrix-computations-in-c.html' title='Meschach: Matrix computations in C'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-611127092718820444</id><published>2009-06-27T16:07:00.000-07:00</published><updated>2009-06-27T16:11:49.218-07:00</updated><title type='text'>ri air show</title><content type='html'>Today, I drived 1 and half hour to north kingstown, RI to get to the air show. Not mention, on the ground are all the main aircraft used in US military. 3 Carrier, 2 fighters. There are several aircraft in air. chopper, c130, f18(blue bird), f22, f15, f16, A10. At the beginning it's boring. Then a operation simulation is performed and things get interesting. Finally the routine air show, the NAVY F18 Blue Bird is out of their van and that's the ultimate cool.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-611127092718820444?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/611127092718820444/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=611127092718820444' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/611127092718820444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/611127092718820444'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2009/06/ri-air-show.html' title='ri air show'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-6813116641141852509</id><published>2009-06-15T13:26:00.000-07:00</published><updated>2009-06-15T13:47:37.489-07:00</updated><title type='text'>福建最游处</title><content type='html'>玉华洞：一是藏禾洞，二是雷公洞，三是果子洞，四是黄泥，五是溪源，六是白云。走2小时。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-6813116641141852509?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/6813116641141852509/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=6813116641141852509' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/6813116641141852509'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/6813116641141852509'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2009/06/blog-post.html' title='福建最游处'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-3320441445151282389</id><published>2009-06-14T12:47:00.001-07:00</published><updated>2012-01-10T20:17:57.621-08:00</updated><title type='text'>vim tricks</title><content type='html'>&lt;br /&gt;&lt;ol&gt;&lt;li&gt;:set filetype=python, for python file and we can figure out the general form.&lt;/li&gt;&lt;li&gt;How to insert tab for Makefile when you have expandtab on, use ctrl-V tab in insert mode.&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-3320441445151282389?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/3320441445151282389/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=3320441445151282389' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/3320441445151282389'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/3320441445151282389'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2009/06/working-in-vim-with-python.html' title='vim tricks'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-1422031265267254782</id><published>2009-06-07T17:10:00.000-07:00</published><updated>2009-06-07T17:14:52.895-07:00</updated><title type='text'>two dimensional input in mathematica</title><content type='html'>&lt;ol&gt;&lt;li&gt;move complementary position by pressing Ctrl+5&lt;/li&gt;&lt;li&gt;Type fraction by Ctrl+/&lt;/li&gt;&lt;li&gt;Type superscript by Ctrl+6&lt;/li&gt;&lt;li&gt;Type subscript by Ctrl+-&lt;/li&gt;&lt;li&gt;Type overscript by Ctrl+7&lt;/li&gt;&lt;li&gt;Type underscript by Ctrl+=&lt;/li&gt;&lt;li&gt;Type square root by Ctrl+2&lt;/li&gt;&lt;li&gt;Type radicals by square root and moving complementary position.&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-1422031265267254782?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/1422031265267254782/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=1422031265267254782' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/1422031265267254782'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/1422031265267254782'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2009/06/two-dimensional-input-in-mathematica.html' title='two dimensional input in mathematica'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-337225596609815867</id><published>2009-05-08T16:11:00.000-07:00</published><updated>2009-05-08T16:22:06.888-07:00</updated><title type='text'>old basketball</title><content type='html'>During the supper time, I eat while watch a online video which is 1998 NBA all star. There a M. Jordan, Kobe Bryant and more. The game is hosted by Han who gives a lot of nickname to player. And it gives a lot of fun to the game.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When I watch this game I realize I was born in a great time. Kobe may have the strong body and great skill as Jordan. Jordan's move is more attractive and curve is higher, air time is longer and audient as me more like it. And when shooting, Jordan is more relax, he doesn't use his leg much in the air. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Anyway, Jordan is the king and 90' NBA is great.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-337225596609815867?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/337225596609815867/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=337225596609815867' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/337225596609815867'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/337225596609815867'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2009/05/old-basketball.html' title='old basketball'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-1133450690198080766</id><published>2009-05-08T15:32:00.000-07:00</published><updated>2009-05-08T15:40:41.127-07:00</updated><title type='text'>northeastern really need a great dinner place</title><content type='html'>again it's the summer time. Food court all close early these time. When I came back from au bon pain with steak rice bowl, a man stopped me and asked me the question which I asked myself several times, "Is there a place to eat on campus?". And the word "is" starts from ten steps away. No doubt that both men were hungry. I came up close and said "along that direction, you will get to Huntington Ave, where serveral place you can eat". &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Notheastern University has great built view, especially thinking the campus is in the city and the thinker from the over crowded eastern. But food do rely on the avenue. Wish one day I can see there is a whole flour restaurant here.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-1133450690198080766?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/1133450690198080766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=1133450690198080766' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/1133450690198080766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/1133450690198080766'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2009/05/northeastern-really-need-great-dinner.html' title='northeastern really need a great dinner place'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-7439330470285315012</id><published>2009-05-07T10:46:00.000-07:00</published><updated>2009-05-07T11:17:52.606-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='finance stock'/><title type='text'>关于F股票</title><content type='html'>今天总结一下这段时间关注的F股票。自从在新闻中间看见了美国汽车行业的问题就觉得这是股价发生巨大变化的时候。如果勉强的从实际的观察看，三大车厂中ford is like honda, gm is like toyota and chrysler is like nissan. gm has many brand and long product line. ford has less brand and shorter product line while chrylser has small amount of brands with long product line from compact car to super sport car. And from my rental experince with these car, the defect from chrylser can be felt anyway. And shorter product line helps surviving since longer product line appears with the growing economy. Once crysis touchs bottom, price will again go up. So I check ford regularly and find the following number:&lt;div&gt;March 06, 2009, $1.70, cap: 35.14m&lt;/div&gt;&lt;div&gt;and today&lt;/div&gt;&lt;div&gt;May 04, 2009, $5.87, cap: 58.16m&lt;/div&gt;&lt;div&gt;That's a fast grow for me. But I think the growing will slow down. Since the future for Chrysler and GM is settle down and I don't see any uncertainty in auto industry.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As I see from this case, I should remember some tips. &lt;/div&gt;&lt;div&gt;In America, news do lead clue to the uncertainty in the market where chance hides. &lt;/div&gt;&lt;div&gt;In oligarch industry, if this is the correct word, one fails mean other one rises.&lt;/div&gt;&lt;div&gt;One on the edge, meaning either with low price or on the news or dominate power should be on the check list.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-7439330470285315012?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/7439330470285315012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=7439330470285315012' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/7439330470285315012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/7439330470285315012'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2009/05/f.html' title='关于F股票'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-1395338528350819376</id><published>2009-05-06T11:12:00.000-07:00</published><updated>2009-05-06T11:20:23.526-07:00</updated><title type='text'>突然想到中国的房地产</title><content type='html'>看这新闻突然想到了中国的房地产的事情。土地归属权的改变是市场化和私有化的必然过程。但如果仍然以社会主义中的国有土地为出发点，发现政府果然不再是以前共产党领导的政府。以前土地是国有或是集体所有的，人们在其上生活，工作。有一天政府说要盘活土地，于是土地被政府拍卖了，当然政府留了一手，说你只有使用权。于是在土地上生活工作的人们不再拥有这片土地，同时也没有得到失去这片土地的补偿。也许从第一天开始土地就不属于生活和工作在其上的人们。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-1395338528350819376?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/1395338528350819376/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=1395338528350819376' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/1395338528350819376'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/1395338528350819376'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2009/05/blog-post.html' title='突然想到中国的房地产'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-115923692760334668</id><published>2006-09-25T19:13:00.000-07:00</published><updated>2006-09-25T19:15:27.613-07:00</updated><title type='text'>recreation in neu</title><content type='html'>neu is really a small university. However it still has its own facility for recreation. I went to marino center today, where student get physics exercise. Nice place anyway, since I have not get used to such before and I will try it with any change.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-115923692760334668?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/115923692760334668/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=115923692760334668' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/115923692760334668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/115923692760334668'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2006/09/recreation-in-neu.html' title='recreation in neu'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-115915708570973602</id><published>2006-09-24T21:03:00.000-07:00</published><updated>2006-09-24T21:04:45.710-07:00</updated><title type='text'>come to here, so I can use this</title><content type='html'>network limit the usage of old blog, so I will use this. Seems good here.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-115915708570973602?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/115915708570973602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=115915708570973602' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/115915708570973602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/115915708570973602'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2006/09/come-to-here-so-i-can-use-this.html' title='come to here, so I can use this'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-114783788587597125</id><published>2006-05-16T20:49:00.000-07:00</published><updated>2006-05-16T20:51:25.886-07:00</updated><title type='text'>看不到，失败阿</title><content type='html'>&lt;a href="http://pipehappy.blogspot.com/"&gt;http://pipehappy.blogspot.com/&lt;/a&gt;打不开，这个地方用不了了&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-114783788587597125?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/114783788587597125/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=114783788587597125' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/114783788587597125'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/114783788587597125'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2006/05/blog-post.html' title='看不到，失败阿'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19452600.post-113336287828561727</id><published>2005-11-30T06:57:00.000-08:00</published><updated>2005-11-30T07:01:18.293-08:00</updated><title type='text'>beginning</title><content type='html'>今天，本来是要看看google的base的，但是还是发现并且决定试试这个blog，google的blog，居然不叫google的名，不知道这个中间有是怎么样的关系，试试先。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19452600-113336287828561727?l=pipehappy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pipehappy.blogspot.com/feeds/113336287828561727/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19452600&amp;postID=113336287828561727' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/113336287828561727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19452600/posts/default/113336287828561727'/><link rel='alternate' type='text/html' href='http://pipehappy.blogspot.com/2005/11/beginning.html' title='beginning'/><author><name>Yue Guan</name><uri>https://profiles.google.com/115413567094309213294</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-XlcGiPnptlg/AAAAAAAAAAI/AAAAAAAAAAA/xxUUko3EiBo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry></feed>
