Saturday, January 31, 2009

Classes in C++

The concept of Classes in C++ can be explained by a simple example from [Stroustrup, 1980]

class stack {
char s[SIZE]; /* array of characters */
char* min; /* pointer to bottom of stack */
char* top; /* pointer to top of stack */
char* max; /* pointer to top of allocated space */
void new(); /* initialize function (constructor) */
public:
void push(char);
char pop();
};

A user-defined data type which specifies the type of class members that defines an object (rep. of a variable of the type) of the class, the set of functions that manipulate such objects, and access users have to those members.

Member functions are defined elsewhere,

char stack.pop()
{
if (top <= min) error("stack underflow");
return *(--top);
}

Objects of class stack can now be defined and used,

class stack s1, s2; /* two stack variables */
class stack *p1 = &s2; /* p1 points to s2 */
class stack *p2 = new stack; /* p2 points to stack object allocated on free store */

s1.push('h'); /* use object directly */
p1->push('h'); /* use object through pointer */

Technorati Tags: ,

del.icio.us Tags: ,

Friday, January 30, 2009

Using USB Flash memory as Extra memory to speed up your computer at NO additional cost.

Windows Vista

VistaReadyBoost, is one of the many cool features in Windows Vista. ReadyBoost enables you to plug a USB external flash drive as extra cache in your computer and have Windows Vista use it as additional memory.

How does this work?

Once you insert a USB drive you will get an AutoPlay dialog like the following,

ReadyBoost_AutoPlay
Select “Speed up my system” option (or) Open the Computer explorer, right-click the drive (D: in this case) and select Properties. Navigate to the Ready Boost tab.

readyboost_options2You can choose to allocate part of a USB drive's memory to speed up performance and use the remainder to store files.

Windows XP

WindowsXPIf you are using a Windows XP always craving for extra memory to feed your applications, here is a cool way to speed up your computer with extra memory with no additional cost.

Here is how you do it,

  • Insert the USB flash drive
  • Open the Control Panel
  • Select the System tab (or) type “sysdm.cpl” in Run dialog
  • Navigate to Advanced tab
  • Select Settings under Performance section
  • Navigate to Advanced tab
  • Select Change in Virtual memory Section

Then, select your USB external flash drive and choose a custom size to allocate part of a USB drive's memory to speed up performance and use the remainder to store files (or) let the System manage the size by selecting System managed size.

ExternalMemory After your changes select SET and click ok. Restart your computer and you have extra memory at no additional cost.

Friday, January 2, 2009

Adography: Cash in your amateur photos

Adography is an online agency that has been created specifically to help members of the public sell photographs to companies and allow companies to post “Want-ads” specific to their needs.

Adography is a relatively new service, offers a way to cash in your amateur photos, if you think there are some who might make for great advertisement material.

You can find a sample of a listing here.

del.icio.us Tags:

Technorati Tags: