portability

Protocol buffers and UTF-8

The history of Encoding Schemes / multiple Operating Systems and Endian-nes have led to a mess in terms of encoding all forms of string data (--i.e., all alphabets); for this reason protocol buffers only deals with ASCII or UTF-8 in its string types, and I can't see any polymorphic overloads that accept the C++ wstring. The question then...

Does 64-bit floating point numbers behave identically on all modern PCs?

I would like to know whether i can assume that same operations on same 64-bit floating point numbers gives exactly the same results on any modern PC and in most common programming languages? (C++, Java, C#, etc.). We can assume, that we are operating on numbers and result is also a number (no NaNs, INFs and so on). I know there are two ...

Which language offers the most portability in terms of tabbing a webpage menu?

This may be a subjective question, I am new here so keep that in mind... I have searched and searched and been unable to determine what the best way is the do a tabbed menu for a webpage. The webserver is Unix based, so anything .NET is out of the question. It seems that AJAX/javascript is the 'nicest' way to go, but I've heard there ...

Does SQLite have a machine portable file format that the C API can read/write?

I've tried passing binary SQLite DBs over the network between different OSes and architectures - it didn't work. What format are you all using? I've tried an unholy hack of copying SQLite's shell.c and calling shell_main() with a hacked up argc, argv, stdin with success on Mac. Pity I'm developing for the iPhone and it fails only there....

Is assembler portable between Linux distros?

Is a program shipped in assembler format portable between Linux distributions (modulo CPU architecture differences)? Here's the background to my question: I'm working on a new programming language (named Aklo), whose modus operandi will be the classic compiling to .s and feeding the result to the GNU assembler. Obviously it would be ni...

How to create dynamic UI?

Recently, I got a application to build for various mobile phones. Basically the Windows Mobile 6.x phones. After thinking a little a bit about the application I stuck at one place. How one can build a portable application that work with different resolution and different screen size phones. So that UI is visible correctly on all the phon...

Static library API question (std::string vs. char*)

I have not worked with static libraries before, but now I need to. Scenario: I am writing a console app in Unix. I freely use std::string everywhere because it's easy to do so. However, I recently found out that I have to support it in Windows and a third party application would need API's to my code (I will not be sharing source, just...

Porting JDK1.5 ThreadLocal code to JDK1.4

I have below piece code which runs on JDK5 private static ThreadLocal<String> messages = new ThreadLocal<String>(); private static ThreadLocal<Boolean> dontIntercept = new ThreadLocal<Boolean>() { @Override protected Boolean initialValue() { return Boolean.FALSE; } }; I wish to run it on JDK1.4. Please advice w...

How to convert an integer to a string portably?

Hi, 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 programmin...

How do I detect if I'm running MATLAB or Octave?

I need to write code that should run equally well in Octave and on MATLAB. Problem is that it needs to do some GUI stuff, which MATLAB and Octave handle completely differently. Is there a way I can detect if I'm running MATLAB or Octave, in order to call the right function? ...

WPF: The Icon property in the Window is crashing the application in Windows XP SP2.

Suppose I have this: <Window stuff Icon="Resources\myicon.ico"> If I run the program on Windows 7, it's fine. If I run it on Windows XP SP2, it crashes. Removing the Icon property, it works fine on Windows XP, but then it doesn't have my myicon on the Windows 7 taskbar or on the Window. Also, setting the application icon on the VS pro...

Points to be considered for writing code which is portable to both 32 and 64 bit architectures

What are the points that should be kept in mind while writing code that should be portable on both 32 bit and 64 bit machines? Thinking more on this, I feel if you can add your experience interms of issues faced, that would help. Adding further on this, I once faced a problem due to a missing prototype for a function which was returnin...

How similar/different are gnu make, microsoft nmake and posix standard make?

How similar/different are gnu make, microsoft nmake and posix standard make? Obviously there's things like "which OS?", "which compiler?" and "which linker?", but I'm referring specifically to the syntax, semantics and command-line options of the makefiles themselves. If I write makefiles based on manuals for gnu make, what are the mos...

Is a single wxWidgets MSW application binary compatible across Win2K, XP, Vista, and 7?

wxWdgets is a cross-platform library that includes support for all the major windows versions, but I can't find anywhere in the wxWidgets documentation that says anything about the portability of a single MSW (windows) build of the wxWidgets library across different windows versions. Assuming my core app just uses vanilla C++ (and perh...

Approved syntax for raw pointer manipulation

I am making a memory block copy routine and need to deal with blocks of raw memory in efficient chunks. My question is not about the specialized copy routine I'm making, but in how to correctly examine raw pointer alignment in C. I have a raw pointer of memory, let's say it's already cast as a non-null char *. In my architecture, I can ...

Writing a portable C program - which things to consider?

For a project at university I need to extend an existing C application, which shall in the end run on a wide variety of commercial and non-commercial unix systems (FreeBSD, Solaris, AIX, etc.). Which things do I have to consider when I want to write a C program which is most portable? ...

Getting a pointer to a 4-byte object.. in an implementation independent way

I was programming normally when I realized that its probably not perfectly safe to assume an int is going to be a pointer to something 4 bytes in length. Because Some of the aspects of C++’s fundamental types, such as the size of an int, are implementation- defined.. What if you're dealing with something (like a waveform, for example) ...

converting database formats (mysql, ms access, ms excel, IBM DB2)

We need to a good tool that we can run from a script to automatically convert a (mysql, ms access or DB2) database to a (mysql, ms access, ms excel or DB2) database, while preserving the data types as much as possible (text, int, decimal, time...). Do you know of such a tool? I am looking for a solution, such as IBM Data Movement T...

Portable c++ atomic swap (Windows - GNU/Linux - MacOSX)

Hi, Is there free a portable (Windows, GNU/Linux & MacOSX) library providing a lock-free atomic swap function? If not, how would it be implemented for each of these platforms? (x86 with VC++ or g++) Thanks ...

Is System.Data.SqlTypes portable?

Can I use the structures in System.Data.SqlTypes with the Oracle db driver? MSDN says: The System.Data.SqlTypes namespace provides classes for native data types in SQL Server. Is that it? End of line? I would really like to use these types but not if they tightly couple my code to a SQL Server. ...