variables

Miva Merchant (Miva Script) When Making A Payment Module, How Do I Retrieve The Following Variables

Order Total Billing Address Billing Zip Billing Email I am a beginning MM developer and I am finding that proper documentation for developers with Miva Merchant is very inadequate. Any help would be much appreciated! ...

Global Static Pointer Issue

This is a rather a problem from a convoluted situation. I have a static pointer sitting in one of my header files. Which is being included everywhere, this is why I put it as a static pointer. So that I can quickly initilize it in my main function so that other files can use it. The problem is this, even after I initialize it and put st...

Working with nested information in controller/views

This is a beginner's question but for some reason I cannot find the answer elsewhere. Customer has_many orders Order has_many order_items I am in customer/show.html.erb and I want my customer to manipulate order_items. Many orders have many order_items and I want to search ALL of those order_items to find those such that read == fa...

[zsh] unpack string in variable

Hi, In Bash, I can use the following code: [ "$sshcmd" = "" ] && sshcmd="ssh -someopts myhost" $sshcmd "echo hello world" In ZSH, the same code does not work because it tries to find a "ssh -someopts myhost" executable. How can I do the same thing in ZSH? Thanks, Albert ...

Accessing Ruby Class Variables with class_eval and instance_eval

I have the following: class Test @@a = 10 def show_a() puts "a: #{@@a}" end class << self @@b = '40' def show_b puts "b: #{@@b}" end end end Why does following work: Test.instance_eval{show_b} b: 40 => nil But I can't access @@b directly? Test.instance_eval{ @@b } NameError: uni...

How to do this without eval()

for (var i in variables) { eval('var ' + i + ' = variables[i]'); } Basically, I want to transfer variables properties to local variables. Is there an alternative to using eval() Or which of these is better: 1. var _ = variables; for (var i = 0; i < 100000; i++) { _.test1(); _.test2(); _.test3(); } 2. with (variab...

textbox = php variable?

I want to get value from php variable to review it in textbox what I have to write in "value": <input type="text" name="name3" size="25" maxlength="50" value=""> name: ...

[zsh] Problems with ${(z)var}

Code: HOST=localhost PORT=1234 RSYNCCMD="rsync -avP -e \"ssh -p $PORT\"" ${(z)RSYNCCMD} root@$HOST:"\"/foo\"" /bar Output: rsync: Failed to exec ssh -p 1234: No such file or directory (2) ... If I enter the same thing (rsync -avP -e "ssh -p 1234" ...) directly into the console, it works. How do I fix it? ...

What benefit is there of allowing a variable to be left uninitialized?

In many languages you're allowed to declare a variable and use it before initializing it. For example, in C++, you can write a snippet such as: int x; cout << x; This would of course return unpredictable (well, unless you knew how your program was mapping out memory) results, but my question is, why is this behavior allowed by compil...

Need an abstract trigger in MySQL 5.1 to update an audit log

I need a way to check for and pass entries into an audit log for any entries in a table that have been changed. It needs to be abstracted away from the table structure. For example: CREATE TRIGGER table1_update BEFORE UPDATE ON table1 FOR EACH ROW BEGIN DECLARE i_column_name varchar(32); DECLARE done INT; DECLARE cursor1 CUR...

Escaping in test comparisons

In the following, I would like check if a given variable name is set: $ set hello $ echo $1 hello $ echo $hello $ [[ -z \$$1 ]] && echo true || echo false false Since $hello is unset, I would expect the test to return true. What's wrong here? I would assume I am escaping the dollar incorrectly. TYIA ...

XSLT Filtering and indices on node set

Hi, I'm trying to retreive the previous node in a for-each using the preceding-sibling axis, a filter and an indexer to find it. The problem is, I only want the first item that matches the XPath in the selector however, I seem unable to apply both the filter and the indexer. The indexer seems to override the filter so I always get the ...

How to check type of variable? Python.

I need to do one thing if args is integer and ather thing if args is string. How can i chack type? Example: def handle(self, *args, **options): if not args: do_something() elif args is integer: do_some_ather_thing: elif args is string: do_totally_different_thing() ...

iPhone SDK - convert strings to call variable names

Ok, I got used to coding with PHP. I'm currently trying to do a sudoku app. Now I'm coming to a point where I need to show the proper number in the appropriate cell (UITextfield) based on the number pressed. (I have 9 buttons that correspond to 1-9 respectively) Conceptually when the used clicks on a cell, I want to: 1. put the UITextFi...

PHP - check if a variable has been set with the name of the value of another variable.

I am setting up a template system, Long story short: I need/want to check if a variable with the name of a tag has been set. the tag name is in another variable. Therefore, I need to check to see if the content of $tag (i.e. title) has a variable with the same name ($title). Any help is appreciated. Thanks. ...

What's inside a reference varible in Java?

We know that the object reference variable holds bits that represent a way to access an object. It doesn't hold the object itself, but it holds something like a pointer or an address. I was going through the Head-First Java (2nd edition) book and in the book it is written that "In Java we don't really know what is inside a refere...

Accessing Websphere 6.1 variables

I would like to get the value of the Websphere variable APP_INSTALL_ROOT from a java class. How can this be done. ...

Can a JavaScript variable be used in plain HTML? ** EDIT

What I mean is, can a variable/array declared and initialized be used in HTML, outside the <script>-tags? Fx. <script type="text/javascript"> var foo = array('placeholder1', 'placeholder2'); </script> <body> <p><!--access the variable here-->foo[0]</p> </body> How do you access the variable/array in this case? like this: <p><script ...

Terms by vocabulary in node.tpl

I've created a variable in template.php that let's me print terms by vocabulary. The problem is that I want to be able to pass in a vocabulary id to select a specific vocabulary. My code looks like this: function xnalaraart_classic_print_terms($node, $vocabularies){ foreach($vocabularies as $vocabulary){ if($terms = taxonomy...

javascript switch depending on user type

I'm trying to make one registration form for two types of attendees that have different options for registration dates and price. Here's how I'm trying to set it up: They select their type: <SELECT id=StudentType name=StudentType> <OPTION id=0 selected value=0>Please Choose</OPTION> <OPTION id=freshman value=F>Freshman</OPTION...