variables

php variable in html no other way then: <?php echo $var; ?>

hi i work a lot in mixed html and php and most time i just want solid html with a fet php variables in it so my code look like this <tr><td> <input type="hidden" name="type" value="<?php echo $var; ?>" ></td></tr> wich is quite crap isnt there little code something like: <tr><td> <input type="hidden" name="type" value="$$var" ></td><...

Using Stata Variable Labels in R

I have a bunch of Stata .dta files that I would like to use in R. My problem is that the variable names are not helpful to me as they are like "q0100," "q0565," "q0500," and "q0202." However, they are labelled like "psu," "number of pregnant," "head of household," and "waypoint." I would like to be able to grab the labels ("psu," "way...

When inside a class, is it better to call its private members or its public properties?

This is something that I've always wrestled with in my code. Suppose we have the following code: public class MyClass { private string _myVariable; public string MyVariable { get { return _myVariable; } set { _myVariable = value; } } public void MyMethod() { string usingPrivateMember = _myVariab...

Is there a maximum limit to the size of a variable that should be allocated on a stack?

i declared a struct variable in C of size greater than 1024bytes. On running Coverity (a static code analyzer application) it reports that this stack variable is greater than 1024 bytes and therefore a cause of error. I'd like to know if I need to worry about this warning? Is there really a maximum limit to the size of a single stack var...

Variable classname in javascript

Hello, Is there a way to make a variable classname in javascript. In php the next is allowed: $classname = "klasse"; $class = new $classname(); Tom ...

Changing value of ruby variables/references

Hi there, I just stumbled upon something i don't quite understand. I know that variables in ruby are references. So that awesome stuff is possible. But when i pass a variable to a method, it behaves strangely: my_var_a = "nothing happend to me" my_var_b = "nothing happend to me" def parse_set(my_var_set) my_var_set = "my value chang...

How to set a variable attribute of an xml element in actionscript 3?

Something that should be very easy has been the quest of my day. How do you set a variable attribute of a xml element? This is what I expected to work: xmlElement.attribute(variableAttr) = "the variable attribute is set to this string"; However, I'm getting some error that this value can only be retrieved as a reference and not set....

What does it mean when a variable appears red in the visual studio C++ debugger?

what does it mean when a variable appears red in the visual studio C++ debugger? I assume not good. Thanks. ...

How can I get phpmail to send to the right user and also limit the ammount of emails for certain users? Part 2.

Thanks to Anthony's advice I've tried to simplify my logic and syntax of the goal I am trying to achieve which is when a blog is written, the AUTHOR gets notified by php mail that someone other than himself comments. When the AUTHOR comments everyone else who commented except him gets a different email. When another user comments, the AU...

Declarative access to structured PHP variable without foreach loops

Background Assume I have the following nested variable in PHP. $data = Array( Array('lname' => 'Simpson','fname' => 'Homer','age' => '35','motto' => '_blank_'), Array('lname' => 'Simpson','fname' => 'Marge','age' => '34','motto' => '_blank_'), Array('lname' => 'Flintstone','fname' => 'Fred','age' => '33','mo...

How do I access these PHP class variables?

Hello SO: I have two php files, one manages database connection and the other retrieves data from the database. I am writing this from scratch as a learning experience, and granted it is 5am but for some reason I cannot access the variables I need to. My database connection file is as follows: <? class mysqlManager { var $dbhost ...

Have loaded a php variable into flash but cant apply it in a function...

hi I have created an actionscript function which stops an animation on a specific frame which works fine. I have then loaded in a php file with a variable which will contain the number for the frame i want the animation to stop on. This has loaded in fine and i have loaded it in a function. what i cant seem to do is to get the variable i...

create private var yada:Whatever; depending on xml count

I am trying to declare private variables that will be used elsewhere in my flex mxml main application. But I need to only create the variables when their is an equal number in my xml file. My xml snippet looks like this: <POIs> <location> <name>jane</name> <lat>12345</lat> <long>12345</long> ...

Create variable during run-time in Objective-C

I currently have a loop which iterates through an NSArray of NSString objects. I would like an NSString variable to be created on each iteration of the loop, using the currently evaluated NSString object's string value (from the NSArray) as the name of the variable. This is probably best explained through example: for (i = 0; i < [array...

JQuery - accessing a VAR in a function which I will need in another function?

Ok so in my html/js i have a form that updates based on the users previous selection. On the last stage i have a select menu where the user will choose their city. I have stored the value of the selected item in my Options list with the id #myCity to the following. ('#myCity').change(function(){ var CityValue = $("#myCity").val(); ...

Static variable of procedure in Delphi

What is difference in memory management of variables a and b? Are they both similar static variables but visibility of b is local? Is it ok to declare static variable in procedure or function? const a: string = 'aaa'; procedure SubMethod; const b: string = 'bbb'; begin a := a + 'a'; b := b + 'b'; end; ...

Local function variables initialization takes processing time?

Local function variables initialization takes processing time? e.g.: void foo ( void ) { char *str = "hello"; int num = 3; } Or, like global variables, their value is assigned already in the read-only section of the binary? In other words: Would it be time-consuming to invoke a function that has many local variables, comparing...

PHP class variable set/get problem

I've attempted to write a PHP class that gets the uptime of my Linux machine. It will get the uptime correctly, but I have an if statement that determines whether or not the load average is "high" or not and set a warning code, and it doesn't seem to be working (it stays at 0). I've included all of the code here from the class (50 or so...

Dynamically picking variable from a class

I'm trying to get data from a class in php5, where the data in the class is private and the calling function is requesting a piece of data from the class. I want to be able to gain that specific piece of data from the private variables without using a case statement. I want to do something to the effect of: public function get_data($f...

Microsoft C Compiler: Inline variable declaration?

I'm writing C in Visual Studio 2010. The compiler doesn't seem to want to let me use inline variable declarations. The following code produces an error: unsigned int fibonacci_iterative(unsigned int n) { if (n == 0) { return 0; } if (n == 1) { return 1; } unsigned int prev_prev = 0; // error unsigned int prev = 1; // error u...