Saturday, September 29, 2007

Milestones of My Blog

Following is the list of the milestones associated with this blog, in chronological order (as in date format yyyy-mm-dd). Since today is still in the month I created this blog, therefore I (or others?) can easily look up this blog in the future. Only time can tell whether this blog will prosper or diminish.

  • 2007-09-17: blog setup.
  • 2007-09-18: 1st post.
  • 2007-09-30: Google indexed this blog.
    • Google Blog Search seemed to include Blogspot blogs immediately after posting (with no surprise) . On the contrary, this blog has almost no trace on other blog search engines in the first one or two weeks.
    • Just for record, I submitted the correct sitemap to Google on 2007-09-24 and the sitemap was verified several minutes later. However Googlebot seems to have its own mind on when to index new sites (of course, there are hundreds of factors and maybe millions of code related to how this crawler work: this is anyway the bread and butter of Google) , no matter how anxiously and frequently I visited Webmaster Tools and also typed site:*** in Google search box. After some frustration with the long delay to index, I also tried to submit the blog to Yahoo. It's very interesting that just after the submission, the blog related search results just magically appear. Bingo! It seems that the bot was pushed by the competition (although the site was actually crawled 23 hours ago but just shown up in search results).Google Search Results
  • 2007-10-10: first comment from aspir8or (very constructive comment!).
  • 2007-12-02: 1st post marked by others.
  • 2007-12-24: post Weirdness of Erlang emerged in programming.reddit, and number of daily visits (according to Google analytics) is 306.
  • 2008-01-17: 1st authority point in Technorati.
  • 2008-01-30: first post to achieve page rank 2. Actually this is the first time my blog posts are credited with page ranks in Google dance. I discovered this by investigating "Crawl Stats" page in Google Webmaster Tools. It is interesting to note that the homepage of the blog itself does not have any page rank (even 0).
  • 2008-10-08: 10 Google Reader subscribers.

Note: this is a live document, therefore stay tuned for the new exciting events showing up!

Friday, September 28, 2007

Necessary Manual Changes to Blogger Template

