This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* \file Fraction.h | |
* \author Prof. Adams | |
* \brief Contains header information and documentation for Fraction object | |
* \version 1.0 - 120205 | |
* \version 1.1 - 120209 - Changed at-dox to slash-dox | |
*/ | |
#import <Foundation/Foundation.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// BAdamsKnife.h | |
// knife_object_intro | |
// | |
// Created by Bryant Adams on 1/24/12. | |
// Copyright (c) 2012 __MyCompanyName__. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Tiny function to compute the GCD | |
int gcd(int a, int b) { return ( b == 0 ? a : gcd(b, a % b) ); } | |
//More readable to return the greatest common divisor of two integers | |
int gcd(int first, int second) | |
{ | |
if(first<0) first = -first; | |
if(second<0) second = -second; | |
if (first > second) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
digraph sd2 | |
{ | |
s1->d1 [label="100"]; | |
s1->d2 [label="100"]; | |
s1->d3 [label="100"]; | |
s1->d4 [label="100"]; | |
s2->d2 [label="100"]; | |
s2->d4 [label="100"]; | |
s3->d3 [label="100"]; | |
s3->d4 [label="100"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>[YOUR NAME HERE]'s Spring2012 CS105 Home Page</title> | |
<style type="text/css"> | |
.notStarted { | |
visibility: hidden; | |
} | |
.inProgress:before { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eclipse:cs131 badams$ clang cs131_program_final_badams.c -o bubblesort | |
eclipse:cs131 badams$ ./bubblesort | |
Bad syntax. Instead try: | |
./bubblesort 3 1 4 1 5 9 2 6 5 3 5 7 | |
Or... | |
./bubblesort verbose 3 1 4 1 5 9 2 6 5 3 5 7 | |
eclipse:cs131 badams$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4/5 * 4/9 = 16/45 | |
1/3 + 5/9 = 8/9 | |
2/5 * 1/6 = 1/15 | |
1/1 + 2/1 = 3/1 | |
4/5 * 1/3 = 4/15 | |
2/5 + 5/4 = 33/20 | |
1/4 * 10/9 = 5/18 | |
7/6 + 8/7 = 97/42 | |
3/8 * 1/4 = 3/32 | |
1/1 + 5/1 = 6/1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(cs228records). | |
-export([listJobbers/2]). | |
listJobbers(NameOfJob, [CurrentRecord | RemainingRecords]) -> | |
case CurrentRecord of | |
{person, {name, UsefulName}, {job, NameOfJob}, _} -> | |
[ UsefulName | listJobbers(NameOfJob, RemainingRecords)] | |
; | |
{person, {name, UselessName}, {job, RandomJob}, {Label, Data}} -> | |
io:format("Ignoring the <~p-~p'ed> ~p, who is a ~p.~n", [Data, Label, UselessName, RandomJob]), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./program_7_solution | |
MAIN MENU: | |
----------------------------------- | |
(a) Input data automatically | |
(b) Input data manually (BAD IDEA!) | |
----------------------------------- | |
(c) Display all array contents | |
(d) Display all contents, backward | |
(e) Display contents in a range | |
(f) Display evenly spaced contents |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Welcome to badams's Program 6 | |
(Part 0) Welcome to the Main Menu. Please select one of the following: | |
0: Display this lovely menu. | |
1: Total some numbers | |
2: Display ASCII codes for letters | |
3: Compute some Ulam numbers, whatever those are. | |
-1: Quit | |
Whatchawannado? -2 |