portability

Big List Of Portability in Python

I thought it would be a good idea to compile a list of things to watch out for when making a Python app portable. There are a lot of subtle 'gotchas' in portability that are only discovered through experience and thorough testing; there needs to be some sort of list addressing the more common ones. Please post one gotcha (with its fix) ...

Running Mercurial on a Flash Drive?

So I do a lot of work on a school computer. We can't install anything but we have most of our tools on our flash drives but I was wondering if there's a way to get Command Prompt to use Mercurial off of my Flash Drive. Let's say in theory that Mercurial's files were on my flash drive, where would I go from there? ...

x64 compatible C source

I think I know what #ifdefs I need to use to be x86-32 and x86-64 compatible on both msvc and gcc, see below. Is this complete for those platforms? #if defined(_MSC_VER) # if defined(_M_IA64) || defined(_M_X64) # define SIZEOF_SIZE_T 8 # define SIZEOF_VOIDP 8 # elif defined(_M_IX86) # define SIZEOF_SIZE_T 4 # define SIZEO...

Recommendations: asynchronous, portable file io in c++

Hi all, Title says it all. I'm looking for a C++, async io library that should be compatible with both unix and windows systems. What are some good libraries? Is this asking too much for a library that does both systems? What are peoples' experiences with this matter? ...

DB Agnostic ASP.Net?

Hello, we are making an ASP.Net application. We would like to have our application to be at least sorta DB agnostic, most notable to be compatible with both SQL Server and PostgreSQL. What is the best way of doing this? What are some of the common pitfalls? Also is there a class or something that already abstracts away the difference bet...

How to design a C / C++ library to be usable in many client languages?

I'm planning to code a library that should be usable by a large number of people in on a wide spectrum of platforms. What do I have to consider to design it right? To make this questions more specific, there are four "subquestions" at the end. Choice of language Considering all the known requirements and details, I concluded that a lib...

file required for ffmpeg portability

I'm making a python GUI app and using ffmpeg to encode files. I'm bundling ffmpeg with it, so I'm wondering what do I need to make it portable. Would it work with just the ffmpeg binary in my /opt/local/bin folder? ...

What's a portable way of converting Byte-Order of strings in C

I am trying to write server that will communicate with any standard client that can make socket connections (e.g. telnet client) It started out as an echo server, which of course did not need to worry about network byte ordering. I am familiar with ntohs, ntohl, htons, htonl functions. These would be great by themselves if I were trans...

Posixy way to launch browser?

Is there a 'Posixy' way to open an URL, preferrably in the default browser? I would like to do something like ShellExecute(0, _T("open"), url, 0, 0, SW_SHOWDEFAULT); that works on GNU/Linux and MAC. I read some answer saying that` if (fork() == 0) system("sensible-browser http://wherever.com"); does the trick on Debian systems ...

Will .NET be portable some day?

Not only Compact Framework. I know about Mono, but it will always be one step behind .NET. ...

Why is it important for C / C++ Code to be compilable on different compilers?

I'm interested in different aspects of portability (as you can see when browsing my other questions), so I read a lot about it. Quite often, I read/hear that Code should be written in a way that makes it compilable on different compilers. Without any real life experience with gcc / g++, it seems to me that it supports every major platf...

How should I handle "cast from ‘void*’ to ‘int’ loses precision" when compiling 32-bit code on 64-bit machine?

I have a package that compiles and works fine on a 32-bit machine. I am now trying to get it to compile on a 64-bit machine and find the following error- error: cast from ‘void*’ to ‘int’ loses precision Is there a compiler flag to suppress these errors? or do I have to manually edit these files to avoid these casts? ...

How can I creating executable JAR with SWT that runs on all platforms?

SWT comes with a base JAR and one specific JAR per platform (Windows, Linux/32bit, Linux/64bit, Mac, AIX, ...). How can I create an executable JAR that will select the correct platform JAR at runtime? [EDIT] I was thinking to supply all platform JARs in a subdirectory and in main() would then modify the class loader. Has anyone already ...

How to run the equivilant of PHP and MySQL on portable media (eg CD, USB and/or iPhone)

I use a local installation of Apache, MySQL, and PHP with XAMPP which require a bit of configuration and installation - is there an alternative language or database system that can be used on portable media such as a CD or DVD-Rom? Although this question is similar to apache-php-and-mysql-portable - I'm looking more for the best portable...

Portably determining whether string is castable to integer

I'd like to cast a VARCHAR to a SQL INTEGER, supplying a default value if some value in the field would not convert properly. Something like: sql> SELECT str FROM tbl; -- CREATE TABLE tbl (str VARCHAR(12), ...) str ======== 12345 -1 foo sql> SELECT CAST((CASE WHEN ... THEN str ELSE '-9999' END) AS INTEGER) AS "int" FRO...

In C++, is it safe/portable to use static member function pointer for C API callbacks?

In C++, is it safe/portable to use static member function pointer for C API callbacks? Is the ABI of a static member function the same as a C function? ...

PHP - Shorter Magic Quotes Solution

I'm writing a app that needs to be portable. I know I should disable magic quotes on the PHP configuration but in this case I don't know if I can do that, so I'm using the following code: if (get_magic_quotes_gpc() === 1) { $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST); while (list($key, $val) = each($process)) {...

STL containers element destruction order

Does ISO C++ standard mandate any sort of destruction order of objects inside STL containers? Are std::list/std::vector/std::map elements destroyed starting from the beginning or the end of the container? Can I rely on std::map storing its elements in std::pairs internally so a key in a pair is destroyed before its value (or vice versa...

A "try" shell script

So, the idea is to have a script that tries to run a command, and if the command fails it shows up any warnings/errors. My try: $ cat try.sh #! /bin/sh tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/temp$$ trap 'rm -f $tempfile >/dev/null 2>&1' 0 trap 'exit 2' 1 2 3 15 echo "$@" if ! "$@" >$tempfile 2>&1; then cat $tempfile; fa...

Can .Net Application be converted into a Portable App i.e. single .exe

Can a .Net application be converted into a single .exe portable application? i.e. no installer, it just runs? I imagine all the dll's, resources etc need embedding into the exe? If so, how would I do this? Thanks ...