platform-independent

Why can an executable run on both Intel and AMD processors?

丶灬走出姿态 提交于 2020-08-18 05:15:33
问题 How is it that an executable can work on both AMD and Intel systems. Aren't AMD's and Intel's instruction sets different? How does the executable work on both? How exactly do they compile the files to work like that. And what exactly is the role of the OS in all this? 回答1: Essentially these days, compilation is done for the OS not for hardware, as most hardware have universal protocols and/or tech, as mentioned above, x86 or x64 machine code/opcodes/instruction sets, some programmers do make

Why can an executable run on both Intel and AMD processors?

余生颓废 提交于 2020-08-18 05:14:18
问题 How is it that an executable can work on both AMD and Intel systems. Aren't AMD's and Intel's instruction sets different? How does the executable work on both? How exactly do they compile the files to work like that. And what exactly is the role of the OS in all this? 回答1: Essentially these days, compilation is done for the OS not for hardware, as most hardware have universal protocols and/or tech, as mentioned above, x86 or x64 machine code/opcodes/instruction sets, some programmers do make

Portable printing of exponent of a double to C++ iostreams

让人想犯罪 __ 提交于 2020-06-24 07:19:11
问题 I want to print a double value to std::cout portably (GCC, clang, MSVC++) such that the output is the same on all platforms. I have a problem with the formatting of the exponent. The following program #include <iostream> int main() { std::cout << 0.1e-7 << std::endl; return 0; } Has this output with GCC: 1e-08 and the following output with MSVC 1e-008 How can I make both outputs the same? I'm sorry if this is a dumb question but I have not found an answer so far. All formatting seems to

Word and Double Word integers in C

可紊 提交于 2020-01-24 23:26:29
问题 I am trying to implement a simple, moderately efficient bignum library in C. I would like to store digits using the full register size of the system it's compiled on (presumably 32 or 64-bit ints). My understanding is that I can accomplish this using intptr_t. Is this correct? Is there a more semantically appropriate type, i.e. something like intword_t? I also know that with GCC I can easily do overflow detection on a 32-bit machine by upcasting both arguments to 64-bit ints, which will

Access the serial port in a platform-independant way [closed]

两盒软妹~` 提交于 2020-01-22 13:10:07
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I have a task to create a program, that control a device over RS-232 from a desktop station. Currently I am at the planning stage and need some general help selecting a language and overall approach to the

Capitalization and NoClassDefFoundError vs ClassNotFoundException

自闭症网瘾萝莉.ら 提交于 2020-01-02 05:04:29
问题 I'm seeing differences across platforms about when Class.forName() throws ClassNotFoundException and when it throws NoClassDefFoundError. Is this behavior well-defined somewhere, or have I stumbled across a bug? Consider the following code (which is a standalone java file in the default package): public class DLExceptionType { private static void printFindError(String name) { System.out.print(name + ": "); try { Class.forName(name); System.out.println("** no error **"); } catch (Throwable e)

OS-independent API to monitor file system?

ぐ巨炮叔叔 提交于 2020-01-01 05:11:07
问题 I would like to experiment with ideas about distributed file synchronization/replication. To make it efficient when the user is working, I would like to implement some kind of daemon to monitor changes in some directory (e.g. /home/user/dirToBeMonitored or c:\docs and setts\user\dirToBeMonitored). So, I could be able to know which filename was added/changed/deleted at every time (or within a reasonable interval). Is this possible with any high-medium level language?. Do you know some API (and

Is PhysicsFS platform-independent?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 04:56:06
问题 I'm thinking about using PhysicsFS in my game engine project, but I'd like to first make sure it's entirely platform-independent. That's because I'd like to port my engine to some rather obscure platforms after I'm done with the Windows code (Wii Homebrew, for example). 回答1: In accordance with the official specs the developers provide on their site it: Compiles/runs on GNU/Linux (x86, PPC, MIPS, Sparc, Alpha, Itanium, and x86-64 tested; gcc). Compiles/runs on Windows, Win95 and later (x86

How to figure out the cpu usage of a java-process in java

烈酒焚心 提交于 2019-12-11 16:52:33
问题 i've been searching the web for a possibility in java to figure out, how much cpu my application needs but sadly couldn't find a solution. Most of the people referred to "OperatingSystemMXBean" which works on platforms like linux, but not on windows. My application will run on multiple os but mostly on windows. So is there any way to figure out the cpu usage of a java-application in the same runtime which is platform independend or supports multiple platforms including windows, mac and linux?

Platform independent languages [closed]

喜夏-厌秋 提交于 2019-12-09 18:20:38
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I was searching a bit for another platform independent language like Java. Are there other P.I. languages? Thanks 回答1: Platform independent isn't a perfectly well defined term. It can mean different things to different people. For example, some people have said that C is PI, others would say it isn't. Sometimes,