I'm trying to be a minimalist if possible. Therefore when writing blogs, I'm using the new template instead of the classic one. I manipulates the page elements instead of directly change the html code, resisting temptations of adding cool features which requires modifications of template by hand. However there are still some nice stuff mandating such modifications. I will list them below in case I change my template in the future (I'm pretty satisfied with my current template, Stretch Denim Light, though). Since I'm really annoyed by these "hacks", in the list below I also discuss the possibility to eliminate them in the future.

  • Google Analytics code
    • Usage: analyze the visitors to your blog via web browsing.
    • How to change: just add the html code provided by Google immediately before the end body tag.
    • Possibility to remove this hack: possible. Once I have tried to implement this in the page element "HTML/Javascript", but Google Analytics failed to collect data since then although the status is still OK ("Receiving Data"). After I switched back, everything went fine.
  • Google Webmaster Tools verification tag
    • Usage: to prove to Google that you are the owner of your blog therefore Google can provide statistics data from its crawler for your blog. Even after successful verification, you still need this tag since the verification is done continuously.
    • How to change: just add the metatag provided by Google immediately after start tag head.
    • Possibility to remove this hack: seems difficult since the verification tag is always required.
  • Yahoo Site Explorer verification tag
    • Usage: the purpose is same as Google Webmaster Tools above.
    • How to change: just add the metatag provided by Yahoo immediately after start tag head. It seems that the tag provided by Yahoo is considered "not well-formed" by Blogger, therefore you need to add "/" before the end ">". Whether you place Google or Yahoo verification tag first is simply a judgment call.
    • Possibility to remove this hack: similar as Google.
  • Ad Sense between Posts
    • Usage: Google has issues on integrating Blogger and Ad Sense for some users (including me), therefore manual change to template is needed to display ads between posts.
    • How to change: just follow this tip. Refine the code and put it before "post-footer-line".
    • Possibility to remove this hack: hope Google can fix the issue soon.
  • Align header text and image
    • Usage: center the title, description and header image.
    • How to change: just follow this tip.
    • Possibility to remove this hack: if Blogger can support configuration of page header.
  • Add CSS for Code
    • Usage: provide uniform style sheet for code.
    • How to change: add the style sheet for div in the header.
    • Possibility to remove this hack: unlikely. Such customization should not be present in common template.
  • Display Permalink
    • Usage: In the footer of each post, Blogger shows the timestamp, which actually points to the permalink. This is rather confusing.
    • How to change: Based on this permalink tip. Check "Expand Widget Template", search through the template, between the end tag of "data:post.timestamp" and end tag of "abbr", insert " | Permalink". The operation is shown in figure below.Change Permalink
    • Possibility to remove this hack: yes. Maybe Blogger will improve the template?
  • Flash Tag Cloud
  • AddThis button
  • Use internal CSS

Wednesday, September 19, 2007

Learn Prolog Inside Lisp

Originally Prolog is not the first priority in programming languages I intended to learn after Lisp. But during reading along the Prolog chapter in On Lisp, I realized that Prolog is really an interesting language. Therefore I downloaded swi-prolog, update Emacs with more powerful prolog mode, and started to follow one Prolog tutorial.

Suddenly I realized that it might be better for me to learn Prolog inside Lisp. The implementation of Prolog presented in On Lisp is already quite powerful (provided the functionality like cut, is, and especially the ability to integrate with Lisp functionalities). Therefore I could try the examples in Prolog tutorials/books both in Prolog (as reference) and Lisp. If there are some Prolog functionalities that are not available in the Lisp implementation, I can try to implement them if possible. Sounds quite interesting.

Visitors

I just setup this blog in recent days and was curious about who will visit my blog. So I setup account for Google Analytics and inserted the javascript code in my template.

No surprise, the only initial visits come from myself when I looked at report from Google Analytics yesterday. Although I do not expect the situation would change, I investigated the report again today and found that there are visitors other than from China. I was somehow pleased until I realized that those visits are from search engines.

Tuesday, September 18, 2007

Performance vs. Productivity

Programming languages rank differently in terms of performance and productivity. Performance here mainly means the running speed of the application while productivity is related to the consuming of developer time.

Some languages are quite good at performance and bad at productivity. C/C++ is in such category. It is quite difficult to beat C/C++ in terms of performance (I know that in Language Shootout, Ocaml, Haskell and other language can beat C/C++ in some fields). However the development cycle of C/C++ is awful. Write some code, compile it, test it, debug it. The whole development cycle tends to diverge the developer's mind hither and thither, let alone the compilation time of C++ is also quite long.

Other languages are quite good at productivity and bad at performance. Ruby and Python are nice examples of this category. They have nice interpreters to easy the development cycle, yet the generated code is quite slow.

Lisp is somehow different. The productivity is high thanks to REPL. The performance is also not bad. The speed of raw code cannot match that of C/C++. But with careful declarations, the performance of Lisp is not far from C/C++. Note that you only need to optimize the hot spot code.

So which one to choose? It depends on the application type and also on the customer. For system software like OS, C is the preferred choice. The speed of the end product is crucial here. For web applications and scripts where speed is not a key issue, Perl/Python/Ruby are used extensively.

How about numerical simulation? We are desperate for speed. On the other hand, we ourselves are the customers of the simulator we write. Our productivity is mainly related to the time for developing the simulator, not the actual running time. Actually during the long simulation run, we have other issues to do: brainstorming, writing documentation etc. Therefore the language with high productivity while acceptable performance seems to be a good choice. That's probably why MATLAB is so popular in the community. Lisp seems to be good too but rarely heard of.

Learning by Watching

Typically learning is by reading books. But recently I find watching is of great help. Watching here means watching the lecture videos.

I have an obsession when reading technical books: I should not start a new section if I have not completely understand the previous session and finished all the exercises there. Such obsession haunted me so severely that sometimes I tries to browse later chapters just for fun. Indeed this kind of obsession is quite harmful for reading: it is quite difficult for me to read through the whole book. It should be noted that in many books, the later part normally contained advanced topics, which I miss.

Watching video is another story. I'm now trying to learn SICP but my obsession just stopped me before finishing chapter 1. However I have also download the video lectures. Watching video lectures does not impose any obsessions for me. Actually it is very interesting when I'm sitting in a shuttle bus or in public transportation. I just feel that it is rather easy to comprehend the video. It seems that I may finish watching all the videos quite early before completing the book.

Just hope all the great books have video lectures.

Languages to Learn, Books to Read

Following is a list of programming languages I intended to learn in the future, including those I'm already learning or have learned. The list is in particular order.

  • Common Lisp/Scheme
    • Implementation: SBCL/PLT-Scheme
    • Lisp is fantastic once you have started. The parenthesis syntax is simply beautiful: simple yet powerful. I started to touch upon Lisp (actually Elisp) in last year, with the intention to be able to configure Emacs in a more free way. Unfortunately I still have not finished the Elisp introduction document which accompanies Emacs distribution and I will finish it in the near future. Afterwards I was attracted by Haskell and devoted nearly half a year to learn it, with the focus on migration my C++ simulator to Haskell. Early this year, when I was browsing reddit as usual, I found this post, which proposed the analogy that hacking Lisp is like riding a bike. I was curious about such metaphor and decided to try myself. And the result is that I'm now a big fan of Lisp. I've almost translated all my Haskell code to Common Lisp, migrated many C++ files too, and added many new functionalities to my simulator. Lisp is just wonderful! It really grows into you. I have read Practical Common Lisp (although I skipped almost all the practical examples and will come back to them later), and now nearly finished On Lisp.
    • Book list for further reading
      • SICP: a must read. Free book available. The video lectures are of great help too.
      • PAIP: I'm also interested in AI and also a fan of Peter Norvig. So I may purchase this book although it is somehow expensive.
      • Object-Oriented Programming in Common Lisp: A Programmer's Guide to CLOS: I use CLOS a lot and like to be shocked by the book.
      • AMOP: A fancy text I heard of.
      • Lisp In Small Pieces: A must read for Lisp/Scheme implementation.
      • Lisp 1.5 Programmer's Manual: Definitive manual for ancient Lisp?
      • Ansi Common Lisp: This book might not be so advanced compared with books listed above, but I really like the articles/books from Paul Graham.
      • Other nice scheme books, especially the series: The Little Schemer/The Seasoned Schemer/The Reasoned Schemer, and How to Design Programs.
  • Oz
    • Implementation: Mozart
    • It seems that Oz encompasses almost all the programming paradigms therefore it would be nice to try.
    • CTM seems to be the book to try.
  • Ruby
  • Prolog
    • Implementation: swi-prolog
    • Another AI language. It seems that many Lisp books (e.g. On Lisp, PAIP) try to build a Prolog interpreter/compiler and then use it to solve problems. It might be of great fun to directly dive into Prolog.
  • Smalltalk
    • Implementation: Squeak
    • Quite shocked during the first use of Squeak 3 years ago.
  • Erlang

#1 Post

About half a year ago, I opened my first blog in Donews, but I only posted a few articles after registration. Now I decided to switch to blogger, mainly because I'm a fan of Google and really like the attractiveness of integration of various services provided by Google.

For this particular blog, I may post either in Chinese or English, depending on my taste :-) Hope this blog can open my mind to pop out things out, hopefully nice things. And I may post several articles in a row today to test my passion.