What are similar class for below objects in Harmony OS? - huawei-mobile-services

Please help me for similar classes for 1. AppBarLayout, 2.Interpolator(with setInterpolator method), 3. BitmapFactory.decodeResource(res, id), 4. SpannableString, 5. ReplacementSpan in HarmonyOS.

For Interpolator/setInterpolator try using Animator/AnimatorProperty setCurveType(curveType)
By default it is a linear interpolator but you can set other types as well. Please check -
https://developer.harmonyos.com/en/docs/documentation/doc-references/animatorproperty-0000001054439987#ZH-CN_TOPIC_0000001054439987__setCurveType-int-
For BitmapFactory.decodeResource(res, id) : you can use ImageSource and createPixelmap. Something like-

In addition to the BitMapFactory.decodeResource and ImageSource.createPixelmap method classes, No other class can find a similar type in Harmony OS by now.
For details about image decoding, see the following website development guide:
https://developer.harmonyos.com/en/docs/documentation/doc-guides/media-image-decoding-0000000000031770?ha_source=hms1

Related

Filter by method attribute in Doxygen

I am new to Doxygen but I want to use it for a technical documentation for our team.
The background: We have several services in .NET which are going to be called from a JAVA backend through RPC.
Therefore it is quite useful to have those services documented for the JAVA guys.
Using the Doxywizard did help in the first place, but it created a huge overflow of data, which I want to filter, but have no clue how to.
What I want to achieve is, that Doxygen ONLY will use methods, which does have a specific attribute.
For example:
[RpcMethod(id: "GetNumDemo", description: "A demo method")]
public async Task<int> GetNumDemo(JavaDTO dtoObject, int randNum)
I want to have the method within the documentation found by Doxygen since it has the RpcMethod attribute and also cause it have a JavaDTO object, I want to have this class documented as well.
But I am overwhelmed with it ... do you guys can help me? ... at least with a hint within the Doxygen documentation.
Read through the documentation and goodled

Most efficient way to change the value of a specific tag in a DICOM file using GDCM

I have a need to go through a set of DICOM files and modify certain tags to be current with the data maintained in the database of an external system. I am looking to use GDCM. I am new to GDCM. A search through stack overflow posts demonstrates that the anonymizer class can be used to change tag values.
Generating a simple CT DICOM image using GDCM
My question is if this is the best use of the GDCM API or if there is a better approach for changing the values of individual tags such as patient name or accession number. I am unfamiliar with all of the API options but have a link to the API documentation. It looks like the DataElement SetValue member could be used, but it doesn't appear that there is a valid constructor for doing this in the Value class. Any assistance would appreciated. This is my current approach:
Anonymizer anon = new Anonymizer();
anon.SetFile(myFile);
anon.Replace(new Tag(0x0010, 0x0010), "BUGS^BUNNY");
Quite late, but maybe it would be still useful. You have not mention if you write in C++ or C#, but I assume the latter, as you do not use pointers. Generally, your approach is correct (unless you use System.IO.File instead of gdcm.File). The value (second parameter of Replace function) has to be a plain string so no special constructor is needed. You should probably start with doxygen documentation of gdcm, and there is especially one complete example. It is in C++, but there should be no problems with translation.
There are two different ways to pad dicom tags:
Anonymizer
gdcm::Anonymizer anon;
anon.SetFile(file);
anon.Replace(gdcm::Tag(0x0002, 0x0013), "Implementation Version Name");
//Implementation Version Name
DatsElement
gdcm::Attribute<0x0018, 0x0088> ss;
ss.SetValue(10.0);
ds.Insert(ss.GetAsDataElement());

Create llvm metadata node with constantInt

While the language reference mention a lot about the LLVM Metadata,
and I see some posts on SO - How to add a Metadata String to an LLVM module with the C++ API?
I also see some code in the llvm source-
http://llvm.org/doxygen/DIBuilder_8cpp_source.html
However, they dont seem to mention how to create a MDNode containing a ConstantInt of a particular width.
Following is the relevant code (doesn't work ) -
std::vector<Metadata*> Elts =
{
ConstantInt::get(TheContext,APInt(returnType->getIntegerBitWidth(),decimal_val))
};
MDNode* Node = MDNode::get(TheContext, Elts);
callInst->setMetadata(LLVMContext::MD_range,Node);
Can anyone explain how this can be done ?
Thanks!
I have written this small post about how to insert metadata in LLVM IR. You can refer that. Basically you need to use ConstantAsMetadata to achieve this.
So apparently I checked the llvm class hierarchy and checked the sub-classes
under MetaData. I found a few classes and one of them was - ConstantAsMetadata
The change in the above code that works for me is -
std::vector<Metadata*> Elts = {
ConstantAsMetadata::get(ConstantInt::get(TheContext,APInt(returnType,0)) ),
ConstantAsMetadata::get(ConstantInt::get(TheContext,APInt(returnType,decimal_val)) )
};
Note- You should ( if you want correctness ) specify a pair of numbers for each range that you are trying to create.
If you are using the verifier pass provided by llvm , the above would not work/make sense if you just have a single ConstantInt inside the initializer.
This is because of an assert inside the Verifier pass provided by the llvm.

Swift 2.0 Core Spotlight API - search only for title

I'am testing the new Core Sportlight API feature in iOS 9. The indexing process works well but is there a way to define that the indexed Item should only get searched by the "title" Attribute instead of "title" and "description"?
Maybe you already have some more informations than me.
I have tried doing this using Objective C, and it works perfectly.
It depends on what implementation of "CSSearchableAttributeSet" is used.
In obj C, there are many implementations of CSSearchableAttributeSet like
CSSearchableItemAttributeSet_General
CSSearchableItemAttributeSet_Document
CSSearchableItemAttributeSet_Image
and others.
I have used CSSearchableItemAttributeSet_General in my code and I'm able to search by the title attribute only. In fact, that particular implementation of CSSearchableItemAttributeSet doesn't even have a "description" attribute.
So depending on what type of object you want to search for, you can use the particular implementation.
I believe it would be the same equivalent class in swift as well.
-Tejas

Warning: class implemented in both SDK

I am getting the following error when running my app:
objc[59714]: Class Message is implemented in both /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/PrivateFrameworks/MIME.framework/MIME and /Users/aditya15417/Library/Application Support/iPhone Simulator/4.3.2/Applications/4EFD7570-AD87-48E8-8606-1D5633F65AD9/CTest.app/CTest. One of the two will be used. Which one is undefined.
Why is this? How do I solve this?
Do you have a class named Message? Change its name, or stop using the MIME framework.
Objective-C doesn't have namespaces like C++ does, so name collisions are possible. This is why Apple prefixes most of its class and function names with two letters, like "NS..." and "CG...". I think the Cocoa coding guidelines recommend that you do the same (using your own prefix, of course).