LectureBlog
Home Assignments Lecture Blog Resources Discussion Group
All lectures may be reviewed using the Echo360 system:
http://echo360.uml.edu/martin2014/computingIVspring.html
Note: Right-click on any image to open it in hi-res.
Meeting 38, Fri May 2
- cross-cutting (across PS's) discussion of Algorithms, Libraries, and Tools/Testing
- discussion of PS5 PS7



Meeting 37, Wed Apr 30
- discussion of PS0 PS4


Meeting 36, Mon Apr 28



Meeting 35, Fri Apr 25
- Design Patterns continuing discussion of design patterns
- PS Summary

Meeting 35, Wed Apr 23
- go over whole set of assignments for learning outcomes
- http://sourcemaking.com/design_patterns



Meeting 34, Fri Apr 18
- using regex's in
find
andgrep
:find . -name "<filespec>" -print0 | xargs -0 ls -l
find . -name "<filespec>" -print0 | xargs -0 grep <regex>
(-print0
and-0
allow filenames with spaces in them) - PS7b assigned



Meeting 33, Wed Apr 16



Meeting 32, Mon Apr 14
- PS7a assigned - first half of Kronos assignment
- Attach:stdin_boost.cpp handed out
- interactive experimentation with regex's figured out
smatch
submatch operation


Meeting 31, Fri Apr 11
- James Forance, Kronos
- introduction to InTouch time clock



Meeting 30, Wed Apr 9
- introduction to regular expressions
- sample log file from Kronos InTouch device

Meeting 29, Mon Apr 7
- demonstration of working Markov model code
- discussion of C++
map
API - looking up a value using subscript operator or
at
operator creates the kvp in the map; usefind
orcount
methods to check for its existence without creating it



Meeting 28, Fri Apr 4
- there are 4 weeks left in the semester
- PS6 will be due next Wednesday
- PS7? will be in collaboration with Kronos; visitor on next Friday
- We'll do one more Princeton PS (TSP or atomic nature of physics?)
- Rest of dicussion: how to implement the PS6 Markov model




Meeting 27, Wed Apr 2



Meeting 26, Mon Mar 31
- introduction of Princeton Markov modeling assignment



Meeting 25, Fri Mar 28
- review of PS5b and implementation notes
- discussion of final project portfolios

Meeting 24, Wed Mar 26
- guest lecture Derrell Lipman on key events and map
Meeting 23, Mon Mar 24
- guest lecture Derrell Lipman on PS5b
Meeting 22, Fri Mar 14
- exception handling for ring buffer PS5a
- if you don't catch an exception, program terminates and dumps core
- generic exception is
std::exception
- you can have more specialized exceptions; see (e.g.) http://www.tutorialspoint.com/cplusplus/cpp_exceptions_handling.htm
- when throwing these exceptions, you can give an error message, which is available in the exception's
what
method - how to catch and print out an exception
- for ring buffer:
- passing constructor an invalid arg (input less than 1) should result in a
std::invalid_argument
exception - dequeuing or peeking from an empty ring, or enqueuing to a full one, should yield a
std::runtime_error
exception
- passing constructor an invalid arg (input less than 1) should result in a
- Boost can trap exceptions (or verify they're not being thrown) with
BOOST_REQUIRE_THROW(code, exception)
andBOOST_REQUIRE_NO_THROW(code)
- PS5a starter code



Meeting 21, Wed Mar 12
- three parts of assignment:
- how ring buffer works
- how string simulation occurs
- how to build up sound from sim
- exception handling
for Friday, read:



Meeting 20, Mon Mar 10
- re-graded exam 1 handed back; new avg is 29.4 with stddevp of 8.70
- we are starting the Princeton guitar hero assignment
- the 1D wave equation
- for Friday: have the RingBuffer class implemented, along with unit tests using Boost and exception handling for contract violations on constructor, or attempts to
enqueue()
into a full buffer or calldequeue()
orpeek()
on an empty buffer.



Fri Mar 7—CLASS IS CANCELED
- makeup class will be scheduled
Meeting 19, Wed Mar 5
- correct file behavior on
PhotoMagic
—don't overwrite your starting file - old-fashioned error handling is terrible
- file operations return a null pointer on error
- main function returns a -1 on error
- the new way: exceptions
- you
try
to execute some code;
it mightthrow
an exception;
then youcatch
it. - this is called exception handling
- http://www.cplusplus.com/doc/tutorial/exceptions/
- libraries should publish a contract for allowable inputs
- then they can throw exceptions if called with illegitimate inputs
- let's think this through for our LFSR class.




Meeting 18, Mon Mar 3
- Rest of the semester:
March-April-May 2014 Su Mo Tu We Th Fr Sa 2[ 3] 4 5 6 7 8 wk 07 LFSR part B 9 10 11 12 13 14 15 wk 08 Guitar Hero: ring buffer 16 17 18 19 20 21 22 spring break 23 24 25 26 27 28 29 wk 09 Guitar Hero: rest of it 30 31 1 2 3 4 5 wk 10 TSP 6 7 8 9 10 11 12 wk 11 TSP/Kronos 13 14 15 16 17 18 19 wk 12 Kronos 20 21 22 23 24 25 26 wk 13 Atomic nature 27 28 29 30 1 [2] wk 14 of matter
- Talked about portfolio assessment instead of final
- Attach:test.cpp Boost unit tests for LFSR starter file
- Attach:pixels.cpp SFML image load, manipulation, display, and save
- Went over a Makefile for
test.cpp
(and samplemain.cpp
)—see lecture capture - PS4b is assigned, due Fri Mar 7



Meeting 17, Fri Feb 28
- overview of whole assignment:
- LFSR is initialized with string of 1s and 0s and tap position; these become password for recovering image
- LFSR generates a series of pseudo-random #s
- take each byte and XOR with RGB bytes from image
- this makes encrypted image
- re-seed LFSR with same init string and tap
- redo process on encrypted image to recover original
- manually simulating an 5-bit LFSR with a tap at pos'n 2 to generate a byte

- intros to Test-Driven Development using Boost



Meeting 16, Wed Feb 26
- Exam 1 handed back (w/answer key).
- Thirty students sat the exam.
- Average was 27.1 (out of a possible 40) and stddevp was 8.01.
- High score was 37.
- Extended discussion about each problem. Submit petitions for partial credit to me on Friday.

- more about how LFSR works.
Meeting 15, Mon Feb 24
- Echo360 poll
- efficiencies in vectors vs arrays (including whether allocated or also initialized)
- when vectors are accessed using subscript, no bounds checking (faster/less safe)
- discussion of an Edit Distance solution
- intro to Princeton linear feedback shift register problem

Meeting 14, Fri Feb 21
- Exam 1
Meeting 13, Wed Feb 19
- quiz review



Meeting 12, Tue Feb 18
- implementation notes for EditDistance, including;
- why should we use classes anyway, if we're only instantiating one object?
- how to do opt matrixe.g., a Vector of Vectors vs. C-style array
- space and time measurement
- using iSENSE to store time performance data



Meeting 11, Fri Feb 14
- I've updated lecture blog with whiteboard photos
- Exam next Fri will cover material through PS2 (i.e., not PS3)
- Today: going over edit distance algorithm in more detail
- You should start coding up the assignment, and ideally have it largely done by next Tue
- Next Tue class we'll discuss profiling approaches
- Attach:inclass-alignment-problem.pdf Attach:inclass-alignment-answer.pdf




Meeting 10, Wed Feb 12
- PS3 assigned; due Wed Feb 19
- DNA substring matching formalized as calculation of “edit distance”
- rules for matching: perfect match=0, mismatch char=1, insert gap=2
- play with some manual substring problems
- discussion of dynamic programming approach



Meeting 9, Mon Feb 10
- Virtual classes (C++) vs. interfaces (Java)
- Jon's LineSegment class again
- A solution to Sierpinski
- Bioinformatics PS introduction



Meeting 8, Fri Feb 7
- EXAM 1 IS FRIDAY FEB 21
- Analytic geometry of triangle poll
- Sierpinski triangle coding poll
- talked through analytic geometry using
sf::ConvexShape
(Matt: also can be done inscribing a triangle insf::CircleShape
) - talked through class structure
- should you initialize a recursive data structure once when your program boots up, or dynamically recurse each time you draw it? This is a matter of taste. Fred prefers the latter, but either is fine.
- you want something that is called in your main SFML loop as
window.draw(sierpinksi);
- how to have your own class that has a
draw
method so that the above will work - how to submit PS2
- how to upload your images for PS2 Images




Wed Feb 5
- No meeting—snow day
- Guidance on how to do Sierpinski implementation
- PS2 updated
- Wiki password posted
Meeting 6, Mon Feb 3
- Everyone should work to the best of their abilities
- We'll have a chance to refactor old projects
- Looked at Jon's
LineSegment
implementation - Discussion of dimensionality of Sierpinski triangles
- PS2 is assigned


Meeting 5, Fri Jan 31
- N-body progress, take 2
- N-body time invested
- If you didn't finish, submit to
ps1-late
- Go over some solutions
- Recursion poll
- COS126 Recursive Graphics assignment


Meeting 4, Wed Jan 29
- http://en.wikipedia.org/wiki/Friend_function (we didn't actually talk about this)
- N-Body progress poll
- decided to call the celestial objects
Body
- they each have instance variables: pos_x, pos_y, vel_x, vel_y, mass, texture, sprite
- could collapse x,y into a vector
- there's a Universe class that includes radius, timestep, time
- need a fcn to map from SI meters to pixels (also need window dimensions to do this)
- as you go through the n^2 of each Body pulling on each other, should you:
- calculate all of the forces and then move everything at once after all are calculated?
- do it pairwise and allow slop as the bodies individually move through the update loop?
- where does the fcn live that takes a pair of bodies and calculates forces? Universe class





Meeting 3, Mon Jan 27
- SMFL event loop—only do one update in the loop (don't loop through all your updates, just do one)
- rest of the physics—figuring out what the leapfrog means; we update the velocity first and then use the updated velocity in the position update
- principle of superposition
- initial OO designs for overall implementation




Meeting 2, Fri Jan 24
- introduction to N-body assignment: the physics
- discussion of position update—use velocity at time t, or t+1, or 1/2(a)(t^2) ?
- see more at https://groups.google.com/forum/#!topic/91-204-202-s14/1OvgzpI18VM



Meeting 1, Wed Jan 22

