portability

Does Darwin/MacOS modify Bash?

前提是你 提交于 2019-12-01 18:45:17
I'm wondering about the portability of Bash scripts that use Bash built-in commands. I understand that each flavor of UNIX tends to modify various UNIX utilities. But do they tend to leave Bash and Bash built-ins alone? What about MacOS in particular? As far as I know, bash is unmodified on Mac OS X (aside from minor tweaks required to make it compile; you can review the source on http://opensource.apple.com/ ), and scripts should be quite portable. As Graham Lee & Gordon Davisson point out, Mac OS X ships with older versions and there are differences between supported versions. Bash 4 has

Does Darwin/MacOS modify Bash?

非 Y 不嫁゛ 提交于 2019-12-01 18:44:39
问题 I'm wondering about the portability of Bash scripts that use Bash built-in commands. I understand that each flavor of UNIX tends to modify various UNIX utilities. But do they tend to leave Bash and Bash built-ins alone? What about MacOS in particular? 回答1: As far as I know, bash is unmodified on Mac OS X (aside from minor tweaks required to make it compile; you can review the source on http://opensource.apple.com/), and scripts should be quite portable. As Graham Lee & Gordon Davisson point

multi platform portable python

旧街凉风 提交于 2019-12-01 18:19:35
I want to install python on a flash drive in a virtual environment so that I can develop code wherever I am. Is this possible to do in such a way that I can use my flash drive on windows/mac/linux computers? For windows, head to Portable Python ( http://PortablePython.com ) to see various options you have, For linux and Mac you don't need to install it on USB drive as those systems usually come with Python pre-installed. If you need specific packages for those systems, bring them on USB together with a command line script that can load them with one call in virtualenv on those systems and you

multi platform portable python

好久不见. 提交于 2019-12-01 17:24:45
问题 I want to install python on a flash drive in a virtual environment so that I can develop code wherever I am. Is this possible to do in such a way that I can use my flash drive on windows/mac/linux computers? 回答1: For windows, head to Portable Python (http://PortablePython.com) to see various options you have, For linux and Mac you don't need to install it on USB drive as those systems usually come with Python pre-installed. If you need specific packages for those systems, bring them on USB

How to convert an integer to a string portably?

谁都会走 提交于 2019-12-01 17:22:25
I was looking for a way to convert an integer to a string in a portable manner (portable among at least Windows & Linux and x86 and x86_64) and I though itoa(X) to be standard just like atoi(1) . But I read the following in the Wikipedia entry: The itoa function is a widespread non-standard extension to the standard C programming language. It cannot be portably used, as it is not defined in any of the C language standards; however, compilers often provide it through the header while in non-conforming mode, because it is a logical counterpart to the standard library function atoi. So I'd like

making proprietary ELF binaries portable on Linux

久未见 提交于 2019-12-01 16:59:10
I am searching for a way to make existing proprietary ELF-binaries, which are linked against specific versions of system libraries, portable. With portable I mean making the executable work on every system with the same processor architecture and a compatible system kernel, without necessarily having the source code of the libraries (if there is no way without having the source code, it'll be fine too). So far I thought of two possibilities, but I don't know if they are at all possible and if yes, which to choose: Searching all linked libraries and their dependencies and include them in a

How to convert an integer to a string portably?

落花浮王杯 提交于 2019-12-01 16:49:39
问题 I was looking for a way to convert an integer to a string in a portable manner (portable among at least Windows & Linux and x86 and x86_64) and I though itoa(X) to be standard just like atoi(1) . But I read the following in the Wikipedia entry: The itoa function is a widespread non-standard extension to the standard C programming language. It cannot be portably used, as it is not defined in any of the C language standards; however, compilers often provide it through the header while in non

How to handle evolving c++ std:: namespace? e.g.: std::tr1::shared_ptr vs. std::shared_ptr vs. boost::shared_ptr vs. boost::tr1::shared_ptr

旧街凉风 提交于 2019-12-01 16:48:03
For the code I am currently working on, we sometimes need to compile on some older systems with older compilers (e.g.- we run sims on an older IBM BlueGene/L, who's support contract dictates some quite old C++ compiler). The code itself makes use of shared_ptrs, and was originally written to use std::tr1::shared_ptr. When compiling on the old BlueGene machine, I quickly realized that it doesn't have a tr1:: implementation, and so I switched to boost::shared_ptr. Turns out there is also a boost::tr1::shared_ptr. Now that the code is being used more widely outside of our research group,

itoa function problem

痴心易碎 提交于 2019-12-01 16:35:34
I'm working on Eclipse inside Ubuntu environment on my C++ project. I use the itoa function (which works perfectly on Visual Studio) and the compiler complains that itoa is undeclared. I included <stdio.h> , <stdlib.h> , <iostream> which doesn't help. www.cplusplus.com says: This function is not defined in ANSI-C and is not part of C++, but is supported by some compilers. Therefore, I'd strongly suggest that you don't use it. However, you can achieve this quite straightforwardly using stringstream as follows: stringstream ss; ss << myInt; string myString = ss.str(); itoa() is not part of any

How to portably parse the (Unicode) degree symbol with regular expressions?

流过昼夜 提交于 2019-12-01 15:08:01
I'm writing a simple regular expression parser for the output of the sensors utility on Ubuntu. Here's an example of a line of text I'm parsing: temp1: +31.0°C (crit = +107.0°C) And here's the regex I'm using to match that (in Python): temp_re = re.compile(r'(temp1:)\s+(\+|-)(\d+\.\d+)\W\WC\s+' r'\(crit\s+=\s+(\+|-)(\d+\.\d+)\W\WC\).*') This code works as expected and matches the example text I've given above. The only bits I'm really interested in are the numbers, so this bit: (\+|-)(\d+\.\d+)\W\WC which starts by matching the + or - sign and ends by matching the °C . My question is, why does