function

How can I pass variable parameters into a Javascript Function using Excel VBA

Hi, I'm not sure if I have the correct terms above, but what I'm trying to do is call a Javascript function passing parameters into it from an Excel File, so the function will run and list the items in the next textbox, allowing me to choose the correct entry in that textbox, which then chooses the final box. Here is the code that I hav...

Is there any use for local function declarations?

Most C++ programmers like me have made the following mistake at some point: class C { /*...*/ }; int main() { C c(); // declares a function c taking no arguments returning a C, // not, as intended by most, an object c of type C initialized // using the default constructor. c.foo(); // compiler compla...

How do I start optimising my Java code? - CPU is at 100%

i have written an application, but for some reason it keeps peaking at 100%. I ran a profile r on a few of the classes and a report show that isReset() and isRunning() seems to be called alot of times. Do you see anything wrong please inform me. thanks Class 1 is the only class that uses the isReset() code so i hope this helps u guys in...

2D non-polynomial function fitting from the command line

I just wrote a simple Unix command line utility that could be implemented a lot more efficiently. I can measure its performance by just running it on a number of inputs and measuring the time it takes. This will produce a set of pairs of numbers, s t, where s is the input size and t the processing time. In order to determine the perfo...

I am stuck with php array()?

Does anybody have an idea why following array() is passing into function. I am not able to understand the array() function. I know, if $_POST dont have any value, it will pass array(). but what are the value in array()? SomeFunction($_POST ? $_POST : array()); ...

HTML within Javascript Function Not Working Properly

Hello: I am using the following JavaScript function: function Projects() { var PrjTb1 = "<input type=text id=PrjNme size=100/>" var PrjTb2 = "<textarea rows=5 col=200 wrap=hard></textarea>" var Info = "1. Project or activity name:<br>" + PrjTb1 + "<br><br>2. Project or activity description:<br>" + PrjTb2 if (document.g...

Excel function Fill Up Cells

Consider the following data on excel(which you have to create in excel): Numbers 0.2 0.2 3.4 1.5 1.8 4.2 Write a VBA function that scans through the selection, finds the empty spots and then t fills them with a numerical value which is passed through the signature of the function. Output: Numbers 0.2 0.2 3.4 0 1.5 1.8 0.0 4.2 Hi ...

Is it possible to use anonymous functions in C++ .NET?

Wikipedia seems to say that C++0x will support anonymous functions. Boost also seem to support it. However I'm using .NET so if I could stick with it it would be awesome. Basically I just want to write some quick code for objects. I have a robot which can have about 85 - 90 states. Most of the states are just "integer values passed to t...

Lambda calculus and church numerals confusion

I'm trying to understand the basics of lambda calculus and Church numerals. I have been doing a lot of reading and practising, but I seem to keep getting stuck with trying to see how some functions work. The example I am stuck on is as follows. Perhaps someone can explain where I have gone wrong. The Church numeral for 1 can be represe...

Pre/Post function call implementation

I was wondering if I could do pre/post function call in C++ somehow. I have a wrapper class with lots of functions, and after every wrapper function call I should call another always the same function. So I do not want to put that postFunction() call to every single one of the functions like this: class Foo { f1(); f2(); f3...

Is there a "function size profiler" out there?

After three years working on a C++ project, the executable has grown to 4 MB. I'd like to see where all this space is going. Is there a tool that could report what the biggest space hogs are? It would be nice to see the size by class (all functions in a class), by template (all instantiations), and by library (how much belongs to the C s...

Javascript setting variables and object and proper syntax (debug console)

So I am trying to invoke methods on a page and I know the values that I want to put inside the methods but I can't seem to get the syntax to work. I feel so, well.. lamerized. Ok so here is the javascript method on the page function ReturnValue (sValue, sText) { window.focus(); var oForm = document.EditForm; switch (s...

Taking type of a template class

Hi everyone i have a question about templates, is there a way for taking type of a template class, for example //i have template function template<typename T> IData* createData(); //a template class instance std::vector<int> a; //using type of this instance in another template //part in quotation mark is imaginary of course :D IData...

When is the best time to call a function to change data being returned from the database

I have two functions written in VB.NET: 1) The first function (call it GetValues()) returns values in a SQL database as a list via a stored proc. One of the fields is DateTimeSubmitted. All of this data is displayed on my webpage using a repeater control. It works fine. 2) The second function (call it NiceDate()) I created to change t...

C - Sending the contents of a matrix in one function to a matrix in another function

Good evening. How can I pass the contents of a char matrix in one function to another matrix of equal dimensions in another function? Many thanks in advance. ...

PL/SQL: Retrieve names of procedures and functions within a package

Is it possible to retrieve the names of all procedures and functions that reside within a particular package? I understand that they can be gleaned (smells hack-ish) from the ALL_SOURCE view, but I would prefer a more canonical strategy. ...

Make links clickable in PHP with twitterlibphp?

Hey guys, I'm using Twitter's PHP API, called twitterlibphp, and it works well, but there's one thing that I need to be able to initiate, which is the linking of URLs and @username replies. I already have the function for this written up correctly (it is called clickable_link($text);) and have tested it successfully. I am not too famil...

Math opposite sign function?

Does such function exist? I created my own but would like to use an official one: private function opposite(number:Number):Number { if (number < 0) { number = Math.abs(number); } else { number = -(number); } return number; } So, -5 becomes 5 and 3 becomes -3. Edit: For...

Clojure function reading from stream locks

I have a function that reads one token from an input stream that is called (get-next-indicator stream indicator) and returns it. I am trying to use it to construct a map. But, when I run it, it locks up. If I remove one of the get-next-indicator function, it does work. Does both functions try to read the stream at the same time is this...

javascript onclick, anonymous function help

Hello everyone, I am a beginning javascript programmer. I am trying to create something similar to Lightbox 2, but much simpler. The only reason why I want to do it from scratch on my own is so that I can learn. However, I've been stuck on the last critical part where it displays the image. I believe the problem lies where I try to use o...