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 :)
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?
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.
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!
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.
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
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
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]
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 ?
Anyone know why this doesn't work?
var lastReceivedBeginDate = new Date($("input[name='lastReceivedFromYear']").val(),$("input[name='lastReceivedFromMonth']").val(),$("input[name='lastReceivedFromDay']").val(),$("input[name='lastReceivedFromHour']").val(),$("input[name='lastReceivedFromMinute']").val(),$("input[name='lastReceivedFromSecond']").val());
Thx
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.
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.
Hi all.. may i know the exact usage of getpriority() call used in linux.. even after searching thru net, i couldnt understand it exactly.. can someone explain it with an example.. thnx in advance :)
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've just switched my scripts to a different server. On the previous server this worked flawlessly, and now that I've switched them to a different server, I can't understand the problem.
I'm not sure it would help, but here's the relevant code.
$headers = apache_request_headers();
PHP Version is: PHP 5.3.2
Any help would be appreciated.
Create a program that will ask the user to enter 3 numbers using for loop, then test the numbers and display it in ascending order.
Sample Input:
5
2
7
Sample Output:
2
5
7
I'm stuck with the testing procedure. I don't know how to test the numbers since the variable holding those numbers is just a single variable and inside the for loop
here is my sample code:
import javax.swing.JOptionPane;
public class ascending
{
public static void main(String args[])
{
for(int x= 0; x<3;x++)
{
String Snum = JOptionPane.showInputDialog("Enter a number");
int num = Integer.parseInt(Snum);
}
<Here comes the program wherein I will test the 3 numbers inputted by the user and
display in ascending order. I don't know where to start. :'( >