bg287

CSC 210 20110411 Notes

Posted in csc210 by bnmng on 2011 04/11

Read 18.1 Error Handling
If you do a throw you should have a catch.

Advertisements

CSC205 2011 04 05 Notes

Posted in csc205 by bnmng on 2011 04/05

In Class Exercise
LDA 15, i
CPA 23, i
BRLE WHATEVER
BRANCH:YES N=1, Z=0, V=0, C=0

LDA 15,i
CPA 14,i
BRNE WHATEVER
Yes. N=0, Z=0, V=0, C=0

LDA 15,I
BREQ WHATEVER
No n=0, z=0, v=?, c=?

LDA 3,i
ANDA 12,i
No. n=0, z=1, v=?, c=?

For Test: PEP/* Page, Page 244, Page 247 Figure 6.33 page 285 and A4.
Remember which flags are affected by LDA, CPA. It’s in the handout.
BRNE Branches when the

For local, use stack addressing.
.equate means constant.

A call pushes the return address onto the run time start.
RETN n specifies the number to take off the stack before returning
0-

csc210 20100404 Notes

Posted in csc210 by bnmng on 2011 04/04

Test. Open Book. Sample Test handed out.
Today: Homework 7 and Sample Test 3

Note: A constant defaults to double. 3.85 is double. For float write 3.85f.

Going over sample test.

Study order of constructers & destructors with inheritance and composition.
Study virtual functions & when the base class or the derived class function is called
Rewrite a function as a template function
Rewrite a class as a template class
-Every single member function needs a template prefix

csc210 20110328 Notes

Posted in csc210 by bnmng on 2011 03/28

Test 3 on April 6th.
69okProgram due date moved to the 11th.
Lab Wednesday at 5PM.
Homework assignment handout.
Answers to prev homework handed out.
Might want to bring both books to the test.

Today:
Homework then template functions.
Template Functions
Overloading (the alternative to template functions)
Defining the functions
Instantiating.

Composition:
The part after the colon in a inheritance constructor or composition constructor is called an initializer list.

Making virtual work
Formal parameter has to be from the base class.
Need the word virtual in the base class and need to pass by reference.

There will likely be a question like Chapter 15 Exam Prep #9.

+Template classes
Ipmlemtation file with a template class should not be named .cpp because it can’t be compiled.
A good idea is using

Example myclass.h

Example tempclass.template
template
simple::simple () {
value = 0;
}
void simple::setvalue (int n) {
value=n;
}
itemtype simple::getvalie () const {
return value;
}

Example:main.cpp
include
using namespace std;
#include “myclass.h”

*** examples are not complete *****
Review: changing a simple class to a template class
Don’t use .cpp for the implementation file.
Either tyep the implementation code into the .h file, or use #include.
Within class, the specification needs .
Every single function needs a template prefix.
Cleint functions that use the class need a template prefix.
Also need nameofclass::.

-Template classes

phi101 20110328 Notes

Posted in phi101 by bnmng on 2011 03/28

If it’s true that humans have choice, that’s would be an anomaly for materialism.

Be open, but critical to paranormal evidence.

+Chapter 5
++Choice
Is choice real? Could you actually have initiated an action that wasn’t pre-determined?
There are arguments that deny the possibility of free choice.
Materialism, naturalism, determinism.
In these fields choosing is a mental phenomenon
Naturalism: The universe is a closed system. Every event is caused by a previous event.
Determinism: Everything is determined by a prior event.
Materialism: Only matter and activities of matter are real.
Mechanistic Materialism = Determinism + Materialism = Every real event is a matter/energy event determined by a previous one.
incompatibalism: Free choice is incompatible with mechanistic materialism.
Soft Determinism/Compatibalism: Humans make choices but given all of the events and conditioning that has led to this moment, you couldn’t have performed different.
–Choice
-End Chapter 5

csc210 2011 03 23 Notes

Posted in csc210 by bnmng on 2011 03/23

Lab next week.
Reading Assignment.

16.2 of Dale, and Main Savitch Chapter 6, section on Template Functions.

Today’s Agenda:
Pointers and Inheritance
Abstract and Base Classes
Template Classes from 16.1.

Composition vs Inheritance. Composition: no special syntax. Public functions are not available.

Inheritance: Special Syntax –

INheritance initializer has the name of the class after the colons; Composition has the name of the object.

Order of constructor calls: Base, Embedded, Derived. Destructors are called in opposit order.

When redefining functions in a derived class, it’s important to use ‘virtual’ in the base class to allow

Inline functions: The code is repeated throughout the main program.

Abstract Base Class: To define the functions in any derived class.
Pure virtual functions: Declare the function as virtual and assign it the value of zero.

See handout 2011 March 23 #1

Class member functions.
+ Each needs a template prefix
+ Nameofclass::

Organization of Program Code: Basically we need one big file. Cannot pre-compile cpp files. Specification file has to be .h, not .cpp because we can’t pre-compile it. Can be in separate files using an include statements. This is the same as including the entire text of one file into another.

-90

phi101 20110323 Notes

Posted in phi101 by bnmng on 2011 03/23

Epiphenomenalism is a form of metaphysical materialism. denies any seperate reality of the mind. It says that brain states cause other brain states. Arising out of brain states are the mental states.

Epiphenomenalism: Property dualism. Brain states have two kinds of properties, physical and mental. It recognizes the reality of mental states as special properties of brain states. This seems to be contradicted by the findings of mind body medicine.

Cognitive Science: Still a materialist theory, but a lot looser. Strongly influenced by computer science and draws on many other fields. We cannot understand human behavior without understanding mental processes (which cannot be objectively observed). Relies of a functionalist theory of mind. The essential nature of mental processes is not to be found in the stuff that their made of, but it’s function.

Functionalist theories are completely neutral about what is stuff. Leadeing thikers in Artificial Intelligence are aligned with functionalist theory. According to functionalist theory, if something behaves like a human then it can be credited with intelligence.

Spinoza: Dual Aspect Theory: Maybe what human experience as mind and what human experience as matter are simply aspects of something that’s more fundamental than either. This is a speculative solution. Spinoza’s arguments became even more realistic with the advance of quantum science, then they were when he came up with them.

Spinoza was one generation after Descartes.

Metaphysical Materialism: Only matter is real. Is this an adequate theory?

Metaphysical Materialism seems to have a lot of anomalies.

Anomaly: Unexplained relevant fact. Of A theory that is generating a lot of anomalies, it’s adequacy can be questioned.

Irreducibility: explained by the story of the smell scientist who cannot smell.

csc205 20110322 Notes

Posted in csc205 by bnmng on 2011 03/23

Read 6.1, 6.2
Test2
Chapter 5
5.2 Immediate Addressing
Trap Instructions

Need to study converting ands to ors
Need to study minimizations and karnogh maps.

Subtract binary by doing two’s complement and adding.

Patterns: Two Types.
Instructions
Mnemonics
Data
Pseudo-Ops

Instruction Specifier: First eight bits.

Pseudo-Ops.
.end has to be in every set. .end stops the assembly process.
.block sets aside an undefined block of memory.

Immediate Mode means operand is stored with the instruction.

Decimal in and Decimal Out read character in and translate into a number.

In assembly, 0x precedes hex numbers. Without 0x the default is decimal.

Assembly doesn’t create a null at the end of strings. Programmer has to put it there.

STRO changes the index register.

Assembler
Pass I
Build Symbol Table
Symbol Value
Validate Opcodes
Pass II
Substitutes for symbols.

An assembler has a location counter.

Almost certainly on a test will be an assembly instruction and we’ll be asked to re-write the code as it would look after the first pass.

csc210 20110321 Notes

Posted in csc210 by bnmng on 2011 03/21

Lab a week from Wednesday.
Read 16.1 in Dale and read handouts.

Today: Discuss inheritance and program3
Time class
Ballsphere class

Remember all classes need constructors, transformers, observers. Classes also have destructor and iterators.

Inheritance as opposed to composition.
The pen has a ball: composition
A volyball is a ball: inheritance.

Conventional Programming: Data structures are global
OOP: Data structures are in the class.

Difference between composition constructor and inheritance constructor: composition uses the name of the instance of th eincluded class; inheritance uses the class name of hte base class.

The problem for which the keyword “virtual” is the solution usually comes up when a pointer to a base class is defined as an instance of a derived class.

Static Binding: THe formal parameter determines what’s called.
Dynamic Binding: The actual parameter determines what’s called.

phi101 2011 03 21 Notes

Posted in phi101 by bnmng on 2011 03/21

Dual Aspect: [definition]

Descartes: His position is Dualism. Dualistic metaphysics preserved a place for religion, as well as an independent sphere for science. IAW Descartes: Reality is two substances. Matter and Mind, Matter: extended substance, which is stuff located in space, and Mind: thinking substance.

The Mind-Body problem: One of the problems with the dual-realities is that if they’re completely different, how do they interact? That they interact seems obvious but is it true? How does a non extended substance, such as a thought, create an effect in an extended substance such as the brain.

Descartes: seems to have confused the endurance of thought with the endurance of consciousness.

Descartes: First “Modern” philosophers. First to be working after the beginning of the scientific revolution.

Descartes: Developed Analytic Geometry (Cartesian plane). Also helped develop calculus. Wanted to start with a foundation of certainty.

Descartes Critically Examined all of this beliefs. Separated believes that could be doubted from few basic believes he can be certain about. Thought: I can’t doubt doubting. I can’t doubt the thinking that lead to doubting. Believed that he proved. The existence of mind is foundational and certain.

Descartes: Systematic doubt to eliminate every believe that could be doubted, and was left with nothing that could not be doubted but doubting itself. Led to “I think, therefore I am”.

Descartes: Since all he could know is mind, he has no reliable bridge to the real world. Made the connection between mind and world through the existence of an infinite and perfect being. Thought “God, being perfect, would not deceive me”.

Metaphysical Materialism: The claim that the only thing that is fundementally real is matter and the interactions (Not Descartes).

Metaphysical Materialism: Only reality is that which can be observed by the third person. No independent reality to mind. Mental experience is merely a property of brain activity.

Physical brain events and mental events are coordinated. One always happens with the other.

Hume: Never found a “Mind”. Only found “Thinking”, “Feeling”, etc. Mind is just a flow of mental events.

Gilbert Ryle: Ghost in the Machine: A machine doesn’t need a “ghost” inside to make it work; neither do humans. Influenced by 20th Century Psychological Behavioralism. Like Hume, denied Cartesian dualism. IAW Ryle. Mind is behaviors.

Eliminative Materialism overcomes the mind-body problem by denying the mind, or defining the mind as nothing but brain states.