variables

PHP - Inverse variable variables?

I'm using an array to store the names of other arrays which are dynamically generated elsewhere. I need to loop through the "names" array and access the contents of the "named" arrays. Something like this: $names = array("one", "two", "three"); $one = array("a", "b", "c"); $two = array("c", "d", "e"); $three = array("f", "g", "h"); fore...

In Objective-C, are int variables that haven't been assigned a value nil?

Like if I have in my .h file: int index; and then in the .m file I have: if(index == nil) and I haven't assigned a value to index, will that come up true? Thanks. EDIT: I guess nil is only used for objects. So what is the state of an int that hasn't been assigned a value? ...

implicit class variable declaration in php?

Hi, I've been looking at some code and am having a hard time working out variable declaration in php classes. Specifically it appears that the code i'm looking at doesn't declare the class variables before it uses them. Now this may be expected but I can't find any info that states that it is possible. So would you expect this: class E...

MATLAB weird output

I wonder if matlab has set restriction on variable's name. fixnb21=0; for fix=1:200 if fixdur(fix)>MIN_FIX_DUR && fixdur(fix)<MAX_FIX_DUR fixnb21 =fixnb21+1 fixdur21(fixnb21) =fixdur(fix) % I wonder if we are not allowed to add 21 at the end of variables or array name ... end end The fi...

How do I change the name of a variable in a word document?

Dear reader, My application allows the user to insert information into a document (using document properties and variables). Part of this is also that they should be able to adjust the values they have previously entered. Changing the Name and Value of a document property is no problem, but apparently the variable Name has a get propert...

Get element content from a variable containing html

How do I use the DOM parser to extract the content of a html element in a variable. More exactly: I have a form where user inputs html in a text area. I want to extract the content of the first paragraph. I know there are many tutorials on this, but could not find any on extracting from variable and not a file(page) Thanks ...

Pass on function arguments to a second function.

I have two functions, one which parses all the arguments sent to the function and another that actually does something with that information. So function1() can take in any number of parameters and then uses func_get_args() to get them all and process them to come up with a string. However, I have a function2() which I want to have a si...

Assign Business entity to hidden variable

Question. Say for example if i have a business entity -> Customer, which has customerId, customerName and customerType. I have created an asp:Hidden Variable hdnCustomer to runat="server" If i wanted to serialize the value of the customer business entity (in the code behind) to the hdnCustomer then how would i do that? Also once serial...

Magento : Variable well displayed in javascript. How call it in php in the same file ?

I've built one variable (horaires_lundi) in this file : app/code/community/Unirgy/StoreLocator/controllers/Adminhtml/Locationcontroller.php ->setTitle($this->getRequest()->getParam('title')) ->setNotes($this->getRequest()->getParam('notes')) ->setStreetAddress($this->getRequest()->getParam('street_address')) ->setHorairesLundi($thi...

Alias for instance variables?

Is there a way to create aliases for instance variables (not talking about db alias attributes) other than assigning it to another instance var? For ex: @imavar alias_attribute(@hesavar, @imavar) ...

Variable assignment...

variables a, b, c and d all need to be set to 'foo'. Is there a way to accomplish this in one swooping assignment? Like: a, b, c, d = 'foo' ...

What are the advantages and disadvantages of CSS variables?

I'm faced with a business requirement that I believe may be solved by implementing CSS variables. Basically, while the front-end developers on this project are in charge of CSS implementation, the designer wants to be able to introduce different "themes" for the site. By swapping one theme for another, a range of changes (such as font-...

$_SESSION['userid'] works in one function and not the next

Hi. I can't understand why this don't work. First i have a function like this where the user name shows up: if(isset($_POST['Commit'])){ if(empty($_POST['crime'])){ echo "You didn't select the type of crime you wish to do."; }else{ (...lots of code) $name = $_SESSION['username'];` Then I have another function where the username ...

Using header("Location") from a template include file / Process include and save in variable

I am trying to figure out a way to do this: I want to have a core template file (structure.php): <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <?php include_once(NAKIDROOT."includes/head.php"); ?> </head>...

Variable Multiplication in C?

//Hydroelectric Dam Helper #include <stdio.h> #define GRAV 9.80 #define EFINC 0.9 #define EFINC2 90 int main() { //Defines all the variables to be used double height, work, mass; printf("Height of dam (in meters):"); scanf("%lf", &height); printf("Flow of water (in thousand cubic meters per second):"); scanf("%lf", &mass); ...

I have a require("config.php") with arrays, but still get Undefined variable error

Hi. I hava a function that looks something like this: require("config.php"); function displayGta() { (... lots of code...) $car = $car_park[3]; } and a config.php that look something like this: <?php $car_park = array ("Mercedes 540 K.", "Chevrolet Coupe.", "Chrysler Imperial.", "Ford Model T.", "Hudson Super.", "Packard ...

Get the GET variables from a URL String

Hey, say I have a url just being passed through my php is there any easy way to get some GET variables that are being passed through it? It's not the actual url of the page or anything. like a just have a string containing http://www.somesite.com/index.php?url=var&amp;file_id=var&amp;test=var Whats the best way to get the values for ...

rails: how do we call a variable that we can use in all the action that belongs to the same controller?

I would like to do something like using instance variables def index @balance=1000 enb def increment @balance+=1 end what kind of variable should i use? ...

jQuery: Check if character is in string.

Hi, I want the simplest way to check if an underscore (_) is in a variable using jQuery and do something if is not.. if ( '_ is not in var') { // Do } Thanks! ...

Linking time "undefined reference to " errors

Hi All, I'm having a hard time writing makefiles. I have experience in using the extern variables, when I build the project without using makefiles I get absolutely no errors and I can run the program. But from the time I wrote the makefile to build the project, I'm getting undefined reference to errors. I have more than 3 files with ...