portability

Reproducibility of python pseudo-random numbers across systems and versions?

喜你入骨 提交于 2019-12-01 15:05:34
I need to generate a controlled sequence of pseudo-random numbers, given an initial parameter. For that I'm using the standard python random generator, seeded by this parameter. I'd like to make sure that I will generate the same sequence across systems (Operating system, but also Python version). In summary: Does python ensure the reproducibility / portability of it's pseudo-random number generator across implementation and versions ? No, it doesn't. There's no such promise in the random module's documentation . What the docs do contain is this remark: Changed in version 2.3: MersenneTwister

Reproducibility of python pseudo-random numbers across systems and versions?

我们两清 提交于 2019-12-01 13:56:53
问题 I need to generate a controlled sequence of pseudo-random numbers, given an initial parameter. For that I'm using the standard python random generator, seeded by this parameter. I'd like to make sure that I will generate the same sequence across systems (Operating system, but also Python version). In summary: Does python ensure the reproducibility / portability of it's pseudo-random number generator across implementation and versions ? 回答1: No, it doesn't. There's no such promise in the

Portable makefile creation of directories

馋奶兔 提交于 2019-12-01 10:26:58
I'm looking to save myself some effort further down the line by making a fairly generic makefile that will put together relatively simple C++ projects for me with minimal modifications required to the makefile. So far I've got it so it will use all .cpp files in the same directory and specified child directories, place all these within a matching structure in a obj subdir and place the resulting file in another subdir called bin . Pretty much what I want. However, trying to get it so that the required obj and bin directories is created if they don't exist is providing awkward to get working

Is assembler portable between Linux distros?

♀尐吖头ヾ 提交于 2019-12-01 08:38:07
Is a program shipped in assembler format portable between Linux distributions (modulo CPU architecture differences)? Here's the background to my question: I'm working on a new programming language (named Aklo), whose modus operandi will be the classic compiling to .s and feeding the result to the GNU assembler. Obviously it would be nice ultimately to have the implementation written in itself, but I had resigned myself to maintaining it in C++ to solve the chicken and egg problem: suppose you download the compiler for the first time and it is itself written in Aklo, how do you compile it? As I

How can I portably turn on large file support?

落花浮王杯 提交于 2019-12-01 07:50:03
问题 I am currently writing a C program that reads and writes files that might be over 2 GiB in size. On linux feature_test_macros (7) specifies: _LARGEFILE64_SOURCE Expose definitions for the alternative API specified by the LFS (Large File Summit) as a "tran‐ sitional extension" to the Single UNIX Specification. (See ⟨http://opengroup.org/platform /lfs.html⟩) The alternative API consists of a set of new objects (i.e., functions and types) whose names are suffixed with "64" (e.g., off64_t versus

Portable makefile creation of directories

醉酒当歌 提交于 2019-12-01 07:09:19
问题 I'm looking to save myself some effort further down the line by making a fairly generic makefile that will put together relatively simple C++ projects for me with minimal modifications required to the makefile. So far I've got it so it will use all .cpp files in the same directory and specified child directories, place all these within a matching structure in a obj subdir and place the resulting file in another subdir called bin . Pretty much what I want. However, trying to get it so that the

Mac and Windows compatible GUI for Python, which is easy to install and works with pygame?

狂风中的少年 提交于 2019-12-01 06:55:56
I have made a program that finds and measures the radius of yeast colonies in images. It uses pygame for pixel access and graphical display of the images. The next step is to make it "user friendly" so that the non-programmers in my university bio lab can use it. Pygame lacks scroll bars, text fields, "open file" dialogues, etc., which I will need. I have heard that it's a nightmare trying to mix pygame and Tkinter. What can I use? An additional requirement is that I want the set up of Python and all necessary modules to be easy to do on Windows and Mac, which is why I'm not using something

Is assembler portable between Linux distros?

∥☆過路亽.° 提交于 2019-12-01 06:29:23
问题 Is a program shipped in assembler format portable between Linux distributions (modulo CPU architecture differences)? Here's the background to my question: I'm working on a new programming language (named Aklo), whose modus operandi will be the classic compiling to .s and feeding the result to the GNU assembler. Obviously it would be nice ultimately to have the implementation written in itself, but I had resigned myself to maintaining it in C++ to solve the chicken and egg problem: suppose you

C++ writing and reading doubles from a binary file

旧时模样 提交于 2019-12-01 05:47:15
问题 I want to perform disk I/O operations for a program that takes too much RAM. I use matrices of doubles and think writing them to disk as bytes is the fastest way (I need to preserve the double precision). How to do it with portability? I found this code (here) but the author says it's not portable... #include <iostream> #include <fstream> int main() { using namespace std; ofstream ofs( "atest.txt", ios::binary ); if ( ofs ) { double pi = 3.14; ofs.write( reinterpret_cast<char*>( &pi ), sizeof

What is meant when a piece of code is said to be portable? [closed]

时光怂恿深爱的人放手 提交于 2019-12-01 05:19:30
I have seen in many documentations that a piece of code is portable . Can anyone explain to me exactly what it means to call a piece of code portable? Portable code is code that is not tightly coupled to one specific platform, or which is coupled as loosely as possible to platform-specific APIs. It is "portable" in that the amount of work required to move it from one platform to another is low. Portable code is desirable when you intend to write code meant to be used by a large audience, on a wide variety of platforms. Portability is primarily a concern in compiled languages, as interpreted