Apr 15, 2009

Change Blogspot Title for SEO

Background

What is SEO? It is short for “Search engine optimization”. It’s the process of improving the volume or quality of traffic to a web site from search engines via “natural” (“organic” or “algorithmic”) search results.

Typically, the earlier a site appears in the search results list, the more visitors it will receive from the search engine. As I place Google Ads in my site, of course I wish it appear earlier from Google’s search results. Changing Blogspot posts’ titles is a trick to achieve this.

Blogspot Title

The default title of Blogspot post title is “Blog name” followed by “Post name”. As the search engines crawl the pages from left to right, and our keywords of our posts are usually the post names, the rankings of our blogs will decrease with the default settings. My post “墙东柳: 展喜犒师” appeared in the FIFTH page of Google search results. OMG!!

What to do?

Before modifying the title:

blogspot title, blog name first, SEO

After modifying the title:

blogspot title, post name first, SEO

How to do?

From your blog Dashboard > Click on "Layout"> Click on "Edit HTML">, and find the following code:

<title><data:blog.pageTitle/></title>

and replace it with this code:

<b:if cond='data:blog.pageType == "item"'>
<title><data:blog.pageName/> - <data:blog.title/></title>
<b:else/>
<title><data:blog.pageTitle/></title>
</b:if>

You are done! And now your post titles will be like this:

“Post name” - “Blog name”

Apr 5, 2009

C++ Program Development Phases [note on C++ How to Program - 02]

C++ programs typically go through six phases: edit, preprocess, compile, link, load and execute.

CPP program development phases 

Preprocessing and compiling

In phase 2, the programmer gives the command to compile the program. In a C++ system, a preprocessor program executes automatically before the compiler's translation phase begins (so we call preprocessing phase 2 and compiling phase 3). The C++ preprocessor obeys commands called preprocessor directives, which indicate that certain manipulations are to be performed on the program before compilation. These manipulations usually include other text files to be compiled and perform various text replacements. In phase 3, the compiler translates the C++ program into machine-language code (also referred to as object code).

Preprocessing occurs before a program is compiled. Some possible actions are inclusion of other files in the file being compiled, definition of symbolic constants and macros, conditional compilation of program code and conditional execution of preprocessor directives. All preprocessor directives begin with #, and only white-space characters may appear before a preprocessor directive on a line. Preprocessor directives are not C++ statements, so they do not end in a semicolon (;). Preprocessor directives are processed fully before compilation begins.

The formats of preprocessor directives are described as above. There are several kinds of preprocessor directives, like the #include preprocessor directive and the #define preprocessor directive.

Linking

Phase 4 is called linking. C++ programs typically contain references to functions and data defined elsewhere, such as in the standard libraries or in the private libraries of groups of programmers working on a particular project. The object code produced by the C++ compiler typically contains "holes" due to these missing parts. A linker links the object code with the code for the missing functions to produce an executable image (with no missing pieces). If the program compiles and links correctly, an executable image is produced.


Comments

Every program should begin with a comment that describes the purpose of the program, author, date and time.

Besides the normal comments dedicated to the methods, variables, or certain lines of codes, we should also add comments at the top of the source code describing the purpose, author, date of the program. Without these, you may totally donot know what the program is about when you revisit it after a long time. I ever experienced this embrassing scenarios, so I will keep this in mind from now on.

C++ How to Program (5th edition) notes - 1

I've been unsatisfactory with my coding skills (esp. C++) for long. Being lazy, and having no assignment on C++ projects, I have been live without C++ programming since about 2 years ago. This life need to come to end. And I'm gonna read the book C++ How to Program (fifth edition) to restore my C++ knowledge. The cover of this book is shown as below.

 C++ How to Program (fifth edition) cover page 

As I am not a totally newbie to C++, I will not read this book chapter line by line. Similar, in this notes I will only keep down the parts that I am currently not familiar with, and those that I think is valuable enough.

This book has more than 1000 pages. So, it will be a long-term project to go through it. I will just try to check it out whether I am able to finish it or not. It's the journey's starting point today, 2009-04-05.

BTW, if anyone need the ebook, just leave me a message. I will upload it to a free hosting site so you can get it too. :)