I can imagine one case, in which the input parameter could be NULL so that pass-by-pointer is preferred but not pass-by-reference?
Can anybody add more cases?
I need to use a class callback method on an array inside another method (the callback function belongs to the class).
class Database {
public function escape_string_for_db($string){
return mysql_real_escape_string($string);
}
public function escape_all_array($array){
return array_filter($array,"$this->escape_string_for_db");
}
}
Is this the right way to go about that? (I mean, in terms of the second parameter passed to array_filter)
In java, when you pass an object to a method as a parameter, it is actually passing a reference, or a pointer, to that object because objects in Java are references.
Inside the function, it has a pointer to that object which is a location in memory. I am wondering where this pointer lives in memory? Is a new memory location created once inside the function to hold this reference?
What does that mean ?
public bool? Verbose { get; set; }
When applied to string? , there is an error
Error 11 The type 'string' must be a non-nullable value type in order to use it as parameter 'T' in the generic type or method 'System.Nullable'
I have this code in base class
protected virtual bool HasAnyStuff<TObject>(TObject obj) where TObject:class
{
return false;
}
In child class I am overriding
protected override bool HasAnyStuff<Customer>(Customer obj)
{
//some stuff
if Customer.sth etc
return false;
}
I am getting this error
'''Type parameter declaration must be an identifier not a type'''
What is it I am doing wrong here?
I'm trying to make a stored procedure but it doesn't seem to be recognizing the parameters I've given it.
Procedure
create procedure test_pro(IN searchTable VARCHAR(55))
begin
select * from searchTable limit 10;
end //
Trying to execute
mysql> call test_pro('exampleTable');
ERROR 1146 (42S02): Table 'db.searchTable' doesn't exist
It isn't replacing the searchTable with the parameter that is passed in.
So I was wondering how they work. To explain what I mean by a "function caller" a good example of what I mean would be glutTimerFunc, it is able to take in a function as a parameter and call it even with it not knowing it is declared. How is it doing this?
Hi,
Is there anyway to convert a string value to a Range object ? I'm having a function which takes a Range object as a argument and need to pass a single string parameter to it
Thank You
I'm trying to get this expression to work, I'm pretty sure its not the parenthesis because I counted all of them. Perhaps there something I'm doing wrong involving the parameter pow (x,y).
double calculatePeriodicPayment()
{
periodicPaymentcalc = (loan * ((interestRate / yearlyPayment))) / (1-((pow ((1+(interestRate / yearlyPayment)))),(-(yearlyPayment * numOfYearLoan))));
return periodicPaymentcalc;
}
I have CMS table that contain CMS_STARTTIME and CMS_STOPTIME (attachment).
I want to create report to summarize exist data by using Date, Time and Year as Parameter (attachment).
I don't know how to create sql statement to meet this requirement. I'm using MySQL and MS-SQL.
Does one can help?
Thank you very much.
<%= check_box_tag('videos_count')%>
If this box is checked, the param will say "videos_count"="1" . In the controller I have this:
videos_count = params[:videos_count]
@cars = Car.paginate( :page => params[:page], :per_page => 10,
:conditions => ["videos_count = ?", videos_count],
when the box is checked I see the correct parameter in the server log, but the find returns all of the results instead of results with videos_count = 1.
function(char* name)
{
char sql[50];
sprintf(sql, "select %s;", name);
}
What's the best way to make sure only 50 chars of name are copied to sql in the case name is larger than what sql can hold? (sprintf with a N parameter?)
Thank You.
I am trying to build a query that does a sum if a certain parameter is
set. For example:
SELECT SUM(IF(<condition>,field,field)) AS total_value
...which is working correctly.
But i have more than one condition in IF(), like:
SELECT SUM(IF(<condition> <condition>,field,field)) AS total_value
..which is not working, could you have any idea what should be the right query for this.
Is it possible to start other application that are installed on the system with my java app and pass a file as a parameter to them? I have a client which receives videos from a server and I want my client program to start, lets say the VLC player with the file that I received. How do I manage to do that?
hey,
I just want to know what is the difference between sending parameter with ajax(post/get) to a servlet and sending them with "submit" .
Thanks for your help.
function test(custId){
List<Account> list=accountDelegate.findAccountEntityByGroupId((long)%>
custId<%)%>;
<script>
}
Here my question is how to send custId to java method as parameter from java script.where java method takes long argument.
I have a website where I have to click a submit button on a form. This gives me a link. I know the link is made up with the paramter that is passed through a hidden value. I was wondering if I could make a python script or something else that would go to the website and click some buttons returning the link that the submit button generates, if so how could I pass the extra parameter that influences the creation of the link?
thanks in advance.
In my specific case, how do I identify or know which UITextField is being referenced in shouldChangeCharactersInRange method?
I know the parameter (UITextField*)textField contains the object being referenced, but how do I compare to identify which one it is?
I'd like to use something like the "update=" parameter of a <g:remoteLink> with a <g:actionSubmit>, so that when the submit button is clicked, it will update a specific target. What's the best way to accomplish this?
hello.
Is there some way to document template parameters like this:
template<
int N, ///< description
typename T ///< description
>
rather than listing each parameter with tparam?
thank you
Just using it as a method parameter is fine but what about an easy way to use it in strings?
For instance say I have this:
11 void myTest()
12 {
13 if(!testCondition)
14 logError("testcondition failed");
15 }
And I want the output to be:
"myTest line 14: testcondition failed"
How can I write logError? Does it have to be some monstrosity of a macro?
I have a class A and another class that inherits from it, B. I am overriding a function that accepts an object of type A as a parameter, so I have to accept an A. However, I later call functions that only B has, so I want to return false and not proceed if the object passed is not of type B.
What is the best way to find out which type the object passed to my function is?
The prototype of memset is void *memset(void *s, int c, size_t n);. So why the third parameter is of type size_t ? memset is just an example, I want more general reasons. Thanks in advance.
Hi all,
How to get a parameter encode in the url ?
for exemple, if we have an html file containning :
how to get the value of a from application.java class ?
Thanks