Split the kendo scheduler occurrence - kendo-ui

Created occurrence from Day1 to Day3. Now, I need to split the occurrence like Day1, Day2 and Day3 separately using occurrence CLONE in kendo scheduler.
How to split the events?
var scheduler = $("#scheduler").data("kendoScheduler");
var originalEvent = occurance;
var clone = occurance.clone({
start: new Date("2013/6/4 00:01"), //occurance.start, //new Date("2013/6/4 00:01"),
end: new Date("2013/6/4 20:50"),
title: "sella"
});
scheduler.dataSource.add(clone);
var clone1 = occurance.clone({
start: new Date("2013/6/5 00:01"),
end: new Date("2013/6/5 23:50"),
title: "sella222"
});
scheduler.dataSource.add(clone1);
var clone2 = occurance.clone({
start: new Date("2013/6/7 00:01"),
end: new Date("2013/6/7 23:50"),
title: "sellasfgsg5323"
});
scheduler.dataSource.add(clone2);
//ToDo: remove just the single occurance of the event based on its target and uid
scheduler.dataSource.remove(originalEvent);
originalEvent.update(clone);
originalEvent.update(clone1);
originalEvent.update(clone2);
scheduler.dataSource.sync();
Now, clone , clone1, clone2 is not updating in scheduler grid.

Related

BotFramework - strictFilters to filter QnAMaker results

https://github.com/microsoft/BotBuilder-Samples#qna-maker-samples
Currently, we have a few values in the metadata on questions to answer based on location.
In these examples, there isn't a way to use the strictFilters options to filter out the FAQs from QnAMaker.
How would I edit the QnAMakerCustomDialog.cs I currently have in order to add in the strictFilters? It is currently set to null and I have tried a few different ways to add filters, but they return syntax errors.
In order to filter based on metadata associated with the QnA pair that you applied in the qnamaker.ai portal, you simply need to use the 2nd parameter in QnAMaker.GetAnswersAsync method in the C# SDK, which is QnAMakerOptions. The sample you linked (sample 11.qnamaker) simply has the QnAMakerOptions value as null, but you can just fill it in.
Inside the OnMessage handler of QnABot.cs in the linked sample, you can do the following:
// Create QnAMaker Options -- StrictFilters + Return Top 5 Answers
var twoStrictFiltersOptions = new QnAMakerOptions
{
Top = 5,
StrictFilters = new Metadata[]
{
new Metadata()
{
Name = "movie",
Value = "disney",
},
new Metadata()
{
Name = "home",
Value = "floating",
},
},
};
// Create your QnAMaker class that will call the QnA service, using the options you created
var qnaMaker = new QnAMaker(new QnAMakerEndpoint
{
KnowledgeBaseId = _configuration["QnAKnowledgebaseId"],
EndpointKey = _configuration["QnAEndpointKey"],
Host = _configuration["QnAEndpointHostName"]
},
twoStrictFiltersOptions,
httpClient);
// Query QnAMaker service
var response = await qna.GetAnswersAsync(turnContext, twoStrictFiltersOptions);

how to add a group to adress book app with javascript on mac os

I try to import csv file in my contacts in a new group with javascript or applescript (I will appreciate help in JS).
what I've tried:(I tried lot combinaison of this command)
var contact = Application("Contacts");
var group = contact.Group({
'name':'test'})
var personne = contact.Person()
contact.add(contact.Person())
var g = contact.Group({name : "test"})
contact.add(g)
I tried first to create a new group but nothing become visible in adress book.app
I aim to do File -> new group(cmd+maj+n) and this new group file->import (cmd +o) but with javascript.
You must use the push() command to add an new object (group, person, ...) to the application.
Use the save() command to show the new object in the application.
This script add a new person in a new group:
var contact = Application("Contacts")
var g = contact.Group({name : "test"})
contact.groups.push(g)// add a new group to the application
contact.save() // save and show the group in the application
var personne = contact.Person({firstName : "Ben", lastName : "zzzzzz", organization : "abcd", jobTitle : "President"})
contact.people.push(personne)// add a new person to the application
contact.add(personne, {to : g}) // add personne to the group
contact.save() // save and show the new person in the new group

Is Dynamics CRM 2013 sdk cache result of QueryExpresions by Default?

