Can I generate UUID in C++11? - c++11

Is there any build-in facility that allows to generate UUID in C++11 without using any adidtional libraries?

Reposted from comment:
Built-in facility, no. But if you use a third party library (as opposed to OS functionality), I strongly recommend Boost.UUID.

I know this is an old thread, but another option is Poco's UUIDGenerator.
auto uuid_str = Poco::UUIDGenerator().createRandom().toString();

Related

Is there a way to call c code from a substrate project?

It's trivial to call c from rust normally, is there a way to do so from a substrate project? I can't find anything online saying it's possible or it's not possible.
I have a c library I'd like to use as part of a substrate project and I was wondering if it would be possible to use it without rewriting it.
Many FFI libraries are no_std compliant, this is the only hard requirement for being used in substrate runtimes. Checkout the list here and look for that tag for options to move forward:
https://lib.rs/development-tools/ffi
If you are using this library outside the runtime, you should be able to use any rust library.

Use ShGetFolderPath in Delphi, which unit should I include?

I try to use ShGetFolderPath in Delphi XE3. Since it is an Windows API, I search the Delphi source codes and find both Winapi.ShFolder.pas and WinApi.Shlobj.pas have its definition. I try to include ShFolder or ShlObj, both are OK. So which unit should I include for using ShGetFolderPath? Or can I just use any?
SHGetFolderPath is deprecated and is supported only for backward compatibility.
For new system and new application you can use SHGetKnownFolderPath instead.
About which header to include you can refer to document of that API and check the requirements part.

How can I create a common library for Xamarin?

my question is easy, I think. In my solution, I used to create different projects, for example, one for data logic (layer), business logic, etc.
Now, I have to create a library not only for my projects but also an SDK for third parties. I'm not sure if I create a PCL library, my third parties can use it in shared projects. In this library, I have to call HttpClient and I should use Refit and Polly.
I read on Xamarin Help that Portable Class are obsolete. Really?
Any advice? Thank you in advance.
PCL were superseded by SCL (.Net Standard) projects.
You can upgrade your existing projects, as described here
For the new projects, just use .Net Standard

Can I use RxJava2 and RxAndroid in a single java class library?

I'm tasked with creating an SDK that can be consumed from both Android & Java applications using ReactiveX programming. I already have an android project using RxAndroid created, but now I need to extend it with RxJava2.
The question I'm facing is whether I should create 'regular' java class library and use it for both scenarios or create 2 separate packages (which would mean a lot of duplicate code + maintenance).
Is this even possible? And if so, is it a good practice?
whether I should create 'regular' java class library and use it for both scenarios
Yes. What I would do to start is simply change your Android library project to be a standard Java library and replace RxAndroid dependency by RxJava. Most code should still compile. Code which doesn't will mostly use schedulers provided by RxAndroid and can be changed to take Scheduler parameters.
Then create an Android Library project which depends on the Java Library and put the RxAndroid-specific code there.
As an addition to #AlexeyRomanov's answer, feel free to check out this library which could be used for both Android and Java projects: https://github.com/JakeWharton/RxRelay.
Its basically an extension to RxJava, but it might give you a solid idea where to go. Good luck!

ILASM for Compact Framework?

I'm working with Linq expression trees (from the db4o/Mainsoft/Mono port) on the Compact Framework. Since System.Reflection.Emit doesn't exist, I can't compile my LambdaExpressions into delegates, which I want to do for performance reasons.
I thought maybe I could transform my expression tree into IL and basically provide the missing Emit functionality that way, but then I realized that I'd have to either run a WinCE-based ILASM on it or write my own PE headers and assmebly metadata.
I'd much rather have ILASM available. Is it?
Apparently, I can compile Mono.Cecil for use under the Compact Framework, which will allow me to emit and load assemblies.
If you want use a Lambda-Expressions on CF you don't need ILASM or System.Reflection.Emit. The C# compiler for CF supports Lamba-Expressions but the CF base libraries does not have the Expressions classes. If you add reference to assembly with correct named (and correct implemented) classes for expressions, you enable Lambda-Expressions.
Thanks for god, there are this assembly already implemented ( http://evain.net/blog/articles/2008/09/22/linq-expression-trees-on-the-compact-framework ) - I use it with Db4O data access and for SqlCE wit LINQ IQueryableToolkit, and it works well.

Resources