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:

Clarifications for Assignment 2

41 of 390 articles shown, currently no other people reading this forum.
photo
From: Jichunyang L.
Date: Fri 8th May 2020, 5:32pm
Actions: 
        Login-to-reply

 

Hi Chris,
I feel confused about some requirements in Assignment 2.

Task 1:

1) What does "detect and report the problem of any of the files having different 
versions numbers to any others" mean?

Reporting to any others means adding or correcting the different versions numbers?

Task 2:

NONE

Task 3:

1) The first step of this task is to determine the location (within one km of a 
train station). However, if the distance between the location and anyone train 
station over than 1 km. We should notify the users, his/her location is out of our 
service or guide the users to the nearest train station (maybe the distance more 
than 1 km)?

Thanks

Clarifications for Assignment 2

photo
From: Christopher M.
Date: Sun 10th May 2020, 11:18am
Actions: 
        Login-to-reply

 

Hi,

"Jichunyang Li" <22*7*0*[email protected]*u*e*t*u*a*e*u*a*> wrote:

> Task 1:
> 
> 1) What does "detect and report the problem of any of the files having different 
> versions numbers to any others" mean?

All file must have the exact same project-version-date line (a comment),
otherwise you'd be sure that they were all part of the same project, and wouldn't know what 
the next version number should be.

You should detect+report if there's such a problem  (and if there's a problem, exit the script 
without performing any changes).


> Task 3:
> 
> 1) The first step of this task is to determine the location (within one km of a 
> train station). However, if the distance between the location and anyone train 
> station over than 1 km. We should notify the users, his/her location is out of our 
> service or guide the users to the nearest train station (maybe the distance more 
> than 1 km)?

If there is no train station within 1km of the starting point (your home), report the error 
and exit the script.

__
Hope that helps,

Clarifications for Assignment 2

photo
From: Jichunyang L.  O.P.
Date: Wed 13th May 2020, 9:55am
Actions: 
        Login-to-reply

 

Hi Chris,

  I have looked through posts about task 1, assignment 2. 

  In summary, the "updateversion" includes three tasks:
  1) update version number and time for each C source file;
  2) detect and report "different version number problem";
  3) add a new target to Makefile to update the version number (only update version number? No 
time?) in C source files and Makefile.
  Finally, just type "make updatevision" to run this shellscript.

  Are these understandings correct? Thanks.

Clarifications for Assignment 2

photo
From: Jichunyang L.  O.P.
Date: Wed 13th May 2020, 10:58am
Actions: 
        Login-to-reply

 

"Christopher McDonald" <ch*i*.*c*o*a*[email protected]*a*e*u*a*> wrote:

> Hi,
> 
> "Jichunyang Li" <22*7*0*[email protected]*u*e*t*u*a*e*u*a*> wrote:
> 
> > Task 1:
> > 
> > 1) What does "detect and report the problem of any of the files having different 
> > versions numbers to any others" mean?
> 
> All file must have the exact same project-version-date line (a comment),
> otherwise you'd be sure that they were all part of the same project, and wouldn't know what 
> the next version number should be.
> 
> You should detect+report if there's such a problem  (and if there's a problem, exit the script 
> without performing any changes).
> 
> 
> > Task 3:
> > 
> > 1) The first step of this task is to determine the location (within one km of a 
> > train station). However, if the distance between the location and anyone train 
> > station over than 1 km. We should notify the users, his/her location is out of our 
> > service or guide the users to the nearest train station (maybe the distance more 
> > than 1 km)?
> 
> If there is no train station within 1km of the starting point (your home), report the error 
> and exit the script.

> In task 3, in order to arrive at a train station or B-shed ferry terminal, walk is necessary. 
But do we need to calculate the time of walking? Or ask Google map to show the time?
> __
> Hope that helps,

Clarifications for Assignment 2

photo
From: Christopher M.
Date: Wed 13th May 2020, 3:44pm
Actions: 
        Login-to-reply

 

Hi,

"Jichunyang Li" <22*7*0*[email protected]*u*e*t*u*a*e*u*a*> wrote:

>   In summary, the "updateversion" includes three tasks:
>   1) update version number and time for each C source file;
>   2) detect and report "different version number problem";
>   3) add a new target to Makefile to update the version number (only update version number? No 
> time?) in C source files and Makefile.
>   Finally, just type "make updatevision" to run this shellscript.


Yes, mostly correct:

- check for and report existing version mis-matches first.
  Do not make any changes/updates if there's a problem.

- yes, update the version number (in *.c, *.h and the Makefile), but also update the date+time as well.

Good luck,

Clarifications for Assignment 2

photo
From: Jichunyang L.  O.P.
Date: Wed 13th May 2020, 4:13pm
Actions: 
        Login-to-reply

 

"Christopher McDonald" <ch*i*.*c*o*a*[email protected]*a*e*u*a*> wrote:

> Hi,
> 
> "Jichunyang Li" <22*7*0*[email protected]*u*e*t*u*a*e*u*a*> wrote:
> 
> >   In summary, the "updateversion" includes three tasks:
> >   1) update version number and time for each C source file;
> >   2) detect and report "different version number problem";
> >   3) add a new target to Makefile to update the version number (only update version number? No 
> > time?) in C source files and Makefile.
> >   Finally, just type "make updatevision" to run this shellscript.
> 
> 
> Yes, mostly correct:
> 
> - check for and report existing version mis-matches first.
>   Do not make any changes/updates if there's a problem.
> 
> - yes, update the version number (in *.c, *.h and the Makefile), but also update the date+time as well.
> 
> Good luck,
 In task 3, in order to arrive at a train station or B-shed ferry terminal, the walk is necessary. 
But do we need to calculate the time of walking? Or ask Google map to show the time? Thanks.

Clarifications for Assignment 2

photo
From: Christopher M.
Date: Wed 13th May 2020, 4:23pm
Actions: 
        Login-to-reply

 

"Jichunyang Li" <22*7*0*[email protected]*u*e*t*u*a*e*u*a*> wrote:

>  In task 3, in order to arrive at a train station or B-shed ferry terminal, the walk is necessary.

Yes, you'll need to divide your walking distance by an average walking speed.

> But do we need to calculate the time of walking? Or ask Google map to show the time? Thanks.

No, Google doesn't provide any additional information, or route planning.
Google Maps just provides the background image, and displays your calculated route.

Clarifications for Assignment 2

photo
From: Jichunyang L.  O.P.
Date: Fri 15th May 2020, 3:11pm
Actions: 
        Login-to-reply

 

"Christopher McDonald" <ch*i*.*c*o*a*[email protected]*a*e*u*a*> wrote:

> "Jichunyang Li" <22*7*0*[email protected]*u*e*t*u*a*e*u*a*> wrote:
> 
> >  In task 3, in order to arrive at a train station or B-shed ferry terminal, the walk is necessary.
> 
> Yes, you'll need to divide your walking distance by an average walking speed.
> 
> > But do we need to calculate the time of walking? Or ask Google map to show the time? Thanks.
> 
> No, Google doesn't provide any additional information, or route planning.
> Google Maps just provides the background image, and displays your calculated route.
Hi, Chris,
  For task 2, one visualisation should present some more insightful information. For example, the 
number of bytes that were transferred by ONE or MORE URL(s)? Thanks

Clarifications for Assignment 2

photo
From: Christopher M.
Date: Fri 15th May 2020, 5:12pm
Actions: 
        Login-to-reply

 

"Jichunyang Li" <22*7*0*[email protected]*u*e*t*u*a*e*u*a*> wrote:

>   For task 2, one visualisation should present some more insightful information. For example, the 
> number of bytes that were transferred by ONE or MORE URL(s)? Thanks

I'm unsure if you're asking a question (or just validating your idea).
You have the freedom to choose any meaningful metric(s) and visualisation you want.

Clarifications for Assignment 2

photo
From: Jichunyang L.  O.P.
Date: Mon 18th May 2020, 9:08am
Actions: 
        Login-to-reply

 

Hi Chris,
  For task 1, the process of the it is that:
  1) "make updateversion $projectname, read the version comment from Makefile; (but what is the 
"project number"? The name of C source file?)
  2) Pass the parameter to other C source files; if there is a different version number, report the 
file name;
  3) Update version number and date;
  4) Add a target to Makefile to update Makefile's version number and date.

  For task 3, when we need to walk to a train station, the time depends on my average walking speed, 
(time=distance/average walking speed). 
  However, the equation you provided is used to calculate the linear distance rather than an actual 
distance. 
  Therefore, we assume that in this task, we divide linear distance by my walking speed. 
  Is it correct? Thanks.

Clarifications for Assignment 2

photo
From: Christopher M.
Date: Mon 18th May 2020, 10:39am
Actions: 
        Login-to-reply

 

"Jichunyang Li" <22*7*0*[email protected]*u*e*t*u*a*e*u*a*> wrote:

> Hi Chris,
>   For task 1, the process of the it is that:
>   1) "make updateversion $projectname, read the version comment from Makefile; (but what is the 
> "project number"? The name of C source file?)
>   2) Pass the parameter to other C source files; if there is a different version number, report the 
> file name;
>   3) Update version number and date;
>   4) Add a target to Makefile to update Makefile's version number and date.

Your explanation either sounds confused, but it may just be the words you're using.

There is no mention, anywhere, of a *project number*, just the project's name.
The project's name will not require changing.
If all files (currently) have the same name, version number, and date, then they can all be updated.
If any are different to the others, then report the error, and no updating should take place.


>   For task 3, when we need to walk to a train station, the time depends on my average walking speed, 
> (time=distance/average walking speed). 
>   However, the equation you provided is used to calculate the linear distance rather than an actual 
> distance. 
>   Therefore, we assume that in this task, we divide linear distance by my walking speed. 

Yes, as answered here:  https://secure.csse.uwa.edu.au/run/help4407?hl=crow&a=197

Clarifications for Assignment 2

photo
From: Jichunyang L.  O.P.
Date: Mon 18th May 2020, 12:51pm
Actions: 
        Login-to-reply

 

"Christopher McDonald" <ch*i*.*c*o*a*[email protected]*a*e*u*a*> wrote:

> "Jichunyang Li" <22*7*0*[email protected]*u*e*t*u*a*e*u*a*> wrote:
> 
> > Hi Chris,
> >   For task 1, the process of the it is that:
> >   1) "make updateversion $projectname, read the version comment from Makefile; (but what is the 
> > "project number"? The name of C source file?)
> >   2) Pass the parameter to other C source files; if there is a different version number, report the 
> > file name;
> >   3) Update version number and date;
> >   4) Add a target to Makefile to update Makefile's version number and date.
> 
> Your explanation either sounds confused, but it may just be the words you're using.
> 
> There is no mention, anywhere, of a *project number*, just the project's name.
> The project's name will not require changing.
> If all files (currently) have the same name, version number, and date, then they can all be updated.
> If any are different to the others, then report the error, and no updating should take place.
> 
> 
> >   For task 3, when we need to walk to a train station, the time depends on my average walking speed, 
> > (time=distance/average walking speed). 
> >   However, the equation you provided is used to calculate the linear distance rather than an actual 
> > distance. 
> >   Therefore, we assume that in this task, we divide linear distance by my walking speed. 
> 
> Yes, as answered here:  https://secure.csse.uwa.edu.au/run/help4407?hl=crow&a=197
sorry, should be project name, project number is a typo. 

Clarifications for Assignment 2

photo
From: Jichunyang L.  O.P.
Date: Mon 18th May 2020, 5:09pm
Actions: 
        Login-to-reply

 

"Jichunyang Li" <22*7*0*[email protected]*u*e*t*u*a*e*u*a*> wrote:

> "Christopher McDonald" <ch*i*.*c*o*a*[email protected]*a*e*u*a*> wrote:
> 
> > "Jichunyang Li" <22*7*0*[email protected]*u*e*t*u*a*e*u*a*> wrote:
> > 
> > > Hi Chris,
> > >   For task 1, the process of the it is that:
> > >   1) "make updateversion $projectname, read the version comment from Makefile; (but what is the 
> > > "project number"? The name of C source file?)
> > >   2) Pass the parameter to other C source files; if there is a different version number, report the 
> > > file name;
> > >   3) Update version number and date;
> > >   4) Add a target to Makefile to update Makefile's version number and date.
> > 
> > Your explanation either sounds confused, but it may just be the words you're using.
> > 
> > There is no mention, anywhere, of a *project number*, just the project's name.
> > The project's name will not require changing.
> > If all files (currently) have the same name, version number, and date, then they can all be updated.
> > If any are different to the others, then report the error, and no updating should take place.
> > 
> > 
> > >   For task 3, when we need to walk to a train station, the time depends on my average walking speed, 
> > > (time=distance/average walking speed). 
> > >   However, the equation you provided is used to calculate the linear distance rather than an actual 
> > > distance. 
> > >   Therefore, we assume that in this task, we divide linear distance by my walking speed. 
> > 
> > Yes, as answered here:  https://secure.csse.uwa.edu.au/run/help4407?hl=crow&a=197
> sorry, should be project name, project number is a typo. 
Hi Chris,
  Do we need to consider the waiting time at any train station?

Clarifications for Assignment 2

photo
From: Christopher M.
Date: Mon 18th May 2020, 5:38pm
Actions: 
        Login-to-reply

 

"Jichunyang Li" <22*7*0*[email protected]*u*e*t*u*a*e*u*a*> wrote:

>   Do we need to consider the waiting time at any train station?

Only if you need to transfer from one train line to another, so that you can leave Perth Station on the Fremantle Line.
Obviously any time waiting delays your arrival at the final train station,   so just ensure that you can get there on 
time.

Clarifications for Assignment 2

photo
From: Jichunyang L.  O.P.
Date: Fri 22nd May 2020, 9:54am
Actions: 
        Login-to-reply

 

Hi Chris,
  For task 3 in assignment 2, the current requirement is to print out my starting "location". So what is my starting 
"location"? Does it mean that print out latitude and longitude of my current location? Thanks.

Clarifications for Assignment 2

photo
From: Christopher M.
Date: Fri 22nd May 2020, 10:02am
Actions: 
        Login-to-reply

 

"Jichunyang Li" <22*7*0*[email protected]*u*e*t*u*a*e*u*a*> wrote:

> Hi Chris,
>   For task 3 in assignment 2, the current requirement is to print out my starting "location". So what is my starting 
> "location"? Does it mean that print out latitude and longitude of my current location? Thanks.

Yes, your starting lat/lon (or any other starting point), that you manually provide to your script.

Clarifications for Assignment 2

photo
From: Lee dB.
Date: Fri 22nd May 2020, 12:12pm
Actions: 
        Login-to-reply

 

Not sure if this has been answered already (apologies if so), but for Question 3, is it correct to assume that we need to consider 
the calendar of services and Service exceptions when formulating our route, based on the date and day the script is run? Just 
wanted to make sure I’m not over-baking it :)

Clarifications for Assignment 2

photo
From: David M.
Date: Fri 22nd May 2020, 3:36pm
Actions: 
        Login-to-reply

 

 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.

Clarifications for Assignment 2

photo
From: Lee dB.
Date: Fri 22nd May 2020, 3:40pm
Actions: 
        Login-to-reply

 

Thanks David, that was my assumption too - thanks for clarifying. :)

Clarifications for Assignment 2

photo
From: Jordan M.
Date: Fri 22nd May 2020, 5:02pm
Actions: 
        Login-to-reply

 

Hi David, I am inspecting the calendar and calendar_dates files and struggling to interpert 
the meaning of the exception_type integers and the same for the binary numbers under 
Monday, Tuesday, Wednesday.. etc in the calendar file. Could you please explain the meaning 
of this or point me in the direction of such explanation? Thanks for all your tips so far 
in the forum, have found many of them useful.

