Recommendation for more than one last viewed item - test-and-target

Currently I have a Recommendation block (Recommendation logic- items with similar attribute) at home page. Here the entire block get tuned and limit the suggestions only to the last viewed item. I wanted to increase the recommendation (incoming feeds) for atleast last 2 or 3 viewed items.
**For example-**Currently If user visits items Z > Y > X then the recommendation blocks gets filled with items which has similar attribute only to item "X" (leaving last to last viewed). I would like to explore the possibility of recommendation block having track of items Z, Y and X.

You would have to push multiple entity.IDs within your targetPageParams() function so the algorithm can generate based off of that.
Here's an example snippet I made whereby I'm excluding items (in a JSON format) already viewed:
<script type="text/javascript">
targetPageParams = function()
{
return { "excludedIds": [] }
}
</script>

Related

InLinks and OutLinks not displaying when level is changed in IBM Doors

Hi Everyone hope all are good in this COVID time
So In a standard, all levels view i am able to view the links but when i change the view to level1 the links are not displayed.How can i display it any idea,why i need is i dont need to much data as in all level just enough as in level 1 view.
Thanks in advance
It is clear that the links are not shown: after all, Object 644 "ABCD" is not linked to any other object and changing the view to level 1 does exactly this: it shows only objects of Level 1 and nothing else, there is no cumulation.
The solution for your problem depends on what you want to do concretely.
If your goal is to count the links in the chapter, you could probably write a Layout DXL column like this
void recursiveCountOutLinks(Object o, int &iCount) {
// first count the links going out of Object o
Link l
for l in o->"*" do iCount++
// next, add all Links on lower levels
Object oChild
for oChild in o do {
if isDeleted(oChild) then continue
recursiveCountOutLinks (oChild, iCount)
}
}
int iTotal = 0
if (level obj == 1) {
recursiveCountOutLinks(obj, iTotal)
display iTotal ""
}
If your goal is to export these links you will have to adopt your exporter by doing this recursively as shown above.

Search results have a couple of more "nextPageToken", but no more items

I call YT.Search API and then iterate over the results. Page by Page.
At some point, there are still more pages to iterate, but the "items" array is empty.
I had to add a condition to break the iteration loop.
if (searchResults.items.length == 0 || !('nextPageToken' in searchResults)) {
Is that a known issue?
I saw this post but I recall it wasn't like that a few weeks ago.
I used to call the YT search and get ~2000 results per keyword.

ios- thread 1 exc_bad_instruction error in app

I am writing an app to simulate the nba lottery. I have already written the codes to generate the random combinations, and assigned them to each team.
Here is my method to simulate the drawings and assign the draft positions to each team. standingsArray is an array of Team items of type ObjectWrapper, with values of name, seed, wins, losses, draft position exc... for each team. So basically what Im doing is I have 14 balls and randomly choose 4 balls, which constitute a combination (order doesn't matter). So essentially there are a total of 1001 total possible combinations, but one is thrown out. (you can ignore the first while loop because that is just there so that the thrown out combination isnt selected). A number of combinations is assigned to the 14 lottery teams based on record (250 for worst team, 199 for second worst exc...). The argument in my method standingsArray already has the number of possibilities assigned to each team. Next, I randomly pull 4 balls from the total possibilities, and the team with that combination gets the first pick. But because all the combinations for that team selected cant be chosen again for the second pick, I have to remove all of those combinations, but that is very complicated so instead, i make a new array called tempPossibilities which appends all the combinations for every team except the one just selected, which then allows me to generate a new combination to select from.
However, I am getting an error at this line for j in 0...(standingsArray[i].possibilities?.count)!-1{ It says bad instruction error, and I cannot figure out why I am getting this error. And what else doesnt make sense is that the for loop works and the tempPossibilities array is fully populated with the correct amount of combinations (without the lottery team), even though the error happens at the for loop?
Code is below: any help is appreciated, thank you, and sorry for the really long paragraph
func setDraftPositions(var standingsArray: [Team])->[Team]{
var lottery: [Team]=[]
var totalPossibilities: [[Int]]=combosOfLength(14, m: 4)
var tempPossibilities = []
var rand = Int(arc4random_uniform(UInt32(totalPossibilities.count)))
var draw = totalPossibilities[rand]
while (draw==(unused?.first)!) {
rand = Int(arc4random_uniform(UInt32(totalPossibilities.count)))
draw = totalPossibilities[rand]
}
s: for x in 0...13{
for a in 0...(standingsArray[x].possibilities?.count)!-1{
if(draw==standingsArray[x].possibilities![a]){
standingsArray[x].setDraftingPosition(1)
standingsArray[x].isLottery=true;
lottery.append(standingsArray[x])
for i in 0...(standingsArray.count-1) {
if(standingsArray[i].firstName != standingsArray[x].firstName!) {
for j in 0... (standingsArray[i].possibilities?.count)!-1{ //ERROR is happening here
tempPossibilities.append(standingsArray[i].possibilities![j])
}
}
}
standingsArray.removeAtIndex(x)
break s;
}
}
}
(repeat this for the next 2 picks)
Try this:
for j in 0...(standingsArray[i].possibilities?.count)!-1{
should be written like this:
for j in 0...(standingsArray[i].possibilities?.count)! - 1{
it needs proper spacing.

SSRS: Adding a filter that returns information from entire group

I am trying to create a report in SSRS. Below is a small example of what my dataset looks like.
Example Data Set
So, there are three different stores (A,B,C) and each has a landlord (a,b,c). Landlords can pay via three different methods (1,2,3) and the amounts paid per method are shown.
Right now, I have two filters set up. The first is by Store and the second is by Landlord.
What I am having trouble with is:
How can I set up a filter by the Amount that will return information from an entire Store/Landlord?
So for example, if I wanted to filter Amount by 150, I would like to return all the "payment" information for the store(s) that have a payment of 150. Such as the following:
Desired Result
Is it possible to add a filter to return information from the entire group? (Store and Landlord are the group in this case)
I am new to SSRS so any help/insight would be greatly appreciated!
You can use LookUpSet to locate the matching groups, JOIN to put the results in a string and the INSTR function to filter your results.
=IIF(ISNOTHING(Parameters!AMOUNT.Value) OR INSTR(
Join(LOOKUPSET(Fields!Amount.Value, Fields!Amount.Value, Fields!Store.Value, "DataSet1"), ", ") ,
Fields!Store.Value
) > 0, 1, 0)
This translates to:
If the Store value is found (INSTR > 0) in the list (JOIN) of Stores where the Amount is the current Amount (Lookupset).
In your filter, put the above expression in the Expression, change the type to INTEGER and the Value to 1.
[

Repeated objects in Kaminari

I have an array of objects in my controller, paginated by Kaminari:
#pics = Pic.page(params[:page]).per(12).order(sort_column)
I render each new set of 12 pics on the same page with an AJAX request, for a manual infinite scroll effect. The sort_column bit sorts the pics according to most_viewed attribute within the object.
My problem - sometimes, when there are a number of pics with the same most_viewed attribute, - i.e. there are 10 images with "20" as their most_viewed value - I will get repeated objects when the new set of 12 is revealed with the AJAX request.
Here's an example of what I mean... I've clicked the "load more" (i've left it in to demonstrate), and there are objects repeated when the new batch loads.
Any help would be much appreciated. Thanks in advance.
You have to order on count AND another column (id would be the best), in this way SQL will returns a list that will not change (because right now SQL does not know what to do if X records have the same count).
You can change .order(sort_column) to .order("#{sort_column} ASC, id ASC"), and it should work.

Resources