I wrote this simple query:
var connectionString = String.Format("Url={0}; Username={1}; Password={2}; Domain={3}", url, username, password, domain);
var myConnection = CrmConnection.Parse(connectionString);
CrmOrganizationServiceContext _service = new CrmOrganizationServiceContext(myConnection);
var whoAmI = _service.Execute(new WhoAmIRequest());
var query = new QueryExpression
{
EntityName = "phonecall",
ColumnSet = new ColumnSet(true)
};
query.PageInfo = new PagingInfo
{
Count = 20,
PageNumber = 1,
PagingCookie = null
};
query.Orders.Add(new OrderExpression
{
AttributeName = "actualstart",
OrderType = OrderType.Descending
});
query.Criteria = new FilterExpression() { FilterOperator = LogicalOperator.And };
query.Criteria.AddCondition("call_caller", ConditionOperator.In, lines);
var entities = _service.RetrieveMultiple(query).Entities;
I have a program which runs this query every minute. On the first execution the correct results are displayed but for subsequent queries the results never change as I update records in CRM.
If I restart my program the results refresh correctly again on the first load.
Why are the results not updating as records are modified in CRM?
It is the CrmOrganizationServiceContext that is doing the caching - I found the following worked a treat and the results of my RetrieveMultiple are no longer cached :)
Context = new CrmOrganizationServiceContext(CrmConnection.Parse(connectionString));
Context.TryAccessCache(cache => cache.Mode = OrganizationServiceCacheMode.Disabled);
RetrieveMultiple always brings back fresh results so there must be some other aspect of your program which is causing stale data to be displayed.

Google SpreadSheet Api, Putting List-Based Feeds Which Starts on Specific Cell

As seen as Google Api, i can easily put my data into a spreadsheet as below :
namespace MySpreadsheetIntegration
{
class Program
{
static void Main(string[] args)
{
SpreadsheetsService service = new SpreadsheetsService("MySpreadsheetIntegration-v1");
// TODO: Authorize the service object for a specific user (see other sections)
// Instantiate a SpreadsheetQuery object to retrieve spreadsheets.
SpreadsheetQuery query = new SpreadsheetQuery();
// Make a request to the API and get all spreadsheets.
SpreadsheetFeed feed = service.Query(query);
if (feed.Entries.Count == 0)
{
// TODO: There were no spreadsheets, act accordingly.
}
// TODO: Choose a spreadsheet more intelligently based on your
// app's needs.
SpreadsheetEntry spreadsheet = (SpreadsheetEntry)feed.Entries[0];
Console.WriteLine(spreadsheet.Title.Text);
// Get the first worksheet of the first spreadsheet.
// TODO: Choose a worksheet more intelligently based on your
// app's needs.
WorksheetFeed wsFeed = spreadsheet.Worksheets;
WorksheetEntry worksheet = (WorksheetEntry)wsFeed.Entries[0];
// Define the URL to request the list feed of the worksheet.
AtomLink listFeedLink = worksheet.Links.FindService(GDataSpreadsheetsNameTable.ListRel, null);
// Fetch the list feed of the worksheet.
ListQuery listQuery = new ListQuery(listFeedLink.HRef.ToString());
ListFeed listFeed = service.Query(listQuery);
// Create a local representation of the new row.
ListEntry row = new ListEntry();
row.Elements.Add(new ListEntry.Custom() { LocalName = "firstname", Value = "Joe" });
row.Elements.Add(new ListEntry.Custom() { LocalName = "lastname", Value = "Smith" });
row.Elements.Add(new ListEntry.Custom() { LocalName = "age", Value = "26" });
row.Elements.Add(new ListEntry.Custom() { LocalName = "height", Value = "176" });
// Send the new row to the API for insertion.
service.Insert(listFeed, row);
}
}
}
If i wrote "firstname" into the A1 and "lastname" into the B1, this is working, but i want to start this function ie. F21.
I mean, my localname firstname is in the cell F21 and i want google api to put my data "JOE" into F22 cell and ...
How can i do that ?
Regards.
CellFeed will do that, but list feed is more like an SQL style database table.
Suggest you use CellFeed or update your data SQL style, in whole rows.
I gave up with list feed when I discovered how little control you have over the position of the data.
Good examples:
CellFeed
https://gdata-java-client.googlecode.com/svn-history/r51/trunk/java/sample/spreadsheet/cell/CellDemo.java
ListFeed
https://gdata-java-client.googlecode.com/svn-history/r51/trunk/java/sample/spreadsheet/list/ListDemo.java

Pass a List of Series to SetSeries

I am using DotNet.Highcharts in conjunction with Visual Studio 2010. I have created an array of Series:
List<Series> allSeries = new List<Series>();
I then looped through a database and added several different Series. Then I created a Highchart and need to add the allSeries list to it. I have the code below that I used to create a Series one at a time. How can I take the allSeries list and pass it to SetSeries?
.SetSeries(new[]
{
new Series { Name = "Combiner 2", Data = new Data(myData2) },
new Series { Name = "Combiner 3", Data = new Data(myData3) }
});
if I am left to assume that the myData2 and myData3 objects are contained in or could be extracted from allSeries, then you should be able to do something like this:
.SetSeries(allSeries.Select(s=> new Series { Name = s.Name, Data = s.Data }));
EDIT:
If set series isn't looking for an IEnumerable<Series> but instead needs Object[] or Series[], then you could do this:
//casts series elements to object, then projects to array
.SetSeries(allSeries.Select(s=> (object)new Series { Name = s.Name, Data = s.Data }).ToArray());
or maybe this:
//projects series elements to array of series
.SetSeries(allSeries.Select(s=> new Series { Name = s.Name, Data = s.Data }).ToArray());
it all depends on what the method signature for SetSeries is.

Resources