SlideShare a Scribd company logo
PrizeExample/.DS_Store
__MACOSX/PrizeExample/._.DS_Store
PrizeExample/.git/COMMIT_EDITMSG
Initial Commit
PrizeExample/.git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
PrizeExample/.git/description
Unnamed repository; edit this file 'description' to name the
repository.
PrizeExample/.git/HEAD
ref: refs/heads/master
PrizeExample/.git/hooks/applypatch-msg.sample
#!/bin/sh
#
# An example hook script to check the commit log message
taken by
# applypatch from an e-mail message.
#
# The hook should exit with non-zero status after issuing an
# appropriate message if it wants to stop the commit. The hook
is
# allowed to edit the commit message file.
#
# To enable this hook, rename this file to "applypatch-msg".
. git-sh-setup
test -x "$GIT_DIR/hooks/commit-msg" &&
exec "$GIT_DIR/hooks/commit-msg"
${1+"[email protected]"}
:
PrizeExample/.git/hooks/commit-msg.sample
#!/bin/sh
#
# An example hook script to check the commit log message.
# Called by "git commit" with one argument, the name of the
file
# that has the commit message. The hook should exit with non-
zero
# status after issuing an appropriate message if it wants to stop
the
# commit. The hook is allowed to edit the commit message file.
#
# To enable this hook, rename this file to "commit-msg".
# Uncomment the below to add a Signed-off-by line to the
message.
# Doing this in a hook is a bad idea in general, but the prepare-
commit-msg
# hook is more suited to it.
#
# SOB=$(git var GIT_AUTHOR_IDENT | sed -n
's/^(.*>).*$/Signed-off-by: 1/p')
# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
# This example catches duplicate Signed-off-by lines.
test "" = "$(grep '^Signed-off-by: ' "$1" |
sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
echo >&2 Duplicate Signed-off-by lines.
exit 1
}
PrizeExample/.git/hooks/post-update.sample
#!/bin/sh
#
# An example hook script to prepare a packed repository for use
over
# dumb transports.
#
# To enable this hook, rename this file to "post-update".
exec git update-server-info
PrizeExample/.git/hooks/pre-applypatch.sample
#!/bin/sh
#
# An example hook script to verify what is about to be
committed
# by applypatch from an e-mail message.
#
# The hook should exit with non-zero status after issuing an
# appropriate message if it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-applypatch".
. git-sh-setup
test -x "$GIT_DIR/hooks/pre-commit" &&
exec "$GIT_DIR/hooks/pre-commit"
${1+"[email protected]"}
:
PrizeExample/.git/hooks/pre-commit.sample
#!/bin/sh
#
# An example hook script to verify what is about to be
committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message
if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
# If you want to allow non-ascii filenames set this variable to
true.
allownonascii=$(git config hooks.allownonascii)
# Redirect output to stderr.
exec 1>&2
# Cross platform projects tend to avoid non-ascii filenames;
prevent
# them from being added to the repository. We exploit the fact
that the
# printable range starts at the space character and ends with
tilde.
if [ "$allownonascii" != "true" ] &&
# Note that the use of brackets around a tr range is ok here,
(it's
# even required, for portability to Solaris 10's /usr/bin/tr),
since
# the square bracket bytes happen to fall in the designated
range.
test $(git diff --cached --name-only --diff-filter=A -z
$against |
LC_ALL=C tr -d '[ -~]0' | wc -c) != 0
then
echo "Error: Attempt to add a non-ascii file name."
echo
echo "This can cause problems if you want to work"
echo "with people on other platforms."
echo
echo "To be portable it is advisable to rename the file ..."
echo
echo "If you know what you are doing you can disable
this"
echo "check using:"
echo
echo " git config hooks.allownonascii true"
echo
exit 1
fi
# If there are whitespace errors, print the offending file names
and fail.
exec git diff-index --check --cached $against --
PrizeExample/.git/hooks/pre-rebase.sample
#!/bin/sh
#
# Copyright (c) 2006, 2008 Junio C Hamano
#
# The "pre-rebase" hook is run just before "git rebase" starts
doing
# its job, and can prevent the command from running by exiting
with
# non-zero status.
#
# The hook is called with the following parameters:
#
# $1 -- the upstream the series was forked from.
# $2 -- the branch being rebased (or empty when rebasing the
current branch).
#
# This sample shows how to prevent topic branches that are
already
# merged to 'next' branch from getting rebased, because
allowing it
# would result in rebasing already published history.
publish=next
basebranch="$1"
if test "$#" = 2
then
topic="refs/heads/$2"
else
topic=`git symbolic-ref HEAD` ||
exit 0 ;# we do not interrupt rebasing detached HEAD
fi
case "$topic" in
refs/heads/??/*)
;;
*)
exit 0 ;# we do not interrupt others.
;;
esac
# Now we are dealing with a topic branch being rebased
# on top of master. Is it OK to rebase it?
# Does the topic really exist?
git show-ref -q "$topic" || {
echo >&2 "No such branch $topic"
exit 1
}
# Is topic fully merged to master?
not_in_master=`git rev-list --pretty=oneline ^master "$topic"`
if test -z "$not_in_master"
then
echo >&2 "$topic is fully merged to master; better remove
it."
exit 1 ;# we could allow it, but there is no point.
fi
# Is topic ever merged to next? If so you should not be rebasing
it.
only_next_1=`git rev-list ^master "^$topic" ${publish} | sort`
only_next_2=`git rev-list ^master ${publish} | sort`
if test "$only_next_1" = "$only_next_2"
then
not_in_topic=`git rev-list "^$topic" master`
if test -z "$not_in_topic"
then
echo >&2 "$topic is already up-to-date with master"
exit 1 ;# we could allow it, but there is no point.
else
exit 0
fi
else
not_in_next=`git rev-list --pretty=oneline ^${publish}
"$topic"`
/usr/bin/perl -e '
my $topic = $ARGV[0];
my $msg = "* $topic has commits already merged to
public branch:n";
my (%not_in_next) = map {
/^([0-9a-f]+) /;
($1 => 1);
} split(/n/, $ARGV[1]);
for my $elem (map {
/^([0-9a-f]+) (.*)$/;
[$1 => $2];
} split(/n/, $ARGV[2])) {
if (!exists $not_in_next{$elem->[0]}) {
if ($msg) {
print STDERR $msg;
undef $msg;
}
print STDERR " $elem->[1]n";
}
}
' "$topic" "$not_in_next" "$not_in_master"
exit 1
fi
exit 0
#####################################################
###########
This sample hook safeguards topic branches that have been
published from being rewound.
The workflow assumed here is:
* Once a topic branch forks from "master", "master" is never
merged into it again (either directly or indirectly).
* Once a topic branch is fully cooked and merged into
"master",
it is deleted. If you need to build on top of it to correct
earlier mistakes, a new topic branch is created by forking at
the tip of the "master". This is not strictly necessary, but
it makes it easier to keep your history simple.
* Whenever you need to test or publish your changes to topic
branches, merge them into "next" branch.
The script, being an example, hardcodes the publish branch
name
to be "next", but it is trivial to make it configurable via
$GIT_DIR/config mechanism.
With this workflow, you would want to know:
(1) ... if a topic branch has ever been merged to "next". Young
topic branches can have stupid mistakes you would rather
clean up before publishing, and things that have not been
merged into other branches can be easily rebased without
affecting other people. But once it is published, you would
not want to rewind it.
(2) ... if a topic branch has been fully merged to "master".
Then you can delete it. More importantly, you should not
build on top of it -- other people may already want to
change things related to the topic as patches against your
"master", so if you need further changes, it is better to
fork the topic (perhaps with the same name) afresh from the
tip of "master".
Let's look at this example:
o---o---o---o---o---o---o---o---o---o "next"
/ / / /
/ a---a---b A / /
/ / / /
/ / c---c---c---c B /
/ / /  /
/ / / b---b C  /
/ / / /  /
---o---o---o---o---o---o---o---o---o---o---o "master"
A, B and C are topic branches.
* A has one fix since it was merged up to "next".
* B has finished. It has been fully merged up to "master" and
"next",
and is ready to be deleted.
* C has not merged to "next" at all.
We would want to allow C to be rebased, refuse A, and
encourage
B to be deleted.
To compute (1):
git rev-list ^master ^topic next
git rev-list ^master next
if these match, topic has not merged in next at all.
To compute (2):
git rev-list master..topic
if this is empty, it is fully merged to "master".
PrizeExample/.git/hooks/prepare-commit-msg.sample
#!/bin/sh
#
# An example hook script to prepare the commit log message.
# Called by "git commit" with the name of the file that has the
# commit message, followed by the description of the commit
# message's source. The hook's purpose is to edit the commit
# message file. If the hook fails with a non-zero status,
# the commit is aborted.
#
# To enable this hook, rename this file to "prepare-commit-
msg".
# This hook includes three examples. The first comments out
the
# "Conflicts:" part of a merge commit.
#
# The second includes the output of "git diff --name-status -r"
# into the message, just before the "git status" output. It is
# commented because it doesn't cope with --amend or with
squashed
# commits.
#
# The third example adds a Signed-off-by line to the message,
that can
# still be edited. This is rarely a good idea.
case "$2,$3" in
merge,)
/usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/;
print' "$1" ;;
# ,|template,)
# /usr/bin/perl -i.bak -pe '
# print "n" . `git diff --cached --name-status -r`
# if /^#/ && $first++ == 0' "$1" ;;
*) ;;
esac
# SOB=$(git var GIT_AUTHOR_IDENT | sed -n
's/^(.*>).*$/Signed-off-by: 1/p')
# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
PrizeExample/.git/hooks/update.sample
#!/bin/sh
#
# An example hook script to blocks unannotated tags from
entering.
# Called by "git receive-pack" with arguments: refname sha1-
old sha1-new
#
# To enable this hook, rename this file to "update".
#
# Config
# ------
# hooks.allowunannotated
# This boolean sets whether unannotated tags will be allowed
into the
# repository. By default they won't be.
# hooks.allowdeletetag
# This boolean sets whether deleting tags will be allowed in
the
# repository. By default they won't be.
# hooks.allowmodifytag
# This boolean sets whether a tag may be modified after
creation. By default
# it won't be.
# hooks.allowdeletebranch
# This boolean sets whether deleting branches will be allowed
in the
# repository. By default they won't be.
# hooks.denycreatebranch
# This boolean sets whether remotely creating branches will be
denied
# in the repository. By default this is allowed.
#
# --- Command line
refname="$1"
oldrev="$2"
newrev="$3"
# --- Safety check
if [ -z "$GIT_DIR" ]; then
echo "Don't run this script from the command line." >&2
echo " (if you want, you could supply GIT_DIR then run"
>&2
echo " $0 <ref> <oldrev> <newrev>)" >&2
exit 1
fi
if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
echo "Usage: $0 <ref> <oldrev> <newrev>" >&2
exit 1
fi
# --- Config
allowunannotated=$(git config --bool hooks.allowunannotated)
allowdeletebranch=$(git config --bool hooks.allowdeletebranch)
denycreatebranch=$(git config --bool hooks.denycreatebranch)
allowdeletetag=$(git config --bool hooks.allowdeletetag)
allowmodifytag=$(git config --bool hooks.allowmodifytag)
# check for no description
projectdesc=$(sed -e '1q' "$GIT_DIR/description")
case "$projectdesc" in
"Unnamed repository"* | "")
echo "*** Project description file hasn't been set" >&2
exit 1
;;
esac
# --- Check types
# if $newrev is 0000...0000, it's a commit to delete a ref.
zero="0000000000000000000000000000000000000000"
if [ "$newrev" = "$zero" ]; then
newrev_type=delete
else
newrev_type=$(git cat-file -t $newrev)
fi
case "$refname","$newrev_type" in
refs/tags/*,commit)
# un-annotated tag
short_refname=${refname##refs/tags/}
if [ "$allowunannotated" != "true" ]; then
echo "*** The un-annotated tag,
$short_refname, is not allowed in this repository" >&2
echo "*** Use 'git tag [ -a | -s ]' for tags you
want to propagate." >&2
exit 1
fi
;;
refs/tags/*,delete)
# delete tag
if [ "$allowdeletetag" != "true" ]; then
echo "*** Deleting a tag is not allowed in this
repository" >&2
exit 1
fi
;;
refs/tags/*,tag)
# annotated tag
if [ "$allowmodifytag" != "true" ] && git rev-parse
$refname > /dev/null 2>&1
then
echo "*** Tag '$refname' already exists." >&2
echo "*** Modifying a tag is not allowed in this
repository." >&2
exit 1
fi
;;
refs/heads/*,commit)
# branch
if [ "$oldrev" = "$zero" -a "$denycreatebranch" =
"true" ]; then
echo "*** Creating a branch is not allowed in
this repository" >&2
exit 1
fi
;;
refs/heads/*,delete)
# delete branch
if [ "$allowdeletebranch" != "true" ]; then
echo "*** Deleting a branch is not allowed in
this repository" >&2
exit 1
fi
;;
refs/remotes/*,commit)
# tracking branch
;;
refs/remotes/*,delete)
# delete tracking branch
if [ "$allowdeletebranch" != "true" ]; then
echo "*** Deleting a tracking branch is not
allowed in this repository" >&2
exit 1
fi
;;
*)
# Anything else (is there anything else?)
echo "*** Update hook: unknown type of update to
ref $refname of type $newrev_type" >&2
exit 1
;;
esac
# --- Finished
exit 0
PrizeExample/.git/index
PrizeExample/.git/info/exclude
.DS_Store
UserInterface.xcuserstate
__MACOSX/PrizeExample/.git/info/._exclude
PrizeExample/.git/logs/HEAD
0000000000000000000000000000000000000000
1b22d78d425bcdab7f2280ef764d390b541ab3fb Kevin Sahr
<[email protected]> 1358207680 -0800 commit (initial):
Initial Commit
PrizeExample/.git/logs/refs/heads/master
0000000000000000000000000000000000000000
1b22d78d425bcdab7f2280ef764d390b541ab3fb Kevin Sahr
<[email protected]> 1358207680 -0800 commit (initial):
Initial Commit
PrizeExample/.git/objects/1b/22d78d425bcdab7f2280ef764d390
b541ab3fb
PrizeExample/.git/objects/1b/22d78d425bcdab7f2280ef764d390
b541ab3fb
commit 185�tree
35d55eb67bdfb12cbe860d3db52958794681d62c
author Kevin Sahr <[email protected]> 1358207680 -0800
committer Kevin Sahr <[email protected]> 1358207680 -0800
Initial Commit
PrizeExample/.git/objects/35/d55eb67bdfb12cbe860d3db529587
94681d62c
PrizeExample/.git/objects/35/d55eb67bdfb12cbe860d3db529587
94681d62c
PrizeExample/.git/objects/3a/b1d767f07c83b809b07dd72fcbfd0
123166deb
PrizeExample/.git/objects/3a/b1d767f07c83b809b07dd72fcbfd0
123166deb
blob 180�//
// Prize.m
// PrizeExample
//
// Created by Kevin Sahr on 1/14/13.
// Copyright (c) 2013 Kevin Sahr. All rights reserved.
//
#import "Prize.h"
@implementation Prize
@end
PrizeExample/.git/objects/60/74a1ae75c9d5ed8b13741bacf58bf9
6746e389
PrizeExample/.git/objects/60/74a1ae75c9d5ed8b13741bacf58bf9
6746e389
PrizeExample/.git/objects/61/0f6e9b9fc30502acf43cd43e3b0941
1195232e
PrizeExample/.git/objects/61/0f6e9b9fc30502acf43cd43e3b0941
1195232e
blob 338�//
// main.m
// PrizeExample
//
// Created by Kevin Sahr on 1/14/13.
// Copyright (c) 2013 Kevin Sahr. All rights reserved.
//
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[])
{
@autoreleasepool {
// insert code here...
NSLog(@"Hello, World!");
}
return 0;
}
PrizeExample/.git/objects/75/90ab9b291c1261947150dc266324b
57bed28f5
PrizeExample/.git/objects/75/90ab9b291c1261947150dc266324b
57bed28f5
blob 202�//
// Prize.h
// PrizeExample
//
// Created by Kevin Sahr on 1/14/13.
// Copyright (c) 2013 Kevin Sahr. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface Prize : NSObject
@end
PrizeExample/.git/objects/89/5ee117fe83ae9655f6124745778b8
ed670e29a
PrizeExample/.git/objects/89/5ee117fe83ae9655f6124745778b8
ed670e29a
blob 3130�."Modified from man(1) of FreeBSD, the NetBSD
mdoc.template, and mdoc.samples.
."See Also:
."man mdoc.samples for a complete listing of options
."man mdoc for the short list of editing options
."/usr/share/misc/mdoc.template
.Dd 1/14/13 " DATE
.Dt PrizeExample 1 " Program name and manual section
number
.Os Darwin
.Sh NAME " Section Header - required - don't
modify
.Nm PrizeExample,
." The following lines are read in generating the apropos(man -
k) database. Use only key
." words here as the database is built based on the words here
and in the .ND line.
.Nm Other_name_for_same_program(),
.Nm Yet another name for the same program.
." Use .Nm macro to designate other names for the documented
program.
.Nd This line parsed for whatis database.
.Sh SYNOPSIS " Section Header - required - don't
modify
.Nm
.Op Fl abcd " [-abcd]
.Op Fl a Ar path " [-a path]
.Op Ar file " [file]
.Op Ar " [file ...]
.Ar arg0 " Underlined argument - use .Ar anywhere
to underline
arg2 ... " Arguments
.Sh DESCRIPTION " Section Header - required - don't
modify
Use the .Nm macro to refer to your program throughout the man
page like such:
.Nm
Underlining is accomplished with the .Ar macro like this:
.Ar underlined text .
.Pp " Inserts a space
A list of items with descriptions:
.Bl -tag -width -indent " Begins a tagged list
.It item a " Each item preceded by .It macro
Description of item a
.It item b
Description of item b
.El " Ends the list
.Pp
A list of flags and their descriptions:
.Bl -tag -width -indent " Differs from above in tag removed
.It Fl a "-a flag as a list item
Description of -a flag
.It Fl b
Description of -b flag
.El " Ends the list
.Pp
." .Sh ENVIRONMENT " May not be needed
." .Bl -tag -width "ENV_VAR_1" -indent " ENV_VAR_1 is
width of the string ENV_VAR_1
." .It Ev ENV_VAR_1
." Description of ENV_VAR_1
." .It Ev ENV_VAR_2
." Description of ENV_VAR_2
." .El
.Sh FILES " File used or created by the topic of the
man page
.Bl -tag -width "/Users/joeuser/Library/really_long_file_name"
-compact
.It Pa /usr/share/file_name
FILE_1 description
.It Pa /Users/joeuser/Library/really_long_file_name
FILE_2 description
.El " Ends the list
." .Sh DIAGNOSTICS " May not be needed
." .Bl -diag
." .It Diagnostic Tag
." Diagnostic informtion here.
." .It Diagnostic Tag
." Diagnostic informtion here.
." .El
.Sh SEE ALSO
." List links in ascending order by section, alphabetically
within a section.
." Please do not reference files that do not exist without filing a
bug report
.Xr a 1 ,
.Xr b 1 ,
.Xr c 1 ,
.Xr a 2 ,
.Xr b 2 ,
.Xr a 3 ,
.Xr b 3
." .Sh BUGS " Document known, unremedied bugs
." .Sh HISTORY " Document history if command
behaves in a unique manner
PrizeExample/.git/objects/b6/5acc40fad073706e32c8335f4a5488
c13b1269
PrizeExample/.git/objects/b6/5acc40fad073706e32c8335f4a5488
c13b1269
blob 8207�// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
26CAE27C16A4D240001F4178 /*
Foundation.framework in Frameworks */ = {isa =
PBXBuildFile; fileRef = 26CAE27B16A4D240001F4178 /*
Foundation.framework */; };
26CAE27F16A4D240001F4178 /* main.m in Sources
*/ = {isa = PBXBuildFile; fileRef =
26CAE27E16A4D240001F4178 /* main.m */; };
26CAE28316A4D240001F4178 /* PrizeExample.1 in
CopyFiles */ = {isa = PBXBuildFile; fileRef =
26CAE28216A4D240001F4178 /* PrizeExample.1 */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
26CAE27516A4D240001F4178 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
26CAE28316A4D240001F4178 /*
PrizeExample.1 in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 1;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
26CAE27716A4D240001F4178 /* PrizeExample */ =
{isa = PBXFileReference; explicitFileType = "compiled.mach-
o.executable"; includeInIndex = 0; path = PrizeExample;
sourceTree = BUILT_PRODUCTS_DIR; };
26CAE27B16A4D240001F4178 /*
Foundation.framework */ = {isa = PBXFileReference;
lastKnownFileType = wrapper.framework; name =
Foundation.framework; path =
System/Library/Frameworks/Foundation.framework; sourceTree
= SDKROOT; };
26CAE27E16A4D240001F4178 /* main.m */ = {isa =
PBXFileReference; lastKnownFileType = sourcecode.c.objc;
path = main.m; sourceTree = "<group>"; };
26CAE28116A4D240001F4178 /* PrizeExample-
Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType =
sourcecode.c.h; path = "PrizeExample-Prefix.pch"; sourceTree =
"<group>"; };
26CAE28216A4D240001F4178 /* PrizeExample.1 */
= {isa = PBXFileReference; lastKnownFileType = text.man;
path = PrizeExample.1; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
26CAE27416A4D240001F4178 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
26CAE27C16A4D240001F4178 /*
Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
26CAE26C16A4D240001F4178 = {
isa = PBXGroup;
children = (
26CAE27D16A4D240001F4178 /*
PrizeExample */,
26CAE27A16A4D240001F4178 /*
Frameworks */,
26CAE27816A4D240001F4178 /* Products
*/,
);
sourceTree = "<group>";
};
26CAE27816A4D240001F4178 /* Products */ = {
isa = PBXGroup;
children = (
26CAE27716A4D240001F4178 /*
PrizeExample */,
);
name = Products;
sourceTree = "<group>";
};
26CAE27A16A4D240001F4178 /* Frameworks */ = {
isa = PBXGroup;
children = (
26CAE27B16A4D240001F4178 /*
Foundation.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
26CAE27D16A4D240001F4178 /* PrizeExample */ =
{
isa = PBXGroup;
children = (
26CAE27E16A4D240001F4178 /* main.m
*/,
26CAE28216A4D240001F4178 /*
PrizeExample.1 */,
26CAE28016A4D240001F4178 /*
Supporting Files */,
);
path = PrizeExample;
sourceTree = "<group>";
};
26CAE28016A4D240001F4178 /* Supporting Files */
= {
isa = PBXGroup;
children = (
26CAE28116A4D240001F4178 /*
PrizeExample-Prefix.pch */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
26CAE27616A4D240001F4178 /* PrizeExample */ =
{
isa = PBXNativeTarget;
buildConfigurationList =
26CAE28616A4D240001F4178 /* Build configuration list for
PBXNativeTarget "PrizeExample" */;
buildPhases = (
26CAE27316A4D240001F4178 /* Sources
*/,
26CAE27416A4D240001F4178 /*
Frameworks */,
26CAE27516A4D240001F4178 /*
CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = PrizeExample;
productName = PrizeExample;
productReference =
26CAE27716A4D240001F4178 /* PrizeExample */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
26CAE26E16A4D240001F4178 /* Project object */ =
{
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0450;
ORGANIZATIONNAME = "Kevin Sahr";
};
buildConfigurationList =
26CAE27116A4D240001F4178 /* Build configuration list for
PBXProject "PrizeExample" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 26CAE26C16A4D240001F4178;
productRefGroup =
26CAE27816A4D240001F4178 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
26CAE27616A4D240001F4178 /*
PrizeExample */,
);
};
/* End PBXProject section */
/* Begin PBXSourcesBuildPhase section */
26CAE27316A4D240001F4178 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
26CAE27F16A4D240001F4178 /* main.m
in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
26CAE28416A4D240001F4178 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS =
"$(ARCHS_STANDARD_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD
= "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH =
YES;
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD =
gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS =
YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN =
NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE =
YES;
GCC_WARN_UNINITIALIZED_AUTOS =
YES;
GCC_WARN_UNUSED_VARIABLE =
YES;
MACOSX_DEPLOYMENT_TARGET =
10.8;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
};
name = Debug;
};
26CAE28516A4D240001F4178 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS =
"$(ARCHS_STANDARD_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD
= "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH =
YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT =
"dwarf-with-dsym";
GCC_C_LANGUAGE_STANDARD =
gnu99;
GCC_ENABLE_OBJC_EXCEPTIONS =
YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE =
YES;
GCC_WARN_UNINITIALIZED_AUTOS =
YES;
GCC_WARN_UNUSED_VARIABLE =
YES;
MACOSX_DEPLOYMENT_TARGET =
10.8;
SDKROOT = macosx;
};
name = Release;
};
26CAE28716A4D240001F4178 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER =
YES;
GCC_PREFIX_HEADER =
"PrizeExample/PrizeExample-Prefix.pch";
PRODUCT_NAME =
"$(TARGET_NAME)";
};
name = Debug;
};
26CAE28816A4D240001F4178 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER =
YES;
GCC_PREFIX_HEADER =
"PrizeExample/PrizeExample-Prefix.pch";
PRODUCT_NAME =
"$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
26CAE27116A4D240001F4178 /* Build configuration
list for PBXProject "PrizeExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
26CAE28416A4D240001F4178 /* Debug
*/,
26CAE28516A4D240001F4178 /* Release
*/,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
26CAE28616A4D240001F4178 /* Build configuration
list for PBXNativeTarget "PrizeExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
26CAE28716A4D240001F4178 /* Debug
*/,
26CAE28816A4D240001F4178 /* Release
*/,
);
defaultConfigurationIsVisible = 0;
};
/* End XCConfigurationList section */
};
rootObject = 26CAE26E16A4D240001F4178 /* Project
object */;
}
PrizeExample/.git/objects/c9/bfd921054b2a58b4dc4734e81ca1b
a626ecf39
PrizeExample/.git/objects/c9/bfd921054b2a58b4dc4734e81ca1b
a626ecf39
PrizeExample/.git/objects/f2/ab0dd5f824e91a68d100d21a81a59
72521f386
PrizeExample/.git/objects/f2/ab0dd5f824e91a68d100d21a81a59
72521f386
blob 165�//
// Prefix header for all source files of the 'PrizeExample' target
in the 'PrizeExample' project
//
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#endif
PrizeExample/.git/refs/heads/master
1b22d78d425bcdab7f2280ef764d390b541ab3fb
PrizeExample/PrizeExample/main.m
//
// main.m
// PrizeExample
//
// Created by Kevin Sahr on 1/14/13.
// Copyright (c) 2013 Kevin Sahr. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "Prize.h"
int main(int argc, const char * argv[])
{
@autoreleasepool {
Prize *prize = [[Prize alloc] init];
NSLog(@"%@", prize);
prize.name = @"Car";
prize.price = 25000;
NSLog(@"%@", prize);
if ([prize isJackpot])
NSLog(@"Jackpot!");
else
NSLog(@"Not a jackpot.");
Prize *boobyPrize = [Prize makeBoobyPrize];
NSLog(@"%@", boobyPrize);
}
return 0;
}
__MACOSX/PrizeExample/PrizeExample/._main.m
PrizeExample/PrizeExample/Prize.h
//
// Prize.h
// PrizeExample
//
// Created by Kevin Sahr on 4/5/14.
// Copyright (c) 2013 Kevin Sahr. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface Prize : NSObject {
// no instance variables that aren't properties
}
@property NSString* name;
@property float price;
+ (Prize*)makeBoobyPrize;
- (id)initWithName:(NSString*)name price:(float)price;
- (BOOL)isJackpot;
@end
__MACOSX/PrizeExample/PrizeExample/._Prize.h
PrizeExample/PrizeExample/Prize.m
//
// Prize.m
// PrizeExample
//
// Created by Kevin Sahr on 4/5/14.
// Copyright (c) 2013 Kevin Sahr. All rights reserved.
//
#import "Prize.h"
@implementation Prize
+ (Prize*)makeBoobyPrize
{
Prize *bp = [[Prize alloc] initWithName:@"BOOBY
PRIZE" price:0.0];
return bp;
}
// the designated initializer
- (id)initWithName:(NSString *)name price:(float)price
{
self = [super init];
if (self)
{
_name = name;
_price = price;
}
return self;
}
- (id)init
{
return [self initWithName:@"UNKNOWN" price:0.0];
}
- (BOOL)isJackpot
{
if (self.price > 10000)
return YES;
else
return NO;
}
- (NSString*)description
{
NSString* s = [NSString stringWithFormat:@"The %@
worth $%.2f.",
self.name, self.price];
return s;
}
@end
__MACOSX/PrizeExample/PrizeExample/._Prize.m
PrizeExample/PrizeExample/PrizeExample-Prefix.pch
//
// Prefix header for all source files of the 'PrizeExample' target
in the 'PrizeExample' project
//
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#endif
__MACOSX/PrizeExample/PrizeExample/._PrizeExample-
Prefix.pch
PrizeExample/PrizeExample/PrizeExample.1
."Modified from man(1) of FreeBSD, the NetBSD
mdoc.template, and mdoc.samples.
."See Also:
."man mdoc.samples for a complete listing of options
."man mdoc for the short list of editing options
."/usr/share/misc/mdoc.template
.Dd 1/14/13 " DATE
.Dt PrizeExample 1 " Program name and manual section
number
.Os Darwin
.Sh NAME " Section Header - required - don't
modify
.Nm PrizeExample,
." The following lines are read in generating the apropos(man -
k) database. Use only key
." words here as the database is built based on the words here
and in the .ND line.
.Nm Other_name_for_same_program(),
.Nm Yet another name for the same program.
." Use .Nm macro to designate other names for the documented
program.
.Nd This line parsed for whatis database.
.Sh SYNOPSIS " Section Header - required - don't
modify
.Nm
.Op Fl abcd " [-abcd]
.Op Fl a Ar path " [-a path]
.Op Ar file " [file]
.Op Ar " [file ...]
.Ar arg0 " Underlined argument - use .Ar anywhere
to underline
arg2 ... " Arguments
.Sh DESCRIPTION " Section Header - required - don't
modify
Use the .Nm macro to refer to your program throughout the man
page like such:
.Nm
Underlining is accomplished with the .Ar macro like this:
.Ar underlined text .
.Pp " Inserts a space
A list of items with descriptions:
.Bl -tag -width -indent " Begins a tagged list
.It item a " Each item preceded by .It macro
Description of item a
.It item b
Description of item b
.El " Ends the list
.Pp
A list of flags and their descriptions:
.Bl -tag -width -indent " Differs from above in tag removed
.It Fl a "-a flag as a list item
Description of -a flag
.It Fl b
Description of -b flag
.El " Ends the list
.Pp
." .Sh ENVIRONMENT " May not be needed
." .Bl -tag -width "ENV_VAR_1" -indent " ENV_VAR_1 is
width of the string ENV_VAR_1
." .It Ev ENV_VAR_1
." Description of ENV_VAR_1
." .It Ev ENV_VAR_2
." Description of ENV_VAR_2
." .El
.Sh FILES " File used or created by the topic of the
man page
.Bl -tag -width "/Users/joeuser/Library/really_long_file_name"
-compact
.It Pa /usr/share/file_name
FILE_1 description
.It Pa /Users/joeuser/Library/really_long_file_name
FILE_2 description
.El " Ends the list
." .Sh DIAGNOSTICS " May not be needed
." .Bl -diag
." .It Diagnostic Tag
." Diagnostic informtion here.
." .It Diagnostic Tag
." Diagnostic informtion here.
." .El
.Sh SEE ALSO
." List links in ascending order by section, alphabetically
within a section.
." Please do not reference files that do not exist without filing a
bug report
.Xr a 1 ,
.Xr b 1 ,
.Xr c 1 ,
.Xr a 2 ,
.Xr b 2 ,
.Xr a 3 ,
.Xr b 3
." .Sh BUGS " Document known, unremedied bugs
." .Sh HISTORY " Document history if command
behaves in a unique manner
__MACOSX/PrizeExample/PrizeExample/._PrizeExample.1
PrizeExample/PrizeExample.xcodeproj/project.pbxproj
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
26CAE27C16A4D240001F4178 /*
Foundation.framework in Frameworks */ = {isa =
PBXBuildFile; fileRef = 26CAE27B16A4D240001F4178 /*
Foundation.framework */; };
26CAE27F16A4D240001F4178 /* main.m in Sources
*/ = {isa = PBXBuildFile; fileRef =
26CAE27E16A4D240001F4178 /* main.m */; };
26CAE28316A4D240001F4178 /* PrizeExample.1 in
CopyFiles */ = {isa = PBXBuildFile; fileRef =
26CAE28216A4D240001F4178 /* PrizeExample.1 */; };
26CAE28B16A4D25B001F4178 /* Prize.m in Sources
*/ = {isa = PBXBuildFile; fileRef =
26CAE28A16A4D25B001F4178 /* Prize.m */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
26CAE27516A4D240001F4178 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
26CAE28316A4D240001F4178 /*
PrizeExample.1 in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 1;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
26CAE27716A4D240001F4178 /* PrizeExample */ =
{isa = PBXFileReference; explicitFileType = "compiled.mach-
o.executable"; includeInIndex = 0; path = PrizeExample;
sourceTree = BUILT_PRODUCTS_DIR; };
26CAE27B16A4D240001F4178 /*
Foundation.framework */ = {isa = PBXFileReference;
lastKnownFileType = wrapper.framework; name =
Foundation.framework; path =
System/Library/Frameworks/Foundation.framework; sourceTree
= SDKROOT; };
26CAE27E16A4D240001F4178 /* main.m */ = {isa =
PBXFileReference; lastKnownFileType = sourcecode.c.objc;
path = main.m; sourceTree = "<group>"; };
26CAE28116A4D240001F4178 /* PrizeExample-
Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType =
sourcecode.c.h; path = "PrizeExample-Prefix.pch"; sourceTree =
"<group>"; };
26CAE28216A4D240001F4178 /* PrizeExample.1 */
= {isa = PBXFileReference; lastKnownFileType = text.man;
path = PrizeExample.1; sourceTree = "<group>"; };
26CAE28916A4D25B001F4178 /* Prize.h */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType =
sourcecode.c.h; path = Prize.h; sourceTree = "<group>"; };
26CAE28A16A4D25B001F4178 /* Prize.m */ = {isa
= PBXFileReference; fileEncoding = 4; lastKnownFileType =
sourcecode.c.objc; path = Prize.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
26CAE27416A4D240001F4178 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
26CAE27C16A4D240001F4178 /*
Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
26CAE26C16A4D240001F4178 = {
isa = PBXGroup;
children = (
26CAE27D16A4D240001F4178 /*
PrizeExample */,
26CAE27A16A4D240001F4178 /*
Frameworks */,
26CAE27816A4D240001F4178 /* Products
*/,
);
sourceTree = "<group>";
};
26CAE27816A4D240001F4178 /* Products */ = {
isa = PBXGroup;
children = (
26CAE27716A4D240001F4178 /*
PrizeExample */,
);
name = Products;
sourceTree = "<group>";
};
26CAE27A16A4D240001F4178 /* Frameworks */ = {
isa = PBXGroup;
children = (
26CAE27B16A4D240001F4178 /*
Foundation.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
26CAE27D16A4D240001F4178 /* PrizeExample */ =
{
isa = PBXGroup;
children = (
26CAE27E16A4D240001F4178 /* main.m
*/,
26CAE28216A4D240001F4178 /*
PrizeExample.1 */,
26CAE28016A4D240001F4178 /*
Supporting Files */,
26CAE28916A4D25B001F4178 /* Prize.h
*/,
26CAE28A16A4D25B001F4178 /* Prize.m
*/,
);
path = PrizeExample;
sourceTree = "<group>";
};
26CAE28016A4D240001F4178 /* Supporting Files */
= {
isa = PBXGroup;
children = (
26CAE28116A4D240001F4178 /*
PrizeExample-Prefix.pch */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
26CAE27616A4D240001F4178 /* PrizeExample */ =
{
isa = PBXNativeTarget;
buildConfigurationList =
26CAE28616A4D240001F4178 /* Build configuration list for
PBXNativeTarget "PrizeExample" */;
buildPhases = (
26CAE27316A4D240001F4178 /* Sources
*/,
26CAE27416A4D240001F4178 /*
Frameworks */,
26CAE27516A4D240001F4178 /*
CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = PrizeExample;
productName = PrizeExample;
productReference =
26CAE27716A4D240001F4178 /* PrizeExample */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
26CAE26E16A4D240001F4178 /* Project object */ =
{
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0510;
ORGANIZATIONNAME = "Kevin Sahr";
};
buildConfigurationList =
26CAE27116A4D240001F4178 /* Build configuration list for
PBXProject "PrizeExample" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 26CAE26C16A4D240001F4178;
productRefGroup =
26CAE27816A4D240001F4178 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
26CAE27616A4D240001F4178 /*
PrizeExample */,
);
};
/* End PBXProject section */
/* Begin PBXSourcesBuildPhase section */
26CAE27316A4D240001F4178 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
26CAE27F16A4D240001F4178 /* main.m
in Sources */,
26CAE28B16A4D25B001F4178 /* Prize.m
in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
26CAE28416A4D240001F4178 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD
= "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH =
YES;
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD =
gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS =
YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN =
NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE =
YES;
GCC_WARN_UNINITIALIZED_AUTOS =
YES;
GCC_WARN_UNUSED_VARIABLE =
YES;
MACOSX_DEPLOYMENT_TARGET =
10.8;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
};
name = Debug;
};
26CAE28516A4D240001F4178 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD
= "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH =
YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT =
"dwarf-with-dsym";
GCC_C_LANGUAGE_STANDARD =
gnu99;
GCC_ENABLE_OBJC_EXCEPTIONS =
YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE =
YES;
GCC_WARN_UNINITIALIZED_AUTOS =
YES;
GCC_WARN_UNUSED_VARIABLE =
YES;
MACOSX_DEPLOYMENT_TARGET =
10.8;
SDKROOT = macosx;
};
name = Release;
};
26CAE28716A4D240001F4178 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER =
YES;
GCC_PREFIX_HEADER =
"PrizeExample/PrizeExample-Prefix.pch";
PRODUCT_NAME =
"$(TARGET_NAME)";
};
name = Debug;
};
26CAE28816A4D240001F4178 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER =
YES;
GCC_PREFIX_HEADER =
"PrizeExample/PrizeExample-Prefix.pch";
PRODUCT_NAME =
"$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
26CAE27116A4D240001F4178 /* Build configuration
list for PBXProject "PrizeExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
26CAE28416A4D240001F4178 /* Debug
*/,
26CAE28516A4D240001F4178 /* Release
*/,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
26CAE28616A4D240001F4178 /* Build configuration
list for PBXNativeTarget "PrizeExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
26CAE28716A4D240001F4178 /* Debug
*/,
26CAE28816A4D240001F4178 /* Release
*/,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 26CAE26E16A4D240001F4178 /* Project
object */;
}
PrizeExample/PrizeExample.xcodeproj/project.xcworkspace/con
tents.xcworkspacedata
PrizeExample/PrizeExample.xcodeproj/project.xcworkspace/xcu
serdata/sahrk.xcuserdatad/UserInterfaceState.xcuserstate
PrizeExample/PrizeExample.xcodeproj/project.xcworkspace/xcu
serdata/sahrk.xcuserdatad/WorkspaceSettings.xcsettings
HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges
SnapshotAutomaticallyBeforeSignificantChanges
PrizeExample/PrizeExample.xcodeproj/xcuserdata/sahrk.xcuser
datad/xcschemes/PrizeExample.xcscheme
PrizeExample/PrizeExample.xcodeproj/xcuserdata/sahrk.xcuser
datad/xcschemes/xcschememanagement.plist
SchemeUserState
PrizeExample.xcscheme
orderHint
0
SuppressBuildableAutocreation
26CAE27616A4D240001F4178
primary
__MACOSX/PrizeExample/._PrizeExample.xcodeproj
CS356 Lab 2: Creating Classes
Complete the following steps in order. Use only messages and
functions discussed in class.
1. Follow Lab 1 steps 1-6 to create a new project named lab02.
Use the same project template as
specified in Lab 1 (i.e., OS X-Application-Command Line
Tool).
2. Now create an empty Prize class by doing the following:
a. Select the lab02 folder (which contains the file main.m) on
the left hand side of the Xcode
window.
b. Choose New-File from the File menu. In the dialog box
choose Source from beneath OS
X, then choose Cocoa Class. Then click Next.
c. In the dialogue box that appears enter Prize for the Class.
Make sure the Subclass of is set
to NSObject. Then click Next. You will be prompted for the
location to create the new file; put
the new file inside the lab02 folder inside your project folder
(note that the folder/file
organization that appears along the left-hand side of the Xcode
window need not necessarily
correspond to the way files are actually organized in your
directories).
3. Enter the code from Prize.h, Prize.m, and main.m that was
handed out in class into the
corresponding files. I highly recommend taking the few minutes
that it will take to actually type
this code in, rather than using copy-and-paste (from which you
will learn nothing). Make sure
the program builds and runs before proceeding.
4. Add a method with the following declaration to your Prize
class:
- (NSString*) valueString
This method should return the string “free” if the price of the
object is 0.0, “inexpensive” if the
price is greater than 0.0 but less than 1000.00, and “expensive”
otherwise. I would recommend
testing this method (and each method below) before continuing,
by experimenting with sending
the message to a Prize object in main.m.
5. Add a method with the following declaration to your Prize
class:
- (BOOL)isBetterThan:(Prize*) prize
This method should return YES if the current object (self) has a
price greater-than-or-equal-to
the passed-in prize, and NO if it does not.
7. Add two instance variables to the Prize class, a string
manufacturer and an integer year
(representing the year the prize was manufactured). Use
properties to define these instance
variables along with their setters and getters.
page � of �1 3
8. Alter the designated initializer initWithName:price: to take
two additional arguments,
corresponding to the new instance variables, and set them
accordingly.
9. Alter the init method so it uses the new designated initializer.
Use UNKNOWN for the
default manufacturer and 2013 for the default year.
10. Alter the makeBoobyPrize method so that the Prize it
creates has a manufacturer of
“Barney” and a year of 2013.
11. Alter the description method so that the string it returns has
the following form:
The value year manufacturer name worth $price.
An example might be:
The expensive 2003 Chevy Corvette worth $20000.00.
Use your valueString method to determine the value field in this
string.
12. Now replace all code in the main method with the following
steps. As above, I recommend
testing each step before proceeding.
a. Create an NSMutableArray.
b. Add Prize objects with the following values to the array, in
the order specified:
2003 Chevy Corvette worth $20,000.00
2009 Maytag washing-machine worth $650.00
A Booby-Prize created using the makeBoobyPrize: class method
2010 Carnival Cruise worth $5,000.00
2013 Bob’s Mansion worth 500,000.00
1999 Worlitzer organ worth $2,500.00
c. Print-out all objects in the array.
d. Using isBetterThan: messages, determine which of the
objects in the array is the best
Prize. Print-out the best prize.
13. Now repeat step 2 to create a class called PrizeChest. This
class should meet the following
criteria:
a. The class should have a single instance variable, an
NSMutableArray to hold prizes. We
don’t want users to directly set/get this array, so it should be
explicitly declared as an instance
variable (i.e., do not use a property).
page � of �2 3
b. The class should have one initializer named init, which will
be the designated
initializer. The initializer should create the prize array and add
to it the six prizes listed in step
12b above (hint: copy-and-paste is your friend here).
c. Override the description method so that it creates and returns
a string containing all of the
prizes in the array, one-per-line.
c. Add a method prizeAtIndex: that returns the prize at the
specified index.
d. Add a method bestPrize which finds (as per step 12d above)
and returns the best prize
in the array.
e. Add a method findBoobyPrizeIndex that finds and returns the
index of the booby
prize in the array. The booby prize can be determined by
looking through the array for the prize
whose name is “BOOBY PRIZE”.
f. Add a method shufflePrizes that shuffles the positions of the
prizes in the array. Use
the following algorithm:
FOR EACH array index curIndex DO
prize1 ← object at curIndex
randIndex ← random array index
prize2 ← object at randIndex
replace object at curIndex with prize2
replace object at randIndex with prize1
END FOR
g. After the array is populated in the init method send the
message shufflePrizes to
self.
14. Add the following steps to your main method:
a. Create a PrizeChest object.
b. Output the PrizeChest object.
c. Output the best prize in the PrizeChest (using the appropriate
message to determine
which is the best prize).
d. Output the index of the booby prize in the PrizeChest (using
the appropriate message to
determine the index).
15. Run your program and submit the output in a text file.
Compress your project by choosing
your project folder (in Finder) and then choosing File Menu-
Compress. Upload the output file
and the compressed project to Moodle for submission.
page � of �3 3
CS356 Lab 1: Getting Started with Xcode and Objective-C
Complete the following steps in order. Note that your program
may only use the classes and
messages listed on the last page of this lab. You may not use
array [] syntax for this lab.
1. Launch Xcode (which resides in the Applications folder).
2. Choose Create a new Xcode project from the splash screen
that appears. (Note that you can
always create a new project from inside Xcode by choosing File
Menu - New - Project).
3. A dialog box will appear where you will specify the type of
project you want to create.
Choose Application from beneath OS X (on left hand side of the
dialog box), then Command
Line Tool. Then click Next.
4. In the next dialog box enter lab01 as the name for your
project in the Product Name field.
Xcode requires that you enter something in the Company
Identifier field; enter “SOU” (or a
company name of your choice). Set the Language to Objective-
C (that should be the default).
Then click Next.
5. You will be presented with a file chooser dialog. Navigate to
a place where you would like to
save your project. Then click Create. Note that local drives on
lab machines are not guaranteed
to preserve your files. I recommend saving your projects on
your P: drive.
6. You should now be in the Xcode project window for your
newly created project. The source
code files in the project are listed in the pane on the left-hand
side. In this case a single
Objective-C source code file has been created for you, called
main.m. Click on this file and you
will see its content in the text editor, which occupies the center
pane. This contains default code
supplied by Apple that outputs “Hello World”.
7. Now click the Build & Run button (the “play” button in the
top left corner). This will build
(compile & link) the template program into an executable and
then, assuming there are no errors,
the program will be run with output going to the All Output
pane (which will appear when
needed). Try removing a semi-colon from the NSLog statement
to see how Xcode reports errors.
Click on the red dot to the left of the error line and note that
Xcode will suggest a fix for the
error for you (accept the fix by hitting return).
8. Now delete the NSLog statement (inside the
@autoreleasepool block statement). Replace
with a program that does the following, using only classes and
messages listed on the next page.
Do not use array [] syntax.
page � of �1 3
In each step do not make assumptions about the array contents
based on the prior steps (e.g., the
number of elements in the array, the contents of the first
element, etc.).
a. Create a mutable array object, which will contain strings
representing presents.
b. Add the three strings “Car”, “Vacation”, and “Fridge” to the
array.
c. Add the names of two more presents you’ve received to the
end of the array.
d. Replace the second element in the array with the name of a
present you have received.
e. Replace the last element in the array with the name of
another present you’ve received.
f. For each object in the array, output a sentence containing the
index, name, length of the
name, and price of that object. The price should be formatted as
money. Use the following
formula to determine the price (where ndx is the array index of
the object):
price = 102.66 * (ndx + 15)
g. Build a single NSString object containing all of the objects
in the array on a single line
separated by commas. Then output that string.
9. Run your program and copy-and-paste the output into a text
file. You can use any text editor
for this (e.g., Apple supplies a simple text editor named
TextEdit). Compress your project by
choosing your project folder (in Finder) and then choosing File
Menu - Compress. Upload the
output file and the compressed project to Moodle for
submission.
page � of �2 3
Allowable Classes and Messages for Lab 1
NSLog function
NSArray/NSMutableArray Class
(Do not use array subscripting (arrayName[]) syntax).
alloc
init
count
addObject:
replaceObjectAtIndex:withObject:
objectAtIndex:
NSString/NSMutableString Class
alloc
init
initWithString:
initWithFormat:
length
stringByAppendingString:
page � of �3 3

More Related Content

Similar to PrizeExample.DS_Store__MACOSXPrizeExample._.DS_StoreP.docx

Migrating Legacy Rails Apps to Rails 3
Migrating Legacy Rails Apps to Rails 3Migrating Legacy Rails Apps to Rails 3
Migrating Legacy Rails Apps to Rails 3
Clinton Dreisbach
 
Git
GitGit
Explore the Rake Gem
Explore the Rake GemExplore the Rake Gem
Explore the Rake Gem
Rudy R. Yazdi
 
GIT Basics
GIT BasicsGIT Basics
GIT Basics
Tagged Social
 
Git::Hooks
Git::HooksGit::Hooks
Git::Hooks
Mikko Koivunalho
 
git session --interactive
git session --interactivegit session --interactive
git session --interactive
Marius Colacioiu
 
Puppet loves RSpec, why you should, too
Puppet loves RSpec, why you should, tooPuppet loves RSpec, why you should, too
Puppet loves RSpec, why you should, too
Dennis Rowe
 
Puppet Loves RSpec, Why You Should, Too
Puppet Loves RSpec, Why You Should, TooPuppet Loves RSpec, Why You Should, Too
Puppet Loves RSpec, Why You Should, Too
Puppet
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
Victor Wong
 
Tool Time
Tool TimeTool Time
Tool Time
Ken Collins
 
How to use git without rage
How to use git without rageHow to use git without rage
How to use git without rage
Javier Lafora Rey
 
How to Really Get Git
How to Really Get GitHow to Really Get Git
How to Really Get Git
Susan Tan
 
Gitosis on Mac OS X Server
Gitosis on Mac OS X ServerGitosis on Mac OS X Server
Gitosis on Mac OS X Server
Yasuhiro Asaka
 
Becoming a Git Master - Nicola Paolucci
Becoming a Git Master - Nicola PaolucciBecoming a Git Master - Nicola Paolucci
Becoming a Git Master - Nicola Paolucci
Atlassian
 
TYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase frameworkTYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase framework
Christian Trabold
 
Git in pills : git stash
Git in pills : git stashGit in pills : git stash
Git in pills : git stash
Federico Panini
 
Becoming a Git Master
Becoming a Git MasterBecoming a Git Master
Becoming a Git Master
Nicola Paolucci
 
Git - Get Ready To Use It
Git - Get Ready To Use ItGit - Get Ready To Use It
Git - Get Ready To Use It
Daniel Kummer
 
Github - Le Wagon Melbourne
Github - Le Wagon MelbourneGithub - Le Wagon Melbourne
Github - Le Wagon Melbourne
Paal Ringstad
 
How To Install GitLab As Your Private GitHub Clone
How To Install GitLab As Your Private GitHub CloneHow To Install GitLab As Your Private GitHub Clone
How To Install GitLab As Your Private GitHub Clone
VEXXHOST Private Cloud
 

Similar to PrizeExample.DS_Store__MACOSXPrizeExample._.DS_StoreP.docx (20)

Migrating Legacy Rails Apps to Rails 3
Migrating Legacy Rails Apps to Rails 3Migrating Legacy Rails Apps to Rails 3
Migrating Legacy Rails Apps to Rails 3
 
Git
GitGit
Git
 
Explore the Rake Gem
Explore the Rake GemExplore the Rake Gem
Explore the Rake Gem
 
GIT Basics
GIT BasicsGIT Basics
GIT Basics
 
Git::Hooks
Git::HooksGit::Hooks
Git::Hooks
 
git session --interactive
git session --interactivegit session --interactive
git session --interactive
 
Puppet loves RSpec, why you should, too
Puppet loves RSpec, why you should, tooPuppet loves RSpec, why you should, too
Puppet loves RSpec, why you should, too
 
Puppet Loves RSpec, Why You Should, Too
Puppet Loves RSpec, Why You Should, TooPuppet Loves RSpec, Why You Should, Too
Puppet Loves RSpec, Why You Should, Too
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
 
Tool Time
Tool TimeTool Time
Tool Time
 
How to use git without rage
How to use git without rageHow to use git without rage
How to use git without rage
 
How to Really Get Git
How to Really Get GitHow to Really Get Git
How to Really Get Git
 
Gitosis on Mac OS X Server
Gitosis on Mac OS X ServerGitosis on Mac OS X Server
Gitosis on Mac OS X Server
 
Becoming a Git Master - Nicola Paolucci
Becoming a Git Master - Nicola PaolucciBecoming a Git Master - Nicola Paolucci
Becoming a Git Master - Nicola Paolucci
 
TYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase frameworkTYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase framework
 
Git in pills : git stash
Git in pills : git stashGit in pills : git stash
Git in pills : git stash
 
Becoming a Git Master
Becoming a Git MasterBecoming a Git Master
Becoming a Git Master
 
Git - Get Ready To Use It
Git - Get Ready To Use ItGit - Get Ready To Use It
Git - Get Ready To Use It
 
Github - Le Wagon Melbourne
Github - Le Wagon MelbourneGithub - Le Wagon Melbourne
Github - Le Wagon Melbourne
 
How To Install GitLab As Your Private GitHub Clone
How To Install GitLab As Your Private GitHub CloneHow To Install GitLab As Your Private GitHub Clone
How To Install GitLab As Your Private GitHub Clone
 

More from ChantellPantoja184

Problem 1Problem 2.docx
Problem 1Problem 2.docxProblem 1Problem 2.docx
Problem 1Problem 2.docx
ChantellPantoja184
 
Problem 20-1A Production cost flow and measurement; journal entrie.docx
Problem 20-1A Production cost flow and measurement; journal entrie.docxProblem 20-1A Production cost flow and measurement; journal entrie.docx
Problem 20-1A Production cost flow and measurement; journal entrie.docx
ChantellPantoja184
 
Problem 2 Obtain Io.Let x be the current through j2, ..docx
Problem 2 Obtain Io.Let x be the current through j2, ..docxProblem 2 Obtain Io.Let x be the current through j2, ..docx
Problem 2 Obtain Io.Let x be the current through j2, ..docx
ChantellPantoja184
 
Problem 1On April 1, 20X4, Rojas purchased land by giving $100,000.docx
Problem 1On April 1, 20X4, Rojas purchased land by giving $100,000.docxProblem 1On April 1, 20X4, Rojas purchased land by giving $100,000.docx
Problem 1On April 1, 20X4, Rojas purchased land by giving $100,000.docx
ChantellPantoja184
 
Problem 17-1 Dividends and Taxes [LO2]Dark Day, Inc., has declar.docx
Problem 17-1 Dividends and Taxes [LO2]Dark Day, Inc., has declar.docxProblem 17-1 Dividends and Taxes [LO2]Dark Day, Inc., has declar.docx
Problem 17-1 Dividends and Taxes [LO2]Dark Day, Inc., has declar.docx
ChantellPantoja184
 
Problem 1Problem 1 - Constant-Growth Common StockWhat is the value.docx
Problem 1Problem 1 - Constant-Growth Common StockWhat is the value.docxProblem 1Problem 1 - Constant-Growth Common StockWhat is the value.docx
Problem 1Problem 1 - Constant-Growth Common StockWhat is the value.docx
ChantellPantoja184
 
Problem 1Prescott, Inc., manufactures bookcases and uses an activi.docx
Problem 1Prescott, Inc., manufactures bookcases and uses an activi.docxProblem 1Prescott, Inc., manufactures bookcases and uses an activi.docx
Problem 1Prescott, Inc., manufactures bookcases and uses an activi.docx
ChantellPantoja184
 
Problem 1Preston Recliners manufactures leather recliners and uses.docx
Problem 1Preston Recliners manufactures leather recliners and uses.docxProblem 1Preston Recliners manufactures leather recliners and uses.docx
Problem 1Preston Recliners manufactures leather recliners and uses.docx
ChantellPantoja184
 
Problem 1Pro Forma Income Statement and Balance SheetBelow is the .docx
Problem 1Pro Forma Income Statement and Balance SheetBelow is the .docxProblem 1Pro Forma Income Statement and Balance SheetBelow is the .docx
Problem 1Pro Forma Income Statement and Balance SheetBelow is the .docx
ChantellPantoja184
 
Problem 2-1PROBLEM 2-1Solution Legend= Value given in problemGiven.docx
Problem 2-1PROBLEM 2-1Solution Legend= Value given in problemGiven.docxProblem 2-1PROBLEM 2-1Solution Legend= Value given in problemGiven.docx
Problem 2-1PROBLEM 2-1Solution Legend= Value given in problemGiven.docx
ChantellPantoja184
 
PROBLEM 14-6AProblem 14-6A Norwoods Borrowings1. Total amount of .docx
PROBLEM 14-6AProblem 14-6A Norwoods Borrowings1. Total amount of .docxPROBLEM 14-6AProblem 14-6A Norwoods Borrowings1. Total amount of .docx
PROBLEM 14-6AProblem 14-6A Norwoods Borrowings1. Total amount of .docx
ChantellPantoja184
 
Problem 13-3AThe stockholders’ equity accounts of Ashley Corpo.docx
Problem 13-3AThe stockholders’ equity accounts of Ashley Corpo.docxProblem 13-3AThe stockholders’ equity accounts of Ashley Corpo.docx
Problem 13-3AThe stockholders’ equity accounts of Ashley Corpo.docx
ChantellPantoja184
 
Problem 12-9AYour answer is partially correct.  Try again..docx
Problem 12-9AYour answer is partially correct.  Try again..docxProblem 12-9AYour answer is partially correct.  Try again..docx
Problem 12-9AYour answer is partially correct.  Try again..docx
ChantellPantoja184
 
Problem 1123456Xf122437455763715813910106Name DateTopic.docx
Problem 1123456Xf122437455763715813910106Name DateTopic.docxProblem 1123456Xf122437455763715813910106Name DateTopic.docx
Problem 1123456Xf122437455763715813910106Name DateTopic.docx
ChantellPantoja184
 
Problem 1. For the truss and loading shown below, calculate th.docx
Problem 1. For the truss and loading shown below, calculate th.docxProblem 1. For the truss and loading shown below, calculate th.docx
Problem 1. For the truss and loading shown below, calculate th.docx
ChantellPantoja184
 
Problem 1 (30 marks)Review enough information about .docx
Problem 1 (30 marks)Review enough information about .docxProblem 1 (30 marks)Review enough information about .docx
Problem 1 (30 marks)Review enough information about .docx
ChantellPantoja184
 
Problem 1 (10 points) Note that an eigenvector cannot be zero.docx
Problem 1 (10 points) Note that an eigenvector cannot be zero.docxProblem 1 (10 points) Note that an eigenvector cannot be zero.docx
Problem 1 (10 points) Note that an eigenvector cannot be zero.docx
ChantellPantoja184
 
Probation and Parole 3Running head Probation and Parole.docx
Probation and Parole 3Running head Probation and Parole.docxProbation and Parole 3Running head Probation and Parole.docx
Probation and Parole 3Running head Probation and Parole.docx
ChantellPantoja184
 
Problem 1(a) Complete the following ANOVA table based on 20 obs.docx
Problem 1(a) Complete the following ANOVA table based on 20 obs.docxProblem 1(a) Complete the following ANOVA table based on 20 obs.docx
Problem 1(a) Complete the following ANOVA table based on 20 obs.docx
ChantellPantoja184
 
Probe 140 SPrecipitation in inchesTemperature in F.docx
Probe 140 SPrecipitation in inchesTemperature in F.docxProbe 140 SPrecipitation in inchesTemperature in F.docx
Probe 140 SPrecipitation in inchesTemperature in F.docx
ChantellPantoja184
 

More from ChantellPantoja184 (20)

Problem 1Problem 2.docx
Problem 1Problem 2.docxProblem 1Problem 2.docx
Problem 1Problem 2.docx
 
Problem 20-1A Production cost flow and measurement; journal entrie.docx
Problem 20-1A Production cost flow and measurement; journal entrie.docxProblem 20-1A Production cost flow and measurement; journal entrie.docx
Problem 20-1A Production cost flow and measurement; journal entrie.docx
 
Problem 2 Obtain Io.Let x be the current through j2, ..docx
Problem 2 Obtain Io.Let x be the current through j2, ..docxProblem 2 Obtain Io.Let x be the current through j2, ..docx
Problem 2 Obtain Io.Let x be the current through j2, ..docx
 
Problem 1On April 1, 20X4, Rojas purchased land by giving $100,000.docx
Problem 1On April 1, 20X4, Rojas purchased land by giving $100,000.docxProblem 1On April 1, 20X4, Rojas purchased land by giving $100,000.docx
Problem 1On April 1, 20X4, Rojas purchased land by giving $100,000.docx
 
Problem 17-1 Dividends and Taxes [LO2]Dark Day, Inc., has declar.docx
Problem 17-1 Dividends and Taxes [LO2]Dark Day, Inc., has declar.docxProblem 17-1 Dividends and Taxes [LO2]Dark Day, Inc., has declar.docx
Problem 17-1 Dividends and Taxes [LO2]Dark Day, Inc., has declar.docx
 
Problem 1Problem 1 - Constant-Growth Common StockWhat is the value.docx
Problem 1Problem 1 - Constant-Growth Common StockWhat is the value.docxProblem 1Problem 1 - Constant-Growth Common StockWhat is the value.docx
Problem 1Problem 1 - Constant-Growth Common StockWhat is the value.docx
 
Problem 1Prescott, Inc., manufactures bookcases and uses an activi.docx
Problem 1Prescott, Inc., manufactures bookcases and uses an activi.docxProblem 1Prescott, Inc., manufactures bookcases and uses an activi.docx
Problem 1Prescott, Inc., manufactures bookcases and uses an activi.docx
 
Problem 1Preston Recliners manufactures leather recliners and uses.docx
Problem 1Preston Recliners manufactures leather recliners and uses.docxProblem 1Preston Recliners manufactures leather recliners and uses.docx
Problem 1Preston Recliners manufactures leather recliners and uses.docx
 
Problem 1Pro Forma Income Statement and Balance SheetBelow is the .docx
Problem 1Pro Forma Income Statement and Balance SheetBelow is the .docxProblem 1Pro Forma Income Statement and Balance SheetBelow is the .docx
Problem 1Pro Forma Income Statement and Balance SheetBelow is the .docx
 
Problem 2-1PROBLEM 2-1Solution Legend= Value given in problemGiven.docx
Problem 2-1PROBLEM 2-1Solution Legend= Value given in problemGiven.docxProblem 2-1PROBLEM 2-1Solution Legend= Value given in problemGiven.docx
Problem 2-1PROBLEM 2-1Solution Legend= Value given in problemGiven.docx
 
PROBLEM 14-6AProblem 14-6A Norwoods Borrowings1. Total amount of .docx
PROBLEM 14-6AProblem 14-6A Norwoods Borrowings1. Total amount of .docxPROBLEM 14-6AProblem 14-6A Norwoods Borrowings1. Total amount of .docx
PROBLEM 14-6AProblem 14-6A Norwoods Borrowings1. Total amount of .docx
 
Problem 13-3AThe stockholders’ equity accounts of Ashley Corpo.docx
Problem 13-3AThe stockholders’ equity accounts of Ashley Corpo.docxProblem 13-3AThe stockholders’ equity accounts of Ashley Corpo.docx
Problem 13-3AThe stockholders’ equity accounts of Ashley Corpo.docx
 
Problem 12-9AYour answer is partially correct.  Try again..docx
Problem 12-9AYour answer is partially correct.  Try again..docxProblem 12-9AYour answer is partially correct.  Try again..docx
Problem 12-9AYour answer is partially correct.  Try again..docx
 
Problem 1123456Xf122437455763715813910106Name DateTopic.docx
Problem 1123456Xf122437455763715813910106Name DateTopic.docxProblem 1123456Xf122437455763715813910106Name DateTopic.docx
Problem 1123456Xf122437455763715813910106Name DateTopic.docx
 
Problem 1. For the truss and loading shown below, calculate th.docx
Problem 1. For the truss and loading shown below, calculate th.docxProblem 1. For the truss and loading shown below, calculate th.docx
Problem 1. For the truss and loading shown below, calculate th.docx
 
Problem 1 (30 marks)Review enough information about .docx
Problem 1 (30 marks)Review enough information about .docxProblem 1 (30 marks)Review enough information about .docx
Problem 1 (30 marks)Review enough information about .docx
 
Problem 1 (10 points) Note that an eigenvector cannot be zero.docx
Problem 1 (10 points) Note that an eigenvector cannot be zero.docxProblem 1 (10 points) Note that an eigenvector cannot be zero.docx
Problem 1 (10 points) Note that an eigenvector cannot be zero.docx
 
Probation and Parole 3Running head Probation and Parole.docx
Probation and Parole 3Running head Probation and Parole.docxProbation and Parole 3Running head Probation and Parole.docx
Probation and Parole 3Running head Probation and Parole.docx
 
Problem 1(a) Complete the following ANOVA table based on 20 obs.docx
Problem 1(a) Complete the following ANOVA table based on 20 obs.docxProblem 1(a) Complete the following ANOVA table based on 20 obs.docx
Problem 1(a) Complete the following ANOVA table based on 20 obs.docx
 
Probe 140 SPrecipitation in inchesTemperature in F.docx
Probe 140 SPrecipitation in inchesTemperature in F.docxProbe 140 SPrecipitation in inchesTemperature in F.docx
Probe 140 SPrecipitation in inchesTemperature in F.docx
 

Recently uploaded

REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdfREASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
giancarloi8888
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
MJDuyan
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
TechSoup
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
nitinpv4ai
 
How Barcodes Can Be Leveraged Within Odoo 17
How Barcodes Can Be Leveraged Within Odoo 17How Barcodes Can Be Leveraged Within Odoo 17
How Barcodes Can Be Leveraged Within Odoo 17
Celine George
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
RamseyBerglund
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
TechSoup
 
Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10
nitinpv4ai
 
MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025
khuleseema60
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
Krassimira Luka
 
Stack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 MicroprocessorStack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 Microprocessor
JomonJoseph58
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
nitinpv4ai
 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
heathfieldcps1
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
haiqairshad
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"
National Information Standards Organization (NISO)
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
Nguyen Thanh Tu Collection
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
سمير بسيوني
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
National Information Standards Organization (NISO)
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 

Recently uploaded (20)

REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdfREASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
 
How Barcodes Can Be Leveraged Within Odoo 17
How Barcodes Can Be Leveraged Within Odoo 17How Barcodes Can Be Leveraged Within Odoo 17
How Barcodes Can Be Leveraged Within Odoo 17
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
 
Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10
 
MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
 
Stack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 MicroprocessorStack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 Microprocessor
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 

PrizeExample.DS_Store__MACOSXPrizeExample._.DS_StoreP.docx

  • 1. PrizeExample/.DS_Store __MACOSX/PrizeExample/._.DS_Store PrizeExample/.git/COMMIT_EDITMSG Initial Commit PrizeExample/.git/config [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true ignorecase = true PrizeExample/.git/description Unnamed repository; edit this file 'description' to name the repository. PrizeExample/.git/HEAD ref: refs/heads/master PrizeExample/.git/hooks/applypatch-msg.sample #!/bin/sh # # An example hook script to check the commit log message taken by # applypatch from an e-mail message. #
  • 2. # The hook should exit with non-zero status after issuing an # appropriate message if it wants to stop the commit. The hook is # allowed to edit the commit message file. # # To enable this hook, rename this file to "applypatch-msg". . git-sh-setup test -x "$GIT_DIR/hooks/commit-msg" && exec "$GIT_DIR/hooks/commit-msg" ${1+"[email protected]"} : PrizeExample/.git/hooks/commit-msg.sample #!/bin/sh # # An example hook script to check the commit log message. # Called by "git commit" with one argument, the name of the file # that has the commit message. The hook should exit with non- zero # status after issuing an appropriate message if it wants to stop the # commit. The hook is allowed to edit the commit message file. # # To enable this hook, rename this file to "commit-msg". # Uncomment the below to add a Signed-off-by line to the message. # Doing this in a hook is a bad idea in general, but the prepare- commit-msg # hook is more suited to it. # # SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^(.*>).*$/Signed-off-by: 1/p')
  • 3. # grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" # This example catches duplicate Signed-off-by lines. test "" = "$(grep '^Signed-off-by: ' "$1" | sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { echo >&2 Duplicate Signed-off-by lines. exit 1 } PrizeExample/.git/hooks/post-update.sample #!/bin/sh # # An example hook script to prepare a packed repository for use over # dumb transports. # # To enable this hook, rename this file to "post-update". exec git update-server-info PrizeExample/.git/hooks/pre-applypatch.sample #!/bin/sh # # An example hook script to verify what is about to be committed # by applypatch from an e-mail message. # # The hook should exit with non-zero status after issuing an # appropriate message if it wants to stop the commit. # # To enable this hook, rename this file to "pre-applypatch". . git-sh-setup
  • 4. test -x "$GIT_DIR/hooks/pre-commit" && exec "$GIT_DIR/hooks/pre-commit" ${1+"[email protected]"} : PrizeExample/.git/hooks/pre-commit.sample #!/bin/sh # # An example hook script to verify what is about to be committed. # Called by "git commit" with no arguments. The hook should # exit with non-zero status after issuing an appropriate message if # it wants to stop the commit. # # To enable this hook, rename this file to "pre-commit". if git rev-parse --verify HEAD >/dev/null 2>&1 then against=HEAD else # Initial commit: diff against an empty tree object against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 fi # If you want to allow non-ascii filenames set this variable to true. allownonascii=$(git config hooks.allownonascii) # Redirect output to stderr. exec 1>&2 # Cross platform projects tend to avoid non-ascii filenames; prevent # them from being added to the repository. We exploit the fact
  • 5. that the # printable range starts at the space character and ends with tilde. if [ "$allownonascii" != "true" ] && # Note that the use of brackets around a tr range is ok here, (it's # even required, for portability to Solaris 10's /usr/bin/tr), since # the square bracket bytes happen to fall in the designated range. test $(git diff --cached --name-only --diff-filter=A -z $against | LC_ALL=C tr -d '[ -~]0' | wc -c) != 0 then echo "Error: Attempt to add a non-ascii file name." echo echo "This can cause problems if you want to work" echo "with people on other platforms." echo echo "To be portable it is advisable to rename the file ..." echo echo "If you know what you are doing you can disable this" echo "check using:" echo echo " git config hooks.allownonascii true" echo exit 1 fi # If there are whitespace errors, print the offending file names and fail. exec git diff-index --check --cached $against -- PrizeExample/.git/hooks/pre-rebase.sample
  • 6. #!/bin/sh # # Copyright (c) 2006, 2008 Junio C Hamano # # The "pre-rebase" hook is run just before "git rebase" starts doing # its job, and can prevent the command from running by exiting with # non-zero status. # # The hook is called with the following parameters: # # $1 -- the upstream the series was forked from. # $2 -- the branch being rebased (or empty when rebasing the current branch). # # This sample shows how to prevent topic branches that are already # merged to 'next' branch from getting rebased, because allowing it # would result in rebasing already published history. publish=next basebranch="$1" if test "$#" = 2 then topic="refs/heads/$2" else topic=`git symbolic-ref HEAD` || exit 0 ;# we do not interrupt rebasing detached HEAD fi case "$topic" in refs/heads/??/*) ;; *)
  • 7. exit 0 ;# we do not interrupt others. ;; esac # Now we are dealing with a topic branch being rebased # on top of master. Is it OK to rebase it? # Does the topic really exist? git show-ref -q "$topic" || { echo >&2 "No such branch $topic" exit 1 } # Is topic fully merged to master? not_in_master=`git rev-list --pretty=oneline ^master "$topic"` if test -z "$not_in_master" then echo >&2 "$topic is fully merged to master; better remove it." exit 1 ;# we could allow it, but there is no point. fi # Is topic ever merged to next? If so you should not be rebasing it. only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` only_next_2=`git rev-list ^master ${publish} | sort` if test "$only_next_1" = "$only_next_2" then not_in_topic=`git rev-list "^$topic" master` if test -z "$not_in_topic" then echo >&2 "$topic is already up-to-date with master" exit 1 ;# we could allow it, but there is no point. else exit 0 fi
  • 8. else not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` /usr/bin/perl -e ' my $topic = $ARGV[0]; my $msg = "* $topic has commits already merged to public branch:n"; my (%not_in_next) = map { /^([0-9a-f]+) /; ($1 => 1); } split(/n/, $ARGV[1]); for my $elem (map { /^([0-9a-f]+) (.*)$/; [$1 => $2]; } split(/n/, $ARGV[2])) { if (!exists $not_in_next{$elem->[0]}) { if ($msg) { print STDERR $msg; undef $msg; } print STDERR " $elem->[1]n"; } } ' "$topic" "$not_in_next" "$not_in_master" exit 1 fi exit 0 ##################################################### ########### This sample hook safeguards topic branches that have been published from being rewound. The workflow assumed here is:
  • 9. * Once a topic branch forks from "master", "master" is never merged into it again (either directly or indirectly). * Once a topic branch is fully cooked and merged into "master", it is deleted. If you need to build on top of it to correct earlier mistakes, a new topic branch is created by forking at the tip of the "master". This is not strictly necessary, but it makes it easier to keep your history simple. * Whenever you need to test or publish your changes to topic branches, merge them into "next" branch. The script, being an example, hardcodes the publish branch name to be "next", but it is trivial to make it configurable via $GIT_DIR/config mechanism. With this workflow, you would want to know: (1) ... if a topic branch has ever been merged to "next". Young topic branches can have stupid mistakes you would rather clean up before publishing, and things that have not been merged into other branches can be easily rebased without affecting other people. But once it is published, you would not want to rewind it. (2) ... if a topic branch has been fully merged to "master". Then you can delete it. More importantly, you should not build on top of it -- other people may already want to change things related to the topic as patches against your "master", so if you need further changes, it is better to fork the topic (perhaps with the same name) afresh from the tip of "master".
  • 10. Let's look at this example: o---o---o---o---o---o---o---o---o---o "next" / / / / / a---a---b A / / / / / / / / c---c---c---c B / / / / / / / / b---b C / / / / / / ---o---o---o---o---o---o---o---o---o---o---o "master" A, B and C are topic branches. * A has one fix since it was merged up to "next". * B has finished. It has been fully merged up to "master" and "next", and is ready to be deleted. * C has not merged to "next" at all. We would want to allow C to be rebased, refuse A, and encourage B to be deleted. To compute (1): git rev-list ^master ^topic next git rev-list ^master next if these match, topic has not merged in next at all. To compute (2):
  • 11. git rev-list master..topic if this is empty, it is fully merged to "master". PrizeExample/.git/hooks/prepare-commit-msg.sample #!/bin/sh # # An example hook script to prepare the commit log message. # Called by "git commit" with the name of the file that has the # commit message, followed by the description of the commit # message's source. The hook's purpose is to edit the commit # message file. If the hook fails with a non-zero status, # the commit is aborted. # # To enable this hook, rename this file to "prepare-commit- msg". # This hook includes three examples. The first comments out the # "Conflicts:" part of a merge commit. # # The second includes the output of "git diff --name-status -r" # into the message, just before the "git status" output. It is # commented because it doesn't cope with --amend or with squashed # commits. # # The third example adds a Signed-off-by line to the message, that can # still be edited. This is rarely a good idea. case "$2,$3" in merge,) /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;;
  • 12. # ,|template,) # /usr/bin/perl -i.bak -pe ' # print "n" . `git diff --cached --name-status -r` # if /^#/ && $first++ == 0' "$1" ;; *) ;; esac # SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^(.*>).*$/Signed-off-by: 1/p') # grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" PrizeExample/.git/hooks/update.sample #!/bin/sh # # An example hook script to blocks unannotated tags from entering. # Called by "git receive-pack" with arguments: refname sha1- old sha1-new # # To enable this hook, rename this file to "update". # # Config # ------ # hooks.allowunannotated # This boolean sets whether unannotated tags will be allowed into the # repository. By default they won't be. # hooks.allowdeletetag # This boolean sets whether deleting tags will be allowed in the # repository. By default they won't be. # hooks.allowmodifytag # This boolean sets whether a tag may be modified after
  • 13. creation. By default # it won't be. # hooks.allowdeletebranch # This boolean sets whether deleting branches will be allowed in the # repository. By default they won't be. # hooks.denycreatebranch # This boolean sets whether remotely creating branches will be denied # in the repository. By default this is allowed. # # --- Command line refname="$1" oldrev="$2" newrev="$3" # --- Safety check if [ -z "$GIT_DIR" ]; then echo "Don't run this script from the command line." >&2 echo " (if you want, you could supply GIT_DIR then run" >&2 echo " $0 <ref> <oldrev> <newrev>)" >&2 exit 1 fi if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then echo "Usage: $0 <ref> <oldrev> <newrev>" >&2 exit 1 fi # --- Config allowunannotated=$(git config --bool hooks.allowunannotated) allowdeletebranch=$(git config --bool hooks.allowdeletebranch) denycreatebranch=$(git config --bool hooks.denycreatebranch) allowdeletetag=$(git config --bool hooks.allowdeletetag)
  • 14. allowmodifytag=$(git config --bool hooks.allowmodifytag) # check for no description projectdesc=$(sed -e '1q' "$GIT_DIR/description") case "$projectdesc" in "Unnamed repository"* | "") echo "*** Project description file hasn't been set" >&2 exit 1 ;; esac # --- Check types # if $newrev is 0000...0000, it's a commit to delete a ref. zero="0000000000000000000000000000000000000000" if [ "$newrev" = "$zero" ]; then newrev_type=delete else newrev_type=$(git cat-file -t $newrev) fi case "$refname","$newrev_type" in refs/tags/*,commit) # un-annotated tag short_refname=${refname##refs/tags/} if [ "$allowunannotated" != "true" ]; then echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 exit 1 fi ;; refs/tags/*,delete) # delete tag if [ "$allowdeletetag" != "true" ]; then echo "*** Deleting a tag is not allowed in this
  • 15. repository" >&2 exit 1 fi ;; refs/tags/*,tag) # annotated tag if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 then echo "*** Tag '$refname' already exists." >&2 echo "*** Modifying a tag is not allowed in this repository." >&2 exit 1 fi ;; refs/heads/*,commit) # branch if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then echo "*** Creating a branch is not allowed in this repository" >&2 exit 1 fi ;; refs/heads/*,delete) # delete branch if [ "$allowdeletebranch" != "true" ]; then echo "*** Deleting a branch is not allowed in this repository" >&2 exit 1 fi ;; refs/remotes/*,commit) # tracking branch ;; refs/remotes/*,delete)
  • 16. # delete tracking branch if [ "$allowdeletebranch" != "true" ]; then echo "*** Deleting a tracking branch is not allowed in this repository" >&2 exit 1 fi ;; *) # Anything else (is there anything else?) echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 exit 1 ;; esac # --- Finished exit 0 PrizeExample/.git/index PrizeExample/.git/info/exclude .DS_Store UserInterface.xcuserstate __MACOSX/PrizeExample/.git/info/._exclude PrizeExample/.git/logs/HEAD 0000000000000000000000000000000000000000 1b22d78d425bcdab7f2280ef764d390b541ab3fb Kevin Sahr <[email protected]> 1358207680 -0800 commit (initial): Initial Commit PrizeExample/.git/logs/refs/heads/master 0000000000000000000000000000000000000000
  • 17. 1b22d78d425bcdab7f2280ef764d390b541ab3fb Kevin Sahr <[email protected]> 1358207680 -0800 commit (initial): Initial Commit PrizeExample/.git/objects/1b/22d78d425bcdab7f2280ef764d390 b541ab3fb PrizeExample/.git/objects/1b/22d78d425bcdab7f2280ef764d390 b541ab3fb commit 185�tree 35d55eb67bdfb12cbe860d3db52958794681d62c author Kevin Sahr <[email protected]> 1358207680 -0800 committer Kevin Sahr <[email protected]> 1358207680 -0800 Initial Commit PrizeExample/.git/objects/35/d55eb67bdfb12cbe860d3db529587 94681d62c PrizeExample/.git/objects/35/d55eb67bdfb12cbe860d3db529587 94681d62c PrizeExample/.git/objects/3a/b1d767f07c83b809b07dd72fcbfd0 123166deb PrizeExample/.git/objects/3a/b1d767f07c83b809b07dd72fcbfd0 123166deb blob 180�// // Prize.m // PrizeExample // // Created by Kevin Sahr on 1/14/13. // Copyright (c) 2013 Kevin Sahr. All rights reserved. // #import "Prize.h"
  • 18. @implementation Prize @end PrizeExample/.git/objects/60/74a1ae75c9d5ed8b13741bacf58bf9 6746e389 PrizeExample/.git/objects/60/74a1ae75c9d5ed8b13741bacf58bf9 6746e389 PrizeExample/.git/objects/61/0f6e9b9fc30502acf43cd43e3b0941 1195232e PrizeExample/.git/objects/61/0f6e9b9fc30502acf43cd43e3b0941 1195232e blob 338�// // main.m // PrizeExample // // Created by Kevin Sahr on 1/14/13. // Copyright (c) 2013 Kevin Sahr. All rights reserved. // #import <Foundation/Foundation.h> int main(int argc, const char * argv[]) { @autoreleasepool { // insert code here... NSLog(@"Hello, World!"); } return 0; }
  • 19. PrizeExample/.git/objects/75/90ab9b291c1261947150dc266324b 57bed28f5 PrizeExample/.git/objects/75/90ab9b291c1261947150dc266324b 57bed28f5 blob 202�// // Prize.h // PrizeExample // // Created by Kevin Sahr on 1/14/13. // Copyright (c) 2013 Kevin Sahr. All rights reserved. // #import <Foundation/Foundation.h> @interface Prize : NSObject @end PrizeExample/.git/objects/89/5ee117fe83ae9655f6124745778b8 ed670e29a PrizeExample/.git/objects/89/5ee117fe83ae9655f6124745778b8 ed670e29a blob 3130�."Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples. ."See Also: ."man mdoc.samples for a complete listing of options ."man mdoc for the short list of editing options ."/usr/share/misc/mdoc.template
  • 20. .Dd 1/14/13 " DATE .Dt PrizeExample 1 " Program name and manual section number .Os Darwin .Sh NAME " Section Header - required - don't modify .Nm PrizeExample, ." The following lines are read in generating the apropos(man - k) database. Use only key ." words here as the database is built based on the words here and in the .ND line. .Nm Other_name_for_same_program(), .Nm Yet another name for the same program. ." Use .Nm macro to designate other names for the documented program. .Nd This line parsed for whatis database. .Sh SYNOPSIS " Section Header - required - don't modify .Nm .Op Fl abcd " [-abcd] .Op Fl a Ar path " [-a path]
  • 21. .Op Ar file " [file] .Op Ar " [file ...] .Ar arg0 " Underlined argument - use .Ar anywhere to underline arg2 ... " Arguments .Sh DESCRIPTION " Section Header - required - don't modify Use the .Nm macro to refer to your program throughout the man page like such: .Nm Underlining is accomplished with the .Ar macro like this: .Ar underlined text . .Pp " Inserts a space A list of items with descriptions: .Bl -tag -width -indent " Begins a tagged list .It item a " Each item preceded by .It macro Description of item a .It item b Description of item b .El " Ends the list
  • 22. .Pp A list of flags and their descriptions: .Bl -tag -width -indent " Differs from above in tag removed .It Fl a "-a flag as a list item Description of -a flag .It Fl b Description of -b flag .El " Ends the list .Pp ." .Sh ENVIRONMENT " May not be needed ." .Bl -tag -width "ENV_VAR_1" -indent " ENV_VAR_1 is width of the string ENV_VAR_1 ." .It Ev ENV_VAR_1 ." Description of ENV_VAR_1 ." .It Ev ENV_VAR_2 ." Description of ENV_VAR_2 ." .El .Sh FILES " File used or created by the topic of the man page
  • 23. .Bl -tag -width "/Users/joeuser/Library/really_long_file_name" -compact .It Pa /usr/share/file_name FILE_1 description .It Pa /Users/joeuser/Library/really_long_file_name FILE_2 description .El " Ends the list ." .Sh DIAGNOSTICS " May not be needed ." .Bl -diag ." .It Diagnostic Tag ." Diagnostic informtion here. ." .It Diagnostic Tag ." Diagnostic informtion here. ." .El .Sh SEE ALSO ." List links in ascending order by section, alphabetically within a section. ." Please do not reference files that do not exist without filing a bug report
  • 24. .Xr a 1 , .Xr b 1 , .Xr c 1 , .Xr a 2 , .Xr b 2 , .Xr a 3 , .Xr b 3 ." .Sh BUGS " Document known, unremedied bugs ." .Sh HISTORY " Document history if command behaves in a unique manner PrizeExample/.git/objects/b6/5acc40fad073706e32c8335f4a5488 c13b1269 PrizeExample/.git/objects/b6/5acc40fad073706e32c8335f4a5488 c13b1269 blob 8207�// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 26CAE27C16A4D240001F4178 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26CAE27B16A4D240001F4178 /* Foundation.framework */; };
  • 25. 26CAE27F16A4D240001F4178 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 26CAE27E16A4D240001F4178 /* main.m */; }; 26CAE28316A4D240001F4178 /* PrizeExample.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 26CAE28216A4D240001F4178 /* PrizeExample.1 */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ 26CAE27516A4D240001F4178 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = /usr/share/man/man1/; dstSubfolderSpec = 0; files = ( 26CAE28316A4D240001F4178 /* PrizeExample.1 in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 1; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 26CAE27716A4D240001F4178 /* PrizeExample */ = {isa = PBXFileReference; explicitFileType = "compiled.mach- o.executable"; includeInIndex = 0; path = PrizeExample; sourceTree = BUILT_PRODUCTS_DIR; }; 26CAE27B16A4D240001F4178 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 26CAE27E16A4D240001F4178 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
  • 26. 26CAE28116A4D240001F4178 /* PrizeExample- Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PrizeExample-Prefix.pch"; sourceTree = "<group>"; }; 26CAE28216A4D240001F4178 /* PrizeExample.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = PrizeExample.1; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 26CAE27416A4D240001F4178 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 26CAE27C16A4D240001F4178 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 26CAE26C16A4D240001F4178 = { isa = PBXGroup; children = ( 26CAE27D16A4D240001F4178 /* PrizeExample */, 26CAE27A16A4D240001F4178 /* Frameworks */, 26CAE27816A4D240001F4178 /* Products */, ); sourceTree = "<group>"; }; 26CAE27816A4D240001F4178 /* Products */ = { isa = PBXGroup;
  • 27. children = ( 26CAE27716A4D240001F4178 /* PrizeExample */, ); name = Products; sourceTree = "<group>"; }; 26CAE27A16A4D240001F4178 /* Frameworks */ = { isa = PBXGroup; children = ( 26CAE27B16A4D240001F4178 /* Foundation.framework */, ); name = Frameworks; sourceTree = "<group>"; }; 26CAE27D16A4D240001F4178 /* PrizeExample */ = { isa = PBXGroup; children = ( 26CAE27E16A4D240001F4178 /* main.m */, 26CAE28216A4D240001F4178 /* PrizeExample.1 */, 26CAE28016A4D240001F4178 /* Supporting Files */, ); path = PrizeExample; sourceTree = "<group>"; }; 26CAE28016A4D240001F4178 /* Supporting Files */ = { isa = PBXGroup; children = ( 26CAE28116A4D240001F4178 /* PrizeExample-Prefix.pch */,
  • 28. ); name = "Supporting Files"; sourceTree = "<group>"; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 26CAE27616A4D240001F4178 /* PrizeExample */ = { isa = PBXNativeTarget; buildConfigurationList = 26CAE28616A4D240001F4178 /* Build configuration list for PBXNativeTarget "PrizeExample" */; buildPhases = ( 26CAE27316A4D240001F4178 /* Sources */, 26CAE27416A4D240001F4178 /* Frameworks */, 26CAE27516A4D240001F4178 /* CopyFiles */, ); buildRules = ( ); dependencies = ( ); name = PrizeExample; productName = PrizeExample; productReference = 26CAE27716A4D240001F4178 /* PrizeExample */; productType = "com.apple.product-type.tool"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 26CAE26E16A4D240001F4178 /* Project object */ = {
  • 29. isa = PBXProject; attributes = { LastUpgradeCheck = 0450; ORGANIZATIONNAME = "Kevin Sahr"; }; buildConfigurationList = 26CAE27116A4D240001F4178 /* Build configuration list for PBXProject "PrizeExample" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = 26CAE26C16A4D240001F4178; productRefGroup = 26CAE27816A4D240001F4178 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 26CAE27616A4D240001F4178 /* PrizeExample */, ); }; /* End PBXProject section */ /* Begin PBXSourcesBuildPhase section */ 26CAE27316A4D240001F4178 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 26CAE27F16A4D240001F4178 /* main.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; };
  • 30. /* End PBXSourcesBuildPhase section */ /* Begin XCBuildConfiguration section */ 26CAE28416A4D240001F4178 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD_64_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES;
  • 31. GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.8; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; }; name = Debug; }; 26CAE28516A4D240001F4178 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD_64_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES;
  • 32. GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.8; SDKROOT = macosx; }; name = Release; }; 26CAE28716A4D240001F4178 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "PrizeExample/PrizeExample-Prefix.pch"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; }; 26CAE28816A4D240001F4178 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "PrizeExample/PrizeExample-Prefix.pch"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 26CAE27116A4D240001F4178 /* Build configuration
  • 33. list for PBXProject "PrizeExample" */ = { isa = XCConfigurationList; buildConfigurations = ( 26CAE28416A4D240001F4178 /* Debug */, 26CAE28516A4D240001F4178 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 26CAE28616A4D240001F4178 /* Build configuration list for PBXNativeTarget "PrizeExample" */ = { isa = XCConfigurationList; buildConfigurations = ( 26CAE28716A4D240001F4178 /* Debug */, 26CAE28816A4D240001F4178 /* Release */, ); defaultConfigurationIsVisible = 0; }; /* End XCConfigurationList section */ }; rootObject = 26CAE26E16A4D240001F4178 /* Project object */; } PrizeExample/.git/objects/c9/bfd921054b2a58b4dc4734e81ca1b a626ecf39 PrizeExample/.git/objects/c9/bfd921054b2a58b4dc4734e81ca1b a626ecf39 PrizeExample/.git/objects/f2/ab0dd5f824e91a68d100d21a81a59 72521f386
  • 34. PrizeExample/.git/objects/f2/ab0dd5f824e91a68d100d21a81a59 72521f386 blob 165�// // Prefix header for all source files of the 'PrizeExample' target in the 'PrizeExample' project // #ifdef __OBJC__ #import <Foundation/Foundation.h> #endif PrizeExample/.git/refs/heads/master 1b22d78d425bcdab7f2280ef764d390b541ab3fb PrizeExample/PrizeExample/main.m // // main.m // PrizeExample // // Created by Kevin Sahr on 1/14/13. // Copyright (c) 2013 Kevin Sahr. All rights reserved. // #import <Foundation/Foundation.h> #import "Prize.h" int main(int argc, const char * argv[]) { @autoreleasepool { Prize *prize = [[Prize alloc] init]; NSLog(@"%@", prize); prize.name = @"Car";
  • 35. prize.price = 25000; NSLog(@"%@", prize); if ([prize isJackpot]) NSLog(@"Jackpot!"); else NSLog(@"Not a jackpot."); Prize *boobyPrize = [Prize makeBoobyPrize]; NSLog(@"%@", boobyPrize); } return 0; } __MACOSX/PrizeExample/PrizeExample/._main.m PrizeExample/PrizeExample/Prize.h // // Prize.h // PrizeExample // // Created by Kevin Sahr on 4/5/14. // Copyright (c) 2013 Kevin Sahr. All rights reserved. // #import <Foundation/Foundation.h> @interface Prize : NSObject { // no instance variables that aren't properties } @property NSString* name; @property float price;
  • 36. + (Prize*)makeBoobyPrize; - (id)initWithName:(NSString*)name price:(float)price; - (BOOL)isJackpot; @end __MACOSX/PrizeExample/PrizeExample/._Prize.h PrizeExample/PrizeExample/Prize.m // // Prize.m // PrizeExample // // Created by Kevin Sahr on 4/5/14. // Copyright (c) 2013 Kevin Sahr. All rights reserved. // #import "Prize.h" @implementation Prize + (Prize*)makeBoobyPrize { Prize *bp = [[Prize alloc] initWithName:@"BOOBY PRIZE" price:0.0]; return bp; } // the designated initializer - (id)initWithName:(NSString *)name price:(float)price { self = [super init]; if (self)
  • 37. { _name = name; _price = price; } return self; } - (id)init { return [self initWithName:@"UNKNOWN" price:0.0]; } - (BOOL)isJackpot { if (self.price > 10000) return YES; else return NO; } - (NSString*)description { NSString* s = [NSString stringWithFormat:@"The %@ worth $%.2f.", self.name, self.price]; return s; } @end __MACOSX/PrizeExample/PrizeExample/._Prize.m PrizeExample/PrizeExample/PrizeExample-Prefix.pch //
  • 38. // Prefix header for all source files of the 'PrizeExample' target in the 'PrizeExample' project // #ifdef __OBJC__ #import <Foundation/Foundation.h> #endif __MACOSX/PrizeExample/PrizeExample/._PrizeExample- Prefix.pch PrizeExample/PrizeExample/PrizeExample.1 ."Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples. ."See Also: ."man mdoc.samples for a complete listing of options ."man mdoc for the short list of editing options ."/usr/share/misc/mdoc.template .Dd 1/14/13 " DATE .Dt PrizeExample 1 " Program name and manual section number .Os Darwin .Sh NAME " Section Header - required - don't modify .Nm PrizeExample,
  • 39. ." The following lines are read in generating the apropos(man - k) database. Use only key ." words here as the database is built based on the words here and in the .ND line. .Nm Other_name_for_same_program(), .Nm Yet another name for the same program. ." Use .Nm macro to designate other names for the documented program. .Nd This line parsed for whatis database. .Sh SYNOPSIS " Section Header - required - don't modify .Nm .Op Fl abcd " [-abcd] .Op Fl a Ar path " [-a path] .Op Ar file " [file] .Op Ar " [file ...] .Ar arg0 " Underlined argument - use .Ar anywhere to underline arg2 ... " Arguments .Sh DESCRIPTION " Section Header - required - don't modify
  • 40. Use the .Nm macro to refer to your program throughout the man page like such: .Nm Underlining is accomplished with the .Ar macro like this: .Ar underlined text . .Pp " Inserts a space A list of items with descriptions: .Bl -tag -width -indent " Begins a tagged list .It item a " Each item preceded by .It macro Description of item a .It item b Description of item b .El " Ends the list .Pp A list of flags and their descriptions: .Bl -tag -width -indent " Differs from above in tag removed .It Fl a "-a flag as a list item Description of -a flag .It Fl b
  • 41. Description of -b flag .El " Ends the list .Pp ." .Sh ENVIRONMENT " May not be needed ." .Bl -tag -width "ENV_VAR_1" -indent " ENV_VAR_1 is width of the string ENV_VAR_1 ." .It Ev ENV_VAR_1 ." Description of ENV_VAR_1 ." .It Ev ENV_VAR_2 ." Description of ENV_VAR_2 ." .El .Sh FILES " File used or created by the topic of the man page .Bl -tag -width "/Users/joeuser/Library/really_long_file_name" -compact .It Pa /usr/share/file_name FILE_1 description .It Pa /Users/joeuser/Library/really_long_file_name FILE_2 description
  • 42. .El " Ends the list ." .Sh DIAGNOSTICS " May not be needed ." .Bl -diag ." .It Diagnostic Tag ." Diagnostic informtion here. ." .It Diagnostic Tag ." Diagnostic informtion here. ." .El .Sh SEE ALSO ." List links in ascending order by section, alphabetically within a section. ." Please do not reference files that do not exist without filing a bug report .Xr a 1 , .Xr b 1 , .Xr c 1 , .Xr a 2 , .Xr b 2 , .Xr a 3 ,
  • 43. .Xr b 3 ." .Sh BUGS " Document known, unremedied bugs ." .Sh HISTORY " Document history if command behaves in a unique manner __MACOSX/PrizeExample/PrizeExample/._PrizeExample.1 PrizeExample/PrizeExample.xcodeproj/project.pbxproj // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 26CAE27C16A4D240001F4178 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26CAE27B16A4D240001F4178 /* Foundation.framework */; }; 26CAE27F16A4D240001F4178 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 26CAE27E16A4D240001F4178 /* main.m */; }; 26CAE28316A4D240001F4178 /* PrizeExample.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 26CAE28216A4D240001F4178 /* PrizeExample.1 */; }; 26CAE28B16A4D25B001F4178 /* Prize.m in Sources */ = {isa = PBXBuildFile; fileRef = 26CAE28A16A4D25B001F4178 /* Prize.m */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ 26CAE27516A4D240001F4178 /* CopyFiles */ = {
  • 44. isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = /usr/share/man/man1/; dstSubfolderSpec = 0; files = ( 26CAE28316A4D240001F4178 /* PrizeExample.1 in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 1; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 26CAE27716A4D240001F4178 /* PrizeExample */ = {isa = PBXFileReference; explicitFileType = "compiled.mach- o.executable"; includeInIndex = 0; path = PrizeExample; sourceTree = BUILT_PRODUCTS_DIR; }; 26CAE27B16A4D240001F4178 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 26CAE27E16A4D240001F4178 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; 26CAE28116A4D240001F4178 /* PrizeExample- Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PrizeExample-Prefix.pch"; sourceTree = "<group>"; }; 26CAE28216A4D240001F4178 /* PrizeExample.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = PrizeExample.1; sourceTree = "<group>"; }; 26CAE28916A4D25B001F4178 /* Prize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Prize.h; sourceTree = "<group>"; };
  • 45. 26CAE28A16A4D25B001F4178 /* Prize.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Prize.m; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 26CAE27416A4D240001F4178 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 26CAE27C16A4D240001F4178 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 26CAE26C16A4D240001F4178 = { isa = PBXGroup; children = ( 26CAE27D16A4D240001F4178 /* PrizeExample */, 26CAE27A16A4D240001F4178 /* Frameworks */, 26CAE27816A4D240001F4178 /* Products */, ); sourceTree = "<group>"; }; 26CAE27816A4D240001F4178 /* Products */ = { isa = PBXGroup; children = ( 26CAE27716A4D240001F4178 /* PrizeExample */, );
  • 46. name = Products; sourceTree = "<group>"; }; 26CAE27A16A4D240001F4178 /* Frameworks */ = { isa = PBXGroup; children = ( 26CAE27B16A4D240001F4178 /* Foundation.framework */, ); name = Frameworks; sourceTree = "<group>"; }; 26CAE27D16A4D240001F4178 /* PrizeExample */ = { isa = PBXGroup; children = ( 26CAE27E16A4D240001F4178 /* main.m */, 26CAE28216A4D240001F4178 /* PrizeExample.1 */, 26CAE28016A4D240001F4178 /* Supporting Files */, 26CAE28916A4D25B001F4178 /* Prize.h */, 26CAE28A16A4D25B001F4178 /* Prize.m */, ); path = PrizeExample; sourceTree = "<group>"; }; 26CAE28016A4D240001F4178 /* Supporting Files */ = { isa = PBXGroup; children = ( 26CAE28116A4D240001F4178 /* PrizeExample-Prefix.pch */,
  • 47. ); name = "Supporting Files"; sourceTree = "<group>"; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 26CAE27616A4D240001F4178 /* PrizeExample */ = { isa = PBXNativeTarget; buildConfigurationList = 26CAE28616A4D240001F4178 /* Build configuration list for PBXNativeTarget "PrizeExample" */; buildPhases = ( 26CAE27316A4D240001F4178 /* Sources */, 26CAE27416A4D240001F4178 /* Frameworks */, 26CAE27516A4D240001F4178 /* CopyFiles */, ); buildRules = ( ); dependencies = ( ); name = PrizeExample; productName = PrizeExample; productReference = 26CAE27716A4D240001F4178 /* PrizeExample */; productType = "com.apple.product-type.tool"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 26CAE26E16A4D240001F4178 /* Project object */ = {
  • 48. isa = PBXProject; attributes = { LastUpgradeCheck = 0510; ORGANIZATIONNAME = "Kevin Sahr"; }; buildConfigurationList = 26CAE27116A4D240001F4178 /* Build configuration list for PBXProject "PrizeExample" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = 26CAE26C16A4D240001F4178; productRefGroup = 26CAE27816A4D240001F4178 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 26CAE27616A4D240001F4178 /* PrizeExample */, ); }; /* End PBXProject section */ /* Begin PBXSourcesBuildPhase section */ 26CAE27316A4D240001F4178 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 26CAE27F16A4D240001F4178 /* main.m in Sources */, 26CAE28B16A4D25B001F4178 /* Prize.m in Sources */, );
  • 49. runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin XCBuildConfiguration section */ 26CAE28416A4D240001F4178 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES;
  • 50. GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.8; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; }; name = Debug; }; 26CAE28516A4D240001F4178 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES;
  • 51. MACOSX_DEPLOYMENT_TARGET = 10.8; SDKROOT = macosx; }; name = Release; }; 26CAE28716A4D240001F4178 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "PrizeExample/PrizeExample-Prefix.pch"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; }; 26CAE28816A4D240001F4178 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "PrizeExample/PrizeExample-Prefix.pch"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 26CAE27116A4D240001F4178 /* Build configuration list for PBXProject "PrizeExample" */ = { isa = XCConfigurationList;
  • 52. buildConfigurations = ( 26CAE28416A4D240001F4178 /* Debug */, 26CAE28516A4D240001F4178 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 26CAE28616A4D240001F4178 /* Build configuration list for PBXNativeTarget "PrizeExample" */ = { isa = XCConfigurationList; buildConfigurations = ( 26CAE28716A4D240001F4178 /* Debug */, 26CAE28816A4D240001F4178 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 26CAE26E16A4D240001F4178 /* Project object */; } PrizeExample/PrizeExample.xcodeproj/project.xcworkspace/con tents.xcworkspacedata PrizeExample/PrizeExample.xcodeproj/project.xcworkspace/xcu serdata/sahrk.xcuserdatad/UserInterfaceState.xcuserstate PrizeExample/PrizeExample.xcodeproj/project.xcworkspace/xcu
  • 54. __MACOSX/PrizeExample/._PrizeExample.xcodeproj CS356 Lab 2: Creating Classes Complete the following steps in order. Use only messages and functions discussed in class. 1. Follow Lab 1 steps 1-6 to create a new project named lab02. Use the same project template as specified in Lab 1 (i.e., OS X-Application-Command Line Tool). 2. Now create an empty Prize class by doing the following: a. Select the lab02 folder (which contains the file main.m) on the left hand side of the Xcode window. b. Choose New-File from the File menu. In the dialog box choose Source from beneath OS X, then choose Cocoa Class. Then click Next. c. In the dialogue box that appears enter Prize for the Class. Make sure the Subclass of is set to NSObject. Then click Next. You will be prompted for the location to create the new file; put the new file inside the lab02 folder inside your project folder (note that the folder/file organization that appears along the left-hand side of the Xcode window need not necessarily correspond to the way files are actually organized in your directories).
  • 55. 3. Enter the code from Prize.h, Prize.m, and main.m that was handed out in class into the corresponding files. I highly recommend taking the few minutes that it will take to actually type this code in, rather than using copy-and-paste (from which you will learn nothing). Make sure the program builds and runs before proceeding. 4. Add a method with the following declaration to your Prize class: - (NSString*) valueString This method should return the string “free” if the price of the object is 0.0, “inexpensive” if the price is greater than 0.0 but less than 1000.00, and “expensive” otherwise. I would recommend testing this method (and each method below) before continuing, by experimenting with sending the message to a Prize object in main.m. 5. Add a method with the following declaration to your Prize class: - (BOOL)isBetterThan:(Prize*) prize This method should return YES if the current object (self) has a price greater-than-or-equal-to the passed-in prize, and NO if it does not. 7. Add two instance variables to the Prize class, a string manufacturer and an integer year (representing the year the prize was manufactured). Use properties to define these instance variables along with their setters and getters.
  • 56. page � of �1 3 8. Alter the designated initializer initWithName:price: to take two additional arguments, corresponding to the new instance variables, and set them accordingly. 9. Alter the init method so it uses the new designated initializer. Use UNKNOWN for the default manufacturer and 2013 for the default year. 10. Alter the makeBoobyPrize method so that the Prize it creates has a manufacturer of “Barney” and a year of 2013. 11. Alter the description method so that the string it returns has the following form: The value year manufacturer name worth $price. An example might be: The expensive 2003 Chevy Corvette worth $20000.00. Use your valueString method to determine the value field in this string. 12. Now replace all code in the main method with the following steps. As above, I recommend testing each step before proceeding. a. Create an NSMutableArray.
  • 57. b. Add Prize objects with the following values to the array, in the order specified: 2003 Chevy Corvette worth $20,000.00 2009 Maytag washing-machine worth $650.00 A Booby-Prize created using the makeBoobyPrize: class method 2010 Carnival Cruise worth $5,000.00 2013 Bob’s Mansion worth 500,000.00 1999 Worlitzer organ worth $2,500.00 c. Print-out all objects in the array. d. Using isBetterThan: messages, determine which of the objects in the array is the best Prize. Print-out the best prize. 13. Now repeat step 2 to create a class called PrizeChest. This class should meet the following criteria: a. The class should have a single instance variable, an NSMutableArray to hold prizes. We don’t want users to directly set/get this array, so it should be explicitly declared as an instance variable (i.e., do not use a property). page � of �2 3 b. The class should have one initializer named init, which will be the designated initializer. The initializer should create the prize array and add to it the six prizes listed in step 12b above (hint: copy-and-paste is your friend here).
  • 58. c. Override the description method so that it creates and returns a string containing all of the prizes in the array, one-per-line. c. Add a method prizeAtIndex: that returns the prize at the specified index. d. Add a method bestPrize which finds (as per step 12d above) and returns the best prize in the array. e. Add a method findBoobyPrizeIndex that finds and returns the index of the booby prize in the array. The booby prize can be determined by looking through the array for the prize whose name is “BOOBY PRIZE”. f. Add a method shufflePrizes that shuffles the positions of the prizes in the array. Use the following algorithm: FOR EACH array index curIndex DO prize1 ← object at curIndex randIndex ← random array index prize2 ← object at randIndex replace object at curIndex with prize2 replace object at randIndex with prize1 END FOR g. After the array is populated in the init method send the message shufflePrizes to self. 14. Add the following steps to your main method:
  • 59. a. Create a PrizeChest object. b. Output the PrizeChest object. c. Output the best prize in the PrizeChest (using the appropriate message to determine which is the best prize). d. Output the index of the booby prize in the PrizeChest (using the appropriate message to determine the index). 15. Run your program and submit the output in a text file. Compress your project by choosing your project folder (in Finder) and then choosing File Menu- Compress. Upload the output file and the compressed project to Moodle for submission. page � of �3 3 CS356 Lab 1: Getting Started with Xcode and Objective-C Complete the following steps in order. Note that your program may only use the classes and messages listed on the last page of this lab. You may not use array [] syntax for this lab. 1. Launch Xcode (which resides in the Applications folder). 2. Choose Create a new Xcode project from the splash screen that appears. (Note that you can always create a new project from inside Xcode by choosing File Menu - New - Project).
  • 60. 3. A dialog box will appear where you will specify the type of project you want to create. Choose Application from beneath OS X (on left hand side of the dialog box), then Command Line Tool. Then click Next. 4. In the next dialog box enter lab01 as the name for your project in the Product Name field. Xcode requires that you enter something in the Company Identifier field; enter “SOU” (or a company name of your choice). Set the Language to Objective- C (that should be the default). Then click Next. 5. You will be presented with a file chooser dialog. Navigate to a place where you would like to save your project. Then click Create. Note that local drives on lab machines are not guaranteed to preserve your files. I recommend saving your projects on your P: drive. 6. You should now be in the Xcode project window for your newly created project. The source code files in the project are listed in the pane on the left-hand side. In this case a single Objective-C source code file has been created for you, called main.m. Click on this file and you will see its content in the text editor, which occupies the center pane. This contains default code supplied by Apple that outputs “Hello World”. 7. Now click the Build & Run button (the “play” button in the top left corner). This will build (compile & link) the template program into an executable and then, assuming there are no errors,
  • 61. the program will be run with output going to the All Output pane (which will appear when needed). Try removing a semi-colon from the NSLog statement to see how Xcode reports errors. Click on the red dot to the left of the error line and note that Xcode will suggest a fix for the error for you (accept the fix by hitting return). 8. Now delete the NSLog statement (inside the @autoreleasepool block statement). Replace with a program that does the following, using only classes and messages listed on the next page. Do not use array [] syntax. page � of �1 3 In each step do not make assumptions about the array contents based on the prior steps (e.g., the number of elements in the array, the contents of the first element, etc.). a. Create a mutable array object, which will contain strings representing presents. b. Add the three strings “Car”, “Vacation”, and “Fridge” to the array. c. Add the names of two more presents you’ve received to the end of the array. d. Replace the second element in the array with the name of a present you have received. e. Replace the last element in the array with the name of
  • 62. another present you’ve received. f. For each object in the array, output a sentence containing the index, name, length of the name, and price of that object. The price should be formatted as money. Use the following formula to determine the price (where ndx is the array index of the object): price = 102.66 * (ndx + 15) g. Build a single NSString object containing all of the objects in the array on a single line separated by commas. Then output that string. 9. Run your program and copy-and-paste the output into a text file. You can use any text editor for this (e.g., Apple supplies a simple text editor named TextEdit). Compress your project by choosing your project folder (in Finder) and then choosing File Menu - Compress. Upload the output file and the compressed project to Moodle for submission. page � of �2 3 Allowable Classes and Messages for Lab 1 NSLog function NSArray/NSMutableArray Class (Do not use array subscripting (arrayName[]) syntax). alloc