Archive

Archive for the ‘Versions’ Category

Space at Upcoming Events

May 19th, 2012 1 comment

Here’s how registration is going for upcoming events:

University of British Columbia May 22-23 39/40
Johns Hopkins University June 18-19 7/20
Paris June 28-29 9/25
Boston July 9-10 23/40
University of Waterloo July 12-13 1/40
Halifax July 16-17 8/40
University of Toronto (Scarborough) July 19-20 14/40

If you’d like to join us, there’s still plenty of space—and if you have friends who could use some training in basic software skills, please point them our way.

Categories: Boot Camp, Version 5.0 Tags:

Feedback from Alberta

May 18th, 2012 No comments

Our two-day workshop at the University of Alberta wound up a couple of hours ago. We had quite a few no-shows this time (which was annoying, given how many people were waitlisted), but those who did come seemed to get a lot out of it:

Good Bad
  • Room
  • Mix of talking & doing
  • Stickies
  • Version control
  • Hands on
  • Link on online video
  • Python
  • Clear speaking
  • Computer in lab (using linux)
  • Automatic versioning
  • Programming in windows in Cygwin
  • Philosophy
  • Discussion of productivity
  • Good reading suggestions
  • Functional programming
  • Overall workflow
  • I feel more competent (morale boost)
  • Researched anectodes, backed with data
  • Website
  • TDD
  • Instructor’s body language
  • Helpers
  • Coffee hard
  • Need more projectors
  • Having to keep stickies
  • No testing
  • Not enough depth
  • Not convinced about version control
  • Too fast on day 1, too slow on day 2
  • Need levels
  • Came late
  • Not enough Python
  • No lunch
  • No time for notes
  • More version control
  • Too short break
  • No shows
  • Pace (a little fast)
  • Supervisor wasn’t here (need to convince her)
  • Where is the code (dropbox?)
  • Bad chairs
  • Windows alienation
  • Mailing list
  • Making DB (no info)

Many thanks to Rose, Neil, and Paul for making it possible.

Halifax in July

May 17th, 2012 No comments

We have just added another workshop to the summer’s list, this one at Saint Mary’s University in Halifax, Nova Scotia, on July 16-17. Please let friends and colleagues know—I look forward to meeting them.

Categories: Boot Camp, Halifax, Version 5.0 Tags:

And One More: Johns Hopkins in June

May 16th, 2012 No comments

We’re pleased to announce that we will be running a two-day boot camp at Johns Hopkins University in Baltimore on June 18-19, 2012. We only have space for 20 participants, so please register early.

Two Boot Camps in Ontario in July

May 15th, 2012 No comments

We are pleased to announce that we will be running two boot camps in Ontario in July: one at the University of Waterloo on July 12-13, and another at the University of Toronto (Scarborough) on July 19-20. If you’d like to take part, please sign up, and please let friends and colleagues know about them as well.

Categories: Boot Camp, Version 5.0 Tags:

Solution to Indented List Problem

May 14th, 2012 No comments

Last week’s homework was to convert a two-level bullet-point list like this:

* A
* B
  * 1
  * 2
* C
  * 3

into an HTML list like this:

<ul>
  <li>A</li>
  <li>B
    <ul>
      <li>1</li>
      <li>2</li>
    </ul>
  </li>
  <li>C
    <ul>
      <li>3</li>
    </ul>
  </li>
</ul>

so it would display like this:

  • A
  • B
    • 1
    • 2
  • C
    • 3

My solution is shown in the video below; the code follows.

import sys

def do_inner(lines, current):
    need_to_start = True
    need_to_close = False
    while (current < len(lines)) and \
          lines[current].startswith('  * '):
        if need_to_start:
            print '  <ul>'
            need_to_start = False
        text = lines[current].lstrip('  * ').rstrip()
        print '  <li>' + text + '</li>'
        need_to_close = True
        current += 1
    if need_to_close:
        print '  </ul>'
    return current

def do_outer(lines):
    print '<ul>'
    current = 0
    while current < len(lines):
        assert lines[current].startswith('* ')
        text = lines[current].lstrip('* ').rstrip()
        print '<li>' + text
        current = do_inner(lines, current+1)
        print '</li>'
    print '</ul>'

lines = sys.stdin.readlines()
do_outer(lines)

Categories: Tutorial, Version 5.0 Tags:

Solution to Sets and Dictionaries Exercise

April 26th, 2012 1 comment

Last week, I posted an exercise on working with sets and dictionaries that also included a fair bit of file I/O and string manipulation. My solution is below, in four parts, along with the code produced in each. If someone would like to re-do the file parsing using regular expressions, I’d be happy to post that as well.

Read more…

Categories: Tutorial, Version 5.0 Tags:

An Exercise With Sets and Dictionaries

April 20th, 2012 5 comments

You are working for a nanotechnology company that prides itself on manufacturing some of the finest molecules in the world. Your job is to rewrite parts of their ordering system, which keeps track of what molecules they can actually make. Before trying this exercise, please review:

  1. Introduction
  2. Storage (the short version)
  3. Dictionaries
  4. Examples
  5. Nanotech Example

Submit your work by mailing Greg:

  1. your final program,
  2. the input file(s) you used to test it, and
  3. a shell script that runs all of your tests.

Read more…

Categories: Tutorial, Version 5.0 Tags:

Halfway Home

April 17th, 2012 No comments

We’re half-way through our current round of work, so it’s time to start thinking about what we’ve accomplished, what we’ve learned, and what we’d like to do next. Here’s what I think we now know:

  1. Our training makes scientists more productive.
  2. We can prove it.
  3. Our methods scale.
  4. We can become self-sustaining in 2-3 years.

In more detail:

Read more…

Categories: Version 5.0 Tags:

Data Munging with Regular Expressions

April 15th, 2012 No comments

Indiana U’s Mike Hansen has written a blog post explaining how he used regular expressions to rename and fix some MATLAB files. Even if you don’t use MATLAB, you should find lots of useful stuff in it. Thanks, Mike.

Categories: Tutorial, Version 5.0 Tags: