Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Loop or Parse Tree of Requirments
I have a question on stepping through a loop or a tree
of requirements. Currently I have 3 lists built that I
need to get info from:
# list built from a DB
# every minute of that particular day
This next part is where I need some help because it gets
a little tricky.
I have to check each element of the "scriptsThatShouldRun"
list against the "minutesList" list and break down each
bit of info to compare in that list: day of week, month,
day of month, hour and minute.
If the minutesList shows: Mon Aug 31 00:00, then I need to
see if the scriptsThatShouldRun matches this exactly so I
check: the day of week, month, date, hour and minute
If it does MATCH, then I will then compare against the list
scriptsThatDidRun and look if it has the same value, if it
does append to a success list or if its not in there append
to a failure list.
If it does NOT MATCH, then I ignore it and move onto the next
element of the list because that item "scriptsThatShouldRun"
is NOT eligible to run @ that time of day, so nothing should
In basic words:
The whole point is to check the scriptsThatShouldRun list
against the scriptsThatDidRun all the while looping through
the minutesList list (every minute of the day). The basic
meaning of this is to go minute by minute and check if a
a script is eligible to run, if it is, compare and see if
it really did run and report on that.
Basically, if the time in minutesList matches the time in
scriptsThatShouldRun, I need to check the scriptsThatDidRun
and append to success or failure.
I hope this all makes sense? Any code examples or pointers
you may have would be very helpful.
Thanks in advance!
0 · ·