variables

Separate Namespaces for Functions and Variables in Common Lisp versus Scheme

Scheme uses a single namespace for all variables, regardless of whether they are bound to functions or other types of values. Common Lisp separates the two, such that the identifier "hello" may refer to a function in one context, and a string in another. (Note 1: This question needs an example of the above; feel free to edit it and add ...

How to use a variable to access certain element within a multidimensional array?

Hello, I am using arrays in PHP to modify xml data and write it back. This is the xml structure (simplified for demonstration purpose): <docs> <folder> <name>Folder name</name> <date>20.06.2009</date> <folder> <name>Subfolder1</name> <date></date> </folder> <folder> <name>Subfolder1</name> ...

Setting an XSLT variable as a javascript variable?

How would I grab an XSLT variable and use it to set a javascript variable? I'm working on a bit of AJAX and in order to make it work to the fullest I would like to be able to grab XSLT variables and use those to set the default values of some javascript variables that I'll then be manipulating with jQuery. ...

Why is a variable not being reset in my event handler?

Here's my code: $(document).ready(function () { var default_var = 2; var show_var = default_var; var total_var = 8; var increment_var = 2; var start_var = show_var+1; var end_var = show_var+increment_var; $("a[rel=more]").live("click", function(){ $("#timeshare-listings li:last").after("<li class='aj...

accessing a variable from another class

Hi, Very simple question but I can't do it. I have 3 classes: DrawCircle class import java.awt.*; import java.awt.event.*; import javax.swing.*; class DrawCircle extends JPanel { private int w, h, di, diBig, diSmall, maxRad, xSq, ySq, xPoint, yPoint; public DrawFrame d; public DrawCircle() { w = 400; h = 40...

validation with variable variables not working

$method = 'post'; $method = strtoupper($method); echo $method.'test1'; $method = '_'.$method; echo $method.'test2'; $method = $$method; echo $method.'test3'; Why doesn't this print the content of $_POST between 2 and 3? ...

How can I perform a substitutions on multiple variables whose names I don't know ahead of time?

I'm working on a Perl script where the user adds a number of set variables at the beginning of the script, all prefixed with $XX, as seen below. The user-set variables, however, need to go through a short transformation function to clean them up. Is there a way to run the sub on all the variables with the $XX prefix? my $XXvar1 = "some...

How can I access variables that are named sequentially by a loop while still inside of the loop?

I'm trying to understand if it's possible to create a set of variables that are numbered based on another variable (using eval) in a loop, and then call on it before the loop ends. As an example I've written a script called question (The fist command is to show what is the contents of the variable $tab) (23:32:12\[[email protected]) [~/bin]$ ...

How would I reference a global variable in my UIView ?

I have a UIView which is accessed by two different View Controllers. Whenever the user presses a button through the view controllers, I increment/decrement a shared variable like: -(void) viewWillAppear:(BOOL)animated { [[self appDelegate] sharedData].count++; } The shared variable gets created and initialized in the app delega...

SSIS save string variable to text file

It seems like it should be simple but as of yet I havent found a way to save the value stored in an SSIS string variable to a text file. I've looked at using the flat file destination inside of a data flow but that requires a data flow source. Any ideas on how to do this? ...

How can I pass variable parameters into a Javascript Function using Excel VBA

Hi, I'm not sure if I have the correct terms above, but what I'm trying to do is call a Javascript function passing parameters into it from an Excel File, so the function will run and list the items in the next textbox, allowing me to choose the correct entry in that textbox, which then chooses the final box. Here is the code that I hav...

[XSLT] Choose statement messing up my variable?

I've got a choose statement that should be setting my variable but for some reason the code, though it works elsewhere, does not work in this instance. Here's my XSLT: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; <xsl:param name="url-show"/> <xsl:param name="...

Problem with scoped local variables and conditionals

Hello, I am trying to construct method which returns a boolean: public boolean isStringValid(String s){ boolean isValid; String temp = null; // only combinations of 'A','B','C' are allowed for (int i = 0; i < s.length(); i++) { temp = s.substring(i, i+1); if (temp.equals("A")|temp.equals("B")|temp.equals("C")){ isValid= t...

c# main method ignores string variables

Hi, I've been given a small c# project to write, which basically is to wrap a few dlls in a console application. I've hit what I see as a weird problem. I've declared a couple of local variables within the main method to use. The idea is that when the arguments are parsed they values are store in these variables ( the arguments are...

C# ASP.NET - a variable that's accessible from any function, and is different to any user?

I need a variable that is available from any function in my code, but is different to all users. so i wrote: public class classedelcappero { private string frasehiragana = String.Empty; public string ohiragana { get { return frasehiragana; } set { frasehiragana...

Calling PHP variables from inside a MySQL Database

I'm currently in the middle of working on a CMS system that builds the website straight from information saved in a MySQL database. Here's the problem I'm having: Inside the CMS the user enters coding for a template the frontend of the site (frontend.php) calls the variable where the layout is stored ($template_header) The frontend a...

Clojure Variables and Looping

From googling around, I found that using while loops or using variables is discouraged. Now I implemented a very simple algorithm that will read characters from an inputstream and parse accordingly: if input is 10:abcdefghej it will parse out 10 then read next 10 bytes after the colon. The thing I am kinda lost with is how I can refact...

Fortran Compiler Terminology: Dummy Variables and Attributes

Can someone explain to me what sort of an abstraction in the parser / compiler a dummy variable or attribute corresponds to? PURE SUBROUTINE F(X, Y) IMPLICIT NONE REAL, INTENT(INOUT) :: X, Y, C C REAL :: A, B C REAL, SAVE :: C = 3.14E0 PARAMETER (C = 3.14E0, X = 32, Y = X) X = Y + 2 * ...

Python: linking/binding variables together in a dictionary

Hi all - first post, so play nice! I have a fairly basic question about Python dictionaries. I would like to have some dict value that updates when another variable is changed (or at least recalculated when it is next called) - eg: mass = 1.0 volume = 0.5 mydict = {'mass':mass,'volume':volume} mydict['density'] = mydict['mass']/mydict[...

Changing variable names with Python for loops

Hi, I was just wondering if anyone knew of a way to change variable names based off of a for loop for something like this: for i in range(3) group+i=self.getGroup(selected, header+i) so that the names of the variables change to accomodate the data. Thanks! ~Sam ...