Count how many times one post has been read - parse-platform

Is it possible to show how many times one post has been read? In WordPress there is a plug-in,https://wordpress.org/plugins/wp-postviews/
I don't know whether there is such a plug-in in Anypic of Parse to count the times?
Of course it will be nice if it can display who has read a post as well.
Thanks

I'm not sure which language you working on.
But anyway you need to create:
Array column in Parse.com
And then just make query to add his name when viewWillAppear
Now you can count the array to get integer number for views and you can display their names from the array.

Two options are;
Add a viewcount column and increment it whenever needed.
Add an actions table which consist all actions within your webpage or app. This way you can store more data(custom analytics) in it like button pressing etc.. When you want to check the viewcount you can just count objects with specific type. For iOS SDK countObjectsInBackgroundWithBlock does this job.

Related

(Google Sheets) How to remove certain dropdown options after a certain number of cells with said option is met?

I'm currently working on a google sheets file to organize the members of my class. I am currently assigning committees and I want them to choose their committee in Google Sheets. However, I want to apply only a certain limit per committee.
What I want to happen is, if a certain choice has been chosen i.e. 5 times, I would like that choice to disappear from the choices and would make it reappear again if ever a students change their choice, however, I do not know how to do this in terms of a formula or through data validation.
I would really appreciate your help. Thank you!
Here's a toy example you may be able to adapt to your needs:
Create a list of options a,b,c,d,e in A1:E1 of Sheet1
Create a list of the limits for each option in A2:E2 (for instance 2,1,3,5,3)
Create a list of people Person1,Person2,Person3 in G2:G4
Apply data validation to H2:H4:
Use criteria 'drop down (from a range)'
Set the data range to =Sheet1!$A3:$E3 (only lock columns, not rows)
In A3 enter the following formula:
=lambda(people,choices,list,limits,
makearray(counta(people),counta(list),lambda(r,c,
if(index(choices,r)<>index(list,,c),if(countif(choices,index(list,,c))<index(limits,,c),index(list,,c),),index(list,,c)))))(
$G$2:$G$4,$H$2:$H$4,$A$1:$E$1,$A$2:$E$2)
We are using MAKEARRAY to create a 2D array with the list of options on each line, however we are asking it to omit elements of the list from each line if they haven't already been selected AND a preset limit on the number of selections for that option has not been reached. Obviously in a 'real' example you would place the data range for validation in a separate sheet and probably hide and protect that sheet as well. You could also potentially use an array literal of strings rather than a cell range as the list of options in order to make the validation list formula completely self-contained.

How to correctly structure a DynamoDB table for sorting results with no hash key condition?

I am new to DynamoDB so I'm still trying to understand how to use it, but I have what I believe is a simple task but I'm not sure how to address it.
I need to create a table to store categorized questions in which I need to store a click counter. So let's say something like this:
ID: 1
Question: What is this?
Category: General
Clicks: 100
Now, the problem is I need an optimized way to get the most general clicked questions and the most clicked questions by category, let's say a top 10.
In a classic SQL style it would be something like this:
SELECT ID, Question
FROM Questions
ORDER BY Clicks DESC
LIMIT 10
Can anyone point me in the right direction on how to structure the table? I tried the sorting but it always requires a hash key condition, so I don't understand how I can get this done as I need the top 10 results and not a single one.
Thanks in advance!
How are you accumulating the clicks, if you are able to figure out how you accumulate the clicksstream onto the table correctly that will be your answer.
You will need to implement a mechanism that maps incoming clicks to the item record being clicked on and increment it using an atomic counter. With this you will be able to then create a sparse index and sort it in descending order to get what you need.

Grafana Templating

I am wondering if there is a way to limit the number of rows generated from grafana templating.
I can have a drop down variable "$x"on my grafana page and I can select the row editor and say repeat row for every value under $x.
Based on different criteria, I can have x anywhere between 1 and like 160 rows. I need to only be looking at about 10 at a time. I am wondering if I can control the number of rows shown/change the rows shown somewhere in grafana.
I can manually select items from the $x drop down to show only a few items of course, but its a matter of selecting only say.. 10 items right when the page loads.
Please let me know if I am not describing the problem correctly or if I need to clarify more.
Thanks,
Karan
As far as I know there is no direct option for this but there are some ways you may be able to achieve what you want.
You could select your ~10 default entries and then save the dashboard this will save the selected ones in the dashboards JSON. (or modify the JSON of the dashboard directly)
You could use the regex field in the template settings to filter some of your values and split them in groups this way. (one variable per regex group)
You could change your data in elasticsearch in order to use multiple fields where you can split on.
see PR #5616 as #Daniel Lee mentioned
In general I think you get a faster response to this in grafana directly at github.

Identify if objects are the same

I want to check certain objects against each other and identify if they are the same.
For example, I need to verify that the total cost in one page is the same as another page. I developed a script that works, however the total cost changes every day so I have to update the object properties in maintenance mode every day.
Is there a way that UFT automatically recognizes this object must change and update?
I request you to elaborate your question. For now, you can use .* if certain values of the object are changing. Alternatively, you can store the values in an excel sheet and you can change everyday depending on the requirement.
If this is not helpful let me know
It sounds like you actually want to compare the values shown in two different objects, and see if those values are the same. (I assume this because you say they are on two different pages)
Also, you mention maintenance mode, so I assume you are using checkpoints to store their expected values.
I would suggest: instead of storing the expected values in a checkpoint, you could read the value of the first object (getROproperty), store it in a variable (dataTable field, environment variable, etc), and then navigate to the other page, read the ROproperty from the other object, and then compare.
i.e.
if {browser,page,object...}.getROproperty({whateverPropertyYouNeed}) = environment({storedFirstValue}) then
reporter.reportevent micPass,"compare step","{details here}"
end if
*replace stuff inside {} with your code, I don't know what it is
If you need to actually store the total cost externally, you could use a DataTable field and export the sheets at the end. then import the same sheet at the beginning. That would save the data to an excel sheet on a drive.

Crystal: Sort by multiple groups

Good afternoon all;
Currently I have a crystal report that displays as such;
{ReceivingHospital}
{CallTtype} {Date} {SendingHospital} {Time1} {Time2}
I would like it to break down by receiving hospital then beneath that show all "Major" call types and sum them. Then Beneath that all "Moderate" call types with a sum, and then all "Minor" call types beneath that with a sum also. And, I want to keep all the associated details listed in that same order. I was thinking I could add multiple group headers and place the call type in that, but that does not seem to be working.
Any ideas would be greatly appreciated.
first, you need to create a group for {ReceivingHospital} and then a second group for {CallType}. You can then create a group sum based on {CallType}. If it still does not work and you are working with multiple tables you should check whether you have joined your tables correctly.

Resources