environment

Consistent ApplicationData path between WinForms Apps and Windows Service contexts in C#

房东的猫 提交于 2019-12-25 04:40:14
问题 I use the following code to build a desired path for an XML file: System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData); When executed from a Windows Forms application, it returns: C:\Users\MyUsername\AppData\Roaming\...\Database.xml When executed from within a Windows Service, it returns: C:\Windows\system32\config\systemprofile\AppData\Roaming\...\Database.xml I am now resorting to having a custom installer action persist the path in a registry key since the

Check OS version and variable for Network Label

只愿长相守 提交于 2019-12-25 04:07:46
问题 I've been using this code successfully however, looking to adjust it and use when performing netsh commands to rename NIC's - although whilst writing this i'm not sure it's the best route anymore. SET _OSVer=OTHER FOR /F "Tokens=2 Delims=[]" %%a IN ('VER') DO SET _VerNo=%%a FOR /F "Tokens=2-3 Delims=. " %%b IN ("%_VerNo%") DO ( IF "%%b.%%c" EQU "5.2" SET _OSVer=2003 IF "%%b.%%c" EQU "6.0" SET _OSVer=2008 IF "%%b.%%c" EQU "6.1" SET _OSVer=2008R2 IF "%%b.%%c" EQU "6.2" SET _OSVer=2012 IF "%%b.%

How to solve the conda virtual env and system env conflict on import cv2?

本秂侑毒 提交于 2019-12-25 00:43:27
问题 I have installed opencv 3.4.1 correctly on my system enviroment. But after I create a conda virtual environment using a yml file inlcues opencv3.2.0, it leads some problems here: Under the conda virtual env, I have to always first cd PATH_TO_VIRTUAL_ENV/lib/python3.5/site_packages such that import cv2 is correctly using the 3.2.0 version of opencv,without this step, 3.4.1 will be used. Under the conda base environment , if the PATH in ~/.bashrc is added to anaconda3, then I will under conda

Unexpected behavior of R after install on another EC2 instance

ぐ巨炮叔叔 提交于 2019-12-24 22:28:40
问题 I'm fighting this problem second day straight with a completely sleepless night and I'm really starting to lose my patience and strength. It all started after I decided to provision another (paid) AWS EC2 instance in order to test my R code for dissertation data analysis. Previously I was using a single free tier t1.micro instance, which is painfully slow, especially when testing/running particular code. Time is much more valuable than reasonable number of cents per hour that Amazon is

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

Passenger misses development gem in production environment

老子叫甜甜 提交于 2019-12-24 03:00:12
问题 I've got a strange behaviour on my production server: I deploy my Rails 3 application via Capistrano to the production server. The Capistrano script restarts passenger at the end of deployment. When I open the application I see a passenger error message: Could not find autotest-fsevent-0.2.4 in any of the sources (Bundler::GemNotFound) Of course autotest-fsevent is not installed in my production environment (and even can't be installed on Ubuntu...) The environment is set in apache's

R: Global assignment of vector element works only inside a function

烈酒焚心 提交于 2019-12-24 00:59:49
问题 I'm working on a project where there are some global assignments, and I ran into something sort of odd. I was hoping someone could help me with it. I wrote this toy example to demonstrate the problem: x <- 1:3 ; x <- c(1, 2, 5) # this works fine x <- 1:3 ; x[3] <- 5 # this works fine x <<- 1:3 ; x <<- c(1, 2, 5) # this works fine x <<- 1:3 ; x[3] <<- 5 # this does not work # Error in x[3] <<- 5 : object 'x' not found same.thing.but.in.a.function = function() { x <<- 1:3 x[3] <<- 5 } same

What class of objects are in the environment ? (R)

心不动则不痛 提交于 2019-12-24 00:58:28
问题 I wish to know what type of objects I've got in my environment. I can show who is there like this: ls() But running something like sapply(ls(), class) Would (obviously) not tell us what type (class) of objects we are having (function, numeric, factor and so on...) using ls.str() Will tell me what class my objects are, but I won't be able to (for example) ask for all the objects which are factors/data.frame/functions - and so on. I can capture.output of ls.str(), but probably there is a

Passing data and column names to ggplot via another function

末鹿安然 提交于 2019-12-23 22:08:27
问题 I'll skip right to an example and comment afterwords: cont <- data.frame(value = c(1:20),variable = c(1:20,(1:20)^1.5,(1:20)^2),group=rep(c(1,2,3),each=20)) value variable group 1 1 1.000000 1 2 2 2.000000 1 3 3 3.000000 1 #... etc. #ser is shorthand for "series". plot_scat <- function(data,x,y,ser) { ggplot(data,aes(x=x,y=y,color=factor(ser)))+geom_point() } plot_scat(cont,value,variable,group) #This gives the error: #Error in eval(expr,envir,enclose) : object 'x' not found Now, I know that

cygwin environment variables set in bat file

流过昼夜 提交于 2019-12-23 19:38:48
问题 I need to set several environment variables that should be available in cygwin shell. I tried running "c:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/amd64"/vcvars64.bat in ~/.bashrc. Script seems to run but it does not update environment variables. How can I export variables set in bat file? 回答1: Depends upon what you are trying to do. If you want access to those tools within Cygwin you can edit your .bash_profile and update your PATH= to match what vcvars64.bat has. This is how