How to fetch Image::Info object for an existing image - imagemagick

If I have an existing image, how can get a reference to its Image::Info object? In particular, I want to read an option (that was previously set using image.define(...)) from it using the [] operator.
If there is any other way to read a value set via image.define(...) from an image, that would be perfect as well.

The define method is the same as []=, so you can get the option value using [].

Related

What values can be used in the tags of the method [DJIRemoteController setCustomButtonTags:withCompletion] in objective-C?

I'm trying to configure the C1 and C2 buttons in a custom DJI app. I found that I can call the method setCustomButtonTags:withCompletion, which is part of the DJIRemoteController class.
I tried to fill the DJIRCCustomButtonTags object to provide it as a parameter of the method, but I don't know which values are valid for c1buttontag and c2buttontag. Does anyone knows something about using the setCustomButtonTags method?
Valid values are in range [0, 255] (documentation).
You can set you own values, but it doesn't make the buttons do anything. Instead you could read the values after they are set by DJI's own application, add button listeners, and do some stuff when button state changes.
As far as I know, the values used by DJI's application are not documented anywhere. So you'd have to find out their meaning one by one. And then implement the functionality one by one...
Here is an example (for Android) for implementing button listeners: https://github.com/dji-sdk/Mobile-SDK-Android/issues/286

RxSwift - Class property's binding

I have an question about binding:
I have an array of objects of my custom class: Array. Every object can be updated (change his properties value) in bg.
Also I have separated Controller, which take and store one object from list as variable and can update it (object still the same, so in list it will be updated too)
Is there any way to bind all object.property -> UILabels on Controller in way, when property changes automatically call label update?
Of course, there are multiple ways how to do it, but from your description I would use some kind of subject (because u said there will be changes in background so you will probably need hot observable )....For example Variable or PublishSubject. So you can crate
let myArrayStream: Variable<[MyObject]> = Variable([])
you can pass this variable as dependency to wherever you want, on one side you can subscribe to it, on the other side you can update it's value.

How do you get the value of a data attribute within an event-based rule in Adobe Dynamic Tag Manager (DTM)?

I have an event-based rule configured to fire on click of an element with a specific class. On click, I would like to capture the value of a data attribute that exists. The DTM documentation says you can capture attribute values using this syntax:
%this.data-event%
or
%this.id%
Example HTML:
On click of links with the class "test", I would like to store the value of "event name" within an eVar. When I used the above syntax however, the syntax is converted to a string and in the Adobe server call as:
v25:%this.data-event%
What is the best way to dynamically grab the value of an attribute of an HTML element on click within DTM?
DTM documentation says you can do that, but in practice I too have found that it doesn't seem to work as advertised most of the time, and will instead populate it with a literal (un-eval'd) string like that.
So what I do instead is under Conditions > Rule Conditions I create a Custom condition. In the Custom condition, I add the following:
// example to get id
_satellite.setVar('this_id',this.id);
// example to get href
_satellite.setVar('this_href',this.href);
return true;
Basically I create on-the-fly data elements using javascript, and then return true (so the condition doesn't affect the rule from triggering).
Then I use %this_id%, %this_href%, etc. syntax from the data element I created, in the Adobe Analytics section variable fields.
The easist way to capture the values of a data attribute against an eVar or prop on the element clicked using DTM is to set the input as the following:
%this.getAttribute(data-attributename)%
For example, if there was a data attribute on an element of data-social-share-destination='facebook' simply input %this.getAttribute(data-social-share-destination)%. This will then capture the value of 'facebook'
More detail on data attributes can be found at http://www.digitalbalance.com.au/our-blog/event-based-tracking-using-html5-custom-data-attributes/
I found a solution. The best way to grab the value of an attribute on click is to use this syntax:
%this.getAttribute(data-title)%
The key is to not use quotes around the attribute name AND ensure the attribute has a value.
If the attribute is missing, the expression is not replaced by an empty string as one would normally expect from experience in other platforms, but instead will display the raw un-interpolated code.

How to update value in angular ui typeahead directive if no matching option is found

I've an array of objects containing title and salary which is used in typeahead directive.
I display department name and get entire object as value.
If none of the options match, I want user entered string to be converted to object still. Is there any way to update that?
This answer is pretty late, but I would just use ng-blur (to trap the end of the users input) along with a variable bound to typeahead-no-results. Then test if the variable is true in the method bound to ng-blur, and, if so, make an object out of the String supplied by the user and push it to your data source. Simple example found here.

what is the inverse of set?

I was trying to jump around documents on line, and i see the set function for when i do set("myString", "hello"); or set("myMap.test", "world"); but i was curious as to what the inverse is? I figured unset but when looking online at the Properties sections of Polymer 1.0 Dart code, i wasnt quite getting the information I wanted.
What is the inverse of set, to remove an attribute? My particular use case is to remove a key from a map, unset("myMap.testKey");
Since set is defined in Polymer_base.dart, i thought it would rest somewhere within that file, but i did not see any "unset" or similar.
I don't know if it works but I would remove the element from the map and then call
notifyPath('myMap.testKey, null);
If the values was null already then this probably won't work.

Resources