Clarifications for Assignment 2

photo
From: Lee dB.
Date: Fri 22nd May 2020, 6:21pm
Actions: 
        Login-to-reply

 

Hi Jordan,

The link on the assignment webpage to the Google specs describes most of these pretty well. My interpretation is as follows:

Exception Type:
1 - Service has been added for the specified date.
2 - Service has been removed for the specified date.

The binary indicators (0/1) under Monday, Tuesday ... Sunday in the calendar.txt file indicate whether the service runs on the given day or not - 0 meaning it doesn't run. (subject to the exceptions in calendar_dates.txt).

See: https://developers.google.com/transit/gtfs/reference?hl=en#calendartxt
https://developers.google.com/transit/gtfs/reference?hl=en#calendar_datestxt

Hope that helps!

Clarifications for Assignment 2

photo
From: David M.
Date: Fri 22nd May 2020, 6:24pm
Actions: 
        Login-to-reply

 

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 0,0,0,0,0,0,1).

However, the availabilility of services is modified by exceptions given in 
calendar_dates.txt:

If the exception code is 2 then that normal service, as specified in calendar.txt,
does not operate on that date.

If the exception code is 1 then that service is available on the that date instead
of the normal service.

The above is my interpretation and it seems to work for various weekdays, Saturdays,
Sundays and public holidays that I tested.

Clarifications for Assignment 2

photo
From: Kang L.
Date: Sat 23rd May 2020, 5:06pm
Actions: 
        Login-to-reply

 

for task3:
So we are only required to assume that the start location is our home?
If I know that there are no train stations within 1km near my house, should I just write the code to 
calculate the distance and report error, or I need to have the code that generates the routes as 
well?

Clarifications for Assignment 2

photo
From: Jichunyang L.  O.P.
Date: Sat 23rd May 2020, 8:19pm
Actions: 
        Login-to-reply

 

For task 3, do we need to consider different patterns? For example, there are 2 patterns for the Fremantle Line, one of 
them is from Perth to Fremantle, and the other one is from Perth to Shenton Park(D Stopping Pattern). 

For this task, we must take the first pattern(from Perth to Fremantle) rather than D Stopping Pattern. 

Therefore, for my script, do we need to exclude inappropriate pattern(s)? Thanks.

Clarifications for Assignment 2

photo
From: David M.
Date: Sat 23rd May 2020, 10:02pm
Actions: 
        Login-to-reply

 

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.

All arrival and departure times can only be got from the stop_times.txt file but you can relate
them to a service to check whether it is avaiable for your required date and time.


 

Clarifications for Assignment 2

photo
From: David M.
Date: Sat 23rd May 2020, 10:08pm
Actions: 
        Login-to-reply

 

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.

Clarifications for Assignment 2

photo
From: Lee dB.
Date: Mon 25th May 2020, 8:59am
Actions: 
        Login-to-reply

 

Regarding the time taken to transfer between platforms and stations. 

The transfers.txt file details the time taken to transfer between some stops within a 
station, but doesn’t seem to contain details on transfer times between stations (for 
example, between Perth and Perth Underground).

Should we use the haversine distance to calculate the transfer time between these stations, 
based on an assumed walking speed? Or would it be reasonable to use a static value taken 
from say, the Transperth trip planning website? I would think that, Given the short 
distance, assuming an “as the crow flies” distance isn’t likely to be much more accurate 
than just assuming a fixed value of say 5 minutes?

Clarifications for Assignment 2

photo
From: Christopher M.
Date: Mon 25th May 2020, 1:46pm
Actions: 
        Login-to-reply

 

"Lee de Byl" <10*0*8*[email protected]*u*e*t*u*a*e*u*a*> wrote:

