Sunday, 11 May 2014

Switch to Slimline Margins in Word

Choose "Page Layout" in the Ribbon, Margins and then select "Narrow". This will reduce the 2.5cm default margin to 1.27cm.

Change from Portrait to Landscape in Word

Choose "Page Layout" in the Ribbon and then click Orientation.

How do I resize the Canvas in MSPaint?

You do Image->Attributes. Alternatively, the shortcut to get to this dialog is Cntrl-E.

By default, width and height is displayed in pixels.

Say the height is 421 pixels. To double it, type in 842.

Saturday, 10 May 2014

A Computer without Applications

Is like a television set without broadcasting - Michael Mahoney, 2002 (Paraphrased).

Essence of the "new" Keyword - Name Three Things It Does

What does the new keyword in C# actually do?

It calculates the TOTAL number of bytes the object needs (including its instance members) and then allocates the relevant amount of memory.

There are some additional bookkeeping items though.

For one thing, the type object pointer is initialised. This is a pointer to the object's description needed to perform virtual function invocation (i.e. to allow dynamic binding). The description is obtained using GetType which is nonvirtual to prevent object type spoofing.

The second thing is the sync block index, which is an index into a table of synchronisation blocks.

Then the instance constructor is called, passing in arguments specified in the new statement. Most compilers will then call the base class constructors all the way to System.Object.