environment

Python calling subprocess that requires no virtual environment

醉酒当歌 提交于 2019-12-20 03:48:09
问题 I have a Python 3.6 script that calls out to a third-party tool using subprocess. main_script.py: #!/usr/bin/env python import subprocess result = subprocess.run(['third-party-tool', '-arg1'], shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE) The problem is, main_script.py must be run from within a virtual environment, and third-party-tool must be run from no virtual environment whatsoever. I don't know much about third-party-tool , except that it is on my path. Calling it while I

Spring 3.1 configuration: environment not injected

前提是你 提交于 2019-12-19 14:05:30
问题 I am using the following for the spring 3.1 configuration: @Configuration @EnableTransactionManagement public class DataConfig { @Inject private Environment env; @Inject private DataSource dataSource; // @Bean public SpringLiquibase liquibase() { SpringLiquibase b = new SpringLiquibase(); b.setDataSource(dataSource); b.setChangeLog("classpath:META-INF/db-changelog-master.xml"); b.setContexts("test, production"); return b; } @Bean public EntityManagerFactory entityManagerFactory() {

Asp.Net VNext App Settings on Azure

ぐ巨炮叔叔 提交于 2019-12-19 10:16:37
问题 I really enjoyed the new Configuration feature of Asp.Net vNext using de default appsettings.json But I would like to change the values of that file when I publish the website as a Azure Web App. The old web.config appsettings was easy to change and configure the properties on the environment. Do you know how to do this? I prefer to user the default provider instead of creating a custom configuration provider. Thank you! 回答1: If you set App Settings in the Azure Portal, they become

get xts objects from within an environment

依然范特西╮ 提交于 2019-12-19 08:39:31
问题 I have stored xts objects inside an environment. Can I subset these objects while they are stored in an environment, i.e. act upon them "in-place"? Can I extract these objects by referring to their colname ? Below an example of what I'm getting at. # environment in which to store data data <- new.env() # Set data tickers of interest tickers <- c("FEDFUNDS", "GDPPOT", "DGS10") # import data from FRED database library("quantmod") dta <- getSymbols( tickers , src = "FRED" , env = data , adjust =

Sandboxing in Lua 5.2

拟墨画扇 提交于 2019-12-19 03:16:26
问题 I am learning from "Programing in Lua" by Roberto Ierusalimschy, and I found that in the book, the example of Sandboxing uses the function setfenv() to change the environment of a given function, but in lua 5.2 this function is no longer available. I tried to load some values from a file (a configuration file) into a field in a table, but, in lua 5.2 I can't use setfenv ( so I can load the values in the given environment). After reading some articles about lua 5.2 I found that each function

Python deployment and /usr/bin/env portability

拥有回忆 提交于 2019-12-18 19:08:44
问题 At the beginning of all my executable Python scripts I put the shebang line: #!/usr/bin/env python I'm running these scripts on a system where env python yields a Python 2.2 environment. My scripts quickly fail because I have a manual check for a compatible Python version: if sys.version_info < (2, 4): raise ImportError("Cannot run with Python version < 2.4") I don't want to have to change the shebang line on every executable file, if it's possible; however, I don't have administrative access

Conda not found after upgrading to macOS Catalina

纵饮孤独 提交于 2019-12-18 12:53:07
问题 I've just updated my MacBook to Catalina. After the update, zsh can't find anymore. In fact, in my .zshrc I had: export PATH=/anaconda3/bin:$PATH However, the path /anaconda3/bin doesn't exist anymore. Does that mean that I have lost all of my environment? 回答1: You can find the entire anaconda3 environment in a shortcut link named 'Relocated Items' on your desktop. It appears as though the upgrade to Catalina does not allow the Conda environment to be installed under a user directory now

UNIX, get environment variable

余生长醉 提交于 2019-12-18 12:46:16
问题 I have a ridiculous question due to a ridiculous problem. Normally if I want to get the contents of an environment variable in UNIX shell, I can do echo ${VAR} Let's assume, due to my ridiculous situation, that this isn't possible. How do I get the contents of an environment variable to stdout, without someone who is looking at the command itself (not the output), see the value of the environment variable. I can picture the solution being something like echo env(NAME_OF_VAR) although I can't

Distinct enclosing environment, function environment, etc. in R

空扰寡人 提交于 2019-12-18 12:35:19
问题 I have a few questions about the different environments of a function. Take the following example: environment(sd) # <environment: namespace:stats> Does namespace:stats point to the enclosing environment of function sd? pryr::where(sd) # <environment: package:stats> Does package:stats point to the binding environment of function sd? According to Advanced R by Hadley Wickham: "The enclosing environment belongs to the function, and never changes..." But the enclosing environment of function can

How are CMake execute_process commands run?

好久不见. 提交于 2019-12-18 07:22:53
问题 I've got the following lines in my CMakeLists.txt file. I'm running CMake 3.5.2 on Windows 7, and using Visual Studio 12 2013 as the generator with "Use default native compilers" checked in the gui. find_path(FORTRAN_DIR NAMES cdll.cpp fdll.f90 Makefile PATHS ../source) execute_process(COMMAND make WORKING_DIRECTORY ${FORTRAN_DIR}) This runs just fine. But exactly how is it being run?? It's on Windows! I've compiled the Makefile via MSYS2 (MinGW) on Windows before, but if that's what CMake is