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] – [upf0steps] 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: | + | |
- | 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 | ||
+ | |||
+ | set xrange [0.9:5.7] | ||
+ | set xtics 1, .5, 6 | ||
+ | set mxtics 1 | ||
+ | |||
+ | set style line 1 linewidth 4 | ||
+ | set style line 2 linewidth 1 | ||
+ | set style line 3 linewidth 2 | ||
+ | plot ' | ||
+ | '' | ||
+ | '' | ||
</ | </ | ||
- | With these constraints, | + | ===generating |
- | ====Example==== | + | < |
- | For example, let's say we have 2 solutions to the above-listed task 0. | + | lab46: |
+ | lab46: | ||
+ | lab46: | ||
+ | </ | ||
+ | |||
+ | ===the graph=== | ||
+ | |||
+ | {{ http:// | ||
+ | |||
+ | ====plotting a histogram==== | ||
+ | |||
+ | ===the data=== | ||
+ | < | ||
+ | march 5 55 20 30 40 | ||
+ | april 6 35 40 30 55 | ||
+ | may 7 45 50 60 70 | ||
+ | </ | ||
+ | |||
+ | ===the gnuplot file=== | ||
+ | < | ||
+ | set title ' | ||
+ | set xlabel ' | ||
+ | set ylabel ' | ||
+ | |||
+ | set terminal png size 600,400 | ||
+ | |||
+ | set grid | ||
+ | set tics out nomirror | ||
+ | set border 3 front linetype black linewidth 1.0 dashtype solid | ||
+ | |||
+ | set xrange [-1:3] | ||
+ | set xtics 1 | ||
+ | |||
+ | set yrange [0:80] | ||
+ | |||
+ | set style line 1 linecolor rgb '# | ||
+ | |||
+ | set style histogram clustered gap 1 title offset character | ||
+ | set style data histograms | ||
+ | |||
+ | set boxwidth 1.0 absolute | ||
+ | set style fill solid 5.0 border -1 | ||
+ | |||
+ | plot ' | ||
+ | '' | ||
+ | '' | ||
+ | '' | ||
+ | </ | ||
- | 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:// |
+ | =====Your Task===== | ||
+ | Your task for this project is as follows: | ||
- | ===Numbers=== | + | * write a script **gtf0.sh** |
- | We see that we are only allowed to use the three, five, seven, and nine numbers tools in the solution | + | * from the [[/ |
+ | * the list of projects, the lowscore, average, median, and hiscore values of each of the evaluated projects | ||
+ | * places these values in columns | ||
+ | * from your **~/ | ||
+ | * obtains the scores | ||
+ | * 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 | ||
+ | * for instance, DESIG in our case is: **unix** | ||
+ | * sets a y axis label of ' | ||
+ | * sets an x axis label of ' | ||
+ | * sets output destination to: | ||
+ | * 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, using the projects (in the order listed) as the x-axis tic values: | ||
+ | * each line should be a different, solid color, of a minimum thickness of 2. | ||
+ | * align each plotted category against the x axis-listed project (ie pbx1 avgscore, median, etc. line up with the pbx1 tic on the x-axis). | ||
+ | * be sure that each line is identified (titled) by its category (lowscore, avgscore, median, hiscore, yourscore), especially as identified in the graph key | ||
+ | * your line should is the same, only having a greater thickness (at least 4); this should help it stand out nicely against the rest of your graph. | ||
+ | * and, plot your line last, that will cause it to draw over any lines it will intersect with | ||
- | ===Operations=== | ||
- | Same situation with operations... the tools allowed may differ from problem to problem. | ||
- | ===minimum pipes=== | + | ====End result==== |
- | We'll see here that, if both problems | + | What you are aiming |
- | We will need to perform an inventory on the pipes to make sure this requirement has been met. | + | {{ https:// |
- | ===maximum pipes=== | + | ... only it adds an additional line: YOUR actual scores on the projects. |
- | Similar case here as with minimum pipes. | + | |
- | ===conclusion=== | + | So this graph will be a nice visual indicator of how you did in various aspects related |
- | Once we have performed these tests on a problem, we can tally up and compute the result, so we can compare it to others. | + | |
- | =====Submission===== | + | =====Spirit of project===== |
- | 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. | + | The spirit |
- | To submit this project | + | * recognizing patterns |
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | * 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. |