User Tools

Site Tools


haas:fall2020:common:projects:ntr0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
haas:fall2020:common:projects:ntr0 [2021/01/27 15:00] – [Part 6: Submission of the project] wedgehaas:fall2020:common:projects:ntr0 [2021/01/28 12:41] (current) wedge
Line 20: Line 20:
  
   * read through this document, starting at its very top, and working your way down, line by line to the bottom (it is generally linear, with contextual clues sprinkled in)   * read through this document, starting at its very top, and working your way down, line by line to the bottom (it is generally linear, with contextual clues sprinkled in)
-  * as you read through, comprehend and strive to understand what is happening. The supporting text, often surrounding any example or model commands to run, will tend to fill in the crucial backstory and connections. If further clarification is needed, please ask questions! Just running the commands in this document and having ZERO clue of what you are doing isn't going to help you in the long run.+  * as you read through, comprehend and strive to understand what is happening. The supporting text, often surrounding any example or model commands to run, will tend to fill in the crucial backstory and connections. If further clarification is needed, please ask questions! Just running the commands in this document and have ZERO clue of what you are doing isn't going to help you in the long run.
   * have a contextual/locational awareness of where you are (there are 2 different computing systems you are to perform work on, and there are two different means of accessing one of the systems- via command line, and via the web)   * have a contextual/locational awareness of where you are (there are 2 different computing systems you are to perform work on, and there are two different means of accessing one of the systems- via command line, and via the web)
   * we will be making heavy use of abstraction in this course. We start off with some simple exercises, providing you with model commands you need to adjust to fit your reality (ie commands that won't work as literally shown, but when pertinent meanings are substituted in and followed, will result in success: this is a common theme throughout the course).   * we will be making heavy use of abstraction in this course. We start off with some simple exercises, providing you with model commands you need to adjust to fit your reality (ie commands that won't work as literally shown, but when pertinent meanings are substituted in and followed, will result in success: this is a common theme throughout the course).
Line 28: Line 28:
 As many of my graduated and subsequently employed alumni have relayed to me, many of these activities and behaviours I have highlighted have been quite influential in their success at their various jobs. As many of my graduated and subsequently employed alumni have relayed to me, many of these activities and behaviours I have highlighted have been quite influential in their success at their various jobs.
  
-Say some of my former students now employed: "Reading is 90%+ of the job" +Say some of my former students now employed as engineers: "Reading is 90%+ of the job"
 =====Abstraction===== =====Abstraction=====
-{{page>haas:spring2021:common:projects:abstraction&noheader}}+{{page>haas:fall2020:common:projects:abstraction&noheader}}
  
 =====Locational Awareness===== =====Locational Awareness=====
-{{page>haas:spring2021:common:projects:location&noheader}}+{{page>haas:fall2020:common:projects:location&noheader}}
  
 =====Part 1: Getting started with course resources===== =====Part 1: Getting started with course resources=====
Line 70: Line 69:
  
 ====Clone your Lab46 Mercurial Repository on lab46==== ====Clone your Lab46 Mercurial Repository on lab46====
-**__NOTE:__** Even if you have done this in a prior semester, you WILL need to do it again (once per semester), as there are now per-semester repositories.+**__NOTE:__** If you have already done this in a prior semester, you do NOT need to do it again.
  
-To both aid you and help you develop better development skills, I'd like for you to make regular commits and pushes to your semester Lab46 mercurial repository.+To both aid you and help you develop better development skills, I'd like for you to make regular commits and pushes to your Lab46 mercurial repository.
  
 This way, you can have a regular snapshot of your work as you go along, plus have the ability to grab an older copy should something go wrong. This way, you can have a regular snapshot of your work as you go along, plus have the ability to grab an older copy should something go wrong.
Line 84: Line 83:
 </cli> </cli>
  
-NOTE: you ONLY want to run 'fixrepo' once per semester to get things set up, to take you from a state of not having an established repository on lab46, to the state of having a cloned and readied repository on lab46. Running it again could "refresh" things to this state, potentially moving unadded/uncommitted/unpushed somewhere else and causing you confusion.+NOTE: you ONLY want to run 'fixrepo' the one time, to take you from a state of not having an established repository on lab46, to the state of having a cloned and readied repository on lab46. Running it again will "refresh" things to this state, potentially moving unadded/uncommitted/unpushed somewhere else and causing you confusion.
  
 For basic repository operation, when you make new files you'd like to track, or see the status of any tracked files that have changed: For basic repository operation, when you make new files you'd like to track, or see the status of any tracked files that have changed:
