Which UUID library to use [closed] - linux

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I'm writing a GUI application using GNOME technologies, and I need to define UUIDs for resources in RDF files.
I'm writing in C++ but I don't mind using a C library and wrap it in my own C++ wrapper. I also prefer to use existing common libraries than add dependencies on 3rd party libraries.
I found two libraries which seem to be standard, libuuid (which comes with the Linux kernel as part of util-linux) and the OSSP uuid library, which has a C++ binding.
No program on my system uses OSSP uuid library, but my whole desktop depends on the libuuid package, probably because the kernel itself depends on it.
The question is, which one should I use? Is there a difference or I can just choose randomly? I don't know why there are different implementations, but I'd like to choose one and stick with it.

If you are on Linux anyway, probably your best option is using libuuid. I mean, everyone is using it and it's a really nice library.
You'll have to depend on the chosen library and, most likely, libuuid will be already present on your user's system. You noted that no program on your system uses OSSP, the same is true for all my systems. So why bother and use some …let's call it third party library… when you already have a popular library used by everyone else and known to work very well (I don't mean that OSSP works worse, it's also quite good)?
I'm not aware of any reason to prefer OSSP uuid over libuuid.
Well, I should probably note that you can simply read UUIDs from /proc/sys/kernel/random/uuid but that's not as much fun as using a C library, right?.

go for libuuid, it has wider use, and it's easier to have feedback and to find docs in case of problems.

Related

What exactly does it mean for a programming language to be simple? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
What factors are important? How do you know if a given programming language is "simple" or "simpler" than another language?
I'm not sure if this is a fair question to ask, since different languages serve different purposes and it might not really be comparing apples to apples.
However, with that said, memory management would come to mind. One can argue that Java is a "simpler" language than C++, since it has a garbage collector that can deal with some of the complexities around memory management, instead of forcing you to do it yourself.
In my perspective, these are the points that define the complexity of a language.
Variation of syntax from common pseudocode and constructs
Ease of developing a structure for real-life entities like objects
Methods of structure enforcement at compile time.
Memory management strategy allocation/deallocation
Code reusability
Ease of code headers and directives management
Inbuilt libraries
Relative installation package sizes
Data exchange capabilities like over network of files
Process handling like thread management
Relative brevity of the code
Speed of compilation
Developer community size and documentation
OpenSource implementations
Platform dependence
And many more could be added to this list.

Reason for using 4-spaces instead of 2-spaces? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
Is there any rationale why HapiJS endorses using 4-space indentations?
Source: http://hapijs.com/styleguide
Short answer: No better reason than anyone else - styleguides are typically only rules for project maintainers. They had to adopt some convention and that was the choice. As a user, you don't really need to care.
Long answer: Hapi is a great framework, built by the folks at Walmart. and specifically a person named Eran Hammer who was unhappy about some architectural choices made by Express, another server framework for Node. It is somewhat opinionated in general, it was effectively created in an environment of opinion, not to mention a large company (which means it desperately needed a convention). That said, you can safely use the Hapi API with any indentation you want, including tabs, though. Likewise, the Hapi internals could have been written the same way. Their specific choice likely comes down to established tools or conventions already in use at the company. Many different projects make different choices for a variety of reasons. In my experience, many large JavaScript applications go with 2 spaces and the Node.js core itself is written with 2. But there's nothing wrong with those that do otherwise.

Should I use libc++ or libstdc++? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I am developing command line interface executables for both osx and linux using c/c++. The project will link against opencv. Should I use libc++ or libstdc++?
I would use the native library for each OS i.e. libstdc++ on GNU/Linux and libc++ on Mac OS X.
libc++ is not 100% complete on GNU/Linux, and there's no real advantage to using it when libstdc++ is more complete. Also, if you want to link to any other libraries written in C++ they will almost certainly have been built with libstdc++ so you'll need to link with that too to use them.
More info here about the completeness of libc++ on various platforms.
Major Linux distributions do not provide LLVM libc++, because:
Unlike Apple and FreeBSD, the GPL+3 is not an issue, so no need to
implement another stack here.
Linux components have been developed around GNU libstd++ for ages. Some of them
do not build on anything else.
While libc++ is strong in new features, it has some problems with legacy code.
If eventually libc++ became part of distributions, it will be as an optional component. linking against it will probably require extra options.
Like Jonathan said, you should use whatever tool is included by default. Clang is safe in Linux to use since is configured as a GCC replacement, so in that aspect you don't have to worry about 2 compilers. Also since you are targeting two platforms, you should take a look to cmake.

Giving R under Linux access to a DLL [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have an R script which was developed in Windows, and which requires a particular DLL to be in the path because it uses some functions contained therein (via the dyn.load function).
Is it possible to make the script work under Linux? Perhaps using wine?
Assuming you have the source code of the non R code, I think your best bet will be to compile the code under Linux, e.g. Using a gcc compiler, create the shared library (.so file) and load it into R. If you put your code (R code and the other source code) in an R package you could integrate the R code and other source code so that they can be installed in one go, where the source is compiled on the fly.
The fact that you don't have the source code makes things quite a bit more complex. This SO post:
Using Windows DLL from Linux
Suggests to me that what you want is not trivial. One option would be to run the dll in a windows virtual machine. You then communicate using e.g. Tcp/ip to the dll running on your machine. So depending on how far you are willing to go, this might be a solution. The answers to the post above also suggest wine will not provide a satisfactory solution, but the post is quite old so wine might be improved in the meantime.

Which distro to use for learning linux(job perspective)? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Which distro to use for learning linux(from job perspective). Which distro is used by most software companies? I was wondering about whether to go for RHEL or Ubuntu or any other. What would be the best choice?
I really don't think it matters nearly as much as how comfortable you are with a Linux environment and the tools available (and knowing about the tools available, and how to use them).
I have been using Unix/Linux since the early 1990s, and I still come across stuff I didn't know about. One of the major strengths of this OS is the wide range of tools available and the flexibility of accomplishing tasks by sometimes combining them.
Once you are comfortable in a Linux environment, the adjustment to a given distribution will be minor. You'd probably notice changing your default shell more than changing the distribution :)
As long as you are comfortable with major linux utilities like find/grep/sed/awk and bash in general, you should be fine.However most major distributions are based on either RPM or debs, knowing about these two packaging mechanisms will be a big help. Concepts like firewalls, RAID
and file permissions are needed on daily basis being system admin related work.

Resources