XrController.hitTest not returning any ESTIMATED_SURFACE or DETECTED_SURFACE results - 8thwall-web

I'm calling
XrController.hitTest(X, Y, ['FEATURE_POINT','ESTIMATED_SURFACE', 'DETECTED_SURFACE'])
But all the results I'm getting are of type 'FEATURE_POINT' only.
If I leave out 'FEATURE_POINT' from the included types
XrController.hitTest(X, Y, ['ESTIMATED_SURFACE', 'DETECTED_SURFACE'])
I'm not getting any results at all.
Are 'ESTIMATED_SURFACE', 'DETECTED_SURFACE' not implemented yet, or do I need to do something specific in order to get them
Thanks

The ESTIMATED_SURFACE and DETECTED_SURFACE options are in the spec but aren't currently a features of 8th Wall Web. Only FEATURE_POINT is currently implemented.

Currently only 'FEATURE_POINT' is supported in 8th Wall. You can reference this document: https://www.8thwall.com/docs/web/#xr8xrcontrollerhittest

Related

How can I use "Interpolated Absolute Discounting" for a bigram model in language modeling?

I want to compare two smoothing methods for a bigram model:
Add-one smoothing
Interpolated Absolute Discounting
For the first method, I found some codes.
def calculate_bigram_probabilty(self, previous_word, word):
bigram_word_probability_numerator = self.bigram_frequencies.get((previous_word, word), 0)
bigram_word_probability_denominator = self.unigram_frequencies.get(previous_word, 0)
if self.smoothing:
bigram_word_probability_numerator += 1
bigram_word_probability_denominator += self.unique__bigram_words
return 0.0 if bigram_word_probability_numerator == 0 or bigram_word_probability_denominator == 0 else float(
bigram_word_probability_numerator) / float(bigram_word_probability_denominator)
However, I found nothing for the second method except for some references for 'KneserNeyProbDist'. However, this is for trigrams!
How can I change my code above to calculate it? The parameters of this method must be estimated from a development-set.
In this answer I just clear up a few things that I just found about your problem, but I can't provide a coded solution.
with KneserNeyProbDist you seem to refer to a python implementation of that problem: https://kite.com/python/docs/nltk.probability.KneserNeyProbDist
There exists an article about Kneser–Ney smoothing on wikipedia: https://en.wikipedia.org/wiki/Kneser%E2%80%93Ney_smoothing
The article above links this tutorial: https://nlp.stanford.edu/~wcmac/papers/20050421-smoothing-tutorial.pdf but this has a small fault on the most important page 29, the clear text is this:
Modified Kneser-Ney
Chen and Goodman introduced modified Kneser-Ney:
Interpolation is used instead of backoff. Uses a separate discount for one- and two-counts instead of a single discount for all counts. Estimates discounts on held-out data instead of using a formula
based on training counts.
Experiments show all three modifications improve performance.
Modified Kneser-Ney consistently had best performance.
Regrettable the modified Version is not explained in that document.
The original documentation by Chen & Goodman luckily is available, the Modified Kneser–Ney smoothing is explained on page 370 of this document: http://u.cs.biu.ac.il/~yogo/courses/mt2013/papers/chen-goodman-99.pdf.
I copy the most important text and formula here as screenshot:
So the Modified Kneser–Ney smoothing now is known and seems being the best solution, just translating the description beside formula in running code is still one step to do.
It might be helpful that below the shown text (above in screenshot) in the original linked document is still some explanation that might help to understand the raw description.

Selecting some kind of closest child with jQuery seems not to work

I try to implement a nested tab module the following way.
By clicking on a .tabs__menu item I want to get the next .tabs__contents to display the correct entry.
I've prepared a codepen with markup and leave out all unimportant code so don't be irritated that it's not working. I don't understand why the variable debug2 is 0 and debug3 is 1. I expect debug2 to be 1 as well since I expect the following expression should find the element. Can anyone help me with this?:
.find(".tabs__contents").not(".tabs__contents .tabs__contents");
https://codepen.io/anon/pen/JNLWQp
Thanks in advance and best wishes,
duc
ok I have an assumption why it's not working. It seems that the .not method doesn't starts to search relatively from the given collection but globally. With this statement
.not(".tabs__contents .tabs__contents")
debug2 finds itself and exclude it from the collection thats why the length is 0.

MDX Children of Several Members