Line 90: Line 89:
 <cli> <cli>
 lab46:~$ cd src lab46:~$ cd src
-lab46:~/src$ ls +lab46:~/src$ hg status
-SEMESTER +
-lab46:~/src$ cd SEMESTER +
-lab46:~/src/SEMESTER$ hg status+
 A .hgignore A .hgignore
-lab46:~/src/SEMESTER+lab46:~/src$ 
 </cli> </cli>
  
-Once cloned (to your ~/src/SEMESTER directory), you will be able to add, commit, and push changes made:+Once cloned (to your ~/src directory), you will be able to add, commit, and push changes made:
  
 <cli> <cli>
-lab46:~/src/SEMESTER$ hg add +lab46:~/src$ hg add 
-lab46:~/src/SEMESTER$ hg commit -m "brief message describing the changes" +lab46:~/src$ hg commit -m "brief message describing the changes" 
-lab46:~/src/SEMESTER$ hg push+lab46:~/src$ hg push
 </cli> </cli>
  
Line 217: Line 213:
  
 ====Clone your Lab46 Mercurial Repository on your raspberry pi==== ====Clone your Lab46 Mercurial Repository on your raspberry pi====
-**__NOTE:__** If you have already done this on your pi (such as in a previous semester), you WILL need to do it again, because we now have per-semester mercurial repositories.+**__NOTE:__** If you have already done this on your pi, you do NOT need to do it again.
  
-Because we will be juggling our activities between lab46 and your raspberry pi (ideally doing the bulk of the work on the pi, then transferring it to lab46 to submit), you will also want to clone your repository on your pi.+Because we will be juggling our activities between lab46 and your raspberry pi (ideally doing the bulk of the work on the pi, then transferring it to lab46 to submit), you will also want to clone your repository on your pi:
  
-I have created a script that will facilitate this, all you have to do is log onto your pi, download the script, and execute it (providing valid information as it requests):+  * make sure you have the "mercurial" package installed 
 +  * my example will have you cloning it into ~/src (NOTE: ~ below the escape key; it is not -) 
 +  * be sure to replace "yourusername" with your actual lab46 username 
 +  * do NOT change tokens of "user" or "username"
  
 <cli> <cli>
-yourpi:~$ wget -q https://lab46.g7n.org/~wedge/piph/download -O piph +yourpi:~$ hg clone https://lab46.g7n.org/hg/user/yourusername ~/src
-yourpi:~$ bash ./piph+
 </cli> </cli>
  
Line 231: Line 229:
  
 You may be prompted for authentication. It is your lab46 account and password. You may be prompted for authentication. It is your lab46 account and password.
 +
 +Next, we will configure the repository (using nano to edit the appropriate file):
 +
 +<cli>
 +yourpi:~$ nano ~/src/.hg/hgrc
 +</cli>
 +
 +And you will want to input the following (any existing, default content can be eliminated):
 +
 +<file>
 +[paths]
 +default = https://lab46.g7n.org/hg/user/yourusername
 +
 +[ui]
 +username = yourusername <yourusername@lab46.g7n.org>
 +
 +[web]
 +push_ssl = False
 +allow_push = *
 +
 +[auth]
 +lab46.prefix = https://lab46.g7n.org/hg/user/yourusername
 +lab46.username = yourusername
 +lab46.schemes = https
 +</file>
 +
 ====Program to Implement==== ====Program to Implement====
 As a first week exercise, I would like you to implement, successfully compile, and verify correct execution of the best first program every great programmer writes: **Hello World** As a first week exercise, I would like you to implement, successfully compile, and verify correct execution of the best first program every great programmer writes: **Hello World**
Line 253: Line 277:
 </code> </code>
  
