Questions tagged [portability]
Portable code can be run with little to no modification in multiple environments. Portable applications can be run from e.g. a USB drive without modifying a computer's environment.
1,450
questions
0
votes
0
answers
14
views
Portable NPM + NodeJS: standalone JS bundler
There are many javascript sandboxes applications (the most popular runJS), that allows with no root-permissions run node server and a bundler.
Is it possible to make a similar thing?
Download Nodejs ...
-2
votes
0
answers
7
views
How to use "anaconda-navigator" in miniconda3(it install in usb flash drive)?
1:I install miniconda3 in my usb flash drive "D:\miniconda3"
2:How con I to use "anaconda-navigator" in miniconda3 and in my usb flash drive and run it OK ?
I try install it in my ...
0
votes
0
answers
41
views
I have a snake game that runs on c code and i want to see if there are ways to make it more accessable on different compilers
For a class project, my group made a snake game that runs on C code, but it uses libraries that aren't standard. Is there any way to make the game run on more platforms besides the one I'm using, ...
-3
votes
1
answer
124
views
How to run a portable Jar-File in Java 20 (OpenJDK 20)
I would like to run a portable jar-file created with OpenJDK 20 (i.e. without installation).
So far I have managed this with the OpenJDKJRE package for Java 14 from portableapps.com. But for the ...
0
votes
0
answers
30
views
Portable Visual Studio Code on mac not working
I want to create my portable Visual Studio on my USB key with MacOS. I followed the instruction from the official site:
On macOS, you need to place the data folder as a sibling of the application ...
0
votes
0
answers
19
views
Variable Python3_LINK_OPTIONS from cmake is empty
I am trying to use the variable Python3_LINK_OPTIONS from the FindPython3 module of cmake. However, on all my machines this is empty. I tried different OS (ubuntu, macos, windows) with different ...
2
votes
1
answer
130
views
Emulating a packed structure in portable C
I have the following structure:
typedef struct Octree {
uint64_t *data;
uint8_t alignas(8) alloc;
uint8_t dataalloc;
uint16_t size, datasize, node0;
// Node8 is a union type with ...
0
votes
0
answers
110
views
Run VSCode Portable v1.78 from mapped network drive in Windows 10
I would like to setup VSCode Portable to run from a mapped network drive on a Windows 10 VM with a roaming profile. A previous version 1.64 of VSCode works in this configuration, but not current ...
1
vote
1
answer
27
views
How are library dependencies managed in practice, in a self-contained/portable app?
I'm not an experienced programmer and I'm mostly self taught. I never really learned how to manage dependencies and I'm having some trouble finding the information I need, which I think it's pretty ...
0
votes
0
answers
89
views
How can I port GCC to a new Operating System?
I want to port Gcc to a new Operating System. Because I want to compile C++ code on the System. But I don't know how to start.
Should I just copy the source code of Gcc to the Operating System's and ...
0
votes
0
answers
13
views
Can the build folder created by "react-scripts build" be ported to another machine/OS without issues?
I'm working on a web app that will be deployed on a raspberry pi (Bullseye 5.15.32), but I can't usually access the raspberry pi itself to build the app.
So far I've been developing and building (...
0
votes
0
answers
71
views
How to prevent incorrect clang-tidy:readability-redundant-string-cstr detection? [duplicate]
Here is the typical (pseudo) code I wish to handle in clang-tidy (eg also here) for conveying an optionally null terminated fixed size buffer to std::string:
% cat str.cc
#include <iostream>
#...
0
votes
1
answer
83
views
AND + CMP or SHR + CMP?
I’m wondering what’ll result in overall “better” code (if speed’s equal then compactness): AND-and-CMP…
#define is_foo(someuint) ((someuint & (unsigned int)~0x7FU) == 0x001B0080U)
… or SHR-and-...
0
votes
0
answers
107
views
How can I open VS Code Portable directly from GitHub Desktop Portable?
I have VS Code running in portable mode. I've added VS Code to $PATH and can start from CMD with code.
In GitHub Desktop (Portable), I cannot open a repository directly as 'Open in Visual Studio Code' ...
2
votes
0
answers
104
views
unique_ptr in PImpl and ABI compatibility
Consider a standard class implementation that makes use of PImpl, but uses a std::unique_ptr to manage the implementation object's lifetime:
class MyClass {
public:
class Impl;
MyClass();
...
0
votes
0
answers
23
views
can I make my cloudnative project portable, I want to leave azure and shift into aws or google cloud
Technology stacks
Backend:
Event Store: Kafka
APIs Framework: web api (.net), Express JS
Language: C# , TypeScript
Container Orchestration: Docker Compose
API Gateway: Express Gateway
Database:
SQL ...
0
votes
0
answers
126
views
Unicode box drawing characters in a portable C program
I'm trying to use Unicode box drawing characters in a C program that is intended to be portable across a range of operating systems, C compilers and environments. Example:
#include <stdio.h>
#...
0
votes
0
answers
39
views
How does MPI_Comm_split_type know what processes on your computer can create shared memory?
I'm looking into the MPI one way communication, specifically shared memory. Before you allocate a section of memory to be shared between processors, you need to split them into groups which are able ...
1
vote
1
answer
103
views
It's possible to make a source code 32 or 64 bit only?
As my understanding, I can compile my C code into 32bit binary or 64bit easily, but, some open source projects sais "We don't support 32bit CPU", so why? what makes the code source 64bit ...
1
vote
2
answers
75
views
Are exact-width integers in Cython actually platform dependent?
In Cython one can use exact-width integral types by importing them from stdint, e.g.
from libc.stdint cimport int32_t
Looking through stdint.pxd, we see that int32_t is defined as
cdef extern from &...
0
votes
1
answer
390
views
How do I add my portable MinGW as a compiler in my portable VS Code?
I have a portable version of VS Code on a USB stick as well as a copy of MinGW. But when i try to run a c file on VS Code, the MinGW copy on the USB stick does not show up as an option when running (...
3
votes
1
answer
253
views
Portable way to write Python 3 shebang?
Back when Python3 was there, I used to use:
#!/usr/bin/env python3
But recently, especially with Ubuntu 22.04 or macOS, the python3 executable isn't always available in PATH, instead, I should use ...
0
votes
0
answers
51
views
Using a parser as a library
I am trying to turn my flex/bison code application into a portable library (hopefully). Searching on the web revealed the following example:
https://begriffs.com/posts/2021-11-28-practical-parsing....
1
vote
0
answers
305
views
using miktex portable INSTEAD of system wide installation with VSCode
I would like to create an USB-Stick you can put into any windows with VSCode, miktex (and perl) portable to work on my thesis with any win device.
VSCode and perl are working just fine and miktex ...
0
votes
1
answer
446
views
Python virtualenv with relative paths
I would like to install a python virtualenv with relative paths, so that I can move the virtualenv to another machine (that has the same operative systems).
I googled about a solution, some suggests ...
3
votes
1
answer
1k
views
what is the standard for password hash string encoding?
I'm asking about the format used after the password is hashed and preparing it for storage. The dollar sign $ annotation is something that seems to be widespread. Is that described in a standard ...
0
votes
1
answer
252
views
What guarantees does C provide about enum ordinal values
When I convert enum to integer type, what can I expect?
Does the first variant have value of 0?
Does the variant ordinal number increment by 1?
Assume that I did not explicitly provide the values.
...
6
votes
1
answer
140
views
Is checking the location of the sign bit enough to determine endianness of IEEE-754 float with respect to integer endianness?
I recently wrote some code that uses memcpy to unpack float/double to unsigned integers of the appropriate width, and then uses some bit-shifting to separate the sign bit from the combined significand/...
1
vote
2
answers
97
views
c++ portable address encoding
I'm writing a software that, at some point must write internal addresses into a buffer. I wrote the following code which works. But produce warnings when cross-compiling to a target device with an ...
3
votes
1
answer
215
views
Portable way of checking if *some* user exists in either Linux or Windows?
I need to check if a user exists in either Linux or Windows, using Python 3 (3.7 right now for reasons unrelated).
No, pwd doesn't work on Windows.
No, getpass only returns current username, while I ...
2
votes
3
answers
585
views
c++ 17 std::filesystem can not run on other (windows 10) computer
I have a program, compiled using MinGW on and for windows 10, I want this program to run on other peoples computers, even if they do not have MinGW or any c++ compilers installed.
Normally, this is ...
0
votes
1
answer
594
views
Portable way to check if subprocess exit code indicates a success?
I'm looking for a portable way to check whether a subprocess exited with an exit code indicating a success.
I found out that some systems don't follow the standard convention of 0 meaning "...
0
votes
0
answers
78
views
Portable method in C++ to determine special folder locations (Downloads, Documents, Preferences, etc.)
I've been searching for a portable method in Boost or C++17 std::filesystem (or POSIX) to determine the system sanctioned locations of the user's Documents, Downloads, and Preferences. Do these ...
0
votes
1
answer
1k
views
How to know if a .jar built on AMD64 will run flawlessly on ARM?
I built a .jar in docker on the ARM architecture and one on AMD64.
The two .jar files have the identical size, but vbindiff says their contents are quite different.
I tested both .jar files on my ...
0
votes
0
answers
130
views
How can I use a RN lib in Flutter?
I have a React Native library that needs to be used in a flutter project, is there a way for me to use it? (I have 0 skill in flutter)
Thanks in advance!
1
vote
2
answers
65
views
Reliably and portably store and retrieve objects of structure type in C
@bdonlan,in Copying structure in C with assignment instead of memcpy(), lists several reasons for using memcpy to copy objects of structure type. I have one more reason: I want to use the same area of ...
1
vote
1
answer
342
views
How to create a portable C/C++ program on linux using additional libraries?
I need to create a portable linux program that uses a lot of additional libraries defined from yum (CentOS).
It is forbidden to install new packages on portable machines. There are no necessary ...
-1
votes
1
answer
78
views
Migrating from big to little endian: How to predetermine problematic code?
I am about to migrate a small project of C code (30+ kSLOC) from a 32-bit big to a 32-bit little endian platform. I would like to check ante festum, how much work this will be, so I would like to ...
0
votes
2
answers
199
views
How can I make a binary that uses openmp and compiled with intel's C compiler portable?
Normally I compile code (all in a single file main.c) with the intel oneapi command prompt like so
icl.exe main.c -o binary_name
I can then run binary_name.exe without issue from a regular command ...
5
votes
1
answer
2k
views
What really is the "linger time" that can be set with SO_LINGER on sockets?
The man page explains little to nothing about that option and while there are tons of information available on the web and in answers on StackOverflow, I discovered that many of the information ...
0
votes
1
answer
334
views
Can machine code executables be transpiled to other operating systems and architectures? [closed]
My novice understanding of the different machine code / binary executables is that they are specific to the operating system and the architecture they have been compiled for. Nevertheless, it appears ...
-2
votes
1
answer
74
views
Library that includes undefined behavior function working on a certain compiler is portable? [closed]
If I compiled a library that includes an undefined behavior function guaranteed to work on a certain compiler, is it portable to other compilers?
I thought that the library has already generated ...
1
vote
1
answer
269
views
How to reference in settings a path to subdirectory within VSCode portable (relative to 'Code.exe')?
I'd appreciate your help.
According to VSCode Variables Reference, I was expecting something like this to work:
${execPath}\data_cadu
Nonetheless, ${execPath} didn't work.
How to set up path to ...
0
votes
1
answer
89
views
Why is there no function pointer conversion specifier to the printf() family functions?
Printing a function pointer can be done in a portable way in a Kernel but I am wondering why the userspace printf() family functions never got the functionality?Is the reason because it can't be done ...
1
vote
1
answer
144
views
Portable way to print function pointers?
I am wondering if this is a portable way to print function pointers.
Casting the function pointer directly to unsigned char * is non-portable.
/* writehex() prints the given byte as its hex ...
1
vote
1
answer
734
views
pynput and GlobalHotKeys not receiving any keyboard events
This code works on Windows 10 but not on Linux. Linux does not seem to receive any keyboard events at all. When interrupting the program on Linux with Ctrl-C, this is the stack trace:
File "/...
0
votes
1
answer
3k
views
Portable VS Code + portable Python
I am new to learning Python and VS Code. Tried to make portable python version from embeddable version. Deleted the python._pth file, and tried to install python get-pip.py. But nothing happens.
I did ...
0
votes
1
answer
2k
views
Portable VS Code + portable Node.js
I am new to learning Node.js and VS Code. I installed portable VS CODE. It works great with other installed programs. But can't set it up to work with portable Node.js
One of the ways I did it. ...
1
vote
2
answers
213
views
Does C99 (and later) 7.1.3 Reserved identifiers miss "external"?
C89, 4.1.2 Standard headers (emphasis added):
All external identifiers that begin with an underscore are reserved.
C99 (and later), 7.1.3 Reserved identifiers, 1 (emphasis added):
All identifiers ...
3
votes
0
answers
44
views
Is there a way to determine which Bash regexes are 'portable' across libc implementations?
I have just been bitten by unexpected regex behavioral differences between glibc and musl. Consider the script below:
#!/usr/bin/env bash
regex=" *([a-z ]+)+ [0-9]+"
line=" the answer ...