CS 453 Recitation
1. Subversion

Originally written by Andy Stone.

Introduction

Subversion is revision control system software that you'll be using CS453. There are notes on subversion available on this page as well as the department WIKI at: https://www.cs.colostate.edu/wiki/Subversion.

Creating a new repository from scratch

Step 1) Create a directory for your future subversion repositories in a location of your choosing. For PA0 this location should be under your home directory. For PA2 on this location should be in your assigned group directory under the ~cs453 account.
    >  cd ~
    >  mkdir SVN_Repositories


Step 2) Create a repository - This contains a database that will keep track of all the versions of your files. After creation you will not touch this directory directly; only indirectly through subversion commands.
    >  cd SVN_Repositories
    >  svnadmin create PA0

Putting PA0 into your repository

To put PA0 into your repository check out a working directory of your repos on the command line, copy your PA0 code into it, and commit this code. Do not checkout a working copy inside of your repositories directory.
   > cd ~
   > svn checkout svn+ssh://username@machine.cs.colostate.edu/myhomedir/SVN_Repositories/PA0 PA0
   > cd PA0
   > cp -r ~/myOrignalPA0dir/* .
   > svn add *
   > svn commit -m "Copied completed PA0 into repository."
TIP: To determine the full-path to your SVN_Repositories directory you can cd into it then use pwd -P.

WARNING: Do not follow this procedure to copy files from an existing working copy (doing this will copy the hidden .svn directory and cause all sorts of badness), instead use svn export.

For this assignment you're a-okay because your not copying PA0 from an existing working copy. To figure out if a directory is a working copy you can use the svn info command.

Where you might run into trouble is if you want to fork a new repository for an assignment from an existing repository.

2. Getting Started with Haskell

Introduction

Haskell is a purely functional language that uses lazy evaluation and static type-checking. It can be downloaded here: https://www.haskell.org/platform/.
Here are some good resources to get you started with Haskell:
https://wiki.haskell.org/Learning_Haskell
https://wiki.haskell.org/Tutorials

Compiling and running a Haskell File

  1. Download Main0.hs and testInput.txt to your local machine.
  2. Compile and run the file :
    	> ghc -o Main0 Main0.hs
    	> cat testInput.txt | ./Main0
    

Some Basic Operations in Haskell

  1. Open GHCi in your terminal:
    	> ghci
    
  2. Try out the following commands in GHCi:
    	> 3+45
    
    	> ((3+15) `mod` 7)/=0    -- /= is the not equal operator
    
    	> not (True && False)
    
    	> head [1,2,3,4,5]
    	> tail [1,2,3,4,5]
    	> take 15 [0,5..]
    	> length [1,2,3,4,5]
    	> [1,2,3,4,5]!!4
    
    	> let addFunc a b = a+b
    	> addFunc 35.4 42
    	> addFunc 14.2 (addFunc 3 4)
    
    	> let list0 = [0,1,2]
    	> list0++[4,5]
    
    	> let list1 = [1,4..24]
    	> list1
    
    	> list0 < list1
    
    	> let doubleVal i=i*5
    	> list1
    	> map doubleVal list1
    
    	> let fib n = if n==0 then 0 else if n==1 then 1 else fib(n-2)+fib(n-1)
    	> fibSeries 0
    	> fibSeries 1
    	> fibSeries 2
    	> fibSeries 3
    	> fibSeries 4
    	> fibSeries 5
    	> let fibSeries n = take n (map fib [0,1..])
    	> fibSeries 20
    	> let fibSeriesUntilK k=takeWhile (<=k) (map fib [0,1..])
    
    
    

mstrout@cs.colostate.edu .... January 28, 2015