variables

C# Variables and Namespaces

Hello, I am new to C# and programming in general my question is how do you call a variable that is in a different namespace? if I have this code public void servicevalues(string _servicename) { string servicename = _servicename; string query = string.Format("SELECT * FROM Win32_Service WHERE Name ='{0}'", servicename); Management...

passing variables in a mvc pattern

Hello, I have built a system that conforms to the mvc pattern in PHP. The controllers and actions are part of the urls in my application. So I have: www.example.com/controller/action/ So now I am looking for a way to pass on variables. For forms I just use the post method, but sometimes I would just like to link to a different page an...

Adding conditional formatting and punctuation to a set of variables

I often need to list items separated by comma, space or punctuation, addresses are a classic example (This is overkill for an address and is for the sake of an example!): echo "L$level, $unit/$num $street, $suburb, $state $postcode, $country."; //ouput: L2, 1/123 Cool St, Funky Town, ABC 2000, Australia. As simple as it sounds, is the...

Static Variable problem On JQuery

if(i==0){ $(document).ready(function(){ $("div#rozet").hover(function(){ $(this).hide("fast"); $(this).animate( { top:'+45px', left:'+500px'}, {duration: 1} ); $(this).show("slow"); $(this).stopall(); }); i=1; } if(i==1){ $("div#rozet")....

Accessing User's Objects in Different States (Ruby on Rails, RESTful Authentication)

In my Rails application I have a User model (more or less built by RESTful Authentication), and several other models belonging to the user. So let's say, for example: user has_many :posts post belongs_to :user Anywhere in the users resource I can access the user variables as I would expect. @user.name, @user.email, @user.login, etc. a...

Javascript variable passing

Can anyone help me with my project? How will I be able to call the textfield details in javascript? function AddPushpin() { var shape = new VEShape(VEShapeType.Pushpin, map.GetCenter()); shape.SetTitle(**//it should be coming from a textfield//**); shape.SetDescription('This is shape number '+pinid); pinid++; map.Add...

Pass string from html inside <object> into Actionscript

I have a flash movie that is being used for several websites. On each site I would like to specify a different XML file inside the markup. How do I grab that string and use it in ActionScript? in markup i want to do this: <object ... <param name=FlashVars value="urlXML=myXML.xml" /> </object> in actionscript 3.0, im trying to do ...

How to deal with ThreadPool and member variables?

Hello everyone, I am a bit new to ThreadPool in .NET. I was wondering, if I can only send one object to my callback method, how am I able to access the class member variable to call its methods? (see customClass in CallBack()) And how would I load the data from customClass? Do I pass the customClass to a different CallBack method? i...

Why compiler is not giving error when signed value is assigned to unsigned integer? - C++

I know unsigned int can't hold negative values. But the following code compiles without any errors/warnings. unsigned int a = -10; When I print the variable a, I get a wrong value printed. If unsigned variables can't hold signed values, why do compilers allow them to compile without giving any error/warning? Any thoughts? Edit Comp...

How do you use variables in a simple PostgreSQL script?

For example, in MS-SQL, you can open up a query window and run the following: DECLARE @List AS VARCHAR(8) SELECT @List = 'foobar' SELECT * FROM dbo.PubLists WHERE Name = @List How is this done in PostgreSQL? Can it be done? ...

Ruby Equivalent of C++ Const?

I'm learning Ruby in my spare time, and I have a question about language constructs for constants. Does Ruby have an equivalent of the C++ const keyword to keep variables from being modified? Here's some example code: first_line = f.gets().chomp() column_count = first_line.split( %r{\s+} ).size() print column_count, "\n" I'd like to...

How do you check if a variable is an array in JavaScript ?

I would like to check whether a variable is either an array or a single value in JavaScript. I have found a possible solution... if (variable.constructor == Array)... Is this the best way this can be done? ...

Having 2 variables with the same name in a class that extends another class in Java

Hello everyone. Following is a part of my code for a project: public class Body extends Point{ public double x, y, mass; public Body() { x = y = mass = 0; } public Body(double x, double y, double mass) { this.mass = mass; this.x = x; this.y = y; } } public class Point { public double x; ...

SQL Server 2000 temp table vs table variable

What would be more efficient in storing some temp data (50k rows in one and 50k in another) to perform come calculation. I'll be doing this process once, nightly. How do you check the efficiency when comparing something like this? ...

Identifying the types of all variables in a C project

I am trying to write a program to check that some C source code conforms to a variable naming convention. In order to do this, I need to analyse the source code and identify the type of all the local and global variables. The end result will almost certainly be a python program, but the tool to analyse the code could either be a python...

ID, id, or Id?

I use camelCase in my code and database field names, etc, but with fields that have Id at the end, it always ends up being hard to read. For example, itemId, teacherId, unitId, etc. In these cases I consider breaking convention and writing itemID, teacherID, or unitID just for improved readability. What do you do and what's a general, b...

PHP How do I retain all GET vars in links?

I have some PHP code that generates dynamic tables of data on the fly. By clicking various links you "refine" the tables of data. What I'd like is each of these links to retain the current GET information and add to it. IE: $allPreviousVars = ???; // Could be 20+ vars echo "<a href='".$allPreviousVars."&newVar=2'>Link</a>"; I can thin...

ant: list folders on command line

I'm new to ant. I'm looking to a way to do this I have a folder, with a variable number of subfolders. Suppose subfolders are s1,s2,s3...,sN (N is not known) I need to create and execute this command line java -jar myjar.jar s1\ s2\ s3\ ... sN\ I would like to use standard task, but I do not know how to list folders on the command l...

Can I create a coda slider navigation with variable height for its content?

Hi, Most people know the Coda Slider effect well these days but even with googling and doing a search here I could not find my answer. Question How can I create a Coda Slider style navigation that uses horizontal sliding/scrolling but adaptes its height during the sliding animation to the height needed for the content? For instance, t...

Display all currently defined variables

Is this possible without a debugger? I mean, we have $_POST, $_GET, $_SESSION, etc. I'm looking for something like $_CURRENT_VARS ...