function

How do you use stl's functions like for_each?

I started using stl containers because they came in very handy when I needed functionality of a list, set and map and had nothing else available in my programming environment. I did not care much about the ideas behind it. STL documentations were only interesting up to the point where it came to functions, etc. Then I skipped reading and...

Jump to function declaration in php

HI, I have the following ide's for php Dreamweaver php-Eclipse Textpad I wish to jump to a function's definition which is located in another file which is not yet open. How could I do that. I am studying a websites code and have the entire directory struction in my local root folder. I come accross certain functions and I dont know i...

php validation function for name that allow UTF-8 characters plus - (minus) and space

Hello everybody, Please help me with a function that validate an input string to allow: 1) UTF-8 characters (ex: şţăîâ) ; 2) space ; 3) minus symbol(-) String cannot start or end with space or minus. Thanks! ...

pass value from embedded function into conditional of page the embedded function is included on

I have a page that includes/embeds a file that contains a number of functions. One of the functions has a variable I want to pass back onto the page that the file is embedded on. <?php include('functions.php'); userInGroup(); if($user_in_group) { print 'user is in group'; } else { print 'user is not in group'; } ?> function withi...

Jquery .select function for selecting inside of select menus?

I have a select menu with two options that are settings for my website. Instead of having a save button, I want it to save to the db when the new value is selected. Right now I have setup a .click function in my jquery file that achieves this purpose for the most part. The only problem is that if you click the drop down arrow (like click...

PHP: How To Call Standard Library Functions

Hi, I'm starting with PHP for dynamic web pages. I have some libaries written in ANSI C for getting/setting parameters and other proprietary stuff. I wonder, is there a simple solution to use a wrapper inside PHP to call this funtions? Is there a already existing class/library? What would be the best practice to do this on my own? I don...

C++ boost function overloaded template

I cannot figure out why this segment gives unresolved overloaded function error (gcc version 4.3.4 (Debian 4.3.4-6)): #include <algorithm> #include <boost/function.hpp> // this does not work int main1() { typedef boost::function<const int&(const int&, const int&)> max; max m(&std::max<int>); } // this does not work int main2()...

In javascript, how do I find out the name of a function from within that function?

Possible Duplicate: How can I get the name of function inside a JavaScript function? The title should make it clear. Is it possible from within a function to determine the name of that function? Basically, I'm adding some debugging code to a number of functions, and I'd like to be able to simply add the following line inside...

Disable dynamically a jquery plugin

Hello, I use the jquery numeric plugin to allow only numbers to be typed in some fields. $("input.numeric").numeric(); I want to disable this function dynamically in some cases, to allow the user to type others characters (i.e. letters). I tryed to use the unbind() or undelegate() functions without success. Does anyone know the solu...

Create a function pointer which takes a function pointer as an argument.

I'm trying to create a function pointer that takes a function pointer as an argument, but am not sure how to go about it... I was advised to try typedef-ing one of my function pointers, but get the same error. Could someone help me with the correct syntax? int 186 main(int argc, char **argv) 187 { 188 int i; 194 typ...

Including/Importing aliases and functions for both bash and zsh

I have a directory of functions and aliases I'd like to include for both bash and zsh terminal invocations (So I don't need to put every function and alias into every separate script and to facilitate organization/tidying of .rc files) What I've tried so far hasn't worked. Just setting this out for further suggestions. ...

Dynamic function. What is it? What's the difference from a regular function?

What is a dynamic function? Also how does it differ from a regular function? Just wondering. I was asked in an interview and I didn't know. I found nothing concrete on google ...

How to pass a function as an argument in Javascript?

I'm looking to pass an anonymous function to another function, but it doesn't seem to be working as I'd like. I've attached the code, I think it'd give you a better idea what I'd to do. <script language="javascript" type="text/javascript"> function do_work(success) { success; } do_work(function () { alert("hello") }); </scrip...

Can't access form elements

Hi, my problem is that my variables are not working in javascript. all variables need names without some character at the beginning, this is the stupid thing...Anyways, im trying to make a funtion that makes "select all checkboxes". It is not working so i looked at the page source/info and found out that the variables were not changing. ...

When is a scala partial function not a partial function?

While creating a map of String to partial functions I ran into unexpected behavior. When I create a partial function as a map element it works fine. When I allocate to a val it invokes instead. Trying to invoke the check generates an error. Is this expected? Am I doing something dumb? Comment out the check() to see the invocation. ...

SQL Split function.

Hi guys, I'm looking for a way to do this ... SELECT FirstName, LastName, Split(AddressBlock, ' ', 1), Split(AddressBlock, ' ', 2), PostCode FROM Contacts The arguments I want to pass are ... The address The separator (current situation requires 2 spaces but this might be a comma or a space followed by a comma) or something els...

How do I return a value from a javascript function

Say I have a function function myFunction(myValue) { // do something } How would I return a value from this, say a string type after the method is executed? ...

How can I implement this Python snippet in Java?

I have this Python code that I found online and would like to know how to translate it to Java. My question is not about the algorithm but how to handle the function's arguments. Here is the code: def ternarySearch(f, left, right, absolutePrecision): #left and right are the current bounds; the maximum is between them if (right...

jQuery: Using normal function value as jquery value

Essentially i'm trying to get the value 'col' that is set in the html, and use it as the value for backgroundColor. Here's the script: function bgc(col) { $("#BG") .animate({ backgroundColor: "col" }, 1000) } Here's the html: <div id="BG"> <a href="#" onclick="bgc(#ffffff);"></a> </div> Any help would be great, i've be...

In PHP :how can I use include() Function which parameter is variable ?

Hi.. I need to use include Function with variable. but,when I try to do it I faced some errors . Code : $year=$_POST['year']; $month=$_POST['month']; $day=$_POST['day']; include "Event.php?year=".$year."&month=".$month."&day=".$day; so,can U help me ? : ) ...