variables

variable compression and expansion in java?

I would like to create a series of new windows when I click labels containing information. I want these windows to be orphaned. Is there a way to pass a static variable to a class and tell it to keep monitoring the status of that variable? Basically I want to say NewOrphanedWindow.main(StaticClass.ValueToMonitorFromNowOn); Is t...

What variable is changing?

Hi, Please tell me what variable is changing on the loop so I can maybe create a if else statement. I'm not a developer so, I really need help. Here's the code $(document).ready(function(){ $("#health").show(); $("#health").hide(); $("#billing").hide(); var arr = [ $("#pension"), $("#health"), $("#billing") ]; var cur = 0...

jquery make variable public from .click

I am trying to pass a variabel from a .click event to a colorbox plugin like so: $('.w_price_assess p.price_report > a').live('click', function() { var $reportRef = $(this).attr('href'); var $reportID = $reportRef.substr($reportRef.lastIndexOf('/') + 1); return false; }); I need $reportID to be visible to an AJAX call ...

Is this a php variable variable bug?

Is there a logical explanation to this? <?php $$a = 'hello world'; echo $$a; //displays hello world echo $$aa; //displays hello world echo $$aaa; //displays hello world ?> ...

Java code snippet - playing with variable final - explanation required.

final Integer a = 1; Integer b = a; System.out.println("a: " + a); // prints 1 System.out.println("b: " + b); // prints 1 b++; System.out.println("a: " + a); // prints 1 System.out.println("b: " + b); // prints 2 b = b + 1; System.out.println("a: " + a); // prints 1 System.out.println("b: " + b); // prints 3 b = 10; System.out.printl...

C variable variables

in PHP, I have something like function doStuff($in, $value) { $var = "V_" . $in; $$var = $value; } Is there a way to do something similar in C? Basically I'm trying to figure out how to make a sort of library to make working with IO pins on an AVR easier. So for example, there would be a function to set a particular pin ...

Xcode debugger stopped displaying local and self variables

I don't understand this at all, but I can no longer see any locals or ivars when debugging my iPhone app with Xcode 3.2.3. Everything seemed normal until yesterday afternoon, and now I just see the globals and registers, which are not of much interest to me. HAs anyone else had this experience? I feel like I have gone crazy. How can the...

groovy "def" declarations translates to C language?

i know this sounds totally ridiculous at the moment but trust me, i want something like "$variable" in php or "def" in groovy, by means of my approach is an automatic variable "data type" identification to IMPLEMENT into c language. for example: "def" is a replacement for a type name. In variable definitions it is used to indicate that...

Can I overload variables in Java?

I'm writing a class to represent a matrix. I want it to look something like this: public class matrix { private int[][] matrix; private double[][] matrix; //And so on and so forth so that the user can enter any primitive type and //get a matrix of it } Is this legal code, or would I have to have different variable name...

Python: Accessing Values For Dict Key Made Using Variables

Hi I've been coding a console version of Minesweeper just to learn some of the basics of Python. It uses a coordinate system that is recorded in a dictionary. Now, I have been able to implement it successfully but accessing or assigning a value to a specific coordinate key using variables for the "x,y" of the coordinate seems... clunky. ...

What is the difference between “=” and “=&” when assigning variables?

Hi guys.. I am trying to figure out the difference between $a=&$b and $a=$b. I know & make the variable to be a reference variable. But the following test gave me the same result. Can anyone explain the difference? Thanks. $a=5; $b=6; $a=&$b; echo $a; //6 $a=5; $b=6; $a=$b; echo $a; //6 ...

php class static variables ,concat

is have 2 class first <?php require_once( 'error/DisconnectedHandler.php' ); require_once( 'error/NoSuchRequestHandler.php' ); class NetworkManager { public static final $RESPONSE_JUMP = 1000; .... second <?php require_once( '../NetworkManager.php' ); class DisconnectedHandler implements Handler{ pu...

fadeIn() in a variable jQuery

Hi everyone, I (i'll try) explain my problem :p I want to use a variable javascript with php like this: var Effet = '$effet'; this return: an effet for jquery, exemple: fadeIn Later in js file, i want to apply the effect on element. I tryed: $('div#something').hide().append(data).Effet+'(1000)'; But this doesn't work... i can't...

save php variables permanently without database

In the admin area of my site there is a form which is for the hostname, username and password for the mysql database that the site uses. Currently these values are hardcoded into a php class. But who can I link it so the form can edit the variables in the php class (and keep the results on the server, in other words the variables are har...

jQuery Validation Plugin - Submit only after checking a variable

I have done some small validation myself and end up with either - myvalid = true or mayvalid = false. How can add this check to the validation I am doing already on my form using the Validation Plugin? ...

Better to get value from PHP variable or from cookie?

Assume that there is a PHP variable: $variable = 'username'; cookie value = 'username' Which one is better to access? get_cookie() or just use $variable? I have a lot of code using get_cookie('cookie_name') (a CodeIgniter function) instead of using variables. Will it increase performance if I change it to access $variable instead of...

Ruby: How to get a local's and/or a instance varialble's by them self?

From example: local_var = "Thanks!" @instance_var = "Thank you ,too" Then how can I get the local_var and instance_var part by them self. I mean weather there is a method maybe called get_self_name to get the name of himself: local_var.get_self_name # => 'local_var' @instance_var.get_self_name # => '@instance_var' or => 'instance_var...

hidden variables for buttons causing problems

Here is my code in php. I have a php creditcard confirmation page, with 2 button, edit details and submit. I have an init file which will perform tasks based on what cc_confirm is and what editval is, confirm and editing details respectively. if($_POST['cc_confirm1']=='y' && $_POST['$editval']!='y' && !isset($editval)) {echo '<input n...

jQuery /Javascript - json to string variable dump

Is there a quick function to covert json objects received via jQuery getJSON to a string variable dump (for tracing/debuggin purposes)? ...

Detecting declared package variables in perl

Given # package main; our $f; sub f{} sub g {} 1; How can I determine that $f, but not $g, has been declared? Off the cuff, I'd thought that *{main::g}{SCALAR} might be undefined, but it is a bona fide SCALAR ref. Background: I'd like to import a variable into main::, but carp or croak if that variable is already declared. EDIT Ad...