devxlogo

Tip Bank

Hide Data and Implemention Details

Consider the following class: #include “OtherData.h”class MyClass { OtherData m_data;public: bool func(OtherData data);}; It seems as though this class hides its implementation details efficiently, but is actually doesn’t! The user

Changing the Locking Scheme on a Table

Using the right type of locking on tables is very important to ensure application scalability. Based on the data access pattern, you’d select either Data Page lock or Data Row

Grabbing Pixels from an Image

This tip shows you how to extract the pixels from an entire image or from a piece of an image. The following code shows the PixelGrabber class: PG=new PixelGrabber(IMG,0,0,L,H,pixels,0,L);try{ PG.grabPixels();}catch(InterruptedException