I do have a wfs source and a cluster source in a vector layer. From time to time I know that something changed in the serverside wfs source, so I want to update the vector layer to show the new features. How can I trigger an update of the wfs layer without interaction of the user (especially change resolution)?
An clear() on the cluster source or the vector source or any combination of it did not help. Also a changed() or a map.render() did not work.
I would like to trigger somehow the loader-function of the vector source.
Thanks for help!
This is related to a known issue: https://github.com/openlayers/ol3/pull/3917
I'd suggest using the change from the pull request above in a custom build, which should enable you to reload the layer (and the cluster) by calling clear on the base source.
Alternatively, you could initialize a new cluster source each time you call clear on the base source, and replace the cluster source by calling setSource on the layer.
Related
I'd like to be able to add or remove geometries as they appear/disappear in my environment.
The docs clearly state that all geometries must be added before the call to MultibodyPlant::Finalize(). Does this mean every time I add a new geometry, I have to re-create an entirely new plant/diagram/scene_graph and re-load all existing objects?
This strongly depends on the role.
Proximity: If you're using MultibodyPlant and are going to ask the plant to handle contact dynamics (e.g., MultibodyPlant needs to resolve contact), then the simplest answer is: you cannot change geometry after you finalize. Changes in geometry require new plants (as of today).
Illustration or Perception: If you're hoping to change the geometry for either of these roles, you can go into SceneGraph and manipulate those geometries to your hearts content before or after you finalize MultibodyPlant. If you're interested in this route, let me know in a comment and I'll elaborate on what this would look like in an edit.
I am difficulties finding a way to update a chart with new data.
One adds data to a chart using:
Configuration conf = chart.getConfiguration();
conf.addSeries(series);
But there is no corresponding "remove(series)"!?!
Thus, if I want to update the data being displayed and add another series I actually add another line (or bar-graph or whatever visualization I have chosen) to the chart, which is clearly NOT what I want/need.
My first attempt to overcome that was to get hold of the old data series and remove them from the chart, but with getSeries() I am only getting a non-modifyable copy of the existing series, so that attempt ended in a java.lang.UnsupportedOperationException.
Thus my question: how do I convince an existing chart to remove all old data series?
Don't tell me, that I need to recreate the entire chart-component each time, please!
You didn't mention any versions, but at least it used to be possible to remove items from the DataSeries itself. So instead of removing the series, you can just empty and repopulate it. Save the series reference when you set it. Alternatively you can e.g. create a new ArrayList from the unmodifiable list, make your changes there, and set the series again (using setSeries, not addSeries). Then calling chart.drawChart(); should trigger the re-draw.
I want to create a domain object in different data sources based on a condition but when we instantiate a new object like new Foo().save() there is no way to set which data source it will be done.
I've also noticed that if I do new Foo().dataSource2.save() it still saves in default (unnamed) data source in addition to dataSource2. How can we instantiate object only in one data source and save only in there?
I'm using grails 2.4.3.
Edit: To make it clear. I want to dynamically pick which data source to create the user in during runtime.
It seems new Foo().dataSource2.save() will not try to save it in the unnamed data source at a later point. This solution actually works.
I am trying to implement architecture similar to one presented in https://www.jstage.jst.go.jp/article/transinf/E101.D/2/E101.D_2017EDP7165/_pdf
using Microsoft's CNTK framework. So I need to add inputs to one or more hidden layers which do not represent the outputs from previous layer but are externally defined.
I've tried by splicing standard layer and these additional inputs into a single layer, but then I obtain a layer with multiple inputs. And I am also not sure how can I make partial connection of two consecutive layers in CNTK.
I have looked the documentation but haven't found any function that could help me. Is this possible to implement with CNTK?
code = C.input_variable()
input_tensor = C.input_variable()
denseout1 = Dense()(C.splice(input_tensor, code, axis=...))
denseout2= Dense()(C.splice(denseout1, code, axis=...))
** I answered here so that anyone looking at this gets help too.
I am attempting to implement zookeeper as a shared state engine for an application I am creating in erlang. The structure for the state would be like the following:
/appRoot
/parent1:{json}
/child1:{json}
/child2:{json}
/parent2:{json}
/child1:{json}
/child2:{json}
I would like to be able to have a single method that returned all parent nodes when provided /appRoot along with it's data. Say in a list of tuples [{parent1,{json}}, {parent2:{json}}]. Or, if provided /appRoot/parent1 a list of it's subnodes with the data. So far, all I see is a way to get the keys (getChildren) then recursively retrieve the data with the key. It seems like I should be able to just make one call to do this.
I am currently using the ezk erlang client library. If anybody knows a better solution, that would be appreciated as well.
TIA
AFAIK there is no way to atomically list node children along with its data in zookeeper wire protocol. Seems, there is only way to do this is following:
List all node children and monitor children changes.
For each child node read it data and monitor data changes.
Update corresponding values on each children change happened after you started traversal.
This can be easily done over ezk, but I've not provided any example code because it heavily depends on guarantees of atomicity that your app logic demanded.