CS 241 Section Week #1. About Sections Each week: – We’ll spend additional time on topics that the instructors feel should be reviewed. – We’ll prepare.

Slides:



Advertisements
Similar presentations
Week 2 DUE This Week: Safety Form and Model Release DUE Next Week: Project Timelines and Website Notebooks Lab Access SharePoint Usage Subversion Software.
Advertisements

Version Control System (Sub)Version Control (SVN).
Version Control System Sui Huang, McMaster University Version Control SystemSui Huang, McMaster University Version Control System -- base on Subversion.
Practical software engineering: Revision control & make Spring 2010, Recitation #2.
Introduction to git Alan Orth Nairobi, Kenya September, 2010 version control for serious hackers ;)
2/6/2008Prof. Hilfinger CS164 Lecture 71 Version Control Lecture 7.
Using subversion COMP 2400 Prof. Chris GauthierDickey.
Subversion Takes Back the Night How Version Control makes web development better.
CS311 – Lecture 08 Outline Subversion (SVN) *All information taken from “SVN Book” O’Reilly Lecture 081CS Operating Systems I.
Version Control and Subversion Chris Coakley. Outline What is Version Control? Why use it? Using Subversion (SVN)
Using svn and git with Unity and sdk
Carnegie Mellon 1 Debugging and Version control / : Introduction to Computer Systems 12 th Recitation, Nov. 14, 2011 Slides by: Lin Xiao(lxiao)
G51FSE Version Control Naisan Benatar. Lecture 5 - Version Control 2 On today’s menu... The problems with lots of code and lots of people Version control.
Version Control. What is Version Control? Manages file sharing for Concurrent Development Keeps track of changes with Version Control SubVersion (SVN)
Version Control with git. Version Control Version control is a system that records changes to a file or set of files over time so that you can recall.
By: Taylor Helsper.  Introduction  Bug Tracking  Progress Tracking  Version Control  Conclusion  Questions.
Seattle Preparatory School Advanced Placement Computer Science Seattle Preparatory School Advanced Placement Computer Science LESSON 62 FEBRUARY 12, 2015.
1 CSE 390 “Lecture 11” Version control with Git slides created by Ruth Anderson, images from
Git for Version Control These slides are heavily based on slides created by Ruth Anderson for CSE 390a. Thanks, Ruth! images taken from
1 Topics for this Lecture Software maintenance in general Source control systems (intro to svn)
Subversion. What is Subversion? A Version Control System A successor to CVS and SourceSafe Essentially gives you a tracked, shared file system.
NEEDS Berkeley Workshop 2014 NEEDS Compact Model Development Process Michael McLennan Director, HUBzero® Platform for Scientific Collaboration Purdue University.
Version Control with Subversion Quick Reference of Subversion.
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 8-Oct-15.
Object-Oriented Software Engineering Using UNIX groups and Subversion Estimated Time: minutes “Unix is user-friendly. It's just very selective about.
SENG 403 Tutorial 1 1SENG 403 – Winter Agenda Version Control Basics Subversion Basic actions in Subversion Some examples 2SENG 403 – Winter 2012.
Computer Science and Engineering The Ohio State University  Widely used, especially in the opensource community, to track all changes to a project and.
Java Basics.  To checkout, use: svn co scb07f12/UTORid  Before starting coding always use: svn update.
Version Control with SVN Images from TortoiseSVN documentation
Git overview for RoboCup Andre Pool, September 2015.
Version Control Reducing risk with version control Jon Austin
Creating Programs on UNIX This term you can create programs on UNIX or you can create programs using a C++ compiler on your PC. This set of slides steps.
Week 3 January 22, 2004 Adrienne Noble. Today CVS – a great tool to use with your groups Threads – basic thread operations Intro to synchronization Hand.
Sabriansyah R.A Version Control. The Repository Subversion adalah sistem tersentralisasi untuk informasi sharing Repository adalah pusat penyimpanan data.
12 CVS Mauro Jaskelioff (originally by Gail Hopkins)
Version Control System
CSCI S-1 Section 4. Deadlines for Homework 2 Problems 1-8 in Parts C and D – Friday, July 3, 17:00 EST Parts E and F – Tuesday, July 7, 17:00 EST.
Version Control and SVN ECE 297. Why Do We Need Version Control?
Introduction to Git Yonglei Tao GVSU. Version Control Systems  Also known as Source Code Management systems  Increase your productivity by allowing.
Recitation 2: Abhijit Warkhedi2/25/20161 Today’s Agenda u CVS u GDB.
1 CSE 303 Lecture 19 Version control and Subversion ( svn ) slides created by Marty Stepp
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 16 – Version control and git.
CS 241 Section Week #1 January 26, Topics This Section HW #1 SVN Review (…by the command line!) C Code Examples.
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
It’s not just an insult from Harry Potter!. What is Git? Distributed Version Control System (DVCS) – Compared to a Centralized Version Control System.
Git How to 1. Why Git To resolve problems in lab exams (accidental deletions) Use existing Libraries with ease (Statistics and Computer) Prepare undergraduates.
CS520 Web Programming Version Control with Subversion Chengyu Sun California State University, Los Angeles.
Using Subversion for Source Code Control Michael McLennan HUBzero® Platform for Scientific Collaboration Purdue University This work licensed under Creative.
DIGITAL REPOSITORIES CGDD Job Description… Senior Tools Programmer – pulled August 4 th, 2011 from Gamasutra.
1 Subversion Kate Hedstrom April Version Control Software System for managing source files –For groups of people working on the same code –When.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 28-Jun-16.
Problem Solving With C++ SVN ( Version Control ) April 2016.
Source Control Dr. Scott Schaefer. Version Control Systems Allow for maintenance and archiving of multiple versions of code / other files Designed for.
Version Control with Subversion
Source Control Dr. Scott Schaefer.
Discussion 11 Final Project / Git.
Subversion Reasons to use How it works Subversion important commands
Version Control System using Git
An introduction to version control systems with Git
Distributed Version Control with git
An introduction to version control systems with Git
slides borrowed and adapted from Alex Mariakis and CSE 390a
An introduction to version control systems with Git
Compilers, Make and SubVersion
Subclipse CSCI 3130 Summer 2016.
Version control with Git Part II
Systems Analysis and Design I
Presentation transcript:

