StackExchange API tag synonyms returns tags that do not exist on Stack Overflow - resultset

I am trying to build a taxonomy-like relationship graph for Stack Overflow tags. I extracted all tags and nearly ~37000 of those wikis. Before determining the relationships based on wikis, I decided to take look at what Stack Overflow /tags/{tag}/synonyms has to offer. Some of the from_tags in the results are not actual tags in Stack Overflow. I thought I might have missed those in my dataset. So tried to search those with the /tags/{tag}/info, which however returned the information for to_tag.
For example:
{
"creation_date": 1377674210,
"last_applied_date": 1602368899,
"applied_count": 1172,
"to_tag": "java",
"from_tag": "jre"
}
Is one of the results for tags/java/synonyms endpoint. However, there is no tag jre. If search /tag/jre/info I get information for Java instead.
I am confused about this behavior. How does tags/java/synonyms get a tag which is not a Stack Overflow tag?

The API results are correct. As you can see here, jre exists and was synonymised and merged with Java. In addition, https://stackoverflow.com/questions/tagged/jre redirects to https://stackoverflow.com/questions/tagged/java (the page doesn't return a 404!). Apparently, you can only find tags that have been synonymised via the /tags/{tag}/synonyms. Thus, this route is not that useful for your task.
For more information, see: What are tag synonyms and merged tags? How do they work?

Related

Scenario Outline And Examples in karate [duplicate]

This question already has an answer here:
In Karate Scenario Outline test, how to pass param values in the Examples table through a variable
(1 answer)
Closed 1 year ago.
I want to run my scenario with all the images that i have in my resource folder. meaning every time hitting same api with different image(converting them to base64encoding first) .But as this images already are in resource folder than it does not make sense to save with some name or records in csv for scenario outline purpose. Can i call a my own function (having code to take the image from resource folder and convert it into base64) in Examples section , So that for every image it will hits the same api again.
Yes. First write some java code to get a list of the image files. You can refer this code for ideas: https://stackoverflow.com/a/65035825/143475
If that is too hard, then just create a CSV file with a list of paths. Let me say that Karate is designed for testing, but you seem to be expecting something else. Karate is not a "general purpose" programming language. But it can be made to do extreme things by Java interop.
One you have a JSON array, then it can be used as the data-source for the Examples: section: https://github.com/intuit/karate#json-array-data-source
You can refer other answers for Base64 conversion: https://stackoverflow.com/a/46452864/143475
All the things you want to do is possible, but please do some research and try. And the next time you ask a question, please show what you tried and give examples instead of just a broad question, thanks.

Strange prefix (/A\) in ABAP call stack

Generally I try to make my questions Reproducible.
In this case I couldn't find a way. Please feel free to guide me how to grab more details and I will attach.
In some cases, we are using the ABAP call stack programmatically to get additional info. I.E: logging user calls, accessing variables from lower calls in the stack as a last resort when there is no other proper way to retrieve them.
We have encountered a case, in which weird chars were added as a prefix in the call stack for central programs of HR module 'MP9XXX00'(Module-Pool generated programs for customer-specific PA infotypes). The weird chars are /A\.
The full string for calling program is /A\MP9XXX00.
The code used to get the whole call stack:
lt_call = cl_abap_get_call_stack=>format_call_stack_with_struct( cl_abap_get_call_stack=>get_call_stack( ) ).
There aren't such programs /A\MP9XXX00 in SE80.
Also, when tried to receive variables from calling program as mentioned, like this:
ASSIGN |( { ls_call-prog })PSYST| it failes, it caused dump. And when we looked into ST22 the stack didn't contain any /A\MP9XXX00 but just MP9XXX00 (ls_call-prog contained /A\MP9XXX00).
As said, we didn't manage to reproduce and debug it. just saw the result.
Where could those chars come from?
What we thought of
We thought that it might be related to the fact that our customer namespace starts with /A, but still, why it's shown up? why just a few times? why just the first two characters? and where did the other \ come from?
We thought that the prefix /A\ might be temporary added to (those) program names, say while importing related transport requests. And that maybe A is for Active/Activating. What made us think so is that it happens more in QA than in production.

what controls the order of UMLS linked entities from scispacy if the scores are all 1

