Descendants function don't return a heirarchy result - olap

Descendants function return only a level children instead hierarchy. To eliminate my errors i used DB, Cube and query from this tutorial. I my case i recive only month, except year-quarter-month hierarchy.
How to fix it? I use xmondrian 3.12.

Error was in shell. It show only last column.

Related

How do I handle uninitialized data in a dynamic predicate in Ada?

This is some simplified code I haven't tested as is (so it may contain errors) that demonstrates the problem I'm experiencing:
type Space is private;
--Depending on members of Space, determines whether Outer fully contains Inner
function Contains(Outer : Space; Inner : Space);
--Outer should fully contain Inner
type Nested_Space is
record
Inner : Space;
Outer : Space;
end record
with Dynamic_Predicate => Contains(Outer, Inner);
I haven't been able to find a convenient way to initialize a Nested_Space without failing the assert defined by the predicate. If I try to set the members of Inner first, the members of Outer are still wherever they defaulted. But if I try to set the members out Outer first, the members of Inner are still wherever they defaulted. Even if I tried forcing a default on either type, there's still no way to pick a default that will certainly be within the bounds of any arbitrary Nested_Space.
Even trying to initialize with something like
declare
My_Inner : Space := (...);
My_Outer : Space := (...);
My_NS : Nested_Space := (Inner => My_Inner, Outer => My_Outer);
begin
....
end;
I can't seem to keep it from failing the assert. I can come up with some pretty clunky ideas (such as adding an Initialized : Boolean to Nested_Space specifically to check in the predicate, or alternatively setting members of the two different Spaces) but I was hoping there might be a solution that doesn't affect the structure of the record for something not required for the use case.
GNAT solutions are welcome if there's no solution in the ARM.
Thanks in advance!
I haven't been able to find a convenient way to initialize a Nested_Space without failing the assert defined by the predicate. If I try to set the members of Inner first, the members of Outer are still wherever they defaulted. But if I try to set the members out Outer first, the members of Inner are still wherever they defaulted.
ARM 3.2.4 (35/3) says, "A Static_Predicate, like a constraint, always remains True for all objects of the subtype, except in the case of uninitialized variables and other invalid values. A Dynamic_Predicate, on the other hand, is checked as specified above, but can become False at other times. For example, the predicate of a record subtype is not checked when a subcomponent is modified." You seem to be saying that this is not followed, and the record predicate is checked when you assign to a record component. If so, then you have found a compiler error. That it fails for an aggregate seems to support this idea.
However, unless you post a compilable example that demonstrates your problem, we cannot be sure that this is a compiler error.

How can I return the last array inside this recursive method?

I'm coding a calculator that simplifies a string of operations to arraylists of positive and negative results.
Right now, im trying to deal with adding the parenthesees feature and I thought about creating arraylists inside others to represent the operations within them.
There is only 1 method that processes everything, so when I add "(" an arraylist must be created in the current position of the array, and signify in some way to the rest of the code that next time the method goes in, it must start in that inner array.
So i thought about doing a recursive method that returns the "deepest" arraylist that has no more arrays inside.
public ArrayList<Object> deepest(ArrayList<Object> al){
ArrayList<Object> input=new ArrayList<>(al);
for(Object o:input){
if(o instanceof ArrayList){
return deepest((ArrayList<Object>) o);
}
}
return input;
}
Is this actually returning the deepest array inside the "tree" ? My code is doing some unexpected stuff and I feel like this starts to escape my understanding.
Your approach would return a leftmost ArrayList, not the deepest (the very first it finds in the tree). For the deepest, you would need a more exhaustive search, a counter that keeps track of the current depth, and also calculation of the "deepest so far" item at the appropriate places (after visiting all elements of an ArrayList).

VueJS: Updating a parent object won't be reflected on child

I have a parent with an object data and I sent to the child part of it. I hope that when the parent is updated the child should be updated to.
groupProps is an object that every property has a lines array. In example: groupProps[1].lines[3] can exist.
<nova-grup v-for="group in m.groups"
:group="group"
:groupProp="groupProps[group.id]"
>
</nova-grup>
The first time it's working fine. The problem is when groupProps is changed the child isn't. For example, when changing or adding a line to groupProps.lines.
I have also noted that any computed variable based on the object isn't updating neither. Is this a limitation of vuejs? I'm using some lodash functions inside the computed variable
OK, it is a limitation.
https://v2.vuejs.org/v2/guide/reactivity.html#Change-Detection-Caveats
Finally I solved it doing this.myvar = Object.assign({}, this.myvar );