CS 241 Section Week #1

About Sections Each week: – We’ll spend additional time on topics that the instructors feel should be reviewed. – We’ll prepare you for the upcoming homework or MP submissions. – We’ll provide extra review/guidance for upcoming exams.

C can be Ugly #defineDIT( #defineDAH) #define__DAH++ #define DITDAH* #defineDAHDITfor #defineDIT_DAHmalloc #define DAH_DITgets #define_DAHDITchar _DAHDIT _DAH_[]="ETIANMSURWDKGOHVFaLaPJBXCYZQ b54a3d2f16g7c8a90l?e'b.s;i,d:" ;mainDIT DAH{_DAHDIT DITDAH_DIT,DITDAH DAH_,DITDAH DIT_, DITDAH_DIT_,DITDAH DIT_DAH DIT DAH,DITDAHDAH_DIT DIT DAH;DAHDIT DIT _DIT=DIT_DAHDIT 81 DAH,DIT_=_DIT __DAH;_DIT==DAH_DITDIT _DIT DAH;__DIT DIT'\n'DAH DAHDAHDIT DIT DAH_=_DIT;DITDAH DAH_;__DITDITDITDAH _DIT_?_DAH DITDITDAH DIT_ DAH:'?'DAH,__DIT DIT' 'DAH,DAH_ __DAHDAH DAHDIT DIT DITDAHDIT_=2,_DIT_=_DAH_; DITDAH _DIT_&&DIT DITDAH _DIT_!=DITDITDAH DAH_>='a'? DITDAH DAH_&223:DITDAHDAH_ DAH DAH; DIT DITDAHDIT_ DAH __DAH,_DIT_ __DAH DAH DITDAH DIT_+=DIT DITDAH _DIT_>='a'?DITDAH _DIT_-'a':0 DAH;}_DAH DIT DIT_DAH{__DIT DIT DIT_>3?_DAHDIT DIT_>>1 DAH:'\0'DAH;return DIT_&1?'-':'.';}__DIT DITDIT_ DAH _DAHDIT DIT_;{DIT void DAH write DIT 1,&DIT_,1 DAH;}

