I have this:
var $ul = $(this).children("ul");
$ul.animate({opacity: 0}, 1000);
$ul.delay(1000).css("display", "none")
It's for my dropdown menu, and I want it to fade off before it disappears using the display: none; CSS property. However it appears that the .delay() cannot be used on the .css(); it doesn't work, the $ul just disappears right away.
I can't use $ul.animate({opacity: 0, display: "none"}, 1000); either.
Hi!
I made this script to test the execution of php in background
foreach($tests as $test) {
exec("php test.php ".$test["id"]);
}
to run php in background like suggested in php process background
and How to add large number of event notification reminder via Google Calendar API using PHP? and php execute a background process
But the script do not run faster than when it was all in one script without the addition of test.php.
what I'm doing wrong?
thanks in advance!
- (void) swapController:(MyViewController*)controller1
with:(MyViewController*)controller2
{
MyViewController *swap = controller2;
controller2 = controller1;
controller1 = swap;
}
Looks like this doesn't work because I'm not passing references. How to do it anyway?
I'm having a problem with a class like this:
class Sprite {
...
bool checkCollision(Sprite &spr);
...
};
So, if I have that clase, I can do this:
ball.checkCollision(bar1);
But if I change the class to this:
class Sprite {
...
bool checkCollision(Sprite* spr);
...
};
I have to do this:
ball.checkCollision(&bar1);
So, what's the difference?? It's better a way instead other?
Thank you.
I am writed an automated test in Selenium IDE to test one of our applications. Our app throws one of those confirmation dialogs "Are you sure you want to continue."
Click OK or Cancel
Selenium does not support the clicking of these dialog boxes. I have
tried the following SeleniumIDE functions with no success:
chooseOkOnNextConfirmation
chooseOkOnNextConfirmationAndWait
Is there a javascript funtion I can call within SeleniumIDE to do
this, or am I out of luck.
I connected my IOS device to a MAC processor and installed/initialized my app running in xcode or dragged it from itunes folder. Now i physically disconnected my device from the processor and through wifi enabled in the device, sent notifications/messages through APNS to the device. I was able to successfully receive notifications in the device. Now after some time, i reconnected the device to the processor, which lead to a problem of the app launching again and calling 'didFinishLaunchingWithOptions' method again, which is not desirable as the launch/initialization should happen only once. This behaviour is random ie. every time when i disconnect/reconnect, it is not happening, only sometimes. Why is this happening. What could be the reason for this random behaviour.
Any help will be appreciated.Thanks
What I wanted is printing out 5 dots that a dot printed per a second using time.sleep(), but the result was 5 dots were printed at once after 5 seconds delay.
Tried both print and sys.stdout.write, same result.
Thanks for any advices.
import time
import sys
def wait_for(n):
"""Wait for {n} seconds. {n} should be an integer greater than 0."""
if not isinstance(n, int):
print 'n in wait_for(n) should be an integer.'
return
elif n < 1:
print 'n in wait_for(n) should be greater than 0.'
return
for i in range(0, n):
sys.stdout.write('.')
time.sleep(1)
sys.stdout.write('\n')
def main():
wait_for(5) # FIXME: doesn't work as expected
if __name__ == '__main__':
try:
main()
except KeyboardInterrupt:
print '\nAborted.'
For the jquery form plugin http://jquery.malsup.com/form/#options-object, I see a success callback, but how do I run code if there is a failure like a network issue?
Can Clojure implement (g ° f) constructions like Haskell's g . f? I'm currently using workarounds like (fn [n] (not (zero? n))), which isn't nearly as nice :)
if i use Doctrine_Core::getTable('User')- i will have no auto completion.
isnt it better to just use User:: for autocompletion?
and of course i have to define the methods static
what is the benefit with using getTable except that i can use a non static method?
I have a list of sales people and a list of their sale revenues in two separate columns. How do I use an advanced filter or other sorting means to find the max of the sale revenue column and then have the formula output be the corresponding sales person?
I have this snippet of the code
Account& Company::findAccount(int id){
for(list<Account>::const_iterator i = listOfAccounts.begin(); i != listOfAccounts.end(); ++i){
if(i->nID == id){
return *i;
}
}
return 0;
}
Is this right way to return 0 if I didn't find appropriate account?
cause I receive an error:
no match for 'operator!' in '!((Company*)this)->Company::findAccount(id)'
I use it this way:
if(!(findAccount(id))){
throw "hey";
}
thanks in advance
Under these conditions,
The o/p of the first program is an large array of either integers, doubles or strings.
Best method means the fastest on x86 architecture.
I'm a beginner and I want to write Java code in eclipse. This program takes two LinkedLists of integers (for example, a and b) and makes a LinkedList (for example d) in which every element is the sum of elements from a and b. However, I can't add these two elements from a and b because they are Objects
Example:
a=[3,4,6,7,8]
b=[4,3,7,5,3,2,1]
------
d=[7,7,13,12,11,2,1]
class base {
public:
virtual void doSomething() = 0;
};
class derived : public base {
**private:**
virtual void doSomething(){cout<<"Derived fn"<<endl;}
};
now if i do the following:
base *b=new child;
b->doSomething(); //it calls the derived class fn even if that is private.
Question:
1.its able to call the derived class fn even if that is private.How is it possible?
Now if i change the inheritance access specifier from public to protected/private then i get compilation error as "'type cast' : conversion from 'Derived *' to 'base *' exists, but is inaccessible"
Notes: I am aware on the concepts of the inheritance access specifiers.So in second case as its derived private/protected, its inaccessible. But here it confuses me for the first question. Any input will be highly appreciated
Okay so have a database that uses the time functions for a list of events and then displays the data as:
echo "<b>Time Frame:";
echo "$time_start"; echo " - "; echo "$time_end";
Although that displays the time as 11:00:00 if i want the time to be 11:00 am. Is there anyway to make this time display as a standard "11:00"? and also if in the mysql datababse enter it as military time (ex. 13:00) to make it display 1:00pm?
I have tried many things. Please help.
http://pastebin.com/kaTZzGrx
I have trying this :
$string ="Group: ALL:ALL:Good";
@str2 = split (/:/,':',2);
print "@str2";
I am looking in $str[0] = Group and $str[1]= ALL:ALL:Good
It not working . What would be issue ?
Given a base class
class A {
int i;
public:
int& f(){ return i;}
const int& f() const { return i;}
};
And a sub class
class ConstA : private A {
public:
const int& f() const { return A::f(); }
};
Is there a wrist-friendly way to access the ConstA::f method on a non-const variable?
ConstA ca;
int i = ca.f();
// compile error: int& A::f() is not accessible since A is privately inherited
int j = static_cast<const ConstA&>(ca).f();
// this works, but it hurts a little...
Or is it so ugly since hiding A::f generally is a bad idea, violating the Liskov Substitution Principle: any subclass of A must at least be capable of all A's functionality?
void set( A& a, int i ) { a.f() = i; }
class ConstA2 : public A {
private: int& f(){ return A::f(); }
};
ConstA2 ca2;
set( ca2, 1 );
(Note: this question popped up while thinking about this question)
Hello all,
I am trying to place some html within a td that has an id but this doesn't seem to work. Can JQuery not put html in a td by using its id as a selector??
I do this:
$('#total_match').html("<b>Test</b>");
Here is the td:
<td id="total_match"></td>
No errors occur and nothing appears in the TD - I view the source to confirm.
I appreciate any help.