Difference between revisions of "CompSciWeek3"

From Predictive Chemistry
Jump to: navigation, search
(Created page with "== Reading Assignment == * Algorithms, Chapters 1-2 ** focus on tree data structures (formal complexity next week) ** ignore python 'Class' for now = Class 1: Intermediate shell…")
 
(Class 2: Python vs. shell)
Line 25: Line 25:
 
* Graphs
 
* Graphs
   
Homework 2 - due Monday, Sept. 15
+
= Homework 2 - due Monday, Sept. 15 =
==========
 
 
* Coding problems:
 
* Coding problems:
 
** Write a loop to sum 100 random numbers (import random, random.random()) using each of the following control structures: for, while, list and `tuple` comprehension.
 
** Write a loop to sum 100 random numbers (import random, random.random()) using each of the following control structures: for, while, list and `tuple` comprehension.

Revision as of 11:10, 1 September 2014

Reading Assignment

  • Algorithms, Chapters 1-2
    • focus on tree data structures (formal complexity next week)
    • ignore python 'Class' for now

Class 1: Intermediate shell utilities

  • commands
    • cat
    • grep
    • sort
    • head / tail
    • tr, sed
    • find
    • w, top, last
  • shell variables
  • control flow
    • pipes, &&, ||
    • for loops

Class 2: Python vs. shell

  • Reading / Writing Files
  • Advanced control structures (list comprehensions)
  • Code profiling
  • Hash tables
  • Graphs

Homework 2 - due Monday, Sept. 15

  • Coding problems:
    • Write a loop to sum 100 random numbers (import random, random.random()) using each of the following control structures: for, while, list and `tuple` comprehension.
    • Write a shell loop to save 100 numbers from $RANDOM to a file, writing one number per line.
    • Write a shell loop to sum files with 1 number per line.
    • Write python and shell programs to print the smallest 10 numbers from such a file.
    • Write a text processing script using sed to get the times from all the lines tagged "timing: 45.122" from the data file