Related
The OSRM Routing engine returns "hints" in many of its outputs, and you are able to pass these back into a new request, which saves on lookup time and thereby optimizes the query.
My question is how do I pass these "hints" back into the
/table/v1/car
API call as per the example below?
EXAMPLE:
An OSRM API request of
/table/v1/car/-0.693000,52.078000;-0.724000,52.040000
gives back (snippet) :
"sources": [
{
"hint": "uImugOqJroBBAAAAAAAAALoBAAAAAAAA7WvYQQAAAACaUzhDAAAAAEEAAAAAAAAAugEAAAAAAAAXCgAAmXb1__mxGgP4bPX_sKUaAwYALwrjJ41R",
"distance": 388.619802,
"location": [
-0.690535,
52.081145
],
"name": ""
},
The original coordinates:
-0.693000, 52.078000
have been fixed up to:
-0.690535, 52.081145
(snapped to a nearby road and the hint is as above).
So I would like to utilise these "hints" in a new API query for the same LAT/LNG location, which should optimize the query.
The manual says about hints:
This can be used on subsequent request to significantly speed up the query and to connect multiple services.
I've tried various combinations and looking at the manual, but so far nothing has worked.
Has anybody successfully passed "hint" data into the /table/v1/car
API for OSRM Routing?
If so, please would you let me know what you did
I tried your request:
/table/v1/car/-0.693000,52.078000;-0.724000,52.040000
and got response:
{"code":"Ok",
"durations":[[0,596.2],[615.9,0]],"destinations":[
{"hint":"teJ0h-fidIdBAAAAAAAAALoBAAAAAAAA7WvYQQAAAACaUzhDAAAAAEEAAAAAAAAAugEAAAAAAACrkAAAmXb1__mxGgP4bPX_sKUaAwYALwr88AjE",
"distance":388.619802,"name":"","location":[-0.690535,52.081145]},{"hint":"dbcDgLevA4BpAAAAAAAAAAQGAAAwCAAA4-dpQQAAAACIYVZDGSCSQzQAAAAAAAAAAgMAABwEAACrkAAATvb0_48VGgPg8_T_QBEaAw4Afwf88AjE",
"distance":129.943557,"name":"","location":[-0.723378,52.041103]}],
"sources":[
{"hint":"teJ0h-fidIdBAAAAAAAAALoBAAAAAAAA7WvYQQAAAACaUzhDAAAAAEEAAAAAAAAAugEAAAAAAACrkAAAmXb1__mxGgP4bPX_sKUaAwYALwr88AjE",
"distance":388.619802,"name":"","location":[-0.690535,52.081145]},{"hint":"dbcDgLevA4BpAAAAAAAAAAQGAAAwCAAA4-dpQQAAAACIYVZDGSCSQzQAAAAAAAAAAgMAABwEAACrkAAATvb0_48VGgPg8_T_QBEaAw4Afwf88AjE",
"distance":129.943557,"name":"","location":[-0.723378,52.041103]}]}
Your request has 2 points, so you have to add 2 hints, one for each point.
So, the request with hints is:
/table/v1/car/-0.693000,52.078000;-0.724000,52.040000?hints=teJ0h-fidIdBAAAAAAAAALoBAAAAAAAA7WvYQQAAAACaUzhDAAAAAEEAAAAAAAAAugEAAAAAAACrkAAAmXb1__mxGgP4bPX_sKUaAwYALwr88AjE;dbcDgLevA4BpAAAAAAAAAAQGAAAwCAAA4-dpQQAAAACIYVZDGSCSQzQAAAAAAAAAAgMAABwEAACrkAAATvb0_48VGgPg8_T_QBEaAw4Afwf88AjE
where hints are separated by semicolon.
I´m trying to make a applications that migrates data over cloud services, while trying to transfer mail messages I was incapable of finding a way to set the sent date for messages, after some search it seams that it cant be done using MSGraph. I know that ews can do it but ews is now deprecated so my questions is. Does any one know a way to do it using ms graph? There is really no solution for this and i will really be forced to use a deprecated api?
You need to set a few Extended properties to do this you need to set the MessageFlags extended property to make it appear as if it was a Sent Message. You also need to set the ClientSubmitTime https://learn.microsoft.com/en-us/office/client-developer/outlook/mapi/pidtagclientsubmittime-canonical-property and the delivery time https://learn.microsoft.com/en-us/office/client-developer/outlook/mapi/pidtagmessagedeliverytime-canonical-property to the date you want the message to be sent.
{
"Subject": "Test123"
,"Sender":{
"EmailAddress":{
"Name":"senderblah",
"Address":"senderblah#blah.com"
}}
,"Body": {
"ContentType": "HTML",
"Content": "Just the facts"
}
,"ToRecipients": [
{
"EmailAddress":{
"Name":"blah",
"Address":"blah#blah.com"
}}
]
,"SingleValueExtendedProperties": [
{
"PropertyId":"Integer 0x0E07",
"Value":"1"
}
,{
"PropertyId":"SystemTime 0x0039",
"Value":"2020-03-04T09:55:38.7169+11:00"
}
,{
"PropertyId":"SystemTime 0x0E06",
"Value":"2020-03-04T09:55:38.7169+11:00"
}
]
}
That said because you can't import the MIMEContent of a Message using the Graph API at the moment so doing large scale data migrations using the Graph is a little impractical (but it will work okay for small scale apps without to much diversity of content).I would still suggest using EWS for migration products while depreciated its still supported (and used by most migration vendors).
Can anybody provide me a step by step tutorial in order to create a own mode for CodeMirror.
The online tutorial is quite complicated.
Thanks.
Regards.
I recommend you this site, it has a great tutorial for "simple modes", if its your case. Also I'll show you a mode that I made for a pseudo-regex mode:
CodeMirror.defineSimpleMode("simplemode", {
start: [
// As you can see I use different tokens for different matches as needed.
{regex: /(\.\+|\.\*|\.|\+)/, token: "keyword"},
{regex: /(\\d)|(\\w)|(\\s)|(\\t)|(\\r)|(\\n)|(\\\()|(\\\))|(\\\[)|(\\\])|(\\\{)|(\\\})|(\\\.)|(\\\-)|(\\\_)/i, token: "string"},
{regex: /(![A-Za-z]+\{|\})/, token: "number"},
{regex: /(\(|\)|\||\[|\]|\-)/, token: "operator"}
]
});
Then just add mode: "simplemode" to the editor options. Hope it helps you!
I am trying to get realtime stock data from BSE and NSE using yahoo finance web-services. I was able to get some data using following URL
http://finance.yahoo.com/webservice/v1/symbols/COALINDIA.NS/quote?format=json
But it gives me very limited information.
{
"list": {
"meta": {
"type": "resource-list",
"start": 0,
"count": 1
},
"resources": [
{
"resource": {
"classname": "Quote",
"fields": {
"name": "COAL INDIA LTD",
"price": "367.649994",
"symbol": "COALINDIA.NS",
"ts": "1418895539",
"type": "equity",
"utctime": "2014-12-18T09:38:59+0000",
"volume": "2826975"
}
}
}
]
}
}
I need more information like yearly high, low, last traded price etc. and I couldn't find any documentation related to this from yahoo where it details how to get more information.
Is there documentation available related to these services? Or please suggest if there are any alternatives available.
I don't know where the definitive documentation might be but for your particular example try appending &view=detail to your URL.
http://finance.yahoo.com/webservice/v1/symbols/COALINDIA.NS/quote?format=json&view=detail
This will at least give you the year_high and year_low that you asked after.
Now, even though the following won't work for your COALINDIA.NS symbol (I suspect the exchange is not supported), it might be worth exploring the following two examples:
Example 1: As before, but for Apple and Yahoo symbols, with &view=detail appended:
http://finance.yahoo.com/webservice/v1/symbols/YHOO,AAPL/quote?format=json&view=detail
Example 2: And now using a completely different url, resulting in much more response data. One key caveat is this data is delayed by 15 minutes:
http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20IN%20(%22YHOO%22,%22AAPL%22)&format=json&env=http://datatables.org/alltables.env
If you discover the major differences between those two options and what impact they might have then please do let us all know; I'd be interested in finding out more.
If you are fine with getting NSE qoutes, you can use this package for the purpose, it is extremely easy to setup.
http://nsetools.readthedocs.org/en/latest/index.html
Since it uses NSE website/services as data source, the quotes will not be delayed (max few seconds).
Beware that these data are both delayed and inconsistent. You are not getting anything even remotely close to tick or real-time data.
From example 2, refresh a few times, and inspect the "LastTradeWithTime" key-value pair. I sometimes get different quotes from different times of day, for no apparent reason. They are sometimes delayed up to three hours.
You get what you pay for; in other words, this is not a free lunch.
For those who are curious about the different options available in the Yahoo Finance URLs, I think these links might help. If it's not what you're looking for, sorry.
http://internetbandaid.com/2009/03/31/yahoo-stocks-api/
https://ilmusaham.wordpress.com/tag/stock-yahoo-data/
Note: the wordpress site contains information that was taken from a site called gummy-stuff.org which is listed in full at the bottom of the above site (I can only list 2 urls in this post so I had to do the round-about way). Oddly, I found this site on my own yesterday. Funny how stuff comes back around. If you visit this site you'll just see a statement from Yahoo that the info he had originally listed (you're looking at some of this site on the above wordpress site) was never intended to be for public consumption and is a violation of Yahoo's terms and conditions agreement as it can apparently be used for hacking purposes. I was curious to see what was on the original post so I searched for it on the WayBack Machine. BTW, the links to the spread sheets are still active in the archive.
Cheers. Thom
I'm trying to get the public posts for a specific subject with Facebook API en French for example (you need to change the access_token below) with this way :
https://graph.facebook.com/search?q=cinema&type=post&access_token=abc|abc&locale=fr_FR
This is not working. I have mixed languages (Spanish, French, English...) in the result. I checked the Facebook developers website and I cannot find a issue here. Somebody have the same problem?
In fact, if in the results, i have a lang key associated to each post, this would be good to me. I tried to add in the url fields=languages (and anothers words like lang,language,locale...) but this is not working too.
Thank you for your help! (sorry for my English)
graph.facebook.com/search?q=cinema&type=post&locale=fr_FR
In fact, when running this query, the locale parameter is considered. It gives categories translated in French.
{
"id": "376665779074901_525847047490106",
"from": {
"category": "Site internet de détente/sports",
"name": "Hasil+jadwal+klasemen Sepakbola",
"id": "376665779074901"
},
"message": "Hasil Pertandingan\n\nLike (y) & Bagikan ...\n\n• England- Premier League\nFT Chelsea 2 - 0 Fulham\nGoals :\n52'[1 - 0] Oscar\n84'[2 - 0] John Obi Mikel\n-\nFT Liverpool 0 - 1 Southampton\nGoals :\n54'[0 - 1] Dejan Lovren\n-\nFT Newcastle United 2 - 3 Hull City\nGoals :\n10'[1...
}
But I must agree, it's not really helpful. The least you could do would be, in the case of a user post, to check what is the language the user is using:
graph.facebook.com/USER_ID?field=locale
Apart from that, I have to say that you can't rely on Facebook's locale information. Facebook doesn't know if a post has been written in French or English. ALso, someone using Facebook in English doesn't mean he will only write english posts. If you want to find all messages in a specific language, better check all messages by yourself with another web service dedicated to language recognition.