> Should we use the haversine distance to calculate the transfer time between these stations, 
> based on an assumed walking speed? Or would it be reasonable to use a static value taken 
> from say, the Transperth trip planning website? I would think that, Given the short 
> distance, assuming an “as the crow flies” distance isn’t likely to be much more accurate 
> than just assuming a fixed value of say 5 minutes?

Getting down to finer details now!
Either a fixed walking time, or calculation the Haversine distance will be fine.

Remember, you're being assessed on your approach to the problem and the choice of commands, not obtaining 
the precise answer.

Clarifications for Assignment 2

photo
From: Lee dB.
Date: Mon 25th May 2020, 1:56pm
Actions: 
        Login-to-reply

 

Hmmm, I'm not convinced there's anything particularly elegant about my approach, design, or implementation, but having 
an idea of what we are expected to potentially build in might lead to some code refactoring...

Clarifications for Assignment 2

photo
From: Christopher M.
Date: Mon 25th May 2020, 2:55pm
Actions: 
        Login-to-reply

 

"Lee de Byl" <10*0*8*[email protected]*u*e*t*u*a*e*u*a*> wrote:

> Hmmm, I'm not convinced there's anything particularly elegant about my approach, design, or implementation, but having 
> an idea of what we are expected to potentially build in might lead to some code refactoring...


I'm a bit confused by your comment; most of the (too many) students first sending their comments to me appear to be making 
reasonable assumptions.

A trip will be invalid if:
  - there is no train station with 1km/20mins walk of your starting position
  - you cannot reach Fremantle Station by 15:30 (less 5 minutes to walk to the ferry)

Otherwise a trip will include:
  - an initial walk, and a single train ride to Fremantle, walk to ferry
  - an initial walk, a train to Perth Station, a train to Fremantle, walk to ferry
  - and initial walk, a train to Perth Underground, a walk to Perth Station, a train to Fremantle, walk to ferry

I believe that that covers all cases (unless you start at a train station?)

Does that cover what you feel you need/want to build?

Clarifications for Assignment 2

photo
From: Lee dB.
Date: Mon 25th May 2020, 7:08pm
Actions: 
        Login-to-reply

 

"Christopher McDonald" <ch*i*.*c*o*a*[email protected]*a*e*u*a*> wrote:

> "Lee de Byl" <10*0*8*[email protected]*u*e*t*u*a*e*u*a*> wrote:
> 
> > Hmmm, I'm not convinced there's anything particularly elegant about my approach, design, or implementation, but having 
> > an idea of what we are expected to potentially build in might lead to some code refactoring...
> 
> 
> I'm a bit confused by your comment; most of the (too many) students first sending their comments to me appear to be making 
> reasonable assumptions.
> 
> A trip will be invalid if:
>   - there is no train station with 1km/20mins walk of your starting position
>   - you cannot reach Fremantle Station by 15:30 (less 5 minutes to walk to the ferry)
> 
> Otherwise a trip will include:
>   - an initial walk, and a single train ride to Fremantle, walk to ferry
>   - an initial walk, a train to Perth Station, a train to Fremantle, walk to ferry
>   - and initial walk, a train to Perth Underground, a walk to Perth Station, a train to Fremantle, walk to ferry
> 
> I believe that that covers all cases (unless you start at a train station?)
> 
> Does that cover what you feel you need/want to build?

Hi Chris,

It certainly does, and I think the functional requirements are very clear. Sorry if there's been an excess of questions. What I'm 
finding challenging though is implementing it cleanly -- it feels like it's easy for small, incremental changes in functionality to 
quickly devolve into spaghetti code, which is why (from my perspective) I thought it might be better to clarify any requirements prior 
to implementation :) 

Clarifications for Assignment 2

photo
From: Christopher M.
Date: Tue 26th May 2020, 7:36am
Actions: 
        Login-to-reply

 

"Lee de Byl" <10*0*8*[email protected]*u*e*t*u*a*e*u*a*> wrote:

> It certainly does, and I think the functional requirements are very clear. Sorry if there's been an excess of questions. What I'm 
> finding challenging though is implementing it cleanly -- it feels like it's easy for small, incremental changes in functionality to 
> quickly devolve into spaghetti code, which is why (from my perspective) I thought it might be better to clarify any requirements prior 
> to implementation :)

