variables

Why is it bad to make elements global variables in Javascript?

I've heard that it's no good idea to make elements global in JS. I didn't understand why. Is it something IE can't handle? For example: div = getElementById('topbar'); ...

Public Properties and Private Members C#

What are the benefits of only using public properties instead of using the public property to access a private variable? For example public int iMyInt { get; set; } instead of private int myint; public int iMyInt { get { return myint; } set { myint = value; } } Other than letting .NET manage the variable / memory underneath the ...

declaration of variable names

what is the best way to declare variable names.... in uppercase ...? .. lowercase? in which area must be declared in any case ... and what name is appropriate depending on the roll of the standard variable ... there are some variables to declare?...sorry for the question..I'm new to the world of programming ... I hope not bother .... =)...

Term to represent all possible values of a variable

Is there a term to represent a set of all possible values a variable can assume? Analogy: In mathematics a domain of a function is a set of values a function is defined on (function can take as an argument). Examples: A variable of type UInt16 can hold values in range [0-65536). Completion status (represented by a double value) c...

Modify/view static variables while debugging in Eclipse

As per the question. In the debug view, there's the Variables frame. It shows all the values of member variables of the current object, and all of the local variables, but it doesn't show any static variables of the object's class. How do I get to these? Some googling has suggested I press the button on the toolbar, but there's nothing...

Why do the variables behave so strange?

I thought an variable in objective-c is just a reference to an object somewhere in memory. So for my understanding, the result must have been "one", because at the end i assign the object's memory address of str1 to str2, and previously I had assignend the memory adress of str2 to test. NSString *str1 = [NSString stringWithCString:"one"...

Scope Of ASP.Net Variables

I'm having a bit of a weird problem to do with scope of variables. I've declared a variable in the following way: public partial class MyClass: System.Web.UI.Page { protected static int MyGlobalVariable; protected void MyFunction() { MyGlobalVariable = 1; } } And this works fine on the workings of my page. How...

Query on Static member variables of a class in C++

Sorry if this question seems trivial to many here. In a C++ code there is something as below: class Foo { public: static int bands; ... ... private: ... ... }//class definition ends int Foo::bands; //Note: here its not initialized to any value! Why is the above statement needed again when 'bands' is once declared in...

Jmeter - Regex issue with embedded variable and $

Greetings, In Jmeter's regex component, I am running into an issue when the expression has both a variable AND a literal '$'. It always returns as fail. When I replace the variable with a hardcoded value, it works fine. I have verified the variable is returning the expected value in previous call. Failed Expression: (variable and lit...

Is it bad to use class variables in a multithreaded app?

I inherited a project that needs to be mutithreaded. There is three major classes that get used in the worker threads. BASE CLASS - has an class level SqlDataAdapter and DataTable. INHERITED CLASS ONE - Uses the inherited SqlDataAdapter and DataTable. INHERITED CLASS TWO - Uses the inherited SqlDataAdapter and DataTable. Every thing s...

Batch File - Into a Variable

Hi guys Havin' problems tryin' to get the string after the : in the following two lines into two seperate variables from the bottom of a text file called file.txt for example Number of files to delete: 27 Total Total size of files to delete: 1,427 KB I just want the 27 in one variable, and the 1,427 in another. These are randomly gen...

Visual Studio Find and Replace Variables

I am trying to replace a two letter state abbreviation with text then the abbreviation. Eventually I want to find and replace the rest. How do I capture the value found? .... I tried \1 and {1} AL 32.2679134368897 -86.5251510620117 AR 35.2315113544464 -92.2926173210144 AZ 33.3440766538127 -111.955985217148 CO 39.709863142533...

Dynamic filename for SQL Server backups?

How can you insert the date in the filename (a dynamic filename) used in a T-SQL backup script? Using SQL Enterprise Manager to create and schedule a backup job, I'd like to edit the T-SQL created to change the filename of the backed up database to be dbname_date.bak (i.e. northwind_5-1-2009.bak). The next time the backup runs, it will...

Can i get this variable value in this case? (php)

Hi, I pass a variable to domain.com/index.php?user=username In my page (index.php) contains others pages like about.php, profile.php, contact.php etc.. My question is, is it possible that i pass variable to index.php, then about.php, profile.php can also retrieve the variable using $_GET['user']; method??(actually i tried, its failed,...

Using $.post within a javascript function, cannot assign value to a variable?

Hi, I'm trying to use $.post within a function, get the results, then return the function true or false based on the results of the $.post callback. However, the callback seems to occur, AFTER the return event of the parent function. Here's the current code the ret variable is always undefined but if I alert() it within the $.post callb...

Implicit typing; why just local variables?

Does anyone know or care to speculate why implicit typing is limited to local variables? var thingy = new Foo(); But why not... var getFoo() { return new Foo(); } ...

Link to all Visual Studio $ variables

I was having a look at $(Configuration),$(ProjectDir) etc in Visual Studio 2008 for Prebuild events. Is there a link to all of these variables with definition of each one of them? ...

Take input text, print to page and open new window onclick

What I need help with: My page shall take user input text, then show what was entered on the page (no alert) and open a new window on click if a match is found that would be stored in an array or var. Here is the line I am having trouble with below: onclick="insert(this.form.name.value),show();"/> Here is the code thus far: ...

Static variables in C#.

In C#, is there a way to put a static variable in a method like VB.Net? Static myCollection As Collection ...

Setting Coldfusion dynamic application variables from a query

I was horsing around and figured it would be nice to move my application variables into a table that can be loaded onApplicationStart. My intent is to allow ANT to roll out the app, and change a few settings in the database and the proverbial presto.. In my test code, the application.cfc has a simple query to call all the variable na...