The children functions returns the set of the member.
But I need the children of several members.
The problem is, that I can't use Union to make it work like that:
Union([Geography].[Geography].[USA].children,[Geography].[Geography].[Canada].children)
I don't know how many member it will be... So I actually would need all children of a set of members.
like:
([Geography].[Geography].[USA],[Geography].[Geography].[Canada],[Geography].[Geography].[GB]).children
Is there a function like that?
I couldn't answer my question and so I just edit it. With the help of DHN's answer and some brain work I found a solution I could use:
Except(DRILLDOWNLEVEL( {[Geography].[Geography].[USA],[Geography].[Geography].[Canada]},,0 ),
{[Geography].[Geography].[USA],[Geography].[Geography].[Canada]})
That does work for me.
Explanation: I drilldown the elements the tool provides me, which returns children plus parents and then I use DHN's idea and except the parents so clean the list up a bit.
Hopefully it is understandable.
You can use the Descendants method (the fourth form of the description linked uses a set as its first argument. Thus,
Descendants( {
[Geography].[Geography].[USA],
[Geography].[Geography].[Canada],
[Geography].[Geography].[GB]
},
1,
SELF
)
should deliver exactly what you want.
Well actually, you could use a Crossjoin to get the set you want.
Something like
[Geography].[Geography].[USA] * [Geography].[Geography].[Canada] * [Geography].[Geography].[GB]
But this is only a proper solution, if you have only a few different search criteria.
Alternatively, you could use Except to remove those criteria you're not interested in. E.g.
Except([Geography].[Geography].children, [Geography].[Geography].[Germany])
This would give you the whole content of the [Geography] dimension, except the one of [Germany].
Hope this helps a bit.
Edit after comment of TO
Ok, this wasn't part of your question, but I think what you need is the MemberToStr() function. Please find the doc here.
I think something like this should do the trick.
with member [Measures].[Cities]
as membertostr([Geography].[Geography].members.children)
select [Measures].[Cities] on 0
from [WhatEverYourCubeNameIs]
where (
[Geography].[Geography].[USA],
[Geography].[Geography].[Canada]
)
Please note that this query is totally untested. I also may have lost some of my skills, because it's been a while, since I used mdx. You will also have to create the query dynamically, since the selection seems to be user dependant. But I'm sure that you're aware of it. ;)

dart HTML TableCellElement - cannot get or set colspan

I am creating a HTML table inside the dart code. then i add rows to the table (TableRowElement) and cells (TableCellElement) to the rows. Then I want to set the colspan of the cells. Or even print the colspan.
Here the program crashes (debugger says that the element has no get$colspan). However the API reference (http://api.dartlang.org/docs/channels/stable/latest/dart_html/TableCellElement.html#colSpan) shows colspan as an int (its not final either).
At the end, I want to create dynamic tables...
Thanks,
imran
p.s.: code looks like this:
var table = new TableElement();
table.addRow();
table.rows.last.addCell();
print(table.rows.last.cells.last.colspan);
table.rows.last.cells.last.colspan=2;
The property is colSpan (capital S)
Issue https://code.google.com/p/dart/issues/detail?id=15256 was created.
What you are seeing are hints, not warnings, out of the analyzer. (There is a bug to fix the UI to make this more clear).
If you change var table to TableElement table, then the analyzer will violate clospan as you probably expected. Since you declared table as a "var" the analyzer doesn't produce a warning. Since this can lead to bugs like the one you encountered, we are always in the process of adding hints.
Unfortunately, there seems to be a bug where the propagated type of table.rows.last.cells.last is not being resolved. I am looking into this now.

Actionscript 3: Referencing data in groupings of movieclips

I'm a very new programmer. I'm making a character calculator for a friend of mine's game, but mostly for practice for myself.
I'm programming in Actionscript and have been trying to reference Data in Lists, which has been working fine, except when my lists are grouped together with anything else as one symbol(MovieClip).
I have looked around the internet and tried getChild() (though I am not positive symbols in other symbols mean they are children of them), as well as putting MovieClip(parent).ListName.Data to try and reference it. I have also simply tried putting ListParent.ListName.Data to reference it, but I'm afraid I'm at a loss.
I'm sure the answer is very obvious but Google, as it seemed, did not pinpoint my issue. Here is the code -- my list's dataProvider is pretty much just 1, 2, 3, 4, 5 for my data points, so here I'm trying to reference list selection 2:
earthponyRacials.earthponyList1.addEventListener(Event.CHANGE, testText);
function testText(event:Event) {
if(earthponyRacials.earthponyList1.data == 2){
trace("Function working?");
}
}
This is my reference error:
ReferenceError: Error #1069: Property data not found on fl.controls.List and there is no default value.
at CharacterCalculator_fla::MainTimeline/testText()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at fl.controls::SelectableList/handleCellRendererClick()
I'm sorry if this is a really obvious question.
You have to access the lists data using:
YourList.dataProvider.getItemAt( ItemsIndex ).data;
You can also get its label by replacing .data with .label
The items index is the same as accessing an array so item 2 is index 1 item 1 is index 0
Hope this helps!