C can be Ugly #defineDIT( #defineDAH) #define__DAH++ #define DITDAH* #defineDAHDITfor #defineDIT_DAHmalloc #define DAH_DITgets #define_DAHDITchar _DAHDIT _DAH_[]="ETIANMSURWDKGOHVFaLaPJBXCYZQ b54a3d2f16g7c8a90l?e'b.s;i,d:" ;mainDIT DAH{_DAHDIT DITDAH_DIT,DITDAH DAH_,DITDAH DIT_, DITDAH_DIT_,DITDAH DIT_DAH DIT DAH,DITDAHDAH_DIT DIT DAH;DAHDIT DIT _DIT=DIT_DAHDIT 81 DAH,DIT_=_DIT __DAH;_DIT==DAH_DITDIT _DIT DAH;__DIT DIT'\n'DAH DAHDAHDIT DIT DAH_=_DIT;DITDAH DAH_;__DITDITDITDAH _DIT_?_DAH DITDITDAH DIT_ DAH:'?'DAH,__DIT DIT' 'DAH,DAH_ __DAHDAH DAHDIT DIT DITDAHDIT_=2,_DIT_=_DAH_; DITDAH _DIT_&&DIT DITDAH _DIT_!=DITDITDAH DAH_>='a'? DITDAH DAH_&223:DITDAHDAH_ DAH DAH; DIT DITDAHDIT_ DAH __DAH,_DIT_ __DAH DAH DITDAH DIT_+=DIT DITDAH _DIT_>='a'?DITDAH _DIT_-'a':0 DAH;}_DAH DIT DIT_DAH{__DIT DIT DIT_>3?_DAHDIT DIT_>>1 DAH:'\0'DAH;return DIT_&1?'-':'.';}__DIT DITDIT_ DAH _DAHDIT DIT_;{DIT void DAH write DIT 1,&DIT_,1 DAH;} Especially when you try! (More examples at

Topics This Section SVN C Code Examples in Real Life Programming Tools

Subversion What it is Collaboration tool for large projects Good at Code Backups Efficient - Uses diff's for backup compression A good learning block for other version control systems (git, etc.)

Subversion What it is not File system backup (bad at binaries) Concurrent access tool (not google docs) Good at merging lots of changes (commit often)

Try it! svn checkout cs241/NETID/ svn If you have already checked out the repository, run `svn update` inside the directory

Try it! cd ~/svn (what does ~ mean) echo “this file holds my idea” > idea ls && svn add idea(what does && do) svn status svn commit -m “my first big idea”

Try it! Edit the file idea and save Commit the changes (Do you remember the command) Oh no, you ruined your first idea and want to go back!

Going back svn log svn up (short for?) svn log svn update -rXX

SVN Conclusion – Learn it – Love it – Hate it

C examples Go to ~/svn/ds/ds1 Time for some real fun! Open ds1.c using your favorite editor

Fun Part #1 void problem1(){ char str[7]="abc"; strcat(str,"def"); printf("%s",str); } //Issues ?

Fun Part #1 Are you ready for the answers on the next slide? Did you use the manpages for strcat?

Fun Part #1 #include //strcat void problem1(){ char str[7]; //avoid ptr to static mem strcat(str,"abc"); strcat(str,"def"); printf("%s",str); }

Test gcc ds.c What is binary called? Does it work? Uncomment Problem2

Fun Part #2 void problem2(){ char *str; for(int i=0;i<42;i+1) str = malloc( sizeof(char)); if( factorial(i,str) ){ //Error return 1; } printf("%d : %s\n",str,i); } int factorial(int num, const char* answer){ while(num >= 0){ num *= --num; sprintf(answer,"%d",num); }

Fun Part #2 How many bugs can you find? Once you are confident test your program

Fun Part #2 Are you ready for the answers? Try running `valgrind a.out`

Fun Part #2 constant int maxFieldSize=20 void problem2(){ char *str; int i; constant int theAnswer = 42; str = malloc( sizeof(char)*(maxFieldSize) ); for(i=0;i<theAnswer;i++){ if( factorial(i,str) ){ //Error printf(“factorial failed\n”); exit(1); } printf("%d : %s\n",i,str); } int factorial(int num, char* answer){ while(num > 0){ num *= num--; snprintf(answer,maxFieldSize,"%d",num); }

Questions? As a challenge see if you can optimize factorial for subsequent accesses - make sure that it still works for the general case