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 14:45] – [Clone your Lab46 Mercurial Repository on your raspberry pi] 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 256: Line 280:
  
 <cli> <cli>
-yourpi:~$ mkdir -p ~/src/SEMESTER/DESIG/ntr0 +yourpi:~$ mkdir -p ~/src/desig/ntr0 
-yourpi:~$ cd ~/src/SEMESTER/DESIG/ntr0 +yourpi:~$ cd ~/src/desig/ntr0 
-yourpi:~/src/SEMESTER/DESIG/ntr0$ +yourpi:~/src/desig/ntr0$ 
 </cli> </cli>
  
-NOTE: "DESIG" is your class designation ("cprog", "unix", "data", "discrete", "c4eng", etc.) Do NOT literally type 'DESIG'+NOTE: "desig" is your class designation ("cprog", "unix", "data", "discrete", "c4eng", etc.) Do NOT literally type "desig"
  
 You may want to use the **nano** text editor for this: You may want to use the **nano** text editor for this:
  
 <cli> <cli>
-yourpi:~/src/SEMESTER/DESIG/ntr0$ nano hello.c+yourpi:~/src/desig/ntr0$ nano hello.c
 </cli> </cli>
  
Line 280: Line 304:
  
 <cli> <cli>
-yourpi:~/src/SEMESTER/DESIG/ntr0$ hg add hello.c+yourpi:~/src/desig/ntr0$ hg add hello.c
 </cli> </cli>
  
Line 286: Line 310:
  
 <cli> <cli>
-yourpi:~/src/SEMESTER/DESIG/ntr0$ hg commit -m "adding hello.c"+yourpi:~/src/desig/ntr0$ hg commit -m "adding hello.c"
 </cli> </cli>
  
Line 292: Line 316:
  
 <cli> <cli>
-yourpi:~/src/SEMESTER/DESIG/ntr0$ hg push+yourpi:~/src/desig/ntr0$ hg push
 </cli> </cli>
  
Line 298: Line 322:
  
 <cli> <cli>
-yourpi:~/src/SEMESTER/DESIG/ntr0$ gcc -Wall --std=gnu99 -o hello hello.c +yourpi:~/src/desig/ntr0$ gcc -Wall --std=gnu99 -o hello hello.c 
-yourpi:~/src/SEMESTER/DESIG/ntr0$ +yourpi:~/src/desig/ntr0$ 
 </cli> </cli>
  
Line 309: Line 333:
  
 <cli> <cli>
-yourpi:~/src/SEMESTER/DESIG/ntr0$ ./hello+yourpi:~/src/desig/ntr0$ ./hello
 Hello, World! Hello, World!
-yourpi:~/src/SEMESTER/DESIG/ntr0$ +yourpi:~/src/desig/ntr0$ 
 </cli> </cli>
  
Line 390: Line 414:
  
 <cli> <cli>
-lab46:~/src/SEMESTER$ hg pull; hg update+lab46:~/src$ hg pull; hg update
 </cli> </cli>
  
haas/fall2020/common/projects/ntr0.1611758711.txt.gz · Last modified: 2021/01/27 14:45 by wedge