environment-variables

How do i define a second environment.rb file in rails?

My default environment.rb is overflowing, and i would like to have a separate file that works exactly the same way. How can I do so? ...

Getting syswow64 directory using 32-bit application

I'm trying to find a file inside the system directory. The problem is that when using Environment.SystemDirectory On a x64 machine, i'm still getting the System32 directory, instead of the Systemwow64 directory. I need to get the "System32" directory on x86 machines, and "SystemWow64" directory on x64 Any ideas? EDIT: To find the S...

How to set $PATH in PHP?

Hi. I am currently working on my own little project, but I have a little problem: I want to set the $PATH environment variable to ./bin, so that when I use exec() and similar functions, it would only search for binary files in that directory (unless I explicitly tell it otherwise). I have already tried putenv(), which won't work unless...

Passing data between Wordpress 'pages'

I have a menu, when the user clicks on any menu item, I want to take them to the same page, but I want to style the page differently depending on the menu item...for ex: change the background color to be different. What's the best way to do this? I was thinking that when they click on a menu item, a variable can be set or a session vari...

Assigning Environment Variables in Ruby on Rails

I have a program that makes calls to an internal web API. However when we're doing development work on the sites we don't want the program to call our production web API but the staging version of the Web API. What's the best way to do this in rails? I feel I should be assigning some sort of variable in development.rb and one in produ...

Rename Default.png to support iOS4 in Run Script

I have a project with several build targets. Each build target has its own default.png and previously it worked with changing the name of each of these to default.png in my run script. However with the release of iOS4 I have to modify my script in order to support the Retina Display. Is it possible to get the target device version (iOS3....

What is the correct way to unset a linux environment variable in python?

From the documentation: If the platform supports the unsetenv() function, you can delete items in this mapping to unset environment variables. unsetenv() will be called automatically when an item is deleted from os.environ, and when one of the pop() or clear() methods is called. However I want something that will work regardless of...

How to fix the valgrind pool allocator issue?

When I run Valgrind on my code, I get several thousand instances of 12 bytes in 1 blocks are possibly lost in loss record 545 of 29,459 at 0x7FCC050: operator new(unsigned int) (vg_replace_malloc.c:214) by 0x87E39B1: __gnu_cxx::new_allocator<T>::allocate(unsigned int, void const*) (new_allocator.h:89) ... ... From various ...

Set RAILS_ENV for Custom Test Environment

I have created a custom Rails integration environment that i use to run Selenium tests. The tests run fine in this new environment, however the problem is that within the test code, the RAILS_ENV variable is set to test. I have a test helper class which is similar to the default rails test_helper class, and defines ENV["RAILS_ENV"] = "...

$_SERVER['_'] equivalent on Windows

On Linux $_SERVER["_"] contains path to PHP interpreter executable (for example /usr/bin/php -r 'echo $_SERVER["_"];' will print /usr/bin/php). On Windows XP with PHP 5.3 $_SERVER["_"] is NULL. ...

Tomcat complaining about botched JAVA_HOME path

I have installed the JDK, to C:\jdk, the JAVA_HOME variable is set to C:\jdk\jdk, and when I echo %JAVA_HOME% I get C:\jdk\jdk. Yet Tomcat complains. The JAVA_HOME environment variable is not defined correctly This environment variable is needed to run this program NB: JAVA_HOME should point to a JDK not a JRE I seem to be having erro...

How to set env variable and start a process in C

Can anybody please help me showing how to set an environment variable and start a process in ANSI C for Windows? If possible I want to avoid using any windows API for this. ...

PHP Environment variable

Hi I am using PHP Java Bridgeon a windows and linux server. Now I want to modify the CLASSPATH. When I do a phpinfo(), I see a CLASSPATH under environment variables section and when I output the java.lang.system properties is have a property called java.class.path. First of all what is the difference between the two ? How do I modi...

Running shell script without environment variables in Xcode?

Xcode sets variety of environment variables related build when running shell script. Is there a way to running shell script without setting of those variables? ...

dyld: warning, unknown environment variable: DYLD_LIBRARY_PATH_64-bit

I used the bundled Property List Editor of Mac OS X Developer Tools to set an environment variable DYLD_LIBRARY_PATH_64-bit to the value path/to/dylib in the file ~/.MacOSX/environment.plist. I saved this file and logged out. Upon logging back in, the console displayed multiple messages of "dyld: warning, unknown environment variable: ...

how can I get the value of %APPDATA% using JScript?

Hi, how can I get the value (path) of %APPDATA% in Micorosoft JScript? ...

Using custom environment variables in .htaccess

I need something like this: SetEnv foo bar.baz RewriteEngine On RewriteCond %{HTTP_HOST} ^%{foo}$ RewriteRule ^(.*)$ http://www.foo/$1 [L] UPD: I have made as follows: SetEnv HOSTNAME_ENV testsite RewriteEngine On RewriteCond %{HTTP_HOST} ^%{ENV:HOSTNAME_ENV} RewriteRule ^(.*)$ http://www.%{ENV:HOSTNAME_ENV}/$1 [L,R=301] But it d...

Tcsh and Bash Initialization

I would like to be able to source a file to set up some environment variables, but do it so it's independent of the shell being used. For example %: source START.env # START.env if [ $SHELL == "bash" ]; then source START.env.bash # sets environment variables else source START.env.tcsh # sets environment variables fi However, t...

Unable to run JAR file on another PC. Possible issue with Environment Variables?

I've built a JAR file and it executes fine on my PC (XP) which has Eclipse installed. It also works on another PC, which also has Eclipse. I've tried running it on another PC(XP) that does not have Eclipse. Though it contains the JDK and multiple JRE. The JAR file just does not execute by clicking or from the command prompt. I am not ...

How can you get eclipse code complete for CI when using &get_instance() ?

Hi everyone, I'm currently using Eclipse PDT and CodeIgniter, is it possible to get code-completion for the sessions library like so: $CI = &get_instance(); $CI->session->se (No auto-completion here.) Also, is there some sort of plug-in (or just a method) that would allow eclipse to do this for all my CodeIgniter libraries. Note: ...