This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
haas:fall2020:common:projects:ntr0 [2021/01/27 15:06] – wedge | haas: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 | + | * 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/ | * have a contextual/ | ||
* 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: " | + | Say some of my former students now employed |
=====Abstraction===== | =====Abstraction===== | ||
- | {{page> | + | {{page> |
=====Locational Awareness===== | =====Locational Awareness===== | ||
- | {{page> | + | {{page> |
=====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: | + | **__NOTE: |
- | 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 | + | 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: | ||
</ | </ | ||
- | NOTE: you ONLY want to run ' | + | NOTE: you ONLY want to run ' |
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: |
- | SEMESTER | + | |
- | lab46: | + | |
- | lab46: | + | |
A .hgignore | A .hgignore | ||
- | lab46:~/src/SEMESTER$ | + | lab46: |
</ | </ | ||
- | Once cloned (to your ~/src/ | + | 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: |
- | lab46:~/src/SEMESTER$ hg commit -m "brief message describing the changes" | + | lab46: |
- | lab46:~/src/SEMESTER$ hg push | + | lab46: |
</ | </ | ||
Line 217: | Line 213: | ||
====Clone your Lab46 Mercurial Repository on your raspberry pi==== | ====Clone your Lab46 Mercurial Repository on your raspberry pi==== | ||
- | **__NOTE: | + | **__NOTE: |
- | 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 | + | * make sure you have the " |
+ | * my example will have you cloning | ||
+ | * be sure to replace " | ||
+ | * do NOT change tokens of " | ||
<cli> | <cli> | ||
- | yourpi: | + | yourpi: |
- | yourpi:~$ bash ./piph | + | |
</ | </ | ||
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 ~/ | ||
+ | </ | ||
+ | |||
+ | And you will want to input the following (any existing, default content can be eliminated): | ||
+ | |||
+ | < | ||
+ | [paths] | ||
+ | default = https:// | ||
+ | |||
+ | [ui] | ||
+ | username = yourusername < | ||
+ | |||
+ | [web] | ||
+ | push_ssl = False | ||
+ | allow_push = * | ||
+ | |||
+ | [auth] | ||
+ | lab46.prefix = https:// | ||
+ | lab46.username = yourusername | ||
+ | lab46.schemes = https | ||
+ | </ | ||
+ | |||
====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: | ||
</ | </ | ||
- | Your task will be to transcribe this code into a source file (call it **hello.c** for simplicity), | + | Your task will be to transcribe this code into a source file (call it **hello.c** for simplicity), |
- | + | ||
- | You should have already established the ~/ | + | |
<cli> | <cli> | ||
- | yourpi: | + | yourpi: |
- | yourpi: | + | yourpi:~$ cd ~/src/desig/ |
+ | yourpi: | ||
</ | </ | ||
- | NOTE: "DESIG" is your class designation (" | + | NOTE: "desig" is your class designation (" |
- | Similarly, " | + | You may want to use the **nano** text editor for this: |
- | + | ||
- | If there are no files in this **ntr0** subdirectory, | + | |
<cli> | <cli> | ||
- | yourpi: | + | yourpi: |
- | </ | + | |
- | + | ||
- | You may want to use the **nano** text editor to edit your program source: | + | |
- | + | ||
- | < | + | |
- | yourpi: | + | |
</ | </ | ||
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 |
- | + | ||
- | If you type **make run** you should see it display | + | |
- | + | ||
- | 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: | + | yourpi: |
</ | </ | ||
- | With that out of the way, you can proceed to adding/ | + | 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 " | + | |
<cli> | <cli> | ||
- | yourpi: | + | yourpi: |
</ | </ | ||
- | You can then commit the current snapshot of it: | + | And finally, pushing |
<cli> | <cli> | ||
- | yourpi: | + | yourpi: |
</ | </ | ||
- | And finally, pushing | + | Verify you typed in everything correctly by compiling |
<cli> | <cli> | ||
- | yourpi: | + | yourpi: |
+ | yourpi: | ||
</ | </ | ||
If there are any errors or additional changes to be made, make them, and then do a follow-up " | If there are any errors or additional changes to be made, make them, and then do a follow-up " | ||
- | Once satisfied, be sure to submit the program source code and binaries | + | 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: | ||
+ | |||
+ | < | ||
+ | yourpi: | ||
+ | Hello, World! | ||
+ | yourpi: | ||
+ | </ | ||
+ | |||
+ | Once satisfied, be sure to submit the program source code as indicated below. | ||
====Information==== | ====Information==== | ||
Line 330: | Line 350: | ||
<cli> | <cli> | ||
- | yourpi: | + | yourpi: |
- | yourpi: | + | yourpi:~$ cd ~/src/desig/ |
+ | yourpi: | ||
</ | </ | ||
- | If you have grabbed | + | You may want to use the **nano** text editor for this: |
<cli> | <cli> | ||
- | yourpi: | + | yourpi: |
</ | </ | ||
+ | |||
+ | 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 " | Whenever you make a new file you wish for mercurial to track, you will first need to " | ||
<cli> | <cli> | ||
- | yourpi: | + | yourpi: |
</ | </ | ||
Line 349: | Line 378: | ||
<cli> | <cli> | ||
- | yourpi: | + | yourpi: |
</ | </ | ||
Line 355: | Line 384: | ||
<cli> | <cli> | ||
- | yourpi: | + | yourpi: |
</ | </ | ||
Line 385: | Line 414: | ||
<cli> | <cli> | ||
- | lab46:~/src/SEMESTER$ hg pull; hg update | + | lab46: |
</ | </ | ||
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 1 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 | ||
Line 421: | Line 448: | ||
<cli> | <cli> | ||
- | lab46: | + | lab46: |
- | Submitting | + | Submitting |
- | -> ntr0-DATESTAMP.tar.gz(OK) | + | -> hello.c(OK) |
+ | -> info.text(OK) | ||
SUCCESSFULLY SUBMITTED | SUCCESSFULLY SUBMITTED | ||
- | lab46: | + | lab46: |
</ | </ | ||
Line 439: | Line 467: | ||
*: | *: | ||
*: | *: | ||
- | *: | ||
*: | *: | ||
- | *: | + | *: |
- | *: | + | *: |
+ | *: | ||
*: | *: | ||
- | *: | ||
*: | *: | ||
*: | *: | ||
- | *:ntr0:no compiler | + | *:ntr0:no compiler |
+ | *:ntr0:no compiler errors | ||
</ | </ | ||