How can DJICameraLaserMeasureInformation of Zenmuse H20/H20T be used in iOS? - dji-sdk

How can I obtain a DJICameraLaserMeasureInformation value in my app code?

Found it: there's a DJILensDelegate method (in DJILens.h):
- (void)lens:(DJILens *_Nonnull)lens
didUpdateLaserMeasureInformation:(DJICameraLaserMeasureInformation *)information;

Related

property overrideSelector does not exist on type Store<state> ngrx/store#8.2

I am adding a test that needs to return a different mock value for a selector. So I found a nice way of doing it using overrideSelecor as mentioned here https://ngrx.io/guide/store/testing. But when adding mockstore.overrideSelector, got this error "property overrideSelector does not exist on type Store". Has anyone fixed this before?
In Angular 7 the mockStore does not have that function indeed. Migrating to Angular 8 will fix your issue.
This is most likely just typings issue. If you use provideMockStore it in fact creates an instance of MockStore that is provided as Store instance on DI so it won't break you apps functionality.
So in your tests you should use it like this:
let store: MockStore<State>;
...
store = TestBed.get<Store<State>>(Store);
...
store.overrideSelector(...);

Dynamic Path is not working in require react native

Below is the code
require("index/components/" + name); //fails
require("index/components/myComponent"); //work fine
any good solution ?
Dynamic paths in require are not currently supported.
Please check this answer
This is covered in the documentation under the section "Static Resources":
The only allowed way to refer to an image in the bundle is to literally write require('name-of-the-asset') in the source.
You can use a switch statement to implement this.
I'm not sure about it but you can try to write it in ES6
require(`index/components/${name}`);

iOS 8 Photos framework: Get file name from PHAsset

Is there any way to get the file name from PHAsset object in iOS 8, same as like ALAsset's defaultRepresentation provides the file name?
// For ALAsset
let defaultRepresentation = self.asset.defaultRepresentation()
let filename = defaultRepresentation.filename()
NOTE: This can be done in iOS9 using PHAssetResource class. But I am looking for iOS8 and documented way of doing this(No undocumented APIs Please).
I did find the same question on SO but did not find the convincing answers, so I thought of asking it separately.
Any pointers would be greatly appreciated.
There have a private API called PHAsset.filename.
let filename = phAsset.value(forKey: "filename") as! String
You will get something like "IMG_193.PNG".
There is no documented way to do this on iOS 8.
The only thing you "might" use is the PHImageFileURLKey returned in the info Dictionary of the method requestImageDataForAsset: of PHImageManager. But even this is not fully documented.

ICDevice not ready

I'm trying to write a simple Cocoa App to scan some documents from my USB-scanner. I use it the same way as this example of apple: https://developer.apple.com/library/mac/samplecode/ScannerBrowser/Listings/AppController_m.html
The 'deviceBrowser:didAddDevice...' method is called. There I set the scanners delegate to self (like in the example), but the methods 'deviceDidBecomeReady' or 'scannerDeviceDidBecomeAvailable' are never called.
Is there anything I have forgotten?
Here is the code:
http://pastebin.com/NHZ0j5ze
Oh... reading the .h-files of the frameworks should still be the first option. The order was wrong and I forgot didOpenSessionWithError.
Here is the working code:
http://pastebin.com/NDEY5S13

Firefox (Gecko) code - interrogating the cache - how do I get a list of devices?

Referring to nsICacheService (https://developer.mozilla.org/en/NsICacheService) and nsICacheVisitor (https://developer.mozilla.org/en/nsICacheVisitor):
Where do I get an instance of nsICacheVisitor?
Where do I get a list of devices so that I can call visitEntry() and visitDevice()?
The nsICacheVisitor is an interface that you implement and pass to the visitEntries method on nsICacheService. See this test file for example code.

Resources