variables

PHP Variable problem!

So I have a PHP variable that's value get's replaced from another PHP file. Example: $var = "~~~OtherVariable~~~"; If I echo this variable out, it prints out the appropriate string. Example: echo $var; //prints out "This is a string of text"; So it looks like everything is working thus far, my PHP variable ($var) shows that it actu...

Variable scope in XSLT

Hi, I am having an issue trying to figure out var scoping on xslt. What I actually want to do it to ignore 'trip' tags that have a repeated 'tourcode'. Sample XML: <trip> <tourcode>X1</tourcode> <result>Budapest</result> </trip> <trip> <tourcode>X1</tourcode> <result>Budapest</result> </trip> <trip> <tourcode>X1</tourcode> <resul...

How do I put variable values into a text string in MATLAB?

I'm trying to write a simple function that takes two inputs, x and y, and passes these to three other simple functions that add, multiply, and divide them. The main function should then display the results as a string containing x, y, and the totals. I think there's something I'm not understanding about output arguments. Anyway, here's ...

vb.net session variable passing "space" from one page to another

i have 2 aspx webpages with vb.net code. On the first page, I have a text box, on first page that says "Enter Hobby", but its not a required textbox. So if the user clicks submit, it'll load up the second page. Now in the second page i have textbox "hobby" which has maxlength = 10. and in the vb.net code i have hobby.text = session("hobb...

incosistency with JavaScript variables

I have an incosistency in my js code that is driving me crazy. Here's the situation: I have events with a starting and ending time that I set into js variables as following, being 'event' the item from a forEach: var hour = new Number('0${event.hourTimeStart}'); var minutes = new Number('0${event.minutesTimeStart}'); var hourEnd = new N...

Pass a variable number of arguments to an aliased function.

Take a function like printf that accepts a variable number of arguments what I would like to do is pass these variable number of functions to a sub function without changing their order. An example of this would be aliasing the printf function to a function called console ... #include <stdio.h> void console(const char *_sFormat, ...);...

Difference between creating a local variable and assigning to ivar and directly assigning to ivar?

Hello, I have always wondered why all apple code samples use code like this: UINavigationController *aNavigationController = [[UINavigationController alloc] initWithRootViewController:rootViewController]; self.navigationController = aNavigationController; [self.view addSubview:[navigationController view]]; [aNavigationCont...

Setting a variable name with another variable value - Java Script

I want to get a value from a variable then use that as the name for another variable. I got something like this: var eval(BodyWeight[i]["ExerciseTitle"]) = BodyWeight[i]["ExerciseVideo"]; This is giving me an error, 'missing ; before statement'. Any ideas? ...

Do the math sum of a text variable? (E.g 5865/100 )

I have a variable that is... $whatever = "5865/100"; This is a text variable. I want it to calculate 5865/100 , so that I can add it to other numbers and do a calculation. Number_format doesn't work, as it just returns "5,865". Whereas I want it to return 58.65 I could do... $explode=explode("/",$whatever); if(count($explode)=="2")...

Django debug display all variables of a page

Is there a template tag (or any other trick) I can use to display all the variables available in a page? ...

Is there any tool that can analyze the dependencies between variables in c# programs?

There are many tools that we can use to show the dependencies between modules, source code files, classes, or functions etc. But there seems no tool for analyzing the dependencies between variables. Given a dependency graph of variables would be helpful for understanding and refactoring the code. For example, if variable b is only used ...

Django - Determine field type of a variable passed to a template tag

I would like to write a Django template tag to which I can pass a variable. I would like the template tag to behave differently depending on what type of model field the variable was derived from (CharField, BooleanField, IntegerField, etc.) as well as other information used in the field's definition (max_length, etc.) I can pass the v...

What is p-notation in C programming?

I'm learning C right now and there is a conversion specifier %a which writes a number in p-notation as opposed to %e which writes something in e-notation (exponential notation). What is p-notation? ...

What's the difference between -> result=$(ls -l) (or) -> result=`ls -l`

I'v run both commands and they both seem to do the same thing, is this true or is there something happening I'm not seeing? These two appear to do the same thing: result=$(ls -l) result=`ls -l` ...

php - extract array into global variables

The manual on "extract" shows you can extract an array like: extract(array('one'=>1,'two'=>2)); into $one,$two... But the extract function doesn't return the variables. Is there a way to 'globalize' these variables? Maybe not using extract, but a foreach loop? EDIT: (explanation about what I'm trying to achieve) I have an array co...

String value with an appostrophe in a PHP variable email address, mysql select

I have an email address mike.o'[email protected] stored in a posted variable and I want a select statement in mysql to validate the existance of the email address and retrieve a password from my table. My query gets stuck at the apostophe when it trys to execute. eg "SELECT pwd FROM tbl_users WHERE userName = '$email'"; Any assistance wi...

Can we Change the Values of ServerVariables?

hi all, I want to change tha value of Request.ServerVariables["Remote_Addr"],is it Possible? if yes please let me know how can we change? if No Please let me know why we can not change? thanks in advance. ...

Sending information between two Windows Froms in C#

This might be a novice question. :). Consider the following scenario. Suppose we have two windows forms that are already "loaded" (i.e You can see both the forms) Form 1 contains a textbox and a "submit" button while the form 2 contains a text lable. The user can enter a string in the textbox and press ...

Passing variable to awk and using that in a regular expression

I'm learning awk and I have trouble passing a variable to the script AND using it as part of a regex search pattern. The example is contrived but shows my probem. My data is the following: Eddy Smith 0600000000 1981-07-16 Los Angeles Frank Smith 0611111111 1947-04-29 Chicago Victoria McSm...

Django templates - can I set a variable to be used in a parent template?

I have a parent template that contains a generic navigation menu. I want to be able to add class="selected" to the appropriate menu option. I want to be able to set a variable in a child template, for example: {% set menu = "products" %} and do: {%ifequal menu "products" %}class="selected"{% endifequal %} I don't want to set a val...