function

Javascript for hover over one image to bring up another with description in a fixed place.

Hey so I'm trying to create the JavaScript, functions and HTML coding for the website I am working on.I have 8 small images on the left hand side. A default large image on the right. I want to make it so when I hover over each small image another different large image replaces the default large image on the right hand side with a descri...

Dynamically declare function name?

I am creating a list of bar buttons with its action functions (sFuncName as below), it is dynamically changed. When user clicks on a button, sFuncName will be called. for(int i = 0; i < 3 ; i++){ NSString* sFuncName = [NSString stringWithFormat:@"OnFunc_%d:", i ]; barButtonItem = [[UIBarButtonItem alloc] initWithBarBut...

How to use acast (reshape2) within a function in R?

I tried to use acast from reshape2 within a self written function, but had the problem that acast did not find the data I send to it. Here is my data: library("reshape2") x <- data.frame(1:3, rnorm(3), rnorm(3), rnorm(3)) colnames(x) <- c("id", "var1", "var2", "var3") y <-melt(x, id = "id", measure = c("var1", "var2", "var3")) y ...

find about about the type of function parameters

can i somehow find all functions/macros that take a specific type of parameter ? for example, what function accepts a Namespace object as parameter ? (this is because i can create a namespace and store it in a var, but i don't know where i could use that var; what function might i pass that var to ?) here is some code: user=> (def wo...

Access OpenPDFFromMem function of an ActiveX control in .NET

I have an ActiveX control which has a function for opening a document directly from memory. The function has the following signature: Public Overridable Function OpenPDFFromMem(ByVal lpPDFData As Integer, ByVal nPDFDataLen As Integer, ByVal lpszUserPwd As String, ByVal lpszOwnerPwd As String) As Boolean How do I load the document in me...

Accepting nested variadic class templates as arguments to function template.

I'm trying to make a function template that will accept two (or more) of the nested variadic class templates listed below, as arguments, and put them into another data structure that will accept different types (pair or tuple is what I'll most likely use). Here are the classes and subclasses, along with the usage of my function (the fun...

Function not defined

I am getting a function not defined error with my jquery script and i'm not sure why. JQuery Code: <script type="text/javascript"> $(document).ready(function(){ var dealerName = $('.name', '.adr').text(); var customerName = dealerName.slice(0, - 1); var customerAddress = $('.street', '.adr').text() + ', ' + $('.locality', '.a...

Declare variables at top of function or in separate scopes?

Which is preferred, method 1 or method 2? Method 1: LRESULT CALLBACK wpMainWindow(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { switch (msg) { case WM_PAINT: { HDC hdc; PAINTSTRUCT ps; RECT rc; GetClientRect(hwnd, &rc); hdc = BeginPa...

jquery counting function. if statement

I am trying to write a bit of jquery to: if there is only one instance of the div which has a class of "option" take the href attribute and redirect to that href, this is what i have to far <script type="text/javascript"> var count =('Size: ' + $('.option').size()); if (count = 1) { $('.readmore a').each(function () { v...

Function call in wrong order

This is what i have coded today #include <iostream> using namespace std; int function1() { cout<<"hello from function1()"; return 0; } int function2() { cout<<"hello from function2()"; return 0; } int main() { int func_diffresult = 0; func_diffresult = function1() - function2(); cout<<func_diffresult; /** prints 0 cor...

Looping through Elements

Hey guys, I want to make a function loop over all elements that have the class of ".block-header-tabs" and do the following: $(function(){ function cssTabs(){ var firstTab = $(".block-header-tabs").find("a:first"); var firstBlock = $(".block-header-tabs").find("a:first").attr('href'); $(firstBlock).parent().css({position: "relative"})...

whats the best way to write a php mysql funtion?

i want to retrieve information from my database quite a lot throughout my app, i was thinking it would be easier to write function, so i can access it anytime, what is the best way to write one! thanks :)) ...

Algorithm for online approximation of a slowly-changing, real valued function

Hi all, I'm tackling an interesting machine learning problem and would love to hear if anyone knows a good algorithm to deal with the following: The algorithm must learn to approximate a function of N inputs and M outputs N is quite large, e.g. 1,000-10,000 M is quite small, e.g. 5-10 All inputs and outputs are floating point values, ...

requestAction() does not go to the controller's function after beforeFilter(), from a shell class

Hi, In my CakePHP aplication, I use a shell script with a cron job which is working perfectly, except when it comes to call the requestAction() function. Thanks to my logs, I can see it going to the proper Controller->beforeFilter() function, but after that nothing happens. It neves goes into the specific function. I tried to output $t...

Javascript function argument handling

It seems the best way to deal with arguments in javascript functions is to require the caller to pass an associative array: example = function(options) { alert('option1: ' + options.a + ', option2: ' + options.b); } Now arguments are named and not needed in any particular order when calling this function: example({'b':'hello option...

Ada: declarative part, function and packages

Hi, I have a query with declarative part, function and packages. I have a package as shown next. Due to the complexity of the Compute_X1 function, I have create a "is separate" for computing this function. The value returned from Compute_X1 is X1 and is to be used in the function J21 (J21 takes X1 as a first argument). Package specif...

View from dynamically generated list of tables

Hello, So I basicly have a table which has a list of table names. All these listed tables have exact same structure. Then I have a query template, with place holder for table name. I need to create a view, which should return results of that query UNIONed from all the tables listed in that one setup table. So far what I've done is cr...

Conflict between providing (optional) functionality and encapsulation?

I need to provide a certain operation on the elements of my class Foo. This operation is specific and weird enough that I don't really want to make it a member function. On the other hand, it works on the internals of the class, which I don't want to expose. Here is the class: class Foo { typedef std::map<int,double> VecElem; std::...

storing return values then using vs using directly c++

Hey guys, I was writing some code and I found a peculiar error. The function convert_vector2d(&i_scale) converts a string to a vector2d (inherits from sf::vector2f). If you examine the next few lines of code, I am doing the same operation twice. Code: Select all float x = convert_Vector2D(&i_scale).x; float y = convert_Vector2D(&i_scal...

VIM macro for interacting with multiple tabs

Hi All, This is what I want to do using GVIM 7.3: open a file in new tab (first tab) get all lines which contain a pattern -> insert them to a register/clipboard open a new tab (second tab) paste the code from clipboard do some regex replace process in the second tab. I can manually execute commands one by one successfully. I even c...