-Your task will be to transcribe this code into a source file (call it **hello.c** for simplicity), within the pertinent SEMESTER subdirectory of your lab46 account (**~/src/SEMESTER/DESIG/ntr0/** would be the ideal choice). +Your task will be to transcribe this code into a source file (call it **hello.c** for simplicity), within some subdirectory of your lab46 account (**~/src/cprog/ntr0/** may be a good choice).
- +
-You should have already established the ~/src/SEMESTER/DESIG/ntr0 directory when you cloned your repository in the previous section. Make sure you have successfully done that before you proceed (ie if, when you run the following **cd** command you get an error, investigate it)+
  
 <cli> <cli>
-yourpi:~$ cd ~/src/SEMESTER/DESIG/ntr0 +yourpi:~$ mkdir -p ~/src/desig/ntr0 
-yourpi:~/src/SEMESTER/DESIG/ntr0$ +yourpi:~$ cd ~/src/desig/ntr0 
 +yourpi:~/src/desig/ntr0$ 
 </cli> </cli>
  
-NOTE: "DESIG" is your class designation ("cprog", "unix", "data", "discrete", "c4eng", etc.) Do NOT literally type D-E-S-I-G.+NOTE: "desig" is your class designation ("cprog", "unix", "data", "discrete", "c4eng", etc.) Do NOT literally type "desig"
  
-Similarly, "SEMESTER" is the current semester (such as "spring2021" or "fall2021"), do NOT literally type S-E-M-E-S-T-E-R. +You may want to use the **nano** text editor for this:
- +
-If there are no files in this **ntr0** subdirectory, AND you have successfully cloned your repository onto your pi, you may need to pull/update changes:+
  
 <cli> <cli>
-yourpi:~/src/SEMESTER/DESIG/ntr0$ hg pull; hg update +yourpi:~/src/desig/ntr0$ nano hello.c
-</cli> +
- +
-You may want to use the **nano** text editor to edit your program source: +
- +
-<cli> +
-yourpi:~/src/SEMESTER/DESIG/ntr0$ nano hello.c+
 </cli> </cli>
  
Line 286: Line 301:
 Note that if there are any changes, you will be prompted whether or not you'd like to save them (the changes are in memory (aka the buffer), and nano will prompt if you'd like to save the modified buffer). You will then be prompted for the filename (filling in the current filename, if there is one). Just press enter to accept these changes. Note that if there are any changes, you will be prompted whether or not you'd like to save them (the changes are in memory (aka the buffer), and nano will prompt if you'd like to save the modified buffer). You will then be prompted for the filename (filling in the current filename, if there is one). Just press enter to accept these changes.
  
-To see if you typed everything correctly, type **make** at the prompt. +Whenever you make a new file you wish for mercurial to track, you will first need to "addit:
- +
-If you type **make run** you should see it display "Hello, World!" +
- +
-When that is all said and done, you'll want to update your repository with your changes. To avoid unnecessary conflicts, you should ALWAYS check for incoming changes before you try and commit new changes:+
  
 <cli> <cli>
-yourpi:~/src/SEMESTER/DESIG/ntr0$ hg pull; hg update+yourpi:~/src/desig/ntr0$ hg add hello.c
 </cli> </cli>
  
-With that out of the way, you can proceed to adding/committing/pushing your changes. +You can then commit the current snapshot of it:
- +
-Whenever you make a new file you wish for mercurial to track, you will first need to "add" it:+
  
 <cli> <cli>
-yourpi:~/src/SEMESTER/DESIG/ntr0$ hg add hello.c+yourpi:~/src/desig/ntr0$ hg commit -m "adding hello.c"
 </cli> </cli>
  
-You can then commit the current snapshot of it:+And finally, pushing it to the server:
  
 <cli> <cli>
-yourpi:~/src/SEMESTER/DESIG/ntr0$ hg commit -m "adding hello.c"+yourpi:~/src/desig/ntr0$ hg push
 </cli> </cli>
  
-And finally, pushing it to the server:+Verify you typed in everything correctly by compiling it; you want no warnings or errors:
  
 <cli> <cli>
-yourpi:~/src/SEMESTER/DESIG/ntr0$ hg push+yourpi:~/src/desig/ntr0$ gcc -Wall --std=gnu99 -o hello hello.c 
 +yourpi:~/src/desig/ntr0$ 
 </cli> </cli>
  
 If there are any errors or additional changes to be made, make them, and then do a follow-up "commit" and "push". Ideally you will want to make several commits per file per project, capturing your implementation progress (the more snapshots you make, the more points of restoration will exist to you should you need to backtrack). If there are any errors or additional changes to be made, make them, and then do a follow-up "commit" and "push". Ideally you will want to make several commits per file per project, capturing your implementation progress (the more snapshots you make, the more points of restoration will exist to you should you need to backtrack).
  
-Once satisfied, be sure to submit the program source code and binaries as indicated below.+Get to know/ask questions about that **gcc** line... this will not be the only time you see it. 
 + 
 +Finally, verify the program runs as anticipated: 
 + 
 +<cli> 
 +yourpi:~/src/desig/ntr0$ ./hello 
 +Hello, World! 
 +yourpi:~/src/desig/ntr0$  
 +</cli> 
 + 
 +Once satisfied, be sure to submit the program source code as indicated below.
  
 ====Information==== ====Information====
Line 330: Line 350:
  
 <cli> <cli>
-yourpi:~$ cd ~/src/SEMESTER/DESIG/ntr0 +yourpi:~$ mkdir -p ~/src/desig/ntr0 
-yourpi:~/src/SEMESTER/DESIG/ntr0$ +yourpi:~$ cd ~/src/desig/ntr0 
 +yourpi:~/src/desig/ntr0$ 
 </cli> </cli>
  
-If you have grabbed the **ntr0** project on lab46, and pulled/updated it on your pi, you can run the **setup** script to facilitate the recording of this information:+You may want to use the **nano** text editor for this:
  
 <cli> <cli>
-yourpi:~/src/SEMESTER/DESIG/ntr0$ ./setup+yourpi:~/src/desig/ntr0$ nano info.text
 </cli> </cli>
 +
 +The **nano** text editor is a simple editor that provides basic functionality (commands listed at the bottom of the screen. You press the CONTROL key in combination with whatever letter invokes the desired functionality).
 +
 +To save the file: CTRL+o
 +
 +To save and exit (or exit if there are no changes made): CTRL+x
 +
 +Note that if there are any changes, you will be prompted whether or not you'd like to save them (the changes are in memory (aka the buffer), and nano will prompt if you'd like to save the modified buffer). You will then be prompted for the filename (filling in the current filename, if there is one). Just press enter to accept these changes.
  
 Whenever you make a new file you wish for mercurial to track, you will first need to "add" it: Whenever you make a new file you wish for mercurial to track, you will first need to "add" it:
  
 <cli> <cli>
-yourpi:~/src/SEMESTER/DESIG/ntr0$ hg add info.text+yourpi:~/src/desig/ntr0$ hg add info.text
 </cli> </cli>
  
Line 349: Line 378:
  
 <cli> <cli>
-yourpi:~/src/SEMESTER/DESIG/ntr0$ hg commit -m "adding info.txt for ntr0"+yourpi:~/src/desig/ntr0$ hg commit -m "adding info.txt for ntr0"
 </cli> </cli>
  
Line 355: Line 384:
  
 <cli> <cli>
-yourpi:~/src/SEMESTER/DESIG/ntr0$ hg push+yourpi:~/src/desig/ntr0$ hg push
 </cli> </cli>
  
Line 385: Line 414:
  
 <cli> <cli>
-lab46:~/src/SEMESTER$ hg pull; hg update+lab46:~/src$ hg pull; hg update
 </cli> </cli>
  
Line 391: Line 420:
  
 Make sure you've pushed any and all commits before you do this, though! Make sure you've pushed any and all commits before you do this, though!
- 
-Once your changes have been pulled back and updated on your lab46 copy, go into your **ntr0** directory on lab46 and run **make** once again (this will compile your code on lab46). You'll notice you should then have TWO (green) hello binaries: hello.x86_64 and hello.armv7l 
  
 =====Part 6: Submission of the project===== =====Part 6: Submission of the project=====
Line 399: Line 426:
   * Project must be submit on time, by the posted deadline to be eligible for full credit.   * Project must be submit on time, by the posted deadline to be eligible for full credit.
     * Late submissions will lose 33% credit per day, with the submission window closing on the 3rd day following the deadline.     * Late submissions will lose 33% credit per day, with the submission window closing on the 3rd day following the deadline.
-    * Early submissions can earn at least one bonus point per day in advance of the posted due date.+    * Early submissions can earn bonus point per day in advance of the posted due date.
   * All code must compile cleanly (no warnings or errors)   * All code must compile cleanly (no warnings or errors)
     * all requested functions must be implemented in the related library or program     * all requested functions must be implemented in the related library or program
haas/fall2020/common/projects/ntr0.1611759637.txt.gz · Last modified: 2021/01/27 15:00 by wedge