multiplatform

How to redirect stdout and stderr streams (Multiplatform)?

旧城冷巷雨未停 提交于 2019-12-02 04:15:39
问题 I'm writing GL application that uses external libs, which print errors to the console. I want to catch that and print in the in-game console. PS: Sorry, for my bad english.... 回答1: There are two basic approaches you could take to this: If the libraries all use std::cout for the IO you want to capture you can write your own basic_streambuf. You can then just call std::cout.rdbuf(mybufinst); to replace the streambuffer, for example using the std::basic_stringbuf : #include <sstream> #include

How can I determine in R what platform I'm running on? [duplicate]

落花浮王杯 提交于 2019-12-02 01:31:54
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: R: determine if a script is running in Windows or Linux How can an R script determine what platform it's running on? I'm using R 2.10.1, sometimes on Windows, sometimes on Linux. I would prefer a built-in function over filesystem taxonomy. I've already searched the index of the base package for anything with "os" or "platform" in the description — no dice there, alas. 回答1: Alternatives to R.version()$os are

How can I determine in R what platform I'm running on? [duplicate]

强颜欢笑 提交于 2019-12-01 20:44:46
Possible Duplicate: R: determine if a script is running in Windows or Linux How can an R script determine what platform it's running on? I'm using R 2.10.1, sometimes on Windows, sometimes on Linux. I would prefer a built-in function over filesystem taxonomy. I've already searched the index of the base package for anything with "os" or "platform" in the description — no dice there, alas. Alternatives to R.version()$os are .Platform$OS.type and R.Version()$platform . See ?.Platform for further info. Note that Sys.info() is not implemented on all platforms, but does give the key information on

Multiplatform Installer

a 夏天 提交于 2019-12-01 06:04:42
I am looking for a recommendation on an installer program. The installer needs to support mulitple OS's - Solaris, Linux and Windows. I have three build machines each running one of the OS's. Currently using the same code base - JAVA and C/C++ for all three. IzPack is a an open source software installer generator. All you need is a JRE on the target platform. InstallAnywhere seems to be the dominant player. Maybe is my personal opinion but I think that the installer is probably the only thing that you may want to keep platform specific and here is why: it is good to integrate with platform

Java: Open a file (Windows + Mac) [duplicate]

做~自己de王妃 提交于 2019-11-30 15:28:04
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: How to launch the default (native) application for a given file from Java? I have a java application that opens a file. This works perfect on windows, but not on mac. The problem here is that I use the windows configuration to open it. The code is: Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + file); Now my question is what is the code to open it in mac? Or is there another way to open a

cross-platform scripting for windows, Linux, MacOS X [closed]

耗尽温柔 提交于 2019-11-29 19:32:27
I'm looking for cross-platform scripting (language) for windows, Linux, MacOS X. I'm tired of .bat / bash . I would like to do things like for example ,,lock workstation'' at automatic login (I had this in X-Window but the solution was pretty ugly; now, I would like that on MS Windows and not that ugly :-) ). Generally: automate tasks. Or would I be better off with Windows Scripting Host? PowerShell also comes to mind, but that's seems to Windows-only for my taste. Can languages like Python, Ruby, (Java?) interact (elegantly? sensibly?) with WSH? Also things like DBUS, DCOM, etc come to mind

C++: execute a while loop until a key is pressed e.g. Esc?

大憨熊 提交于 2019-11-29 14:27:39
问题 Does anyone have a snippet of code that doesn't use windows.h to check for a key press within a while loop. Basically this code but without having to use windows.h to do it. I want to use it on Linux and Windows. #include <windows.h> #include <iostream> int main() { bool exit = false; while(exit == false) { if (GetAsyncKeyState(VK_ESCAPE)) { exit = true; } std::cout<<"press esc to exit! "<<std::endl; } std::cout<<"exited: "<<std::endl; return 0; } 回答1: Your best bet is to create a custom

cross-platform scripting for windows, Linux, MacOS X [closed]

a 夏天 提交于 2019-11-28 15:06:48
问题 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 3 years ago . I'm looking for cross-platform scripting (language) for windows, Linux, MacOS X. I'm tired of .bat / bash . I would like to do things like for example ,,lock workstation'' at automatic login (I had this in X-Window but the solution was pretty ugly; now, I would like that on MS Windows and not that ugly :-) ).

How would a Python script running on Linux call a routine in a Python script running under Wine?

隐身守侯 提交于 2019-11-28 09:43:30
问题 I have a Python (3) script running on Linux, referred to as the main script, which has to call a routine from a proprietary DLL. So far, I have solved this with Wine using the following construct: # Main script running on Linux import subprocess # [...] subprocess.Popen('echo "python dll_call.py %s" | wine cmd &' % options, shell = True) # [...] The script dll_call.py is executed by a Windows Python (3) interpreter installed under Wine. It dumps the return values into a file which is then

How to make installer of java desktop application for multi-platform?

有些话、适合烂在心里 提交于 2019-11-28 07:01:24
How could we made a jar file's installer, which can run on multi-platform. Is there any simple way, because I don't know Java much well. Balwant Jonik Installer tools for Java have been dealt with in quite many questions on SO, and most options have probably been mentioned already: What’s the best way to distribute Java applications? Java Application Installers What is the best installation tool for java? See also other questions tagged java+installer . If a commercial tool is ok, the best multi-platform installer for Java software, to my knowledge, is install4j ; I can definitely recommend it