JOINTJS: Get children recursively of a parent

How can i get all children recursively in jointjs.
I have done embedding in correct order.
I have done some homework in trying to find the answer, I have been using cell.getNeighbours().
But this does not help me in retrieving what i want.It only give the first child or first neighbours.
Since the embedding is done correct, I was thinking to use cell.getEmbeddedCells().
I am looking for help in creating a recursive function using cell.getEmbeddedCells()
getNeightbors() is for retrieving neighbors of an element in terms of links (both inbound and outbound) that are connected to that element. This has nothing to do with embeds. For retrieving all the embedded cells and their embedded cells recursively, you can do something like this:
var subtree = [];
function collectDeepEmbedded(cell) {
_.each(cell.getEmbeddedCells(), function(c) {
subtree.push(c);
collectDeepEmbedded(c);
})
}
collectDeepEmbedded(myCell);

Flex: select tree node right after the dataProvider is been assigned / updated / replace

i have a Flex tree control and im trying to select a tree node 3 levels down right after the dataProvider is assigned with a collection object like the following.
basically treeItem1, treeItem2, treeItem3 are the nodes in the tree and treeitem3 is a child of treeItem2 which is a child of treeItem1. Assume these treeItem(1,2,3) are referenced correctly from the collection items.
my problem is that if i wait for the whole component to load completely then select the nodes, it open/select/scrolltoIndex correctly. However, if i were to select the node right after the dataProvider is assigned, then it doesn't even open or select (basically the this.treeService.selectedItem is always null).
can anyone point out what i did wrong? is there anything needs to happen after the dataProvider is assigned?
thanks
this.treeService.dataProvider = oPricingHelper.getCurrentPricingSercicesTreeSource();
this.treeService.expandItem(treeItem1, true);
this.treeService.expandItem(treeItem2, true);
this.treeService.selectedItem = treeItem3;
this.treeService.scrollToIndex(this.treeService.selectedIndex);
I have used the updateComplete event to know when a component (such as a DataGroup or List) has completed rendering after performing a simple task (such as updating the dataProvider reference). Of course, you have to be careful and remove listening to updateComplete because it can run a lot, unless you have a need for it to run.
Something like:
//...some function...
this.treeService.addEventListener(FlexEvent.UPDATE_COMPLETE, onTreeUpdateComplete);
this.treeService.dataProvider = oPricingHelper.getCurrentPricingSercicesTreeSource();
//...rest of some function...
private function onTreeUpdateComplete(event:FlexEvent):void {
this.treeService.removeEventListener(FlexEvent.UPDATE_COMPLETE, onTreeUpdateComplete);
this.treeService.expandItem(treeItem1, true);
this.treeService.expandItem(treeItem2, true);
this.treeService.selectedItem = treeItem3;
this.treeService.scrollToIndex(this.treeService.selectedIndex);
}
I'm not positive your experiencing the same issue but I seem to have the same type of problem with using the advanced data grid, it appears in these cases where the dataprovider is acceptable as multiple types, the components do some extra work in the background to wrap things up into something Hierarchical (HierarchicalData or HierarchicalCollectionView) and in doing so the dataprovider setter call is not synchronous (so it will return before actually having assigned the internal property storing the dataprovider). I've used callLater in this case with moderate success, callLater is generally a bad practice but basically adds a function to a list of functions to call once background processing is done, so this is assuming that something in the dataprovider setter called UIComponent.suspendBackgroundProcessing() and that it will subsequently call UIComponent.resumeBackgroundProcessing() and then it will execute the list of functions added by using callLater. Alternatively you could use setTimeout(someFunction,1000).
These are both "hacks" the real solution is to dig into the framework code and see what it's really doing when you tell it to set the dataprovider. Wherever you see that it actually has set the dataprovider you could extend that class and dispatch an event that you could listen for to run the function to do the selections after this point.
If anyone has a better solution please by all means correct me (I would love to have a better answer than this)

Resources