Task Management Script (1 database of tasks all users must complete indipendantly)? - taskmanager

Explanation: I currently have a database of thousands of tasks and a few hundred people that can see these tasks. Each user has their own login but all see the same list of tasks and all have to complete all of these tasks.
My Problem: I want each user to be able to mark each task complete as completed within their account without marking it complete for all other users.
What I currently have: 1 table of tasks and descriptions, 1 table of users, 1 table of discussion on each task. Users can login and see all of the tasks but cannot mark them complete.
I'm not sure if I am explaining this well enough but I am just looking for any insight as to the best way to get started with this as I kind of hit a brick wall and need people smarter than me to give their insights :)
Thank you all in advance for your comments.

You need one more table that holds the relation between the users and the task.
Everytime a user completes a task you make an entry into that table:
idx task_id user_id
1 1 3
2 4 3
3 1 5 ...
That way you can query for users who have completed a task, or the tasks completed by a user, the tasks that have not been completed by a user, etc...

Related

How can I interrogate user activity in Laravel

I'm looking for a way to best analyse the user data in our app.
for example
how many users have read 0 articles on our site
how many users have read 1 article on our site etc
we have a users table with id, username columns and we also have an activities table that creates an entry when an article is viewed. For example it would create a database row with
id
activity
user_id
1
read
1
all of the data we need is there, I just don't know how to interrogate to give that detail.
I personally would use an int code for activity and not a string. So "read" would = 1, "edit"=2...etc If you have no care about what user read with no association, that becomes easy by just setting a flag on the article that was read by article id. So your article table would have:
id article_id activity user_id
1 5 1 8675309
From there just do an eloquent query on article_id where activity = 1...
$articlecount = Article::where('article_id', $request->id)->where('activity', 1)->count();
$articlecount will give you all of the reads for that article.
If you need it based on user you could do a one to many relationship from your users models to articles models. Then query the user with(articles). That will bring back all the articles where that user has activity. You could also specify in your eloquent to only bring back activity of reads/edits..etc too. In the same respect you could do the reverse and query the article and see all the users that have read that same article.

SQL - trying to get what doesn't exist

Two related tables -- tasks and activities. For every active task, there should be one related Open activity. Trying to find tasks with no Open activities. FYI, activity status includes Open, Completed, and Cancelled. Task status is Active and Inactive.
Relative newbie to SQL world, though have the basic principles.
Thought something along the lines of SELECT * from Tasks WHERE Status = Active AND the count of related Activities with Status of Open = 0, but I'm not sure how to translate that into SQL.
Have read a few posts here and elsewhere regarding temp tables and outer joins, but I couldn't work it out -- believe was for an audience slightly more advanced than me.
Any help would be much appreciated!
Trying to find tasks with no Open activities.
Use not exists:
select t.*
from tasks t
where not exists (select 1
from activities a
where a.task_id = t.task_id and
a.status = 'open'
);

Splunk Failed Login Report

I am relatively new to Splunk and I am trying to create a reportthat will display a hostname and the amount of times that host failed to login within the past five minutes, when they failed 3 or more times. The only way I was able to get the initial search results I want is to look only within the past 5 minutes, as you can see in my query:
index="wineventlog" EventCode=4625 earliest=-5min | stats count by host,_time | stats count by host | search count > 2
This returns the host and the count. The issue is if I use this query in my report, it can run every five minutes, but the hosts that were listed previously get removed as they no longer are included in the search results.
I found ways to generate logs that I can then search for separately (http://docs.splunk.com/Documentation/Splunk/6.6.2/Alert/LogEvents) but it didn't work the way I expected.
I am looking for an answer to any of these questions that can help me get the intended results:
Can my original search be improved to still only get results where the failed logins were within 5 minutes but be able to search over any time period?
Is there a way to send the results from the query I already have to a report, where the results will not be cleared out when the search is run again?
Is there any other option I haven't considered to achieve the desired result?
If you only care about the last 5 minutes then search only the last 5 minutes. Searching more is just wasting resources.
Consider writing your results to a summary index (using collect) with a scheduled search and have your report/dashboard display values from the summary index.

Using Linq to bind dependent SQL rows

enter image description here
I'm trying to find an efficient way to select all dependencies. The idea behind this table is:
Each taskID is a task that will be display to the user.
When taskid 22180 is selected by the user and completed it will
automatically enable the other tasks (activateTaskId = 22180) to
become available to the user hence inactive = 0. Up to that point
everything is fine.
What i need help at is when you have subsequent tasks.
So when taskid (22180) is selected and completed by the user the following tasks become available (22181,22182,22185 and 22186). As you can see if the user selects 22182 then the task dependent on it is 22183 and subsequently 22184 will .
how would i efficiently select all the task that branch off the initial one (22182) no matter how many may exist ?
Thank you

running two scenario at same time with loadrunner

Can we run two scenarios at same time with loadrunner?
E.g. Suppose there are 50 user and I have to generate script such that 25 user accessing login and order modules and other 25 user just browsing the site.
Is it possible to generate such scenario?
Running multiple scenarios at the same time (assuming standalone controller) is not possible on THE SAME controller at THE SAME time.
From your description of the problem I assume you are looking for multiple scripts (groups) running in the same scenario - if so then the answer is YES.
In the controller you add more Groups (scripts are called groups in controller) and define the number of vusers or % of total vusers (depending on scenario type & controller version) for the group. I have not seen any limit on the number of groups/scenario. I've never needed more than 15 groups in a single scenario thou ..
Rohit,
I have a direct question for you, are you using an evaluation license?
Generally you would just use a 50 user license with two groups of 25 users apiece. The only time I get this question for the past 15 years is when someone is trying to combine result sets for two 25 user evaluation license copies of a LoadRunner controller.
Rohit, you can create two seperate scripts - one for your login & other for browse site transactions. In controller scenario , you can select select by Group and add these two scripts in your groups and assign 25 vusers each to both.