What happens, step by step, when a variable is returned. I know that if it's a built-in and fits, it's thrown into rax/eax/ax. What happens when it doesn't fit, and/or isn't built-in? More importantly, is there a guaranteed copy constructor call?
edit: What about the destructor? Is that called "sometimes", "always", or "never"?
I would like to convert this /bin/sh syntax into a widely compatible Windows batch script:
host=`hostname`
echo ${host}
How to do this so that it'll work on any Windows Vista, Windows XP, and Windows 2000 machine?
To clarify: I would then like to go on in the program and use the hostname as stored in the variable host. In other words, the larger goal of the program is not to simply echo the hostname.
is it correct to unset the session variable for a particular index as the vay whole session is made unset in PHP?
I know this works: unset($_SESSION['bannersize'])
But does this works ? : unset($_SESSION['bannersize'][3])
or is there any other way to unset any particular desired index of the session and then again rearrange the values inside it to remove the empty index..?
I need to be able to execute a shell command through LaTeX [*] and have the resulting output available for use later on in the form of a LaTeX 'variable' (e.g., via a subsequent \newcommand command). If necessary a temporary file could be used to hold the output, although I would like to avoid this. I have been able to use
\immediate\write18
to invoke a bash command before, but this was only used to write to a temporary file.
[*] I realise that the -shell-escape flag must be set for this to be allowed
I originally had the variable cpanel named url and the code would not return anything. Any idea why? It doesn't seem to be used by anything else, but there's gotta be something I'm overlooking.
import urllib2
cpanel = 'http://www.tas-tech.com/cpanel'
req = urllib2.Request(cpanel)
try:
handle = urllib2.urlopen(req)
except IOError, e:
if hasattr(e, 'code'):
if e.code != 401:
print 'We got another error'
print e.code
else:
print e.headers
print e.headers['www-authenticate']
I want to refer to a static Java variable in my styles.xml, is that possible? Here's a pseudo-xml example:
<style name="Artwork">
<item name="android:background">@drawable/border_{Constants.MY_COLOR}</item>
</style>
i'm try to change an image's imageurl on an aspx asp.net c# page based on a variable from #var=1 (or 2, or 3, or 4)
i know nothing about javascript unfortunately which is what i've been told i need. can anyone point me at a novice based script i can try to learn via implementation?
Hi,
i have this code:
if(sfContext::getInstance()->get('form_signin')){
//...
}
but im getting this error:
The "form_signin" object does not
exist in the current context.
Any right way to check if a variable saved in sfContext is set or not ?
Regards
Javi
How is the scope of a variable/identifier maintained in the symbol table of a c/c++ compiler.
Please suggest some good links and books to know the how compiling process of c/c++
program is implemented for better understanding.
boolean variable have only two specified values ,"true" or "false"
How does it stored in VM?
Hmm...This is my first question here.Thank you all for answering me.
:)
Why can't i define a variable recursively in a code block?
scala> {
| val fibs: Stream[Int] = 1 #:: fibs.scanLeft(1){_ + _}
| }
<console>:9: error: forward reference extends over definition of value fibs
val fibs: Stream[Int] = 1 #:: fibs.scanLeft(1){_ + _}
^
scala> val fibs: Stream[Int] = 1 #:: fibs.scanLeft(1){_ + _}
fibs: Stream[Int] = Stream(1, ?)
lazy keyword solves this problem, but i can't understand why it works without a code block but throws a compilation error in a code block.
Is there a row count that makes Table Variable's inefficient or what? I understand the differences between the two and I've seen some different figures on when that point is reached, but I'm curious if anyone knows.
here's my problem: I have multiple classes that are part of the same package and they need access to a certain file path
String filePath = "D:/Users/Mine/School/Java/CZ2002_Assignment/src/"
Rather than declaring the same Filepath in every single class, is it possible to simply have a "global" type of variable of this FilePath so that all classes can access it and I only need to declare and update it once.
Thanks
I want to generate some dynamic data and feed these data in to test cases. But I found that Django will initial the test class every time to do the test. So the data will get generated every time django test framework calls the function.
Is there anyway to use something like the singleton or static variable to solve the problem? What should be the solution?
Thanks!
At the beginning of a makefile I have this line :
PATH := $(PATH):/other/dir
and this gives this error: Recursive variable 'PATH' references itself. What do I have to do so it works?
What is the cleanest way of picking up a match variable form a substitution in Perl
I sometimes find myself writing
s/(something)// ;
my $x = $1 ;
then I realize that if the s/ / / fails $1 might be carrying over a value from a previous match. So I try
my $x = 'defaultvalue' ;
if ( s/(something)// )
{
$x = $1 ;
}
Is this the cleanest way of doing it?
When stepping through a script in MySQL Query Browser's script window, is there any way to view the value of a variable I have just assigned?
Specifically I do an update on one line, and then:
SET @Num=row_count();
While debugging the script, I would like to be able to know the value of @Num
Why don't make all variable private? All the variables must give a getter, setter to modify/read. Why leave the "public" keyword here? Except for convenient, any another reason for that?
hi,
I'm implementing some code generators, i would like to know if there's any way in C, if a variable has already been declared ?
I was trying to find something using the preprocessor but without any success...
thanks.
Lets say I have a SP that has a SELECT statements as follows,
SELECT product_id, product_price FROM product
WHERE product_type IN ('AA','BB','CC');
But data goes to that IN clause must be through a single variable that contains the string of values. Something link below
SELECT product_id, product_price FROM product
WHERE product_type IN (input_variables);
But its not working that way. Any idea how to do this?
How do you query a MySQL table columns highest entry and store it in a variable. Here is what I have but it is not working.
$query = "SELECT MAX(date) FROM Records WHERE ips='$currentip'";
$result = mysql_query($query) or die(mysql_error());
echo $result;
Hi, I asked a question yesterday about how to manage to get %% around a variable without getting the evaluation.
Well, the thing is, it does not work that way in my case...
I have a .bat file which gets an input parameter. Later on I want to use the value of this input parameter and put %...% around, like:
call script.bat testValue
script.bat:
set inputPar=%1
set newValue=%%inputPar%%
Now I get:
echo %inputPar%
testValue
echo %newValue%
%inputPar%
But I would like to get:
echo %newValue%
%testValue%
Is that somehow possible?
Variable outside of the loop
int number = 0;
for(int i = 0; i < 10000; i++){
number = 3 * i;
printf("%d",number);
}
or Variable inside of the loop
for(int i = 0; i < 10000; i++){
int number = 3 * i;
printf("%d",number);
}
Which one is recommended and which one is better in performance?
Edit:
This is just an example to exhibit what I mean, All I wanna know is if defining a variable inside a loop and outside a loop means the same thing , or there's a difference.