environment

script runs fine in terminal but not from launchd

China☆狼群 提交于 2020-01-06 09:55:48
问题 My Python script runs fine in the terminal but when I try to set it up to run once a day at a certain time with launchd (set up using software called Lingon), I just can't get it to run. From everything I've read, it's better to invoke the Python script from a shell script (I'm on a Macbook, running Yosemite). So, that's what I'm trying to do. The errors I get when the script is due to be run are: TERM environment variable not set. env: python3: No such file or directory At this point, I'm

setting up environment variables in Play! framework

↘锁芯ラ 提交于 2020-01-05 06:39:07
问题 I am trying to get the Play! framework up and running. After I extracted Play! version 2.3.0 to C:\Play and adding that directory ( C:\Play ) to my path in 'Environment Variables' (separated form the other paths with a ;), I tried running it with the command "Play new foobar" and I keep getting the error "'Play' is not recognized as an internal or external command, operable program or batch file." I have looked at a few possible fixes to this on here Configuration Variables in Play! Framework

Environment variable are not hidden (secure)?

梦想的初衷 提交于 2020-01-05 06:24:47
问题 I found with my browser inspector some private credentials located in my environment file. They're not hidden ? That's not secure... I did something wrong ? 回答1: If you included them in your environment.ts in your Angular project then they will not be hidden. You can not include any secret values directly in your front-end Angular project as everything will be transferred to the client. If you need to use a secret of some kind then usually they are only accessible by your back-end code and

Strictly speaking does the scoping assignment <<- assign to the parent environment or global environment?

人盡茶涼 提交于 2020-01-03 18:41:08
问题 Often the parent environment is the global environment. But occasionally it isn't. For example in functions within functions, or in an error function in tryCatch() . Strictly speaking, does <<- assign to the global environment, or simply to the parent environment? 回答1: Try it out: env = new.env() env2 = new.env(parent = env) local(x <<- 42, env2) ls(env) # character(0) ls() # [1] "env" "env2" "x" But: env$x = 1 local(x <<- 2, env2) env$x # [1] 2 … so <<- does walk up the entire chain of

Can user.name be spoofed

六月ゝ 毕业季﹏ 提交于 2020-01-03 09:11:13
问题 To get the name of the current user in a Java program, you can simply fetch the value of the user.name system property: System.getProperty("user.name"); But how secure is that? Can a user executing the program easily set this property to an arbitrary value (using a command-line argument of the JVM, for example) for common runtime environments? Can a user easily spoof this user name? I ask because I am writing a command-line program that can be run by anyone, but allows some privileged

Best way to execute a python script in a given conda environment

杀马特。学长 韩版系。学妹 提交于 2020-01-02 00:52:16
问题 I want to execute a python script executed.py from another python script trigger.py using the subprocess package. The executed.py must be ran in a different conda environment than trigger.py (let say executed_env and trigger_env ). What is the best way to do that ? My current code of trigger.py is: command = "python executed.py --option1 -dir /path/to/dir" args = shlex.split(command) my_subprocess = subprocess.Popen(args) It returns an error since executed.py is ran in the trigger_env

Where to save ini file dependent to machine (not user) on windows

↘锁芯ラ 提交于 2020-01-01 11:45:34
问题 My application is currently storing settings in an INI file under the current user's profile ( C:\Documents and Settings\<CurrentUser>\Application Data\MyApplication\MySettings.ini under WinXP). But I've realised some of these settings are unique to the machine not the user and thus want (actually need) to save them in a single location for all users. Is there a folder location on Windows XP (and up) where I can store user independent settings? NOTE: I don't want to store them in the same

Why do variable lookups in the body of function A take values from the global environment but not function B that calls A?

爷,独闯天下 提交于 2020-01-01 09:56:27
问题 I defined a function: .get <- function( o, ...) { p <- match.call( expand.dots = 0)$... cat( sprintf( 'In .get, it is %s.\n', eval( tail( p, 1)[[ 1]]))) fn <- switch( typeof( o), list =, environment = `[[`, 'S4' = '@', `[`) if( length( p)) eval( as.call( c( fn, quote( o), p))) else o # Here when true, I compose a call based on p. } Then I tried it as follows: it <- 1 m <- matrix( seq( 9), 3) sapply( seq( 3), function( it) { cat( sprintf( 'In sapply, it is: %s.\n', it)) .get( m, , it) })

Remove objects in .GlobalEnv from within a function

落爺英雄遲暮 提交于 2020-01-01 02:08:33
问题 I would like to create a function ( CleanEnvir ) which basically calls remove/rm and which removes certain objects from .GlobalEnv . CleanEnvir <- function(pattern = "tmp"){ rm(list = ls()[grep("tmp", ls())], envir = globalenv()) } keep <- 1 tmp.to.be.removed <- 0 ls() ## does not work CleanEnvir() ls() ## does work rm(list = ls()[grep("tmp", ls())], envir = globalenv()) ls() 回答1: ls() needs to look in the correct place. By default it looks in the current frame, that of the function

Remove objects in .GlobalEnv from within a function

人盡茶涼 提交于 2020-01-01 02:08:22
问题 I would like to create a function ( CleanEnvir ) which basically calls remove/rm and which removes certain objects from .GlobalEnv . CleanEnvir <- function(pattern = "tmp"){ rm(list = ls()[grep("tmp", ls())], envir = globalenv()) } keep <- 1 tmp.to.be.removed <- 0 ls() ## does not work CleanEnvir() ls() ## does work rm(list = ls()[grep("tmp", ls())], envir = globalenv()) ls() 回答1: ls() needs to look in the correct place. By default it looks in the current frame, that of the function