Search Results

Search found 6805 results on 273 pages for 'variables'.

Page 4/273 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • What is a user-friendly solution to editing email templates with replacement variables?

    - by Daniel Magliola
    I'm working on a system where we rely a lot of "admins / managers" emailing users from the database. One of the key features is being able to email several people at the same time, with specific information relevant to each of them. Another key feature is to be able to hand-craft emails, because it tends to be be necessary to slightly modify them each time, but having a basic template saves a lot of time. For this, we have the typical "templates" solution, where we have a template that looks kind of like this: Hello {{recipient.full_name}}, Your application to {{activity.title}} has been accepted. You have requested to participate on dates {{application.dates}}, in role {{application.role}} Blah blah blah The problem we are having is obviously that (as we expected), managers don't get the whole "variables" idea, and they do things like overwriting them, which doesn't let them email more than one person at a time, assuming those are not going to get replaced and that the system is broken, or even inexplicable things like "Hello {{John}}". The big problem is that this isn't relegated, as usual, to an "admin" section where only a few power users have access to editing the templates that are automatically send out, and they're expected to know what they are doing. Every user of the system gets exposed to this problem. The obvious solution would be to replace the variables before showing this template for the user to edit, but that doesn't work when emailing several people. This seems like a reasonably common problem, and we are kind of hoping that someone has already solved it. Have you seen anywhere/created/can think of good solutions to this problem?

    Read the article

  • Evaluation of environment variables in command run by Java's Runtime.exec()

    - by Tom Duckering
    Hi, I have a scenarios where I have a Java "agent" that runs on a couple of platforms (specifically Windows, Solaris & AIX). I'd like to factor out the differences in filesystem structure by using environment variables in the command line I execute. As far as I can tell there is no way to get the Runtime.exec() method to resolve/evaluate any environment variables referenced in the command String (or array of Strings). I know that if push comes to shove I can write some code to pre-process the command String(s) and resolve enviroment variables by hand (using getEnv() etc). However I'm wondering if there is a smarter way to do this since I'm sure I'm not the only person wanting to do this and I'm sure there are pitfalls in "knocking up" my own implementation. Your guidance and suggestions are most welcome. edit: I would like to refer to environment variables in the command string using some consistent notation such as $VAR and/or %VAR%. Not fussed which. edit: To be clear I'd like to be able to execute a command such as: perl $SCRIPT_ROOT/somePerlScript.pl args on Windows and Unix hosts using Runtime.exec(). I specify the command in config file that describes a list of jobs to run and it has to be able to work cross platform, hence my thought that an environment variable would be useful to factor out the filesystem differences (/home/username/scripts vs C:\foo\scripts). Hope that helps clarify it. Thanks. Tom

    Read the article

  • PHP: Alternative to SESSIONS

    - by iamjonesy
    Hi, I have a PHP application that relies on session variables quite a lot. After login the user get redirected to a page that executes code to set up a load of session variables depending on who the user is. The application is using data from different sources and the sessions are used to store ID numbers to query the databases. So when the user goes to a page that will query their asset management system their ID for that particular database is called via the session. I've had a LOT of problems with session variables recently. Sometimes only one session file is created during the lifetime of the app, and sometimes each session request results in a new session id (still haven't managed to find out why!). My question is this. Is there an alternative to using session variables for this? Like globals or some other way? Any help most appreciated! Regards, Jonesy

    Read the article

  • How to extract specific variables from a string?

    - by David
    Hi, let's say i have the following: $vars="name=david&age=26&sport=soccer&birth=1984"; I want to turn this into real php variables but not everything. By example, the functions that i need : $thename=getvar($vars,"name"); $theage=getvar($vars,"age"); $newvars=cleanup($vars,"name,age"); // Output $vars="name=david&age=26" How can i get only the variables that i need . And how i clean up the $vars from the other variables if possible? Thanks

    Read the article

  • How to override environment variables when running configure?

    - by Sam
    In any major package for Linux, running ./configure --help will output at the end: Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir> CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. How do I use these variables to include a directory? I tried running ./configure --CFLAGS="-I/home/package/custom/" and ./configure CFLAGS="-I/home/package/custom/" however these do not work. Any suggestions?

    Read the article

  • Windows environment variables change when opening command line?

    - by Jakobud
    Sometimes when I change my environment variables in Windows, and then use software the depends on those variables, they are not properly updated. And good example is to change a variable, then open up Windows Command Line and echo the variable and see that it hasn't been changed, even though you properly changed it in the Environment Variables window. Another example I'm dealing with right now: I've been using Python 2.4.x for a while for a project, which uses the env var PYTHONPATH who's value has been: C:\Python24;C:\Python24\lib Today I installed Python 2.5.x for the project. I changed my PYTHONPATH to be: C:\Python25;C:\Python25\lib When I use Python 2.5 to run a script and do this: import sys print sys.path It prints: 'C:\\PYTHON24', 'C:\\PYTHON24\\lib' (and some other Python 2.5 related default installation paths) So clearly, the old PYTHONPATH environment variable changes aren't really sticking.... Does anyone know why this happens and how to fix it?

    Read the article

  • Converting a PHP array to class variables.

    - by animuson
    Simple question, how do I convert an associative array to variables in a class? I know there is casting to do an (object) $myarray or whatever it is, but that will create a new stdClass and doesn't help me much. Are there any easy one or two line methods to make each $key => $value pair in my array into a $key = $value variable for my class? I don't find it very logical to use a foreach loop for this, I'd be better off just converting it to a stdClass and storing that in a variable, wouldn't I? class MyClass { var $myvar; // I want variables like this, so they can be references as $this->myvar function __construct($myarray) { // a function to put my array into variables } }

    Read the article

  • Setting Global Variables in VBA

    - by dennis96411
    I'm currently making an "OS" in PowerPoint and I need to know how to set global variables for the settings. I made a module called "Settings" containing: Public Sub Settings() Option Explicit Public UserName, UserIcon, Background, BrowserHomePage As String Public SetupComplete As Boolean SetupComplete = False UserName = "Administrator" UserIcon = Nothing Background = Nothing BrowserHomePage = Nothing 'Set the variables UserName.Text = UserName End Sub Now on the "log in" screen, I have a text box named "UserName". I then made a button just to test out the variables. The button does this: Private Sub CommandButton1_Click() UserName.Value = UserName End Sub The text box has no value when I click the button. I'm super new at VBA, and would like to know how to do this. Also, if anyone knows how to automatically execute codes when starting the PowerPoint, that would be fantastic.

    Read the article

  • Apache2 - mod_rewrite : RequestHeader and environment variables

    - by Guillaume
    I try to get the value of the request parameter "authorization" and to store it in the header "Authorization" of the request. The first rewrite rule works fine. In the second rewrite rule the value of $2 does not seem to be stored in the environement variable. As a consequence the request header "Authorization" is empty. Any idea ? Thanks. <VirtualHost *:8010> RewriteLog "/var/apache2/logs/rewrite.log" RewriteLogLevel 9 RewriteEngine On RewriteRule ^/(.*)&authorization=@(.*)@(.*) http://<ip>:<port>/$1&authorization=@$2@$3 [L,P] RewriteRule ^/(.*)&authorization=@(.*)@(.*) - [E=AUTHORIZATION:$2,NE] RequestHeader add "Authorization" "%{AUTHORIZATION}e" </VirtualHost> I need to handle several cases because sometimes parameters are in the path and sometines they are in the query. Depending on the user. This last case fails. The header value for AUTHORIZATION looks empty. # if the query string includes the authorization parameter RewriteCond %{QUERY_STRING} ^(.*)authorization=@(.*)@(.*)$ # keep the value of the parameter in the AUTHORIZATION variable and redirect RewriteRule ^/(.*) http://<ip>:<port>/ [E=AUTHORIZATION:%2,NE,L,P] # add the value of AUTHORIZATION in the header RequestHeader add "Authorization" "%{AUTHORIZATION}e"

    Read the article

  • Apache2 - mod_rewrite : RequestHeader and environment variables

    - by Guillaume
    I try to get the value of the request parameter "authorization" and to store it in the header "Authorization" of the request. The first rewrite rule works fine. In the second rewrite rule the value of $2 does not seem to be stored in the environement variable. As a consequence the request header "Authorization" is empty. Any idea ? Thanks. <VirtualHost *:8010> RewriteLog "/var/apache2/logs/rewrite.log" RewriteLogLevel 9 RewriteEngine On RewriteRule ^/(.*)&authorization=@(.*)@(.*) http://<ip>:<port>/$1&authorization=@$2@$3 [L,P] RewriteRule ^/(.*)&authorization=@(.*)@(.*) - [E=AUTHORIZATION:$2,NE] RequestHeader add "Authorization" "%{AUTHORIZATION}e" </VirtualHost> I need to handle several cases because sometimes parameters are in the path and sometines they are in the query. Depending on the user. This last case fails. The header value for AUTHORIZATION looks empty. # if the query string includes the authorization parameter RewriteCond %{QUERY_STRING} ^(.*)authorization=@(.*)@(.*)$ # keep the value of the parameter in the AUTHORIZATION variable and redirect RewriteRule ^/(.*) http://<ip>:<port>/ [E=AUTHORIZATION:%2,NE,L,P] # add the value of AUTHORIZATION in the header RequestHeader add "Authorization" "%{AUTHORIZATION}e"

    Read the article

  • Environment variables in bash_profile or bashrc?

    - by Viriato
    I have found this question [blog]: Difference between .bashrc and .bash_profile very useful but after seeing the most voted answer (very good by the way) I have further questions. Towards the end of the most voted, correct answer I see the statement as follows : Note that you may see here and there recommendations to either put environment variable definitions in ~/.bashrc or always launch login shells in terminals. Both are bad ideas. Why is it a bad idea (I am not trying to fight, I just want to understand)? If I want to set an environment variable and add it to the PATH (for example JAVA_HOME) where it would be the best place to put the export entry? in ~/.bash_profile or ~/.bashrc? If the answer to question number 2 is ~/.bash_profile, then I have two further questions: 3.1. What would you put under ~/.bashrc? only aliases? 3.2. In a non-login shell, I believe the ~/.bash_profile is not being "picked up". If the export of JAVA_HOME entry was in bash_profile would I be able to execute javac & java commands? Would it find them on the PATH? Is that the reason why some posts and forums suggest setting JAVA_HOME and alike to ~/.bashrc? Thanks in advance.

    Read the article

  • Setting environment variables in OS X /etc/launchd.conf

    - by al nik
    I'm trying to set some env variable in OS X 10.6 (/etc/launchd.conf) setenv M2_HOME /usr/share/maven setenv M2 $M2_HOME/bin setenv MAVEN_OPTS '-Xms256m -Xmx512m' M2 and MAVEN_OPTS are not working. I tried with something like setenv MAVEN_OPTS -Xms256m\ -Xmx512m but still it doesn't work. Any idea of what is the correct synthax? Thanks

    Read the article

  • Windows 7, going crazy with environment variables

    - by roymustang86
    So, I am trying to learn java. I installed the JDK and proceeded to write a few programs. Each time, I have to give the path to javac.exe to compile the .java file. SO, I decided to tweak the %PATH% variable. And no matter what I change it to, it doesn't work. when I do an echo %PATH%, I get 'Program' is not recognized as an internal or external command, operable program or batch file. This is my Path variable contents : C:\app\product\11.1.0\client_1\bin;%CommonProgramFiles%\Microsoft Shared\Windows Live;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;"C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\";"C:\Program Files\Broadcom\Broadcom 802.11";"C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\";"C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\";"C:\Program Files (x86)\Common Files\Roxio Shared\OEM\12.0\DLLShared\";"C:\Program Files (x86)\Roxio\OEM\AudioCore\";"C:\Program Files (x86)\Intel\Services\IPT\" How do I work around this? the double quotes were not there before, I added it thinking the space was the problem.

    Read the article

  • Tricking Linux apps about current time with environment variables

    - by geek
    Sometimes it is possible to trick a Linux app by calling it like this: HOME=/tmp/foo myapp This would make myapp think /tmp/foo is the home directory, it won't try to get the user id, find its home directory via getpwent(). This is useful when myapp must be forced to dump some of its config files into a non-standard location different than ~. A similar trick can be done like this: LANG=foo LC_ALL=bar myapp This is useful when myapp needs to be called once with a different locale without having to make the change persistent by using the export bash built-in or even modify stuff in /etc/profile. Is it possible to pull the same trick with time and date? The goal is to make an app use another time than the system ones. The final goal - to make timestamps that appear in logs/commit messages not being tied to the system time.

    Read the article

  • CodeIgniter: Passing variables via URL - alternatives to using GET

    - by John Durrant
    I'm new to CodeIgniter and have just discovered the difficulties using the GET method of passing variables via the URL (e.g. domain.com/page.php?var1=1&var2=2). I gather that one approach is to pass the variables in the URI segments but haven't quite figured out how to do that yet as it seems to create the expectation of having a function in the controller named as the specific URI segment???? Anyway Instead of using GET I've decided to use POST by adapting a submit button (disguised as a link) with the variables in hidden input fields. I've created the following solution which seems to work fine, but am wondering whether I'm on the right track here or whether there is an easier way of passing variables via a link within CodeIgniter? I've created the following class in application/libraries/ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class C_variables { function variables_via_link($action, $link_text, $style, $link_data) { $attributes = array('style' => 'margin:0; padding:0; display: inline;'); echo form_open($action, $attributes); $attributes = array('class' => $style, 'name' => 'link'); echo form_submit($attributes, $link_text); foreach ($link_data as $key => $value){ echo form_hidden($key, $value); } echo form_close(); } } ?> With the following CSS: /* SUBMIT BUTTON AS LINK adapted from thread: http://forums.digitalpoint.com/showthread.php?t=403667 Cross browser support (apparently). */ .submit_as_link { background: transparent; border-top: 0; border-right: 0; border-bottom: 1px solid #00F; border-left: 0; color: #00F; display: inline; margin: 0; padding: 0; cursor: hand /* Added to show hand when hovering */ } *:first-child+html .submit_as_link { /* hack needed for IE 7 */ border-bottom: 0; text-decoration: underline; } * html .submit_as_link { /* hack needed for IE 5/6 */ border-bottom: 0; text-decoration: underline; } Link then created using the following code in the VIEW: <?php $link = new C_variables; $link_data=array('var1' => 1, 'var2' => 2); $link ->variables_via_link('destination_page', 'here is a link!', 'submit_as_link', $link_data); ?> Thanks for your help...

    Read the article

  • Python - Get Instance Variables

    - by Chris Bunch
    Is there a built-in method in Python to get an array of all a class' instance variables? For example, if I have this code: class hi: def __init__(self): self.ii = "foo" self.kk = "bar" Is there a way for me to do this: >>> mystery_method(hi) ["ii", "kk"] Thanks guys! Edit: I originally had asked for class variables erroneously. Thanks to all who brought this to my attention!

    Read the article

  • Creating AST for shared and local variables

    - by Rizwan Abbasi
    Here is my grammar grammar simulator; options { language = Java; output = AST; ASTLabelType=CommonTree; } //imaginary tokens tokens{ SHARED; LOCALS; BOOL; RANGE; ARRAY; } parse : declaration+ ; declaration :variables ; variables : locals ; locals : (bool | range | array) ; bool :ID 'in' '[' ID ',' ID ']' ('init' ID)? -> ^(BOOL ID ID ID ID?) ; range : ID 'in' '[' INT '..' INT ']' ('init' INT)? -> ^(RANGE ID INT INT INT?) ; array :ID 'in' 'array' 'of' '[' INT '..' INT ']' ('init' INT)? -> ^(ARRAY ID INT INT INT?) ; ID : (('a'..'z' | 'A'..'Z'|'_')('a'..'z' | 'A'..'Z'|'0'..'9'|'_'))* ; INT : ('0'..'9')+ ; WHITESPACE : ('\t' | ' ' | '\r' | '\n' | '\u000C')+ {$channel = HIDDEN;} ; INPUT flag in [down, up] init down pc in [0..7] init 0 CA in array of [0..5] init 0 AST It is having a small problem. Variables (bool, range or array) can be of two abstract types 1. locals (each object will have it's own variable) 2. shared (think of static in java, same for all object) Now the requirements are changed. I want the user to input like this NEW INPUT domains: upDown [up,down] possibleStates [0-7] booleans [true,false] locals: pc in possibleStates init 0 flag in upDown init down flag1 in upDown init down map in array of booleans init false shared: pcs in possibleStates init 0 flag in upDown init down flag1 in upDown init down maps in array of booleans init false Again, all the variables can be of two types (of any domain sepecified) 1. Local 2. Shared In Domains: upDown [up,down] possibleStates [0-7] upDown, up, down and possibleStates are of type ID (ID is defined in my above grammar), 0 and 7 are of type INT Can any body help me how to convert my current grammar to meet new specifications.

    Read the article

  • How do I set PATH variables for all users on a server?

    - by Rob S.
    I just finished installing LaTeX for my company's Ubuntu server that we all SSH into to use. At the end of the install it says this: Add /usr/local/texlive/2010/texmf/doc/man to MANPATH, if not dynamically determined. Add /usr/local/texlive/2010/texmf/doc/info to INFOPATH. Most importantly, add /usr/local/texlive/2010/bin/x86_64-linux to your PATH for current and future sessions. So, my question is simply: How do I do this so that these variables are set for all users on the system? (And yes, I have sudo permissions). Thanks in advance to any and all responses I receive.

    Read the article

  • Does it make a difference if I declare variables inside or outside a loop in Java?

    - by Puckl
    Does it make a difference if I declare variables inside or outside a loop in Java? Is this for(int i = 0; i < 1000; i++) { int temporaryValue = someMethod(); list.add(temporaryValue) } equal to this (with respect to memory usage)? int temporaryValue = 0; for(int i = 0; i < 1000; i++) { temporaryValue = someMethod(); list.add(temporaryValue) } And what if the temporary variable is for example an ArrayList? for(int i = 0; i < 1000; i++) { ArrayList<Integer> array = new ArrayList<Integer>(); fillArray(array); // do something with the array }

    Read the article

  • Java and dynamic variables

    - by Arvanem
    Hi folks, I am wondering whether it is possible to make dynamic variables in Java. In other words, variables that change depending on my instructions. FYI, I am making a trading program. A given merchant will have an array of items for sale for various prices. The dynamism I am calling for comes in because each category of items for sale has its own properties. For example, a book item has two properties: int pages, and boolean hardCover. In contrast, a bookmark item has one property, String pattern. Here are skeleton snippets of code so you can see what I am trying to do: public class Merchants extends /* certain parent class */ { // only 10 items for sale to begin with Stock[] itemsForSale = new Stock[10]; // Array holding Merchants public static Merchants[] merchantsArray = new Merchants[maxArrayLength]; // method to fill array of stock goes here } and public class Stock { int stockPrice; int stockQuantity; String stockType; // e.g. book and bookmark // Dynamic variables here, but they should only be invoked depending on stockType int pages; boolean hardCover; String pattern; }

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >