variables

PHP variable is not working in a Wordpress header and index file?

I have the following code in header.php to echo the body's id: <body id="<?php echo $body; ?>"> which is taken from a variable from index.php: $body = "home"; The output result is: body id="" Any suggestions to fix this? (I made var_dump($body) and the value is "home" so the variable is working) header.php: <?php /** * The Header ...

No PHP variable or include work when it is defined or called from header.php (Wordpress + Starkers Theme)

Every time I tried to define a variable or include a file in header.php nothing happens in the final output index.php. For instance, I defined a $test variable in the header.php (the last line): <?php /** * The Header for our theme. * * Displays all of the <head> section and everything up till <div id="main"> * * @package WordPre...

Find references of Path Variables used in ISM file

Hi I have one ISM file created using Installshield. In Path Variables Explorer, I can see some variables defined. How can find if they are used anywhere in the ISM ? I want to remove variables if they are unused. I am using Installshield 11.5 Adminstudio. Thanks in Advance. ---Sambhaji ...

Static char array not found and not working with strncpy?

char * function decode time() { tm *ptm; //time structure static char timeString[STRLEN]; //hold string from asctime() ptm = gmtime( (const time_t *)&ltime ); //fill in time structure with ltime if(ptm) { strncpy(timeString, asctime( ptm ), sizeof(timeString) ); //EDIT sprintf(test, "Sting is: %s", tim...

Problem Setting Variable value in MySQL Procedure

Having trouble setting the value of a declared variable in MySQL. If I run the following in MySQL Command Line it all works great: SET @numberOfMonths = (SELECT COUNT(\*) FROM (SELECT DISTINCT months WHERE year = 2010) as A); SELECT @numberOfMonths; So it returns 6 for this particular example. If I do the following I don't have ...

How to set environmental variable(s) with javascript ?

Hi, I need to display 2 or 3 environmental variables in a webpage. Each variable will have a text box next to it to change the value and a button to initiate the change. I am new to javascript. Please help me, thanks in advance. ...

Use of module private member instead of Application or Cache object in ASP.NET project

In an ASP.NET web app written in VB.NET, I need to load and store a large read-only hash table that is frequently accessed by the application. It only needs to be loaded once on application start, is never updated and can be accessed by any session at any time. If I load the hash table into a private member in a (global) module, a look...

What is the difference between var foo = new Love(); AND object foo = new Love(); ?

Hi, As I am not familiar with implicit typing; can you please tell me the main differences between: var foo = new Love(); AND object foo = new Love(); ...

adding jquery onto a link

I'm having some trouble adding a javascript variable onto the end of my link here's my code var locid = $.trim($(this > '.locid').text()); $(this).prepend('<a class="booknow2" href="../../availability/default.aspx?propid=' + locid + '"><span>Check availability &raquo;</span></a>'); Any help would be appreciated Thanks Jamie ...

Javascript variable function name

I have the following code in Javascript: jQuery(document).ready(function(){ var actions = new Object(); var actions; actions[0] = 'create'; actions[1] = 'update'; for (key in actions) { // Dialogs var actions[key]+Dialog = function(){ $('#'+actions[key]+'dialog').dialog('destroy'); ...

Python variable weirdness?

What's going on with my Python variable? old_pos seems to be linked to pos: Code: pos = [7, 7] direction = [1, 1] old_pos = pos print 'pos = '+str(pos) print 'old_pos = '+str(old_pos) pos[0] += direction[0] pos[1] += direction[1] print 'pos = '+str(pos) print 'old_pos = '+str(old_pos) Output: pos = [7, 7] old_pos = [7, 7...

javascript add variable onto end of link

I'm trying to add a variable i created on to the end of one of my links but not sure how to do it? <a href="../../availability/default.aspx?propid=' + myvariable + '">Link</a> Any ideas? Thanks Jamie ...

How do I create a string with Quotes in it in C#

Hello, C# newbie here. I am trying to set a C# variable as follows. string profileArg = @"/profile ""eScore"" "; The end result is that I want the variable to contain the value /profile "eScore" There should be a space in the string after the "eScore" How do I do it? Seth ...

Should I use variables or arrays, or an nsdictionary in Objective c

Hi everyone, I was wondering if I should use an nsdictionary to hold all of the values that my program uses. Or, I could stick with using many variables for each value. If I use an NSDictionary/array I could release it all at once, rather than a bunch of variables. Unfortunately I am dealing with many memory leaks, so I thought that u...

iPhone SDK Nonatomic and Atomic

Really quick and simple question: In Objective-C what is the difference between nonatomic and atomic? like when declaring properties like "@property (nonatomic, retain) id object"? ...

Bash: Testing if a variable is an integer

Hello, I have a bash scripting question please. I would like to test if my variable $var is actually an integer or not. How can I please do that? Thank you very much, Jary ...

How do I include a yet to be defined variable inside a string? PHP

For sake of performing less database queries and for clarity of code, I'd like include a yet to be defined variable inside a string. Later in the page, the variable will be declared and the string printed and evaluated. How do i do this? $str="This $variable is delicious"; $array=array("Apple","Pineapple","Strawberry"); foreach($array...

Why are variables declared with "our" visible across files?

From the "our" perldoc: our has the same scoping rules as my, but does not necessarily create a variable. This means that variables declared with our should not be visible across files, because file is the largest lexical scope. But this is not true. Why? ...

Prolog - problem with a variable

Hi, i have a problem with a variable in Prolog. I must resolve the tantrix domino in prolog, this is a game size by 56 hexagonal tile with 4 different color on sides. The tantrix domino consist to align the different tile so the colour match. Each tile can be rotated to match the colors with the previous tile. In Prolog i have three d...

PHP / Wordpress - passing variables to create_function()

Hi How do I pass a variable to create_function() ? I have something like this: function my_hook_function(){ $var = 10; apply_filters('hook', $var); return $var; } $variable = 5; $function = create_function('', 'return $variable;'); add_filter('hook', $function); echo my_hook_function(); but it doesn't work :( theoreticall...