function

what is the parameter to ns ?

what is the parameter to ns ? the documentation says something, but it's not clear (to me, at least) my-new-namespace=> (doc ns) ------------------------- clojure.core/ns ([name docstring? attr-map? references*]) Macro Sets *ns* to the namespace named by name (unevaluated), creating it if needed. ...the rest of the documentatio...

I want a function that reads in a file and returns the sum of ascii values

I want a function that reads in a file and returns the sum of ascii values. I have looked at this page: http://stackoverflow.com/questions/1292630/how-to-open-a-file-and-find-the-longest-length-of-a-line-and-then-print-it-out/1292676#1292676 and the answer to my question was probably starring me in the face, but I cant follow the cod...

how to write custom function/method in java? (RFT)

I need to process few lines of code over and over in RFT (java) so custom method/function/procedure is the best (and only) solution to this. I have no java experience so I need some help with that. The method will receive some parameters and will return no value. Basically it will be entering new records into a database (web based app...

Listening for Multiple Events on Multiple Objects AS3

I currently have an over, out and click event for 8 different objects. The over and out events are identical for each (tween expands object and then shrinks it back for the out state). I have previously asked for an easy way to declare those events, and now I was looking for an easier way to handle them. Here's my code: //-----------G...

Reload table/array with function?

Hi I have this code, what am I doing wrong? I have a function which I call playing a number of strings into an array. Then at some point I want to reload it after the user has edited the strings. This is the function: NSMutableArray *lessonsFunc(id a, id b, id c, id d, id e, id f){ monData *mon = [monData sharedData]; return [...

Declare function at end of file in Python.

Greetings StackOverflow, Is it possible to call a function without first fully defining it? When attempting, i get the error: "*function_name* is not defined". I am coming from a c++ background so this issue stumps me. Declaring the function before works: def Kerma(): return "energy / mass" print Kerma() However, atte...

What does the exclamation mark do before the function?

!function () {}(); ...

SQL Server Function That Returns A Delimited String

Hey I have a table like this: ID BitOne BitTwo BitThree -- ------ ------ -------- 99 NULL 1 NULL 99 1 NULL NULL And I need a user function that returns the string "BitTwo, BitOne" for the ID: 99 - which would be the input parameter for the function. Is that possible? ...

What does this PHP function return?

Hi. public function add($child){ return $this->children[]=$child; } Btw, this is an excerpt from PHP in Action by Dagfinn Reiersol. According to the book, this returns $child, but shouldn't it return true in case of successful assignment and false otherwise? Thanks in advance ...

javascript scope question

I've written a little Ajax-y page, that displays data rows from an ajax request. Each row has a "delete link" to allow the user to delete the row quickly, also via ajax. My problem is one with the scope of the function-- The "main" page has a function that looks like this: <script language="javascript" type="text/javascript"> window.a...

Excel - Using OFFSET function to create dynamic graphs

Hi guys, I have been working on a dynamic way to create a bargraph where the data can be updated and modified over time which will change the appearance of the graph e.g. If I add a new row it will feed that data into the graph. I have managed to do this successfully when the data is organised vertically e.g. Data column which has the ...

C++ function call question

Hi, i have a question about the function call in the following example: int main() { int a, b; cin >> a >> b >> endl; cout << *f(a,b); return 0; } So is *f(a,b) a valid function call? Edit:: sorry for the errors, i fixed them now i'm a little tired ...

Fastest JavaScript summation

What is the fastest way to sum up an array in JavaScript? A quick search turns over a few different methods, but I would like a native solution if possible. This will run under SpiderMonkey. Thinking very inside-the-box I have been using: var count = 0; for(var i = 0; i < array.length; i++) { count = count + array[i]; } I'm sure...

jquery replace < with " " (a space)

I'm trying to replace the characters < and > onblur with a space when someone enters it into my form. I've got this at the moment $(".tbAddress").blur(function() { $("<").replaceWith(" "); $(">").replaceWith(" "); } Any help would be much appreciated thanks Jamie ...

What am I doing wrong in this bash function?

I'm trying to create a function that goes to a specific directory, and if a single argument is specified add that to the directory string. But no matter what I try I can't get it to work and bash always reports that X is not a directory even though if I copy/paste it to a new command line it works from there. function projects () { DI...

Counting Null Values in an array

Making an uno game for a project. all 108 cards are located in a filled array named cardDeck[108] the start function pulls 7 cards at random and fills the players hand by adding them to an array called playerHand[] I need help on this please. 1) I don't know how to make the cards dissappear out of the cardDeck array when they are pu...

Is it possible in Delphi to get the address of a function/procedure in another process?

I use Madshi's madCodeHook components to Inject a DLL in a process, and then hook a procedure/function. The problem is each time a new version of the EXE comes out the address of the functions may change. Currently the way I do it is to use Ollydbg and then hard code the address in the DLL that I inject into the process, this is very u...

C Programming weird struct setup

I am trying to build this project and for some reason the program hangs when I run it. It works fine if i comment out the data cache lines. but it cannot make a call to makeCache for two different caches i dont know why any C experts know. Im new to c. /* * main.c * * Created on: Sep 16, 2010 * Author: TJ */ #include <std...

php make function inside a variable.

Im sure I have seen an implementation of this in PHP somewhere and I am positive if it exists its a PHP 5 thing. Any way I was wondering if it was possible to set and run a function from a string and set the returned value to the value of the string. e.g. <?php $hi = function(){ return "Hello World"; }; echo $hi(); ?> It probably is ...

How does PHP's list function work?

Hello my friends, After recently answering a couple of questions here on SO that involved utilizing PHP's list function, I wondered, "how in the world does that function actually work under the hood?". I was thinking about something like using func_get_args() and then iterating through the argument list, and that's all nice and peachy, ...