variables

is there any way to access all references to given object?

Hello anyone has idea if and how is it possible to destroy / change php object which is referenced in many places? unset obviously destroys only one reference, and sometimes tracing all references manually is not an option. Any ideas? Maybe there is something i am missing in Reflection ? ...

How to assign a string value to a string variable in C++

Shouldn't this work? string s; s = "some string"; ...

Modifying a global variable from <a href>

I have created some code to popup a confirm dialog if a user tries to leave a page without saving their changes. However, I don't want the confirmation dialog to popup if the user has clicked the "Save" button. I have some code at the top of my file which looks like this: var confirmClose = false; window.onbeforeunload = function(evt)...

Dispatcher Timer Problem

I am trying to make a game in silverlight that also has widgets in it. To do this I am using a dispatcher timer running a game loop that updates graphics etc. In this I have a variable that has to be accessed by both by the constantly running game loop and UI event code. At first look it seemed that the gameloop had its own local copy...

problem with extern variable

I have got 2 cpp files & a header file, which I have included in both cpp files. It's like this: abc.h extern uint32_t key; a.cpp #include "abc.h" uint32_t key; int main { ............. } b.cpp #include "abc.h" int main { printf("Key: %.8x\n", key); ............. } Now when I compile a.cpp, there is no error. but when i compi...

How do I increment a variable to the next or previous letter in the alphabet in Java?

I'm relatively new to Java coding, and was looking for some help. I have a capital letter defined in a variable string, and I want to output the next and previous letters in the alphabet. For example, if the variable was equal to C, I would want to output B and D. Thanks in advance for any help. ...

problem in variables in jquery

Hi, I don't understand why I'm not getting the message as "username already exits" if type the username which is already in database. If the username in a server, then it is returning the value as "1" otherwise empty, and despite of successfully getting the value from the server based on username is present or not, and assigning the...

create variable from array actionscript 3

I'm currently trying to make a dynamic menu via an array and a loop. So when someone clicks on the first item of the array, "menu_bag_mc" it will link to the content "menu_bag_mc_frame" (or some name that will be unique to this array) that is another movieclip that will load. Below is the code I have so far: //right here, i need to make...

Why was the definition of a variable changed in the latest C++0x draft?

n3035 says: A variable is introduced by the declaration of an object. The variable's name denotes the object. n3090 says: A variable is introduced by the declaration of a reference other than a non-static data member or of an object. The variable's name denotes the reference or object. I wonder what motivated this change. Doe...

Access variable value using string representing variable's name in C++

Hello everyone, If the title was not clear, I will try to clarify what I am asking: Imagine I have a variable called counter, I know I can see its current value by doing something like: std::cout << counter << std::endl; However, assume I have lots of variables and I don't know which I'm going to want to look at until runtime. Doe...

How can I trace a variable at runtime in C#?

How can I track a variable's values as they change, at runtime, in C#? I'm interested in the same functionality that the debugger provides when I'm tracing a variable through execution steps, only that I need to call upon it from my code. Some sort of key-value observing, but for all kinds of variables(local, class, static, etc), not onl...

How do you set a variable to be an empty, but workable Jquery object?

Outside of a for I declare a variable using var list;. I use this variable inside of my for loop like so: // add the html to the list if (list == undefined) list = item; else list.append(item.contents()); item is a cloned jquery object build from a $('list_template').clone(); call (list_template is a div with <li> elements in...

Trying to reference a hash using a string value in Ruby

How would I refer to a hash using the value of a string - i.e. #!/usr/bin/env ruby foo = Hash.new bar = "foo" "#{bar}"["key"] = "value" results in foo:5:in `[]=': string not matched (IndexError) from foo:5 How do I use the value of bar (foo) to reference the hash named foo? Thanks! ...

How can you write a function that accepts multiple types?

I have a function that should work on int[] and on String[] now i have made the same function with a int parameter and an String parameter however if it has to go this way its a bit copy paste work and doesn't look very organized is there a way to solve this and put these 4 functions in 2? static public void print(String s) { ...

Oracle/c#: How do i use bind variables with select statements to return multiple records?

I have a question regarding Oracle bind variables and select statements. What I would like to achieve is do a select on a number different values for the primary key. I would like to pass these values via an array using bind values. select * from tb_customers where cust_id = :1 int[] cust_id = { 11, 23, 31, 44 , 51 }; I then bind a...

Is there special variables shared between MPI processees ?

Hello All, I'm new in MPI programming world and i'm wondering if there is some variables shared between MPI processees and accessible from any process without having to send/receive them ? Thanks ...

jQuery - dynamic variables?

Newbie question. Given the following html. <div id="mycontainer1" class="container"> <input type="text" class="name"/> <input type="text" class="age"/> </div> <div id="mycontainer2" class="container"> <input type="text" class="name"/> <input type="text" class="age"/> </div> I'm trying to create a function where I can pass an element...

Dynamic Comparison Operators in PHP

Hi All Is it possible, in any way, to pass comparison operators as variables to a function? I am looking at producing some convenience functions, for example (and I know this won't work): function isAnd($var, $value, $operator = '==') { if(isset($var) && $var $operator $value) return true; } if(isAnd(1, 1, '===')) echo 'wo...

What exactly is a variable in C++?

The standard says A variable is introduced by the declaration of an object. The variable's name denotes the object. But what does this definition actually mean? Does a variable give a name to an object, i.e. are variables just a naming mechanism for otherwise anonymous objects? Or is a variable the name itself? Or is a variab...

How to use local variables in stored procedures?

if I want to select any id from a table and want to insert it's value in another table as foreign key then how i will do it through stored procedure? ...