Maintaining a Relative Order of Flex Tasks in a SQL DB - ios

I have a task scheduling app that allows people to create 2 types of tasks...
•Strict- tasks with a set start time and duration
•Flex- tasks that have a duration, but no specific start time
Its also important to understand how flex tasks operate- Flex tasks will continuously reschedule themselves throughout your day in the nearest time you have open...so for example if the only task on your schedule today is a flex task like "Go workout - duration:60mins" and you open the app at 4pm it will have "Go workout" scheduled from 4-5pm for you , if you dont click the checkbox indicating you completed the task and open the app again at 5PM "Go workout will be rescheduled to 5-6pm so that the stuff you are meaning to get done is constantly in your face and trying to fit itself into the gaps of your life.
When a user views their schedule here are the steps I go through:
•Grab a array of all strict tasks
•Grab a array of all flex tasks
•Loop through each strict task and figure out how big of a time gap there is between the task currently being looped's end time and the next tasks start time.
•if a gap exists loop through the flex tasks and see if any of them will fit in the time gap in question. if a flex task is small enough to fit in the time gap add it to the strictTasksArray between the task being currently looped and the next task.
This works great as long as there is no need for any kind of ordering when it comes to flex tasks, but now we have added the ability for users to drag and drop flex tasks into a specific relative order aka if I have Task A,B,C,D
and I drag Task D & B to the front so that its now D,B,A,C it needs to save that ordering so that if you close and reopen the app the app will still remember to try to fit task D in , followed by B, A & C .....but im having big trouble thinking of a efficient way to do considering the ordering is relative and not strict...any ideas how to save relative ordering in a SQLIte DB without having to update every tasks's DB record every time a user drag/drops a task and changes the relative ordering?

If you have ever coded in Basic, you might remember numbering code lines. It was advisable to number in increments of 10 so that if later on you would have to insert a line or two you won't have to re-number all the code, just assign a new number in-between those of the previous and the next lines.
So, in your situation I would create a numeric field for Rank and for each new Flex task assign Rank = max(Rank) + 1024 (for example). Afterwards if the tasks are rearranged I would update just one "moved" task's Rank with the average Rank of it's new previous and next neighbours. That way any Rank change would be an update for one row only. Of cause if the Rank is int and I run out of integers in-between two tasks I would have to update them all, but that should be a rear occasion and I would just re-Rank them in new increments of 1024.

Sounds like you'd need some sort of either priority or order_number column to set the order in which the tasks come in. Just make it an int, and weight them accordingly. If you needed the DBMS to keep them in order using a query, you'd have to use sorting:
SELECT task_id, task_group_id, task_name, completed, priority
FROM tasks WHERE user = ? and task_group_id = ? and completed = 0 ORDER BY priority ASC
you can use some sort of foreign key to a task_group table to actually group certain tasks together if they're multipart, and then build a query to find all the ones that are either complete or incomplete. The weightage assigned would still be correct, because the tasks don't refer to each other by ID.

Related

Formula to make dropdown menu choice follow specific text?

I made a task tracker which takes my tasks from the main group Google Spreadsheet and arranges them in order in my tracker spreadsheet by date. I also included a dropdown list to mark the status of each task.
It's all working the way I hoped it would except for the status option - the data from the group spreadsheet changes frequently (tasks are removed and added) and when this happens, the list in my spreadsheet gets automatically updated and get shifted around based on the new tasks and dates, but the status column remains static.
For example, say I finish the first task on my spreadsheet so I mark the task on the first row of my tracker spreadsheet "done". Our group admin sees my work is finished and deletes said task from the group spreadsheet, so my tracker spreadsheet automatically gets updated and the first task is also removed from my spreadsheet.
However, the next task gets bumped to the top row of my spreadsheet, which is still marked "done" - I was hoping the status would get deleted as well or the dropdown menu is reverted to its blank initial state.
Is there a way to make the dropdown option register/remember which data or text were in its row (when it was chosen) and follow it when the tasks and schedules get updated? I was thinking the trigger could be when a cell in the status column gets filled in (by way of choosing an option from the dropdown menu), it remembers the data from the four cells to its left, then tracks it even when the list of tasks get shifted around.
I've tried to put together an update to your sheet that may do what you want. Look at my sample sheet. Since several small changes were needed on different tabs, I didn't want to affect your sample.
The key point is having a unique identifier for each task. Lots of ways of doing this. I added the sheet name, eg tasks1, or tasks2 to the Task#. This would need to be done in the sheets that you pull your tasks from, eg. tasks1, tasks2, and tasks3.
The Tracker tab lists all of your tasks, pulled from those sheets. I've added a hidden column (E) for the Task ID, but it doesn't have to be hidden. And possibly you don't need to show the Task#, if it is obvious from the Task ID value.
To enter status updates, you must only do that on the UpdateStatus tab. Here you will need to maintain a list of task IDs in some way. New Task IDs could be added to this list manually, when you get assigned a new task. Or a macro/script could be used to add new Task IDs.
You could even pre-define all possible task IDs for your company, and, using filtering, only show the ones for which you have an assigned task.
See tab UpdateStatus#2 for an example of this. This would depend on a good naming convention for your TaskID values.
Let me know if this makes sense to you or not, or if you have any questions. The only necessary formulas are a few VLOOKUPs to pull data from other locations, based solely on the Task ID value for that row. Formula cells are hightlighted in yellow.