i'm using Scispacy (which is awesome!) but when I type 'tau' into the app found here https://scispacy.apps.allenai.org/
the UMLS entity gives me the canonical name of 'MAPT gene' which is what I want.
But when I do the exact same thing in my python code based on the app code (see here https://gist.github.com/DeNeutoy/b20860b40b9fa9d33675893c56afde42)
the first canonical name on the list is 'uridine triacetate' (the second is 'MAPT gene')
in the app code there is the call 'if show_only_top:break' so I assume somehow their app implementation orders the linked entities differently.
if someone can explain the difference in ordering and how to fix that would be great thanks!!
This question was also asked on github (https://github.com/allenai/scispacy/issues/344), and answered there, but I am including the answer below in case anyone ends up here.
The demo app is not currently running the latest version of scispacy, and the inconsistent ordering of the entities was an issue that was fixed in scispacy version 0.4.0.

How do the operators `{##}` and `{##}` differ in the Moodle STACK system?

What the title says. I've ran into these operators before when authoring a question and looking at questions others have made, but I can't seem to find what the actual specific difference is. The difference is not mentioned anywhere in the documentation, that I can find. I know that {#var#} is used to display the value of the variable var specified previously in the form in the question text, but what would {#var#} do?
Is there anybody here who knows about this?
I think you'll find the answer on the CASText documentation page in the qtype-stack source repository.
In both cases, whatever is enclosed is evaluated by CAS, but (if I understand the doc correctly) when using {# ... #} the result is displayed in LaTeX, while {# ... #} is displayed in Maxima.

How do I get a list of the Velocity objects and APIs usable in user macros in Atlassian Confluence? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I need to write some user macros in Atlassian Confluence. It uses the Apache Velocity templating engine. How can I find which APIs are available in that context?
For example, one community-provided macro uses objects like $spaceManager. How can I enumerate all of the objects that are available, and also get documentation for their methods?
The page on the Atlassian site listing the objects is incomplete: not only does it only list a small fraction of the true objects available, it's also not specific to the user macro context, or even to my specific version of Confluence. (For example, user macros are given a different Velocity context than Velocity used in other plugin points and have different objects available, and the objects available in Confluence 5.1 are different from those available in Confluence 5.6.)
There are similar questions on the Atlassian Answers site, but none point to complete API and type references.
The official list of Velocity objects visible in Confluence is listed on Atlassian's site, but as you may have noticed, it is far from complete.
With JIRA, there is a trick that one can use to list all objects in the current Velocity context:
#foreach($p in $ctx.keySet().toArray())
$p.toString() - $ctx.get($p).getClass().getName().toString()
#end
Unfortunately, the JIRA trick above does not work for Confluence because Confluence does not expose the ctx map.
Luckily, you mentioned that you are writing user macros, so not all is lost! Using another trick to access objects that are not normally available in the default context, you can punch a hole through to the class that provides the Velocity context for user macros and give yourself a copy. Combining the two approaches, we get the following for Confluence:
#set($macroUtilClass=$action.class.forName('com.atlassian.confluence.renderer.radeox.macros.MacroUtils'))
#set($getContextMethod=$macroUtilClass.getDeclaredMethod('defaultVelocityContext',null))
#set($ctx=$getContextMethod.invoke(null))
#foreach($p in $ctx.keySet().toArray())
$p.toString() - $ctx.get($p).getClass().getName().toString()<br/>
#end
This gives you a list of all objects available and their corresponding types, like this:
res - com.atlassian.confluence.web.filter.DebugFilter$LoggingResponseWrapper
bootstrap - com.atlassian.confluence.setup.DefaultBootstrapManager
settingsManager - com.atlassian.confluence.setup.settings.DefaultSettingsManager
userAccessor - com.sun.proxy.$Proxy54
seraph - com.atlassian.confluence.util.SeraphUtils
xsrfTokenGenerator - com.atlassian.xwork.SimpleXsrfTokenGenerator
...
To find the methods available through each of those objects, you will need to look up the corresponding JavaDocs by the class name. I find that Google is often the fastest path to done, but you can also go directly to the JavaDocs (for example, for the SpaceManager) and then root around in the other packages or adjust the URL to match the class you want. You will also want to adjust the "latest" in the URL to correspond to the actual version of Confluence you have installed. Lastly, a few of the classes are hidden behind proxies (like userAccessor above), but the variable name often matches the class name, so these are usually easy to figure out.
Note that this example is specifically tailored for user macros. The objects available in other Velocity contexts will certainly be different.