You'll always find it challenging if you're coming from programming in language(s) with more features than bash, such as enforced types, nested 
functions and scope, etc.

I've found it "enough" to just write many smaller functions, with fantastically-chosen verbs for names, and just have the main part of the script 
call them.

Clarifications for Assignment 2

photo
From: Lee dB.
Date: Tue 26th May 2020, 8:55am
Actions: 
        Login-to-reply

 

Thanks Chris -- that's very helpful and I feel like I'm on the right track! It seems like there's a bit to learn in terms of writing idiomatic shell scripts.

Clarifications for Assignment 2

photo
From: Jichunyang L.  O.P.
Date: Tue 26th May 2020, 10:17am
Actions: 
        Login-to-reply

 

"Christopher McDonald" <ch*i*.*c*o*a*[email protected]*a*e*u*a*> wrote:

> "Jichunyang Li" <22*7*0*[email protected]*u*e*t*u*a*e*u*a*> wrote:
> 
> > Hi Chris,
> >   For task 3 in assignment 2, the current requirement is to print out my starting "location". So what is my starting 
> > "location"? Does it mean that print out latitude and longitude of my current location? Thanks.
> 
> Yes, your starting lat/lon (or any other starting point), that you manually provide to your script.
Hi, Chris,

For my script, there are some issues that need to be clarified.

Task 1:
When I run ./updateversion $project name (for this task, the project name is calmarks), all files' version number and date 
can be updated (including Makefile), meanwhile, the script can detect different date or version number, and report that 
"xxx is another version. Is the script correct?

Taks 2:
1) In order to improve the performance (and reduce the time), I just used 100 lines of data, is it suitable?
2) Could I need to submit the HTML files?


Task 3:
1) Could I assume that the maker will have the file "haversine.c" in their working directory?
2) TransPerth operates 3 timetables for all lines (Monday to Friday, Saturday, and Sunday and public holiday). Do I need 
to use different timetables for different dates in my script?

Many thanks.

Clarifications for Assignment 2

photo
From: Christopher M.
Date: Tue 26th May 2020, 5:44pm
Actions: 
        Login-to-reply

 

"Jichunyang Li" <22*7*0*[email protected]*u*e*t*u*a*e*u*a*> wrote:

> When I run ./updateversion $project name (for this task, the project name is calmarks), all files' version number and date 
> can be updated (including Makefile), meanwhile, the script can detect different date or version number, and report that 
> "xxx is another version. Is the script correct?

I cannot tell if your script is correct,  but your description of its actions meets the requirements.


> Taks 2:
> 1) In order to improve the performance (and reduce the time), I just used 100 lines of data, is it suitable?
> 2) Could I need to submit the HTML files?

You do not need to submit any data files or HTML (results) files.
Your script will be run using some test data,  a submit of the large data file you've been using.

> Task 3:
> 1) Could I assume that the maker will have the file "haversine.c" in their working directory?

Yes. They'll come prepared.

> 2) TransPerth operates 3 timetables for all lines (Monday to Friday, Saturday, and Sunday and public holiday). Do I need 
> to use different timetables for different dates in my script?

Has been asked elsewhere;  it's reasonable to just have it work for weekdays, Mon-Fri.

Clarifications for Assignment 2

photo
From: Jichunyang L.  O.P.
Date: Tue 26th May 2020, 11:26pm
Actions: 
        Login-to-reply

 

"Christopher McDonald" <ch*i*.*c*o*a*[email protected]*a*e*u*a*> wrote:

