About

Readcode.org provides a place for every developer around the world to read Opensourced code, share their thoughts through writing comments.

Readcode.org tries to help developers understanding the code in various ways.

News

kdebase-4.1 and kdelibs-4.1 are added

Tue, 26 Aug 2008 20:19:00 -0600
Recently, I've done some work related to kde4, porting Google Gadgets for Linux to KDE4's plasma.

As a long time user of KDE(ever since kde1.x), I love KDE and I am very glad I have the chance to contribute to it. Maybe you want to contribute too. Well, now you can read the source code easier because I've hosted the code of kdelibs and kdebase on this site. Go read the code and write your own!

ps:
I didn't work on this site for quite a long time. It's bad. There are still a few tiny improvements that are easy to add. I'll get them done ASAP.

As for the advanced features like keeping the call-stack while reading code, I am not sure if I have time to work on it. I really hope someone can join me. Don't forget this site is opensourced. You can always get the source code at http://code.google.com/p/readcode and contribute.

A simple but useful improvement

Wed, 16 Jul 2008 00:54:00 -0600
ReadCode uses lxr to analyze source code. So far, the result is quite good except with c++ codes which contain "namespace xxx {".

lxr analyzes code in following steps:
1. find out all global symbols
2. find out all the references by simply matching the name

To find out all global symbols, lxr strips all "{ code we don't care }". lxr removes these codes because global symbols can't be defined between pair of "{" "}". But it's not true with pair of "namespace xxx {" and "}". So when dealing with such source code, lxr strips all except the namespace. So the only global symbols found are the name of the namespace.

Well, it's easy to fix. In first step, before doing the strip job, I used a regular expression to change "namespace xxx {" to "namespace xxx;".

With this fix, symbols with a namespace can be found out.

Get the source code of ReadCode

Mon, 30 Jun 2008 00:23:00 -0600
Hi,

I've planned to release the source code of ReadCode for a long time. Actually, it has been a open project for quite a long time because it's a project hosted on Google Code. But I didn't announce it officially because I wanted to do it after rewriting the ugly Javascript code.

Now, the rewriting is almost done. So here it is:

http://code.google.com/p/readcode/

I hope you will find it useful.

--
Tiger

ReadCode 1.5 is live

Mon, 30 Jun 2008 00:13:00 -0600
Hi all,

After a few weekends' hacking, ReadCode 1.5 went alive. You will see the UI has been totally rewritten. I've planned to use GWT to rewrite the UI but because I don't know much about Java and I found Ext is so easy to use, so eventually it's the Ext that did the work.

Ext library is too big, almost 0.5 MB. And it's said it has a bad license. So GWT is still a valid option in the future.

Although the loading time increased a little, well, a lot to be honest due to ext's size, the overall user experience was dramatically improved. Try it out here: code2.

A few bugs are fixed also. But I don't have enough time to reimplement the code analyser.

There are still features not finished, like bookmarks and comments. I'll add them soon.

--
Tiger

Readcode 1.5 is coming

Tue, 27 May 2008 22:21:00 -0600
Hi all,

I don't know how many you are. I would like you know that I am working on Readcode 1.5 ( The version you are using is 1.0). Although I don't have much time to work on it, I will manage to release it in next two weeks.

The main feature of the new version is Ext powered UI. Ext is so cool that I can implement a UI at will. The new UI will be very easy to use and very powerful:)

OK, keep your eyes open. Great thing is coming.

Regards,

Tiger

What a day, everything break!

Mon, 18 Feb 2008 23:28:00 -0700
Today is a bad day.

In office, I found the unit test broken. I spent hours and failed to fix it.

Then I worked on other things. I needed to read some code. So I came here. Bang! This site was broken too. It was caused by that the host provider has upgraded to rails 2.0. No problem, I can fix it when I was home.

When I got home and turned on my notebook. Ubuntu panic on my face! Damn it. I didn't upgrade kernel. How can it happen? I spent two hours on it in vain:(

Fortunately, I got a PC with my old faithful Debian installed. So I could checked out the code and got it fixed.

What a day!

Rewrite the UI with GWT

Thu, 06 Sep 2007 02:30:00 -0600
I was scared away by GWT(Google Web Toolkit) about half a year ago because it's labeled Java and I was worried if I could find a virtual host which was fast enough to support Java.

But I just found out it can be a pure client side technology. I played with GWT for about an hour tonight and found it amazing. So a quick decision is made that I am going to rewrite the UI with GWT. The backend should remain Rails.

Cool, isn't it?

History works now

