Faculty of Engineering and Mathematical Sciences 
Not logged in (login)

help4407


This forum is provided to promote discussion amongst students enrolled in Open Source Tools and Scripting (CITS4407).
 
Options:
RSS cloud
Jump to:

There are 39 articles from this person

39 of 390 articles shown, currently no other people reading this forum.

UWA week 24 - 1st semester, 1st exam week

photo Re: lec # wk 10 File Attributes - Square Bracket command external or internal (all 14)
Tue 9th Jun, 5:26pm, David M.
Sometimes the same executable file supports multiple commands and executes the one it was called with based on value of the program name (argv[0]) passed to it. E.g. executable file X may be linked to by "a" and "b". When you run command "a" the system runs...
photo Re: lec # wk 10 File Attributes - Square Bracket command external or internal (all 14)
Tue 9th Jun, 4:36pm, David M.
PS I meant the built-in and external versions of "test" may differ. The external commmands "test" and "[" are links to the same external command.
photo Re: lec # wk 10 File Attributes - Square Bracket command external or internal (all 14)
Tue 9th Jun, 4:26pm, David M.
The command "test" or "[" is available both as an external command and as a Bourne shell built-in command (and therefore as a bash built-in also). (As I recall they can differ slightly in their supported options.) See the bash documentation <https://www.gnu.org/software/bash/manual/html_node/Bourne-Shell-Builtins.html#Bourne-Shell-Builtins>...

UWA week 23 - 1st semester, study break

photo Re: Bash vs Other Programming Languages (eg Python or C) (all 4)
Sun 7th Jun, 7:05pm, David M.
The assignments require you to demonstrate what you CAN do with bash not what you SHOULD do with bash. You would never use bash to write a significant program. Bash and other shells are primarily to help a user interact with the operating system. This...

UWA week 22 - 1st semester, week 12

