Hello All,
I am creating a pop up window. After I am finished with the work on child(pop up) window and click close button, i need to call a javascript function of the parent window. How can I achieve this.
I am not creating the child window myself but displaying the contents of some other url.
I have a function foo(i) that takes an integer and takes a significant amount of time to execute. Will there be a significant performance difference between any of the following ways of initializing 'a':
a = [foo(i) for i in xrange(100)]
,
a = map(foo, range(100))
, and
vfoo = numpy.vectorize(foo)
vfoo(range(100))
? (I don't care whether the output is a list or a numpy array).
Is there some other better way of doing this?
Thanks.
I have two user controls I have some functions written on those two controls. Is it possible to invoke a function written on one user control from another user control. Pls provide the code for this.
In statistical language R, mean() and median() are standard functions which do what you'd expect. mode() tells you the internal storage mode of the R object, not the value that occurs the most in its argument. But surely there is a standard library function that implements mode for a vector (or list).
I have a char array with data from a text file and I need to convert it to hexadecimal format.
Is there such a function for C language.
Thank you in advance!
Trying to optimize my MUI 2 NSIS setup in which I do some ExecWait calls in the .onInstSuccess callback function, I was searching through the documentation to find a callback that is called:
after the files are all copied -and-
before the wizard page is being switched from the file copy page to the finish page.
Unfortunately, I found no such callback.
Therefore my question is:
Is it possible to do some custom processing after the files are copied and before the wizard page is being switched away from the file copy page?
I'm trying to setup something like Aspect Oriented Programming in Actionscript 3, basically the only thing I need to be able to do is something like this:
SomeClass.getMethod("methodName").addEventListener(afterMethodExecuted, function() {
//run code
});
This way I can run code after (or before) any method in any class has run, allowing numerous new possibilities.
How should I implement this?
I just got this question on a interview and had no idea how to calculate the answer.
How many additional function calls does fib(n) require if "LINE 3" is removed? The answer should be in terms on n.
int fib(int n) {
if(n == 0) return 0;
if(n == 1) return 1;
if(n == 2) return 1; //LINE 3 HERE <---
return fib(n - 1) + fib(n - 2);
}
I'm trying to override the behavior of an external function in user32.dll because I don't want a certain window to show up.
What I'm trying to do is this:
[DllImport("user32.dll")]
public extern override IntPtr GetSystemMenu(IntPtr hMenu, bool bRevert)
{
return new IntPtr();
}
but this won't work because I get the following errors:
... no suitable method found to override
and
... cannot be extern and declare a body
Is there any way to simulate what I'm trying to do?
1-which is the parameter that is added to every non-static member function when it is called?
2-what is an adaptor class or wrapper class?
3-what is a non object when can you tell that a memory leak will occur?
4-what is a parameterized type?
I have some code that I am porting from an SGI system using the MIPS compiler. It has functions that are declared to have double return type. If the function can't find the right double, those functions return "NULL"
The intel C compiler does not like this, but I was trying to see if there is a compiler option to enable this "feature" so that I can compile without changing code. I checked the man page, and can't seem to find it.
Thanks
eg I have two concurrent AJAX requests, and I need the result from both to compute a third result. I'm using the Prototype library, so it might look something like this:
var r1 = new Ajax.Request(url1, ...);
var r2 = new Ajax.Request(url2, ...);
function on_both_requests_complete(resp1, resp2) {
...
}
One way would be to use polling, but I'm thinking there must be a better way.
I am learning about pmap and wrote the following function:
(pmap #((println "hello from " (-> (Thread/currentThread) .getName))
(+ %1 %2))
[1 1 1] [-1 -1 -1])
When run, the result is a NullPointerException
(hello from clojure-agent-send-off-pool-4
hello from clojure-agent-send-off-pool-3
hello from clojure-agent-send-off-pool-5
NullPointerException user/eval55/fn--56 (NO_SOURCE_FILE:11)
Why is this happening? I have understood and observed the body of a fn to be an implicit do.
This is my first time. I will appreciate any thoughts, tips, and what not. How can I improve this? Ultimately, I don't want so many selects in my script.
function mysqlSelectCodes($table,
$where, $order, $limit) { $sql =
"SELECT * FROM $table WHERE $where
ORDER BY $order LIMIT $limit" or
die(mysql_error());
}
I saw a delayed example in David Pollak's "Beginning Scala". I tried to adapt that, by trial and error. Here's what I have:
def sayhello() = {
println("hello")
}
def delaying(t: => Unit):Unit = {
println("before call")
t
println("after call")
}
delaying(sayhello())
How would you delay a function/method that takes parameters? Why can't I use parantheses when I call t? Where can I find more documentation on delaying functions?
I am trying to stop the default mouse wheel event that is called on the window and on a div and call my own function instead on the div. I need this to be cross-browser (without the use of a library. I know I need to use an eventListener and I think have to use both onmousewheel and DOMMouseScroll (for FF) but I think am getting caught up in the implementation somewhere.
I appreciate any and all help.
I have a data structure containing a list of objects, like this:
class A {
private List<Object> list;
}
How to properly define a hash function for the list, assuming each element of the list has correct hashCode()?
(It's strange that I couldn't easily find the solution via Google.)
It's easy to create a new name for a type, a variable or a namespace. But how do I assign a new name to a function? For example, I want to use the name holler for printf. #define is obvious... any other way?
Solutions:
#define holler printf
...
I want to find that when a user fires an event, such as click a button, what function(s) does this event invoke in run-time? Would it be possible?
Thanks!
i have a function and i am unclear what i should return from this?
public ActionResult LoadExternalURL()
{
Response.Redirect("http://www.google.com");
// what do i return here ??
}
The Python documentation specifies that is is legal to omit the parentheses if a function only takes a single parameter, but
myfunction "Hello!"
generates a syntax error. So, what's the deal?
(I'm using Python 3.1)
I am using a form to get the hour and minute using post method and then store it to mysql DB.
Such as :
$hour = $_POST['hour'];
$minute = $_POST['minute'];
** There is no need of date, month and year. I just need to store the hour and minute in a column of a table (ex: exam_time)
Column structure: exam_time time NOT NULL
Now how to store these value into database using mktime() function. I tried but it stores 00:00:00, not the one which I am sending via form.