environment

Push and pull my conda environment using git

China☆狼群 提交于 2019-12-05 02:04:58
问题 I have a git repo with my project. I change my conda environment quite frequently, so I want my repo to track changes in the environment, and to be able to push the most recent one and pull it in another computer. Is it possible? I search and find several solutions (e.g. https://tdhopper.com/blog/my-python-environment-workflow-with-conda/) but none provide an automatic changes-tracking. Meaning, I want to include any changes I make in my environment into the project's repository. Like adding

Adding “--help” parameter to C# console application

大憨熊 提交于 2019-12-04 15:00:29
Almost all the .exe's I use via command line have a help function that gets called by the "--help" command. How do I implement this in C#? Is it as simple as checking whether or not the parameter in args[] is the string "--help"?? A C# snippet for processing the command line across multiple cultures is... string[] args = Environment.GetCommandLineArgs(); if (args.Length == 2) { if (args[1].ToLower(CultureInfo.InvariantCulture).IndexOf("help", System.StringComparison.Ordinal) >= 0) { // give help } } The detection logic can be combined with "?" or "/?" or any other combination that covers all

How to specify rubygems path in environment-less Ruby script?

浪子不回头ぞ 提交于 2019-12-04 14:49:39
I've written a data collection script for Cacti in Ruby and it runs fine from the command line but Cacti runs the script via "env -i" which strips the environment so Ruby can't find the rubygems library ("in `require': no such file to load -- rubygems (LoadError)"). How might I work around this? #!/bin/sh #export LOAD_PATH=whatever #export RUBYLIB=whatever #export RUBYOPT=whatever #export RUBYPATH=whatever #export RUBYSHELL=whatever #export PATH=$PATH:whatever exec ruby -x. $0 "$@" #!/usr/bin/ruby require 'rubygems' require 'open4' # or whatever # rest of ruby script here This is a shell

Moving Processing project into Eclipse

喜欢而已 提交于 2019-12-04 14:04:26
I've been working on a Processing project for a while, and now want to move it into Eclipse. I've installed Proclipse with my Eclipse environment. I've a lot of files with the extension of ".pde". However the Proclipse files all ends with ".java". And there's a lot of dependency issues with all the pde files. How should I convert my project? =============== Thanks everyone! There doesn't seem to be a one-button solution, I refactored all the code following an approach similar to George's answer. Plus changing all the file extensions from ".pde" to ".java". Jose's advice is pretty good.

How to make Android app automatically configure w/ debug vs. release values?

[亡魂溺海] 提交于 2019-12-04 13:22:28
问题 I'm working on an Android app, specifically one that uses the Facebook Android SDK. In development mode, I'm working with a test Facebook app that goes by one ID. However, in release mode, the app will be working with second Facebook app with a different ID. I'm wondering how most Android (or Java might be a suitable enough realm of knowledge) developers here go about having their app automatically build with debug vs. release values. An ideal solution does not involve a manual switch (e.g.:

How can I make my R session vanilla?

≯℡__Kan透↙ 提交于 2019-12-04 12:22:52
问题 This is a follow up for clarification of a previous question, How can I ensure a consistent R environment among different users on the same server? I'd like to enter a "vanilla" R session from within R, e.g. similar to what I would obtain if I launched R using the command R --vanilla . For example, I would like to write a script that is not confounded by a particular user's custom settings. In particular, I'd like the following doesn't read R history, profile, or environment files doesn't

Ansible: How to globally set PATH for solaris

£可爱£侵袭症+ 提交于 2019-12-04 11:45:11
I am writing Ansible playbooks to setup and install our applications on Solaris servers. The problem is that the (bash) scripts which I need to execute all assume that a certain directory lies on the PATH, namely /data/bin - which would normally not be a problem were it not for Ansible ignoring all the .profile and .bashrc config. Now, I know that you can specify the environment for shell tasks via the environment flag, for example like this: - shell: printenv environment: PATH: /usr/bin:/usr/sbin:/data/bin This will properly path the /data/bin folder, and the printenv command will correctly

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

走远了吗. 提交于 2019-12-04 08:39:35
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 folder as my application nor do I want to store them in the registry. I notice there is an "All Users"

Lambda and the Environment Model

故事扮演 提交于 2019-12-04 07:59:29
I need help drawing the relevant portions of the environment model diagram when evaluating this code: Scheme>(define x 10) Scheme> ((lambda (x y) (+ (y 3) x)) 6 (lambda (w) (* x 9))) I need to make sure and write each lambda body next to the environment in which it is being evaluated. Okay I know that there is only one define so most of the work will be done by “anonymous” or “nameless” functions and these will still show up in various ways in the environment model diagram In addition to the answers already given, the 6.001 course at MIT has two very comprehensive lectures on the environment

/usr/bin/env questions regarding shebang line pecularities

隐身守侯 提交于 2019-12-04 06:57:10
Questions : What does the kernel do if you stick a shell-script into the shebang line? How does the Kernel know which interpreter to launch? Explanation : I recently wanted to write a wrapper around /usr/bin/env because my CGI Environment does not allow me to set the PATH variable, except globally (which of course sucks!). So I thought, "OK. Let's set PREPENDPATH and set PATH in a wrapper around env.". The resulting script (here called env.1 ) looked like this: #!/bin/bash /usr/bin/env PATH=$PREPENDPATH:$PATH $* which looks like it should work. I checked how they both react, after setting