variables

What is the difference between a static variable in C++ vs. C#?

Do static variables have the same or similar functionality in C# as they do in C++? Edit: With C++ you can use static variables in many different contexts - such as: 1) Global variables, 2) Local function variables, 3) Class members - Would similar usages in C# behave similar to that of C++? ...

Using session variable instead of hidden fields in aspx pages

I would love to use hidden field value but I think I am missing something to do. Since every page refresh or staying a little bir longer on the page, the value is missing. http://stackoverflow.com/questions/1283650/asp-net-mvc-make-session-entirely-cookie-less-hidden-form-field ? how can i do the this cookiles suff above...? I u...

How does one extract the name of a variable in a function that is called from another function in R?

My question is how to extract the name of a variable from a function that is called in another function in R? To illustrate, here is an example: a <- function(variable) { print(deparse(substitute(variable))) internala(substitute(variable)) } internala <- function(variableXX) { namex=deparse(substitute(variableXX)) ...

Duplicate <meta> in Drupal variable $head

Hey Everyone, I am trying to customize the $head variable in my page.tpl.php template, because there are two instances of <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> appearing, which I believe is affecting the site from being validated u...

Pass img src via jquery to new div

Hi folks I am trying to create a "simple" modal type of operation. When a user clicks on an image it opens a mask over the screen (done that) and displays the image (can't do that). This is ment to be very simple, no need for galleries etc. hence just a simple effect. The code generated for the mask is $j(document).ready(function(){...

jQuery access variable in <body> tag?

Essentially I need to specify a JQuery variable in my webpage's body tag, and have a function in my head tag read it. This is the function in my head tag (simplified): <script type="text/javascript"> $.noConflict(); jQuery(document).ready(function($) { $('a.paymentAdd').click(function(){ alert ("rowCount 1 = " + rowCount); rowCoun...

Using variables as value and not as reference

Hi, I'm having some troubles using Session Variables as they are being used as Reference and I want to use them as value. I got to this debuging my solution and I created something like: DataTable dt = (DataTable)HttpContext.Current.Session[ "SearchReturn-DataTableSchema"]; // Adding Rows of Data to DataTa...

Python: Using vars() to assign a string to a variable

I find it very useful to be able to create new variables during runtime and create a dictionary of the results for processing later, i.e. writing to a file: myDict = {} for i in range (1,10): temp = "variable"+str(i) vars()[temp] = myFunctionThatReturnsData() # variable1= data1, variable2 = data2,etc. myDict[temp] = vars(te...

Where can I legally declare a variable in C99?

When I was first introduced to C I was told to always declare my variables at the top of the function. Now that I have a strong grasp of the language I am focusing my efforts on coding style, particularly limiting the scope of my variables. I have read this SO question on the benefits to limiting the scope and I came across an interesti...

Defining Variable's Data Type While Assigning New?

i'm linked a MovieClip class object to my project, and i will programatically add it to the display list. is there a difference between defining the variable's data type and not doing so? neither produce a runtime error. //var datatype var rectangle:Block = new Block(); addChild(rectangle); //no var datatype var rectangle = new Block...

ASP.NET variable scope

hey all, im really new to ASP.Net and still havnt got my head round most of the concepts, im really having problems with variable, when creating a desktop application, any variable created in code for example int n = 10; this variable will be there until the program is running right. but in asp iv created variables which are suppose...

Accessing member variables through boost lambda placeholder

I'm trying to print the second member variable of all items in an stl map using a lambda expression map<int, int> theMap; for_each(theMap.begin(), theMap.end(), cout << bind(&pair<int, int>::second, _1) << constant(" ")); but this is not compiling. I essentially want to de-reference the placeholder. Any idea what I'm missing...

SESSION variable show before its defined.

Hello. Im standing out with a issue, that the SESSION variable is "showing" before its defined.. Index.php is my site, where there is a design and inside that there is a frame. Now, index.php have this: <div id='message2' onclick="closeNotice2()" style="display: none"> <? echo $_SESSION["user_message_123456"]; ?> </div> Inside the f...

What is the difference between "instantiated" and "initialized"?

I've been hearing these two words used in Microsoft tutorials for VB.NET. What is the difference between these two words when used in reference to variables? ...

Why can't i set a member variable of an interface class as follows.

So i have a interface class class interfaceClass { public: virtual void func1( void ) = 0; virtual void func2( void ) = 0; protected: int m_interfaceVar; } and a class that inherits from it. Why can't i set the member variable of the interface class as follows. class inhertitedClass : public interfaceClass { inher...

Javascript: Get access to local variable or variable in closure by its name

Hi all. We all know that you can access a property of a javascript object by it's name using the [] syntax.. e.g. ob['nameOfProperty']. Can you do the same for a local variable? Another answer here suggested the answer is to use window['nameOfVar']. However, this only worked for the poster as he was defining variables at window-level ...

How do I do multiple assignment in MATLAB?

Here's an example of what I'm looking for: >> foo = [88, 12]; >> [x, y] = foo; I'd expect something like this afterwards: >> x x = 88 >> y y = 12 But instead I get errors like: ??? Too many output arguments. I thought deal() might do it, but it seems to only work on cells. >> [x, y] = deal(foo{:}); ??? Cell content...

two variables in one text box - flex - actionscript-3

quick question.. I'm trying to make two variables appear in one text box but I'm not sure how to do so Here's what I have. title1.text = dg_post.selectedItem.post_title; date1.text = dg_post.selectedItem.post_date; I'd like to have post_title and post_date appear in the title1 box and remove the date1 box altogether. ...

Using variables for referencing objects in vb.net (Visual Studio 2008)

Hello, I'm having a problem when using variables in object names. I have a Public class which is called "Tank" In that class, there is a public property called "direction" of an integer type. I keep getting the error: "Tank is a type and cannot be used as an expression" What I'm doing wrong here ? Public Class mainroutines() ' Creat...

Javascript: How to make this var. work globally.

I am having an issue with this variable not wanting to work outside the function and I just can't understand why! here's the code: globalData = new Array(); // // Colors // if ( settings.category == 'colors' ) { $.getJSON(colorLoversURL, function(data) { for ( var i in data ) { var localData = data[i].hex; globalData...