WebXR: how to migrate from Oculus Go to Quest? - migration

I'm using Oculus Go controls (touchpad + trigger) in my WebXR molecular viewer (pure JavaScript + WebGL + WebXR) at https://www.ibiblio.org/e-notes/webxr/mini.htm. To migrate from Go to Quest I'd like to know, what corresponds to "selectend event" and "xrSession.inputSources[0].gamepad.axes[0/1] on Quest?

On the Quest thumbstick is exposed as
xrSession.inputSources[0/1].gamepad.axes[touchpad X, touchpad Y, thumbstick X, thumbstick Y]
where 0/1 correspond to the right/left hands. Therefore axes[2,3] should be used (instead axes[0,1] on the Go) to get X,Y coordinates.
See e.g. https://www.ibiblio.org/e-notes/webxr/mini/micro3q.htm.

Related

pine script with two indicators one overlaid on the chart and another on its own?

I am trying to write a pine script with two indicators one overlaid on the chart (EMA) and another on its own?(Stoch) I cannot seem to find any info on how to separate these (Visually) but keep them within 1 pine script, ie to be able to take trading decisions based on these.
The earlier answer from Luc is right, unfortunately. Each script can either create plots that are overlaid on the default price chart, or shown in a different pane, but not both. But there is a workaround.
Suppose you've made some non-trivial calculation in your script and you'd like to put it in different pane. E.g. the next code:
//#version=4
study(title="Stochastic", shorttitle="Stoch", format=format.price, precision=2)
periodK = input(14, title="K", minval=1)
periodD = input(3, title="D", minval=1)
smoothK = input(3, title="Smooth", minval=1)
k = sma(stoch(close, high, low, periodK), smoothK)
d = sma(k, periodD)
plot(k, title="%K", color=color.blue)
plot(d, title="%D", color=color.orange)
h0 = hline(80)
h1 = hline(20)
fill(h0, h1, color=color.purple, transp=75)
// This next plot would work best in a separate pane
someNonTrivialCalculatedSeries = close
plot(ema(someNonTrivialCalculatedSeries, 25), title="Exporting Plot")
Because they have different scale, one of them most likely will break another indicator's scale.
So you'd like show Stoch in different pine, whereas ema() should be overlayed with the main chart. For that you should make the next steps:
Turn off in the study's the extra plot to return scale to normal:
Apply to the chart the next script:
//#version=4
study("NonOverlayIndicator", overlay=true)
src = input(defval=close, type=input.source)
plot(src)
Choose in the second's script inputs source required plot from the first script:
And voilĂ  - you got the plots in different pines:
But if you want split the plots because you have retrictions on amount of studies you allowed to apply (e.g. 3 for free-account) - that won't help you.
It cannot be done. A script runs either in overlay=true mode on the chart, in which case it cannot direct plots elsewhere, or in a separate pane when overlay=false (the default).
When the script is running in a pane, it can change the color of the chart bars using barcolor(), but that's the only way it can modify the chart.
It is possible to rescale signals so that multiple bounded (e.g., 0-100, -1 to +1) signals generated by one script appear one on top of the other, but this is typically impossible in overlay mode, as the vertical scale varies with the bars on the chart. The only way for an overlay script to work with its own scale is when it uses No scale, but this prevents the indicator's plots to plot relative to price, and so the chart's bars.
Nice workaround from Michael.
Unfortunately, this only seems to work to pass data for one plot.
I would like to pass data for 3 different plots to the stock price graph.
If I try this, for 'input.source' I can only select the standard sources: "open, high, low, close ...". I can not select the data from other indicators.
If I remove plots 2 and 3, it works as Michael described.
Anybody has a workaround for the workaround..? ;-)

In react-native-maps, reverse y axis in UrlTile (for support of TMS)

React-native-maps supports custom tile overlays with UrlTile component. They are using Google maps and OSM style tile numbering, where 0, 0 is upper left corner.
Is there possibility to use TMS tiles, where 0, 0 refers to lower left corner (y-axis is reversed)?
I got no other idea than writing server-side proxy, which would parse x,y,z out from URL, reverse y and curl tile from Tile server with correct URL.
I ended up with patching AirMapUrlTile.java, I added new substitution for variable 'yr' (standing for y reversed).
String s = this.urlTemplate
.replace("{x}", Integer.toString(x))
.replace("{y}", Integer.toString(y))
.replace("{yr}", Integer.toString((1<<zoom) - y - 1))
.replace("{z}", Integer.toString(zoom));
This allows usage of urlTemplates like http://my.tms.server.com/layer/{z}/{x}/{yr}.png
But it would be nice to have some official solution for that, though.
You can try <UrlTile urlTemplate="..." flipY={true}.

Click an area of a webpage given an X Y value

I am trying to click a pin I have on my application which uses Bing Maps V8. The pins which are placed on to the map do not appear in the DOM elements as they are directly rendered onto the Map by Bing Maps engine.
I was wondering is there a way I can tell Testcafe to click an X Y value - for example
testController.click(718,962);
The above X Y value is from Selenium's IDE test recorder
Many thanks for any help
Please use the Click action with offset to click a point on an area. For example:
t.click('body', { offsetX: X, offsetY: Y })
// or t.click('img', {offsetX: X, offsetY: Y})

Cytoscape.js making a sub-instance from a graph

Background
So I have my main graph:
var cy = cytoscape { ... }
I am running it headless as it is sufficiently large.
I would like to, given a node id (n-id), make a non-headless instance from my main graph, which is based upon all nodes / edges in the neighborhood of degree d centered at n-id.
so the first part isn't too complicated...
cy.getElementById('n-id')
in principal I should be able to chain methods to get the desired result
cy.getElementById('n-id').neighborhood(SELECTOR).add(cy.getElementById('n-id'))
where we have the add command because the neighborhood doesn't include the calling node.
Questions
So my questions are the following
1.) what is the appropriate selector? [degree <= d] doesn't work
2.) now that I have my neighborhood, how do I turn it into a non-headless instance for visualization?
E.g. cy2.add( cy1.getElementById('#some-node').closedNeighborhood('[[degree = 5]]') )

How to display simple mathematical formulas in a rich internet application

I have some mathematical formulas of the type
p = (l + m + n) / (i+j*2)
Note: This is just an example. The real equations are more complicated with several variables participating in the equations.
I want to display these formulas in a tree like structure in an interactive, rich web component.
Initially the screen should display
p = x/y
with p, x and y as boxes. The user can click on the box labeled x which will "unfold" the box to expand and display
x = (l + m + n) and so on.
Since this is a J2EE based application, I can use any RIA library compatible with J2EE.
Are there any 3rd party RIA libraries out there that can help me render these formulas?
Looks like MathOverflow has this down... check it out.
please see the below links:
http://www.math.union.edu/~dpvc/jsMath/examples/Henrici.html
http://www.myphysicslab.com/web_math.html
http://amaya.software.informer.com/11.1/
http://en.wikipedia.org/wiki/MathML