cross-platform

Get Desktop directory OS-independent

元气小坏坏 提交于 2019-12-07 13:04:39
问题 Of course I could use File desktop = new File(System.getProperty("user.home") + "/Desktop")); but this would only work OS-independent if the OS is set to English locale... On Windows the Desktop is named Desktop in every language it was translated to, but e.g. on Ubuntu the Desktop name gets translated (On my German system it's Arbeitsfläche ). So I'm looking for an OS- and Locale-independent way of getting a File object representing the desktop directory. 来源: https://stackoverflow.com

Simple C++ cross-platform way to execute an external program

走远了吗. 提交于 2019-12-07 11:00:43
问题 What is a simple, elegant, and effective cross-platform way to execute an external program in C++ and get the return code from it? int execute(std::string const &path, std::vector<std::string> const &arguments = {}) { //... } Since we're waiting for the called program to finish before continuing execution, the called program should use our program's input/output/error streams. If, for any number of reasons, path isn't executable, just throw an exception (e.g. std::invalid_argument ).

Compiling C Program on OS X to Run on Linux

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 09:55:18
问题 I have a pretty simple C program that does some cryptographic calculations using only standard library functions. I will be running the program on Ubuntu (10.04, 32 bit) and compiled it on OS X 10.6 using cc with the -m32 flag. When I tried to run it on Ubuntu I got the error message "cannot execute binary file." When I compile it on Ubuntu it runs fine. Is there any easy way to compile code on OS X into a binary that will run on Ubuntu? If not, what are the differences that cause the binary

Set up a development environment on Linux targeting Linux and Windows

…衆ロ難τιáo~ 提交于 2019-12-07 09:31:01
问题 For a university course I have to write a http server which is supposed to run on both Linux and Windows. I have got a humble Linux machine which I don't think can handle any kind of heavy virtual environment, neither I'm willing to go through the hassle of installing it. This is the first project of mine complex enough (I estimate ~1.5 months to develop) to require an environment sufficiently comfortable to alternate rapidly between short coding and testing sessions (the latter on both

Which Java library to use for record a video from a connected camera?

家住魔仙堡 提交于 2019-12-07 08:29:03
问题 You would have thought that tere is a simple solution to this but there isn't :( My application needs to capture a stream from a USB/firewire (or whatever is the connection) connected camera (result would be a file like output.flv ). I would prefer that I can detect all connected cameras and choose which one to use (one or more at the same time --> one or more output files). Application has to be cross platform. Found libraries: Xuggle - not very good camera support. Good for manipulating

Pickle cross platform __dict__ attribute error

自古美人都是妖i 提交于 2019-12-07 08:00:49
问题 I'm having an issue with pickle. Things work fine between OSX and Linux, but not Windows and Linux. All pickled strings are stored in memory and sent via an SSL socket. To be 100% clear I have replaced all '\n's with ":::" and all '\r's with "===" (there were none). Scenario: Client-Win: Small Business Server 2011 running Python 2.7 Client-Lin: Fedora Linux running Python 2.7 Server: Fedora Linux running Python 2.7 Client-Lin sends a pickled object to Server: ccopy_reg:::_reconstructor:::p0::

How do start with complex level cross-platform mobile application development? [closed]

为君一笑 提交于 2019-12-07 07:51:28
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . Is there any document to develop cross-platform mobile application. I have try to go with phonegap but I couldn't find any

How to get environment variables in C in a cross platform way

依然范特西╮ 提交于 2019-12-07 04:23:19
问题 I'm using the following code in OSX and in Windows Vista: #include <stdio.h> #include <string.h> extern char **environ; int main(int argc, char **argv) { int i; for (i = 0; environ[i] != NULL; i++) { printf("var = %s - %d\n", environ[i], (int)strlen(environ[i])); } return 0; } On OSX compile it with cc , on Windows - with 'cl' from Windows SDK 7.1 (with Redistributable Packages: Microsoft Visual C++ 2010 in it). I define the same ENV variables in both OS in Russian language: MY_ENV='russian

Emoji Support for iOS and Android

南楼画角 提交于 2019-12-07 04:16:56
问题 I am trying to develop an application for both iOS and Android with emoji support in posts. Currently I am Base64 encoding and decoding the String (text &/ emoji) with UTF-8. It seems to work natively, Android-to-Android and iOS-to-iOS, but from Android -> iOS or iOS -> Android it doesn't always work. There are occasionally a few emojis missing, and the rest of the string (any actual text) is lost in these instances. Note: I understand different devices have different emojis, so I am not as

Roll 64-bit and 32-bit versions of an app into the same binary?

喜你入骨 提交于 2019-12-07 04:13:51
问题 We have an application we're trying to deploy on both 64 bit and 32 bit platforms. Is there a way to put both compiled versions of the code in the same binary, a la Apple and NeXT's fat binaries? Ideally we could ship one .exe that decides upon execution which version of the code to execute. We're targeting Windows XP and later. 回答1: One approach is perhaps to supply a bootstrapping application that determines the architecture and chooses the appropriate executable to run. So basically the