Mon, 27 Aug 2007 00:48:00 -0600
The "Backward" and "Forward" buttons of browser don't work with this site because Ajax is used, which means you can't jump back to the code you just read. This turned out to be unbearable during using this site to read code.

So I have to write a few lines of javascript to simulate a history mechanism. It's ready to use now. Have you noticed the two arrow buttons on top of this site? That's it. Enjoy!

Unfortunately, this function doesn't work with IE6 or older very well.

A few important features to be added

Thu, 02 Aug 2007 01:39:00 -0600
You may or may not notice, there have been a few new features added.

  1. The id list on the left side supports folding now. But because the code has to been regenerated, currently only new uploaded projects support these.
  2. The other is when searching for a identifier in a source file, javascript will try first to find the identifier in current file. If found, the remote server will not be bothered.
With these features added, a few new bugs exposed. I'll fix them once I get time.

And I realize there are a few features that are critical to the usability, which are:
  1. Currently, backward/forward don't work because of AJAX. It's unbearable.
  2. When searching for identifier's reference, the caller function name should be presented.
  3. When doing asynchronous operation, there should be an indicator, otherwise, users will be confused.
Well, they are on top of my todo list now:)

Gears Ready!

Sun, 15 Jul 2007 00:56:00 -0600
Ha, readcode.org now equipped with Google Gears. The code you have browsed and the identifier search you have done will be stored on your local computer and you can revisit them on the fly.

I've implemented "recent files" function with cookie. But this function was never enabled. This time, I replaced the cookie version with the "Gears" version. Try it:)

Bookmark is ready, wow!

Sun, 01 Jul 2007 01:58:00 -0600
I just uploaded the new code. Now you can enjoy the bookmark function. Please be gentle as this part of code is not well tested:)

And a lot of cleanup of the code, especially the Javascript part. I hope when I feel ready to release the code, it won't be too ugly to scare the users off:)

Well, I am back again:)

Sat, 23 Jun 2007 18:00:00 -0600
You can not blame me for not updating during last month. I just got a new job and bought myself a Wii. So how could I spare my precious time on this site? :)

Two days ago, I uploaded other two source code, apache2 and pidgin( Once known as Gaim). And I am working on bookmark, hoping it will be ready by next week.

Remember I said I planned to deploy Domstorage on this site? Well this kind of technology is getting so popular and so important. Now they call it "local web application". My plan changes a little bit. I am going to use Google Gears instead of DomStorage.

One more news, after cleanup the code, I will opensource the code behind this site. I don't know how useful it will be but at least you can replace lxr with it:)

Several Javascript bugs fixed

Thu, 26 Apr 2007 02:52:00 -0600
Tonight I fixed a few "bugs" to make this site usable to IE. There are still many things need to be fixed or improved but I gotta sleep now. After more than one hour swimming, I long for a good sleep:)

BTW, I will add another project tomorrow: firefox, my favorite browser. I bet its code is very fun. Enjoy!

One more thing, I will use RSH(Really simple history) to make history and bookmark more usable. And I will use domstorage to reduce the unnecessary traffic. Coming soon....

Not working with IE, First comment.

Mon, 23 Apr 2007 13:55:00 -0600
I will fix it by the end of this week. For IE users, I strongly suggest you switch to firefox.

And some other bugs found, mainly related to javascript. Hopefully, I will have enough time to fix them all in next few days. If you find bugs or something need to be improved, please let me know.

And I found the first comment written by a visitor. Check it out in case you haven't notice this function:)

http://www.readcode.org/code#linux-2.6.20/arch/i386/lib/bitops.c

Big update, finally!

Sat, 21 Apr 2007 03:44:00 -0600
Almost as I said in last post but:
  1. I didn't find way to combine static content and dynamic content into one response. So every time you ask for a source code, two requests are made.
  2. Comments are not populated to Google Base yet.
TODO:
  1. bookmarks and personal notes.
  2. function call trace analyze.

Squeeze out performance as much as possible

Wed, 18 Apr 2007 00:49:00 -0600
People don't like sluggish websites and Readcode is not going to be one of them. To avoid to be sluggish, I have done or am doing the following:
  1. Store user comments, some meta information in BDB and other meta information in MySql.
  2. Populate these comments to Google base periodically.
  3. When retrieving comments, browser tries with Google base at first. If not found, BDB will be used. Never retrieve comments from MySql.
  4. Generate static pages for every source file and zip it off line.
  5. When browser requests a source file, the static zipped page is returned. It implies browser loads source file in an AJAX way. It also implies extra work to keep the original URL scheme work.
  6. When browser loads a source file, there is not only static zipped content but also dynamic content. I don't want to send these two in two separated responses. How to combine these two together with effort as little as possible is issue I am working on.

