User Tools

Site Tools


haas:fall2018:discrete:projects:bdt0

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:fall2018:discrete:projects:bdt0 [2018/08/26 13:01] – [Grabit] wedgehaas:fall2018:discrete:projects:bdt0 [2018/08/26 13:20] (current) – [Submission] wedge
Line 60: Line 60:
 <cli> <cli>
 lab46:~/src/discrete/bdt0$ xxd in/sample0.txt lab46:~/src/discrete/bdt0$ xxd in/sample0.txt
-0000000: 3e41 4243 4445 4647 4849 4a4b 4c4d 4e4f  >ABCDEFGHIJKLMNO +00000000: 3e41 4243 4445 4647 4849 4a4b 4c4d 4e4f  >ABCDEFGHIJKLMNO 
-0000010: 5051 5253 5455 5657 5859 5a3c 0a5b 6162  PQRSTUVWXYZ<.[ab +00000010: 5051 5253 5455 5657 5859 5a3c 0a5b 6162  PQRSTUVWXYZ<.[ab 
-0000020: 6364 6566 6768 696a 6b6c 6d6e 6f70 7172  cdefghijklmnopqr +00000020: 6364 6566 6768 696a 6b6c 6d6e 6f70 7172  cdefghijklmnopqr 
-0000030: 7374 7576 7778 797a 5d0a 3031 3a09 0920  stuvwxyz].01:.. +00000030: 7374 7576 7778 797a 5d0a 3031 3a09 0920  stuvwxyz].01:.. 
-0000040: 4249 4e41 5259 0a30 3132 3334 3536 373a  BINARY.01234567: +00000040: 4249 4e41 5259 0a30 3132 3334 3536 373a  BINARY.01234567: 
-0000050: 0920 4f43 5441 4c0a 3031 3233 3435 3637  . OCTAL.01234567 +00000050: 0920 4f43 5441 4c0a 3031 3233 3435 3637  . OCTAL.01234567 
-0000060: 3839 3a09 2044 4543 494d 414c 0a30 3132  89:. DECIMAL.012 +00000060: 3839 3a09 2044 4543 494d 414c 0a30 3132  89:. DECIMAL.012 
-0000070: 3334 3536 3738 3941 4243 4445 463a 4845  3456789ABCDEF:HE +00000070: 3334 3536 3738 3941 4243 4445 463a 4845  3456789ABCDEF:HE 
-0000080: 5841 4445 4349 4d41 4c0a 2921 4023 2425  XADECIMAL.)!@#$% +00000080: 5841 4445 4349 4d41 4c0a 2921 4023 2425  XADECIMAL.)!@#$% 
-0000090: 5e26 2a28 0a2e 0a                        ^&*(...+00000090: 5e26 2a28 0a2e 0a                        ^&*(...
 lab46:~/src/discrete/bdt0$  lab46:~/src/discrete/bdt0$ 
 </cli> </cli>
Line 100: Line 100:
   * The second command-line argument is a sizing throttle (controlling the number of lines your program will display). If no argument, or a **0** is given, display the entire file.   * The second command-line argument is a sizing throttle (controlling the number of lines your program will display). If no argument, or a **0** is given, display the entire file.
   * Each row will display:   * Each row will display:
-    * a 7-digit hex offset (referring to the first data byte on a given line)+    * a zero-padded, 8-value hex offset (referring to the first data byte on a given line)
     * followed by a colon and a single space     * followed by a colon and a single space
     * then eight space separated groups of two bytes     * then eight space separated groups of two bytes
Line 138: Line 138:
 An **ioctl(2)** is a method (and system/library call) for manipulating underlying device parameters of special files (for the UNIX people: everything is a file, including your keyboard, and **terminal screen**). We are basically querying the screen (or accessing lower level information made possible by communicating with the driver of the device) to obtain some useful information. If you've ever wondered how drivers work- this **ioctl()** functionality can be rather central to the whole process (basically, reading or writing bytes at specific memory addresses). An **ioctl(2)** is a method (and system/library call) for manipulating underlying device parameters of special files (for the UNIX people: everything is a file, including your keyboard, and **terminal screen**). We are basically querying the screen (or accessing lower level information made possible by communicating with the driver of the device) to obtain some useful information. If you've ever wondered how drivers work- this **ioctl()** functionality can be rather central to the whole process (basically, reading or writing bytes at specific memory addresses).
  
-Here we are accessing the information on our terminal file, retrieving the width and height so that we can make use of them productively in our programs.+Here we are accessing the information on our terminal file, retrieving the current width and height so that we can make use of them productively in our program.
  
 Compile and run the above code to see how it works. Try it in different size terminals. Then incorporate the logic into your hex viewer for this project. Compile and run the above code to see how it works. Try it in different size terminals. Then incorporate the logic into your hex viewer for this project.
Line 263: Line 263:
   * no forced redirection of the flow of the process (no seeking to the end of the file to grab a max size only to zip back somewhere else: deal with the data in as you are naturally encountering it).   * no forced redirection of the flow of the process (no seeking to the end of the file to grab a max size only to zip back somewhere else: deal with the data in as you are naturally encountering it).
   * With the exception of any negative values, all numbers should be transacted in hexadecimal (as in the values you assign and compare and manipulate in your code).   * With the exception of any negative values, all numbers should be transacted in hexadecimal (as in the values you assign and compare and manipulate in your code).
-  * No line must exceed 80 characters in width.+  * No line of output must exceed 80 characters in width
 +    * For code readability, note that my terminals are generally 90 characters wide. You may want to format your code to reduce line-wrappings, inadvertently making your source code less readable
   * All "arrays" must be declared and referenced using ONLY pointer notation, NO square brackets.   * All "arrays" must be declared and referenced using ONLY pointer notation, NO square brackets.
   * For the highlighted address and lengths, store them in an array of structs (containing the //address// and //length// members).   * For the highlighted address and lengths, store them in an array of structs (containing the //address// and //length// members).
Line 272: Line 273:
  
   * Code must compile cleanly (no warnings or errors)   * Code must compile cleanly (no warnings or errors)
-    * Use the **-Wall** and **--std=c99** flags when compiling (which occurs automatically when using **make**).+    * Use the **-Wall** and **--std=gnu99** flags when compiling (which occurs automatically when using **make**).
   * Code must be nicely and consistently indented (you may use the **indent** tool)   * Code must be nicely and consistently indented (you may use the **indent** tool)
   * Code must utilize the algorithm/approach presented above   * Code must utilize the algorithm/approach presented above
Line 298: Line 299:
  
 Submitting discrete project "bdt0": Submitting discrete project "bdt0":
-    -> ../bdt0-20170925-05.tar.gz(OK)+    -> ../bdt0-20180826-09.tar.gz(OK)
  
 SUCCESSFULLY SUBMITTED SUCCESSFULLY SUBMITTED
Line 305: Line 306:
  
 You should get some sort of confirmation indicating successful submission if all went according to plan. If not, check for typos and or locational mismatches. You should get some sort of confirmation indicating successful submission if all went according to plan. If not, check for typos and or locational mismatches.
 +
 +=====Evaluation Criteria=====
 +
 +What I will be looking for:
 +
 +<code>
 +130:bdt0:final tally of results (130/130)
 +*:bdt0:bdt0.c compiles cleanly, no compiler messages [13/13]
 +*:bdt0:bdt0.c implements only specified algorithm [13/13]
 +*:bdt0:bdt0.c code conforms to project specifications [26/26]
 +*:bdt0:bdt0.c implementation free from restrictions [13/13]
 +*:bdt0:bdt0 runtime output conforms to specifications [26/26]
 +*:bdt0:bdt0 make check tests succeed [13/13]
 +*:bdt0:bdt0 make checklines tests succeed [13/13]
 +*:bdt0:bdt0 make checkcolors tests succeed [13/13]
 +</code>
 +
 +Additionally:
 +  * Solutions not abiding by spirit of project will be subject to a 25% overall deduction
 +  * Solutions not utilizing descriptive why and how comments will be subject to a 25% overall deduction
 +  * Solutions not utilizing indentation to promote scope and clarity will be subject to a 25% overall deduction
 +  * Solutions not organized and easy to read (assume a terminal at least 90 characters wide, 40 characters tall) are subject to a 25% overall deduction
haas/fall2018/discrete/projects/bdt0.1535288465.txt.gz · Last modified: 2018/08/26 13:01 by wedge