portability

How to use generics in a world of mixed Java versions?

I like generics a lot and use them whereever I can. Every now and then I need to use one of my classes in another project which has to run on an old JVM (before 5.0), needs to run on JavaME (where generics are not allowed neither) or in Microsoft J# (which has VERY poor Support for generics). At the moment, I remove all generics manuall...

Maximize SDL window

How should I tell SDL to maximize the application window? I'm creating the window with these flags: SDL_OPENGL | SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_RESIZABLE. Thanks for your replies ...

C#/Java portability

What mainstream frameworks, patterns, and tools would you choose to develop two projects in parallel, one in C#, one in Java, in order to minimize the total effort. (Disregard the obvious cases of interchangeable or equivalent tools, like SCC, Unit Testing, etc. Also assume generic broad RDBMS support.) "Mainstream" means the market in ...

is there a replacement for unistd.h for Windows (Visual C)?

I'm porting a relatively simple console program written for unix to the Windows platform. (VC++ 2005). All the source files include "unistd.h", which doesn't exist. Removing it, i get complaints about misssing prototypes for 'srandom', 'random', and 'getopt'. I know I can replace the random funcs, and I'm pretty sure I can find/hack-u...

How can I have a portable Emacs?

Is there a way run Emacs from a USB drive? I am a Windows user and I would like to be able use it on any PC without an Emacs install. ...

portable emacs? (emacs server not working)

I have seen a few suggestions on making emacs portable (on Windows). I have this in my site-start.el: (defvar program-dir (substring data-directory 0 -4)) (setq inhibit-startup-message t) (setenv "HOME" program-dir) I changed the HOME variable so that not only my .emacs init files (and other init files) are read, but everything gener...

Default file extension of the executable created by g++ under Cygwin vs Linux.

Hi All, I've done most of my work on VisualStudio and don't have much experience with gcc or g++. When I tried to compile a (ex. aprogram.cpp) this morning on my pc using cygwin, I got (aprogram.exe) when I tried to compile the same thing on my Ubuntu box I got (aprogram) w/o any extension. I am just wondering if someone be kind enough ...

How to measure time in milliseconds using ANSI C?

Using only ANSI C, is there any way to measure time with milliseconds precision or more? I was browsing time.h but I only found second precision functions. ...

How do I programmatically check memory use in a fairly portable way? (C/C++)

I'm writing cross platform C++ code (Windows, Mac). Is there a way to check how much memory is in use by the current process? A very contrived snippet to illustrate: unsigned long m0 = GetMemoryInUse(); char *p = new char[ random_number ]; unsigned long m1 = GetMemoryInUse(); printf( "%d bytes used\n", (m1-m0) ); Of course (m1-m0) sho...

What development tools do you carry on your USB drive?

I've just bought a new 4GB USB thumb drive and I'm trying to decide what to put on it. I'm thinking about one of the webserver on a stick packages, a C/C++ IDE (leaning toward Code::Blocks; had Dev-C++ on my old USB drive) and Python. What development related tools do you carry around with you on yours? Update I've added categories. ...

Component reuse between ASP.NET and C#.NET

This might seem like a ridiculous question since I'm quite inexperienced in .NET. Is it possible to build components in C#, using .NET, which can be reused in ASP.NET. For example if one would like to port an application onto the web. If possible, how portable are they? I.e. can GUI be reused in some extent? Is there an intermediate fo...

Non-Linux Implementations of boost::random_device

Currently, Boost only implements the random_device class for Linux (maybe *nix) systems. Does anyone know of existing implementations for other OS-es? Ideally, these implementations would be open-source. If none exist, how should I go about implementing a non-deterministic RNG for Windows as well as Mac OS X? Do API calls exist in ei...

Portable wchar_t in C++

Is there a portable wchar_t in C++? On Windows, its 2 bytes. On everything else is 4 bytes. I would like to use wstring in my application, but this will cause problems if I decide down the line to port it. ...

Should I make my own framework?

Should I make my own framework by wrapping up the STL classes and/or Boost libraries so that if I need to change the implementation of the string, vectors, lists, etc. or I need to write functions that MFC, other other libraries or even other platforms would need to use their format, I can easily mutate them to meet the criteria. this i...

Is PThread a good choice for multi-platorm C/C++ multi-threading program?

Been doing mostly Java and smattering of .NET for last five years and haven't written any significant C or C++ during that time. So have been away from that scene for a while. If I want to write a C or C++ program today that does some multi-threading and is source code portable across Windows, Mac OS X, and Linux/Unix - is PThread a goo...

Carrying and Working on an Entire Development Box from a USB Stick. Feasible ?

Lately I have been thinking about investing in a worthy USB pen drive (something along the lines of this), and install Operating Systems on Virtual Machines and start developing on them. What I have in mind is that I want to be able to carry my development boxes, being a Windows Distribution for .Net development and a Linux Distribution...

Good portable wiimote library with sound support?

Hi all. I'm lookin for a portable wiimote library. I want to use the wiimote for the hardware it has (but I don't need to access any data stored on it). Required features: access to all the buttons (as an exception, no use of the power button is OK) make the wiimote play sound talk to nunchuks and classic controllers preferably: mak...

Should I clone or denormalize my database for portable use?

I have a database that has lots of data and is all "neat", normalized (within reason - using EAV), and I have stored procedures to access and modify the data. I also have a WinForms application that users download to search and view this data (no inserts). To make things handy for use and updates, I've been using SQLite to store this da...

Portable Programming IDE

Frequently I'm brainstormed with programming ideas that I would like to directly code. More or less like "Wow, that algorithm will rock! I need to write it now!". For this kind of "impulse" to write, I use http://www.jarte.com/ that is a cool portable text editor. If I'm near a cybecafe or a friend computer, I just plug the usb pen driv...

What is the smallest possible Windows (PE) executable?

As a precursor to writing a compiler I'm trying to understand the Windows (32-bit) Portable Executable format. In particular I'd like to see an example of a bare-bones executable which does nothing except load correctly, run and exit. I've tried writing and compiling a simple C main function which does nothing but the resulting .exe is ...