Saturday, April 29, 2006

Prog: CPP Sensitivity

April 28, 2006:

I learned that sometimes we just can't transfer our C++ VS solution to a new machine and use it. For some unknown reason, function calls were messed up in my case. I called wrong functions; for example, my code called the function A(), but when I ran and debugged, it called B() instead. If we encounter the similar case, just try recompiling each project one by one.

Wednesday, April 12, 2006

This Week: April 10 - 16, 2006

Monday: Learn parameter-passing method for dynamic array. We need to force casting in some way, but the function signature is always float* arInput, const int SIZE.

Tuesday: Learn how to read data from binary file and learn how to save binary data to file. In reading, we cannot flush the buffer, just read again and overwrite the old data. In writing, it is much faster to perform large write (write multiple bytes). Moreover, we don't need to flush data. See Convolver class (xConvolve function).

I also learn that casting is a time consuming task. If we can provide compatible variable types, we might want to consider provide one as much as we can. It reduces running time significantly.

Wednesday: I encountered a strange problem. I cannot promote a protected member function to a public one. It causes linking problem in other projects using a library with the promoted function. I have to avoid the problem by deriving the class and build an interface to provide a way to call the protected member as a public one. I did it in VesselTreeUtilities by providing the same function name and signature. To create the function we can do it as follows:

float***
VesselTreeUtilities::init3DArrayFloat( int nNumSlc, int nNumRow, int nNumCol ) {
return CommonCore::init3DArrayFloat( nNumSlc, nNumRow, nNumCol );
}

Tuesday, April 04, 2006

Tech: Shear Transformation in Illustrator

April 4, 2006

I tried to use draw an isometric grid with some text in it. Kun-Chang suggested me to use Illustrator to draw a grid, but he did not know how to call shear transformation feature in it. In short, we want to draw a rectangular grid and shear transform it to an isometric one.

To draw a rectangular grid:
  1. Show a grid (in top menu bar)
  2. Snap to grid (in top menu bar as well)
  3. Draw a grid easily as you want
To call the feature, do not use the top menu bar, but right click on objects you want to transform, instead. We can do multiple transform by dragging an area of interest as usual. Then, choose Transform -> Shear. Next, select shear angle. The good one is 20 degree.

When export it for later use with other document, we'd better use somewhat high resolution to do that job.

Monday, April 03, 2006

Latex: \left\{ and \right.

ตามปรกติแล้วเวลาใช้ \left\{ มันจะต้องไปกับ \right\} แต่ว่าบางทีเราก็ต้องการจะเขียนแค่ \left\{ จริงๆ

ปัญหาแบบนี้แก้ได้ด้วยการใช้คำสั่ง \right. เพื่อเป็นการแจ้งกับ LaTex ว่าเราไม่ได้ลืมปิด แต่เราไม่ต้องการใส่มันเข้าไปจริงๆ