Consider this code:
const char* someFun() {
// ... some stuff
return "Some text!!"
}
int main()
{
{ // Block: A
const char* retStr = someFun();
// use retStr
}
}
My question is in the function sumFun() where is "some Text!!", stored (i think may be in some static area in ROM) and what will be its scope?
Will the memory pointed by retStr be occupied throughout the program or be released once the block A exits?
--
Thanks
hello.
Is there macro, something like BOOST_AUTO, which would allow to emulate automatic return type deduction of function in C++?
I mean something like trailing-return-type, http://en.wikipedia.org/wiki/C%2B%2B0x#Alternative_function_syntax
thank you
1) Besides the negative frequencies, which is the minimum frequency provided by the FFT function? Is it zero?
2) If it is zero how do we plot zero on a logarithmic scale?
3) The result is always symmetrical? Or it just appears to be symmetrical?
4) If I use abs(fft(y)) to compare 2 signals, may I lose some accuracy?
Is there any difference between these two queries?
select * from tbl where ts < '9999-12-31-24.00.00.000000';
and
select * from tbl where ts < timestamp('9999-12-31-24.00.00.000000');
When is the timestamp function required?
Is there a difference in performance?
i can thought that it will open a shell, execute the parameter (shell command) and return the result in a scalar.
But, execute 'system' function in a perl script is faster than a shell command.
It will call this command in C?
If yes, what's the difference between
rmdir foo
and
system('rmdir foo');
Thanks,
I am looking for function in postgre that returns last inserted id into table.
In MS SQL there is SCOPE_IDENTITY(). Is something same in PostgreSQL?
Please, do not advise use something like this:
select max(id) from table
Hello all im getting the following error. I tried putting the files everywhere i can and no fix. is there something else i have to do to make this work? thanks here is the error
Fatal error: Call to undefined function recaptcha_get_html() in /home/folder/public_html/site/views/users/register.php on line 75
I using php's str_replace function to replace some text. Example below.
str_replace("{x+{\$v}}", "{x-{\$v}}", $this->introtext);
str_replace('{x+{\$v}}', '{x-{\$v}}', $this->introtext);
In first case it replace text, but in second case it is not doing so. What is difference between two?
I have a view that I'm trying to setup an Index for. One of the select columns for the view executes a user-defined function that has a return value of varchar(250). However, when I try to setup an Index on that column, I see a size of nvarchar(4000). Why is that and will that cause a problem if I continue to setup my index?
Hi All, I'm running into a similar problem as this:
link text
I've done the fix as in the answer but now I end up with an error a couple lines later:
$$([overlay = (new Element("div", {id: "mbOverlay"})).addEvent("click", close), center = new Element("div", {id: "mbCenter"})]).setStyle is not a function [Break on this error] ]).setStyle("display", "none")
It's on this page:
link text
When you click on 'showreel' it should pop up into the media box, but instead it just goes to a new page.
Any help would be much appreciated. Thanks!
Is better to use the below statement
Convert.ToInt32("0" + stringValue)
If not then why?
I know that it is better to user int.TryParse() function, which is better, but what about the above statement.
Hi,
I am not getting "user type" for below function: (using Domino.dll in C#)
_NotesRegister.RegisterNewUser(pLastn,pIdfile,pServer,pFirstn,pMiddle,pCertpw,pLocation,pComment, pMaildbpath,pForward,pUserpw,pAltName,pAltLang,Usertype);
Regards,
Preeti
Hello,
I think everyone has experience working with a code like the following:
void fun(Type1&);
void fun(Type2&);
vector<Type1> vec;
for_each(vec.begin(), vec.end(), fun);
Of course that won't compile, because it's not clear which function to be passed. And what's your commonly-used solution to the problem?
Lets say i wrote helper for TStringList
TslHelper = class helper for TStringList
function DoSth: boolean;
end;
Then ive included this helper (unit in which helper is defined) in unit i want to use it.
During debugging i hit Ctrl+F7 and i want to evaluate:
someStringList.DoSth
I cant get it to work. Is it possible?
Regards
That's pretty much it. I need to allocate memory and pass it to a function that takes a void *. I'd like to use a shared_ptr but I don't know how to do it.
I want to return StudentId to use elsewhere outside of the scope of the $.getJSON()
j.getJSON(url, data, function(result)
{
var studentId = result.Something;
});
//use studentId here
I would imagine this has to do with scoping, but it doesn't seem to work the same way c# does
This is probably a very common question, but I was unable to find an answer myself;
All my list elements call the function setQuery like this
onClick="admin_stats.setQuery(this);"
rather than [hardcode] add this to every list element, is there a way to simply have it run when a list element is clicked?
I'm not very familiar with jQuery Live or binding/unbinding, but I think they would play a role here?
Before I reinvent a rather square-looking wheel I thought I might ask =)
i am developing a module in joomla . all things goes fine except
Fatal error: Call to a member function get()
getting this error when i m using $username = $parem-get('username')
but if i m using $username = 'foo'; all things goes fine
Thanks
Hi ,
There is a Messages.resx file under App_GlobalResources in my solution. Everytime i create a string and give a value to the string
internal static string Alert_EnterUserName {
get {
return ResourceManager.GetString("Alert_EnterUserName", resourceCulture);
}
}
is created automatically.
Can anybody guide me how to use this string in a function which is present in a seperate .js file?
Thanks in advance
hi,
I need to call a function with some javascript everytime my View is updated (I enabled ajax option, there is not page refresh).
How can I make it ? I'm inspecting php code in Views to find it, but I cannot find it.
thanks
Is there an equivalent of JS 'escape' function in Groovy/Java?
escape('hello world') => hello%20world
I tried this class: http://commons.apache.org/lang/api/org/apache/commons/lang/StringEscapeUtils.html, but it didn't work.
Or do i have to implement it?
Thanks.
I have a page that has a tab set. Each of the tabs is loaded by the jQuery .load() function.
I want to display a loading animation that disappears when all of the ajax requests are finished. However, document.ready() has only provided me with limited success.
How can I ensure that all ajax requests are completed before executing the code to hide the loading animation?
Thanks!
import
com.google.appengine.api.labs.taskqueue.Queue;
import
com.google.appengine.api.labs.taskqueue.QueueFactory;
import static
com.google.appengine.api.labs.taskqueue.TaskOptions.Builder.*;
// ...
Queue queue = QueueFactory.getDefaultQueue();
queue.add(url("/worker").param("key",
key))
in the code example given on the google task queue documentation page i can't understand the url("/worker") function they are calling in the queues.add() invocation .