Hello, and welcome to Software Carpentry at McMaster University on Monday, May 5.
Please see http://gdevenyi-05-05-mcmaster.github.io/2014-05-05-mcmaster for our home page.

Why Crunch Mode Doesn't Work: http://legacy.igda.org/why-crunch-modes-doesnt-work-six-lessons

http://www.amazon.com/Unix-Linux-Visual-QuickStart-Edition/dp/0321636783
http://www.amazon.com/Practical-Computing-Biologists-Steven-Haddock/dp/0878933913/

Why do many programming languages count from 0? http://exple.tive.org/blarg/2013/10/22/citation-needed/

You may also enjoy http://neverworkintheory.org/2014/01/29/stefik-siebert-syntax.html and/or http://www.amazon.com/Bad-Data-Handbook-Cleaning-Back/dp/1449321887/

12 Steps to Navier Stokes
http://lorenabarba.com/blog/cfd-python-12-steps-to-navier-stokes/

Please go to http://regexpal.com/

Put this data in the bottom box

Baker 1 2009-11-17      1223.0
Baker 1 2010-06-24      1122.7
Baker 2 2009-07-24      2819.0
Baker 2 2010-08-25      2971.6

Site/Date/Evil
Davison/May 22, 2010/1721.3
Davison/May 23, 2010/1724.7
Pertwee/May 24, 2010/2103.8
Davison/June 19, 2010/1731.9
Davison/July 6, 2010/2010.7

Who's Here
Notes on Human Memory
Human attention span
You should build a program in stages and pieces of jobs that do small things really well.  This makes your program modular, easier to read, and gives you the ability to write small programs that are applicable to a number of different jobs.

You should always document your programs.  Short explanations are better because the in depth explanation can be had by reading the code itself.

Excel is unadvisable because it doesn't remember processes

Notes on the Unix Shell

Notes on Python and the IPython Notebook
Let's Write a Gabriel

def gabriel(numbers):
    return [] # this is probably wrong

# You may like this:
result = 0
for n in [1, 2, 3]:
    result = result + n
# final value of result is 1 + 2 + 3

# and this
result = [] # an empty list
for n in [1, 2, 3]:
    temp = n * n # calculate the square
    result.append(temp) # put it on the end of the result list
# result is now [1, 4, 9]

def gabriel(nums):
    sum = []
    last = 0
    total = 0
    for n in nums:
        if last > n:
            total = 0
        total += n
        sum.append(total)
        last = n
    return sum

def gabriel(lst):
    result = []
    if lst == []:
        return result
    result.append(lst[0])
    for i in range(1, len(lst)):
        res = result[i-1]
        prev = lst[i-1]
        current = lst[i]
        if current >= prev:
            result.append(current+res)
        else:
            result.append(current)
    return result

assert gabriel([]) == [], 'empty list'
assert gabriel([1]) == [1], 'single value'
assert gabriel([1, 2]) == [1, 3], 'increasing sequence'
assert gabriel([1, 2, 3]) == [1, 3, 6], 'is this useful?'
assert gabriel([1, 2, 0, 3]) == [1, 3, 0, 3], 'contains one drop'
assert gabriel([5, 6, 2, 3, 4]) == [5, 11, 2, 5, 9], 'contains a non-zero drop'
assert gabriel([1, 2, 2, 3]) == [1, 3, 5, 8], 'flatlines'
assert gabriel([0, -3, -2, -1]) == [0, -3, -5, -6]
print 'holy cow, Phil is a coding god!'

Let's Look at Databases

select distinct visited.dated, site.lat, site.long from visited join site on site.name = visited.site where visited.dated is not null;

-- Get unique date/lat/long for all visits.
select distinct visited.dated, site.lat, site.long
from visited join site
on site.name=visited.site
where visited.dated is not null;

Version Control and Git

http://www.github.com -- Please signup for an account if you don't have one

https://github.com/gdevenyi/mcmaster.latex


Well done everyone: http://i.imgur.com/59KTQ.gif