1. To define a static array in C++, we must not make it too large, ie int[512*512], because the simple memory allocation cannot do that.

2. To work with matlab compiler, make sure that we include libraries that corresponding to our compiler version. Matlab prepares libraries for every famouse compilers and we need to recompile the old .m file as well.

3. Suffering from using C++ is common if we do not sacrifice some performance for flexibility and convenience by using STL. Study it and use it in regular basis. The loss of performance will not hurt you as much as the loss of time.

Tuesday, February 22, 2005

1. Add ContentsStarting from adding a directory to CVS, we can add all of its contents recursively to ourCVS repository buy using 'Add Contents' in Tortoise CVS interface.

2. TaggingI guess this is for naming and clarification purpose only. The result, however, will appear in a revision graph and look really nice. One of the main use is to make a tag to several files at the same time. This can make a meaningful custom revision number. For example, if we have three files: file1, file2 and file3 and their revision number 1.11, 1.5 and 1.4 respectively and we want to make note that those three files with the revision numbers are in the same release or at the same milestone in our development, we can issue the same tagg to all the three files.

Note for TortoiseCVS: If we want to update by tag name reference, we sometimes need to update the tag lists before it's available in the GUI. To get the copy by another method such as graph or history, 'update list' is generally unnecessary.

3. AnnotateI am still unable to fully understand it, but this can show us history of each line!!! It displays developer's name whose contributes to each line and revision number that makes the latest change on the line.

4. Branching/MergingThis feature is so confusing. But the guideline of usage is that we can create a branch and then merge it back and commit. If we commit before merging, it will go to the main development line (line before we make a branch). I, however, cannot stop branching and merge everything back to the HEAD development line. In addition, the revision number counting is strange. It show four numbers, not three. Sth. must wrong.

Hey, after some study, I found that the number is correct. If we make a brach from revision 1.5, we will get a branch with revision number 1.5.2.1. The number is in this way because there is internal running number too (main version may be 1.5.1.1).

Another noteworthy stuff is that if we make a mistake about a file and cannot do anything useful with that, we can delete it and use cvs update in the directory to get the file back with fresh start. If the result from the update is not satisfactory, we may use 'update spacial' to specify a branch name for that file. BEWARE: If we use update special to a directory with 'clean copy' option, every file that is not related to the branch in update special command will be deleted.

Then, how to go back to the main development line? When we finish doing something in a branch, we want to go back and make a new revison in the main line. To go back, first make sure we commit any good change to the repository. Second, use 'update special' to get the main branch copy. Third, merge the branch and solve conflict if any. Then, we will see that the file is modified after the merge. If everything is okay, we can commit the change safely. Note that if we make a merge when we are on the branch, the later commit will appear on the branch, not on the main line. In other word, if we want to make new revision at any development line, use update special to get the line and issue commit when appropriate.

Sunday, February 20, 2005

วันนี้ทดลองใช้ระบบกู้คืนข้อมูล ของ cvs ดูพบว่าทำได้ดีมาก เราสามารถที่จะเลือกกู้จากจุดใดก็ได้ที่เคย commit ไว้ ไม่จำเป็นต้องเป็นจุดล่าสุด ซึ่งทำได้ดังนี้1. Right click at the file we want to restore, go to cvs menu and choose 'history'.2. Dialog will pop up and we will see every revision we commited. Right click on a revision we prefer to get a pop up menu. Please read 3 before you move on.3. There are 'Get this revision (sticky)' and 'Get clean copy of this revision (sticky)'. If we select the first option, we will get the mixture of our current uncommitted edition and the committed one (if no conflict involved). If we choose the second option, we can obtain the fresh start over (or fresh new version).

Explaination: The first option is designed for update/merge, not start over. For example, someone may check out the same file and commit new version. If we want to get the new version without manual copy-paste for update, we can try the first choice. Note that manual copy-paste may be required if there is conflict between committed and uncommitted one.

For second option, we can make a start over at our current option. In case somebody committed new version and we want to retrieve the new one, if we want to throw our uncomitted change away, choose the second option. That's why I said we can both restore or get new version.