<?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-8742529245277406456</id><updated>2012-02-08T21:05:58.336-05:00</updated><category term='System Programming'/><category term='Network'/><category term='Python'/><category term='Interests'/><category term='WSNs'/><category term='All about Apple'/><category term='Insterests'/><category term='Kinect'/><category term='Presentation Skills'/><category term='Mathimatical modeling'/><category term='Probability'/><category term='Qt'/><category term='Hardware'/><category term='Thoughts'/><category term='Perl'/><category term='Miscellaneous'/><category term='Geometry'/><category term='Ethics Issues'/><category term='Writing Skills'/><category term='Computational Geometry'/><category term='STL study'/><category term='Programming'/><category term='Social Networking'/><category term='OS'/><title type='text'>My Little Notebook</title><subtitle type='html'>Pursuing my dream, proceed sloooowly but stably... :-)</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>78</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-486810332084764873</id><published>2012-02-08T21:05:00.001-05:00</published><updated>2012-02-08T21:05:58.355-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>Using regular expression with Perl</title><content type='html'>A very good tutorial:&lt;br /&gt;&lt;a href="http://affy.blogspot.com/p5be/ch10.htm"&gt;Perl 5 - Regular Expressions&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-486810332084764873?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/486810332084764873/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=486810332084764873' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/486810332084764873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/486810332084764873'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2012/02/using-regular-expression-with-perl.html' title='Using regular expression with Perl'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-5710758716706113397</id><published>2011-12-09T15:56:00.001-05:00</published><updated>2011-12-09T16:00:20.372-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hardware'/><category scheme='http://www.blogger.com/atom/ns#' term='Kinect'/><category scheme='http://www.blogger.com/atom/ns#' term='Interests'/><title type='text'>How Kinect works</title><content type='html'>&lt;a href="http://www.wired.com/gadgetlab/2010/11/tonights-release-xbox-kinect-how-does-it-work/all/1"&gt;How does Kinect work?&lt;/a&gt; from Wired.com&lt;br /&gt;&lt;br /&gt;And another one:&lt;br /&gt;&lt;a href="http://gilotopia.blogspot.com/2010/11/how-does-kinect-really-work.html"&gt;How does Kinect really work?&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-5710758716706113397?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/5710758716706113397/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=5710758716706113397' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/5710758716706113397'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/5710758716706113397'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2011/12/how-kinect-works.html' title='How Kinect works'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-7744727371747811970</id><published>2011-05-12T10:32:00.000-04:00</published><updated>2011-05-13T16:46:25.964-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Interview'/><title type='text'>Copy constructor &amp; Assignment constructor</title><content type='html'>&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Default copy&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Every struct and class have a default copy constructor and assignment operator method. e.g.&lt;/div&gt;&lt;blockquote&gt;&lt;code&gt;1: struct Foo {  int f, o; };&lt;br /&gt;2: Foo f1 = {1, 10};&lt;br /&gt;3: Foo f2(f1);&lt;br /&gt;4: Foo f3; f3 = f1;&lt;/code&gt;&lt;/blockquote&gt;&lt;div&gt;Line 2 invokes the default copy constructor; Line 3 invokes the default assignment operator. The difference of the two is that the copy constructor is invoked when the target (f2) is constructed, passing the source object into the new one; the assignment constructor is invoked when the target object (f3) already exists.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;b&gt;When to implement your own copy?&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;The default copy only make a shallow copy. Thus, if one of the members is a pointer, a shallow copy will not allocate memory but create another pointer pointing to the same address. When one of them free the memory, the other one is still pointing to that piece of memory.&lt;/div&gt;&lt;div&gt;In this case, explicit copy and assignment constructor are required.&lt;/div&gt;&lt;div&gt;The difference between the bodies of the two constructors is that the copy constructor can allocate new memory and assign value to the pointer assuming that no member has been set yet (since the object is just being constructed); however, the assignment constructor must handle the case where members may already have been initialized and thus have to delete the contents of the pointer before assigning new value.&lt;/div&gt;&lt;blockquote&gt;&lt;code&gt;class Foobar {&lt;br /&gt;int fo; char* name;&lt;br /&gt;public:&lt;br /&gt;Foobar(const char* str, int n) {&lt;br /&gt;name = new char[strlen(str)+1];&lt;br /&gt;strcpy(name, str);&lt;br /&gt;age = n;&lt;br /&gt;}&lt;br /&gt;Foobar(const Foobar&amp;amp; rf) {&lt;br /&gt;name = new char[strlen(rf.name)+1];&lt;br /&gt;strcpy(name, rf.name);&lt;br /&gt;age = rf.age;&lt;br /&gt;}&lt;br /&gt;Foobar&amp;amp; Foobar(const Foobar&amp;amp; rf) {&lt;br /&gt;&lt;span class="Apple-style-span"  style="color:#FF6600;"&gt;     char* temp = new char[strlen(rf.name)+1];&lt;br /&gt;delete[] name;&lt;/span&gt;&lt;br /&gt;name = temp;&lt;br /&gt;strcpy(name, rf.name);&lt;br /&gt;age = rf.age;&lt;br /&gt;&lt;span class="Apple-style-span"  style="color:#FF6600;"&gt;     return *this;&lt;/span&gt;&lt;br /&gt;}&lt;br /&gt;~Foobar()  {  delete[] name;  }&lt;br /&gt;};&lt;/code&gt;&lt;/blockquote&gt;&lt;div&gt;Notice that&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;why temp is used and why not &lt;code&gt;delete[] name; name  = new char ...&lt;/code&gt;The reason is that the &lt;code&gt;new&lt;/code&gt; may throw an exception and leave the object in a bad state. By finishing all operations that could fail and then replacing the fields, the code is safe.&lt;/li&gt;&lt;li&gt;the assignment operator returns a reference to the object so that &lt;code&gt;f1 = f2 = f3&lt;/code&gt; will work.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;b&gt;Avoid copy or assignment constructors&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;In some cases, it may not be proper to make a copy of some class fields. To prevent the default implicit copy and assignment constructors, a private copy constructor and assignment operator should be provided. No need to implement the methods. Simply prototyping is enough.&lt;/div&gt;&lt;blockquote&gt;&lt;code&gt;private:&lt;br /&gt;Foobar(const Foobar&amp;amp; rf);&lt;br /&gt;Foobar&amp;amp; Foobar(const Foobar&amp;amp; rf);&lt;/code&gt;&lt;/blockquote&gt;&lt;div&gt;By doing this, if a piece of code attempts to copy the object, there will be an error message saying that the copy constructor and assignment operator cannot be accessed.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Ref: &lt;/span&gt;&lt;a href="http://www.codeguru.com/cpp/cpp/algorithms/general/article.php/c9585"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Copy Constructors and Assignment Operators&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-7744727371747811970?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/7744727371747811970/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=7744727371747811970' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/7744727371747811970'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/7744727371747811970'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2011/05/copy-constructor-assignment-constructor.html' title='Copy constructor &amp; Assignment constructor'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-1321796569309934033</id><published>2011-04-23T19:48:00.002-04:00</published><updated>2011-04-23T20:33:00.742-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OS'/><category scheme='http://www.blogger.com/atom/ns#' term='All about Apple'/><title type='text'>Mac OS X Memory Management: terms in Activity Monitor</title><content type='html'>&lt;div&gt;Last week, I was suffered by the super slow start of VMware Fashion. From the status bar, I can see the usage of CPU is low and the problem seems from memory usage. I opened Activity Monitor to see the detailed memory usage and was surprised to find out that there are only 100MB (or even less!) "free memory". Btw, I am using Macbook with 2G memory.&lt;/div&gt;&lt;div&gt;This forced me to do more research about the memory management in Mac OS. It turned out that the low amount free memory may not be a bad thing (cf. in Windows, it definitely sucks!).&lt;/div&gt;&lt;div&gt;Let's start from some general terms here.&lt;/div&gt;&lt;div&gt;You might noticed that, in Activity Monitor, there are: Free, Wired, Active, and Inactive memory. The sum of all these four will be equal to the total amount of RAM (in my case, 2GB).&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Free memory: as named, it is the not-yet-used memory.&lt;/li&gt;&lt;li&gt;Wired memory: here, "wired" = always-in. These data will never be moved to the disk and will always stay in RAM. It could be owned by some core system processes or stand-by processes even after you close the application (main process).&lt;/li&gt;&lt;li&gt;Active memory: These data is currently in RAM and has been recently used.&lt;/li&gt;&lt;li&gt;Inactive memory: here is the tricky part. These data is not actively being used but has recently used. What does it mean? It means that each time when you quit an app, their data will stay in the memory as inactive memory until the app is reopened and access the same data again, OR they are replaced by other apps' data just like free memory. What's the benefit? Think about "memory frequency"!&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;Mac OS uses a different memory management methodology from what Windows does. It will crawl as more as possible free memory to catch up disk data so that when these data come into use, the access time will be reduced. When the memory usage hits some threshold, it will release some inactive memory; If it is still not enough, it will swap some data from RAM to disk. In Activity Monitor, you can see the cumulative statistics of Page-ins and Page-outs.&lt;/div&gt;&lt;div&gt;Check out &lt;a href="http://developer.apple.com/library/mac/#documentation/Performance/Conceptual/ManagingMemory/Articles/AboutMemory.html"&gt;this&lt;/a&gt; for more details about memory management and virtual memory.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-1321796569309934033?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/1321796569309934033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=1321796569309934033' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/1321796569309934033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/1321796569309934033'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2011/04/mac-os-x-memory-management-terms-in.html' title='Mac OS X Memory Management: terms in Activity Monitor'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-1456219831994622817</id><published>2011-03-15T09:52:00.001-04:00</published><updated>2011-03-15T09:58:38.726-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Insterests'/><title type='text'>求二进制数中1的个数</title><content type='html'>比较常见的就是移位计数和快速法了，&lt;a href="http://www.cnblogs.com/graphics/archive/2010/06/21/1752421.html"&gt;这篇帖子&lt;/a&gt;里列的相当全。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-1456219831994622817?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/1456219831994622817/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=1456219831994622817' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/1456219831994622817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/1456219831994622817'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2011/03/1.html' title='求二进制数中1的个数'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-9074424295844774444</id><published>2011-03-11T12:27:00.000-05:00</published><updated>2011-03-11T12:27:56.876-05:00</updated><title type='text'>GNU Screen</title><content type='html'>&lt;div&gt;If you are a UNIX user, you maybe familiar with workspaces, featured in UNIX where you can have different workspaces: one for reading email, one for working, one for Internet surfing, and one for composing documents, blablabla.&lt;/div&gt;&lt;div&gt;Now you can start one terminal and run screen in it. Bang! Problem solved.&lt;/div&gt;&lt;div&gt;Refer to &lt;a href="http://www.kuro5hin.org/story/2004/3/9/16838/14935"&gt;GNU Screen: an introduction and beginner's tutorial || kuro5hin.org&lt;/a&gt; for more details.&lt;/div&gt;&lt;div&gt;Here are some commands most used:&lt;/div&gt;&lt;ol&gt;&lt;li&gt;typing &lt;code&gt;screen&lt;/code&gt; will start a screen session for you;&lt;/li&gt;&lt;li&gt;&lt;code&gt;Ctrl-a&lt;/code&gt; and then type &lt;code&gt;c&lt;/code&gt; to create a new session;&lt;/li&gt;&lt;li&gt;&lt;code&gt;Ctrl-a n&lt;/code&gt; to switch to the next or previous session;&lt;/li&gt;&lt;li&gt;&lt;code&gt;Ctrl-a d&lt;/code&gt; to detach from screen sessions and &lt;code&gt;screen -r [session number]&lt;/code&gt; to resume the session you detached. Note that after you detached, all of the screen windows are still running. You can close the terminal, leave your office, go back home, open a terminal on your home machine and resume your work at home!&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/8742529245277406456-9074424295844774444?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.kuro5hin.org/story/2004/3/9/16838/14935' title='GNU Screen'/><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/9074424295844774444/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=9074424295844774444' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/9074424295844774444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/9074424295844774444'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2011/03/gnu-screen.html' title='GNU Screen'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-3539781744660000127</id><published>2011-02-27T14:33:00.003-05:00</published><updated>2011-03-01T11:25:40.755-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>How to run .py file？</title><content type='html'>&lt;div&gt;Suppose Python is installed in &lt;code&gt;/usr/bin/python&lt;/code&gt;.&lt;/div&gt;&lt;ol&gt;&lt;li&gt;In the .py file, add the following line as the &lt;b&gt;first line&lt;/b&gt; to tell shell which interpreter you are using:&lt;br /&gt;&lt;code&gt;#!/usr/bin/python&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Close the file, set it as an executable file&lt;br /&gt;&lt;code&gt;chmod a+x [filename]&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Now you can type &lt;code&gt;./[filename]&lt;/code&gt; to execute it!&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;What if we need some input parameters? We will use &lt;b&gt;command-line arguments&lt;/b&gt; and here is how:&lt;/div&gt;&lt;blockquote&gt;In the .py file, add &lt;code&gt;import sys&lt;/code&gt;, and then grab the arguments from &lt;code&gt;sys.argv[1:]&lt;/code&gt;.&lt;/blockquote&gt;&lt;div&gt;Note 1: &lt;code&gt;sys.argv[0]&lt;/code&gt; is the script name.&lt;br /&gt;Note 2: &lt;code&gt;sys.argv&lt;/code&gt; read in arguments as strings, so if you want integer or float use &lt;code&gt;int()&lt;/code&gt; or &lt;code&gt;float()&lt;/code&gt; to convert them.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-3539781744660000127?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/3539781744660000127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=3539781744660000127' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/3539781744660000127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/3539781744660000127'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2011/02/how-to-run-py-file.html' title='How to run .py file？'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-8074999091489648958</id><published>2011-02-25T16:43:00.007-05:00</published><updated>2011-02-25T17:48:06.699-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Python - list</title><content type='html'>&lt;div&gt;List is a very useful and powerful data structure in Python. Here are something about it.&lt;/div&gt;&lt;div&gt;&lt;b&gt;Copy a list in a right way&lt;/b&gt;&lt;/div&gt;&lt;div&gt;First we need to understand how Python manages objects. Remember pointers in C++? Keep it in mind since you gonna see its bro soon.&lt;div&gt;In Python, &lt;code&gt;a = [1, 2, 3]&lt;/code&gt; means that &lt;code&gt;a&lt;/code&gt; POINTs to the list &lt;code&gt;[1, 2, 3]&lt;/code&gt;. &lt;code&gt;a&lt;/code&gt; itself is NOT the list.&lt;br /&gt;So, if we do &lt;code&gt;b = a&lt;/code&gt;, we didn't copy the list from &lt;code&gt;a&lt;/code&gt; to &lt;code&gt;b&lt;/code&gt;. We just created a new "pointer" (or, more pythonic, say "tag") &lt;code&gt;b&lt;/code&gt; which points to the same object as &lt;code&gt;a&lt;/code&gt; does.&lt;br /&gt;Thus, to copy the list referenced by &lt;code&gt;a&lt;/code&gt;, we need to create a new list and attach &lt;code&gt;b&lt;/code&gt; to it.&lt;/div&gt;&lt;div&gt;There are two ways:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Slicing. i.e. &lt;code&gt;b = a[:]&lt;/code&gt;&lt;br /&gt;&lt;code&gt;[:]&lt;/code&gt; returns a &lt;b&gt;slice&lt;/b&gt; of the specified portion of the list. It creates a new list, and copy the portion of the original list into the new one. By omitting the first and second index, the slice starts at the beginning and stops at the end of the list.&lt;/li&gt;&lt;li&gt;Constructor. i.e. &lt;code&gt;b = list(a)&lt;/code&gt;&lt;br /&gt;Here, &lt;code&gt;list()&lt;/code&gt; is the constructor of &lt;code&gt;list&lt;/code&gt;. It will construct a new list based on the passed parameter.&lt;br /&gt;Plus, this makes the code more readable and more OO styled!&lt;/li&gt;&lt;/ol&gt;Refer [1] for more details.&lt;/div&gt;&lt;div&gt;&lt;b&gt;More stuffs about &lt;code&gt;[start:stop]&lt;/code&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Basically, you can get any continuous portion from the original list by using the operator &lt;code&gt;[:]&lt;/code&gt;.&lt;/div&gt;&lt;div&gt;But, what if we want to extract odd or even items?&lt;/div&gt;&lt;div&gt;The straightforward way is &lt;code&gt;even = [lst[i] for i in range(len(lst)) if i % 2 == 0]&lt;/code&gt;.&lt;/div&gt;&lt;div&gt;Wait! Try this.&lt;/div&gt;&lt;div&gt;&lt;code&gt;&gt;&gt;&gt; l = [1, 2, 3, 4, 5]&lt;br /&gt;&gt;&gt;&gt; l&lt;br /&gt;[1, 2, 3, 4, 5]&lt;br /&gt;&gt;&gt;&gt; l[::2]&lt;br /&gt;[1, 3, 5]&lt;br /&gt;&gt;&gt;&gt; l[1::2]&lt;br /&gt;[2, 4]&lt;/code&gt;&lt;/div&gt;&lt;div&gt;See, it is simple! The secret is: the third arg is a step value.&lt;/div&gt;&lt;div&gt;&lt;b&gt;Remove duplicates from a list&lt;/b&gt;&lt;/div&gt;&lt;div&gt;[2] lists many ways to do it and their benchmarks. I pick some of them:&lt;/div&gt;&lt;ol&gt;&lt;li&gt;&lt;code&gt;list(set(lst))&lt;/code&gt;  # No order preserving&lt;/li&gt;&lt;li&gt;&lt;code&gt;{}.fromkeys(lst).keys()&lt;/code&gt;  # No order preserving (faster than 1)&lt;/li&gt;&lt;li&gt;&lt;code&gt;seen = set()&lt;/code&gt;  # Order preserving&lt;br /&gt;&lt;code&gt;[x for x in lst if x not in seen and not seen.add(x)]&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;Ref: [1] &lt;a href="http://henry.precheur.org/python/copy_list"&gt;Python: copying a list the right way&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;[2] &lt;a href="http://www.peterbe.com/plog/uniqifiers-benchmark"&gt;Fastest way to uniqify a list in Python&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-8074999091489648958?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/8074999091489648958/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=8074999091489648958' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/8074999091489648958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/8074999091489648958'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2011/02/python-list.html' title='Python - list'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-982865994183072549</id><published>2011-02-25T16:18:00.004-05:00</published><updated>2011-02-25T16:42:23.995-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>How to "re-import" an updated module in Python Interpreter</title><content type='html'>It is common to write a module and debug and test it in the Python interpreter on-the-fly. Then, after fixing some bugs, we want the interpreter test on the updated module.&lt;div&gt;Just typing "&lt;code&gt;import&lt;/code&gt;" again will not help since it would only give you the existing copy of the module from &lt;code&gt;sys.modules&lt;/code&gt;. Thus, a straightforward but brutal (and annoying :) way is exiting-and-reentering the interpreter.&lt;/div&gt;&lt;div&gt;Or, we can use "&lt;code&gt;reload(module)&lt;/code&gt;" to update &lt;code&gt;sys.modules&lt;/code&gt; and get a new copy of that module.&lt;/div&gt;&lt;code&gt;reload&lt;/code&gt; is a build-in function in Python. When &lt;code&gt;reload(module)&lt;/code&gt; is executed:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Python modules’ code is &lt;b&gt;recompiled&lt;/b&gt; and the module-level code reexecuted, defining a new set of objects which are bound to names in the module’s dictionary. The init function of extension modules is not called a second time.&lt;/li&gt;&lt;li&gt;As with all other objects in Python the old objects are only reclaimed after their reference counts drop to zero.&lt;/li&gt;&lt;li&gt;The names in the module namespace are updated to point to any new or changed objects.&lt;/li&gt;&lt;li&gt;Other references to the old objects (such as names external to the module) are &lt;b&gt;NOT&lt;/b&gt; rebound to refer to the new objects and must be updated in each namespace where they occur if that is desired.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Did you see it? It is very tricky to get it right! If, if any other modules have a reference to the original module or any object &lt;code&gt;from&lt;/code&gt; the original module, they will keep their old references and very confusing things will happen.&lt;/div&gt;&lt;div&gt;So, if you are using a self-contained module, &lt;code&gt;reload&lt;/code&gt; will be perfect for you to save you from exiting-reentering cycles; but if you got two modules depending on each other, or if you got a module passing references to its objects to system module, unfortunately, exiting-reentering would be the only choice for you.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-982865994183072549?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/982865994183072549/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=982865994183072549' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/982865994183072549'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/982865994183072549'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2011/02/how-to-re-import-updated-module-in.html' title='How to &quot;re-import&quot; an updated module in Python Interpreter'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-7982179699176620477</id><published>2011-02-24T00:45:00.004-05:00</published><updated>2011-02-24T01:08:06.249-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Miscellaneous'/><category scheme='http://www.blogger.com/atom/ns#' term='Writing Skills'/><title type='text'>Vi/Vim: Insert text at the beginning of a multi-line selection</title><content type='html'>&lt;div&gt;Sometimes, we would like to indent or comment out a block of code. Here are some solutions:&lt;/div&gt;&lt;div&gt;Solution 1:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Use &lt;code&gt;Ctrl+v&lt;/code&gt; to select the first column of text in the lines you want to comment.&lt;/li&gt;&lt;li&gt;Then hit '&lt;code&gt;I&lt;/code&gt;' and type the text you want to insert.&lt;/li&gt;&lt;li&gt;Then hit &lt;code&gt;Esc&lt;/code&gt;, wait 1 second and the inserted text will appear on every line.&lt;/li&gt;&lt;/ul&gt;Solution 2:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;This replaces the beginning of each line with "//":&lt;br /&gt;&lt;code&gt;:%s!^!//!&lt;/code&gt;&lt;/li&gt;&lt;li&gt;This replaces the beginning of each selected line (use visual mode to select) with "//":&lt;br /&gt;&lt;code&gt;:'&lt;,'&gt;s!^!//!&lt;/code&gt;;&lt;br /&gt;And removing the text goes as follows:&lt;br /&gt;&lt;code&gt;:'&lt;,'&gt;s!^//!!&lt;/code&gt;&lt;/li&gt;&lt;li&gt;If you want to reuse it, put this in your .vimrc:&lt;br /&gt;&lt;code&gt;vmap \c :s!^!//!&lt;cr&gt;&lt;br /&gt;vmap \u :s!^//!!&lt;cr&gt;&lt;/cr&gt;&lt;/cr&gt;&lt;/code&gt;&lt;br /&gt;Then, whenever in visual mode, you can hit &lt;code&gt;\c&lt;/code&gt; to comment the block and &lt;code&gt;\u&lt;/code&gt; to uncomment it. Of course, you can change those shortcut keystrokes to whatever.&lt;/li&gt;&lt;/ul&gt;Solution 3:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;place the cursor on the first line and type the following to insert "//" at the beginning of that line:&lt;br /&gt;&lt;code&gt;I//&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Press &lt;code&gt;Esc&lt;/code&gt; and use the digraph:&lt;br /&gt;&lt;code&gt;j.j.&lt;/code&gt;&lt;br /&gt;Here, &lt;code&gt;j&lt;/code&gt; is a motion command and &lt;code&gt;.&lt;/code&gt; repeats the last editing command you made (in this case &lt;code&gt;I//&lt;/code&gt;).&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-7982179699176620477?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/7982179699176620477/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=7982179699176620477' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/7982179699176620477'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/7982179699176620477'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2011/02/vivim-insert-text-at-beginning-of-multi.html' title='Vi/Vim: Insert text at the beginning of a multi-line selection'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-8130186308122749855</id><published>2011-02-14T20:34:00.005-05:00</published><updated>2011-02-14T20:57:21.858-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Insterests'/><category scheme='http://www.blogger.com/atom/ns#' term='Thoughts'/><category scheme='http://www.blogger.com/atom/ns#' term='Miscellaneous'/><title type='text'>Think before you do, ALWAYS</title><content type='html'>Given a to-do list with 20 or 30 things like "write down your name", "draw a star", "write down numbers", etc. Now read it and see how far you can go in one minute. What will you do?&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;A. Work on the steps one by one immediately and as fast as possible.&lt;br /&gt;B. Read through the whole list very quickly and then decide what to do next.&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;If you are an A-type person, you will only get about 10 or less steps down in one minute, since you need to read and write;&lt;br /&gt;If you are a B-type person, congratulations! You will find that at the end (the last one or the one before the last) there is one step saying "skip step 1 through this one". Bingo!&lt;/div&gt;&lt;div&gt;This is to tell you: NEVER START UNTIL YOU KNOW WHAT YOU NEED TO DO.&lt;/div&gt;&lt;div&gt;For example, as a programmer, when you get a new project, don't sit down and coding immediately. INSTEAD, think about how to do it, think about algorithms, think about the best language you should use, think until you have a clear idea in your mind and then start coding. It sounds taking more time by thinking first, right? But, actually, no, it saves your time from fix unexpected bugs and from re-codings.&lt;/div&gt;&lt;div&gt;Wait, one more thing: How could I know the list will have that tricky step in advance?&lt;/div&gt;&lt;div&gt;Remember the instruction? "READ the list"! Yes, literally, read the whole list first!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-8130186308122749855?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/8130186308122749855/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=8130186308122749855' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/8130186308122749855'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/8130186308122749855'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2011/02/think-before-you-do-always.html' title='Think before you do, ALWAYS'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-5729311299685646866</id><published>2011-02-12T13:31:00.003-05:00</published><updated>2011-02-12T13:52:09.055-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='All about Apple'/><title type='text'>Re-enable Java 1.5 and 1.4 on Mac OS X 10.6</title><content type='html'>Apple disabled Java 1.4 and 1.5 from OS X 10.6 (the default is Java 1.6 there). Unfortunately, sometimes you will find some softwares still rely on the older versions.&lt;div&gt;Here are two articles talking about how to restore Java 1.4 and 1.5 with a hand-on instruction:&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;a href="http://tedwise.com/2009/09/25/using-java-1-5-and-java-1-4-on-snow-leopard/"&gt;Using Java 1.5 and Java 1.4 on Snow Leopard&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://wiki.oneswarm.org/index.php/OS_X_10.6_Snow_Leopard"&gt;Snow Leopard Java problems (and fix)&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;Basically, to install Java 1.5 (1.4 would be the same, just replace 1.5.0 with 1.4.2)&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Get Java 1.5 from Internet, e.g. &lt;a href="http://tedwise.com/files/java.1.5.0-leopard.tar.gz"&gt;http://tedwise.com/files/java.1.5.0-leopard.tar.gz&lt;/a&gt;&lt;br /&gt;and expand it using &lt;code&gt;tar -zxvf java.1.5.0-leopard.tar.gz&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Move it to the default Java directory (password required)&lt;br /&gt;&lt;code&gt;sudo mv 1.5.0 /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0-leopard&lt;/code&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Finally, set up links&lt;br /&gt;&lt;code&gt;cd /System/Library/Frameworks/JavaVM.framework/Versions/&lt;br /&gt;sudo rm 1.5.0&lt;br /&gt;sudo ln -s 1.5.0-leopard 1.5.0&lt;br /&gt;sudo rm 1.5&lt;br /&gt;sudo ln -s 1.5.0 1.5&lt;/code&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;You can change the default Java version in &lt;code&gt;Java Preference&lt;/code&gt; (located in &lt;code&gt;/Applications/Utilities&lt;/code&gt;)&lt;/li&gt;&lt;/ol&gt;One more thing needed to be mentioned: After installing these older versions, some Java applications might crash, especially GUI applications. But command-line applications and using Java SDK to compile seems work very well.&lt;/div&gt;&lt;div&gt;You decide.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-5729311299685646866?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/5729311299685646866/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=5729311299685646866' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/5729311299685646866'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/5729311299685646866'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2011/02/re-enable-java-15-and-14-on-mac-os-x.html' title='Re-enable Java 1.5 and 1.4 on Mac OS X 10.6'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-7877825812163594422</id><published>2011-02-09T20:55:00.003-05:00</published><updated>2011-02-09T21:24:25.017-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='WSNs'/><category scheme='http://www.blogger.com/atom/ns#' term='All about Apple'/><title type='text'>Install QualNet on Mac OS X</title><content type='html'>&lt;p&gt;Install QualNet&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Download the installation package from the QualNet download page or load it from the installation CD.&lt;/li&gt;&lt;li&gt;Go to the home directory, and extract QualNet using the following command:&lt;br /&gt;&lt;code&gt;tar xvfz qualnet-4.5.1-university-wireless-mme.tar.gz&lt;/code&gt;&lt;br /&gt;&lt;i&gt;&lt;span class="Apple-style-span" &gt;QualNet will be installed in &lt;code&gt;~/snt/qualnet/4.5&lt;/code&gt;.&lt;/span&gt;&lt;/i&gt;&lt;/li&gt;&lt;li&gt;Copy the license file into &lt;code&gt;[qualnet_installed_dir]\license_dir&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Set the QualNet environment variables.&lt;br /&gt;&lt;code&gt;QUALNET_HOME=[qualnet_installed_dir]/5.0&lt;br /&gt;export QUALNET_HOME&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Compile and Test&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Go to &lt;code&gt;QUALNET_HOME\main&lt;/code&gt; directory using the &lt;code&gt;cd&lt;/code&gt; command to change directories.&lt;/li&gt;&lt;li&gt;Make a copy of the original Makefile for the version of gcc installed on your system.&lt;br /&gt;&lt;code&gt;cp Makefile-darwin-x86-gcc-4.0 Makefile&lt;/code&gt;&lt;br /&gt;Use &lt;code&gt;gcc -v&lt;/code&gt; to check the version of gcc (gcc 4.0 is required).&lt;br /&gt;&lt;b&gt;Important&lt;/b&gt;: Add these lines after the line "&lt;code&gt;include Makefile-unix-common&lt;/code&gt;"&lt;br /&gt;&lt;code&gt;CXX = g++-4.0&lt;br /&gt;GCC = gcc-4.0&lt;br /&gt;&lt;br /&gt;CFLAGS += -m32&lt;br /&gt;CXXFLAGS += -m32&lt;/code&gt;&lt;br /&gt;&lt;i&gt;&lt;span class="Apple-style-span" &gt;Qualnet does not like 64 bit on the Mac...&lt;/span&gt;&lt;/i&gt;&lt;/li&gt;&lt;li&gt;Compile QualNet (it takes several minutes for QualNet to compile).&lt;br /&gt;&lt;code&gt;make&lt;/code&gt;&lt;br /&gt;&lt;i&gt;&lt;span class="Apple-style-span" &gt;This creates the QualNet executable &lt;code&gt;qualnet&lt;/code&gt; in the &lt;code&gt;QUALNET_HOME/bin&lt;/code&gt; directory.&lt;/span&gt;&lt;/i&gt;&lt;/li&gt;&lt;li&gt;To recompile QualNet, run make again. However, it is sometimes useful to delete all object files before recompiling.&lt;br /&gt;&lt;code&gt;make clean&lt;br /&gt;make&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Test the QualNet installation after compiling.&lt;br /&gt;&lt;code&gt;cd $QUALNET_HOME/bin/scenarios/default&lt;br /&gt;./qualnet default.config&lt;/code&gt;&lt;br /&gt;Test the QualNet GUI.&lt;br /&gt;&lt;code&gt;cd $QUALNET_HOME/gui/netbeans/bin&lt;br /&gt;./runide.sh&lt;/code&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/8742529245277406456-7877825812163594422?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/7877825812163594422/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=7877825812163594422' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/7877825812163594422'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/7877825812163594422'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2011/02/install-qualnet-on-mac-os-x.html' title='Install QualNet on Mac OS X'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-5512591776654907199</id><published>2010-09-07T16:43:00.001-04:00</published><updated>2011-12-09T16:01:31.436-05:00</updated><title type='text'></title><content type='html'>&lt;a href="http://en.wikipedia.org/wiki/List_of_important_publications_in_computer_science"&gt;List of important publications in computer science&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://liinwww.ira.uka.de/bibliography/index.html"&gt;The Collection of Computer Science Bibliographies&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-5512591776654907199?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/5512591776654907199/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=5512591776654907199' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/5512591776654907199'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/5512591776654907199'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2010/09/list-of-important-publications-in.html' title=''/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-6264864965322859875</id><published>2010-07-23T21:19:00.002-04:00</published><updated>2010-07-23T21:33:15.179-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><title type='text'>svn: locate older versions</title><content type='html'>To locate some older file via &lt;code&gt;svn&lt;/code&gt;, we first need to figure out the &lt;b&gt;version number&lt;/b&gt;.&lt;br /&gt;&lt;code&gt;svn log [filename]&lt;/code&gt; will list out all of the previous subversions of that file with comments that we checked in using &lt;code&gt;svn commit -m "[comments]"&lt;/code&gt;. The result would look like as follows:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;------------------------------------------------------------------------&lt;br /&gt;[ver no.] | [author] | [commit date &amp;amp; time] | [number of comment lines]&lt;br /&gt;&lt;br /&gt;[comments]&lt;br /&gt;------------------------------------------------------------------------&lt;br /&gt;and so on...&lt;/code&gt;&lt;/blockquote&gt;Then, after we find the version number that we are looking for, instead of checking it out, we can use  &lt;code&gt;svn cat -r [ver no.] [filename]&lt;/code&gt; to read the content of the file.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-6264864965322859875?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/6264864965322859875/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=6264864965322859875' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/6264864965322859875'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/6264864965322859875'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2010/07/svn-locate-older-versions.html' title='svn: locate older versions'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-4468302046062810191</id><published>2010-07-14T16:41:00.004-04:00</published><updated>2010-07-14T17:04:32.687-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Miscellaneous'/><category scheme='http://www.blogger.com/atom/ns#' term='All about Apple'/><title type='text'>Basic Work Cycle on SVN</title><content type='html'>&lt;div&gt;I tried ZigVersion first on my Macbook. It is convenient to use, especially for a beginner. It provides license for non-commercial users. But, unfortunately, the website is not available any more.&lt;/div&gt;&lt;div&gt;So I turned back to SVN. Mac OS has already installed svn for developers. :)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;The typical work cycle looks like this &lt;span class="Apple-style-span"  style="font-size:small;"&gt;[1]&lt;/span&gt;:&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;1. Update your working copy.&lt;/div&gt;&lt;div&gt;&lt;code&gt; • svn update&lt;/code&gt;&lt;/div&gt;&lt;div&gt;2. Make changes.&lt;/div&gt;&lt;code&gt;&lt;div&gt; • svn add&lt;/div&gt;&lt;div&gt; • svn delete&lt;/div&gt;&lt;div&gt; • svn copy&lt;/div&gt;&lt;div&gt; • svn move&lt;/div&gt;&lt;/code&gt;&lt;div&gt;3. Examine your changes.&lt;/div&gt;&lt;code&gt;&lt;div&gt; • svn status&lt;/div&gt;&lt;div&gt; • svn diff&lt;/div&gt;&lt;/code&gt;&lt;div&gt;4. Possibly undo some changes.&lt;/div&gt;&lt;code&gt;&lt;div&gt; • svn revert&lt;/div&gt;&lt;/code&gt;&lt;div&gt;5. Resolve conflicts (merge others' changes).&lt;/div&gt;&lt;code&gt;&lt;div&gt; • svn update&lt;/div&gt;&lt;div&gt; • svn resolve&lt;/div&gt;&lt;/code&gt;&lt;div&gt;6. Commit your changes.&lt;/div&gt;&lt;code&gt;&lt;div&gt; • svn commit&lt;/div&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;Ref: [1] &lt;a href="http://svnbook.red-bean.com/"&gt;Version Control with Subversion for svn1.5&lt;/a&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/8742529245277406456-4468302046062810191?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/4468302046062810191/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=4468302046062810191' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/4468302046062810191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/4468302046062810191'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2010/07/basic-work-cycle-on-svn.html' title='Basic Work Cycle on SVN'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-224867254261893683</id><published>2010-06-15T00:05:00.004-04:00</published><updated>2010-06-16T14:47:01.717-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Qt'/><title type='text'>Layout Management in Qt</title><content type='html'>Layout management is to give an appropriate size and position for each widget on a form &lt;span class="Apple-style-span"  style="font-size:85%;"&gt;[1]&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Instead of using manually (&lt;i&gt;=lots of calculation and coding work :[&lt;/i&gt; ) layout management, Qt provides several classes:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;QHBoxLayout&lt;/code&gt;,&lt;br /&gt;&lt;code&gt;QVBoxLayout&lt;/code&gt;,&lt;br /&gt;and &lt;code&gt;QGridLayout&lt;/code&gt;.&lt;br /&gt;&lt;/blockquote&gt;These classes can be used conveniently through &lt;i&gt;Qt Designer&lt;/i&gt; or directly in source code. They ensure that widgets adapt automatically to different fonts, languages, and platforms. That is, if the user changes the system's font settings, or he translate the application's UI to other languages, the layout classes will resize themselves to avoid text truncation. Plus, if we add or remove, hide or show , and change a widget from a layout, the layout will automatically adapt to the new situation.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;QHBoxLayout&lt;/code&gt; and &lt;code&gt;QVBoxLayout&lt;/code&gt; are quite straightforward: lay out side by side or in a top-bottom fashion, respectively.&lt;div&gt;&lt;code&gt;QGridLayout&lt;/code&gt; allows a row by column layout, i.e. a two-dimensional grid.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;addLayout&lt;/code&gt; and &lt;code&gt;addWidget&lt;/code&gt; add layouts or widgets to a layout;&lt;br /&gt;&lt;code&gt;setContentsMargins&lt;/code&gt; and &lt;code&gt;setSpacing&lt;/code&gt; change the margin around the dialog and the spacing between child widgets.&lt;br /&gt;Or, modify the form setting from &lt;b&gt;Form&lt;/b&gt; menu and select &lt;b&gt;Form Setting...&lt;/b&gt; &lt;span class="Apple-style-span"  style="font-size:85%;"&gt;[2]&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span"  style="font-size:85%;"&gt;Ref: [1] More detailed example can be found in Chapter 6, &lt;a href="http://www.amazon.com/Programming-Prentice-Source-Software-Development/dp/0132354160"&gt;[C++ GUI Programming with Qt4].2nd.Edt&lt;/a&gt;&lt;br /&gt;[2] &lt;a href="http://doc.trolltech.com/4.6/designer-customizing-forms.html"&gt;Qt4.6: Customizing Qt Designer Forms&lt;/a&gt;&lt;/span&gt;&lt;a href="http://doc.trolltech.com/4.6/designer-customizing-forms.html"&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-224867254261893683?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/224867254261893683/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=224867254261893683' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/224867254261893683'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/224867254261893683'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2010/06/layout-management-in-qt.html' title='Layout Management in Qt'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-2927214335027702320</id><published>2010-06-04T17:23:00.001-04:00</published><updated>2010-06-04T17:24:18.121-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='System Programming'/><title type='text'>zz 高效的Timer实现 - Daly的游戏人生 - C  博客</title><content type='html'>原帖：&lt;a href="http://www.cppblog.com/daly88/archive/2010/05/26/116414.html"&gt;高效的Timer实现 - Daly的游戏人生 - C  博客&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="  line-height: 19px; font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;font-size:13px;"&gt;    很多程序都需要处理一系列定时事件，一个Timer程序就是实现定时事件集合的管理。&lt;br /&gt;   每个timer事件项一般包括超时值(delay), 标识(key)和回调函数，Timer程序的作用就是实现插入，删除，更新和调用。&lt;br /&gt;&lt;br /&gt;方法1. 链表&lt;br /&gt;  最简单的实现是有序链表。list_head保存到当前时间的剩余时间remain_time，后一节点保存与前一节点的超时时间的差(而不是到当前时间的差)。&lt;br /&gt;  更新：每次tick update时，只需要更新链表头节点remain_time，如果remain_time &lt;= 0, 调用函数，删除该头节点，然后更新后一个节点的remain_time,如此类推直到头结点remain_time &gt; 0或链表为空.  O(1)&lt;br /&gt;  插入：相当于插入排序。有序插入到适当位置，更新后一个节点的remain_time. &lt;br /&gt;  删除：遍历链表搜索，删除节点，更新后一个节点的remain_time.&lt;br /&gt;  例子：live555流媒体服务器&lt;br /&gt;&lt;br /&gt;方法2. 最小堆(优先队列)&lt;br /&gt;  方法与链表类似，插入/删除效率从O(n)变为O(lgN)&lt;br /&gt;  libevent中有min-heap实现一个优先队列，根节点是最先触发的超时时间, 与方法1一样，只需更新根节点。根节点超时后，调整堆即可&lt;br /&gt;&lt;br /&gt;方法3. Hash或分级&lt;br /&gt;  根据超时值的范围(比如CPU的流逝ticks)进行hash，hash后每个bucket实现方法1所示的链表. 较方法1减少了搜索次数&lt;br /&gt;  例子：MudOS定时器&lt;br /&gt;&lt;br /&gt;方法4. 分级hash&lt;br /&gt;  这是linux内核timer的实现方法，值得参考。见文献[1]&lt;br /&gt;  方法：假设定时值以tick为单位，每tick更新timer一次。&lt;br /&gt;        定时值范围为0 ~ 2^32个tick(32个bit), 则把他分成4级，每级做一个hash, 每个则有256个bucket (刚好8bit)&lt;br /&gt;        000000000  00000000  00000000  00000000&lt;br /&gt;        ---------  --------  --------  --------&lt;br /&gt;           A          B         C         D&lt;br /&gt;        插入：算出 tick_trig = delay + 当前tick， mask = tick_trig &amp;amp; 0xFF000000，&lt;br /&gt;              如果mask不等于0，在A hash表插入timer项, 否则进入下一级，mask = tick_trig &amp;amp; 0x00FF0000, 插入B hash表，如此类推。&lt;br /&gt;        更新：每次tick++, 先检查D hash表(最低8位的与操作)有无timer项，如果有，执行函数并删除。&lt;br /&gt;              如果tick满255进位， 则检查C hash表中对应位置有否timer项，如果有，重新插入(此处的timer项必定会插入D hash表中)，如此类推&lt;br /&gt;        这样，插入，更新，删除都做到O(1)了&lt;br /&gt;  疑惑：这个方法用于内核级程序。对于用户级程序，每次update的间隔不恒定（即每次tick不一定是+1），这时需要扫描tick之前的几个bucket了&lt;br /&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/8742529245277406456-2927214335027702320?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/2927214335027702320/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=2927214335027702320' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/2927214335027702320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/2927214335027702320'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2010/06/zz-timer-daly-c.html' title='zz 高效的Timer实现 - Daly的游戏人生 - C  博客'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-2205271847750375143</id><published>2010-05-15T17:36:00.007-04:00</published><updated>2010-06-15T00:39:06.245-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Qt'/><title type='text'>Getting Started with Qt4</title><content type='html'>Create a &lt;code&gt;hello.cpp&lt;/code&gt; file in &lt;code&gt;hello&lt;/code&gt; directory with the following code:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;#include &amp;lt;QApplication&amp;gt;&lt;br /&gt;#include &amp;lt;QPushButton&amp;gt;&lt;br /&gt;&lt;br /&gt;int main (int argc, char *argv[])&lt;br /&gt;{&lt;br /&gt;QApplication app(argc, argv);&lt;br /&gt;QPushButton *button = new QPushButton("Quit");&lt;br /&gt;QObject::connect(button, SIGNAL(clicked()),&lt;br /&gt;              &amp;amp;app, SLOT(quit()));&lt;br /&gt;button-&gt;show();&lt;br /&gt;return app.exec();&lt;br /&gt;}&lt;/code&gt;&lt;br /&gt;&lt;/blockquote&gt;Enter the &lt;code&gt;hello&lt;/code&gt; directory, type &lt;code&gt;qmake -project&lt;/code&gt; to &lt;span style="font-weight: bold;"&gt;platform-independent&lt;/span&gt; project file (.pro file), and then type &lt;code&gt;qmake -spec macx-g++ hello.pro&lt;/code&gt; to create a &lt;span style="font-weight: bold;"&gt;platform-specific&lt;/span&gt; makefile from the project file (in this case, we use g++).&lt;br /&gt;Type &lt;code&gt;make&lt;/code&gt; to build the program.&lt;br /&gt;Run it by typing &lt;code&gt;./hello&lt;/code&gt; on Unix, and &lt;code&gt;open hello.app&lt;/code&gt; on Mac OS X.&lt;br /&gt;&lt;br /&gt;In Qt, a &lt;span style="font-weight: bold;"&gt;widget&lt;/span&gt; is "a visible element in a user interface". It includes buttons, menus, scroll bars, dialogs, and main windows. Usually, most applications use a dialog or main window as its application window. But Qt allows any widget to be an application window (in this example, a button).&lt;br /&gt;&lt;br /&gt;A Qt widget uses &lt;span style="font-weight: bold;"&gt;signals&lt;/span&gt; (no, not THE signal in UNIX =) to indicate that a user action or a change of state has occurred. In this example, a button's &lt;code&gt;clicked()&lt;/code&gt; signal is &lt;span style="font-weight: bold;"&gt;connect&lt;/span&gt;ed to the application object's &lt;code&gt;quit()&lt;/code&gt; &lt;span style="font-weight: bold;"&gt;slot&lt;/span&gt; (i.e. function).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Ref: [1] &lt;a href="http://www.amazon.com/Programming-Prentice-Source-Software-Development/dp/0132354160"&gt;[C++ GUI Programming with Qt4].2nd.Edt&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;[2] Qt Assistant (== MSDN for VC)&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-2205271847750375143?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/2205271847750375143/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=2205271847750375143' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/2205271847750375143'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/2205271847750375143'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2010/05/getting-started-with-qt4.html' title='Getting Started with Qt4'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-3220695392962462918</id><published>2010-05-11T18:20:00.004-04:00</published><updated>2010-05-11T19:25:54.594-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><title type='text'>extern keyword</title><content type='html'>The &lt;span style="font-weight: bold;"&gt;&lt;code&gt;extern&lt;/code&gt;&lt;/span&gt; keyword explicitly declares a variable or function and specifies that it has external linkage (i.e. visible from files other than the one in which it's defined).&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;Declare vs. Define&lt;/span&gt; [1]&lt;br /&gt;To define a variable, the compiler will allocate memory and might also to initialize it to some value;&lt;br /&gt;To declare a variable, the compiler "knows" that a variable by that name and type exists, and it will not allocate memory since it has been done somewhere else.&lt;br /&gt;A variable must be defined once and only once but it can be declared  many times.&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;An external variable may also be declared inside a function. Otherwise the compiler will consider it a definition of a local variable with a different scope, lifetime and initial value. This declaration will only be visible inside the function.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;extern vs. include guards &lt;span style="font-size:85%;"&gt;[2]&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;Include guards:&lt;br /&gt;&lt;code&gt;#ifndef _SOMENAME_H&lt;br /&gt;#define _SOMENAME_H&lt;br /&gt;... (body of the header) ...&lt;br /&gt;#endif //_SOMENAME_H&lt;/code&gt;&lt;br /&gt;Include guards are useful only when &lt;code&gt;a.cpp&lt;/code&gt; includes &lt;code&gt;a.h&lt;/code&gt; and &lt;code&gt;b.h&lt;/code&gt;, both of which include &lt;code&gt;c.h&lt;/code&gt;. In this case, &lt;code&gt;c.h&lt;/code&gt; will be parsed only once.&lt;br /&gt;&lt;/blockquote&gt;&lt;blockquote&gt;Consider a header file, &lt;code&gt;header.h&lt;/code&gt;, which has a global variable declaration without &lt;code&gt;extern&lt;/code&gt; keyword.&lt;br /&gt;&lt;code&gt;int x;&lt;/code&gt;&lt;br /&gt;Now suppose two source files, &lt;code&gt;a.cpp&lt;/code&gt; and &lt;code&gt;b.cpp&lt;/code&gt;, both of which include &lt;code&gt;header.h&lt;/code&gt;. And we compile &lt;code&gt;a.cpp&lt;/code&gt; and &lt;code&gt;b.cpp&lt;/code&gt; separately.&lt;br /&gt;&lt;code&gt;g++ a.cpp -o a.o&lt;br /&gt;g++ b.cpp -o b.o&lt;/code&gt;&lt;br /&gt;When &lt;code&gt;a.cpp&lt;/code&gt; is compiled, the compiler reads &lt;code&gt;header.h&lt;/code&gt; and instantiates an integer variable named &lt;code&gt;x&lt;/code&gt; as part of the object file &lt;code&gt;a.o&lt;/code&gt;. Then &lt;code&gt;b.cpp&lt;/code&gt; gets compiled. The compiler doesn't remember that &lt;code&gt;a.cpp&lt;/code&gt; already read &lt;code&gt;hearder.h&lt;/code&gt;, and it will read &lt;code&gt;header.h&lt;/code&gt; (again!) and instantiates another integer variable named &lt;code&gt;x&lt;/code&gt; as part of &lt;code&gt;b.o&lt;/code&gt;!&lt;br /&gt;When &lt;code&gt;a.o&lt;/code&gt; and &lt;code&gt;b.o&lt;/code&gt; are linked into the final executable, there are two separate instantiations of the same variable, &lt;code&gt;x&lt;/code&gt;! Hence, a linked error. :(&lt;br /&gt;&lt;/blockquote&gt;The &lt;code&gt;extern&lt;/code&gt; applied to a function prototype makes no  difference since functions are assumed to be external. But, when used with a string, it can specify that the linkage conventions of another language are being used for the declarator(s).&lt;br /&gt;&lt;code&gt;extern string-literal declarator&lt;br /&gt;extern string-literal { declarator-list }&lt;/code&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Mixed-language Programming and external linkage &lt;span style="font-size:85%;"&gt;[3]&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;A C++ programmer may use a standard C library and it works coz C implementation takes care of the language for us. But when we use our own libraries witten in C from a C++ program, we need &lt;code&gt;extern "C"&lt;/code&gt; for our functions.&lt;br /&gt;Consider a C library containing&lt;br /&gt;&lt;code&gt;%cat greet.h&lt;br /&gt;extern char *greet(); // notice that there is no string-literal "C"!&lt;/code&gt;&lt;br /&gt;Now our C++ code call the C function and is linked with the dynamic library that holds the implementation for the function.&lt;br /&gt;&lt;code&gt;%cat mixcode.cpp&lt;br /&gt;#include "greet.h"&lt;br /&gt;&lt;br /&gt;int main() {&lt;br /&gt;greet();&lt;br /&gt;return (0);&lt;br /&gt;}&lt;br /&gt;%CC -lgreet mixcode.cpp&lt;/code&gt;&lt;br /&gt;The linking will be failed with &lt;code&gt;undefined symbol&lt;/code&gt; error! Why?&lt;br /&gt;The reason is that a typical C++ compiler &lt;span style="font-weight: bold;"&gt;mangles&lt;/span&gt; function names to support &lt;span style="font-weight: bold;"&gt;function overloading&lt;/span&gt;! So, the symbol &lt;code&gt;greet&lt;/code&gt; is changed to something else (depends on the algorithm implemented in the compiler during the name mangling process). Hence the object file dose not have the symbol &lt;code&gt;greet&lt;/code&gt; anywhere in the symbol table!&lt;br /&gt;The solution is to use &lt;code&gt;extern "C"&lt;/code&gt; instead of &lt;code&gt;extern&lt;/code&gt;.&lt;br /&gt;&lt;code&gt;%cat greet.h&lt;br /&gt;#if defined __cplusplus  // use this to avoid an error from a C compiler&lt;br /&gt; extern "C" {           // since C compiler doesn't recognize "C" protion&lt;br /&gt;#endif&lt;br /&gt; char *greet();&lt;br /&gt;#if defined __cplusplus&lt;br /&gt; }&lt;br /&gt;#endif&lt;br /&gt;&lt;/code&gt;The function name &lt;code&gt;greet&lt;/code&gt; was not mangled by the C++  compiler, and hence the linker could find the symbol in the object file  and was able to build the executable.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;Note: Standard C99 does NOT support function overloading but it may mangle some names.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;span style="font-size:85%;"&gt;Ref: [1] &lt;a href="http://en.wikipedia.org/wiki/External_variable"&gt;External variable (wiki)&lt;/a&gt;&lt;br /&gt;[2] &lt;a href="http://www.cplusplus.com/forum/general/13759/"&gt;Header inclusions (C++ forums)&lt;/a&gt;&lt;br /&gt;[3] &lt;a href="http://developers.sun.com/solaris/articles/external_linkage.html"&gt;Mixed-language Programming and external linkage&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-3220695392962462918?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/3220695392962462918/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=3220695392962462918' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/3220695392962462918'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/3220695392962462918'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2010/05/extern-keyword.html' title='extern keyword'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-6648298931506012442</id><published>2010-05-02T14:18:00.006-04:00</published><updated>2010-05-02T15:18:02.687-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='All about Apple'/><title type='text'>Install libQGLViewer on Mac OS X 10.6.3 (Snow Leopard) [1]</title><content type='html'>&lt;span style="font-weight: bold;font-family:arial;" &gt;Pre-requirement: Qt&lt;/span&gt;&lt;br /&gt;The easiest way to develop Qt applications on a Mac is to download Xcode  from the &lt;a href="http://developer.apple.com/technology/xcode.html"&gt;apple  web site&lt;/a&gt; and then to install a Qt package from the &lt;a href="http://qt.nokia.com/downloads"&gt;nokia web site&lt;/a&gt;.&lt;blockquote  style="font-style: italic;font-family:times new roman;"&gt;&lt;span style="font-size:85%;"&gt;Note -- Qt for Mac OS X requirement&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;font-family:times new roman;" &gt;Performing a new install of the Qt 4.6 beta on Snow Leopard triggers  a bug in the installer that causes the install to fail. Updating an  existing Qt installation works fine.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:times new roman;" &gt;There are two workarounds, either disable spotlight for the target  drive during the install, or do a custom install where you deselect  documentation and examples. Run the installer again as a full install to  get the documentation and examples installed.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;Using &lt;span style="font-family:courier new;"&gt;make&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;The general procedure is&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;tar -xzf &lt;a href="http://www.libqglviewer.com/src/libQGLViewer-2.3.5.tar.gz"&gt;libQGLViewer-2.3.5.tar.gz&lt;/a&gt;&lt;br /&gt;cd libQGLViewer-2.3.5/QGLViewer&lt;br /&gt;qmake&lt;br /&gt;make&lt;br /&gt;make install&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;The default install paths are system directories. It could be customized by &lt;code&gt;qmake&lt;/code&gt; parameters, e.g. &lt;code&gt;qmake PREFIX=$HOME&lt;/code&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;&lt;br /&gt;Possible Errors and Solutions&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;pre&gt;bash-3.2$ qmake -spec macx-g++&lt;br /&gt;bash-3.2$ make&lt;br /&gt;make: *** No rule to  make target `qglviewer.icns', needed by `/Library/Frameworks/&lt;wbr&gt;QGLViewer.framework/Versions/&lt;wbr&gt;2/Headers/qglviewer.icns'.   Stop.&lt;/pre&gt;Solu 1: Remove every mention of &lt;span style="font-style: italic;"&gt;qglviewer.icns&lt;/span&gt; in all &lt;span style="font-style: italic;"&gt;.pro&lt;/span&gt; files.&lt;br /&gt;Solu 2: Create an empty file with the same name to "cheat" &lt;code&gt;make&lt;/code&gt;.&lt;br /&gt;&lt;pre&gt;touch qglviewer.icns&lt;br /&gt;make&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;pre&gt;bash-3.2$ qmake -spec darwin-g++&lt;br /&gt;bash-3.2$ make&lt;br /&gt;Undefined symbols:&lt;br /&gt;"QWidget::x11Event(_XEvent*)", referenced from:&lt;br /&gt;vtable for VRenderInterfacein saveSnapshot.o&lt;br /&gt;vtable for ImageInterfacein saveSnapshot.o&lt;br /&gt;vtable for QGLViewerin moc_qglviewer.o&lt;br /&gt;ld: symbol(s) not found&lt;br /&gt;collect2: ld returned 1 exit status&lt;br /&gt;make: *** [/Library/Frameworks/QGLViewer.framework/QGLViewer] Error 1&lt;/pre&gt;darwin-g++ requires X11. Supposedly, x11Event thing is only switched on when &lt;code&gt;Q_WS_X11&lt;/code&gt; is defined [2].&lt;br /&gt;&lt;br /&gt;A solu: try compile and run the following program [3] with &lt;code&gt;gcc -I/Developer/qt/include -o test test.c&lt;/code&gt; and see what it says. If it says &lt;code&gt;Q_WS_X11&lt;/code&gt; then that's the problem. Find a version of gcc and Qt so that &lt;code&gt;Q_WS_X11&lt;/code&gt; will not be spited out. An alternative is to include &lt;code&gt;-lX11&lt;/code&gt; at link time to force feed (a bad dog...).&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;Using Xcode&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;qmake -spec macx-xcode&lt;br /&gt;&lt;/pre&gt;Then open and build the resulting Xcode project. Run &lt;code&gt;make install&lt;/code&gt;  to install the documentation in &lt;code&gt;/Developer/Documentation/QGLViewer&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;Note&lt;/span&gt;&lt;br /&gt;Both Xcode and make generate a Framework by default.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Ref: [1] &lt;a href="http://www.libqglviewer.com/installUnix.html#mac"&gt;libQGLViewer installation on Mac&lt;/a&gt;&lt;br /&gt;[2] &lt;a href="http://bugs.mysql.com/bug.php?id=2183"&gt;Bugs: can't make mysql on Mac&lt;/a&gt;&lt;br /&gt;[3]&lt;br /&gt;&lt;/span&gt;&lt;pre class="note"&gt;&lt;span style="font-size:85%;"&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;&lt;br /&gt;#include &amp;lt;qglobal.h&amp;gt;&lt;br /&gt;&lt;br /&gt;int main(int argc, char **argv) {&lt;br /&gt;&lt;br /&gt;#if defined(__APPLE__) &amp;amp;&amp;amp; defined(__GNUC__)&lt;br /&gt;fprintf(stderr, "__APPLE__ &amp;amp;&amp;amp; __GNUC__\n");&lt;br /&gt;#endif&lt;br /&gt;&lt;br /&gt;#ifdef __MACOSX__&lt;br /&gt;fprintf(stderr, "__MACOSX__\n");&lt;br /&gt;#endif&lt;br /&gt;&lt;br /&gt;#ifdef __DARWIN_X11__&lt;br /&gt;fprintf(stderr, "__DARWIN_X11__\n");&lt;br /&gt;#endif&lt;br /&gt;&lt;br /&gt;#ifdef Q_OS_UNIX&lt;br /&gt;fprintf(stderr, "Q_OS_UNIX\n");&lt;br /&gt;#endif&lt;br /&gt;&lt;br /&gt;#ifdef Q_WS_MACX&lt;br /&gt;fprintf(stderr, "Q_WS_MACX\n");&lt;br /&gt;#endif&lt;br /&gt;&lt;br /&gt;#ifdef Q_WS_X11&lt;br /&gt;fprintf(stderr, "Q_WS_X11\n");&lt;br /&gt;#endif&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;span style="font-size:85%;"&gt;It should say:&lt;br /&gt;&lt;/span&gt;&lt;pre&gt;&lt;span style="font-size:85%;"&gt;__APPLE__ &amp;amp;&amp;amp; __GNUC__&lt;br /&gt;Q_OS_UNIX&lt;br /&gt;Q_WS_MACX&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-6648298931506012442?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/6648298931506012442/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=6648298931506012442' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/6648298931506012442'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/6648298931506012442'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2010/05/install-libqglviewer-on-mac-os-x-1063.html' title='Install libQGLViewer on Mac OS X 10.6.3 (Snow Leopard) [1]'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-5500183934323909455</id><published>2010-04-29T23:15:00.002-04:00</published><updated>2010-04-29T23:31:54.532-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='All about Apple'/><title type='text'>Uninstall DevTools</title><content type='html'>Uninstall XCode:&lt;br /&gt;&lt;blockquote&gt;Type the following command from a terminal window.&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-family: courier new;"&gt;%% sudo /Developer/Library/uninstall-devtools --mode=all&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;Easy enough, just make sure this is what you really intend to do as once  it’s gone, it’s gone.&lt;br /&gt;IMPORTANT: If you are going to install a previous version of the Developer Tools, be sure to restart the machine after installing.&lt;br /&gt;&lt;/blockquote&gt;Uninstall MacPort: [&lt;a href="http://guide.macports.org/chunked/installing.macports.uninstalling.html"&gt;1&lt;/a&gt;]&lt;br /&gt;&lt;blockquote&gt;First uninstall all the installed ports by running this     command in the Terminal.&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-family: courier new;"&gt;%% sudo port -f uninstall installed&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;To remove all remaining traces of MacPorts, run the following     command in the Terminal.&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;%% sudo rm -rf \&lt;br /&gt;   /opt/local \&lt;br /&gt;   /Applications/DarwinPorts \&lt;br /&gt;   /Applications/MacPorts \&lt;/span&gt;&lt;span style="font-family: monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;/Library/LaunchDaemons/org.macports.* \&lt;/span&gt;&lt;span style="font-family: monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;   /Library/Receipts/DarwinPorts*.pkg \&lt;/span&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;   /Library/Receipts/MacPorts*.pkg \&lt;/span&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;   /Library/StartupItems/DarwinPortsStartup \&lt;/span&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;   /Library/Tcl/darwinports1.0 \&lt;/span&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;   /Library/Tcl/macports1.0 \&lt;br /&gt;   ~/.macports&lt;span style="font-family: monospace;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-5500183934323909455?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/5500183934323909455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=5500183934323909455' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/5500183934323909455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/5500183934323909455'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2010/04/uninstall-devtools.html' title='Uninstall DevTools'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-1323023186302448762</id><published>2010-04-27T19:05:00.008-04:00</published><updated>2010-04-27T20:24:00.362-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><title type='text'>Polymorphism, Inheritance -- virtual functions</title><content type='html'>A &lt;span style="font-weight: bold;"&gt;virtual&lt;/span&gt; function allows derived classes to over-ridden the implementation provided by the base class so that derived classes could have different functionality from the base class.&lt;br /&gt;&lt;blockquote&gt;cf. &lt;span style="font-weight: bold;"&gt;Function Overloading&lt;/span&gt;: Declare the same function (same name, same return type) with different number of parameters or different types of parameters.&lt;br /&gt;&lt;/blockquote&gt;&lt;blockquote&gt;cf. &lt;span style="font-weight: bold;"&gt;non-virtual&lt;/span&gt; member functions: The non-virtual functions are resolved at &lt;span style="font-weight: bold;"&gt;compile time&lt;/span&gt; (aka &lt;span style="font-weight: bold;"&gt;static binding&lt;/span&gt;); whereas the virtual functions are resolved during &lt;span style="font-weight: bold;"&gt;run-time&lt;/span&gt; (aka &lt;span style="font-weight: bold;"&gt;dynamic binding&lt;/span&gt;).&lt;br /&gt;&lt;/blockquote&gt;If a function is NOT declared as virtual, then the base class function would have been called all the times; But if the function is declared virtual, the derived class function is being invoked.&lt;br /&gt;Whenever a program  has a C++ virtual function declared, a &lt;span style="font-weight: bold;"&gt;v-table&lt;/span&gt; is constructed for the  class. The v-table consists of addresses to the virtual functions for  classes and pointers to the functions from each of the objects of the  derived class. Whenever there is a function call made to the c++ virtual  function, the v-table is used to resolve to the function address. This  is how the Dynamic binding happens during a virtual function call.&lt;br /&gt;&lt;blockquote&gt;vs. Java: In Java, all non-static methods are &lt;span style="font-weight: bold;"&gt;by default virtual functions&lt;/span&gt; unless they are marked with the keyword &lt;span style="color: rgb(0, 0, 0); font-family: courier new;font-family:courier new;" &gt;final&lt;/span&gt;.&lt;/blockquote&gt;A &lt;span style="font-weight: bold;"&gt;pure virtual&lt;/span&gt; functions is declared using a special syntax [ &lt;i&gt;= 0&lt;/i&gt; ] and all classes that contain at least one pure virtual function are &lt;span style="font-weight: bold;"&gt;abstract  base classes&lt;/span&gt;.&lt;br /&gt;Because in abstract base classes at least one of its members lacks  implementation, we can NOT create instances (objects) of it. But we can create &lt;span style="font-weight: bold;"&gt;pointers&lt;/span&gt; to it and take advantage of all its polymorphic  abilities.&lt;pre class="de1"&gt;&lt;span class="kw2"&gt;&lt;/span&gt;&lt;blockquote  style="font-family:courier new;"&gt;&lt;span class="kw2"&gt;class&lt;/span&gt; Abstract &lt;span class="br0"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span class="kw2"&gt;public&lt;/span&gt;&lt;span class="sy4"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;span class="kw2"&gt;virtual&lt;/span&gt; &lt;span class="kw4"&gt;void&lt;/span&gt; pure_virtual&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt; &lt;span class="sy1"&gt;=&lt;/span&gt; &lt;span class="nu0"&gt;0&lt;/span&gt;&lt;span class="sy4"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class="br0"&gt;}&lt;/span&gt;&lt;span class="sy4"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Abstract abs; // illegal&lt;br /&gt;Abstract* pAbs; // perfectly valid&lt;/blockquote&gt;&lt;/pre&gt;It is important for a C++ base class to have a virtual destructor to  ensure that the destructor from the most derived class will always be  called.&lt;br /&gt;&lt;br /&gt;Here is a full example:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family: courier new;font-size:85%;" &gt;#include  &amp;lt;iostream&amp;gt;&lt;br /&gt;#include &amp;lt;string&amp;gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;&lt;br /&gt;//There are N types of amphibians: frogs and toads.&lt;br /&gt;&lt;br /&gt;class Amphibian{&lt;br /&gt;public:&lt;br /&gt;    Amphibian() {&lt;br /&gt;cout &amp;lt;&amp;lt; "Constructing " &amp;lt;&amp;lt; name() &amp;lt;&amp;lt; endl;&lt;br /&gt;}&lt;br /&gt;    virtual ~Amphibian() {&lt;br /&gt;cout &amp;lt;&amp;lt; "Destructing " &amp;lt;&amp;lt; name() &amp;lt;&amp;lt; endl;&lt;br /&gt;}&lt;br /&gt;public:&lt;br /&gt;    void jump(){&lt;/span&gt;&lt;span style="font-family: courier new;font-size:85%;" &gt; // non-virtual function&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-size:85%;" &gt;   cout &amp;lt;&amp;lt; "I'm jumping now." &amp;lt;&amp;lt; endl;&lt;br /&gt;}&lt;br /&gt;    virtual string name() {&lt;br /&gt;return "Amphibian";&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;font-size:85%;" &gt;&lt;br /&gt;// not a pure virtural  function but a declaration&lt;br /&gt;                             // will produce error during link-time&lt;br /&gt;   &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;     //virtual void speak();&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;&lt;br /&gt;virtual void speak() {&lt;br /&gt;cout &amp;lt;&amp;lt; "Error." &amp;lt;&amp;lt; endl;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;class Frog: public Amphibian{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;public:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;     ~Frog() {&lt;br /&gt;cout &amp;lt;&amp;lt; "Destructing " &amp;lt;&amp;lt; endl;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;public:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;     string name() {&lt;br /&gt;return "Frog";&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;     void speak() {&lt;br /&gt;cout &amp;lt;&amp;lt; "Ribbet." &amp;lt;&amp;lt; endl;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;class Toad: public Amphibian{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;public:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;     Toad() {&lt;br /&gt;cout &amp;lt;&amp;lt; "Contructing " &amp;lt;&amp;lt; endl;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;public:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;     string name() {&lt;br /&gt;return "Toad";&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;     void speak() {&lt;br /&gt;cout &amp;lt;&amp;lt; "Croak!" &amp;lt;&amp;lt; endl;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;};&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;int main(){&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;    &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;    Amphibian * ap1 = new Amphibian();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;    ap1-&gt;jump();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;    ap1-&gt;speak();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;    cout &amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;    Frog * fp1 = new Frog();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;    fp1-&gt;jump();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;    fp1-&gt;speak();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;    cout &amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;    Toad * tp1 = new Toad();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;    tp1-&gt;jump();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;    tp1-&gt;speak();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;    cout &amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;    Amphibian * list[10];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;    list[0] = ap1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;    list[1] = fp1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;    list[2] = tp1;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family: courier new;"&gt;    for (int i = 0; i &lt;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;        list[i]-&gt;speak(); //ah!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;    delete ap1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;    cout &amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;    delete fp1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;    cout &amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;    delete tp1;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;    return 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;g++ output:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;Constructing Amphibian&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;I'm jumping now.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;Error.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;Constructing Amphibian&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;I'm jumping now.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;Ribbet.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;Constructing Amphibian&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;Contructing Toad&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;I'm jumping now.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;Croak!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;Error.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;Ribbet.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;Croak!&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;Destructing Amphibian&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;Destructing Frog&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;Destructing Amphibian&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;font-family:courier new;" &gt;Destructing Amphibian&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span&gt;&lt;span style="font-size:85%;"&gt;Ref: [1] &lt;a href="http://en.wikipedia.org/wiki/Virtual_function"&gt;wiki - virtual function&lt;/a&gt;&lt;br /&gt;[2] &lt;a href="http://www.parashift.com/c++-faq-lite/virtual-functions.html"&gt;C++ FAQ Lite - virtual function&lt;/a&gt;&lt;/span&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/8742529245277406456-1323023186302448762?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/1323023186302448762/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=1323023186302448762' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/1323023186302448762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/1323023186302448762'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2010/04/polymorphism-inheritance-virtual.html' title='Polymorphism, Inheritance -- virtual functions'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-1180548406241032031</id><published>2010-04-27T17:43:00.003-04:00</published><updated>2010-04-27T18:13:51.603-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='All about Apple'/><title type='text'>CMake -- Cross-Platform Make System</title><content type='html'>CMake itself is not a build system, since it USES native build system to build files.&lt;br /&gt;It generates native build environments and it supports most modern systems, such as &lt;span style="font-weight: bold;"&gt;Make&lt;/span&gt; on UNIX/Linux, &lt;span style="font-weight: bold;"&gt;VS&lt;/span&gt; on Windows and &lt;span style="font-weight: bold;"&gt;XCode&lt;/span&gt; on Apple. That's how it can be used as a Cross-Platform make system.&lt;br /&gt;&lt;p&gt;Using  CMake to build a project is extremely easy.&lt;/p&gt;&lt;p&gt;First, create a &lt;span style="font-weight: bold;"&gt;CMakeLists.txt&lt;/span&gt; which contains the project parameters and  describes the build process in simple CMake language.&lt;/p&gt;&lt;p&gt;Then, take UNIX as an example, enter the directory which contains CMakeLists.txt and type in:&lt;/p&gt;&lt;pre class="programlisting"&gt;&lt;span style="font-family:courier new;"&gt;cmake &lt;/span&gt;&lt;span class="emphasis"  style="font-family:courier new;"&gt;&lt;em&gt;path&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;make&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;The CMake step reads the CMakeLists.txt file from the source directory and generates appropriate Makefiles for the system, in the current directory. CMake also maintains a list of all header files that objects depend on, so &lt;span style="font-weight: bold;"&gt;dependency checking can be assured&lt;/span&gt;. If you need to add more source files, simply add them to the list. Once Makefiles are generated, you do not have to run CMake any more, because the dependency to CMakeLists.txt also are in the generated Makefiles. If you want to make sure that dependencies are regenerated, you can always run &lt;span style="font-family:courier new;"&gt;make depend&lt;/span&gt;.&lt;/p&gt;&lt;p&gt;Similarly, on Mac OS X, run&lt;br /&gt;&lt;/p&gt;&lt;span style="font-family:courier new;"&gt;cmake -G Xcode&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;CMake will generate an XCode project for  you. Just open the XXX.xcodeproj in XCode and you are  done. =]&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Ref: [1] &lt;a href="http://www.cmake.org/Wiki/CMake"&gt;CMake Wiki&lt;/a&gt;&lt;br /&gt;[2] &lt;a href="http://manish-chaks.livejournal.com/88106.html"&gt;CMake + Qt4 + XCode on OSX&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-1180548406241032031?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/1180548406241032031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=1180548406241032031' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/1180548406241032031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/1180548406241032031'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2010/04/cmake-cross-platform-make-system.html' title='CMake -- Cross-Platform Make System'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-8744649328841708735</id><published>2010-04-20T18:11:00.003-04:00</published><updated>2010-04-20T19:18:41.034-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='OS'/><category scheme='http://www.blogger.com/atom/ns#' term='All about Apple'/><title type='text'>Default install location for MacPorts</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Default&lt;/span&gt;: &lt;span style="font-family:courier new;"&gt;/opt/local&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Reason&lt;/span&gt;: to avoid stomping on other installations; &lt;span style="font-family:courier new;"&gt;/usr/local&lt;/span&gt; is not a viable (practicable/feasible) choice due to:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Some software (especially tools from GNU) look in &lt;span style="font-family:courier new;"&gt;/usr/local&lt;/span&gt; as a default location, which means MacPorts can't be isolated when needed&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:courier new;"&gt;/usr/local&lt;/span&gt; is usually reserved for the host system's admin to install items local to that system, so it would be a bad choice to be taken over by a non-system port system&lt;/li&gt;&lt;li&gt;GCC considers &lt;span style="font-family:courier new;"&gt;/usr/local&lt;span style="font-family:georgia;"&gt; &lt;/span&gt;&lt;/span&gt;to be a standard system directory, thus, (at least) the include directory is UNable to appear early in the list of include directories, and hence, MacPorts-installed items would be difficult to use properly for items which need them (where another version is installed elsewhere, like &lt;span style="font-family:courier new;"&gt;/usr/X11R6&lt;/span&gt;)&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;Ref: &lt;a href="http://trac.macports.org/wiki/FAQ"&gt;FAQ - MacPorts &lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-8744649328841708735?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/8744649328841708735/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=8744649328841708735' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/8744649328841708735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/8744649328841708735'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2010/04/default-install-location-for-macports.html' title='Default install location for MacPorts'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-5443647276855583065</id><published>2010-04-20T17:45:00.003-04:00</published><updated>2010-04-21T10:30:11.880-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='All about Apple'/><title type='text'>Install libQGLViewer on Mac using MacPorts</title><content type='html'>Well, I felt so lucky to have MacPorts to install these open-source libraries... So many dependencies...&lt;br /&gt;&lt;br /&gt;bash-3.2$ &lt;span style="font-family:courier new;"&gt;port deps libQGLViewer&lt;/span&gt;&lt;br /&gt;Full Name: libQGLViewer @2.3.5&lt;br /&gt;Build Dependencies:   libicns&lt;br /&gt;Library Dependencies: qt4-mac&lt;br /&gt;&lt;br /&gt;bash-3.2$ &lt;span style="font-family:courier new;"&gt;sudo port install libqglviewer&lt;/span&gt;&lt;br /&gt;Password:&lt;br /&gt;---&gt;  Computing dependencies for libQGLViewer&lt;br /&gt;---&gt;  Fetching jpeg&lt;br /&gt;...&lt;br /&gt;---&gt;  Fetching jasper&lt;br /&gt;...&lt;br /&gt;---&gt;  Fetching libpng&lt;br /&gt;...&lt;br /&gt;---&gt;  Fetching libicns&lt;br /&gt;...&lt;br /&gt;---&gt;  Fetching perl5.8&lt;br /&gt;...&lt;br /&gt;---&gt;  Fetching perl5&lt;br /&gt;...&lt;br /&gt;---&gt;  Fetching p5-locale-gettext&lt;br /&gt;...&lt;br /&gt;---&gt;  Fetching help2man&lt;br /&gt;...&lt;br /&gt;---&gt;  Fetching m4&lt;br /&gt;...&lt;br /&gt;---&gt;  Fetching autoconf&lt;br /&gt;...&lt;br /&gt;---&gt;  Fetching automake&lt;br /&gt;...&lt;br /&gt;---&gt;  Fetching libtool&lt;br /&gt;...&lt;br /&gt;---&gt;  Fetching pkgconfig&lt;br /&gt;...&lt;br /&gt;---&gt;  Fetching dbus&lt;br /&gt;...&lt;br /&gt;---&gt;  Activating dbus @1.2.16_1&lt;br /&gt;###############################################################&lt;br /&gt;# Startup items have been generated that will aid in&lt;br /&gt;# starting dbus with launchd. They are disabled&lt;br /&gt;# by default. Execute the following command to start them,&lt;br /&gt;# and to cause it to launch at startup:&lt;br /&gt;#&lt;br /&gt;# sudo launchctl load -w /Library/LaunchDaemons/org.freedesktop.dbus-system.plist&lt;br /&gt;# launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist&lt;br /&gt;###############################################################&lt;br /&gt;---&gt;  Cleaning dbus&lt;br /&gt;---&gt;  Fetching tiff&lt;br /&gt;...&lt;br /&gt;---&gt;  Fetching lcms&lt;br /&gt;...&lt;br /&gt;---&gt;  Fetching libmng&lt;br /&gt;...&lt;br /&gt;---&gt;  Fetching readline&lt;br /&gt;...&lt;br /&gt;---&gt;  Fetching sqlite3&lt;br /&gt;...&lt;br /&gt;---&gt;  Fetching qt4-mac&lt;br /&gt;...&lt;br /&gt;&lt;blockquote&gt;It was stuck when "Building qt4-mac". Used Ctrl+C to break the procedure and tried to re-install by calling "sudo port install libqglviewer" but didn't work. From the manual, it is said that a port can not be uninstalled if it was installed as a dependency. Thus, called "port clean qt4-mac" and re-install libqglviewer. It worked!&lt;br /&gt;&lt;/blockquote&gt;---&gt; Fetching libqglviewer&lt;br /&gt;...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-5443647276855583065?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/5443647276855583065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=5443647276855583065' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/5443647276855583065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/5443647276855583065'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2010/04/install-libqglviewer-on-mac-using.html' title='Install libQGLViewer on Mac using MacPorts'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-2022551394613272707</id><published>2010-04-20T17:22:00.003-04:00</published><updated>2010-04-20T17:53:29.218-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='All about Apple'/><title type='text'>Install CGAL on Mac using MacPorts</title><content type='html'>For a general introduction about MacPorts and its commands, you can find in the prior post.&lt;br /&gt;&lt;br /&gt;bash-3.2$ &lt;span style="font-family:courier new;"&gt;port deps cgal&lt;/span&gt;&lt;br /&gt;Full Name: cgal @3.5.1&lt;br /&gt;Library Dependencies: cmake,&lt;br /&gt;                     boost,&lt;br /&gt;                     mpfr&lt;br /&gt;&lt;br /&gt;bash-3.2$ &lt;span style="font-family:courier new;"&gt;port install cgal&lt;/span&gt;&lt;br /&gt;MacPorts running without privileges. You may be unable to complete certain actio&lt;br /&gt;ns (eg install).&lt;br /&gt;---&gt;  Computing dependencies for cgal&lt;br /&gt;        ...&lt;br /&gt;Error: Target org.macports.install returned: MacPorts requires root privileges f&lt;br /&gt;or this action&lt;br /&gt;Error: The following dependencies failed to build: cmake libidn gettext libiconv&lt;br /&gt;gperf ncurses ncursesw openssl mpfr gmp&lt;br /&gt;Error: Status 1 encountered during processing.&lt;br /&gt;Before reporting a bug, first run the command again with the -d flag to get comp&lt;br /&gt;lete output.&lt;br /&gt;&lt;br /&gt;bash-3.2$ &lt;span style="font-family:courier new;"&gt;sudo port install cgal&lt;/span&gt;&lt;br /&gt;Password:&lt;br /&gt;---&gt;  Computing dependencies for cgal&lt;br /&gt;---&gt;  Fetching gperf&lt;br /&gt;        ...&lt;br /&gt;---&gt;  Fetching libiconv&lt;br /&gt;        ...&lt;br /&gt;---&gt;  Fetching ncursesw&lt;br /&gt;        ...&lt;br /&gt;---&gt;  Fetching ncurses&lt;br /&gt;        ...&lt;br /&gt;---&gt;  Fetching gettext&lt;br /&gt;        ...&lt;br /&gt;---&gt;  Fetching libidn&lt;br /&gt;        ...&lt;br /&gt;---&gt;  Fetching openssl&lt;br /&gt;        ...&lt;br /&gt;---&gt;  Fetching cmake&lt;br /&gt;        ...&lt;br /&gt;---&gt;  Fetching gmp&lt;br /&gt;        ...&lt;br /&gt;---&gt;  Fetching mpfr&lt;br /&gt;        ...&lt;br /&gt;---&gt;  Fetching cgal&lt;br /&gt;---&gt;  Attempting to fetch CGAL-3.5.1.tar.gz from http://lil.fr.distfiles.macports.org/cgal&lt;br /&gt;---&gt;  Verifying checksum(s) for cgal&lt;br /&gt;---&gt;  Extracting cgal&lt;br /&gt;---&gt;  Configuring cgal&lt;br /&gt;---&gt;  Building cgal&lt;br /&gt;---&gt;  Staging cgal into destroot&lt;br /&gt;---&gt;  Installing cgal @3.5.1_0&lt;br /&gt;---&gt;  Activating cgal @3.5.1_0&lt;br /&gt;---&gt;  Cleaning cgal&lt;br /&gt;&lt;br /&gt;bash-3.2$ &lt;span style="font-family: courier new;"&gt;port livecheck cgal&lt;/span&gt;&lt;br /&gt;cgal seems to have been updated (port version: 3.5.1, new version: 3.5)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-2022551394613272707?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/2022551394613272707/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=2022551394613272707' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/2022551394613272707'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/2022551394613272707'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2010/04/install-cgal-on-mac-using-macports.html' title='Install CGAL on Mac using MacPorts'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-7629170569452907606</id><published>2010-04-20T15:13:00.005-04:00</published><updated>2010-04-20T18:05:05.802-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='All about Apple'/><title type='text'>Install Boost on Mac (Snow Leopard) using MacPorts</title><content type='html'>The &lt;a href="http://www.macports.org/"&gt;MacPorts&lt;/a&gt; is an easy-to-use system for compiling, installing, and upgrading open-source software on the Mac OS X operating system.&lt;br /&gt;&lt;br /&gt;Pre-requirement:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Apple's &lt;a style="font-weight: bold;" href="http://developer.apple.com/tools/xcode/"&gt;Xcode&lt;/a&gt; Developer Tools&lt;br /&gt;Ensure that the optional components for command line development are installed ("Unix Development" in the Xcode 3.x installer).&lt;/li&gt;&lt;li&gt;The &lt;span style="font-weight: bold;"&gt;X11&lt;/span&gt; windowing environment (aka "X11 User")&lt;br /&gt;The "X11 User" package is included by default on Snow Leopard.&lt;br /&gt;You can use the xorg-server port instead of Apple's X11.app if you wish.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;Install MacPorts:&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;The easiest way is to download the &lt;a href="http://distfiles.macports.org/MacPorts/MacPorts-1.8.2-10.6-SnowLeopard.dmg"&gt;dmg for Snow Leopard&lt;/a&gt; and run the system's package installer (.pkg). This procedure will place a default MacPorts installation on your host system. Your shell configuration files (.profile) might be adapted by the installer. The installer will also run "&lt;span style="font-family:courier new;"&gt;selfupdate&lt;/span&gt;" to ensure the latest available release.&lt;br /&gt;To keep your MacPorts system current, you should run the following step manually:&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-family:courier new;"&gt;sudo port -v selfupdate&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;MacPorts also provides Source install and SVN install. You can find a detailed instruction &lt;a href="http://www.macports.org/install.php"&gt;here&lt;/a&gt; or &lt;a href="http://guide.macports.org/#installing.macports"&gt;Installing section in manual&lt;/a&gt;.&lt;br /&gt;&lt;/blockquote&gt;Install Boost using MacPorts:&lt;br /&gt;&lt;blockquote&gt;bash-3.2$ &lt;span style="font-family:courier new;"&gt;port deps boost&lt;/span&gt;&lt;br /&gt;Full Name: boost @1.42.0&lt;br /&gt;Build Dependencies:   boost-jam&lt;br /&gt;Library Dependencies: zlib,&lt;br /&gt;                                                              expat,&lt;br /&gt;                                                              bzip2&lt;br /&gt;&lt;/blockquote&gt;&lt;blockquote&gt;Then in the installing procedure, it installs dependencies first and then boost.&lt;br /&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;bash-3.2$ &lt;span style="font-family:courier new;"&gt;sudo port install boost&lt;/span&gt;&lt;br /&gt;Password:&lt;br /&gt;---&gt;  &lt;span style="font-weight: bold;"&gt;Computing dependencies&lt;/span&gt; for boost&lt;br /&gt;---&gt;  &lt;span style="font-weight: bold;"&gt;Fetch&lt;/span&gt;ing boost-jam&lt;br /&gt;---&gt;  Attempting to fetch boost-jam-3.1.17.tgz from http://voxel.dl.sourceforge.net/boost&lt;br /&gt;---&gt;  Verifying &lt;span style="font-weight: bold;"&gt;checksum&lt;/span&gt;(s) for boost-jam&lt;br /&gt;---&gt;  &lt;span style="font-weight: bold;"&gt;Extract&lt;/span&gt;ing boost-jam&lt;br /&gt;---&gt;  Applying &lt;span style="font-weight: bold;"&gt;patch&lt;/span&gt;es to boost-jam&lt;br /&gt;---&gt;  &lt;span style="font-weight: bold;"&gt;Configur&lt;/span&gt;ing boost-jam&lt;br /&gt;---&gt;  &lt;span style="font-weight: bold;"&gt;Build&lt;/span&gt;ing boost-jam&lt;br /&gt;---&gt;  Staging boost-jam into destroot&lt;br /&gt;---&gt;  &lt;span style="font-weight: bold;"&gt;Install&lt;/span&gt;ing boost-jam @3.1.17_0&lt;br /&gt;---&gt;  &lt;span style="font-weight: bold;"&gt;Activat&lt;/span&gt;ing boost-jam @3.1.17_0&lt;br /&gt;---&gt;  &lt;span style="font-weight: bold;"&gt;Clean&lt;/span&gt;ing boost-jam&lt;br /&gt;---&gt;  Fetching bzip2&lt;br /&gt;       ...&lt;br /&gt;---&gt;  Fetching expat&lt;br /&gt;       ...&lt;br /&gt;---&gt;  Fetching zlib&lt;br /&gt;       ...&lt;br /&gt;---&gt;  Fetching boost&lt;br /&gt;---&gt;  Attempting to fetch boost_1_42_0.tar.bz2 from http://voxel.dl.sourceforge.&lt;br /&gt;net/boost&lt;br /&gt;---&gt;  Verifying checksum(s) for boost&lt;br /&gt;---&gt;  Extracting boost&lt;br /&gt;---&gt;  Applying patches to boost&lt;br /&gt;---&gt;  Configuring boost&lt;br /&gt;---&gt;  Building boost&lt;br /&gt;&lt;br /&gt;---&gt;  Staging boost into destroot&lt;br /&gt;---&gt;  Installing boost @1.42.0_0&lt;br /&gt;---&gt;  Activating boost @1.42.0_0&lt;br /&gt;---&gt;  Cleaning boost&lt;br /&gt;&lt;/blockquote&gt;Port Commands [&lt;a href="http://guide.macports.org/#using.port"&gt;manual&lt;/a&gt;]:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;selfupdate&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;sudo port selfupdate&lt;/span&gt;&lt;br /&gt;or use the debug flag for verbose  output: &lt;span style="font-family:courier new;"&gt;sudo port -d selfupdate&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;list&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;port  list&lt;/span&gt; is used to get a list of all &lt;span style="font-weight: bold;"&gt;available&lt;/span&gt; ports. (The list is very long, so use search if  you know part of it.)&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;port installed&lt;/span&gt;  is used to get a list of all &lt;span style="font-weight: bold;"&gt;installed&lt;/span&gt;  ports in your host system.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;search&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:courier new;"&gt;port search xxx&lt;/span&gt;&lt;/span&gt; is  used to find port names by &lt;span style="font-weight: bold;"&gt;partial  matches&lt;/span&gt;.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;get information&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;port info xxx&lt;/span&gt; is to get information about a  port: description, maintainer, etc.&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;port  deps xxx&lt;/span&gt; shows the dependencies of a port.&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;port variants xxx&lt;/span&gt; allows you to check what variations of a  port are available.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;install&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;sudo port install xxx&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;clean&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;port  clean --all xxx&lt;/span&gt; deletes all intermediate files that MacPorts  creates while building a port.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;uninstall&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;port uninstall xxx&lt;/span&gt;  will uninstall an installed port.&lt;br /&gt;A port will not be uninstalled if  it was installed as a dependency of another port. You can use -f (force)  uninstall &lt;span style="font-family:courier new;"&gt;port -f uninstall xxx&lt;/span&gt; but be  careful!&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;upgrade&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;port upgrade xxx&lt;/span&gt; upgrades installed ports and  their dependencies when a Portfile in the repository has been updated  after the port was installed.&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;port -n  upgrade xxx&lt;/span&gt; will not upgrade a port's dependencies.&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;port upgrade outdated&lt;/span&gt; upgrades all outdated  ports.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-7629170569452907606?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/7629170569452907606/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=7629170569452907606' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/7629170569452907606'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/7629170569452907606'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2010/04/install-boost-on-mac-snow-leopard-using.html' title='Install Boost on Mac (Snow Leopard) using MacPorts'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-4730923751551092909</id><published>2010-03-31T17:20:00.000-04:00</published><updated>2010-04-01T10:22:04.502-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Insterests'/><title type='text'>Self learning</title><content type='html'>Several useful websits for programmer: -- those who want to learn sth awesome by themselves (not only in class, definitely).&lt;br /&gt;&lt;br /&gt;O'Reilly Answers&lt;br /&gt;http://answers.oreilly.com/&lt;br /&gt;&lt;br /&gt;Webmonkey&lt;br /&gt;http://www.webmonkey.com/&lt;br /&gt;&lt;br /&gt;Google Code University&lt;br /&gt;http://code.google.com/edu/languages/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-4730923751551092909?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/4730923751551092909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=4730923751551092909' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/4730923751551092909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/4730923751551092909'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2010/03/self-learning.html' title='Self learning'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-7119647012763599574</id><published>2010-03-30T15:32:00.005-04:00</published><updated>2010-04-03T12:17:59.253-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='Computational Geometry'/><category scheme='http://www.blogger.com/atom/ns#' term='Geometry'/><title type='text'>Rectilinear Mininimum Spanning Trees &amp; Steiner Trees</title><content type='html'>Given a set of points in a plane, a &lt;span style="font-weight: bold;"&gt;Rectilinear Minimum Spanning Tree&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; (RMST)&lt;/span&gt; is a set of edges which connects all of the points with minimum rectilinear distance.  &lt;span style="font-weight: bold;"&gt;Rectilinear distance&lt;/span&gt; (also called "&lt;span style="font-weight: bold;"&gt;Manhattan Distance&lt;/span&gt;") is the sum of the horizontal and vertical distance between two points.  It is used instead of Euclidean distance in VLSI CAD applications because VLSI processes support only horizontal and vertical wires.   &lt;br /&gt;&lt;br /&gt;The RMST can be used as an estimate of the length of a net that connects together multiple terminals.   &lt;br /&gt;&lt;br /&gt;The RMST Problem is a special case of the Minimum Spanning Tree problem studied in Computer Science Algorithms textbooks in that the distances between the points imply a complete graph&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Ref: [&lt;a href="http://vlsicad.ucsd.edu/GSRC/bookshelf/Slots/RSMT/RMST/"&gt;1&lt;/a&gt;] A. Kahng and I. Mandoiu, "GSRC Bookshelf RMST-Pack: Rectilinear Minimum Spanning Tree Algorithms", June 2001.&lt;br /&gt;[&lt;a href="http://cadapplets.lafayette.edu/STree/RMSTApplet.html"&gt;2&lt;/a&gt;] RMST Applet&lt;/span&gt;&lt;br /&gt;&lt;p&gt; &lt;span style=";font-family:arial,helvetica;font-size:100%;"  &gt;&lt;b&gt;About Steiner Trees&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;    &lt;/p&gt;       Given a set of terminal points in a plane, a &lt;span style="font-weight: bold;"&gt;Minimum Steiner Rectilinear Tree (MSRT)&lt;/span&gt; is a set of edges which connects all the terminals along with a set of added "Steiner points" such that the rectilinear distance is minimized.  F. Hwang [4] proved that the length of a Steiner tree can be &lt;span style="font-weight: bold;"&gt;up to 3/2 times shorter&lt;/span&gt; than a Rectilinear Minimum Spanning Tree on the same set of terminals.&lt;br /&gt;&lt;p&gt;M. Hanan [3] proved that a Minimum RST can be constructed using points on a grid defined by the x and y coordinates of the terminal points (now known as the &lt;span style="font-weight: bold;"&gt;Hanan Grid&lt;/span&gt;).&lt;br /&gt;    &lt;/p&gt;       The Minimum Steiner Rectilinear tree problem is be NP-Hard  [2].&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Ref: [&lt;a href="http://cadapplets.lafayette.edu/STree/SteinerDemo.html"&gt;1&lt;/a&gt;] MSRT Applet&lt;br /&gt;[2] M. &lt;span class="m"&gt;&lt;span class="h"&gt;Garey and D. Johnson,  "The rectilinear Steiner tree problem is NP-complete&lt;i&gt;"&lt;/i&gt;,        &lt;span style="font-style: italic;"&gt;SIAM Journal on Applied Mathematics&lt;/span&gt;, Vol. 32 pp. 826-834, 1977.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;[3] M. Hanan, "On Steiner's Problem with Rectilinear Distance", &lt;span style="font-style: italic;"&gt;SIAM Journal of Applied Math&lt;/span&gt;, Vol. 14, No. 2, March 1966, pp. 255-265.&lt;br /&gt;[4] F. Hwang, "On Steiner Minimal Trees with Rectilinear Distance", &lt;span style="font-style: italic;"&gt;SIAM Journal of Applied Mathematics,&lt;/span&gt; Vol. 30, No. 1, January 1976, pp. 104-114.&lt;br /&gt;[5] F. Hwang, D. Richards, and P. Winter, &lt;span style="font-style: italic;"&gt;The Steiner Tree Problem&lt;/span&gt;, North-Holland, 1992.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-7119647012763599574?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/7119647012763599574/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=7119647012763599574' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/7119647012763599574'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/7119647012763599574'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2010/03/rectilinear-mininimum-spanning-trees.html' title='Rectilinear Mininimum Spanning Trees &amp; Steiner Trees'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-2439786519564902372</id><published>2010-02-24T11:14:00.003-05:00</published><updated>2010-02-24T11:26:30.943-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OS'/><category scheme='http://www.blogger.com/atom/ns#' term='Hardware'/><title type='text'>Flash memory vs. DRAM</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Flash memory&lt;/span&gt; is a non-volatile computer storage that can be electrically erased and reprogrammed. Now it can be erased and programmed in large blocks instead of the entire chip in earlier age.&lt;br /&gt;Flash memory is &lt;span style="font-weight: bold;"&gt;non-volatile&lt;/span&gt;, meaning that no power is needed to maintain the information stored in the chip. Beyond that, flash memory offers &lt;span style="font-weight: bold;"&gt;fast read access times&lt;/span&gt; (although not as fast as DRAM) and better kinetic shock resistance than hard disks. These characteristics determine the popularity of flash memory in portable devices. Plus, it is extremely durable, in terms of intense pressure, extremes of temperature, and even immersion in water.&lt;br /&gt;Flash memory is a type of EEPROM but old-style EEPROM is only erasable in small blocks (typically bytes) and thus slowly. Being able to erase in large blocks gives flash memory a significant speed advantage over old-style EEPROM.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;DRAM (Dynamic Random Access Memory)&lt;/span&gt; is a type of random access memory. Its structure is simpler than SRAM, which allows DRAM to reach very high density. But, unlike flash memory, it is &lt;span style="font-weight: bold;"&gt;volatile&lt;/span&gt; memory (it loses its data when the power supply is removed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-2439786519564902372?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/2439786519564902372/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=2439786519564902372' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/2439786519564902372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/2439786519564902372'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2010/02/flash-memory-vs-dram.html' title='Flash memory vs. DRAM'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-4071515845244653908</id><published>2010-02-23T23:29:00.003-05:00</published><updated>2010-02-23T23:59:22.884-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OS'/><title type='text'>Nucleus RTOS</title><content type='html'>&lt;a href="http://www.mentor.com/products/embedded_software/nucleus_rtos/"&gt;Nucleus OS&lt;/a&gt; is an efficient real-time operating system (RTOS) created by the Embedded Software Division of &lt;a href="http://www.mentor.com/"&gt;Mentor Graphics&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;It is ideal for &lt;span style="font-weight: bold;"&gt;resource-constrained&lt;/span&gt; devices (in terms of frequency and memory) and for environments where squeezing out every cycle per watt is paramount. It is designed for embedded applications such as consumer electronics, set-top boxes, cell phones, and other portable and hand-held devices.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Core Services:&lt;/span&gt; Dynamic task creation and deletion; Application Timers; Counting Semaphores; Event Flags; Static and dynamic memory allocation.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Inter-task Communications Synchronization via:&lt;/span&gt; Semaphores; Fixed and variable queues; Mailboxes; Pipes; UNIX-like Signals.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Real-Time MMU (Memory Management Unit):&lt;/span&gt; Deterministic flat memory model; Graceful handling of errors in the field.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-4071515845244653908?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/4071515845244653908/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=4071515845244653908' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/4071515845244653908'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/4071515845244653908'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2010/02/nucleus-rtos.html' title='Nucleus RTOS'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-1867066687532729750</id><published>2010-02-17T20:37:00.002-05:00</published><updated>2010-02-17T21:22:10.890-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='Insterests'/><category scheme='http://www.blogger.com/atom/ns#' term='Thoughts'/><category scheme='http://www.blogger.com/atom/ns#' term='WSNs'/><title type='text'>Possible uses of Wireless Sensor Networks</title><content type='html'>Just record them here and will check them our with more details later when writing my thesis. ^^&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Environmental and weather monitoring&lt;/li&gt;&lt;li&gt;home automation and air conditioning&lt;/li&gt;&lt;li&gt;monitoring soil in agriculture&lt;/li&gt;&lt;li&gt;tracking goods in commerce and industry&lt;/li&gt;&lt;li&gt;monitoring machines in manufacturing plants&lt;/li&gt;&lt;li&gt;health care and medical diagnostics&lt;br /&gt;CodeBlue by Harvard Univ.&lt;/li&gt;&lt;li&gt;smart clothing for firefighter protection&lt;br /&gt;sensor mote, dynamically select header sensor of the cluster (one cluster per person)&lt;br /&gt;[Huantian Cao, Dept. of Fashion and Apparel Studies@UDel]&lt;br /&gt;&lt;/li&gt;&lt;li&gt;intrusion detection and other security systems&lt;/li&gt;&lt;li&gt;military applications&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-1867066687532729750?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/1867066687532729750/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=1867066687532729750' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/1867066687532729750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/1867066687532729750'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2010/02/possible-uses-of-wireless-sensor.html' title='Possible uses of Wireless Sensor Networks'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-7288146714935707320</id><published>2010-02-17T10:47:00.005-05:00</published><updated>2010-02-17T14:00:16.408-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Geometry'/><title type='text'>Taxicab Geometry</title><content type='html'>The &lt;span style="font-weight: bold;"&gt;taxicab metric&lt;/span&gt;, also known as &lt;span style="font-weight: bold;"&gt;rectilinear distance&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;city block distance&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;Manhattan distance&lt;/span&gt;, is another metric of Euclidean geometry in which the distance between two points is the sum of the (absolute) differences of their coordinates. Manhattan distance comes from the grid layout of most streets on the island of Manhattan where the shortest path a car could take between two points in the city is as long as their distance in taxicab geometry.&lt;br /&gt;&lt;br /&gt;Given two points &lt;span style="font-weight: bold;"&gt;p&lt;/span&gt;(p_1, p_2, ..., p_n) and &lt;span style="font-weight: bold;"&gt;q&lt;/span&gt;(q_1, q_2, ..., q_n), their taxicab distance is&lt;br /&gt;&lt;div style="text-align: center;"&gt;dist(&lt;span style="font-weight: bold;"&gt;p&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;q&lt;/span&gt;) = Sum(|p_i - q_i|), i = 1, 2, ..., n&lt;br /&gt;&lt;div style="text-align: left;"&gt;e.g. in 2D plane, the taxicab distance between (p_1, p_2) and (q_1, q_2) is |p_1 - q_1| + |p_2 - q_2|.&lt;br /&gt;&lt;br /&gt;cf. The &lt;span style="font-weight: bold;"&gt;Euclidean distance&lt;/span&gt; is the length of the straight line segment between two points.&lt;br /&gt;As shown in the picture (from wiki), the green line is Euclidean distance; The red, blue, and yellow lines are Manhattan distance and they have the same length.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_VV80-JZKIIw/S3wU99wJXVI/AAAAAAAAD4M/GdwLpbZ6LtM/s1600-h/283px-Manhattan_distance.svg.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 283px; height: 283px;" src="http://3.bp.blogspot.com/_VV80-JZKIIw/S3wU99wJXVI/AAAAAAAAD4M/GdwLpbZ6LtM/s320/283px-Manhattan_distance.svg.png" alt="" id="BLOGGER_PHOTO_ID_5439245504737795410" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;In chess, the distance between squares on the chessboard is measured in Manhattan distance.&lt;br /&gt;&lt;br /&gt;Interestingly, the shape of circles in taxicab geometry changes -- taxicab circles are squares with sides oriented at a 45° angle to the coordinate axes.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-7288146714935707320?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/7288146714935707320/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=7288146714935707320' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/7288146714935707320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/7288146714935707320'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2010/02/taxicab-geometry.html' title='Taxicab Geometry'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_VV80-JZKIIw/S3wU99wJXVI/AAAAAAAAD4M/GdwLpbZ6LtM/s72-c/283px-Manhattan_distance.svg.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-3512196042588678211</id><published>2010-02-08T15:20:00.003-05:00</published><updated>2010-02-08T15:34:25.634-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Mathimatical modeling'/><title type='text'>0-1 Integer Programming</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Linear Programming (LP)&lt;/span&gt; is a mathematical method to achieve an optimal outcome (such as maximum profit or lowest cost) in a given mathematical model with a list of requirements represented as linear equations. It can be expressed in the following form:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-weight: bold;"&gt;Maximum&lt;/span&gt; c^Tx&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Subject to&lt;/span&gt; Ax ≤ b&lt;br /&gt;&lt;/blockquote&gt;where x represents the vector of variables (to be determined), c and b are vectors of (known) coefficients and A is a (known) matrix of coefficients.&lt;br /&gt;&lt;br /&gt;If the unknown variables are all required to be integers, then the problem is called an &lt;span style="font-weight: bold;"&gt;Integer Programming (IP)&lt;/span&gt; or &lt;span style="font-weight: bold;"&gt;Integer Linear Programming (ILP)&lt;/span&gt; problem. &lt;span style="font-weight: bold;"&gt;0-1 IP&lt;/span&gt; or &lt;span style="font-weight: bold;"&gt;Binary Integer Programming (BIP)&lt;/span&gt; is the special case of IP where variables are required to be 0 or 1 (rather than arbitrary integers). In contrast to LP, which can be solved efficiently in the worst case, this problem is classified as NP-hard. If only some of the unknown variables are required to be integers, then it is &lt;span style="font-weight: bold;"&gt;Mixed Integer Programming (MIP)&lt;/span&gt; problem. They are also NP-hard.&lt;br /&gt;Advanced algorithms for solving ILP includes:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Branch and Bound&lt;br /&gt;&lt;span style="font-size:85%;"&gt;(Ref: http://mat.gsia.cmu.edu/orclass/integer/node13.html)&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ol&gt;&lt;li&gt;Solve the linear relaxation of the problem. If the solution is integer, then we are done. Otherwise create two new subproblems by branching on a fractional variable.&lt;/li&gt;&lt;li&gt;A subproblem is not active when any of the following occurs:&lt;br /&gt;1. You used the subproblem to branch on,&lt;br /&gt;2. All variables in the solution are integer,&lt;br /&gt;3. The subproblem is &lt;span style="font-weight: bold;"&gt;infeasible&lt;/span&gt;,&lt;br /&gt;4. You can fathom the subproblem by a bounding argument.&lt;/li&gt;&lt;li&gt;Choose an active subproblem and branch on a fractional variable. Repeat until there are no active subproblems.&lt;/li&gt;&lt;/ol&gt;&lt;ul&gt;&lt;li&gt;b. Cutting Plane method&lt;br /&gt;The fundamental idea behind cutting planes is to add constraints  (called &lt;span style="font-weight: bold;"&gt;cuts&lt;/span&gt;) to a linear program until the optimal basic feasible solution takes on integer values.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-3512196042588678211?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/3512196042588678211/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=3512196042588678211' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/3512196042588678211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/3512196042588678211'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2010/02/0-1-integer-programming.html' title='0-1 Integer Programming'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-4121553750224788934</id><published>2010-02-07T09:47:00.003-05:00</published><updated>2010-02-07T10:16:10.130-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Thoughts'/><category scheme='http://www.blogger.com/atom/ns#' term='Miscellaneous'/><title type='text'>What do U and I learn from PhD?</title><content type='html'>It is generally believed that Ph.D. graduates are ONLY suitable candidates for academia and research. However, it is NOT just that!&lt;br /&gt;&lt;br /&gt;What do you learn from PhD study? How do you prepare for work? (or, I should say, what/how should you?!)&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Conducting Research&lt;br /&gt;A major difference between a undergrad life and a graduate life is the emphasis on research.&lt;br /&gt;Undergrad education focuses more on understanding fundamental concepts, evaluated through homework assignments and exams; While graduate education emphasizes on broad research through publication reviews, class projects, faculty-student group research, and the dissertation.&lt;br /&gt;At the beginning, preliminary research provides an look into a variety of disciplines within the major area and allows students to develop and determine their interest.&lt;br /&gt;At the ending, students focus on specific problem-solving tasks to complete their dissertations and thus gradation.&lt;br /&gt;Not only the successes but failures of the research help develop the practical skills necessary for career success.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Communicating effectively&lt;br /&gt;The skills and good habits of technical writing are further developed in graduate school, which is desired by most employers. Also, presenting one's ideas individually in a technical session builds student confidence and alleviates presentation anxiety. Students become familiar with visual aids and learn how to delivery their ideas better according to their audience.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Teaching&lt;br /&gt;Through teaching experiences, students learn how to express their knowledge, get better teamwork, develop critical multitasking skills on time management, and may even improve supervisor/employee relationships.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;Ref: "Putting transferable Ph.D. skills to work", Maryclaire Peterson, IEEE Potentials 2009.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-4121553750224788934?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/4121553750224788934/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=4121553750224788934' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/4121553750224788934'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/4121553750224788934'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2010/02/what-do-u-and-i-learn-from-phd.html' title='What do U and I learn from PhD?'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-702968898752862586</id><published>2010-02-06T22:55:00.002-05:00</published><updated>2010-02-06T23:00:17.081-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='Thoughts'/><title type='text'>MU-MIMO systems</title><content type='html'>Keep this in mind just in case it might be of help someday...&lt;br /&gt;&lt;br /&gt;Multiple User Multiple Input Multiple Output system: the future of wireless communication systems. MIMO have already been employed in 802.11n and 802.16e standards. Now, it might be extended to multi-user scenarios in the context of high data rates envisioned for future cellular standards after 3G.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-702968898752862586?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/702968898752862586/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=702968898752862586' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/702968898752862586'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/702968898752862586'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2010/02/mu-mimo-systems.html' title='MU-MIMO systems'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-8506274200247132842</id><published>2010-02-06T14:45:00.002-05:00</published><updated>2010-02-06T15:29:11.681-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Insterests'/><category scheme='http://www.blogger.com/atom/ns#' term='Miscellaneous'/><title type='text'>GPU vs. CPU</title><content type='html'>GPU, a &lt;span style="font-weight: bold;"&gt;Graphics Processing Unit&lt;/span&gt;, is a specialized processor designed for high performance 3D rendering. Their born highly &lt;span style="font-style: italic;"&gt;parallel structure&lt;/span&gt; make them more effective and efficient than general-purpose CPUs.&lt;br /&gt;&lt;br /&gt;Due to the relentless demands for graphics performance, GPUs provide &lt;span style="font-weight: bold;"&gt;parallel design&lt;/span&gt; for &lt;span style="font-style: italic;"&gt;vector operations&lt;/span&gt; and also increase their &lt;span style="font-weight: bold;"&gt;precision&lt;/span&gt; in programmablity, from 8-bit integer (as most CPUs do), to 24-bit floating point, then to 32-bit floating point, and soon to 64-bit double-precision floating point!&lt;br /&gt;&lt;br /&gt;Now, since GPUs are programmable, they are considered to be used for some more general computation for complex algorithms. GPUs exceed the complexity of modern CPUs in terms of absolute transistor count but they are designed for solving almost completely unrelated problems. At least, GPUs may be used as a new form of &lt;span style="font-weight: bold;"&gt;stream processor&lt;/span&gt;s in the context of parallel processing and floating point calculations.&lt;br /&gt;&lt;br /&gt;PS. I'm not a graphics gal and I might interpret GPUs in a wrong way... If so, hope someone could point it out...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-8506274200247132842?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/8506274200247132842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=8506274200247132842' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/8506274200247132842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/8506274200247132842'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2010/02/gpu-vs-cpu.html' title='GPU vs. CPU'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-5263563845179863258</id><published>2010-02-05T19:42:00.000-05:00</published><updated>2010-02-06T20:29:44.350-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='Thoughts'/><title type='text'>A little worry...</title><content type='html'>When I was reading an article for sensor battery, "forever" battery using some nanotechnology. Then I was a little, just a little bit, worried about my current research topic.&lt;br /&gt;I'm designing algorithms to prolong the battery lifetime in the context of topology control.&lt;br /&gt;What if, at some point, sensors would have forever battery using solar or nano batteries?! Would then my research make any sense any more??? :-(&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-5263563845179863258?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/5263563845179863258/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=5263563845179863258' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/5263563845179863258'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/5263563845179863258'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2010/02/little-worry.html' title='A little worry...'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-1704173023636058288</id><published>2010-01-21T22:02:00.003-05:00</published><updated>2010-01-21T22:11:01.200-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='Insterests'/><category scheme='http://www.blogger.com/atom/ns#' term='Thoughts'/><title type='text'>Living in the Cloud?!</title><content type='html'>&lt;&lt;span style="font-style: italic;"&gt;Winners &amp;amp; Losers&lt;/span&gt;&gt;, a special report of IEEE Spectrum for the past 2009, predict &lt;span style="font-style: italic;"&gt;Google's Chrome OS&lt;/span&gt; as one of the winners.&lt;br /&gt;&lt;br /&gt;It IS pretty cool:&lt;br /&gt;  -- 7 SECONDs from a shut-down computer to your emails and docs;&lt;br /&gt;  -- No more various plug-ins (thanks to HTML5 and hope all websites would like HTML5 sooner...);&lt;br /&gt;  -- Say goodbye to hard drives and L2 caches and walk in the cloud w/o even realize you are there.&lt;br /&gt;&lt;br /&gt;It would be an amazing change not only to an OS but to the entire architecture of computers.&lt;br /&gt;Hmm, if all of these would be implement in the future few years, what would happen?&lt;br /&gt;No other software companies! The world will be a realm of Google + Internet.&lt;br /&gt;&lt;br /&gt;Now, everything will be in the cloud. And, it is FREE! -- Chrome OS and browser are both free and open-source (Well, you still need to buy a netbook… But it is just $300+, a similar price for a smart phone!).&lt;br /&gt;But, is it really free?&lt;br /&gt;Actually, sorry but NO. You need to pay for your "steps" in the cloud: pay for the Internet. And sometimes, you would be "kick out" from the Cloud to the "ground" even you would like to pay. Yes, just think about being on a flight w/ your brick netbook.&lt;br /&gt;Technically, we have internet access everywhere. But if you rely all your life on the Cloud, you will definitely find that it is just a fairytale.&lt;br /&gt;So, maybe Google would figure out a way to offer free wifi all over the world…&lt;br /&gt;&lt;br /&gt;Another issue is security, also the kink of the Cloud.&lt;br /&gt;Is it Safe? Is it safe for sensitive documents?&lt;br /&gt;"It's worth pointing out the many companies store sensitive documents in the cloud right now, and some of them use the enterprise version of Google Apps." ["&lt;span style="font-style: italic;"&gt;Chrome the Conqueror&lt;/span&gt;", Jan 2010 IEEE Spectrum.]&lt;br /&gt;So, Chrome should also provide a way to "jump" from one Cloud to another (login might be able to do that) and make sure any information in the private Cloud would not be leak to the public.&lt;br /&gt;&lt;br /&gt;It would be revolution -- to "googleize" the real world!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-1704173023636058288?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/1704173023636058288/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=1704173023636058288' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/1704173023636058288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/1704173023636058288'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2010/01/living-in-cloud.html' title='Living in the Cloud?!'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-929368536199640818</id><published>2009-10-27T15:06:00.001-04:00</published><updated>2009-10-27T15:08:26.817-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Miscellaneous'/><title type='text'>Poor Richard's advice</title><content type='html'>&lt;b&gt;Poor Richard's advice:&lt;/b&gt; "If you would not be forgotten, as soon as you are dead and rotten, either write things worth reading, or do things worth writing."&lt;br /&gt;&lt;p&gt;&lt;i&gt;-- Benjamin Franklin&lt;/i&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-929368536199640818?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/929368536199640818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=929368536199640818' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/929368536199640818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/929368536199640818'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2009/10/poor-richards-advice.html' title='Poor Richard&apos;s advice'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-6616656290252737487</id><published>2009-09-30T17:55:00.005-04:00</published><updated>2009-10-02T02:19:51.614-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Social Networking'/><category scheme='http://www.blogger.com/atom/ns#' term='Insterests'/><title type='text'>Six Sources of Influence -- By Jo Miller@GHC09</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold; color: rgb(255, 102, 0);"&gt;Our behavior teaches others how to treat us!&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;a href="http://gracehopper.org/2009/"&gt;Grace Hopper Celebration of Women in Computing 2009&lt;/a&gt; is awesome!&lt;br /&gt;Firstly, it IS amazing to see thousands of "Technical Women" in one single conference. Secondly, it is great to talk with other students or researchers -- you can always get something new and your mind might get refreshed. I'm still feel shy and sometime awkward to talk with strangers, BUT, but, I also can feel my change! Starting a conversation seems not that difficult for me now! Well, in some cases... :P&lt;br /&gt;&lt;br /&gt;Jo Miller is actually the very example to show "a person of influence". I want to make my notes public instead of sharing with my laptop. So, here you go!&lt;br /&gt;&lt;br /&gt;Miller said that if you want to become a person of influence, you need to make the impression that &lt;span style="font-weight: bold;"&gt;you ARE someone that has something to say and should be listened to&lt;/span&gt;. As an example, she says that at meetings you should &lt;span style="font-weight: bold;"&gt;arrive early&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;be prepared with talking points&lt;/span&gt; and &lt;span style="font-weight: bold;"&gt;sit near the main group&lt;/span&gt;. Your behaviour teaches people how to treat you.&lt;br /&gt;She also listed out 6 sources of influence:&lt;br /&gt;&lt;blockquote&gt;6. Positional Influence&lt;br /&gt;&lt;br /&gt;   It comes from your &lt;span style="font-weight: bold;"&gt;job title and role&lt;/span&gt;. Yes, your title does matter to others!&lt;br /&gt;   Beyond that, you also need to be prepared with a &lt;span style="font-weight: bold;"&gt;30-sec commercial talk&lt;/span&gt; including the following contents and speak it out loudly and confidently.&lt;/blockquote&gt;&lt;blockquote&gt;&lt;ul&gt;&lt;li&gt;Name&lt;/li&gt;&lt;li&gt;Job title&lt;/li&gt;&lt;li&gt;I'm responsible for ... a, b, c&lt;/li&gt;&lt;li&gt;Come directly to me when you ...&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;&lt;blockquote&gt;5. Expertise Influence&lt;br /&gt;&lt;br /&gt;  It comes from your &lt;span style="font-weight: bold;"&gt;background, qualifications, experiences and expertise&lt;/span&gt;.&lt;br /&gt;  Ways to build it:&lt;br /&gt;Don't wait for an invitation to speak up on your topics of expertise; Don't downplay yourself;&lt;br /&gt;Do promote your accomplishments;&lt;br /&gt;Present in meetings and lunch &amp;amp; learns; Write articles or papers or a blog; Speak on panels and at conferences.&lt;br /&gt;&lt;br /&gt;4. Resources Influence&lt;br /&gt;&lt;br /&gt;  Having access to the resources you need to do your job well. Best use what you have.&lt;br /&gt;Ways to build it:&lt;br /&gt;Become a strong negotiator; Learn matrixed management; Cross train others in your area; Prioritize your workload, communicate bandwidth constraints; &lt;span style="font-weight: bold;"&gt;Gain visibility for the importance of your work and the effort it takes&lt;/span&gt;; Suggest special projects as developmental opportunities for others.&lt;br /&gt;&lt;br /&gt;3. Informational Influence&lt;br /&gt;&lt;br /&gt;Being an &lt;span style="font-weight: bold;"&gt;informational powerhouse&lt;/span&gt; who keeps a "finger on the pulse" of business, personnel and organizational issues.&lt;br /&gt;Ways to built it:&lt;br /&gt;Strive to keep a 'finger on the pulse' of the business; Stay current on personnel and organizational issues; Know who other 'informational powerhouses' are; Filter out useful information from gossip or noise; Seek out information about changes before they occur.&lt;br /&gt;Why? This will help you make BETTER decisions and be able to change directions SOONER when necessary.&lt;br /&gt;&lt;br /&gt;2. Direct Influence&lt;br /&gt;&lt;br /&gt;Be firm, professional and direct when someone's behavior is detrimental to the team or the organization.&lt;br /&gt;Ways to effectively use it:&lt;br /&gt;Be &lt;span style="font-weight: bold;"&gt;firm, fair and professional&lt;/span&gt;; Be direct and concise while delivering tough news; Explain what was unacceptable and why; Focus on a positive vision for the future.&lt;br /&gt;BUT do this for ONLY &lt;span style="font-weight: bold;"&gt;1%&lt;/span&gt; of the case! Do it in private! Be direct and give the individual specific examples and/or a positive vision for how things will change FOR THEM if they change their behavior.&lt;br /&gt;&lt;br /&gt;1. Relationship Influence&lt;br /&gt;&lt;br /&gt;Knowing who the KEY people are in your organization, profession, and industry, and building an influential network.&lt;br /&gt;Your network aka your "&lt;span style="font-weight: bold;"&gt;sphere of influence&lt;/span&gt;".&lt;br /&gt;&lt;/blockquote&gt;&lt;span style="font-size:85%;"&gt;Ref: A full version of the presentation can be found &lt;a href="www.womensleadershipcoaching.com/%20ghc.htm"&gt;here&lt;/a&gt;.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-6616656290252737487?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/6616656290252737487/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=6616656290252737487' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/6616656290252737487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/6616656290252737487'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2009/09/six-sources-of-influence-by-jo.html' title='Six Sources of Influence -- By Jo Miller@GHC09'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-29028049645322559</id><published>2009-09-24T11:21:00.003-04:00</published><updated>2009-09-24T11:55:49.570-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='Insterests'/><title type='text'>Cognitive Ad Hoc Networks</title><content type='html'>A cognitive network is a network with a cognitive process that can perceive current network conditions and then plan, decide, and act on those conditions. The network can learn from these adaptations and use them to make future decisions, all while taking into account end-to-end goals &lt;span style="font-size:85%;"&gt;[1]&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Ref: [1] Thomas R. W., DaSilva L. A., Mackenzie A. B.; Cognitive Networks. Proc. IEEE DySPAN 2005, Nov 2005, pp 352-360.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-29028049645322559?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/29028049645322559/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=29028049645322559' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/29028049645322559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/29028049645322559'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2009/09/cognitive-ad-hoc-networks.html' title='Cognitive Ad Hoc Networks'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-1234940209332600842</id><published>2009-07-30T15:34:00.003-04:00</published><updated>2009-07-30T15:39:09.578-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Insterests'/><category scheme='http://www.blogger.com/atom/ns#' term='All about Apple'/><title type='text'>.MPKG File Extension</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Meta PacKaGe File&lt;/span&gt; on Mac OS X or Linux&lt;br /&gt;&lt;br /&gt;Macintosh installer package that contains all the necessary installation files in a single Mac OS X package. It is typically found on *NIX-type (inc. UNIX, LINUX, etc.) systems.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-1234940209332600842?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/1234940209332600842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=1234940209332600842' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/1234940209332600842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/1234940209332600842'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2009/07/mpkg-file-extension.html' title='.MPKG File Extension'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-3897479010979273471</id><published>2009-07-30T14:43:00.005-04:00</published><updated>2009-07-30T15:39:49.129-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Insterests'/><category scheme='http://www.blogger.com/atom/ns#' term='All about Apple'/><title type='text'>.DMG File Extension</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Disk iMaGe File&lt;/span&gt;&lt;span&gt; on Macintosh OS X&lt;/span&gt; (corresponding to .ISO or .IMG file on Windows)&lt;br /&gt;&lt;br /&gt;Usually, it is used for software installment downloaded from the Internet. When clicking the image file, it is automatically &lt;span style="font-weight: bold;"&gt;mount&lt;/span&gt;ed as a virtual disk on the desktop. It could also be opened using &lt;span style="font-weight: bold;"&gt;Apple Disk Utility&lt;/span&gt; just like a real disk.&lt;br /&gt;&lt;br /&gt;In most cases, a DMG file is not recognizable on Windows. It may be opened in Daemon Tools as some virtual drive. There are several software that can convert DMG file to a more standard format that can be recognized by Windows. (For further info, search for 'DMG2IMG' or 'DMG2ISO'.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-3897479010979273471?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/3897479010979273471/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=3897479010979273471' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/3897479010979273471'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/3897479010979273471'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2009/07/dmg-file-extension.html' title='.DMG File Extension'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-3748225538758304577</id><published>2009-07-29T10:55:00.003-04:00</published><updated>2009-07-29T11:59:00.959-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='Insterests'/><title type='text'>Wi-Fi on the go</title><content type='html'>To get online, of course, you can go to a library, a cafe shop, or some restaurant. The key thing is: you have to sit in the range of an access point / hot spot. What if you want Internet while you are on the move?&lt;br /&gt;&lt;br /&gt;An old fashion option is to use &lt;span style="font-weight: bold;"&gt;cellular modem (cellular PC-card)&lt;/span&gt; and plug the card into your laptop. Then you can use your laptop to surf on the Internet.&lt;br /&gt;You can get such a modem from a cellular carrier like Verizon, Sprint, AT&amp;amp;T or T-mobile. The card provides the Internet connection, courtesy of those companies' 3G ("third generation") high-speed cellular data networks. Well, the speed may not be the same as a cable-modem speed, but it is close enough.&lt;br /&gt;In addition, you can use a &lt;span style="font-weight: bold;"&gt;mobile router&lt;/span&gt; that translates the cellular connection into a Wi-Fi one. By doing this, you can share your Internet signal.&lt;br /&gt;Notice that, here, at least one laptop is required (to activate the PC-card).&lt;br /&gt;&lt;br /&gt;Now you can have an alternative way which provide you a personal Wi-Fi bubble, a private hot spot,  that followed you everywhere you go!&lt;br /&gt;Novatel &lt;span style="font-weight: bold;"&gt;MiFi&lt;/span&gt; 2200, available from Verizon starting in mid-May.&lt;br /&gt;It IS pocket-able -- just triple thick as a credit card. It does provide a personal, portable, powerful, password-protected wireless hot spot. And yes, it still gets its Internet signal the same way those cellular modems do — in this case, converting Verizon’s 3G (high-speed) cellular signal into a Wi-Fi cloud. But, now, you don't need to carry your big laptop. What you need to do is simply put this tiny thing into your pocket!&lt;br /&gt;&lt;br /&gt;Well, there is another way: find free Wi-Fi using an &lt;span style="font-weight: bold;"&gt;easy Wi-Fi radar&lt;/span&gt;. It may not work all the time (depends on whether there are any free access points nearby) but it is FREE!&lt;br /&gt;Free access points can be found in a cafe house, a hotel, an airport, an local library, a book store, and maybe some national parks. Plus, there are several cities covered entirely by free wifi-access, like San Francisco, Mountain View, or Chicago. The good news is that &lt;span style="font-weight: bold;"&gt;Municipal WiFi&lt;/span&gt; is popping up in cities across the nation which is free, government sponsored wireless internet in certain areas of a city where people are likely to congregate.&lt;br /&gt;&lt;br /&gt;One day in the near future, we would have Internet everywhere just as water, electricity facilities. :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-3748225538758304577?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/3748225538758304577/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=3748225538758304577' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/3748225538758304577'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/3748225538758304577'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2009/07/wi-fi-on-go.html' title='Wi-Fi on the go'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-7228625973682265810</id><published>2009-07-06T10:51:00.003-04:00</published><updated>2009-07-06T11:41:33.039-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='Insterests'/><title type='text'>Bluetooth</title><content type='html'>&lt;u&gt;Name&lt;/u&gt;: &lt;span style="font-weight: bold;"&gt;Bluetooth&lt;/span&gt; (name after the tenth-century king Harald I of Denmark, who united dissonant Danish tribes into a single kingdom -- Bluetooth units communications protocols into one universal standard)&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Parents&lt;/u&gt;: &lt;span id="ctl00_cphMainContent_lblDoc"&gt;&lt;span style="font-weight: bold;"&gt;Bluetooth Special Interest Group (SIG)&lt;/span&gt;&lt;span style="font-size:78%;"&gt;&lt;a href="http://www.bluetooth.org"&gt;[1]&lt;/a&gt;&lt;a href="http://www.bluetooth.com"&gt;[2]&lt;/a&gt;&lt;/span&gt; &amp;amp; &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;IEEE 802.15 Task group 1&lt;/span&gt;, divorced at 2005 and now living with Bluetooth SIG.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Contributions&lt;/u&gt;: exchanging data over short distances (10m/50m) from fixed and mobile devices, creating &lt;span style="font-weight: bold;"&gt;personal area networks (PANs);&lt;/span&gt; a wireless alternative to RS232 data cables.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Potential Diseases&lt;/u&gt;:&lt;br /&gt;&lt;b&gt;Bluejacking&lt;/b&gt; is the sending of unsolicited messages to Bluetooth-enabled devices, essentially harmless (exploit others' Bluetooth connections without their knowledge but no exposure of any data in the victim's handset);&lt;br /&gt;&lt;b&gt;Bluesnarfing&lt;/b&gt; is the unauthorized access of information from a wireless device through a Bluetooth connection (exploit others' Bluetooth connections without their knowledge and copy information from the victim's Bluetooth device);&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Community Participation&lt;/u&gt;:&lt;br /&gt;Pairing; Bluesniping; Piconet Topology&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;Ref: &lt;a href="http://en.wikipedia.org/wiki/Bluetooth"&gt;Bluetooth@wiki&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-7228625973682265810?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/7228625973682265810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=7228625973682265810' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/7228625973682265810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/7228625973682265810'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2009/07/bluetooth.html' title='Bluetooth'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-4343236671732185154</id><published>2009-05-18T13:58:00.004-04:00</published><updated>2009-05-18T15:03:58.729-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><title type='text'>Mobility Models</title><content type='html'>Random &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;Waypoint&lt;/span&gt; Model (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;RWP&lt;/span&gt;)&lt;br /&gt;&lt;blockquote&gt;Each node chooses &lt;span style="font-weight: bold;"&gt;uniformly at random a destination point&lt;/span&gt; (the '&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;waypoint&lt;/span&gt;') &lt;span style="font-weight: bold;"&gt;within the deployment region R&lt;/span&gt;, and moves &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_3"&gt;toward&lt;/span&gt; it &lt;span style="font-weight: bold;"&gt;along a straight line&lt;/span&gt;. Node &lt;span style="font-weight: bold;"&gt;Velocity &lt;/span&gt;is chosen &lt;span style="font-weight: bold;"&gt;uniformly at random in the interval&lt;/span&gt; [v_min, v_max], where v_min and v_max are the minimum and maximum node velocities. When the node arrives at destination, it remains &lt;span style="font-weight: bold;"&gt;stationary for a predefined pause time&lt;/span&gt;, and then starts moving again according to the same pattern.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Individual movement (each node moves independently)&lt;/li&gt;&lt;li&gt;Obstacle-free (move in any &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;subregion&lt;/span&gt; of R)&lt;/li&gt;&lt;li&gt;Intentional Movement&lt;/li&gt;&lt;li&gt;Border effect (the long-term node spatial distribution in concentrated in the center of R)&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;Ref: - Johnson D, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;Maltz&lt;/span&gt; D, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;Hu&lt;/span&gt; Y, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;Jetcheva&lt;/span&gt; J; The Dynamic Source Routing Protocol for Mobile ad &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;hoc&lt;/span&gt; Networks (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;dsr&lt;/span&gt;). Internet Draft draft-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;ietf&lt;/span&gt;-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;manet&lt;/span&gt;-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;dsr&lt;/span&gt;-7.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;txt&lt;/span&gt;, 2002, Mobile Ad &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;Hoc&lt;/span&gt; Networking Working Group.&lt;br /&gt;- &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;Blough&lt;/span&gt; D, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;Resta&lt;/span&gt; G, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;Santi&lt;/span&gt; P; A statistical analysis of the long-run node spatial distribution in mobile ad &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;hoc&lt;/span&gt; network. 2004, Wireless Networks 10, pp 543-554.&lt;br /&gt;- &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;Bettstetter&lt;/span&gt; C, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;Resta&lt;/span&gt; G, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;Santi&lt;/span&gt; P; The node distribution of the random &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;waypoint&lt;/span&gt; mobility model for wireless ad &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;hoc&lt;/span&gt; networks. 2003, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;IEEE&lt;/span&gt; Trans. on Mobile Computing 2(3), pp 257-269.&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;Random Direction Model&lt;br /&gt;&lt;blockquote&gt;Each node chooses a &lt;span style="font-weight: bold;"&gt;direction uniformly at random in the interval&lt;/span&gt; [0, 2PI], and a &lt;span style="font-weight: bold;"&gt;random velocity in the interval&lt;/span&gt; [v_min, v_max]. Then, it starts moving in the selected direction with the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;chosen&lt;/span&gt; velocity. When the node reaches the boundary of R, it chooses a new direction and velocity (or '&lt;span style="font-weight: bold;"&gt;bounced back&lt;/span&gt;'), and so on.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Individual movement (each node moves independently)&lt;/li&gt;&lt;li&gt;Obstacle-free (move in any &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_26"&gt;subregion&lt;/span&gt; of R)&lt;/li&gt;&lt;li&gt;Intentional Movement&lt;/li&gt;&lt;li&gt;Avoid the 'border effect' of &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;RWP&lt;/span&gt; -- maintain a uniform node spatial distribution during the simulation time&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;Ref: - &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_28"&gt;Royer&lt;/span&gt; E, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_29"&gt;Melliar&lt;/span&gt;-Smith P, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_30"&gt;Moser&lt;/span&gt; L; An analysis of the optimum node density for ad &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_31"&gt;hoc&lt;/span&gt; mobile networks. 2001, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_32"&gt;IEEE&lt;/span&gt; International &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_33"&gt;Conf&lt;/span&gt;. on Communications, Helsinki, pp 857-861.&lt;br /&gt;- &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_34"&gt;Pearlman&lt;/span&gt; M, Haas Z, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_35"&gt;Sholander&lt;/span&gt; P, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_36"&gt;Tabrizi&lt;/span&gt; S; On the impact of alternate path routing for load balancing in mobile ad &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_37"&gt;hoc&lt;/span&gt; networks. 2000, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_38"&gt;Proc&lt;/span&gt;. &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_39"&gt;ACM&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_40"&gt;MobiHoc&lt;/span&gt;, Boston, MA, pp 3-10.&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;Brownian-like Motion Model (&lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_41"&gt;Drunkard-like&lt;/span&gt; Model)&lt;br /&gt;&lt;blockquote&gt;The position of a node at a given time step depends (in a certain, probabilistic, way) on the node position at the previous step. &lt;span style="font-weight: bold;"&gt;No explicit modeling&lt;/span&gt; of movement direction and velocity is used in this model.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Individual movement (each node moves independently)&lt;/li&gt;&lt;li&gt;Obstacle-free (move in any &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_42"&gt;subregion&lt;/span&gt; of R)&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Non&lt;/span&gt;intentional Movement&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;Ref: - &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_43"&gt;Santi&lt;/span&gt; P, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_44"&gt;Blough&lt;/span&gt; D; The critical transmitting range for connectivity in sparse wireless ad &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_45"&gt;hoc&lt;/span&gt; networks. 2003, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_46"&gt;IEEE&lt;/span&gt; Trans. on Mobile Computing 2(1), pp 25-39.&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;Map-based Mobility Models&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;blockquote&gt;&lt;/blockquote&gt;Freeway Mobility Model -- Freeway &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_47"&gt;scenario&lt;/span&gt;&lt;br /&gt;Several &lt;span style="font-weight: bold;"&gt;freeways&lt;/span&gt;, located in the deployment region, composed of a varying number of &lt;span style="font-weight: bold;"&gt;lanes&lt;/span&gt; in both directions; Nodes, located on a freeway, moving with a &lt;span style="font-weight: bold;"&gt;random velocity&lt;/span&gt; (temporally dependent on its previous &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_48"&gt;velocity&lt;/span&gt;); Safety distance; etc.&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Ref: - &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_49"&gt;Bai&lt;/span&gt; F, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_50"&gt;Sadagopan&lt;/span&gt; N, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_51"&gt;Helmy&lt;/span&gt; A; Important: a framework to systematically analyze the impact of mobility on performance of routing protocols for ad &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_52"&gt;hoc&lt;/span&gt; networks. 2003, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_53"&gt;Proc&lt;/span&gt;. &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_54"&gt;IEEE&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_55"&gt;Infocom&lt;/span&gt;, SF, CA, pp 825-835.&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Manhattan Mobility Model -- Urban scenario&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Horizontal and vertical streets&lt;/span&gt;; Nodes, moving along the streets in both directions; when arriving at an &lt;span style="font-weight: bold;"&gt;intersection&lt;/span&gt;, randomly chooses whether to continue moving along the same direction, or to take a &lt;span style="font-weight: bold;"&gt;left/right turn&lt;/span&gt;; Velocity of a node depends on that at the previous time step; etc.&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Ref: - &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_49"&gt;Bai&lt;/span&gt; F, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_50"&gt;Sadagopan&lt;/span&gt; N, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_51"&gt;Helmy&lt;/span&gt; A; Important: a framework to systematically analyze the impact of mobility on performance of routing protocols for ad &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_52"&gt;hoc&lt;/span&gt; networks. 2003, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_53"&gt;Proc&lt;/span&gt;. &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_54"&gt;IEEE&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_55"&gt;Infocom&lt;/span&gt;, SF, CA, pp 825-835.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Obstacle Mobility Model -- Building &amp;amp; Pathways scenario&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Obstacles (Buildings)&lt;/span&gt; in the environment; &lt;span style="font-weight: bold;"&gt;Pathways&lt;/span&gt;, connecting defferent buildings; Nodes, moving along the pathways; &lt;span style="font-weight: bold;"&gt;radio signal&lt;/span&gt; is obstructed by those obstacles; etc.&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Ref: - Jordosh A, Belding-Royer E, Almeroth K, Suri S; Towards realistic mobility models for mobile ad hoc networks. 2003, Proc. ACM Mobicom, pp 217-229.&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;Group-based Mobility Model&lt;br /&gt;&lt;blockquote&gt;Nodes are randomly assigned to one of the &lt;span style="font-weight: bold;"&gt;Group Leaders&lt;/span&gt;, thus forming groups.  The leaders are randomly distributed in R and its group members are randomly located in its neighborhood. Then the group leader moves according to some mobility model and its group members '&lt;span style="font-weight: bold;"&gt;follow&lt;/span&gt;' the leader with a speed and direction that are a random perturbation of those of its leader. When two groups cross, any group member can leave its group and &lt;span style="font-weight: bold;"&gt;join &lt;/span&gt;the other &lt;span style="font-weight: bold;"&gt;with a certain probability&lt;/span&gt;.&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Ref: - Hong X, Gerla M, Pei G, Chiang C; A group mobility model for ad hoc wireless networks. 1999, Proc. ACM MSWiM, Seattle, WA, pp 53-60.&lt;br /&gt;- Wang K, Li B; Group mobility and partition prediction in wireless ad hoc networks. 2002, Proc. IEEE International Conf. on Communications, NY, pp 1017-1021.&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;span style="font-size:85%;"&gt;Ref: Santi P; Topology Control in Wireless Ad Hoc and Sensor Networks (Section 2.4). 2006 &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-4343236671732185154?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/4343236671732185154/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=4343236671732185154' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/4343236671732185154'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/4343236671732185154'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2009/05/mobility-models.html' title='Mobility Models'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-2255941597141425238</id><published>2009-05-14T11:12:00.002-04:00</published><updated>2009-05-18T15:01:25.533-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Insterests'/><category scheme='http://www.blogger.com/atom/ns#' term='Geometry'/><title type='text'>Conformal Geometry (保形几何)</title><content type='html'>In Mathematics, &lt;span style="font-weight: bold;"&gt;Conformal Geometry&lt;/span&gt; is the study of the set of angle-preserving ("conformal") transformations on a Riemannian manifold or pseudo-Riemannian manifold. &lt;a href="http://en.wikipedia.org/wiki/Conformal_geometry"&gt;[wiki]&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;The main invariant in conformal geometry is the angle between two directions. This definition of conformal geometry is valid for Euclidean spaces of arbitrary dimension. [1]&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;[1] G.V.&lt;cite style="font-style: normal;" class="" id="CITEREFG.V._Bushmanova2001"&gt;Bushmanova&lt;/cite&gt;; &lt;a href="http://eom.springer.de/C/c024770.htm"&gt;Conformal Geometry&lt;/a&gt;, &lt;cite style="font-style: normal;" class="" id="CITEREFG.V._Bushmanova2001"&gt;in Hazewinkel, Michiel, 2001, &lt;/cite&gt;&lt;/span&gt;&lt;cite style="font-style: normal;" class="" id="CITEREFG.V._Bushmanova2001"&gt;&lt;span style="font-size:85%;"&gt;Kluwer Academic Publishers.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/cite&gt;An &lt;i&gt;n&lt;/i&gt;-dimensional space with notions of distance and angle that obey the Euclidean relationships is called an &lt;i&gt;n&lt;/i&gt;-dimensional &lt;b&gt;Euclidean space&lt;/b&gt;. An essential property of a Euclidean space is its flatness. An example of such a relationship is that the sum of the angles in a triangle is always 180 degrees. &lt;a href="http://en.wikipedia.org/wiki/Euclidean_space"&gt;[wiki]&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-2255941597141425238?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/2255941597141425238/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=2255941597141425238' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/2255941597141425238'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/2255941597141425238'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2009/05/conformal-geometry.html' title='Conformal Geometry (保形几何)'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-6669688671901098807</id><published>2009-05-13T13:43:00.005-04:00</published><updated>2009-05-18T15:01:01.711-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='Computational Geometry'/><title type='text'>Point Graph</title><content type='html'>The main weakness of the point graph model is the assumption of perfectly regular radio coverage. Such an assumption is quite realistic in open air, flat environments. While, ad hoc and sensor networks are likely to be used in very different situations, such as indoor or urban scenarios (ad hoc), or under harsh conditions (sensor).&lt;br /&gt;However, the point graph model is still widely used in the study of ad hoc network properties since including all those interference or influence of walls or ... would make the network model too complex and scenario dependent. The results obtained using the point graph model are useful to some extent, but become less and less significant from a practical point of view as the actural radio coverage area is more and more irregular.&lt;br /&gt;&lt;br /&gt;Continuum Percolation Graphs&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;p&gt;A &lt;strong&gt;Unit Disk Graph (UDG)&lt;/strong&gt; is a graph in which every two nodes are connected with an edge iff they are at distance at most 1.&lt;/p&gt;&lt;p&gt;UDGs corresponds to network models with &lt;strong&gt;homogeneous&lt;/strong&gt; rage assignment, i.e. all the nodes have the same transmitting range.&lt;/p&gt;&lt;/blockquote&gt;Geometric Random Graphs (GRG)&lt;br /&gt;&lt;blockquote&gt;&lt;p&gt;A set of points is distributed according to some probability distribution in a certain region. Points are then connected according to some rule (e.g. connect to all the points within distance r, or connect to the k closest nodes, etc.), generating a geometric random graph.&lt;/p&gt;&lt;p&gt;Notes: traditional random graph theory is not very useful in the theoretical analysis of fundamental ad hoc network properties coz a fundamental assumption in this model is that the probabilities of edge occurrence in the graph are independent, which is not the case in the context of wireless ad hoc networks.&lt;/p&gt;&lt;p&gt;Several asymptotic properties can be studied in a GRG model, including:&lt;/p&gt;&lt;p&gt;min &amp;amp; max node degree; longest nearest neighbor link; length of the shortest path; total edge length; number of connected components; critical neighbor number of the k-neighbors graph; total edge length of DT; length of the longest edge of MST; total  edge length of MST; etc.&lt;/p&gt;&lt;/blockquote&gt;&lt;span style="font-size:85%;"&gt;Ref: Santi, P.; Topology Control in Wireless Ad Hoc and Sensor Networks (Section 2.2 + Appendix B), 2006&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-6669688671901098807?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/6669688671901098807/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=6669688671901098807' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/6669688671901098807'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/6669688671901098807'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2009/05/point-graph.html' title='Point Graph'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-2474089457956262057</id><published>2009-04-28T11:57:00.005-04:00</published><updated>2009-05-18T14:58:54.577-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Computational Geometry'/><title type='text'>Proximity Graphs</title><content type='html'>Proximity Graphs are a class of graphs introduced in the theory of Computational Geometry that are based on &lt;span style="font-weight: bold;"&gt;proximity relationships&lt;/span&gt; between nodes. A proximity graph is simply a graph in which two vertices are connected by an edge if and only if the vertices satisfy particular geometric requirements.&lt;br /&gt;It represents &lt;span style="font-weight: bold;"&gt;neighbor relationships&lt;/span&gt; between geometric points in the Euclidean plane. That is, given a set of points in the plane, put edges between points that satisfy a particular neighbor relationship with each other to form a graph.&lt;blockquote&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;Ref: - &lt;a href="http://math.sfsu.edu/beck/teach/870/brendan.pdf"&gt;Lecture Notes&lt;/a&gt; from Math @ SFSU&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;K-neighbors Graph&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;Given a set N of points in the d-dimensional space (d=1, 2, 3), and an integer k&gt;=1, the k-neighbors graph is the &lt;span style="font-weight: bold;"&gt;directed graph&lt;/span&gt; where an edge (u, v) is presented iff v is one of the &lt;span style="font-weight: bold;"&gt;k closest neighbors of node&lt;/span&gt; u.&lt;br /&gt;&lt;/blockquote&gt;Delaunay Triangulation (DT)&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;Given a set N of points in the plane, DT of N is the &lt;span style="font-weight: bold;"&gt;unique triangulation&lt;/span&gt; of N such that the circumcircle of every triangle contains no points of N in its interior.&lt;br /&gt;Notes: A &lt;span style="font-weight: bold;"&gt;Triangulation&lt;/span&gt; of N is a maximal planar subdivision whose node set is N. A &lt;span style="font-weight: bold;"&gt;Maximal Planar Subdivision&lt;/span&gt; of N is a planar graph s.t. no edge connecting two nodes in N can be added without compromising graph planarity.&lt;br /&gt;&lt;/blockquote&gt;Relative Neighborhood Graph (RNG)&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;A graph that has an edge between u and w if there is no node v such that&lt;br /&gt;max{uv, wv} &lt;= uw. &lt;a href="http://en.wikipedia.org/wiki/Relative_Neighborhood_Graph"&gt;[wiki]&lt;/a&gt; i.e. there is an edge between u and w iff there is&lt;br /&gt;no node v in Lune(u, w), where &lt;span style="font-weight: bold;"&gt;Lune&lt;/span&gt;(u, w) is the intersection of the circle about u&lt;br /&gt;with a radius of |uw| and the circle about w with a radius of |uw|.&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;Ref: - Jaromczyk, J.W.; Toussaint, G.T.; &lt;a href="http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=163414"&gt;Relative neighborhood graphs and their relatives&lt;/a&gt;, (1992)&lt;br /&gt;Supowit, K.J.; &lt;a href="http://portal.acm.org/citation.cfm?id=322386"&gt;The Relative Neighborhood Graph, with an Application to Minimum Spanning Trees&lt;/a&gt;, (1983)&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;/blockquote&gt;Gabriel Graph (GG) &lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;A graph with vertex set V in which any points P and Q in V are adjacent&lt;br /&gt;precisely if they are distinct and the closed disc of which line segment PQ is a&lt;br /&gt;diameter contains no other elements of V. i.e. there is an edge between P and Q&lt;br /&gt;in GG iff the disk obtained using PQ as its diameter does not contain any vertex&lt;br /&gt;from V. &lt;a href="http://en.wikipedia.org/wiki/Gabriel_graph"&gt;[wiki]&lt;br /&gt;&lt;/a&gt;GG is a &lt;span style="font-weight: bold;"&gt;subgraph of DT&lt;/span&gt;. It can be found in linear time if the Delaunay triangulation is given. GG contains as a subgraph the Euclidean MST and the nearest neighbor graph.&lt;/p&gt;&lt;p style="text-align: center;"&gt;EMST ≤ RNG ≤ GG ≤ DT&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;Ref: - Matula, D. W.; Sokal, R. R. Properties of Gabriel graphs relevant to geographic variation research and clustering of points in the plane, Geogr. Anal. 12: 205-222 (1980).&lt;br /&gt;- &lt;a href="http://www.cs.jhu.edu/%7Escheideler/courses/600.348_F04/lecture_13.pdf"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;Lecture Notes&lt;/a&gt; from CS @ JHU&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;Yao Graphs (YG)&lt;br /&gt;&lt;blockquote&gt;&lt;p&gt;The basic idea underlying the Yao graphs is to &lt;span style="font-weight: bold;"&gt;cut the space around each node into sectors&lt;/span&gt; of equal angle and to connect each node to the nearest neighbor in each of its sectors.&lt;br /&gt;At each node u in V, any k equally seperated rays originated at u define k equal sectors. In each sector, choose the shortest directed edge (u, w) in G, if any, and add the correspondent directed edge in YG_k.&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;Ref: - &lt;a href="http://www.cs.jhu.edu/%7Escheideler/courses/600.348_F04/lecture_13.pdf"&gt;Lecture Notes&lt;/a&gt; from CS @ JHU.&lt;br /&gt;- &lt;a href="http://www.cs.unb.ca/conf/cccg/eProceedings/23.ps.gz"&gt;Yao graphs and MST&lt;/a&gt;, J. Caceres et al.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;span style="font-size:85%;"&gt;Ref: - Santi, P.; Topology Control in Wireless Ad Hoc and Sensor Networks (Appendix A), 2006 &lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-2474089457956262057?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/2474089457956262057/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=2474089457956262057' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/2474089457956262057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/2474089457956262057'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2009/04/several-graphs.html' title='Proximity Graphs'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-7531765464610150253</id><published>2009-04-28T11:38:00.004-04:00</published><updated>2009-05-18T14:59:18.844-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='Computational Geometry'/><title type='text'>Spanner</title><content type='html'>A &lt;strong&gt;geometric spanner&lt;/strong&gt; or a &lt;strong&gt;k-spanner graph&lt;/strong&gt; or a &lt;strong&gt;k-spanner&lt;/strong&gt; is a weighted graph over a set of points as its vertices which for every pair of vertices has a path between them of weight at most k times the spatial distance between these points for a fixed k. The parameter k is called the &lt;strong&gt;stretch factor&lt;/strong&gt; or &lt;strong&gt;dilation factor&lt;/strong&gt; of the spanner.&lt;br /&gt;&lt;br /&gt;It was proven that the problem of finding a spanner in the Euclidean plane with minimal dilation over n points with at most m edges in NP-hard.&lt;a href="http://en.wikipedia.org/wiki/Geometric_spanner"&gt;[wiki]&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Ref: - David Eppstein, &lt;a href="http://www.ics.uci.edu/%7Eeppstein/pubs/Epp-TR-96-16.pdf"&gt;Spanning Trees and Spanners&lt;/a&gt;, Tech. Report (1996)&lt;br /&gt;- Giri Narasimhan, Michiel Smid, &lt;a href="http://books.google.com/books?id=SY4cNZWc4GAC"&gt;Geometric Spanner Networks&lt;/a&gt;, Cambridge University Press (2007) ISBN 0521815134&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-7531765464610150253?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/7531765464610150253/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=7531765464610150253' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/7531765464610150253'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/7531765464610150253'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2009/04/spanner.html' title='Spanner'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-3991126843649779427</id><published>2009-03-08T17:00:00.003-04:00</published><updated>2009-03-08T17:15:14.704-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='STL study'/><title type='text'>sort in STL</title><content type='html'>&lt;b&gt;sort&lt;/b&gt; is a function in STL that takes two random-access iterators, the &lt;span style="font-style: italic;"&gt;start &lt;/span&gt;and the &lt;span style="font-style: italic;"&gt;end&lt;/span&gt;, as arguments and performs a &lt;span style="font-weight: bold;"&gt;comparison sort&lt;/span&gt; on the range of elements between the two iterators, front-inclusive and end-exclusive. The underlying algorithm is (usually) &lt;a href="http://en.wikipedia.org/wiki/Introsort"&gt;&lt;span style="font-weight: bold;"&gt;introsort&lt;/span&gt;&lt;/a&gt;, which is a combination of quicksort &lt;a style="font-weight: bold;" href="http://en.wikipedia.org/wiki/Quicksort" title="Quicksort"&gt;quicksort&lt;/a&gt; and &lt;a style="font-weight: bold;" href="http://en.wikipedia.org/wiki/Heapsort" title="Heapsort"&gt;heapsort&lt;/a&gt; (the implementation details are not mandated). Whatever the implementation, the complexity is guaranteed to be &lt;span style="font-weight: bold;"&gt;O(nlogn)&lt;/span&gt; comparisons in the worst case.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.sgi.com/tech/stl/sort.html"&gt;&lt;span style="font-style: italic;"&gt;SGI STL specification of sort() function&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Note that elements in the &lt;span style="font-weight: bold;"&gt;map&lt;/span&gt; container are sorted from &lt;span style="font-weight: bold;"&gt;lower&lt;/span&gt; to &lt;span style="font-weight: bold;"&gt;higher key value&lt;/span&gt; internally on construction. Thus, by taking advantage of such a feature, given an array of elements, we can insert each element and its corresponding index into a map container, and then use an iterator to read them out &lt;span style="font-weight: bold;"&gt;in order&lt;/span&gt;.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;multimap&lt;/span&gt; is a map container that allows different elements to have the same key value. An example of multimap can be found &lt;a href="http://www.cplusplus.com/reference/stl/multimap/insert.html"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-3991126843649779427?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/3991126843649779427/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=3991126843649779427' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/3991126843649779427'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/3991126843649779427'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2009/03/sort-in-stl.html' title='sort in STL'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-1385662283309341219</id><published>2009-02-25T17:30:00.000-05:00</published><updated>2009-03-03T11:44:45.656-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ethics Issues'/><title type='text'>Authorship</title><content type='html'>Hmm, it's quite interesting to hear that different departments did has different policy for authorship.&lt;br /&gt;&lt;br /&gt;Some departments may publish a paper with a loooong author list, while some may have one with only one or two authors.&lt;br /&gt;&lt;br /&gt;Some departments think the most important author (major) should be the first one, and the second would be the second important, and so on. While some may take the first (and the last) as major author(s) and 'ignore' the one in the middle... :-)&lt;br /&gt;&lt;br /&gt;Dr. L told me that, in our area, theoretical computer science, first author would be major author if he did most of the job, OR alphabetical order would be use if everyone did part of the job. He would like to put student name prior to his.&lt;br /&gt;Plus, in his view, when judging tenure for an assistant professor, the number of first-author papers are not quite important since one can comment on what is done by him and who is under his advise. The grant he got plays a significant role in some universities... (hmm, this is quite similar to Chinese...)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-1385662283309341219?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/1385662283309341219/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=1385662283309341219' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/1385662283309341219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/1385662283309341219'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2009/02/authorship.html' title='Authorship'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-1799892921622201767</id><published>2008-12-14T17:53:00.006-05:00</published><updated>2008-12-14T18:15:48.397-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><title type='text'>HTTP/1.1  vs  HTTP/1.0</title><content type='html'>&lt;ul&gt;&lt;li&gt;HTTP &lt;span style="font-weight: bold;"&gt;Persistent Connection&lt;/span&gt; in /1.1&lt;/li&gt;&lt;/ul&gt;           (Also called HTTP keep-alive, or HTTP connection reuse)&lt;br /&gt;      i.e. using the same TCP connection to send and receive multiple HTTP requests/responses, as opposed to opening a new one for every single request/response pair.&lt;br /&gt;&lt;br /&gt;     Using persistent connections is very important for improving HTTP performance. There are several advantages, including: &lt;ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Network friendly&lt;/span&gt;.  Less network traffic due to fewer setting up  and tearing down of TCP connections.  &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Reduced latency&lt;/span&gt; on  subsequent request. Due to avoidance of initial TCP handshake  &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;React to congestion appropriately. &lt;/span&gt;Long lasting  connections allowing TCP sufficient time to determine the congestion  state of the network. Note that each new connection will always start from slow start and may not have enough time to enter congestion avoidance if it is open only for a short while.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt; &lt;p&gt;          The advantages are even more obvious with HTTPS or HTTP over SSL/TLS.  There, persistent connections may reduce the number of costly SSL/TLS handshake to establish security associations, in addition to the initial TCP connection set up.&lt;/p&gt; &lt;p&gt;          In HTTP/1.1, persistent connections are the default behavior of any  connection.&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Pipelining &lt;/span&gt;in 1.1&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;            Normally, HTTP requests are issued sequentially, with the next request being issued only after the response to the current request has been completely received.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;ul&gt;&lt;li&gt;Allow &lt;span style="font-weight: bold;"&gt;multiple HTTP requests&lt;/span&gt; to be written out to a socket together without waiting for the corresponding responses. The requester then waits for the responses to arrive in the order in which they were requested.  &lt;span style="font-weight: bold;"&gt;--&gt;&lt;/span&gt; reduce the page response time, especially over high latency connections&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;ul&gt;&lt;li&gt;            Possible to &lt;span style="font-weight: bold;"&gt;pack several HTTP requests&lt;/span&gt; into one TCP/IP packet.  &lt;span style="font-weight: bold;"&gt;--&gt;&lt;/span&gt; reduce the number of TCP/IP packets, which naturally reduces the burden on IP routers and networks and benefits the whole internet&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;br /&gt;       Pipelining can only be done when reusing an existing &lt;em&gt;keep-alive&lt;/em&gt; connection.&lt;blockquote&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-1799892921622201767?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/1799892921622201767/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=1799892921622201767' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/1799892921622201767'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/1799892921622201767'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2008/12/http11-vs-http10.html' title='HTTP/1.1  vs  HTTP/1.0'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-3427038739819923183</id><published>2008-12-09T22:34:00.001-05:00</published><updated>2008-12-09T22:41:12.920-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><title type='text'>Comparison of VoIP software</title><content type='html'>&lt;h1 class="firstHeading"&gt;&lt;a href="http://en.wikipedia.org/wiki/Voice_over_IP"&gt;&lt;span style="font-size:100%;"&gt;Voice over Internet Protocol&lt;/span&gt;&lt;/a&gt;&lt;/h1&gt;&lt;a href="http://en.wikipedia.org/wiki/Comparison_of_VoIP_software"&gt;Comparison of software&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-3427038739819923183?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/3427038739819923183/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=3427038739819923183' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/3427038739819923183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/3427038739819923183'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2008/12/comparison-of-voip-software.html' title='Comparison of VoIP software'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-5725720624305357342</id><published>2008-11-22T09:22:00.005-05:00</published><updated>2008-11-23T15:38:37.905-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><category scheme='http://www.blogger.com/atom/ns#' term='Insterests'/><title type='text'>NASA Tests First Deep-Space Internet</title><content type='html'>&lt;a href="http://www.jpl.nasa.gov/news/news.cfm?release=2008-216"&gt;News from NASA JPL lab&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;NASA has successfully tested the first deep space  communications network modeled on the Internet, using DTN. They called "Disruption-Tolerant Networking", which should be same to "Delay-Tolerant Networking", I believe...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;P.S.&lt;/span&gt; In the mean time, Xuan told me that British Government exploded bunch of files documenting UFO related stuffs.&lt;br /&gt;Here is a link from Google-Video.&lt;br /&gt;&lt;a href="http://video.google.com/videoplay?docid=-6983772507888470670"&gt;&lt;span id="details-title"&gt;British UFO Files&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;... This film is based on Government files documenting EYE witness accounts of unexplained events that have occurred in the skies of Britain during the last 60 years...&lt;br /&gt;&lt;br /&gt;Omg, “during the last 60 years", that means, UFO first appeared in 1940's!!&lt;br /&gt;Sounds interesting... Is there any relationship between these two issues?! I'm wondering...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-5725720624305357342?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/5725720624305357342/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=5725720624305357342' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/5725720624305357342'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/5725720624305357342'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2008/11/nasa-tests-first-deep-space-internet.html' title='NASA Tests First Deep-Space Internet'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-6835128705475797865</id><published>2008-11-21T12:55:00.006-05:00</published><updated>2008-11-21T13:07:19.453-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><title type='text'>FXP -- File eXchange Protocol</title><content type='html'>&lt;b&gt;F&lt;/b&gt;ile e&lt;b&gt;X&lt;/b&gt;change &lt;b&gt;P&lt;/b&gt;rotocol (&lt;i&gt;&lt;b&gt;FXP&lt;/b&gt;&lt;/i&gt;) allows you to  copy files from one FTP server to another FTP server&lt;a id="KonaLink0" target="undefined" class="kLink" style="text-decoration: underline ! important; position: static;" href="http://www.webopedia.com/TERM/F/File_eXchange_Protocol.html#"&gt;&lt;span style="font-weight: 400; position: static; color: rgb(176, 0, 0);font-family:serif;font-size:16;"  &gt;&lt;span class="kLink" style="font-weight: 400; position: static; color: rgb(176, 0, 0);font-family:serif;font-size:16;"  &gt;&lt;/span&gt;&lt;span class="kLink" style="font-weight: 400; position: static; color: rgb(176, 0, 0);font-family:serif;font-size:16;"  &gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; (two remote hosts) using an FXP client.&lt;br /&gt;&lt;br /&gt;FXP removes the middle step of transferring files from one FTP server to your local machine then to the second FTP server. The data transfer rate is also independent of your own internet connection speed &lt;a id="KonaLink1" target="undefined" class="kLink" style="text-decoration: underline ! important; position: static;" href="http://www.webopedia.com/TERM/F/File_eXchange_Protocol.html#"&gt;&lt;span style="font-weight: 400; position: static; color: rgb(176, 0, 0);font-family:serif;font-size:16;"  &gt;&lt;span class="kLink" style="border-bottom: 1px solid blue; font-weight: 400; position: static; color: rgb(176, 0, 0);font-family:serif;font-size:16;"  &gt;&lt;/span&gt;&lt;span class="kLink" style="border-bottom: 1px solid blue; font-weight: 400; position: static; color: rgb(176, 0, 0);font-family:serif;font-size:16;"  &gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; as it is based on the connection speed between the two hosts, which is usually faster than a user's own Internet connection. Since FXP provides a direct connection between the two hosts, users are unable to see standard FTP information in their client software such as transfer progress and connection speed. Usually you will see only a successful or failed transfer message.&lt;br /&gt;&lt;br /&gt;To use FXP, the remote servers must support  PASV mode and allow PORT commands to foreign hosts.&lt;br /&gt;&lt;pre&gt;User-PI - Server A (Dest)     User-PI - Server B (Source)&lt;br /&gt;------------------            ------------------&lt;br /&gt;C-&gt;A : Connect                C-&gt;B : Connect&lt;br /&gt;C-&gt;A : PASV&lt;br /&gt;A-&gt;C : 227 Entering Passive Mode. A1,A2,A3,a1,a2&lt;br /&gt;                             C-&gt;B : PORT A1,A2,A3,a1,a2&lt;br /&gt;                             B-&gt;C : 200 Okay&lt;br /&gt;C-&gt;A : STOR                   C-&gt;B : RETR&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-6835128705475797865?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/6835128705475797865/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=6835128705475797865' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/6835128705475797865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/6835128705475797865'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2008/11/fxp-file-exchange-protocol.html' title='FXP -- File eXchange Protocol'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-7296659171279709656</id><published>2008-11-19T10:22:00.005-05:00</published><updated>2008-11-19T11:24:12.754-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><title type='text'>TFTP - Trivial File Transfer Protocol</title><content type='html'>Simple, designed for quickly file transfer, requires only basic IP and UDP on port 69.&lt;br /&gt;Good for bootstrap time on a diskless workstation.&lt;br /&gt;No security for TFTP.&lt;br /&gt;&lt;br /&gt;UDP provide no connection establishment and termination.&lt;br /&gt;Thus, in TFTP, RRQ/WRQ, ACK/ERROR messages are used to &lt;span style="font-weight: bold;"&gt;establish connection&lt;/span&gt; for the blocks of data belonging to the same file.&lt;br /&gt;No special message for termination. &lt;span style="font-weight: bold;"&gt;Termination&lt;/span&gt; is accomplished by sending the last block of data which is &lt; 512 bytes.&lt;br /&gt;&lt;br /&gt;UDP does not have any mechanism for flow and error control.&lt;br /&gt;In TFTP, &lt;span style="font-weight: bold;"&gt;flow control&lt;/span&gt; is achieved by numbering the data blocks and waiting for an ACK before the next data block is sent.&lt;br /&gt;The TFTP &lt;span style="font-weight: bold;"&gt;error-control&lt;/span&gt; mechanism is symmetric, which means that sender and receiver both use time-outs, i.e. time-out for not only data messages byt also for ack messages.&lt;br /&gt;Receiver uses UDP checksum to detect data corruption and discards the block if damaged. &lt;span style="font-weight: bold;"&gt;No negative ack&lt;/span&gt; in TFTP. Sender will retransmit the block after time-out period.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Sorcerer's Apprentice Bug&lt;/span&gt;&lt;br /&gt;Happens if ACK message is not lost but dealyed. Then, every succeeding block is sent twice and every succeeding ack is received twice.&lt;br /&gt;&lt;br /&gt;TFTP uses the well-known &lt;span style="font-weight: bold;"&gt;port 69 for the initial connection&lt;/span&gt; and &lt;span style="font-weight: bold;"&gt;an ephemetal port for the remaining communication&lt;/span&gt;. The reason is that communication between a client and a server can be quite lengthy (even minutes). If a server uses the well-known port number to communicate with a single client, no other clients can use these services during that time!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-7296659171279709656?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/7296659171279709656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=7296659171279709656' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/7296659171279709656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/7296659171279709656'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2008/11/tftp-trivial-file-transfer-protocol.html' title='TFTP - Trivial File Transfer Protocol'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-6982843924483211998</id><published>2008-11-19T09:46:00.005-05:00</published><updated>2008-11-19T11:37:05.681-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><title type='text'>FTP - File Transfer Protocol</title><content type='html'>FTP is in Application layer and each time it opens 2 TCP connections: one for control and one for data.&lt;br /&gt;&lt;br /&gt;In control connection, server issues a passive open on port 21 and wait for a client. This connection will be persistent over the whole session.&lt;br /&gt;FTP uses NVT ASCII character set instead of command code, i.e. each command or response is one short line ended by CR and LF. It is sort of wasting network resource but it makes programming and debugging to be easier.&lt;br /&gt;&lt;br /&gt;In data connection, &lt;span style="font-weight: bold;"&gt;client &lt;/span&gt;issues a passive open, sends its ephemeral port number to server using PORT via control connection and server then issues an active open use port 20. An alternative method is using PASV command: client asks server to choose a port number, server does a passive open and sends the port number in response, and client issues an active open using that port number.&lt;br /&gt;Such a connection will be open and closed upon each file transfer.&lt;br /&gt;Notice that in the first method, server does NOT open the connection upon receiving PORT w/ the port number of client but prepares itself for issuing an active open. Server will open the data connection when receiving a request via control connection and close the data connection when finishing the whole list/file.&lt;br /&gt;Before sending a file, 3 attributes (file type, data structure and transmission mode) need to be defined through the control connection.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-6982843924483211998?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/6982843924483211998/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=6982843924483211998' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/6982843924483211998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/6982843924483211998'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2008/11/ftp-file-transfer-protocol.html' title='FTP - File Transfer Protocol'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-8380518438664517119</id><published>2008-11-06T12:05:00.002-05:00</published><updated>2008-11-06T14:26:59.201-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><title type='text'>Limit on total number of TCP connections in OS</title><content type='html'>By using non-persistent parallel connection, a HTTP application could be faster coz it creates multiple TCP connections for a web page and embedded objects in that page. But why there exists a limit on the total number of TCP connections in OS level?&lt;br /&gt;&lt;br /&gt;Think about congestion control.&lt;br /&gt;Suppose there are 40 TCP connections between a pair of client and server. One packet is lost. Then what happens?&lt;br /&gt;Only one connection will be slow down according to congestion control. All the others still keep sending in a higher speed!&lt;br /&gt;&lt;br /&gt;There is a term called "TCP friendly". It designed for applications to vary their sending rate in response to congestion.&lt;b&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;/b&gt;&lt;i&gt;&lt;b&gt;&lt;/b&gt;&lt;/i&gt;&lt;blockquote&gt;&lt;i&gt;&lt;b&gt;T&lt;/b&gt;CP-&lt;b&gt;F&lt;/b&gt;riendly &lt;b&gt;R&lt;/b&gt;ate &lt;b&gt;C&lt;/b&gt;ontrol&lt;/i&gt; (TFRC) is a congestion control mechanism designed for unicase flows operating in an Internet  environment and competing with TCP traffic. &lt;span style="font-weight: bold;"&gt;It is designed for applications that use a fixed packet size, and vary their sending rate in packets  per second in response to congestion.&lt;/span&gt; TFRC is a receiver-based mechanism, with  the calculation of the congestion control information (i.e., the loss event  rate) in the daat receiver rather in the data sender.  This is well-suited to an application where the sender is a large server  handling many concurrent connections, and the receiver has more memory and CPU cycles available for computation. &lt;i&gt;[Adapted from &lt;a href="http://www.faqs.org/rfcs/rfc3448.html"&gt;RFC 3448 - TCP Friendly Rate  Control (TFRC): Protocol Specification&lt;/a&gt;]&lt;/i&gt;&lt;/blockquote&gt;&lt;i&gt;&lt;blockquote&gt;&lt;/blockquote&gt;Another related web page is &lt;a href="http://www.psc.edu/networking/projects/tcpfriendly/"&gt;here&lt;/a&gt;.&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-8380518438664517119?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/8380518438664517119/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=8380518438664517119' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/8380518438664517119'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/8380518438664517119'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2008/11/limit-on-total-number-of-tcp.html' title='Limit on total number of TCP connections in OS'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-7301187649098100277</id><published>2008-11-05T10:24:00.002-05:00</published><updated>2008-11-05T10:37:09.841-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Insterests'/><title type='text'>Murphy's law</title><content type='html'>&lt;b&gt;Murphy's law&lt;/b&gt; is an adage in Western culture that broadly states, "if anything can go wrong, it will." It is also cited as: "If there's more than one possible outcome of a job or task, and one of those outcomes will result in disaster or an undesirable consequence, then somebody will do it that way"; "Anything that can go wrong, will," the similar "Whatever can go wrong, will go wrong," or, "Whatever can go wrong will go wrong, and at the worst possible time, in the worst possible way." In a less dramatic fashion, the law can be expressed as "Anything that has a probability of happening greater than 0 can and will happen. No exceptions."&lt;br /&gt;&lt;br /&gt;It IS a funny law but the point is that its spirit embodies the principle of &lt;span style="font-weight: bold;"&gt;defensive design&lt;/span&gt; (sometimes referred to as a "Murphy-proofing" procedure) -- anticipating the mistakes the end-user is likely to make.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-7301187649098100277?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/7301187649098100277/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=7301187649098100277' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/7301187649098100277'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/7301187649098100277'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2008/11/murphys-law.html' title='Murphy&apos;s law'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-6597167195863997048</id><published>2008-11-02T12:30:00.004-05:00</published><updated>2008-11-02T12:47:26.600-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><title type='text'>P2P or P2SP?</title><content type='html'>&lt;b&gt;点对点技术&lt;/b&gt;（peer-to-peer， 简称&lt;b&gt;P2P&lt;/b&gt;）又称&lt;b&gt;对等互联网络技术&lt;/b&gt;，是一种网络新技术，依赖 网络中参与者的计算能力和带宽，而不是把依赖都聚集在较少的几台服务器上。P2P网络通常用于通过Ad Hoc连接来连接节点。这类网络可以用于多种用途，各种文件共享软件已经得到了广泛的使用。P2P技术也被使用在类似VoIP等实时媒体业务的数据通信 中。 &lt;p&gt;纯点对点网络没有客户端或服务器的概念，只有平等的同级节点，同时对网络上的其它节点充当客户端和服务器。这种网络设计模型不同于客户端-服务器模型，在客户端-服务器模型中通信通常来往于一个中央服务器。&lt;/p&gt;&lt;p&gt;&lt;b&gt;P2S&lt;/b&gt;（Peer to Sever），即点对服务器技术，是最经典的一种下载协议。“点”(Peer)即网络节点或终端，通常可以理解为用户计算机。P2S协议又分HTTP（Hyper Text Transportation Protocol，译为超文本传输协议）与FTP（File Transportation Protocol，文件传输协议）两种类型。IE自带的下载软件采用的是P2S技术。 &lt;/p&gt;&lt;p&gt;&lt;b&gt;P2SP&lt;/b&gt;（Peer to Sever&amp;amp;Peer），即点对服务器和点技术，是一种下载协议。“点”(Peer)即网络节点或终端，通常可以理解为用户计算机。P2SP整合了P2P与P2S技术。在稳定性和速度方面，P2SP协议比传统的P2P或P2S有了较大的提高。&lt;/p&gt;&lt;p&gt;迅雷采用一种类似P2P的方式来结合和取代传统下载方式，透过后台上传服务器及客户端电脑上通过迅雷下载的资料（用户可进行限制），使得传统HTTP/FTP等协议下的资料以P2P模式传输，能够获得较高的下载速度。&lt;br /&gt;用户使用迅雷打开一个，例如URL等待下载地址时，迅雷会将目标档案资料发送至服务器进行比对检索，并在短时间内返回大量拥有该档案的目标电脑。这些目标电脑可以是提供该档案的传统 HTTP/FTP服务器，亦可能是仅仅储存有该档案而安装了迅雷的普通电脑。随后，迅雷建立大量连接从这些目标电脑上下载目标档案，形成了P2P的下载方式，故此不积压于服务器的负荷能力。&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-6597167195863997048?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/6597167195863997048/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=6597167195863997048' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/6597167195863997048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/6597167195863997048'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2008/11/p2p-or-p2sp.html' title='P2P or P2SP?'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-4041526737542027947</id><published>2008-10-26T12:07:00.002-04:00</published><updated>2008-11-02T12:19:25.804-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Probability'/><title type='text'>Linearity of Expectation</title><content type='html'>&lt;p class="para"&gt;The expectation of the sum of two random variables is the sum of  their expectations, that is,&lt;/p&gt;&lt;p style="font-family: trebuchet ms; text-align: center;" class="para"&gt;E[X+Y] = E[X] + E[Y]&lt;/p&gt;&lt;p class="para"&gt;whenever E[&lt;i class="emphasis"&gt;X&lt;/i&gt;] and E[&lt;i class="emphasis"&gt;Y&lt;/i&gt;] are defined.  We call this property &lt;b class="bold"&gt;&lt;i class="emphasis"&gt;linearity of  expectation&lt;/i&gt;&lt;/b&gt;, and &lt;span style="color: rgb(204, 0, 0);"&gt;it holds even if &lt;/span&gt;&lt;i style="color: rgb(204, 0, 0);" class="emphasis"&gt;X&lt;/i&gt;&lt;span style="color: rgb(204, 0, 0);"&gt; and &lt;/span&gt;&lt;i style="color: rgb(204, 0, 0);" class="emphasis"&gt;Y&lt;/i&gt;&lt;span style="color: rgb(204, 0, 0);"&gt; are NOT independent&lt;/span&gt;. It also &lt;span style="color: rgb(204, 0, 0);"&gt;extends to finite and  absolutely convergent summations of expectations&lt;/span&gt;. Linearity of expectation is  the key property that enables us to perform probabilistic analyses by using  indicator random variable.&lt;/p&gt;&lt;p class="para"&gt;c.f. When two random variables &lt;i class="emphasis"&gt;X&lt;/i&gt; and &lt;i class="emphasis"&gt;Y&lt;/i&gt;  are &lt;span style="color: rgb(204, 0, 0);"&gt;independent &lt;/span&gt;and each has a defined expectation,&lt;/p&gt;&lt;p style="text-align: center;" class="para"&gt;&lt;span style="font-family: trebuchet ms;"&gt;E[XY] = E[X]E[Y]&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="para"&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p class="first-para"&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;A &lt;/span&gt;&lt;b style="color: rgb(204, 0, 0);" class="bold"&gt;&lt;i class="emphasis"&gt;(discrete) random  variable&lt;/i&gt;&lt;/b&gt;&lt;span style="color: rgb(204, 0, 0);"&gt; &lt;/span&gt;&lt;i style="color: rgb(204, 0, 0);" class="emphasis"&gt;X&lt;/i&gt;&lt;span style="color: rgb(204, 0, 0);"&gt; is a function from a finite or  countably infinite sample space &lt;/span&gt;&lt;i style="color: rgb(204, 0, 0);" class="emphasis"&gt;S&lt;/i&gt;&lt;span style="color: rgb(204, 0, 0);"&gt; to the real numbers.&lt;/span&gt; It  associates a real number with each possible &lt;a name="3472"&gt;&lt;/a&gt;&lt;a name="IDX-1107"&gt;&lt;/a&gt;outcome of an experiment, which allows us to work with the  probability distribution induced on the resulting set of numbers. Random  variables can also be defined for uncountably infinite sample spaces, but they  raise technical issues that are unnecessary to address for our purposes.  Henceforth, we shall &lt;span style="color: rgb(204, 0, 0);"&gt;assume that random variables are discrete&lt;/span&gt;.&lt;/p&gt;&lt;p class="first-para"&gt;The &lt;b class="bold"&gt;&lt;i class="emphasis"&gt;expected value&lt;/i&gt;&lt;/b&gt; (or, synonymously, &lt;b class="bold"&gt;&lt;i class="emphasis"&gt;expectation&lt;/i&gt;&lt;/b&gt; or &lt;b class="bold"&gt;&lt;i class="emphasis"&gt;mean&lt;/i&gt;&lt;/b&gt;) of a discrete random variable &lt;i class="emphasis"&gt;X&lt;/i&gt; is&lt;/p&gt;&lt;p style="text-align: center;" class="first-para"&gt;E[X] = \sum_{x}{x Pr[X=x]}&lt;br /&gt;&lt;/p&gt;&lt;p class="first-para"&gt;which is well defined if the sum is finite or converges absolutely.&lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-4041526737542027947?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/4041526737542027947/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=4041526737542027947' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/4041526737542027947'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/4041526737542027947'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2008/10/linearity-of-expectation.html' title='Linearity of Expectation'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-6728730421606469806</id><published>2008-10-25T14:32:00.002-04:00</published><updated>2008-10-25T14:43:12.666-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Insterests'/><title type='text'>Good for your eyes ^^</title><content type='html'>&lt;ul&gt;&lt;li&gt;保护视力色&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;FAFBE6 杏仁黄 250,251,230&lt;br /&gt;FFF2E2 秋叶褐 255,242,226&lt;br /&gt;FDE6E0 胭脂红 253,230,224&lt;br /&gt;F3FFE1 芥末绿 243,255,225&lt;br /&gt;DAFAFE 天蓝   218,250,254&lt;br /&gt;E9EBFE 雪青   233,235,254&lt;br /&gt;EAEAEF 灰     234,234,239&lt;br /&gt;FFFFFF 银河白 255.255.255&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;改变窗口颜色&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;第一步， 在桌面上点击鼠标右键，依次点击“属性(properties)”、“外观(appearance)”、“高级(advanced)”按钮。&lt;br /&gt;第二步， 在打开的“高级(advanced)”对话框中，在“项目(items)”下拉列表里选择“窗口(windows)”。&lt;br /&gt;第三步， 再打开右边对应的“颜色(color)”列表，选择其中的“其他(others)”一项，在打开的对话框里，把“色调(Hue)”的参数设置为85，把“饱和度(Sat)”参数设置为90，把“亮度(Lum)”参数设置为205，单击“添加到自定义颜色(Add tocustom colors)”，点击“确定”退出设置。&lt;br /&gt;&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;IE的网页背景&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;打开IE，点击“工具(TOOLS)”，点“INTERNET选项(INTERNET OPTIONS)”，点右下角的“辅助功能 (Assessibility)”，然后勾选“不使用网页中指定的颜色(ignore colors specifiedon web pages)”，然后点“确定”退出。&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;PDF格式背景&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;点击 编辑 -&gt;首选项-&gt;辅助工具&lt;br /&gt;选中“替换文档颜色”和“自定义颜色”，将背景颜色改成你想要的背景颜色&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-6728730421606469806?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/6728730421606469806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=6728730421606469806' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/6728730421606469806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/6728730421606469806'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2008/10/good-for-your-eyes.html' title='Good for your eyes ^^'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-4794059012802756076</id><published>2008-10-21T14:56:00.001-04:00</published><updated>2008-10-21T14:58:24.634-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Thoughts'/><title type='text'>1st Congestion Collapse</title><content type='html'>1986 - first congestion collapse Observed!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-family: times new roman;"&gt;-- Omg, I was just entering my primary school at that time...&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-4794059012802756076?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/4794059012802756076/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=4794059012802756076' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/4794059012802756076'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/4794059012802756076'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2008/10/1st-congestion-collapse.html' title='1st Congestion Collapse'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-8022849916162845773</id><published>2007-11-12T17:23:00.000-05:00</published><updated>2008-11-02T12:45:34.499-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Network'/><title type='text'>P2P File Sharing: BT, eMule...</title><content type='html'>&lt;p&gt;Yesterday, when I use bt and emule to download &lt;cold&gt;, some  questions jumped out -- "How to locate content in other peers using these  software" and "What is the difference between BT and eMule". Well, first, let  me read Network text for some hints.  &lt;/cold&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:Comic Sans MS;font-size:85%;"  &gt;--Partly cited from &lt;computer&gt; Charper 2:  Application Layer&lt;/computer&gt;&lt;/span&gt;  &lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:Comic Sans MS;font-size:85%;"  &gt;P2P file sharing is a compelling content  distribution paradigm because all content is transferred directly between  ordinary peers without passing through third-party server. It still relies on  the client-server paradigm. All peers must be capable of running both the client  and server sides of the file transfer protocol.&lt;/span&gt;  &lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:Comic Sans MS;font-size:85%;"  &gt;In a P2P file-sharing system, there is  typically a large number of connected peers, with each peer having objects to  share. If peer X is interested in obtaining a particular object, then it must  have a way of determining the IP addresses of the connected peers that have  copies of the desired object. Now, there are mainly three architectures for  locating content.&lt;/span&gt;  &lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:Comic Sans MS;font-size:85%;"  &gt;1. Centralized Directory&lt;/span&gt;  &lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:Comic Sans MS;font-size:85%;"  &gt;Representative application: Napster.&lt;/span&gt;   &lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:Comic Sans MS;font-size:85%;"  &gt;In this manner, there is a large server (or  server farm) to provide the directory service, that is, it collects information  about available content to share in each active peer and thereby creating a  centralized, dynamic database that maps each object name to a set of IP  addresses. When an active peer obtains a new object, or removes an object, it  informs the directory server so that server can update its database. Also,  server must periodically ping to make sure a child peer is still alive.&lt;/span&gt;  &lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:Comic Sans MS;font-size:85%;"  &gt;Drawback: the salient one is that the P2P  application is only partially decentralized. The file transfer between peers is  decentralized, but the process of locating content is highly centralized, which  will be the performance bottleneck of the whole system.&lt;/span&gt;  &lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:Comic Sans MS;font-size:85%;"  &gt;2. Query Flooding&lt;/span&gt;  &lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:Comic Sans MS;font-size:85%;"  &gt;Representative application:  Gnutella.&lt;/span&gt;  &lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:Comic Sans MS;font-size:85%;"  &gt;In Gnutella, peers send Gnutella Query  message to neighboring peers in the overlay network over the pre-existing TCP  connections. All neighbors check whether the keyword matches any of the files  available for sharing, and if there is a match, it sends back a QueryHit  message. In the meantime, they forward the message to all of their neighbors,  which in turn check the match and forward the message to all of their neighbors,  and so on. This process is referred to as Query Flooding. In practice, to reduce  the query traffic that is dumped into the Internet, Gnutella uses Limited Scope  Query Flooding, which localize the flooding to a region of the overlay network.  To solve Bootstrap problem (peer must first find some other peer that is already  in the overlay network), client maintains a list of peers that are often up in  the Gnutella network or contacts with a Gnutella site that maintains such a  list.&lt;/span&gt;  &lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:Comic Sans MS;font-size:85%;"  &gt;Drawback: it uses a full distributed  architecture, but only locates content in nearby peers in the overlay network,  where "nearby" means within a small number of hops.&lt;/span&gt;  &lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:Comic Sans MS;font-size:85%;"  &gt;3. Exploiting Heterogeneity&lt;/span&gt;  &lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:Comic Sans MS;font-size:85%;"  &gt;Representative application: KaZaA.&lt;/span&gt;  &lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:Comic Sans MS;font-size:85%;"  &gt;KaZaA borrows ideas from both Napster and  Gnutella. It resembles Gnutella in the sense that it does not use a dedicated  directory server. However, unlike Gnutella, the peers in KaZaA are not equal --  the peers with high bandwidth connections and high Internet connectivity are  designed as group leaders and maintain a database that includes the identifiers  of all the files its children are sharing. In contrast with Nepster, a group  leader is not a dedicate server, instead, it is an ordinary peer. When receiving  a Query message, each group leader not only tracks the content of its children,  but also forwards the query to other group leaders to which it is connected. By  this means, the group leaders create a network that resembles a Gnutella  network, and KaZaA shares content information among the various groups.&lt;/span&gt;  &lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:Comic Sans MS;font-size:85%;"  &gt;KaZaA also employs a number of features to  improve its performance. These techniques include: Queue Management at Server  and Client (Frequent uploaders can get priority in server queue), Parallel  Downloading (Downloading portions of the file from different peers in parallel),  Content Hash.&lt;/span&gt;  &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;hr /&gt;  &lt;p&gt;Now, come back to my previous question. How are BT and eMule doing?  &lt;/p&gt;&lt;p&gt;The two application can do better than KaZaA when downloading large files.  The salient difference from KaZaA is that the two both cut a large file into  pieces and use DHT to locate it.  &lt;/p&gt;&lt;p&gt;DHT introduce a hash function to map the object being searched for to a  unique identifier, distributing the range of the hash function among all nodes  in the network. Thus, each node must "know about" at least one copy of each  object that hashes within its range (when one exists). For each object, nodes  whose ranges cover that object must be reachable via a "short" path by the  arbitrarily chosen querier nodes and by nodes that have copies of the object.  Note that DHT mechanism should be fully distributed s.t. no centralized point  that bottlenecks throughput or can act as single point of failure.  &lt;/p&gt;&lt;p&gt;In BitTorrent, file.torrent is a descriptor of objects, which includes file  name, file length, hash identifier and URL of tracker. Client first gets  file.torrent, then uses the URL of tracker to access the tracker to get the list  of peers, and downloads the file from these peers in parallel.  &lt;/p&gt;&lt;p&gt;In eMule, each client must be connected to a server to enter the network.  When connecting your client to a server, the server will assigns your client a  High-ID or Low-ID according to whether other clients can freely connect to your  client. Once connected to the network, the client can search for keywords in  filenames. A search can either be local search (searches only the server you are  connected to - quicker but fewer matches) or global search (searches all the  servers within the network - slower but more results). Recent version of eMule  uses Kademlia to solve the Bootstrap problem, a network independent to classic  servers based eD2k and improve scalability.  &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;hr /&gt;  &lt;p&gt;References:  &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.emule-project.net/home/perl/help.cgi?l=1&amp;amp;topic_id=232&amp;amp;rm=show_topic"&gt;More  information about eMule&lt;/a&gt;  &lt;/p&gt;&lt;p&gt;&lt;a href="http://cis.poly.edu/%7Eross/papers/P2PtutorialInfocom.pdf"&gt;A P2P  Systems Tutorial (PPT file)&lt;/a&gt;  &lt;/p&gt;&lt;p&gt;&lt;a href="http://cis.poly.edu/%7Eross/p2pTheory/P2Preading.htm"&gt;Recommended  reading list about P2P Networking Theory&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-8022849916162845773?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/8022849916162845773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=8022849916162845773' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/8022849916162845773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/8022849916162845773'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2007/11/p2p-file-sharing-bt-emule.html' title='P2P File Sharing: BT, eMule...'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-461217946221124119</id><published>2007-05-20T17:14:00.001-04:00</published><updated>2010-04-20T17:20:58.565-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Computational Geometry'/><category scheme='http://www.blogger.com/atom/ns#' term='Geometry'/><title type='text'>Basic Terms of Graphs</title><content type='html'>&lt;span style="color: rgb(153, 51, 0);font-family:arial;font-size:130%;"  &gt;Basicly, what is a graph?&lt;/span&gt;     &lt;p&gt;A &lt;strong&gt;graph&lt;/strong&gt; G = (V, E) consists of two types of  elements, where V is the set of &lt;strong&gt;vertices&lt;/strong&gt; or &lt;strong&gt;nodes&lt;/strong&gt;  and E is the set of pairs of distinct vertices, called &lt;strong&gt;edges&lt;/strong&gt;  or &lt;strong&gt;lines&lt;/strong&gt;.[&lt;a href="http://en.wikipedia.org/wiki/Glossary_of_graph_theory"&gt;&lt;span id="navi"&gt;Wiki&lt;/span&gt;&lt;/a&gt;]&lt;/p&gt;     &lt;p&gt;The vertices belonging to an edge are called the &lt;strong&gt;ends&lt;/strong&gt;,  &lt;strong&gt;endpoints&lt;/strong&gt;, or &lt;strong&gt;endvertices&lt;/strong&gt; of the  edge. Two vertices &lt;em&gt;u&lt;/em&gt; and &lt;em&gt;v&lt;/em&gt; are considered &lt;strong&gt;adjacent&lt;/strong&gt;  if an edge   exists between them; these two vertices are said to be &lt;strong&gt;incident&lt;/strong&gt;  to that edge, or,   equivalently, that edge &lt;strong&gt;incident&lt;/strong&gt;  to those two vertices.&lt;/p&gt;     &lt;p&gt;Normally, we use &lt;strong&gt;n&lt;/strong&gt; to denote the number of  vertices |V|, namely the &lt;strong&gt;order&lt;/strong&gt; of a graph, and use &lt;strong&gt;e&lt;/strong&gt;  to denote the number of edges |E|, namely the &lt;strong&gt;size&lt;/strong&gt; of a  graph. The &lt;strong&gt;degree&lt;/strong&gt; of a vertex is the number of other  vertices connected to it by edges. The &lt;strong&gt;distance&lt;/strong&gt; &lt;em&gt;d&lt;/em&gt;&lt;em&gt;G&lt;/em&gt;(&lt;em&gt;u&lt;/em&gt;,  &lt;em&gt;v&lt;/em&gt;) between two (not necessary distinct) vertices &lt;em&gt;u&lt;/em&gt;  and &lt;em&gt;v&lt;/em&gt; in a graph &lt;em&gt;G&lt;/em&gt; is the length of a   shortest path  between them.&lt;/p&gt;     &lt;p&gt;A graph is &lt;em&gt;&lt;strong&gt;k&lt;/strong&gt;&lt;/em&gt;&lt;strong&gt;-connected&lt;/strong&gt;  if and only if it contains &lt;em&gt;k&lt;/em&gt; internally   disjoint paths  between any two vertices. That is, the minimum number of vertices needed  to be removed to disconnect &lt;em&gt;G&lt;/em&gt; is k. A &lt;strong&gt;component&lt;/strong&gt;  is a maximally connected subgraph; and a &lt;strong&gt;biconnected component&lt;/strong&gt;  is a maximal set of edges in which any two members   lie on a common  simple cycle.&lt;/p&gt;     &lt;p&gt;A &lt;strong&gt;dominating set&lt;/strong&gt; of a graph is a vertex subset  whose closed neighborhood includes all vertices of the graph. A vertex &lt;em&gt;v&lt;/em&gt;  &lt;strong&gt;dominates&lt;/strong&gt; another vertex &lt;em&gt;u&lt;/em&gt; if there is an  edge from &lt;em&gt;v&lt;/em&gt; to &lt;em&gt;u&lt;/em&gt;. A vertex subset &lt;em&gt;V&lt;/em&gt; &lt;strong&gt;dominates&lt;/strong&gt;  another vertex subset &lt;em&gt;U&lt;/em&gt; if every vertex in &lt;em&gt;U&lt;/em&gt; is  adjacent to some vertex in &lt;em&gt;V&lt;/em&gt;. The minimum size of a dominating  set is the &lt;strong&gt;domination number&lt;/strong&gt;.&lt;/p&gt;     &lt;p&gt;An &lt;strong&gt;isolated vertex&lt;/strong&gt; is a vertex not incident to  any edges. An &lt;strong&gt;independent set&lt;/strong&gt;, or &lt;em&gt;stable set&lt;/em&gt;  or &lt;em&gt;staset&lt;/em&gt;, is a set of isolated vertices, i.e., no pair of  vertices is adjacent. The graph induced by any independent set is an  empty graph. The &lt;strong&gt;independence number&lt;/strong&gt; α(&lt;em&gt;G&lt;/em&gt;) of a  graph &lt;em&gt;G&lt;/em&gt; is the size of   a largest independent set of &lt;em&gt;G&lt;/em&gt;.&lt;/p&gt;     &lt;p&gt;A &lt;strong&gt;matching&lt;/strong&gt; &lt;em&gt;M&lt;/em&gt; in &lt;em&gt;G&lt;/em&gt; is a set of &lt;u&gt;pairwise  non-adjacent&lt;/u&gt; edges; that is, no   two edges share a common vertex. A  &lt;strong&gt;maximum matching&lt;/strong&gt; is a matching that contains the  largest possible   number of edges. There may be many maximum matchings.  The &lt;strong&gt;matching number&lt;/strong&gt; of a graph is the size of a  maximum matching. A &lt;strong&gt;perfect matching&lt;/strong&gt; is a matching  which covers all vertices of the graph.&lt;/p&gt;     &lt;p&gt;The &lt;strong&gt;complement&lt;/strong&gt; &lt;img alt="\bar{G}" src="http://upload.wikimedia.org/math/a/7/e/a7ed73df196c8b8492b75c508c61fcd7.png" /&gt;  of a graph &lt;em&gt;G&lt;/em&gt; is a graph with the same vertex set as &lt;em&gt;G&lt;/em&gt;  but with an   edge set such that &lt;em&gt;xy&lt;/em&gt; is an edge in &lt;img alt="\bar{G}" src="http://upload.wikimedia.org/math/a/7/e/a7ed73df196c8b8492b75c508c61fcd7.png" /&gt;  if and only if &lt;em&gt;xy&lt;/em&gt; is not an edge in &lt;em&gt;G&lt;/em&gt;.&lt;/p&gt;     &lt;p&gt;Two graphs &lt;em&gt;G&lt;/em&gt; and &lt;em&gt;H&lt;/em&gt; are said to be &lt;strong&gt;isomorphic&lt;/strong&gt;,  denoted by &lt;em&gt;G&lt;/em&gt; ~ &lt;em&gt;H&lt;/em&gt;, if there is a one-to-one  correspondence, called an &lt;strong&gt;isomorphism&lt;/strong&gt;, between the  vertices of the graph such that two vertices are   adjacent in &lt;em&gt;G&lt;/em&gt;  if and only if their corresponding vertices are adjacent in &lt;em&gt;H&lt;/em&gt;.  Likewise, a graph &lt;em&gt;G&lt;/em&gt; is said to be &lt;strong&gt;homomorphic&lt;/strong&gt;  to a graph &lt;em&gt;H&lt;/em&gt; if there is a mapping, called a &lt;strong&gt;homomorphism&lt;/strong&gt;,  from &lt;em&gt;V&lt;/em&gt;(&lt;em&gt;G&lt;/em&gt;)   to &lt;em&gt;V&lt;/em&gt;(&lt;em&gt;H&lt;/em&gt;) such that if  two vertices are adjacent in &lt;em&gt;G&lt;/em&gt; then   their corresponding  vertices are adjacent in &lt;em&gt;H&lt;/em&gt;.&lt;/p&gt;     &lt;p  style="color: rgb(153, 51, 0);font-family:arial;" class="subHeader" id="seperator1"&gt;&lt;span style="font-size:130%;"&gt;Walk, Path, Cycle&lt;/span&gt;&lt;/p&gt;     &lt;p&gt;A &lt;strong&gt;walk&lt;/strong&gt; is an alternating sequence of vertices  and edges, beginning and ending with a vertex, in which each vertex is  incident to the two edges that precede and follow it in the sequence,  and the vertices that precede and follow an edge are the endvertices of  that edge. A walk is &lt;strong&gt;closed&lt;/strong&gt; if its first and last  vertices are the same, and &lt;strong&gt;open&lt;/strong&gt; if they are different. A  &lt;strong&gt;trail&lt;/strong&gt; is a walk in which all the edges are distinct.&lt;/p&gt;     &lt;p&gt;A &lt;strong&gt;path&lt;/strong&gt; is a sequence of vertices such that from  each of its vertices there is an edge to the next vertex in the  sequence. The first vertex is called the &lt;em&gt;&lt;strong&gt;start vertex&lt;/strong&gt;&lt;/em&gt;  and the last vertex is called the &lt;em&gt;&lt;strong&gt;end vertex&lt;/strong&gt;&lt;/em&gt;.  Both of them are called &lt;em&gt;&lt;strong&gt;end or terminal vertices&lt;/strong&gt;&lt;/em&gt;  of the path. The other vertices in the path are &lt;em&gt;&lt;strong&gt;internal  vertices&lt;/strong&gt;&lt;/em&gt;.&lt;/p&gt;     &lt;p&gt;A &lt;strong&gt;cycle&lt;/strong&gt; is a path such that the start vertex and  end vertex are the same. Notice however that unlike  paths, any vertex  of a cycle can be chosen as the start, so the start is often not  specified.&lt;/p&gt;     &lt;p&gt;Traditionally, a &lt;strong&gt;path&lt;/strong&gt; referred to an &lt;strong&gt;open  walk&lt;/strong&gt;; while a &lt;strong&gt;cycle&lt;/strong&gt; is equivalent to a &lt;strong&gt;closed  walk&lt;/strong&gt;. &lt;/p&gt;     &lt;p&gt;A path with no repeated vertices is called a &lt;strong&gt;simple path&lt;/strong&gt;,  and cycle with no repeated vertices aside from the start/end vertex is a  &lt;strong&gt;simple cycle&lt;/strong&gt;.&lt;br /&gt;     Two paths are &lt;strong&gt;independent&lt;/strong&gt; (alternatively,  internally vertex-disjoint) if they do not have any internal vertex in  common.&lt;/p&gt;     &lt;p&gt;The &lt;strong&gt;length&lt;/strong&gt; of a walk is the number of edges that  the path uses, counting multiple edges multiple times. For an open  walk, &lt;em&gt;l&lt;/em&gt; = &lt;em&gt;n&lt;/em&gt;–1, where &lt;em&gt;n&lt;/em&gt; is the number of    vertices visited (a vertex is counted each time it is visited). For a  closed   walk, &lt;em&gt;l&lt;/em&gt; = &lt;em&gt;n&lt;/em&gt; (the start/end vertex is listed  twice, but is NOT   counted twice).&lt;/p&gt;     &lt;p&gt;A &lt;strong&gt;loop&lt;/strong&gt; is a cycle of length 1, i.e. an edge  whose endvertices are the same vertex, e.g. (u, u).&lt;br /&gt;   &lt;em&gt;A cycle of length 2&lt;/em&gt; is a pair of &lt;strong&gt;digons&lt;/strong&gt; (&lt;strong&gt;multiple  edges&lt;/strong&gt;).&lt;br /&gt;   &lt;em&gt;A cycle of length 3 &lt;/em&gt; is called a &lt;strong&gt;triangle&lt;/strong&gt;.&lt;br /&gt;   An edge is &lt;strong&gt;multiple&lt;/strong&gt; if there is another edge with  the same endvertices, e.g. (u, v) and (v, u); otherwise it is &lt;strong&gt;simple&lt;/strong&gt;.&lt;/p&gt;     &lt;p&gt;A path or cycle is &lt;strong&gt;Hamiltonian&lt;/strong&gt; (or &lt;em&gt;&lt;strong&gt;spanning&lt;/strong&gt;&lt;/em&gt;)  if it &lt;u&gt;uses all vertices exactly once&lt;/u&gt;. A graph that contains a  Hamiltonian path is &lt;strong&gt;traceable&lt;/strong&gt;.&lt;br /&gt;   A trail or cycle is &lt;strong&gt;Eulerian&lt;/strong&gt; if it &lt;u&gt;uses all  edges precisely once&lt;/u&gt;. A graph that contains an Eulerian trail is &lt;strong&gt;traversable&lt;/strong&gt;.&lt;/p&gt;     &lt;p&gt;Two paths are &lt;strong&gt;internally disjoint&lt;/strong&gt; (some people  call it &lt;em&gt;&lt;strong&gt;independent&lt;/strong&gt;&lt;/em&gt;) if they do not have any  vertex in common, &lt;u&gt;except the first and last ones&lt;/u&gt;.&lt;/p&gt;     &lt;p  style="color: rgb(153, 51, 0);font-family:arial;" class="subHeader" id="seperator1"&gt;&lt;span style="font-size:130%;"&gt;Subgraphs&lt;/span&gt;&lt;/p&gt;     &lt;p&gt;A &lt;strong&gt;subgraph&lt;/strong&gt; of a graph &lt;em&gt;G&lt;/em&gt; is a graph  whose vertex and edge sets are   subsets of those of &lt;em&gt;G&lt;/em&gt;. In the  other direction, a &lt;strong&gt;supergraph&lt;/strong&gt; of a   graph &lt;em&gt;G&lt;/em&gt;  is a graph that contains &lt;em&gt;G&lt;/em&gt; as a subgraph.&lt;/p&gt;     &lt;p&gt;A subgraph &lt;em&gt;H&lt;/em&gt; is a &lt;strong&gt;spanning subgraph&lt;/strong&gt;, or  &lt;em&gt;&lt;strong&gt;factor&lt;/strong&gt;&lt;/em&gt;, of a graph &lt;em&gt;G&lt;/em&gt; if it has the  same vertex set as &lt;em&gt;G&lt;/em&gt;.&lt;/p&gt;     &lt;p&gt;A subgraph &lt;em&gt;H&lt;/em&gt; of a graph &lt;em&gt;G&lt;/em&gt; is said to be &lt;strong&gt;induced&lt;/strong&gt;  if, for   any pair of vertices &lt;em&gt;x&lt;/em&gt; and &lt;em&gt;y&lt;/em&gt; of H, &lt;em&gt;xy&lt;/em&gt;  is an edge of &lt;em&gt;H&lt;/em&gt; if and only if &lt;em&gt;xy&lt;/em&gt; is an edge of G. In  other words, &lt;em&gt;H&lt;/em&gt; is   an &lt;strong&gt;induced subgraph&lt;/strong&gt; of &lt;em&gt;G&lt;/em&gt;  if it has the most edges that appear in &lt;em&gt;G&lt;/em&gt; over the same vertex  set. If &lt;em&gt;H&lt;/em&gt; is chosen based on a vertex subset &lt;em&gt;S&lt;/em&gt; of &lt;em&gt;V(G)&lt;/em&gt;,  then &lt;em&gt;H&lt;/em&gt; can be written as &lt;em&gt;G&lt;/em&gt;[&lt;em&gt;S&lt;/em&gt;] and   is said  to be &lt;strong&gt;induced by &lt;em&gt;S&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;     &lt;p  style="color: rgb(153, 51, 0);font-family:arial;" class="subHeader" id="seperator1"&gt;&lt;span style="font-size:130%;"&gt;Tree&lt;/span&gt;&lt;/p&gt;     &lt;p&gt;A &lt;strong&gt;tree&lt;/strong&gt; is a connected acyclic simple graph. A  vertex of degree 1 is called a &lt;strong&gt;leaf&lt;/strong&gt;. A &lt;strong&gt;subtree&lt;/strong&gt;  of the tree &lt;em&gt;T&lt;/em&gt; is a connected subgraph of &lt;em&gt;T&lt;/em&gt;. A &lt;strong&gt;forest&lt;/strong&gt;  is an acyclic simple graph. A &lt;strong&gt;subforest&lt;/strong&gt; of the forest &lt;em&gt;F&lt;/em&gt;  is a subgraph of &lt;em&gt;F&lt;/em&gt;.&lt;/p&gt;     &lt;p&gt;A &lt;strong&gt;spanning tree&lt;/strong&gt; is a spanning subgraph that is a  tree. Every graph has a spanning forest. But only a connected   graph  has a spanning tree.&lt;/p&gt;     &lt;p&gt;A special kind of tree called a &lt;strong&gt;star&lt;/strong&gt; is &lt;em&gt;$K_{&lt;/em&gt;1,&lt;em&gt;k}$&lt;/em&gt;.  An induced star with 3 edges is a &lt;strong&gt;claw&lt;/strong&gt;.&lt;/p&gt;     &lt;p&gt;A &lt;strong&gt;&lt;em&gt;k&lt;/em&gt;-ary&lt;/strong&gt; tree is a rooted tree in which  every internal vertex   has &lt;em&gt;k&lt;/em&gt; &lt;em&gt;children&lt;/em&gt;. An 1-ary tree  is just a path. A 2-ary tree is also   called a &lt;strong&gt;binary tree&lt;/strong&gt;.&lt;/p&gt;     &lt;p  style="color: rgb(153, 51, 0);font-family:arial;" class="subHeader" id="seperator1"&gt;&lt;span style="font-size:130%;"&gt;Cliques&lt;/span&gt;&lt;/p&gt;     &lt;p&gt;A &lt;strong&gt;complete graph of order n&lt;/strong&gt; is a simple graph  with n vertices in which every vertex is adjacent to every other. A &lt;strong&gt;clique&lt;/strong&gt;  is a complete subgraph in a graph. A &lt;strong&gt;k-clique&lt;/strong&gt; is a  clique of order k. A &lt;strong&gt;maximal clique&lt;/strong&gt; is a clique that is  not a subset of any other clique.&lt;/p&gt;     &lt;p&gt;The &lt;strong&gt;clique number&lt;/strong&gt; of a graph G is the order of a  largest clique in G.  &lt;/p&gt;     &lt;p  style="color: rgb(153, 51, 0);font-family:arial;" class="subHeader" id="seperator1"&gt;&lt;span style="font-size:130%;"&gt;Important graphs&lt;/span&gt;&lt;/p&gt;     &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Undirected / Directed Graph&lt;/strong&gt;&lt;br /&gt;       edges are unordered or ordered pairs of vertices respectively&lt;br /&gt;    In a directed graph, an arc e=(u, v) is considered to be directed  from u to v.&lt;br /&gt;     &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Weighted Graph&lt;/strong&gt;&lt;br /&gt;    each edge is associated with some value, variously called its &lt;em&gt;&lt;strong&gt;cost&lt;/strong&gt;&lt;/em&gt;,  &lt;em&gt;&lt;strong&gt;weight&lt;/strong&gt;&lt;/em&gt;, &lt;em&gt;&lt;strong&gt;length&lt;/strong&gt;&lt;/em&gt; or  other term depending on the application&lt;br /&gt;     &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Acyclic / Unicyclic / Pancyclic Graph&lt;/strong&gt;&lt;br /&gt;       A graph is &lt;strong&gt;acyclic&lt;/strong&gt; if it contains no cycles; &lt;strong&gt;unicyclic&lt;/strong&gt;  if it contains exactly one cycle; and &lt;strong&gt;pancyclic&lt;/strong&gt; if it  contains cycles of every possible length (from 3 to the order of the  graph).&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Directed Acyclic Graph (dag / DAG)&lt;/strong&gt;&lt;br /&gt;    a directed graph with no directed cycles; that is, for any vertex &lt;em&gt;v&lt;/em&gt;,  there is no nonempty directed path that starts and ends on &lt;em&gt;v&lt;/em&gt;&lt;br /&gt;    Every directed acyclic graph corresponds to a &lt;strong&gt;partial order&lt;/strong&gt;  on its vertices.&lt;br /&gt;       A simple directed acyclic graph: &lt;img src="http://upload.wikimedia.org/wikipedia/commons/0/08/Directed_acyclic_graph.png" align="middle" /&gt;&lt;br /&gt;       DAGs can be considered to be &lt;strong&gt;a generalization of trees&lt;/strong&gt;  in which certain subtrees can be shared by different parts of the tree.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Simple / Multigraph / Pseudograph Graph&lt;/strong&gt;&lt;br /&gt;  A graph is a &lt;strong&gt;simple graph&lt;/strong&gt; if it has no multiple  edges or loops, a &lt;strong&gt;multigraph&lt;/strong&gt; if it has multiple edges,  but no loops, and a &lt;strong&gt;multigraph&lt;/strong&gt; or &lt;strong&gt;pseudograph&lt;/strong&gt;  if it contains both multiple edges and   loops (the literature is  highly inconsistent).&lt;br /&gt;  When stated without any qualification, a graph is almost always &lt;u&gt;assumed  to be simple&lt;/u&gt;.&lt;br /&gt;     &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Complete Graph&lt;/strong&gt;&lt;br /&gt;       each pair of vertices is joined by an edge, that is, the graph  contains all possible edges&lt;br /&gt;     &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Bipartite Graph&lt;/strong&gt;&lt;br /&gt;  the vertices can be divided into two sets, W and X, so that every  edge has one vertex in each of the two sets&lt;br /&gt;     &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Complete Bipartite Graph&lt;/strong&gt;&lt;br /&gt;  the vertex set is the union of two disjoint subsets, W and X, so that  every vertex in W is adjacent to every vertex in X but there are no  edges within W or X&lt;br /&gt;  The complete bipartite graph with partitions of size |W| = m and |X| =  n is denoted &lt;em&gt;K&lt;/em&gt;&lt;em&gt;m&lt;/em&gt;,&lt;em&gt;n&lt;/em&gt;.&lt;br /&gt;     &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Planar Graph&lt;/strong&gt;&lt;br /&gt;     a graph that can be drawn in a plane with no crossing edges (i.e.,  embedded in a plane)&lt;br /&gt;  A tree is necessarily a planar graph.&lt;br /&gt;     &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Unit Disk Graph&lt;/strong&gt;&lt;br /&gt;     A graph formed from a collection of points in the &lt;strong&gt;Euclidean  plane&lt;/strong&gt;, in which two points are connected if their distance is &lt;strong&gt;below&lt;/strong&gt;  a fixed threshold.&lt;br /&gt;  Unit disk graphs have been used in computer science to model the  topology of ad-hoc wireless communication networks.&lt;br /&gt;  It is &lt;strong&gt;NP-hard&lt;/strong&gt; to determine whether a graph, given  without geometry, can be represented as a unit disk graph.&lt;br /&gt;     &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Unit Distance Graph&lt;/strong&gt;&lt;br /&gt;     A graph formed from a collection of points in the &lt;strong&gt;Euclidean  plane&lt;/strong&gt; by connecting two points by an edge whenever the  distance between the two points is &lt;strong&gt;exactly&lt;/strong&gt; one.&lt;br /&gt;  Unlike planar graphs, edges of unit distance graphs are allowed to  cross each other.&lt;br /&gt;  Every unit distance graph is a unit disk graph, but the converse is  not true.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-461217946221124119?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/461217946221124119/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=461217946221124119' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/461217946221124119'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/461217946221124119'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2007/05/basicly-what-is-graph-graph-g-v-e.html' title='Basic Terms of Graphs'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-2984444339967202135</id><published>2007-04-03T11:59:00.001-04:00</published><updated>2008-10-19T12:00:34.696-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Presentation Skills'/><title type='text'>Create a Research Poster</title><content type='html'>&lt;p&gt;&lt;a href="http://www.acm.org/crossroads/xrds3-2/posters.html"&gt;&lt;span id="body-navi-sub"&gt;Research Posters&lt;/span&gt;&lt;/a&gt;    &lt;br /&gt;    &lt;i&gt;Copyright 2004 by Lorrie Cranor&lt;/i&gt;&lt;/p&gt;Suggestions on how to propose/create a research poster&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-2984444339967202135?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/2984444339967202135/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=2984444339967202135' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/2984444339967202135'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/2984444339967202135'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2007/04/create-research-poster.html' title='Create a Research Poster'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-5098764963085033828</id><published>2007-03-30T14:57:00.000-04:00</published><updated>2010-04-20T17:09:53.259-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Writing Skills'/><title type='text'>Minimum vs Minimal</title><content type='html'>&lt;span style="font-style: italic;font-family:times new roman;" &gt;[Comments from Dr.Lloyd]&lt;/span&gt;     &lt;p  style="font-style: italic;font-family:times new roman;"&gt;We need to be careful with this word.&lt;br /&gt;    Recall that &lt;span style="font-weight: bold;"&gt;Minimal &lt;/span&gt;can often mean a local minimum whereas &lt;span style="font-weight: bold;"&gt;Minimum &lt;/span&gt;is more of a global concept.&lt;br /&gt; To avoid confusion, it is almost always best to use minimum unless you are really sure that minimal is what is needed.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-5098764963085033828?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/5098764963085033828/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=5098764963085033828' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/5098764963085033828'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/5098764963085033828'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2007/05/minimum-vs-minimal.html' title='Minimum vs Minimal'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-6126761256001184591</id><published>2007-03-09T16:57:00.000-05:00</published><updated>2008-10-19T12:15:19.446-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='System Programming'/><title type='text'>Context Switch</title><content type='html'>&lt;ul&gt;&lt;li&gt;Context Switch &lt;/li&gt;&lt;/ul&gt;     &lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;A &lt;strong&gt;context switch&lt;/strong&gt; is storing and restoring the state (context) of a process such that multiple processes can share a single CPU resource. The context switch is an essential feature of a multitasking operating system. [&lt;a href="http://en.wikipedia.org/wiki/Context_switch"&gt;&lt;span id="navi"&gt;Wiki&lt;/span&gt;&lt;/a&gt;]&lt;/p&gt;     &lt;p&gt;The state of the process includes all the registers that the process may be using in future. Specifically, they are: the value of the &lt;strong&gt;Program Counter (PC)&lt;/strong&gt;, &lt;strong&gt;Stack Pointer (SP)&lt;/strong&gt; and &lt;strong&gt;Frame Pointer (FP)&lt;/strong&gt; or it might involve resetting the MMU to make a different set of memory pages available. Often, all the data that is necessary for state is stored in one data structure, called a &lt;strong&gt;Process Control Block (PCB)&lt;/strong&gt;. [&lt;a href="http://dict.die.net/context%20switch/"&gt;&lt;span id="navi"&gt;Dict&lt;/span&gt;&lt;/a&gt;]&lt;/p&gt;     &lt;p&gt;In order to switch processes, OS saves the state of the first process in its PCB. After that, OS now loads another process, restores its context (in doing so, the PC of the new process is loaded), and thus execution can continue in the new process.&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;     &lt;ul&gt;&lt;li&gt;Program Counter (PC)&lt;/li&gt;&lt;/ul&gt;     &lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;A register contains the address of the next instruction to be executed. The PC is automatically incremented after each instruction is fetched to point to the following instruction.&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;     &lt;ul&gt;&lt;li&gt;Stack Pointer (SP)&lt;/li&gt;&lt;/ul&gt;     &lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;A register or variable pointing to the top of a stack. If the stack is a "full" stack the SP points to the most recently pushed item, else if it is an "empty" stack, the PS points to the first empty location, where the next item will be pushed.&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;     &lt;ul&gt;&lt;li&gt;Memory Management Unit (MMU)&lt;/li&gt;&lt;/ul&gt;     &lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;A hardware device or circuit that supports &lt;strong&gt;virtual memory&lt;/strong&gt; and paging by translating &lt;strong&gt;virtual addresses&lt;/strong&gt; (the range of addresses used by the processor) into &lt;strong&gt;physical addresses&lt;/strong&gt;.&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;     &lt;ul&gt;&lt;li&gt;setjmp / longjmp [&lt;a href="http://www.die.net/doc/linux/man/man3/setjmp.3.html"&gt;&lt;span id="navi"&gt;Linux man page&lt;/span&gt;&lt;/a&gt;]&lt;/li&gt;&lt;/ul&gt;     &lt;p&gt;&lt;u&gt;&lt;/u&gt;&lt;/p&gt;&lt;blockquote style="font-family: times new roman; font-style: italic;"&gt;&lt;p&gt;&lt;u&gt;NAME&lt;/u&gt;&lt;/p&gt;     &lt;p&gt;setjmp, sigsetjmp -- save stack context for non-local goto&lt;br /&gt;      longjmp, siglongjmp -- non-local jump to a saved stack context&lt;/p&gt;     &lt;p&gt;&lt;u&gt;SYNOPSIS&lt;/u&gt;&lt;/p&gt;     &lt;p&gt;&lt;strong&gt;#include &lt;&lt;a href="http://www.die.net/doc/linux/include/setjmp.h"&gt;&lt;span id="navi"&gt;&lt;/span&gt;&lt;/a&gt;&lt;a rel="nofollow"&gt;setjmp.h&lt;/a&gt;&gt;&lt;/strong&gt;&lt;/p&gt;     &lt;p&gt;&lt;u&gt;DESCRIPTION&lt;/u&gt;&lt;/p&gt;     &lt;p&gt;&lt;strong&gt;setjmp&lt;/strong&gt;() and &lt;strong&gt;longjmp&lt;/strong&gt;() are useful for dealing with errors and interrupts encountered in a low-level subroutine of a program.&lt;/p&gt;     &lt;p&gt;&lt;strong&gt;setjmp&lt;/strong&gt;() saves the stack context/environment in &lt;strong&gt;env&lt;/strong&gt; for later use by &lt;strong&gt;longjmp&lt;/strong&gt;(). &lt;u&gt;The stack context will be invalidated if the function which called &lt;strong&gt;setjmp&lt;/strong&gt;() returns&lt;/u&gt;. &lt;strong&gt;sigsetjmp&lt;/strong&gt;() is similar to &lt;strong&gt;setjmp&lt;/strong&gt;(). If &lt;em&gt;savesigs&lt;/em&gt; is non-zero, the set of blocked signals is saved in &lt;em&gt;env&lt;/em&gt; and will be restored if a &lt;strong&gt;siglongjmp&lt;/strong&gt;() is later performed with this &lt;em&gt;env&lt;/em&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;     &lt;p class="BlogNote"&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p class="BlogNote"&gt;--Why? Because what we saved is the SP and FP of the calling procedure. If that procedure returns, then when you restore the SP and FP, the stack might be in a different state than before. For example:&lt;/p&gt;     &lt;span class="BlogNote"&gt;&lt;ul&gt;&lt;li febrn="0" wssga="0"&gt;main() routine is first called. The stack is initialized, so do SP, FP and PC.&lt;/li&gt;&lt;li&gt;main() calls a(). It first pushes the arguments on the stack in reverse order, and then pushes the return PC on the stack, and the old FP. The FP and SP then are changed to make an empty stack frame for a().&lt;/li&gt;&lt;li&gt;The first thing that a() does is allocate room for its local variables. Then it calls &lt;strong&gt;setjmp&lt;/strong&gt;(), which saves the current state of the registers. In other words, it saves the current values of SP, FP, and PC.&lt;/li&gt;&lt;li&gt;Now a() returns to main(). The stack looks as the very start, except that env is initialized to the state of the machine when a() was called.&lt;/li&gt;&lt;li&gt;Then main() calls b(). In b(), &lt;strong&gt;longjmp&lt;/strong&gt;() is called. The registers are restored to their values when a() called &lt;strong&gt;setjmp&lt;/strong&gt;(), and the PC returns from  &lt;strong&gt;setjmp&lt;/strong&gt;() in a().&lt;/li&gt;&lt;/ul&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span class="BlogNote"&gt;&lt;ul&gt;&lt;li&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/span&gt;     &lt;p align="center"&gt;&lt;img src="http://www.cis.udel.edu/%7Efei/_images/setjmp.jpg" border="0" width="927" height="264" /&gt;&lt;/p&gt;     &lt;p class="BlogNote"&gt;&lt;/p&gt;&lt;blockquote&gt;--Did you see the problem? Yes. The stack is in a bad state. When we try to use the pointer to the arguments of a(), it points to the arguments of b() actually, which dumps core.&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;     &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;blockquote style="font-family: times new roman; font-style: italic;"&gt;&lt;p&gt;&lt;strong&gt;longjmp&lt;/strong&gt;() restores the environment saved by the last call of &lt;strong&gt;setjmp&lt;/strong&gt;() with the corresponding &lt;em&gt;env&lt;/em&gt; argument. After &lt;strong&gt;longjmp&lt;/strong&gt;() is completed, program execution continues as if the corresponding call of &lt;strong&gt;setjmp&lt;/strong&gt;() had just returned the value &lt;em&gt;val&lt;/em&gt;. &lt;u&gt;&lt;strong&gt;longjmp&lt;/strong&gt;() cannot cause 0 to be returned. If longjmp is invoked with a second argument of 0, 1 will be returned instead&lt;/u&gt;. &lt;strong&gt;siglongjmp&lt;/strong&gt;() is similar to &lt;strong&gt;longjmp&lt;/strong&gt;() except for the type of its &lt;em&gt;env&lt;/em&gt; argument. If the &lt;strong&gt;sigsetjmp&lt;/strong&gt;() call that set this &lt;em&gt;env&lt;/em&gt; used a non-zero &lt;em&gt;savesigs&lt;/em&gt; flag, &lt;strong&gt;siglongjmp&lt;/strong&gt;() also restores the set of blocked signals.&lt;/p&gt;     &lt;p&gt;&lt;u&gt;RETURN VALUE&lt;/u&gt;&lt;/p&gt;     &lt;p&gt;&lt;strong&gt;setjmp&lt;/strong&gt;() and &lt;strong&gt;sigsetjmp&lt;/strong&gt;() &lt;u&gt;return 0 if returning directly&lt;/u&gt;, and &lt;u&gt;non-zero when returning from &lt;strong&gt;longjmp&lt;/strong&gt;() using the saved context&lt;/u&gt;.&lt;/p&gt;     &lt;p&gt;&lt;strong&gt;longjmp&lt;/strong&gt;() and &lt;strong&gt;siglongjmp&lt;/strong&gt;() never return.&lt;/p&gt;     &lt;p&gt;&lt;u&gt;NOTES&lt;/u&gt;&lt;/p&gt;     &lt;p&gt;POSIX does not specify whether &lt;strong&gt;setjmp&lt;/strong&gt;()/&lt;strong&gt;longjmp&lt;/strong&gt;() will save/restore the signal context. If you want to save and restore signal masks, use &lt;strong&gt;sigsetjmp&lt;/strong&gt;()/&lt;strong&gt;siglongjmp&lt;/strong&gt;(). &lt;u&gt;&lt;strong&gt;setjmp&lt;/strong&gt;() and &lt;strong&gt;sigsetjmp&lt;/strong&gt;() / &lt;strong&gt;longjmp&lt;/strong&gt;() and &lt;strong&gt;siglongjmp&lt;/strong&gt;() make programs hard to understand and maintain. If possible an alternative should be used&lt;/u&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;     &lt;p class="BlogNote"&gt;&lt;/p&gt;&lt;blockquote&gt;--I DO agree with that!!&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;     &lt;ul&gt;&lt;li&gt;setcontext / getcontext, makecontext / swapcontext [&lt;a href="http://www.die.net/doc/linux/man/man3/setcontext.3.html"&gt;&lt;span id="navi"&gt;Linux man page&lt;/span&gt;&lt;/a&gt;]&lt;/li&gt;&lt;/ul&gt;     &lt;p class="BlogNote"&gt;&lt;/p&gt;&lt;blockquote&gt;--They are much safer and easier to use than setjmp/longjmp do.&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;     &lt;p style="font-family: times new roman; font-style: italic;"&gt;&lt;u&gt;&lt;/u&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p style="font-family: times new roman; font-style: italic;"&gt;&lt;u&gt;NAME&lt;/u&gt;&lt;/p&gt;     &lt;p style="font-family: times new roman; font-style: italic;"&gt;getcontext, setcontext -- get and set current user context&lt;br /&gt;      makecontext, swapcontext -- manipulate user context &lt;/p&gt;     &lt;p style="font-family: times new roman; font-style: italic;"&gt;&lt;u&gt;SYNOPSIS&lt;/u&gt;&lt;/p&gt;     &lt;p style="font-family: times new roman; font-style: italic;"&gt;&lt;strong&gt;#include &lt;&lt;a href="http://www.die.net/doc/linux/include/ucontext.h"&gt;&lt;span id="navi"&gt;&lt;/span&gt;&lt;/a&gt;&lt;a rel="nofollow"&gt;ucontext.h&lt;/a&gt;&gt;&lt;/strong&gt;&lt;/p&gt;     &lt;p style="font-family: times new roman; font-style: italic;"&gt;&lt;u&gt;DESCRIPTION&lt;/u&gt;&lt;/p&gt;     &lt;p style="font-family: times new roman; font-style: italic;"&gt;In a System V-like environment, one has the type &lt;strong&gt;ucontext_t&lt;/strong&gt; defined in &lt;&lt;span id="navi"&gt;&lt;a href="http://www.die.net/doc/linux/include/ucontext.h" rel="nofollow"&gt;ucontext.h&lt;/a&gt;&lt;/span&gt;&gt; and the four functions &lt;strong&gt;getcontext&lt;/strong&gt;(), &lt;strong&gt;setcontext&lt;/strong&gt;(), &lt;strong&gt;makecontext&lt;/strong&gt;() and &lt;strong&gt;swapcontext&lt;/strong&gt;() that allow user-level context switching between multiple threads of control within a   process.&lt;/p&gt;     &lt;p style="font-family: times new roman; font-style: italic;"&gt;&lt;strong&gt;getcontext&lt;/strong&gt;() gets the current context of the calling process, storing it in the ucontext struct pointed to by &lt;strong&gt;ucp&lt;/strong&gt;. The &lt;strong&gt;ucontext_t&lt;/strong&gt; type that &lt;strong&gt;ucp&lt;/strong&gt; points to defines the user context and includes the contents of the calling thread's machine registers, the signal mask, and the current execution stack.&lt;/p&gt;     &lt;p style="font-family: times new roman; font-style: italic;"&gt;&lt;strong&gt;setcontext&lt;/strong&gt;() sets the context of the calling process to the state stored in the ucontext struct pointed to by &lt;strong&gt;ucp&lt;/strong&gt;. A successful call to &lt;strong&gt;setcontext&lt;/strong&gt;() shall not return; program execution resumes at the point specified by the &lt;strong&gt;ucp&lt;/strong&gt; argument passed to &lt;strong&gt;setcontext&lt;/strong&gt;(). The &lt;strong&gt;ucp&lt;/strong&gt; argument should be created either by a prior call to &lt;strong&gt;getcontext&lt;/strong&gt;() or &lt;strong&gt;makecontext&lt;/strong&gt;(), or by being passed as an argument to a signal handler. &lt;u&gt;If the &lt;strong&gt;ucp&lt;/strong&gt; argument was created with &lt;strong&gt;getcontext&lt;/strong&gt;(), program execution continues as if the corresponding call of &lt;strong&gt;getcontext&lt;/strong&gt;() had just returned. If the &lt;strong&gt;ucp&lt;/strong&gt; argument was created with &lt;strong&gt;makecontext&lt;/strong&gt;(), program execution continues with the function passed to &lt;strong&gt;makecontext&lt;/strong&gt;().&lt;/u&gt;&lt;/p&gt;     &lt;p style="font-family: times new roman; font-style: italic;"&gt;The &lt;strong&gt;makecontext&lt;/strong&gt;() function modifies the context pointed to by &lt;strong&gt;ucp&lt;/strong&gt; (which was obtained from a call to &lt;strong&gt;getcontext&lt;/strong&gt;()). Before invoking &lt;strong&gt;makecontext&lt;/strong&gt;(), the caller must allocate a new stack for this context and assign its address to &lt;strong&gt;ucp-&gt;uc_stack&lt;/strong&gt;, and define a successor context and assign its address to &lt;strong&gt;ucp-&gt;uc_link&lt;/strong&gt;. When this context is later activated (using &lt;strong&gt;setcontext&lt;/strong&gt;() or &lt;strong&gt;swapcontext&lt;/strong&gt;()) the function &lt;strong&gt;func&lt;/strong&gt; is called, and passed the series of integer (&lt;strong&gt;int&lt;/strong&gt;) arguments that follow &lt;strong&gt;argc&lt;/strong&gt;; the caller must specify the number of these arguments in &lt;strong&gt;argc&lt;/strong&gt;. When this function returns, the successor context is activated. If the successor context pointer is NULL, the thread exits.&lt;/p&gt;     &lt;p style="font-family: times new roman; font-style: italic;"&gt;The &lt;strong&gt;swapcontext&lt;/strong&gt;() function saves the current context in the structure pointed to by &lt;strong&gt;oucp&lt;/strong&gt;, and then activates the context pointed to by &lt;strong&gt;ucp&lt;/strong&gt;. &lt;/p&gt;     &lt;p style="font-family: times new roman; font-style: italic;"&gt;&lt;u&gt;RETURN VALUE&lt;/u&gt;&lt;/p&gt;     &lt;p style="font-family: times new roman; font-style: italic;"&gt;Upon successful completion, &lt;strong&gt;setcontext&lt;/strong&gt;() shall not return and &lt;strong&gt;getcontext&lt;/strong&gt;() shall return 0; otherwise, a value of -1 shall be returned.&lt;/p&gt;     &lt;p style="font-family: times new roman; font-style: italic;"&gt;When successful, &lt;strong&gt;swapcontext&lt;/strong&gt;() does not return. (But we may return later, in case &lt;strong&gt;oucp&lt;/strong&gt; is activated, in which case it looks like &lt;strong&gt;swapcontext&lt;/strong&gt;() returns 0.) On error, &lt;strong&gt;swapcontext&lt;/strong&gt;() returns -1 and sets &lt;strong&gt;errno&lt;/strong&gt; appropriately. &lt;/p&gt;     &lt;p style="font-family: times new roman; font-style: italic;"&gt;&lt;u&gt;APPLICATION USAGE&lt;/u&gt;&lt;/p&gt;     &lt;span style="font-family: times new roman; font-style: italic;"&gt;When a signal handler is executed, the current user context is saved and a new context is created. If the thread leaves the signal handler via &lt;/span&gt;&lt;strong style="font-family: times new roman; font-style: italic;"&gt;longjmp&lt;/strong&gt;&lt;span style="font-family: times new roman; font-style: italic;"&gt;(), then it is unspecified whether the context at the time of the corresponding &lt;/span&gt;&lt;strong style="font-family: times new roman; font-style: italic;"&gt;setjmp&lt;/strong&gt;&lt;span style="font-family: times new roman; font-style: italic;"&gt;() call is restored and thus whether future   calls to &lt;/span&gt;&lt;strong style="font-family: times new roman; font-style: italic;"&gt;getcontext&lt;/strong&gt;&lt;span style="font-family: times new roman; font-style: italic;"&gt;() provide an accurate representation of the current context, since the context restored by &lt;/span&gt;&lt;strong style="font-family: times new roman; font-style: italic;"&gt;longjmp&lt;/strong&gt;&lt;span style="font-family: times new roman; font-style: italic;"&gt;() does not necessarily contain all the information that &lt;/span&gt;&lt;strong style="font-family: times new roman; font-style: italic;"&gt;setcontext&lt;/strong&gt;&lt;span style="font-family: times new roman; font-style: italic;"&gt;() requires. Signal handlers should use &lt;/span&gt;&lt;strong style="font-family: times new roman; font-style: italic;"&gt;siglongjmp&lt;/strong&gt;&lt;span style="font-family: times new roman; font-style: italic;"&gt;() or &lt;/span&gt;&lt;strong style="font-family: times new roman; font-style: italic;"&gt;setcontext&lt;/strong&gt;&lt;span style="font-family: times new roman; font-style: italic;"&gt;() instead.&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-family: times new roman; font-style: italic;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-6126761256001184591?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/6126761256001184591/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=6126761256001184591' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/6126761256001184591'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/6126761256001184591'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2007/03/context-switch.html' title='Context Switch'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-2587400872437202965</id><published>2007-03-07T20:46:00.000-05:00</published><updated>2008-10-19T12:19:15.034-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='System Programming'/><title type='text'>Static variables &amp; Static functions</title><content type='html'>&lt;ul&gt;&lt;li&gt;Static variables in C&lt;/li&gt;&lt;/ul&gt;     &lt;p&gt;Here, we need give a brief introduction of "C storage classes" first.&lt;/p&gt;     &lt;p style="font-family: times new roman; font-style: italic;"&gt;"storage classes" is a concept of C which are used to define the scope (visibility) and life time of variables and/or functions.&lt;br /&gt;    There are several storage classes available.&lt;/p&gt;     &lt;ul style="font-family: times new roman; font-style: italic;"&gt;&lt;li febrn="0" wssga="0"&gt;&lt;strong&gt;AUTO&lt;/strong&gt;&lt;br /&gt;   &lt;strong&gt;auto&lt;/strong&gt; is the &lt;u&gt;default&lt;/u&gt; storage class for &lt;u&gt;local&lt;/u&gt; varialbes. auto can only be used within functions, i.e. local variables which can only be visible in the function.&lt;br /&gt;   &lt;/li&gt;&lt;li febrn="0" wssga="0"&gt;&lt;strong&gt;REGISTER&lt;/strong&gt;&lt;br /&gt;   &lt;strong&gt;register&lt;/strong&gt; is used to define &lt;u&gt;local&lt;/u&gt; variables that should be stored in a register instead of RAM. This means that the variable has a &lt;u&gt;maximum size equal to the register size (usually one word)&lt;/u&gt; and &lt;u&gt;can't have the unary '&amp;amp;' operator&lt;/u&gt; applied to it (as it does not have a memory location).&lt;br /&gt;   Register should only be &lt;u&gt;used for variables that require quick access&lt;/u&gt; - such as counters. Note that defining 'register' goes not mean that the variable will be stored in a register. It means that it MIGHT be stored in a register - depending on hardware and implimentation restrictions.&lt;br /&gt;   &lt;/li&gt;&lt;li febrn="0" wssga="0"&gt;&lt;strong&gt;STATIC&lt;/strong&gt;&lt;br /&gt;   We will discuss it later. :)&lt;br /&gt;   &lt;/li&gt;&lt;li febrn="0" wssga="0"&gt;&lt;strong&gt;EXTERN&lt;/strong&gt;&lt;br /&gt;   &lt;strong&gt;extern&lt;/strong&gt; defines a global variable that is visable to &lt;u&gt;ALL&lt;/u&gt; object modules.&lt;br /&gt;For instance, when you define a variable in file 1 and 'extern' it, you can read and change its value. Note that if file 1 changes the value of the variable, file 2 will see the new value.&lt;/li&gt;&lt;/ul&gt;     &lt;p id="seperator1"&gt;Well, go back to our topic.&lt;/p&gt;     &lt;p&gt;&lt;strong&gt;static&lt;/strong&gt; is the &lt;u&gt;default&lt;/u&gt; storage class for global variables. That is to say, the two variables defined as below both have a static storage class.&lt;/p&gt;     &lt;p style="font-style: italic; font-family: times new roman;"&gt;static int count;&lt;br /&gt;      int road;&lt;br /&gt;   main()&lt;/p&gt;     &lt;p&gt;&lt;strong&gt;static variable&lt;/strong&gt; can also be defined within a function.&lt;br /&gt;      In this case, the variable is permanent. It can only be initalised once and only one copy of the variable exists. &lt;u&gt;Recursive calls use the same variable&lt;/u&gt;. It is &lt;u&gt;initialized at the compilation time&lt;/u&gt; and retains its value between calls to the function. Since it is initialized at compilation time, &lt;u&gt;the initial value must be a constant&lt;/u&gt;.&lt;/p&gt;     &lt;ul&gt;&lt;li&gt;Static variables in C++&lt;/li&gt;&lt;/ul&gt;     &lt;p&gt;It is same as in C when defined a static variable as a global variable or inside a function.&lt;/p&gt;     &lt;p&gt;When defined a class member variable as &lt;strong&gt;static&lt;/strong&gt;, &lt;u&gt;only one copy of it exists&lt;/u&gt;. It can be accessed without instantiation of the class. All instances of the object use the same variable (memory location).&lt;/p&gt;     &lt;ul&gt;&lt;li&gt;Static Functions in C&lt;/li&gt;&lt;/ul&gt;     &lt;p&gt;&lt;strong&gt;static functions&lt;/strong&gt; can only visible to other functions in the same file, so providing &lt;u&gt;function hiding&lt;/u&gt;.&lt;/p&gt;     &lt;p&gt;It is a good trick which could improve the program performance. Declaring local functions as &lt;strong&gt;static&lt;/strong&gt; tells the compiler that the function need not service any calls from unrelated modules. If the function is small enough, it may be &lt;u&gt;inlined&lt;/u&gt; without having to maintain an external copy. If the function's address is never taken, the compiler can try to simplify and &lt;u&gt;rearrange usage&lt;/u&gt; of it within other function.&lt;/p&gt;     &lt;ul&gt;&lt;li&gt;Static Functions in C++&lt;/li&gt;&lt;/ul&gt;          The differences between a static member function and non-static member functions are as follows.&lt;br /&gt;          &lt;ul&gt;&lt;li febrn="0" wssga="0"&gt;A static member function can access only static member data, static member functions and data and functions outside the class. A non-static member function can access all of the above including the static data member.&lt;br /&gt;            &lt;/li&gt;&lt;li febrn="0" wssga="0"&gt;A static member function can be called, even when a class is not instantiated, a non-static member function can be called only after instantiating the class as an object.&lt;br /&gt;            &lt;/li&gt;&lt;li febrn="0" wssga="0"&gt;A static member function cannot be declared virtual, whereas a non-static member functions can be declared as virtual&lt;br /&gt;            &lt;/li&gt;&lt;li febrn="0" wssga="0"&gt;A static member function cannot have access to the 'this' pointer of the class.&lt;/li&gt;&lt;/ul&gt; The static member functions are not used very frequently in programs. But nevertheless, they become useful whenever we need to have functions which are accessible even when the class is not instantiated.?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-2587400872437202965?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/2587400872437202965/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=2587400872437202965' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/2587400872437202965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/2587400872437202965'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2007/03/static-variables-static-functions.html' title='Static variables &amp; Static functions'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-1137996612857815540</id><published>2007-03-02T12:02:00.000-05:00</published><updated>2008-10-19T12:04:03.051-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='System Programming'/><title type='text'>Concurrency VS Parallelism</title><content type='html'>Parallelism is a subset of Concurrency.&lt;br /&gt;      &lt;u style="font-weight: bold;"&gt;Parallelism&lt;/u&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;implies simultaneous running of code (which is impossible on uniprecessor machines);&lt;br /&gt;      &lt;u style="font-weight: bold;"&gt;Concurrency&lt;/u&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;implies that many tasks can run in any order and POSSIBLY in parallel.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-1137996612857815540?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/1137996612857815540/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=1137996612857815540' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/1137996612857815540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/1137996612857815540'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2007/03/concurrency-vs-parallelism.html' title='Concurrency VS Parallelism'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-1312912140589613612</id><published>2007-02-19T11:50:00.000-05:00</published><updated>2008-10-19T11:53:33.725-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Insterests'/><title type='text'>Camera</title><content type='html'>&lt;p&gt;Basically, we define the lens of camera as follow:&lt;/p&gt;     &lt;table cellpadding="0" cellspacing="0"&gt;       &lt;tbody&gt;&lt;tr&gt;               &lt;th align="left" width="160"&gt;Lens Focal Length               &lt;/th&gt;&lt;th align="left" width="135"&gt;Terminology               &lt;/th&gt;&lt;th align="left" width="175"&gt;Typical Photography               &lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;               &lt;td&gt;Less than 21 mm                &lt;/td&gt;&lt;td&gt;Extreme Wide Angle               &lt;/td&gt;&lt;td&gt;Architecture               &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;               &lt;td&gt;21-35 mm                  &lt;/td&gt;&lt;td&gt;Wide Angle                  &lt;/td&gt;&lt;td&gt;Landscape                  &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;               &lt;td&gt;35-70?mm                  &lt;/td&gt;&lt;td&gt;Normal                  &lt;/td&gt;&lt;td&gt;Street &amp;amp; Documentary                  &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;               &lt;td&gt;70-135 mm                  &lt;/td&gt;&lt;td&gt;Medium Telephoto                  &lt;/td&gt;&lt;td&gt;Portraiture                  &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;               &lt;td&gt;135-300+ mm                  &lt;/td&gt;&lt;td&gt;Telephoto                  &lt;/td&gt;&lt;td&gt;Sports, Bird &amp;amp; Wildlife              &lt;/td&gt;&lt;/tr&gt;       &lt;/tbody&gt;&lt;/table&gt;     &lt;p&gt;&lt;a href="http://www.hash.com/users/jsherwood/tutes/focal/focal.html"&gt;&lt;span id="body-navi-sub"&gt;Fun With Focal Length!&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;    &lt;i&gt;By Jim Sherwood&lt;br /&gt;    Copyright @ Jim Sherwood 1998&lt;/i&gt;&lt;/p&gt;     &lt;p&gt;&lt;a href="http://www.cambridgeincolour.com/tutorials/camera-lenses.htm"&gt;&lt;span id="body-navi-sub"&gt;Understanding Camera Lenses&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;     "&lt;span style="font-style: italic;"&gt;... This tutorial aims to improve understanding by providing an introductory overview of concepts relating to image quality, focal length, perspective, prime vs. zoom lenses and aperture or f-number...&lt;/span&gt;"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-1312912140589613612?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/1312912140589613612/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=1312912140589613612' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/1312912140589613612'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/1312912140589613612'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2007/02/camera.html' title='Camera'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-4509229376484554068</id><published>2007-02-09T12:31:00.001-05:00</published><updated>2008-10-19T12:33:32.993-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><title type='text'>C VS C++</title><content type='html'>&lt;p&gt;&lt;a href="http://theory.stanford.edu/%7Eamitp/rants/c++-vs-c/"&gt;&lt;span id="body-navi-sub"&gt;Sorting in C++ VS C&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;    &lt;i&gt;By Amit Patel, Jan. 4th, 2000 (a long time ago)&lt;/i&gt;&lt;/p&gt;&lt;p&gt;"&lt;span style="font-family: times new roman; font-style: italic;"&gt;... When I programmed in C, I always had to choose between library routines and   hand-written code...&lt;/span&gt;"&lt;br /&gt;"&lt;span style="font-family: times new roman; font-style: italic;"&gt;... In C++, I choose (STL) library routines whenever possible. It's refreshing to finally be able to use library routines without expecting any performance penalties...&lt;/span&gt;"&lt;/p&gt;     &lt;p&gt;&lt;a href="http://unthought.net/c++/c_vs_c++.html"&gt;&lt;span id="body-navi-sub"&gt;Another C VS C++ page &lt;/span&gt;&lt;/a&gt;&lt;br /&gt;    &lt;i&gt;By Jakob Ostergaard, Feb. 24th, 2004&lt;/i&gt;&lt;/p&gt;"&lt;span style="font-family: times new roman; font-style: italic;"&gt;... I firmly believe that C++ is a &lt;/span&gt;&lt;em style="font-family: times new roman; font-style: italic;"&gt;superior general purpose&lt;/em&gt;&lt;span style="font-family: times new roman; font-style: italic;"&gt; programming language...&lt;/span&gt;"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-4509229376484554068?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/4509229376484554068/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=4509229376484554068' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/4509229376484554068'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/4509229376484554068'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2007/02/c-vs-c.html' title='C VS C++'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-5024305870254557583</id><published>2007-01-19T12:01:00.000-05:00</published><updated>2008-10-19T12:02:52.795-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='System Programming'/><title type='text'>Process VS Thread</title><content type='html'>&lt;p&gt;&lt;a href="http://blog.csdn.net/byxdaz/archive/2006/03/31/645452.aspx"&gt;&lt;span id="body-navi-sub"&gt;Process VS Thread: An Introduction (CHN)&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;     &lt;p&gt;--Cited by Sophie Che, Jan. 2007&lt;/p&gt;     An introduction of some basic conception about Multi-Process &amp;amp; Multi-Thread (in Chinese).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-5024305870254557583?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/5024305870254557583/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=5024305870254557583' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/5024305870254557583'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/5024305870254557583'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2007/01/process-vs-thread.html' title='Process VS Thread'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-6606389638176486265</id><published>2007-01-03T12:30:00.001-05:00</published><updated>2008-10-19T12:31:44.385-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><title type='text'>Programming Optimization</title><content type='html'>&lt;p&gt;&lt;a href="http://www.azillionmonkeys.com/qed/optimize.html"&gt;&lt;span id="body-navi-sub"&gt;Programming Optimization&lt;/span&gt;&lt;/a&gt;   &lt;br /&gt;   &lt;i&gt;Copyright 1996-2004 by Paul Hsieh&lt;/i&gt;&lt;/p&gt;     &lt;p&gt;--Cited by Sophie Che, Jan. 2007&lt;/p&gt;     "&lt;span style="font-style: italic;font-family:times new roman;" &gt;... This is a page about the elusive subject of program performance optimization. ... Optimization is but one of many desirable goals in software engineering, and is often antagonistic to other important goals such as stability, maintainability, and portability. ... Be cautious and wary of the cost of optimizing your code.&lt;/span&gt;"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-6606389638176486265?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/6606389638176486265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=6606389638176486265' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/6606389638176486265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/6606389638176486265'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2007/01/programming-optimization.html' title='Programming Optimization'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8742529245277406456.post-3598160728912213188</id><published>2006-12-16T11:54:00.001-05:00</published><updated>2008-10-19T11:56:54.208-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Writing Skills'/><title type='text'>Paper Writing</title><content type='html'>&lt;p&gt;&lt;a href="http://www.aresearchguide.com/1steps.html"&gt;&lt;span id="body-navi-sub"&gt;How to Write an A+ Research Paper&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Outlines the logical steps to writing a good research paper. Like the Olympic athlete aiming for the gold medal, you must have &lt;strong&gt;a positive attitude&lt;/strong&gt; and &lt;strong&gt;the belief that you have the ability to achieve it&lt;/strong&gt;. This is just the start to writing an research paper. &lt;a href="http://www.aresearchguide.com/"&gt;&lt;span id="body-navi"&gt;More...&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;     &lt;p&gt;&lt;a href="http://www.cs.indiana.edu/mit.research.how.to/mit.research.how.to.html"&gt;&lt;span id="body-navi-sub"&gt;How to do Research At the MIT AI Lab&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;    &lt;i&gt;By a whole bunch of current, former, and honorary MIT AI Lab graduate students&lt;br /&gt;    Editor: David Chapman. Sep. 1988.&lt;br /&gt;    Copyright 1987~1988 by the authors&lt;/i&gt;&lt;/p&gt;Explain how to do research&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8742529245277406456-3598160728912213188?l=sophie-notes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sophie-notes.blogspot.com/feeds/3598160728912213188/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8742529245277406456&amp;postID=3598160728912213188' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/3598160728912213188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8742529245277406456/posts/default/3598160728912213188'/><link rel='alternate' type='text/html' href='http://sophie-notes.blogspot.com/2006/12/paper-writing.html' title='Paper Writing'/><author><name>瞬...</name><uri>http://www.blogger.com/profile/08130938292479634191</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_VV80-JZKIIw/SPtWU6dJ4uI/AAAAAAAABQU/vm7rT5oEI9c/S220/12.jpg'/></author><thr:total>0</thr:total></entry></feed>
