Notes on Object-Oriented Programming

Introduction

System Configuration talks about the setup of your system for program development from the command window (or console).

Console discusses command-line compilation in Microsoft Visual C, Java, and Python.

simple are some examples of C, C++, Java, and Python programs.

Source-Highlighting

Source highlighting

C++ Topics

hello is a sequence of programs introducing topics in defining C++ classes.

vec2 is a class that captures the mathemetical properties of a 2D geometrical point or vector.

MFC Topics

small1 is a simple MFC example, no Document/View architecture, no special features, just a frame window (MainFrm.cpp) enclosing a client window (ChildView.cpp). Its behavior is to find the size of the client window and format a text string that is displayed centered in the client window.

small2 is a small MFC application modified to test the display generated by point2, a class that captures the display or graphics properties of a 2D geometrical point.

small3 modifies the small MFC application framework to support animation and move the origin to the center of the screen.

Java Topics

Test1 is a small Java application equivalent to MFC small1. It shows the size of the client window (JPanel) inside a main window (JFrame). It also illustrates how the displayed size of a text string may be determined.

Test2 is a small Java application that demonstrates the display of point objects (class Vec2).

Test3 is a Java application that illustrates the use of a Timer to do animation. It also illustrates the ability for a Java program to run either as an applet or as a standalone application.

Test4 is a Java application that demonstrates the use of Java Line2 and Arrow classes.

Qt Topics

Qt1, simple Qt example
Qt2, Qt application with custom window

Python Topics

Here is a link to live python CGI examples on my hosted account.

18 February 2008

The console-application code in line2 is a C++ expression of a 2D line segment, consisting of a test program and the line2 class.

The code in testbed1 is a MFC application for developing procedures for drawing electronic symbols. Symbols for resistors, inductors, capacitors, current sources, and impedance are illustrated.

The C++ console-application in netlist3 develops a class circuit that captures the structure of an electonic circuit as a netlist, or connected set of circuit elements (devices) such as resistors, capacitors, inductors, voltage and current sources, and so forth. This version includes only resistors and current sources. Circuit elements are sub-classes of the abstract class device.

20 February 2008

HTML Forms with Python CGI scripts.

The C++ console application netlist2 tests some parsing functions for a netlist.

The Matrix class is a matrix data structure and routines for matrix manuipulation. The class Vec is a simple column (or row) vector. There is also a linear-equation solver using LU-decomposition. (See ludcmp.cpp)

complex is a class for complex numbers.

Java network programming

25 February 2008

Overview of the C++ Standard Template Library (STL)

tag is my version of double-linked lists, written before STL.

tlist shows an example of the STL list container. It does basically the same things as the tag test example.

27 February 2008

playground fields: proposed Web database table fields for playground interactive distributed program project.

3 March 2008

colorchooser Python CGI form script

Solving differential equations

playground scripts

10 March 2008

sending email from python script

intersection of rectangles

12 March 2008

EventQueue, the right way to start a Swing program.

MouseTracker, MouseDetails, and Painter, are Java programs that use the mouse.

MouseTest, textbook program illustrating use of the mouse.

24 March 2008

submitfile.py is a Python CGI script allowing users to submit files to a central server.

netlist2 (Java version)

netlist3 (Java version)

gates1 (Java version)

Matrix (Java version)

26 March 2008

Drag Demo

Executable Jar Files

JTextArea demo.

TextDemo, sending an output stream to a JTextArea

gates1 (as an applet/windows application)

31 March 2008

growline, a rubber-band line

growbox, a rubber-band box

JPopupMenu

2 April 2008

cursors
netlist4, Java version of program that implements nodal analysis of basic electrical circuits (resistor, capacitors, inductors, and independent current and voltage sources).

7 April 2008

collide1 demo, Java programs
collide2 demo, Java program
Visual Python examples for the ball bounce problem.
gameboard.py is a CGI script that manages an interactive game prototype
GameBoard.java is a client program that displays player positions as obtained periodically from the web server.

9 April 2008

OOP Principles

21 April 2008

Unchecked Method Invocation warning message
final-game demo

14 February 2007

cifread is an object-oriented modification of a program that reads CIF files. The Caltech Intermediate Format (CIF) is used to describe VLSI layouts. See cif for more information.

gates1 is a work in progress that extends the circuit classes developed earlier to handle logic circuits. The simulator needs work!

19 February 2007

I found several interesting examples from a book by Reese. (See WebCT excerpt)

Shown here are an application of the STL complex class (numeric complex), a function evaluator (numeric function), and a string tokenizer (string tokenizer).

Simple RISC system (srisc) development, level 1. (srisc1 v1). The goal of level 1 is to simulate a Nios II processor to the extent of handling arithmetic (add and subtract) and logic operations. No branching or data memory access. Version 1 is presented here - all we do is read a binary file of machine-language instructions.

Reference

Greg Reese, C++ Standard Library Practical Tips, Charles River Media, 2006. ISBN 1-58450-400-5.

21 February 2007

netlist4 implements nodal analysis of basic electrical circuits (resistor, capacitors, inductors, and independent current and voltage sources).

bank1 is a work in progress on event-driven simulation. It explores some of the operations of a priority queue, see the event queue example.

small4 animates ellipical motion and provides a C++ version of the arrow class.

4 April 2007

Horstmann chapter 2

Horstmann Violet UML Editor

Horstmann chapter 4

Horstmann chapter 5

Horstmann chapter 6

Examples 123,  and 4 of the Graph Layout demonstration applet packages with the Java SDK.

26 April 2007

Horstmann Graph Editor (chapter 8)


Maintained by John Loomis, last updated 2 April 2008