# Code & Math

## Massachusetts Institute of Technology OpenCourseWare – Intro to C++

http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-096-introduction-to-c-january-iap-2011/

There is no one who dreams of technology that has not given thought to how an education at MIT could send us to the top of the Computer Scientists charts. Although most of us may not be able to attend MIT, we can still take the classes they offer, and for FREE I might add. MIT OpenCourseWare is a name you should have tattoed across your chest, forearm, or forehead, as ...

## C++ Numeric Types, Expressions, and Output

Overview of Chapter 3, Programming and Problem Solving with C++, 5th edition (2010)

### C++ Data Types

* Types CHAR, SHORT, INT, and LONG are unsigned. An unsigned integer value is assumed to be only positive or zero.

Examples of Named Constant Declarations for Numberic Types:
const float PI = 3.14159;
const float E = 2.71828;
const float int = MAX_SCORE = 100;
const ...

## SAMS Teach Yourself PHP in 24 Hours, 3rd Edition courtesy of the Association for Computing Machinery

This post was created as a reference point.

### PHP Standard Data Types

There are 6 standard data types in PHP. They are:

• Integer
• Double
• String
• Boolean
• Object
• Array
• There are also 2 Special Data Types. They are:

• Resource
• Null
• ### Testing for a specific data type.

Functions to test data types

• is_array()
• is_bool()
• is_double()
• is_int()
• is_object()
• is_string()
• is_null()
• is_resource()
• ### Operators and Expressions

An operator is a symbol or series of symbols that, when used in conjunction with values, performs an action and usually produces a new value.

An ...

## JavaScript Budget Calculator

Do you need a quick and easy way to calculate your budget? If so, check out this JavaScript Budget Calculator.

### JavaScript Budget Calculator Source Code

Are you a programmer interested in the source code of this JavaScript? If so, here it is:
(Just Copy and Paste into your HTML Editor and save as a .html file.)

# Basics of JavaScript

This article was created to outline the basics of the JavaScript langauge.

### JavaScript – Unsupported Browsers

When JavaScript is run in an unsupported browser, the script itself might be displayed as text within the browser. To prevent this from happening, it is best to use the HTML comment feature to comment out the code from the script.

For example:
<SCRIPT TYPE="text/javascript">
<!--  HIDE THE SCRIPT
FROM OTHER BROWSERS

JavaScript program
//
STOP HIDING FROM OTHER
BROWSERS  -->

</SCRIPT>
HTML is commented ...

# Floating Point Numbers

While working on a JavaScript calculator I became stuck in what should be simple mathematics. The use of decimal points resulting in addition and subtraction caused erros in the calculations. The cause is in the way machine language calculates decimal points.

Oracle offers some great insight into the cause and resolution: What Every Computer Scientist Should Know About Floating-Point Numbers

The JavaScript Budget Calculator is a work in progress, to view how a machine interprets decimals check out ...

# JavaScript Calculator

*You must have a JavaScript enabled browser for the JavaScript Calculator demo to work.

## JavaScript Calculator Source Code

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>

<meta content=”text/html; charset=utf-8″ http-equiv=”Content-Type” />
<title>JavaScript Calculator</title>
<script type=”text/javascript”>

var total = 0;
var lastOperation = “+”;
var newnumber = true;

function enterNumber(digit) {

## Artificial Life – Simple Animation

One of the base things I must accomplish in the creation of a software program that emmulates the evolution and survival of life is a simplistic method of animating graphical objects. The graphics will be able to “see” and therefore will sense when they come in close contact with other objects. After a bit of research and development, I found an existing program, written in Java, that does just this.

The artificial life simulation will take into account the cycle of ...

Page 6 of 9 «...45678...»