Top "Portability" questions

Portable code can be run with little to no modification in multiple environments.

Change the current working directory in C++

How can I change my current working directory in C++ in a platform-agnostic way? I found the direct.h header …

c++ header portability working-directory
c++ Initializing a struct with an array as a member

Edited again because it originally wasn't clear that I'm trying to initialize the arrays at compile time, not at run …

c++ struct initialization portability
Django: 'current_tags' is not a valid tag library

I have a small Django project I received from a friend. The code works perfectly on his system. However, on …

python django portability
Converting Little Endian to Big Endian

All, I have been practicing coding problems online. Currently I am working on a problem statement Problems where we need …

java portability
Portable way of setting std::thread priority in C++11

What is the correct way in the post C++11 world for setting the priority of an instance of std::thread …

c++ c++11 portability stdthread thread-priority
How do I type a floating point infinity literal in python

How do I type a floating point infinity literal in python? I have heard inf = float('inf') is non portable. …

python floating-point portability numerical
Why does glibc's strlen need to be so complicated to run quickly?

I was looking through the strlen code here and I was wondering if the optimizations used in the code are …

c optimization glibc portability strlen
Building a 32-bit float out of its 4 composite bytes

I'm trying to build a 32-bit float out of its 4 composite bytes. Is there a better (or more portable) way …

c++ floating-point endianness portability single-precision
Proper shebang for Python script

I'm usually using the following shebang declaration in my Python scripts: #!/usr/bin/python Recently, I've came across this shebang …

python portability shebang