Hi there,
I want to have a function in my zsh for faster accessing my todo-files. It should look inside the folder ~/tasks where i put my todo-lists and stuff. Now i want to type task p and when I hit tab, it should use the files in that directory for autocompletition. Can anyone point me some direction? Or share some snippet to work wi...
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. I don't know what should a MySQL type of function consist of. Any inputs on what I should include would be great also, such as mysql_query().
function mysqlSelectCodes($table,
$wh...
> if (((test>=0) && (test<=90)) || ((test>270) && (test<=360))){n_y=1;}
> else {n_y=-1;}
I need the magnitude of trigonometric function in order to determine the sign of the trigonometric function for an angle falling into a particular quadrant.
My plan is to replace the code above with something equivalent.
Here is what I w...
Hello,
I would like to pass to a jQuery function a regular function, instead of the usual anonymous function, but I'm not sure how such a thing could be done.
Instead of this:
function setVersion(feature) {
$.post("some.php", { abc:"abc" },
function(data){
// do something here
}, "json");
}
I would like to...
I read a question earlier asking if there was a times method in Python, that would allow a function to be called n times in a row.
Everyone suggested for _ in range(n): foo() but I wanted to try and code a different solution using a function decorator.
Here's what I have:
def times(self, n, *args, **kwargs):
for _ in range(n):
...
Hello,
I'm trying to call an accessor function in a copy constructor but it's not working. Here's an example of my problem:
A.h
class A {
public:
//Constructor
A(int d);
//Copy Constructor
A(const A &rhs);
//accessor for data
int getData();
//mutator for data
void setData(int d);
private:
int d...
Possible Duplicate:
When pass-by-pointer is preferred to pass-by-reference in C++?
Hello everyone,
What do you consider a better programming practice: passing objects as pointers or references to functions.
What do you do for input validation?
Thanks.
...
Hello guys, if in a literal object i try to reference a function using "this" inside a nested property/function, this don't work. Why? A nested property have it's own scope?
For example, i want to call f1 from inside d.f2:
var object = {
a: "Var a",
b: "Var b",
c: "Var c",
f1: function() {
alert("This is f1");
},
...
I'm writing some terrible, terrible code, and I need a way to put a free() in the middle of a statement. The actual code is:
int main(){
return printf("%s", isPalindrome(fgets(malloc(1000), 1000, stdin))?"Yes!\n":"No!\n") >= 0;
// leak 1000 bytes of memory
}
I was using alloca(), but I can't be sure that will actually work on ...
var CoreGroups = new function(){
this.name = function(){return 'name test'};
var functionName = function(){
// here I want to call the name() function
a = this.name(); // doesnt work: this.name is not a function
b = name(); // doesn't work too: name is not defined
}
}
Any idea on how...
I have this pl/pgsql function:
CREATE OR REPLACE FUNCTION get_result(id integer) RETURNS SETOF my_table AS $
DECLARE
result_set my_table%ROWTYPE;
BEGIN
IF id=0 THEN
SELECT INTO result_set my_table_id, my_table_value FROM my_table;
ELSE
SELECT INTO result_set my_table_id, my_table_v...
i use recaptcha
Recaptcha.create("xxx", "recaptcha", {
theme: 'clean',
tabindex: 0,
callback: $("#id").focus
});
i want to use callback to focus some field, but it doesn't work, only callback: f works
function f() {
$("#FIO").focus();
}
what is the problem?
...
I think I have not got the syntax correct for writing a javascript function and calling it to assign its return value to a variable.
My function is:
getObjName(objId){
var objName ="";
$.ajax( {
type : "GET",
url : "Object",
dataType: 'json',
data : "objId="+objId,
success : function(data) {
objName = data;
...
EDIT Taking COST 100 out made the command go through, however, I'm still unable to run my query because it yields this error:
ERROR: function group_concat(character) does not exist
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
The query I'm running is this:
select tpid, group_...
I need to get list of functions with their contents (not only the function name) from php file. I tried to use regex but it has lots of limitations. it doesn't parse all types of functions. for example it fails if the function has if and for loop statements.
in details:
I have around 100 include files. each file has number of declared f...
Suppose I have this program, I want to compare 2 input lists. Assume array A and array B. How do I determine the best case and worst case of the function?
Here is my code in [php]:
foreach($array_1 as $k){
if(!in_array($k, $array_2)){
array_push($array_2, $k);
}
}
What is the best case and worst case of the for loo...
with your help, i am now able to call the function for each radio button. however, i get a error message
Reference to non-existent field 'ics_si'
ics_si is my function, which has the following code, i do not know where i am making a mistake
i have created the edit box for user to input the values for bore and stroke. and vdisp is cal...
I'm looking at the auth class in Kohana 3 as well as a login script. When the login page calls the login function of the auth class, it is returned via a protected abstract function _login. Why would you do that out of curiosity? I can't seem to understand what would really be the difference since you'd be returning the same data eith...
I was given a task. Write an algorithm so that, the input of 2 lists of data, will have at least one in common.
So, this is my algorithm: (I write the code in php)
$arrayA = array('5', '6', '1', '2', '7');
$arrayB = array('9', '2', '1', '8', '3');
$arrayC = array();
foreach($arrayA as $val){
if(in_array($val, $arrayB)){
ar...
Please order the function belows by growth rate from fastest to slowest:
n^10
2^n
nlog(n)
10^6
And my answer is:
2^n
n^10
nlog(n)
10^6
Is my answer correct?
...