function

I'm trying to do Ackermann's Function on IBasic

Ackermann's Function is a recursive mathematical algorithm that can be used to test how well a computer performs recursion. Design a function ackermann(m,n), which solves Ackermann's Function. Use the following logic in your function: If m = 0, then return n + 1 If n = 0 then return ackermann(m-1, 1) Otherwise, return ackermann...

Calling a function by a string in JavaScript and staying in scope

Hi, I've been playing around and searching a bit, but I can't figure this out. I have a pseudo private function within a JavaScript object that needs to get called via eval (because the name of the function is built dynamically). However, the function is hidden from the global scope by a closure and I cannot figure out how to reference i...

I am getting error in in-array function used in Multiple Select box

I have used Multiple select Box in edit form, displaying previously selected items in it using "in-array($needle,$haystack)" php function, but if the variable array "$haystack" in which multiple value is stored, there is no value,there I get the Warning message prompting for wrong datatype for second argument for in "in-array($needle,$ha...

Return pointer from function C

In my C program this function is going to handle all the work of opening a specific file and then return the file pointer, so main or other functions can read the content by using fp, but so far i haven't been able to get this to work. I'm just learning the language, so it is possible that i am doing something very wrong. int open_text...

How to trim leftmost and rightmost whitespaces of a string using PHP?

What function can I use? ...

Recusive function

Hi i have the below table datas id parent_id name 1 Machine 2 3 Ram 3 4 Cpu 4 Computer 5 6 food1 6 food2 My need is to select possible parents for example 1) if we select 'machine' all others can parents 2) if we select 'cpu' then '...

variable passing inside a function to another function in javascript

hello, setTimeout("refresh()", 2*15000 ); This is a code from my javascript here setTimeout is a built in function and refresh is a function which i have declared. i want to pass a variable (cval1) to this refresh fuction i have tried this setTimeout("refresh(cval1)", 2*15000 ); bit its not working What is the exact way to do th...

creating functions in CodeIgniter controllers

Hi I have a CodeIgniter application, but one of my controllers must call a data processing function that I have also written myself. The only problem is I can't seem to figure out how to do this. Looking through the user guide it seems that I should put my function inside the class declaration, and prefix it with an underscore (_) so th...

How to write this meaning in a MySQL query?

How to write this meaning in a MySQL query? where ((location/'$location'<2) and (location/'$location'>=1)) ...

Sites for function reference

Hello, do you use any particular site for function reference or you just google the function? ...

Returning an array from a function (PHP)

I have this function coded to check the status of a Rapidshare link using their API: function CheckLink($fileid, $filename) { $q = file_get_contents("http://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=checkfiles_v1&amp;files=$fileid&amp;filenames=$filename"); $r = explode(",", $q); switch ($r[4]) { case 0: ...

Matlab loops for a function

Hi, I am trying to make a loop to redo a Matlab function 1000 times. Here's the program d = unifrnd (0,10,[10,1]); c = d.^(-2); a = round(unifrnd(0,1,[1,10]); e = a*c btotal = e+1 SIR = 1/btotal What I want is to iterate this function 1000 times, each time the value of SIR will vary due to the random number generated. For every iterat...

I am writing a function to do "while" , but why error?

I am writing a function to do "while" to count the numbers of alphabetic and digits in a text file. I would like to seperate it to 2 functions of 2 "while". But it error after I create the first function. What's wrong of it? #include "stdafx.h" #include "stdlib.h" #include "ctype.h" void countDig (FILE* input, char num,...

MS Access 2007 sql functions?

Does MS Access 2007 support creation of user defined sql functions? if so, where is the option for it in the menu? ...

Blocking a function call in C#

Hello All, How do I block a function call in C#? This function gets repeatedly called by different classes.I want to lock it up so that no one else can use it until I perform my current operation. Then,i want to release it again. Please help.. Thanks Edit:I'm not actually using threads...but I am using timers that call the function ...

"unpacking" a passed dictionary into the function's name space in Python?

In the work I do, I often have parameters that I need to group into subsets for convenience: d1 = {'x':1,'y':2} d2 = {'a':3,'b':4} I do this by passing in multiple dictionaries. Most of the time I use the passed dictionary directly, i.e.: def f(d1,d2): for k in d1: blah( d1[k] ) In some functions I need to access the v...

SQL SUM() function field

I have a database which contains some numerical fields; now i want to create another field which displays the sum of one of these fields. How can I create that field? thanks ...

jquery call function by name

i have function <script type="text/javascript"> $(function () { $("#search").click(function() { var text = $("#searchText").val(); $.getJSON("Search", { world: text, filter: text }, function(data) { $("tr.DataRow").toggle(false); for (i = 0; i < data.length; i++) { ...

Drupal theme function not being overridden

I'm using Ubercart and I'm attempting to override the following theme function theme_address_pane() which is in uc_cart_checkout_pane.inc. So I wrote the following function in template.php: function mytheme_address_pane($form) { return "asdf"; } However, it isn't replacing anything with "asdf". What could I be doing wrong? Edit: ...

c# LINQ XML how to add function inside select query

select new FeedResource { Title = (string)details.Element("title"), Host = (string)details.Element("link"), Description = (string)details.Element("description"), PublishedOn = (DateTime?)details.Element("pubDate"), Generator = (string)details.Element("generator"), Language = (string)details.Element("language") ...