photo Re: Clarifications for Assignment 2 (all 41)
Thu 28th May, 10:36am, David M.
Yes, the effect of the block cache was quite noticable between first and subsequent executions of the script. I also tried creating a ramdisk and storing the files on that and was disappointed that it made no improvement at all in the program execution time....
photo Re: Clarifications for Assignment 2 (all 41)
Wed 27th May, 4:01pm, David M.
I spent some time investigating script performance in Task 3 and I was concerned about it being slow under WSL2 (it wasn't). My solution typically runs in under 4.8 seconds. > There is a definite lower limit on execution time based on how long it takes just...

UWA week 21 - 1st semester, week 11

photo Re: assigment2 Q3 about time (all 7)
Sun 24th May, 7:54pm, David M.
You should refer to the GTFS documentation online. stop_times.txt contains arrival time and departure time for each stop on a trip. It might have been helpful if an entity relationship diagram had been included in the GTFS documentation - I don't know why...
photo Re: assigment2 Q3 about time (all 7)
Sun 24th May, 6:08pm, David M.
You should refer to the GTFS documentation online. The exact information you require is to found in the file transfers.txt.
photo Re: Clarifications for Assignment 2 (all 41)
Sat 23rd May, 10:08pm, David M.
I assumed that the script must work for any geographical location date and time. Thes assumptions seem plausible because a latitude and longitude are required to be passed as parameters and the date and time are calculated in the script.
photo Re: Clarifications for Assignment 2 (all 41)
Sat 23rd May, 10:02pm, David M.
The GTFS files refer to a "service id". This, together with the associated calendar day flags (and calendar exceptions), corresponds to the local Transperth terminology of stopping pattern. Stopping patterns exist on all the metropolitan railway lines....
photo Re: Assignment 2, Task 1. (all 11)
Fri 22nd May, 8:03pm, David M.  O.P.
I and many others have asked similar questions. The answer seems to be both - the script should be runnable from the command line and in addition we need to submit a modified makefile for the calcmarks project which includes a new target to perform the...
photo Re: Clarifications for Assignment 2 (all 41)
Fri 22nd May, 6:24pm, David M.
My interpretation of the calendar files is that each record in calendar.txt flags the days of the week when that service normally operates - columns 2 to 8. They are always weekdays (i.e. flags 1,1,1,1,1,0,0) or Saturday (flags 0,0,0,0,0,1,0) or Sunday (flags...
photo Re: Clarifications for Assignment 2 (all 41)
Fri 22nd May, 3:36pm, David M.
From the GTFS documentation and the contents of the Transperth data files it can be seen that calendar.txt and calendar_dates.txt contain essential information needed to correctly compute a route.
photo Re: Assignment 2, Task 1. (all 11)
Fri 22nd May, 12:30am, David M.  O.P.
As I understand it the updateversion script could be stored anywhere and you would invoke it the appropriate way. E.g.: If it is in the same directory as Makefile and executable: ./updateversion or else bash updateversion. If it is executable and can be...
photo Re: Assign 2 Q2 - execution time very long (all 3)
Tue 19th May, 3:22pm, David M.
Things I have found helpful for script debugging and performance measurement, in decreasing order of importance are: 1. Print debug statements in the code at suitable places. 2. Set bash debugging option -x to confirm the script is working as you intended....
photo Re: Assign 2, Q3 - haversine.awk implementations (all 3)
Mon 18th May, 11:38pm, David M.
I modified the supplied haversine.awk file slightly by removing the file processing statements to make it a pure function. Then I include it my own AWK program. It's more useful that way.
photo Assignment 2, Task 2 (both)
Mon 18th May, 1:06pm, David M.
I am concerned about a lack of clarity regarding the requirements for the second part of Task 2. The specifications state only "the other visualisations should present some more insightful information, such as any URLs that are 'trending' across the week,...

UWA week 20 - 1st semester, week 10

photo Re: Assignment2 Q3 maps (all 8)
Sun 17th May, 4:45pm, David M.
Google Charts states: "The Google Map Chart displays a map using the Google Maps API." Google Maps documentation states: : "Before you can start using the Google Maps Platform APIs and SDKs, you must sign up and create a billing account." There is free...
photo Re: question about route strategy (all 4)
Fri 15th May, 5:09pm, David M.
The specifications for Assignment 2, Task 3 state: "less than a kilometre or twenty minutes walk from a train station". I deduced the walking speed from this statement and applied it to compute the time to walk to the nearest station. In an earlier post...
photo Assignment 2, Task 1. (all 11)
Tue 12th May, 8:24pm, David M.
The assignemnt specifications for Task 1 state "Finally, add a new target to the project's Makefile to update the version number in the C source files and in the Makefile, itself." Just to be clear: we only have to submit the script "updateversion" for...
photo Re: Assignment 2 - Q1 (all 16)
Tue 12th May, 7:56pm, David M.
Assignment 2, Task 1 states that "your shellscript should receive the project's name as a command-line parameter". It does not say that the project's name is the ONLY parameter. In my solution the script also receives the complete list of all the project...

UWA week 18 - 1st semester, week 8

photo Do not change WSL Linux files using Windows apps and tools.
Thu 30th Apr, 6:02pm, David M.
See this URL for important information: <https://devblogs.microsoft.com/commandline/do-not-change-linux-files-using-windows-apps-and-tools/>. Quoting from the above document: "There is one hard-and-fast rule when it comes to WSL on Windows:" "DO NOT, under...

UWA week 17 - 1st semester, week 7

photo Accessing WSL files rom Windows.
Fri 24th Apr, 3:36pm, David M.
You can browse the WSL filesystem from Windows and you can create a network drive mapping for the WSL filesystem. If you do this you can simply launch a file with the appropriate Windows app (e.g. Firefox)by clicking on the WSL file (e.g. csssubmit.html)...
photo Re: Windows Subsystem for Linux (WSL) -Step 4(Unable to save the configuration file ) (all 4)
😢Fri 24th Apr, 2:24pm, David M.
I do not understand this: I originally installed WSL1 and later upgraded to WSL2 on my laptop but I do not recall ever seeing anything like that on either occasion. I installed the Ubuntu Linux distribution from the Microsoft Store. Did you try that?
photo Running Windows programs from WSL command line.
Fri 24th Apr, 1:59pm, David M.
If the appropriate Windows folder is in your PATH variable just type the program name otherwise type the full pathname of the executable. Example: $ firefoxe.exe launches Windows Firefox if folder /mnt/c/Program Files (x86)/Mozilla Firefox/ is in your PATH....
photo Re: Problem with script functionality on Ubuntu Linux and MacOS (all 6)
Mon 20th Apr, 2:19pm, David M.
This is the most amusing part of the article: "The reason that Apple includes such an old version of Bash in its operating system has to do with licensing. Since version 4.0 (successor of 3.2), Bash uses the GNU General Public License v3 (GPLv3), which...

UWA week 16 - 1st semester, mid-semester break

photo Re: Problem with script functionality on Ubuntu Linux and MacOS (all 6)
Sun 19th Apr, 12:46pm, David M.
Upgrade bash: <https://itnext.io/upgrading-bash-on-macos-7138bd1066ba?gi=bbe7358c1dba>
photo Re: Assignment 1 Task 1 quick question (all 6)
Thu 16th Apr, 12:20pm, David M.
90% of my code is carefully validating the inputs. Only one line does the actual work. I hope that is not a problem.

UWA week 15 - 1st semester, non-teaching week

photo Re: Assignment 1, Task 4 (all 13)
Thu 9th Apr, 3:16pm, David M.  O.P.
Sorry Chris, I did not mean to appear adverarial. But I have already submitted my solution and I did not want to revise it!
photo Re: Assignment 1, Task 4 (all 13)
Thu 9th Apr, 2:54pm, David M.  O.P.
When I download files I am prompted for a file name. I chose "kaggle-titanic.csv" for the file. I have several other versions of the file from other sources all with with different names. So it makes sense for me to specify a file name. Also I have already...
photo Re: Assignment 1, Task 4 (all 13)
Wed 8th Apr, 10:13pm, David M.  O.P.
Good question. For my solution I assumed the file name of the data file is on the command-line. I.e. My script is named "families", my data was saved to a file "kaggle-titanic.csv" and so I run the command-line: $ families kaggle-titanic.csv But those were...
photo Assignment 1. Task 4. (all 13)
Tue 7th Apr, 10:25am, David M.
Tasks1 to 3 each specify a name for the required script. I.e. Task 1 is "between", Task 2 is "mylotto", Task 3 is "bookindex". Is there a specific name for the script in for Task 4?
photo Links on help4407 page not working. (both)
Mon 6th Apr, 1:53pm, David M.
The links for "Assignment 1" and "Clarifications" on the help4407 Web page do not work for me - the associated URLs contain an inaccessible domain name.

UWA week 14 - 1st semester, week 6

photo Assignment 1. Task 3. (both)
Fri 3rd Apr, 3:43pm, David M.
Could we have a sample text file for task 3 for unit testing purposes? I am also wondering about issues such as greater-than and less-than symbols ocurring in the text where they are used as mathematical sybols instead of delimiters. E.g. 0<x, and x>-1....
photo Assignment 1 Task 1 (both)
Thu 2nd Apr, 6:50pm, David M.
The example output from the "between" program gives the difference between 2 April and 20 April as 19 days. However, the stated convention is that consecutive days differ by 1. Therefore, I would expect the 2nd and 20th days of April to differ by 18...
photo Re: Output for Question 2 in Exercise 3 (all 9)
Thu 2nd Apr, 6:27pm, David M.
Locales are a complicated topic. Basically if you are using a non-English language computing environment you may need to run a command such as $ export LC_ALL=C for locale aware programs to behave as they do for US English language environments.

UWA week 13 - 1st semester, week 5

photo Re: Output for Question 2 in Exercise 3 (all 9)
Thu 26th Mar, 10:17pm, David M.
The order of words in your output looks unusual: Ie.g. would expect uppercase "A" to precede lower case "a". Could this warning from the man page for SORT(1) be relevent to your problem? *** WARNING *** The locale specified by the environment affects...
photo Re: Output for Question 2 in Exercise 3 (all 9)
Thu 26th Mar, 10:13pm, David M.

UWA week 12 - 1st semester, week 4

photo Re: Windows Sub-system for Linux is really good (Trust me) and other cool ways to linux from home (all 5)
Sun 22nd Mar, 4:41pm, David M.
I have been using both standalone Ubuntu Linux and Ubuntu on WSL. Both work perfectly well for this unit. Don't know why anyone would want to RDP to a remote Linux box for this unit. In fact, for intetrest, I installed Linux Desktop on WSL and I run bash...
This Page


Program written by: [email protected]
Feedback welcome
Last modified:  3:57pm Aug 06 2020