This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
haas:spring2018:unix:projects:gtf0 [2018/03/12 17:34] – [Process] wedge | haas:spring2018:unix:projects:gtf0 [2018/04/09 19:39] (current) – [plotting a single line] wedge | ||
---|---|---|---|
Line 4: | Line 4: | ||
</ | </ | ||
- | ======Project: | + | ======Project: |
=====Errata===== | =====Errata===== | ||
Line 11: | Line 11: | ||
=====Objective===== | =====Objective===== | ||
- | Working | + | Recently, you spent some quality time with your raw class status |
+ | |||
+ | Here we will be taking that to the next step, in appealing to our more visual tendencies: you will be writing a script and coordinating the various tools necessary to graph your project results against the class high, average, median, and low scores for each project (effectively, | ||
=====Background===== | =====Background===== | ||
- | As is often the case, tasks we are given are not only meant to be accomplished, but also verified. | + | Visualization has a number of uses, not only in computing, but in general: our minds are visual engines; we have phrases like "a picture is worth a thousand words", |
- | In the **upf0** project, we explored | + | By eliminating |
- | We explored automating aspects of the process | + | This project has us taking that step, taking our data we now have experience in gathering, and plotting it against various class benchmarks, so we can better gauge our overall progress |
- | Now, we will specifically | + | =====Plotting with gnuplot===== |
+ | For this project, we will be making use of the venerable **gnuplot** tool. Like many powerful tools we have encountered this semester, we seek only to scratch the surface, | ||
- | What's more, comparing one solution | + | Following will be some usage examples |
- | =====The data===== | + | ====plotting a single line==== |
- | In the **gtf0/** sub-directory of the UNIX Public Directory are a number of sub-directories named after various semesters; for example, you may see things like: | + | |
- | * spring2017/ | + | ===the data=== |
- | * fall2017/ | + | < |
- | * spring2018/ | + | 1.0 430 |
+ | 1.5 120 | ||
+ | 2.0 431 | ||
+ | 2.5 600 | ||
+ | 2.6 610 | ||
+ | 2.9 620 | ||
+ | 3.0 432 | ||
+ | 4.0 500 | ||
+ | 5.0 510 | ||
+ | 5.5 900 | ||
+ | </code> | ||
- | Inside each of these directories is a set of additional directories, | + | ===the gnuplot file=== |
+ | < | ||
+ | set title ' | ||
+ | set xlabel ' | ||
+ | set ylabel ' | ||
- | And inside THAT directory you will potentially find all or some of the following: | + | set terminal png size 600,400 |
- | * TASK | + | unset key |
- | * task0.cli | + | set tics out nomirror |
- | * task1.cli | + | set border 3 front linetype black linewidth 1.0 dashtype solid |
- | * task2.cli | + | |
- | * task3.cli | + | |
- | * task4.cli | + | |
- | * task5.cli | + | |
- | * task6.cli | + | |
- | * task7.cli | + | |
- | I say //some//, because it is possible some directories will lack the task#.cli files (denoting an incomplete or non-existent submission). | + | set xrange [1:5] |
+ | set xtics 1, .5, 5 | ||
+ | set mxtics 1 | ||
- | You will be referencing the specific TASK file in each directory, to calibrate any logic used to evaluate the results. | + | set style line 1 linecolor rgb '# |
- | NOTE: You do **NOT** want to copy this data. Reference it. This would be an __excellent__ application of variables. | + | plot ' |
+ | </ | ||
- | =====Process===== | + | ===generating the graph=== |
- | In the particular **TASK** file, there are a set of 8 tasks (ranging from 0 to 7) the provide specifications of command-lines that were to have been constructed to produce the desired outcome via particular means. | + | |
- | There are fields such as: | + | < |
+ | lab46:~/src/gtf0$ gnuplot line.gp > ~/ | ||
+ | lab46: | ||
+ | lab46: | ||
+ | </ | ||
- | * **result: | + | ===the graph=== |
- | * **numbers: | + | |
- | * **operations: | + | |
- | * **min_pipes: | + | |
- | * **max_pipes: | + | |
- | All of these factors will need to be taken into account when determining the correctness and viability of a particular solution (and then to compare one solution' | + | {{ http:// |
- | As was the case in **upf0**, the potential constraints are as follows: | + | ====plotting lines==== |
- | * **ANY:** no restrictions, | + | ===the data=== |
- | * **ONLY:** you are restricted to only those listed | + | < |
- | * **WITH_LIMITS: | + | 1.0 430 110 |
- | * **EXCEPT:** you are explicitly not allowed to use the listed; usually restricting an existing **ANY** domain | + | 1.5 120 125 |
- | + | 2.0 431 130 | |
- | There may also be quantity limits on how many times you can use each number or operation. If so, such will be shown in parenthesis following the item in question. | + | 2.5 600 150 |
- | + | 2.6 610 160 | |
- | As an example, we could have the following (formatted is it would appear in your **TASK** file): | + | 2.9 620 192 |
+ | 3.0 432 100 | ||
+ | 4.0 500 340 | ||
+ | 5.0 510 450 | ||
+ | 5.5 900 700 | ||
+ | </ | ||
+ | ===the gnuplot file=== | ||
< | < | ||
- | task: 0 | + | set title ' |
- | result: 4 | + | set xlabel ' |
- | numbers: ONLY(three(2), five, seven, nine) | + | set ylabel ' |
- | operations: ANY | + | set terminal png size 600,400 |
- | min_pipes: 2 | + | |
- | max_pipes: ANY | + | |
- | </ | + | set grid |
+ | set key below center horizontal noreverse enhanced autotitle box dashtype solid | ||
+ | set tics out nomirror | ||
+ | set border 3 front linetype black linewidth 1.0 dashtype solid | ||
- | With these constraints, | + | set xrange [0.9:5.7] |
+ | set xtics 1, .5, 6 | ||
+ | set mxtics 1 | ||
- | ====Example==== | + | set style line 1 linewidth 4 |
- | For example, let's say we have 2 solutions to the above-listed task 0. | + | set style line 2 linewidth 1 |
+ | set style line 3 linewidth 2 | ||
+ | |||
+ | plot ' | ||
+ | '' using 1:3 with lines linestyle | ||
+ | '' | ||
+ | </ | ||
- | They are as follows: | + | ===generating the graph=== |
<cli> | <cli> | ||
- | $ cat 0/task0.cli | + | lab46: |
- | seven | minus `three` | + | lab46: |
- | $ cat 1/task0.cli | + | lab46: |
- | three | minus `seven` | negate | + | |
- | $ | + | |
</ | </ | ||
- | ===Result=== | + | ===the graph=== |
- | First up, do they produce the desired result? We see from the task specification (in the **TASK** file), we need to get an output of 4. | + | |
- | Running the cli file (if present) will produce output, we can capture that and compare. | + | {{ http:// |
- | ===Numbers=== | + | ====plotting a histogram==== |
- | We see that we are only allowed to use the three, five, seven, and nine numbers tools in the solution (and three at max only twice). We will need to make sure that only these valid tools are used (and also that no actual numbers have been placed instead of calling upon the tools). | + | |
- | ===Operations=== | + | ===the data=== |
- | Same situation with operations... the tools allowed | + | < |
+ | march 5 55 20 30 40 | ||
+ | april 6 35 40 30 55 | ||
+ | may 7 45 50 60 70 | ||
+ | </ | ||
- | ===minimum pipes=== | + | ===the gnuplot file=== |
- | We'll see here that, if both problems are subject to that same task 0 specification, | + | < |
+ | set title ' | ||
+ | set xlabel ' | ||
+ | set ylabel 'y' | ||
- | We will need to perform an inventory on the pipes to make sure this requirement has been met. | + | set terminal png size 600,400 |
- | ===maximum pipes=== | + | set grid |
- | Similar case here as with minimum pipes. | + | set tics out nomirror |
+ | set border 3 front linetype black linewidth 1.0 dashtype solid | ||
- | ===conclusion=== | + | set xrange [-1:3] |
- | Once we have performed these tests on a problem, we can tally up and compute the result, so we can compare it to others. | + | set xtics 1 |
- | =====upf0steps===== | + | |
- | You will once again be creating a steps file that can automate your project. | + | |
- | As in previous projects, **upf0steps** will contain the steps you took from the point of copying the numbers suite and downloading the pipemath suite up until the submit step (hint: just run the task#.cli scripts within the steps script). | + | set yrange [0:80] |
- | * To clarify: YES, I want to see steps creating a project directory, copying and downloading files in question, extracting, compiling, installing, and then of course running each individual task#.cli script. | + | |
- | There are some additional constraints you need to keep in mind: | + | set style line 1 linecolor rgb '# |
- | * your script should not produce ANY STDERR output | + | set style histogram clustered gap 1 title offset character 0, 0, 0 |
- | * your script should ONLY produce STDOUT output in conformance with the below stated requirements. Any other output needs to be silenced. | + | set style data histograms |
- | * For each task, you'll want to display things as follows: | + | |
- | * "Task X result is: #" | + | |
- | * where X is the task number (0, 1, 2, etc.) | + | |
- | * where # is the calculated output matching the TASK file result requested (ie, you must run your task#.cli script to produce this output). | + | |
- | * note that the task#.cli output appears on the SAME line as the "Task X result is:" text, and there is a single space separating it from the colon. | + | |
- | * additionally, | + | |
- | * you will be making use of a loop to drive the execution of your results (the "Task # result is: ..."). | + | |
- | For example, a sample output of your **upf0steps** script should appear like follows | + | set boxwidth 1.0 absolute |
+ | set style fill solid 5.0 border -1 | ||
+ | |||
+ | plot ' | ||
+ | '' | ||
+ | '' | ||
+ | '' | ||
+ | </ | ||
+ | |||
+ | ===generating the graph=== | ||
<cli> | <cli> | ||
- | lab46: | + | lab46: |
- | Task 0 result is: 13 | + | lab46:~/src/gtf0$ chmod 0604 ~/ |
- | Task 1 result is: 27 | + | lab46: |
- | Task 2 result is: 32 | + | |
- | Task 3 result is: 7 | + | |
- | Task 4 result is: -4 | + | |
- | Task 5 result is: 57 | + | |
- | Task 6 result is: 2 | + | |
- | Task 7 result is: 98 | + | |
- | lab46: | + | |
</ | </ | ||
- | =====Submission===== | ||
- | By successfully performing this project, you should have a set of task#.cli files (one for each task). You will want to submit these, along with a **upf0steps** file. | ||
- | To submit | + | ===the graph=== |
+ | |||
+ | {{ http:// | ||
+ | =====Your Task===== | ||
+ | Your task for this project | ||
+ | |||
+ | * write a script **gtf0.sh** that when run: | ||
+ | * from the [[/ | ||
+ | * the list of projects, the lowscore, average, median, and hiscore values of each of the evaluated projects | ||
+ | * places these values in columns (a projects column, a lowscore column, an average column, etc.) in a **gtf0.data** file | ||
+ | * from your **~/ | ||
+ | * obtains the scores and totals of each of the evaluated unix projects | ||
+ | * calculates the score (out of 100) of each individual project | ||
+ | * places these calculated scores as a final column in your **gtf0.data** file | ||
+ | * constructs a **gtf0.gp** gnuplot file that: | ||
+ | * creates a graph title of "USER SEMESTER/ | ||
+ | * where USER, SEMESTER, and DESIG are replaced with their pertinent (and lowercase represented) values | ||
+ | * for instance, DESIG in our case is: **unix** | ||
+ | * sets a y axis label of ' | ||
+ | * sets an x axis label of ' | ||
+ | * sets output destination | ||
+ | * the terminal | ||
+ | * in png format | ||
+ | * of a resolution of **1280x1024** | ||
+ | * set a y axis range of **-10** to **110** | ||
+ | * sets the y axis tic values to a value of **10** | ||
+ | * sets a grid view | ||
+ | * establishes a graph key, that: | ||
+ | * shows and identifies all 5 data points (low, avg, med, hi, your scores) | ||
+ | * places the key NOT within the main drawing area of the graph (below and in the center would be fine) | ||
+ | * plots these 5 data sets as individual lines on your graph, | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | * and, plot your line last, that will cause it to draw over any lines it will intersect with | ||
+ | |||
+ | |||
+ | ====End result==== | ||
+ | What you are aiming for is a graph that strongly resembles this one: | ||
+ | |||
+ | {{ https:// | ||
+ | |||
+ | ... only it adds an additional line: YOUR actual scores on the projects. | ||
+ | |||
+ | So this graph will be a nice visual indicator of how you did in various aspects related to the class as a whole. | ||
+ | |||
+ | =====Spirit of project===== | ||
+ | The spirit of the project embodies many aspects we've been focusing on throughout the semester: | ||
+ | |||
+ | * recognizing patterns to employ effective solutions in problem solving | ||
+ | * utilizing concepts and tools covered | ||
+ | * demonstrating comprehension of concepts, tools, and problems | ||
+ | * employing concepts in knowledgeable and thoughtful manner | ||
+ | * following | ||
+ | * implementing to specifications | ||
+ | * utilizing creativity | ||
+ | * being able to control solution via consistent, clear, and organized presentation | ||
+ | |||
+ | Basically: I want your solution to be the result of an honest, genuine brainstorming process where you have (on your own) figured out a path to solving the problem, you have dabbled and experimented and figured things out, and you can command | ||
+ | |||
+ | Cutting corners, avoiding work, skimping on functionality, | ||
+ | |||
+ | =====Submit===== | ||
+ | Please submit as follows: | ||
<cli> | <cli> | ||
- | $ submit unix upf0 upf0steps task*.cli | + | lab46: |
- | Submitting unix project "upf0": | + | Submitting unix project "gtf0": |
- | -> upf0steps(OK) | + | -> gtf0.sh(OK) |
- | -> task0.cli(OK) | + | -> gtf0.data(OK) |
- | -> task1.cli(OK) | + | -> gtf0.gp(OK) |
- | -> task2.cli(OK) | + | -> gtf0.png(OK) |
- | -> task3.cli(OK) | + | -> http:// |
- | ... | + | |
SUCCESSFULLY SUBMITTED | SUCCESSFULLY SUBMITTED | ||
+ | lab46: | ||
</ | </ | ||
- | |||
- | You should get some sort of confirmation indicating successful submission | ||
I'll be looking for the following: | I'll be looking for the following: | ||
< | < | ||
- | 78:upf0:final tally of results (78/78) | + | 78:gtf0:final tally of results (78/78) |
- | *:upf0:upf0steps has valid list of non-interactive instructions | + | *:gtf0:gtf0.sh directly uses info dir status data when run [4/4] |
- | *:upf0:upf0steps only copies/ | + | *:gtf0:gtf0.sh effectively utilizes shell features |
- | *:upf0:upf0steps builds the various task#.cli files it runs [4/4] | + | *:gtf0:gtf0.sh is a proper bash script with shabang and exit [4/4] |
- | *:upf0:upf0steps obtains the latest pipemath release | + | *:gtf0:gtf0.sh scrapes pertinent data from class status page [4/4] |
- | *:upf0:upf0steps only displays specified STDOUT output | + | *:gtf0:gtf0.sh formats data and generates gtf0.data file [4/4] |
- | *:upf0:upf0steps resiliently creates local project directory | + | *:gtf0:gtf0.sh generates viable gtf0.gp to make intended plot [4/4] |
- | *:upf0:upf0steps copies public dir data with absolute path [4/4] | + | *:gtf0:gtf0.sh submits correct and requested items [4/4] |
- | *:upf0:upf0steps makes clear, effective use of wildcards | + | *:gtf0:gtf0.sh no line in any file exceeds 80 characters in length |
- | *:upf0:upf0steps has descriptive why and how comments | + | *:gtf0:gtf0.sh all custom variable name lengths at least 4 symbols |
- | *:upf0:upf0steps indentation used to promote scope and clarity | + | *:gtf0:gtf0.data contents arranged by column with headings |
- | *:upf0:upf0steps defines | + | *:gtf0:gtf0.gp sets proper graph title and axis labels |
- | *:upf0:upf0steps uses command expansions to get information | + | *:gtf0:gtf0.gp sets proper image format and resolution |
- | *:upf0:upf0steps uses a loop to drive numbers in final output | + | *:gtf0:gtf0.gp sets proper axis range, sets up a grid [4/4] |
- | *:upf0:upf0steps automates the task when run [4/4] | + | *:gtf0:gtf0.gp displays a valid key outside of graph area [4/4] |
- | *:upf0:all files are organized, clear, | + | *:gtf0:gtf0.gp grabs data from gtf0.data |
- | *:upf0:task#.cli files output only correct, specified data [4/4] | + | *:gtf0:gtf0.gp uses different line colors and thicknesses |
- | *:upf0:task#.cli files use specified number tools by quantity | + | *:gtf0:gtf0.gp identifies each line by category |
- | *:upf0:task#.cli files display no STDERR output | + | *:gtf0:gtf0.sh operates according to specifications |
- | *:upf0:task#.cli files have solution within given constraints | + | *:gtf0:gtf0.sh logic is organized and easy to read [5/5] |
- | *: | + | |
</ | </ | ||
+ | |||
+ | 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 | ||
+ | * comments should be consistent in appearance (adopt a style; one that promotes readability) | ||
+ | * Solutions not utilizing indentation to promote scope and clarity will be subject to a 25% overall deduction | ||
+ | * indentation should be no fewer than 3 spaces (or 3-space tabs); I prefer 4. |