Can you think of how to mark a card good/bad via Javascript, so it marks the current card and then displays the next one?
Ideally without any addons so it works on mobiles.
I am creating a custom quiz interface with multiple answer buttons.
Thank you!
Edit: Turns out it is already available in the AnkiDroid
https://github.com/ankidroid/Anki-Android/wiki/Advanced-formatting#designing-custom-cards-layout-for-buttons
showAnswer()
buttonAnswerEase1()
buttonAnswerEase2()
buttonAnswerEase3()
buttonAnswerEase4()
ankiMarkCard()
ankiToggleFlag()
AnkiDroidJS.ankiGetNewCardCount()
AnkiDroidJS.ankiGetLrnCardCount()
AnkiDroidJS.ankiGetRevCardCount()
AnkiDroidJS.ankiGetCardMark()
AnkiDroidJS.ankiGetCardFlag()
AnkiDroidJS.ankiGetETA()
In the next release they are planning to implement JS function to get the time for each button (to find out which one is "good" and if "easy" is available.
I have a problem when I try to use the function similarity proposed in the academic knowledge API.
I tested the following commad to compute the similarity between two string:
curl -v -X GET "https://api.labs.cognitive.microsoft.com/academic/v1.0/similarity?s1={string}&s2={string}" -H "Ocp-Apim-Subscription-Key: {subscription key}"
The error that I get is :
{"error":{"code":"Unspecified","message":"Access denied due to invalid
subscript ion key. Make sure you are subscribed to an API you are
trying to call and provi de the right key."}}
Curl_http_done: called premature == 0
Connection #0 to host (nil) left intact
Can you tell how can I generate the Ocp-Apim-Subscription-Key?
At the moment I used the key generated automatically when I visit the following url : https://labs.cognitive.microsoft.com/en-us/subscriptions?productId=/products/5636d970e597ed0690ac1b3f&source=labs
Thank you for your help
Unfortunately, primarily not an answer to your question, but rather a warning for all with the "same" problem, who could came across the original question like me, as the question helped me to solve a very, very similar problem: check whether you are using api.labs.cognitive.microsoft.com instead of westus.api.cognitive.microsoft.com. But may be you need the opposite.
It seems the whole project has been moved inside Microsoft (see https://www.microsoft.com/en-us/research/project/academic/articles/sign-academic-knowledge-api/, I would bet that this blogpost was at the top of some "entrypoint" blog even yesterday morning, but now I am not able to find this blog, perhaps the things are changing right now) and may be the project is somewhere in the middle of the transition process and not all documentation etc. corresponds with the new state. E.g. https://learn.microsoft.com/en-us/azure/cognitive-services/academic-knowledge/home, in the submenu Reference, links to two "versions" of API which seem to be almost same except for the URLs westus.api... and api.labs..., respectively. But there seem to be no info what is the difference, which one should be preferred etc.
My original keys expired yesterday, thus I generated new ones and was not able to use them until I have changed the URL to api.labs..., thanks to your question. May be you have the opposite problem, that you still have the "old" keys, so you need to use the "old" url westus.api..., but I am not able to test it, as my original keys which worked with westus.api... are expired.
Both your query and your link where to get keys are OK and work for me. Just one additional detail: did you try the circle arrow next to the key value, which generates a new key? May be your key is somehow broken or expired and this could solve your problem. You can also try to create a completely new account at MS site.
PS: I have added microsoft-cognitive tag as MS refers to https://stackoverflow.com/questions/tagged/microsoft-cognitive from many pages related to Cognitive Services
I think you need to sign up for a free account, there is a link you can follow from here:
https://westus.dev.cognitive.microsoft.com/docs/services/56332331778daf02acc0a50b/operations/58076bdadcf4c40708f83791
Except for the invalid key, you curl-call looks right.
You need a valid subscription key to be able to make API calls.
Production key
Have a look at this page on how to created the needed services in the Azure portal and how to find the endpoint, as well as they key from there.
Trial key
However, if you just want to try out the service, you can create a temporary key here. This key is very limited in use but it should get you up and running.
Limitations are:
50,000 transactions per month, up to 20 per second.
Trial keys expire after a 90 day period.
I would like to know how the key event is read and dispatched from the kernel to the Tizen OS. Haven't found any informative document on the same. While surfing through Tizen wiki I came across Tizen::Ui::SystemUtil::GenerateKeyEvent function which says it generates a key event. I would like to see the implementation of this function and understand how the key event is generated and injected into the input queue.
Please let me know where can we find the source code of this implementation. Also, point me to,if any, documentation is available that gives information about the event propagation from keypress till it reaches the application.
Thanks in advance.
The code for Tizen::Ui::SystemUtil::GenerateKeyEvent is found here. It in turn calls the SystemUtilImpl version of GenerateKeyEvent, which you can find here.
I'm looking at using a pre-image for one of my plugins so i can get values in fields that haven't been changed. I've registered a pre-image for the entity in the plugin registration tool but when I've put some code in that tries to check it it doesn't find the image. So i was wondering what it was that I've missed that is stopping it from working. I've searched Google but couldn't really find anything, cant anyone help?
Thanks
Have you ensured your string key in your code matches the image you have registerd for your plugin step?
For example.
Your code: Entity entity = (Entity)context.PreEntityImages["Target"];
Then your Entity Alias and Name when registering the image should also be named to Target.
Jimmy, assume you are not triggering the plugin during a create operation as the pre images are not available during create.
This is another possibility that the one mentioned by peter and robben above.
I want to know programatically if the third softbutton is present or not on a device. How to achieve that ?
There is no way to detect the presence of a third softbutton UI. Its an application decision whether to use a third softbutton or not.
check this link this is one example for checking all keys.
& Check this also for detecting soft_keys so you can get idea how to find third softbutton present or not.
Thanks