Can I use zend Registry to save variable to use in other controller?
this is my code that don't work in another controller:
Zend_Registry::set('id', $Id);
Hi Guys,
I'm looking to test some code I've written and to do so I need to construct a variable of type Location and to give it a long / lat value but I'm unsure how I would do so. Any ideas?
How do I export an environment variable from within a Ruby script to the parent shell? For example, implementing a naïve implementation of the /usr/bin/read utility:
#!/usr/bin/ruby
varname = ARGV[0]
ENV[varname] = STDIN.gets # but have varname exported to the parent process
I am trying to number some rows on a bridge table with a single UPDATE/SELECT statement using a counter variable @row. For example:
UPDATE teamrank JOIN (SELECT @row := @row + 1 AS position, name FROM members)
USING(teamID, memberID) SET rank = position
Is something like this possible or do I need to create a cursor? If it helps, I am using MySQL 5.
I have constructed the following -
`$format_$game_$name_$season`
4 variables with underscores between. Should this work, or will it act as one variable?
THankyou
I have a level class and a Enemy_control class that is based off an vector that takes in Enemys as values.
in my level constructor I have:
Enemy tmp( 1200 );
enemys.Add_enemy( tmp ); // this adds tmp to the vector in Enemy_control
enemys being a variable of type Enemy_control. My program crashes after these statements complaining about some destructor problem in level and enemy_control and enemy.
Any ideas?
Hey guys,
a quick question, I have data of the following sort:
Ticker _ Date _ Fem Analyst (dummy 1 if true)
AA _ 04/2001 _ 1
AA _ 04/2001 _ 1
AA _ 04/2001 _ 1
AA _ 05/2002 _ 1
AA _ 05/2002 _ 1
AA _ 07/2002 _ 0
AA _ 04/2003 _ 1
and so on.. What I want to receive is the following:
Ticker _ Date _ Number of fem analyst
AA _ 04/2001 _ 3
AA _ 05/2002 _ 2
AA _ 07/2002 _ 0
AA _ 04/2003 _ 1
So an easy counting algorithm that allows me to count for the number of analysts per company per month (the date is in 01/04/2002 format but I also have a month count variable which can be used too)
Any ideas?
how i suppose to do to read global variable in actionscript 2.0?
i've declared _global.MyVar="dummyContent";
may i write MyVar="anotherContent";?
or it should _global.MyVar="anotherContent"?
I have a text file test.txt with the following content:
text1
text2
And I want to assign the content of the file to a UNIX variable but when I do this:
testvar=$(cat test.txt)
echo $testvar the reult is:
text1 text2
instead of
text1
text2
Can someone suggest me a solution for this?
In this code snippet:
use strict;
use warnings;
use Data::Dumper;
my $r = [qw(testing this thing)];
print Dumper($r);
foreach my $row (@({$r})
{
print "$row\n";
$row .= 'mod';
}
print Dumper($r);
print Dumper(@({$r});
I figured out that the '(' after the '@' in the foreach is causing this not to loop correctly. I have no idea why this code even works as there is no ending parenthesis. What is this doing? It looks to be creating a new variable on the fly, but shouldn't 'use strict' have fired or something?
Please help explain what that '@(' is doing and why it still runs without an ending parenthesis.
I added following line of code in .vimrc
let g:jslint_status = 'enabled'
if exists("jslint_status")
echo jstlint_status
else
echo 'not found'
endif
Error message
E121: Undefined variable: jstlint_status
E15: Invalid expression: jstlint_status
What am I doing wrong?
Hi,
I have been working with C# so this is quite strange for me:
while($variable=mysql_fetch_assoc)
I have not been able to look up in PHP manual how it works. I guess that in each loop it advances to next element of assoc.array. But what is this generally called in PHP? I am just not used to see '=' in loop condition.
Hi,
In android, is it recommend to use static variable?
E.g, implement a Singleton pattern in Java, I usually do:
private static A the_instance;
public static A getInstance() {
if (the_instance == null) {
the_instance = new A();
}
return the_instance;
}
My question is when do that get free by android JVM?
Thank you.
I want to call require_once("test.php") but not display result and save it into variable like this:
//pseudocode
$test = require_once('test.php');
//some operations like $test = preg_replace(…);
echo $test;
Is it possible?
I need to put a javascript variable as image source.That is my image tag should be in this format
here i am adding my script
document.getElementById("pricefilter").innerHTML =''
here variablename carries my image path.How can i put this in double quates.Please help to solve this
hi,
i am doing a shopping cart.i had a variable $total.when i add 1st product of price 200 i get $total=200 , when i add 2nd product of price 100 i get $total=200100 when i add 3rd product of price 400 i get $total=200100400 . i want to get $total=700. how to fix this problem?
please help me........
thanks,
Hmwd
I am running a query from the VBA editor of Access:
select max(somerow) from sometable
I want to put the result of this query into a VBA variable. How do i do it?
class B {
public:
static int a;
}
class C:B {
}
I want to use a variable through any inherited classes but it has problem when I declare a.
B::B() {
a=1;
}
Do I do it right ?
Thanks for reading and waiting for your comments.
Say I have my class
@interface Person : NSObject { NSString *name; }
I need to get the name of NSString's within my class
Person *person = [[Person alloc] init];
NSLog(@"Name of variable %s\n", NameofVariable(person.name));
I try to declare a variable in a code like this, but it's doesn't work. Can you tell me what's the problem?
ERROR: syntax error at or near "VARCHAR"
LINE 2: p_country VARCHAR;
DECLARE
p_country VARCHAR;
p_country : = '';
SELECT p_country;