How to get power charts and reports for tfs

I want to get some different reports and charts from Tfs activities and history (most based on task tags and assigned users). for example after 3 monthes I want to know how many hours a user moved her tasks to next iteration, ...
Is there any tools for this?
No such a tool can exactly achieve that. There is an extension Team Capacity Management, but seems it's not apply for you.
If you want to know how many hours a user moved her tasks to next iteration, then you need to get the planned hours then subtract the completed hours in current iteration. Alternatively you can add tags on the work items which moved to the next iteration, then create a query which filter by the tags to get the sum of hours.
e.g.:
Create a query 'RemainingWork' with the column Assigned
to and Remaining Work added in "next iteration" (e.g.: iteration
2 here) to filter the moved work items from pervious iteration with the tag.
Save it in Shared queries
Add Chart for Work items widget in your project dashborad, then
configure the widget. Then you can see the hours a user moved tasks
to next iteration in the chart:

Task in daily products generated not in duration

I have a project which contains a task for creation 1000 products in 10 days (daily 100 products).
I have distributed that in 10 employees mean every employee have to create daily 10 products not matter how many hours he spent. I am unable to find how to create that task and monitor accordingly.
You cannot use MS-Project to model this kind of task scheduling behaviour since its resource loading and task scheduling is based on knowing how much work (expressed as time) is needed to complete a task.
You can force MS-Project to have a 10-day duration, irrespective of the resources applied, by setting Work=10d and making the task Fixed Duration (both before adding any resources), but that cannot be used to divide up piece-work amongst resources assigned to that task.

Greedy Algorithm implementation

So I have some questions concerning the solution to the problem of scheduling n activities that may overlap using the least amount of classrooms possible. The solution is below:
Find the smallest number of classrooms to schedule a set of activities S in. To do this efefficiently
move through the activities according to starting and finishing times. Maintain two lists of classrooms: Rooms that are busy at time t and rooms that are free at time t. When t is the starting time
for some activity schedule this activity to a free room and move the room to the busy list.
Similarly, move the room to the free list when the activity stops. Initially start with zero rooms. If
there are no rooms in the free list create a new room.
The algorithm can be implemented by sorting the activities. At each start or finish time we can
schedule the activities and move the rooms between the lists in constant time. The total time is thus
dominated by sorting and is therefore O(n lg n).
My questions are
1) First, how do you move through the activities by both starting and finishing time at the same time?
2) I don't quite understand how it's possible to move the rooms between lists in constant time. If you want to move rooms from the busy list to the free list, don't you have to iterate over all the rooms in the busy list and see which ones have end times that have already passed?
3) Are there any 'state' variables that we need to keep track of while doing this to make it work?
The way the algorithm works, you need to create a list containing an element for each start time and an element for each end time (so 2n elements in total if there are n activities). Sort this list. When an end time and a start time are equal, sort the end time first -- this will cause back-to-back bookings for halls to work.
If you use linked lists for holding the free and booked halls, you can have the elements you created in step 1 hold pointers back to an activity structure, and this structure can hold a pointer to the list element containing the hall that this activity is assigned to. This will be NULL initially, and will take on a value when that hall is used for that activity. Then when that activity ends, its hall can be looked up in constant time by following two pointers from the activity-end element (first to the activity object, and from there to the hall element).
That should be clear from the above description, hopefully.

How to automatically measure\monitor the average of sums of a consecutive samplers in jmeter?

I have the following JMeter test plan.
+Test Plan
+Login Thread Group
HttpRequest1
HttpRequest2
HttpRequest3
Is there a way to automatically view\monitor the average of sums of HttpRequest1 ,2 and 3?
I couln't found a way to do it in "Summary Report" or "Aggregate Report"
Is it possible? or do I have to do it manually?
Do you explicitly mean 'the average of sums' As in the average of the total sum for each request over the duration of the test run? If so, then I'm not aware of any JMeter listeners will show you the sum of elapsed time for a sampler, it's not something typically required. Instead, you could probably get what you need fairly easily from reading the jtl file at the command line.
But perhaps you meant something else, you might find that using a Transaction Controller serves you requirements. This will record and show the total elapsed time for multiple requests. So in your example, you might wrap HTTPRequest1, 2 & 3 in a transaction controller and this would give you the sum of all three requests. Then, the Aggregate and Summary listeners would show you the average for this transaction as a separate line.

Resources