Tuesday, August 7, 2012

ooad stuff

Encapsulation:

  • Allows you to group objects into logical parts
  • YOu can change one part without having to change the entire object
  • You shoould encapsulate parts of objects( that may change )away from parts which change

Three ways in which well defined software is easier to use than sw wiht duplicate code:
1) modification is easy
2)cleaner?
 

Thursday, August 2, 2012

shell

Shell:
You interact with unix using a special program called Shell. IT passes to commands to the Unix operating system.
It comes in different flavours: bash, Bourne shell(sh), C Shell(csh) etc.
Each shell uses a particular character (or string of characters) to prompt the user for commands; not surprisingly, this is known as a shell prompt. Exercises in this tutorial show the default shell prompt for csh, the "%" character.

Tuesday, February 7, 2012

drawing axes for a graph using GDI+ on a panel in C#


private void DrawBoundaryAndGraphAxes(Graphics g)
        {
            origin = new Point(margin, histogramPanel.Height - margin);
            Point xmax = new Point(histogramPanel.Width - margin, histogramPanel.Height - margin);
            Point ymax = new Point(margin, margin);
            Point xymax = new Point(histogramPanel.Width - margin, margin);

            Pen p = new Pen(Color.Black);
            g.DrawLines(p, new Point[] { ymax, origin, xmax });          
           
            p.Dispose();
}

pointers in C#



if p is a variable denoting a pointer, and *p is the variable it points to, then:

p[e] is equivalent to *(p+e)