platform

How can I set VM options in a Java Netbeans Platform Modular Project?

只愿长相守 提交于 2019-11-27 14:54:00
问题 I have a Netbeans Platform modular project, not a regular Java project. I want to set VM options to increase memory, but under the "properties" dialog, there is no way to do this for a modular Netbeans platform project. This has cost me huge amounts of time and I still have not found a good way to set the VM args. Does anyone know how to set VM args using a Netbeans platform modular project, when compiling and running the program in Netbeans 7? Given the amount of trouble, I am almost ready

Detect EOL type using PHP

故事扮演 提交于 2019-11-27 13:13:38
问题 Reference: This is a self-answered question. It was meant to share the knowledge, Q&A style. How do I detect the type of end of line character in PHP? PS: I've been writing this code from scratch for too long now, so I decided to share it on SO, plus, I'm sure someone will find ways for improvement. 回答1: /** * Detects the end-of-line character of a string. * @param string $str The string to check. * @param string $default Default EOL (if not detected). * @return string The detected EOL, or

Is there an platform independent equivalent of os.startfile()?

霸气de小男生 提交于 2019-11-27 11:14:32
问题 I want to run a program on several platforms (including Mac OS), so I try to keep it as platform independent as possible. I use Windows myself, and I have a line os.startfile(file) . That works for me, but not on other platforms (I read in the documentation, I haven't tested for myself). Is there an equivalent that works for all platforms? By the way, the file is a .wav file, but I want users to be able to use their standard media player, so they can pause/rewind the file. That's why I use os

AOSP repo sync takes too long

我与影子孤独终老i 提交于 2019-11-27 09:53:26
问题 I'm trying to learn Embedded Android from the book with the same name. And the author suggested working with AOSP gingerbread branch. So I followed to download the source: $ repo init -u https://android.googlesource.com/platform/manifest.git -b gingerbread $ repo sync But it's taking too long. Also from the output, it seems to me like it's also downloading source code from other branches (I see android-5.....) which is not what I want. I'm wondering if that's the reason why it takes so long.

How do I check if I'm running on Windows in Python? [duplicate]

霸气de小男生 提交于 2019-11-27 09:35:47
问题 This question already has answers here : What OS am I running on? (24 answers) Closed 5 years ago . I found the platform module but it says it returns 'Windows' and it's returning 'Microsoft' on my machine. I notice in another thread here on stackoverflow it returns 'Vista' sometimes. So, the question is, how do implemement? if isWindows(): ... In a forward compatible way? If I have to check for things like 'Vista' then it will break when the next version of windows comes out. Note: The

Java: platform's default charset on different platforms?

*爱你&永不变心* 提交于 2019-11-27 08:37:55
Some legacy code relies on the platform's default charset for translations. For Windows and Linux installations in the "western world" I know what that means. But thinking about Russian or Asian platforms I am totally unsure what their platform's default charset is (just UTF-16?). Therefore I would like to know what I would get when executing the following code line: System.out.println("Default Charset=" + Charset.defaultCharset()); Edit: I don't want to discuss the problems of charsets and their difference to unicode here. I just want to collect what operating systems will result in what

how do I detect user operating system

不羁的心 提交于 2019-11-27 07:07:21
I have the following code to obtain user details: HttpBrowserCapabilities bc = HttpContext.Current.Request.Browser; string UserAgent = HttpContext.Current.Request.UserAgent; ENT_TrackingData ret = new ENT_TrackingData() { IPAddress = HttpContext.Current.Request.UserHostAddress, Browser = bc.Browser + " " + bc.Version, DateStamp = DateTime.Now, PageViewed = HttpContext.Current.Request.Url.AbsolutePath, NodeId = UmbracoHelper.GetCurrentNodeID(), IsMobileDevice = IsMobileDevice(UserAgent), Platform = bc.Platform }; This works great but I noticed that the Platform always says windows NT for my

Flutter: How to call methods in Dart portion of the app, from the native platform using MethodChannel?

落花浮王杯 提交于 2019-11-27 02:05:01
I am writing a native plugin that, in some cases, has to call functions in the flutter portion of the app, written in Dart. How it's achieved, is explained here: https://flutter.io/platform-channels/ Furthermore, an example of invoking a method from the native/platform part towards the Dart/non-native is here: https://github.com/flutter/plugins/tree/master/packages/quick_actions Now, this example is really nice in case the platform only needs to invoke a method , i.e. that call returns nothing/ void , but in case it needs to invoke a function , i.e. needs a return value from the non-native

running R from windows command prompt

▼魔方 西西 提交于 2019-11-26 19:24:57
问题 I have a R program in a txt file say "functions.txt" . I load the "functions.txt" file the R using source("function.txt") and then call functions f1() , f2() etc. which are declared and defined within "function.txt" file. I also need to load a couple of R libraries using library() before I can use f1() , f2() etc. My question is can I acheive all this (i.e. calling function f1() and f2() ) from the windows prompt without opening the R environment ? So essentially I want to load the R

Java: platform's default charset on different platforms?

℡╲_俬逩灬. 提交于 2019-11-26 16:32:53
问题 Some legacy code relies on the platform's default charset for translations. For Windows and Linux installations in the "western world" I know what that means. But thinking about Russian or Asian platforms I am totally unsure what their platform's default charset is (just UTF-16?). Therefore I would like to know what I would get when executing the following code line: System.out.println("Default Charset=" + Charset.defaultCharset()); Edit: I don't want to discuss the problems of charsets and