User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

journal:spring2020:chorton8:week8 [2020/03/12 08:30] external edit
journal:spring2020:chorton8:week8 [2020/03/18 21:59] (current)
chorton8 final edit for journal
Line 1: Line 1:
 =====unix week8===== =====unix week8=====
 ---- ----
-====MONTH DayYEAR====+====MARCH 182020====
-Filler text- your entry goes here; remove ​this line to receive full credit.+===Script Destruction=== 
 +So this week, I absolutely brutally destroyed a script I wroteI mean, they say you learn from your mistakes, right?
 +I wrote a script to tally your points for a class abusing **status** and **sed**. Essentially it would use **sed** to get the earned score for each project and also the total score that could be earned from that project, used some math to add it to a variable, then used **bc** to finally output a percentage. Pretty simple.
 +Someone requested the dark arts that I have transcribed into a file in the form of "​code",​ so that they too may share the awesome information of their grade. I was trying to allow this process of transferring data into a single line command that this person could then execute to share my dark arts, but in the process of reading the file for the command, I somehow managed to destroy some of the main parts of that file. I still am unsure of how I accomplished such tasks, but it happened regardless. From now on, I will use **scp** to copy to my server, to which I will instruct my fellow classmates to use **wget** or a similar file downloading technology to retrieve the code.
 +===Automation Overhaul===
 +For my upf1, I tried to make a fancy loop to automate the task file generation. Why? Because I am crazy and like Bash a little too much. I made a cool function that would read the TASKS file and get the value of a specific property of each task. Then I would use that with a list of the commands used to generate all the task files. It was working well, until I needed to have specific options when using cubits or stadions. At that point, I gave up with the automation and hard-coded everything.
 +I guess a good lesson to be learned here is this: when is it appropriate to automate? I tend to, as a programmer, want to be lazy and write code to automate things that could have been done manually in less time. This is exactly one of those cases. I think learning from this and trying to understand the best outcome of manual/​automation is a great lesson to learn. Hopefully I can actually learn that lesson and not waste so much time in the future!
journal/spring2020/chorton8/week8.txt · Last modified: 2020/03/18 21:59 by chorton8