portability

Graphviz portability and fonts. How make schemes identical on different OSs?

六月ゝ 毕业季﹏ 提交于 2019-12-13 00:10:00
问题 I'm working with Graphviz on Mac but most of my apps run on servers with Ubuntu. I've noticed that dot-schemes with the same source code are drawn a bit differently when compiled on different operating systems. It seems to me that the main reason is the difference between fonts on the systems. Even though I use the same generic fonts and same sizes — they appear too different which affects the layout a lot. So the question is: is it possible to make fonts look identical in Graphviz schemes

Portability between Unix shells - am I thinking about the issue correctly?

痴心易碎 提交于 2019-12-12 18:11:55
问题 Whenever I write shell scripts (mostly software development utilities or build tools) I've generally tried to avoid using bash in favor of using plain old sh for portability. However lately I've been running into more and more issues where useful features are not available, or behavior is actually less consistent across systems using sh then it is using bash, since sh is aliased to different shells... As I understand it, sh is the oldest Unix shell and carefully written sh scripts should in

How to parse a float, sent by a Bluetooth device, in Swift?

我与影子孤独终老i 提交于 2019-12-12 15:39:42
问题 On my iOS app I need to decode a Float value received by bluetooth and taking 4 bytes from a different device ( not iOS) so I need a "portable" 4-byte Float format . For now the sender is using this format: Data codification: 0xCCBBAAEE - 0xEE: Exponent, 1 signed byte. - 0xCCBBAA: Mantissa, 3 signed bytes. My question is: how can I construct an (ios) Float from such Exponent and the Mantissa? in iOS Float has this initializer: public init(sign: FloatingPointSign, exponent: Int, significand:

What are possible reasons for not mapping Win32 Portable Executable images at offset 0?

谁说胖子不能爱 提交于 2019-12-12 15:11:43
问题 I've been looking into Window's PE format lately and I have noticed that in most examples, people tend to set the ImageBase offset value in the optional header to something unreasonably high like 0x400000 . What could make it unfavorable not to map an image at offset 0x0 ? 回答1: First off, that's not a default of Windows or the PE file format, it is the default for the linker's /BASE option when you use it to link an EXE. The default for a DLL is 0x10000000. Selecting /BASE:0 would be bad

portable lightweight java orm framework for android [closed]

寵の児 提交于 2019-12-12 14:44:17
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I am developing a portable library on Java which will run on mobile device (android, blackberry) and I am looking for a lightweight

How can elusive 64-bit portability issues be detected?

十年热恋 提交于 2019-12-12 12:09:16
问题 I found a snippet similar to this in some (C++) code I'm preparing for a 64-bit port. int n; size_t pos, npos; /* ... initialization ... */ while((pos = find(ch, start)) != npos) { /* ... advance start position ... */ n++; // this will overflow if the loop iterates too many times } While I seriously doubt this would actually cause a problem in even memory-intensive applications, it's worth looking at from a theoretical standpoint because similar errors could surface that will cause problems.

numpy's tostring/fromstring — what do I need to specify to restore the array

寵の児 提交于 2019-12-12 10:51:14
问题 Given a raw binary representation of a numpy array, what is the complete set of metadata needed to unambiguously restore the array? For example, >>> np.fromstring( np.array([42]).tostring()) array([ 2.07507571e-322]) which is to be expected (with a hindsight, at least): here the I haven't told fromstring to expect ints, so it goes with the default float. But it seems to me that just specifying the dtype=np.float64 or similar may or may not be sufficient. For example, >>> a = np.array([42.]) >

What's the simplest way to write portable dynamically loadable libraries in C++?

天涯浪子 提交于 2019-12-12 08:48:12
问题 I'm working on a project which has multiple similar code paths which I'd like to separate from the main project into plugins. The project must remain cross-platform compatible, and all of the dynamic library loading APIs I've looked into are platform specific. What's the simplest way to create a dynamic library loading system which can be compiled and run on multiple operating systems without extra modification of the code? Ideally, I'd like to write one plugin, and have it work on all the

Portable C binary serialization primitives

一个人想着一个人 提交于 2019-12-12 07:49:37
问题 As far as I know, the C library provides no help in serializing numeric values into a non-text byte stream. Correct me if I'm wrong. The most standard tool in use is htonl et al from POSIX. These functions have shortcomings: There is no 64-bit support. There is no floating-point support. There are no versions for signed types. When deserializing, the unsigned-to-signed conversion relies on signed integral overflow which is UB. Their names do not state the size of the datatype. They depend on

Are IEEE float and double guaranteed to be the same size on any OS?

浪尽此生 提交于 2019-12-12 07:07:55
问题 I'm working on a OS portable database system. I want our database files to be OS portable so that customers can move their database files to other kinds of OS's at their discretion. Because of this use case I need my data types to be consistent across OS's, and I'm wondering if IEEE float's and double's are guaranteed to be the same byte size on any OS? 回答1: C++ says almost nothing about the representation of floating point types. [basic.fundamental]/8 says (Emphasis mine): There are three