You can register now! But ....

Wed, 28 Mar 2007 02:46:00 -0600
As you may noticed, you can register now. But more polish is needed( Well, I am not a professional web geek, yet:)

And you can see by clicking on the line number preceding every line of code, comments is retrieved from Google. But you can't submit comments at this moment.

In last 3 weeks, I could hardly find time to work on this site. So little progress has been made. But tonight, I went back. Here is the features coming soon:
  1. Submit comments, of course.
  2. Make "user login" more professional.
  3. I played with window.js a few days ago and tonight I made a good use of it on this site. You will see it in next week with above two. I hope you will like it.
  4. If I have enough time, I am going to generate static pages for all source code so the performance could be boosted.
  5. Make this site as pretty as possible.

Update: IE6, comments and user register

Sun, 11 Mar 2007 00:34:00 -0700
No update for a long time.

Two or three nights were spent with IE6. I've no idea why my javascript can't work with it while it works with IE7, Firefox and konqueror. So I gave up, tired and disgusted.

As I said in previous post, comments will be stored in Google base. The code is finished and works well during my test. I just hope google will keep up with its great work.

Coding of "User register" is done. After a little more test, it will be put into work, together with "comments" module.

Of course, there will be some other tiny fixes/improvements. Hopefully all these will be done in next week.

Trouble with feed of blogger.com

Wed, 07 Mar 2007 19:15:00 -0700
I spent last whole night with Blogger's feeds.

Blogger used to generate two feed files for me, one is in RSS format, the other ATOM. But two days ago, I found the two files turned to be the same, all ATOM format.

I have a cron job running on my site to generate index.html from the RSS feed file. This is done by a ruby script and ruby has no preinstall ATOM parser. So the script can't cope with ATOM feed file and my index.html is gone( I know the script should not remove the original index.html if it can't generate a new one. But ...).

After fighting with blogger's dashboard and asking for help on forum, I found a easy and straight way. Why not just transform the ATOM file into a RSS file. So here it is:
http://atom.geekhood.net/

Now I added a step of xsltproc to do the transformation. If I don't make anything wrong, this post should show up on the frontpage tomorrow. Just wait and see:)

Google base as database backend?

Mon, 05 Mar 2007 22:04:00 -0700
I've played with Google base in last few days. I am going to use it as my database to store the comments. The result of my experiments is quite good. But I still have concern about some issues.
Anyway, if I could make it work, I will not have to worry about the storage and computation capacity of my site in near future.

Great things are coming, hopefully:)

Wed, 28 Feb 2007 12:14:00 -0700
Two purposes for this post.
  1. As mentioned in title. I am working on features of "user login" and "comments share". They should be done in two or three weeks. Once finished, you can register an account and then write comments on every line of code hosted on this site. The comments are shared with others and has version control.
  2. I have setup a cron job to generate the index.html file. If it works, this post will be automatically populated to index.html at the end of today.
  3. I want to know your opinions like what functions you want, what source code you want etc. Any kind of opinion is welcomed no matter it's praise or praise:)
Finally, have you heard this saying, "There are three kinds of people in the world, one can count, the other not":) Have a good day!

Update: IE support, File and ID search

Thu, 22 Feb 2007 03:37:00 -0700
I am a little behind the schedule. Till now, I haven't gotten my hands in "user_register" module. For me, everything is almost new and I have to learn and make some experiments.

But still some progess for you:
1. Now IE can render the site more friendly. I'll stop with it.
2. File and ID search is ready. And it's ajax-able:)

I found myself kindof like javascript now. But I still think all of the web development needs more polishment. So many details should be hidden from developers like me. GWT from google seems promising, but it relies on java. We need a more general solution.

Damn it, IE is not out of consideration, yet!

Tue, 20 Feb 2007 13:58:00 -0700
From the log, I see about half visitors are still using IE. So they can't view readcode.org correctly. What a sad fact! So I have to do some dirty jobs to make the site work with IE, at least make the layout work with IE.

The other planned feature of readcode.org require "dom storage". It's said mozila, firefox, safari and opera will /do support this functionality, but IE is not on the list.

So if you are still using IE, I suggest you switch to alternatives like firefox and opera. It will really make our web world better.

reacode.org alive now!

Fri, 16 Feb 2007 12:09:00 -0700
Although missing a lot of features, I am still very excited about this. In the following 7 days, I will have plenty of time to improve it. Here is the todo list:
  1. Rework the layout and javascript. Now they are messy and I hate that.
  2. File and identifier search
  3. User register( So you can save your bookmark online)
I have to say I am not good at web dev. So please be patient. I do have some good ideas for you:)