> "Jichunyang Li" <22*7*0*[email protected]*u*e*t*u*a*e*u*a*> wrote:
> 
> > When I run ./updateversion $project name (for this task, the project name is calmarks), all files' version number and date 
> > can be updated (including Makefile), meanwhile, the script can detect different date or version number, and report that 
> > "xxx is another version. Is the script correct?
> 
> I cannot tell if your script is correct,  but your description of its actions meets the requirements.
> 
> 
> > Taks 2:
> > 1) In order to improve the performance (and reduce the time), I just used 100 lines of data, is it suitable?
> > 2) Could I need to submit the HTML files?
> 
> You do not need to submit any data files or HTML (results) files.
> Your script will be run using some test data,  a submit of the large data file you've been using.
> 
> > Task 3:
> > 1) Could I assume that the maker will have the file "haversine.c" in their working directory?
> 
> Yes. They'll come prepared.
> 
> > 2) TransPerth operates 3 timetables for all lines (Monday to Friday, Saturday, and Sunday and public holiday). Do I need 
> > to use different timetables for different dates in my script?
> 
> Has been asked elsewhere;  it's reasonable to just have it work for weekdays, Mon-Fri.
Hi Chris,
  For task3, I run my script on a Surface (too old version, maybe Surface 4), the process about 4 mins, is the processing time 
acceptable? Thanks.

Clarifications for Assignment 2

photo
From: Christopher M.
Date: Wed 27th May 2020, 3:15pm
Actions: 
        Login-to-reply

 

"Jichunyang Li" <22*7*0*[email protected]*u*e*t*u*a*e*u*a*> wrote:

>   For task3, I run my script on a Surface (too old version, maybe Surface 4), the process about 4 mins, is the processing time 
> acceptable? Thanks.

It does sound slower than anticipated, though the getting it to be super-fast is not a requirement.

You may be able to find places where you are invoking some 'expensives' processes like AWK,
several thousand times, just to have it perform a single calculation.

Often it's possible to change the structure, or order of execution of things - for example,
if calling AWK many times, just to process one 'thing', can you pre-calculate all
of those 'things',  place them in a temporary file, and have AWK then process the whole contents of that file?

Clarifications for Assignment 2

photo
From: David M.
Date: Wed 27th May 2020, 4:01pm
Actions: 
        Login-to-reply

 

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.

> time ./trains_to_the_rottnest_ferry -31.7184 115.7469 20200525 13:50:00 >/dev/null
>
> real    0m4.799s
> user    0m4.747s
> sys     0m0.050s

There is a definite lower limit on execution time based on how long it takes just to scan
through all the data files.

Clarifications for Assignment 2

photo
From: Jichunyang L.  O.P.
Date: Wed 27th May 2020, 11:19pm
Actions: 
        Login-to-reply

 

"David May" <17*1*2*[email protected]*u*e*t*u*a*e*u*a*> wrote:

> 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.
> 
> > time ./trains_to_the_rottnest_ferry -31.7184 115.7469 20200525 13:50:00 >/dev/null
> >
> > real    0m4.799s
> > user    0m4.747s
> > sys     0m0.050s
> 
> There is a definite lower limit on execution time based on how long it takes just to scan
> through all the data files.
Hi David,
  I run task3 on another laptop (Linux system), the processing time is less than 1 min. I 
guess the problem releases to a laptop itself and operation system rather than my script.

Clarifications for Assignment 2

photo
From: Christopher M.
Date: Thu 28th May 2020, 9:43am
Actions: 
        Login-to-reply

 

"David May" <17*1*2*[email protected]*u*e*t*u*a*e*u*a*> wrote:

> There is a definite lower limit on execution time based on how long it takes just to scan
> through all the data files.

Thanks David, impressive results.

You (everyone) will also note that the first execution of your script will be a bit slower than 
subsequent executions, as the files are transferred from disk, and copies of them retained in faster 
cache memory.

Using an SSD-based disk will also be a bit faster than for a magnetic HDD, though the benefits of 
the disk cache (as a percentage) will be lower.

Clarifications for Assignment 2

photo
From: David M.
Date: Thu 28th May 2020, 10:36am
Actions: 
        Login-to-reply

 

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. Then I realised the 
ramdisk was effectively just repeating the work of the
block cache!
This Page


Program written by: [email protected]
Feedback welcome
Last modified: 11:27am Sep 21 2020