cross-platform

conversion from unsigned char* to const wchar_t*

拥有回忆 提交于 2019-12-25 01:53:25
问题 I am using the following code to convert a string from unsigned char* to const wchar_t* . The error I am getting is that only a few words are being converted properly while the rest is garbled value. CODE unsigned char* temp = fileUtils->getFileData("levels.json", "r", &size); const char* temp1 = reinterpret_cast<const char*>(temp); size_t len = mbstowcs(nullptr, &temp1[0], 0); if (len == -1) { } else { wchar_t* levelData = new wchar_t(); mbstowcs(&levelData[0], &temp1[0], size*10); } OUTPUT

Change link destination based on whether user has mac or PC

橙三吉。 提交于 2019-12-25 00:37:54
问题 Is it possible to change the destination of a link based on whether the user has a mac or a PC using javascript? To give an example: The Apple website allows download of Quicktime but it "knows" whether you are using a mac or a pc and directs you to the relevant page. Background/Reason for doing this: I have built a website for someone and they have a number of audio and video files on there. Ideally they want it so that if the user is on a mac it will download a quicktime version of the file

c++ 2d plotting tool for linux

倾然丶 夕夏残阳落幕 提交于 2019-12-25 00:29:39
问题 I am looking for a simple c++ 2d plotting tool for Linux (to be more honest "Cross-platform"). "koolplot" is nice but I think it's for windows only since its code includes graphics.h and windows.h. Someone suggested Qt's QPainter, but I cannot even use it to draw a single point. :'( So, if there is any help on other plotting tool or a decent tutorial on Qt's QPainter, I would be very grateful. Thanks. 回答1: Check out Qwt. It's worked well for all of my 2D applications, plus it's cross-platform

Managing conda env in cross platform environment

自作多情 提交于 2019-12-24 21:35:24
问题 My project supposed to run on cross platform environment (Mac, Win, Linux). I've created a conda env that manage our dependencies for an easy setup. I want to ensure that everyone that want to update the enn could do that, however when I try to export the env from linux to yml file, it couldnt be install properly on Win or Mac and vise versa. I've already tried to do the regular stuff: 1. conda env export > env.yml conda env create --name -f env.yml 2. conda env export --no-builds > env.yml 3

SwipeView detect on release event QML - QT

元气小坏坏 提交于 2019-12-24 20:29:24
问题 I need to detect when the user release the finger from the screen. I'm doing an application with SwipeView, but when the finger remove from the screen I need to detect the minimum slide also. There is a method for this ? Or maybe if I detect when the finger leave the screen on the ApplicatioWindow. Thanks. 回答1: In the very beginning of my QML learning I had a similar problem: I wanted to detect mouse events without interfering with the rest of the application. It might not be the right

Delaying for milliseconds in C++ cross-platform

↘锁芯ラ 提交于 2019-12-24 16:25:46
问题 I'm writing a multi-platform internal library in C++ that will eventually run on Windows, Linux, MacOS, and an ARM platform, and need a way to sleep for milliseconds at a time. I have an accurate method for doing this on the ARM platform, but I'm not sure how to do this on the other platforms. Is there a way to sleep with millisecond resolution on most platforms or do I have to special-case things for each platform? 回答1: For Linux and Mac OS X you can use usleep : usleep(350 * 1000); For

ObjectIDGenerator implementation

陌路散爱 提交于 2019-12-24 15:19:59
问题 I was attempting to use ObjectIDGenerator in C# to generate a unique ID during serialization, however, this class is not available in the XBox360 or Windows Phone 7 .NET frameworks (they use a compact version of .NET). I implemented a version using a dictionary of Object to Int64 and was able to get a fully working version up, however, the performance is unsatisfactory. I'm serializing on the order of tens of thousands of objects, and currently this is the greatest bottleneck in save/load

what are the disadvantages of using a cross-platform framework to develop for one platform?

╄→尐↘猪︶ㄣ 提交于 2019-12-24 15:18:46
问题 Lately I've been contemplating whether I should start studying another framework since I only have a windows machine and I don't intend to make cross-platform software anytime soon. So to help me with that decision... Is there any disadvantage to using a cross-platform framework when I don't intend to develop cross-platform? Intuitively I would say that a framework specialized for a certain platform would perform better in said platform than a cross-platform framework. But I am just assuming

How to open the default browser from Eclipse user space on any platform?

有些话、适合烂在心里 提交于 2019-12-24 13:13:33
问题 I want to select a term a term in the editor and pass it to an external URL using the default browser. I found a few helpful hints on SO, especially this recipe for invoking IE from an external tool. But I would like to open the default browser, not necessarily IE, and not necessarily in Windows. I answered the question below with a Windows-specific recipe, but given that there are several recipes for launching the browser from the Java API, I figured there is also an user-visible variable

Visual Studio - X11: The DISPLAY environment variable is missing

允我心安 提交于 2019-12-24 12:35:06
问题 I'm developing a cross-plataform (Windows / Linux) x64 GUI application, using Visual Studio 2019 Enterprise. In this 2019 edition we can use Visual Studio to debug both plataforms (Windows - Native) and Linux - Ubuntu (Running in a Virtual Machine). You can see it here: https://devblogs.microsoft.com/cppblog/using-visual-studio-for-cross-platform-c-development-targeting-windows-and-linux/ So, I followed this tutorial and I got this GUI example application running and debugging in my Ubuntu 18