Search Results

Search found 40165 results on 1607 pages for 'function pointers'.

Page 14/1607 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Calling function after .load (Jquery)

    - by Matt
    Having a little difficulty getting a function to call after a .load: $(function(){ $('a.pageFetcher').click(function(){ $('#main').load($(this).attr('rel')); }); }); The page loads, but the functions don't fire: $(function(){ var $container = $('#container'); $container.imagesLoaded(function(){ $container.masonry({ itemSelector: '.box', }); }); $container.infinitescroll({ navSelector : '#page-nav', nextSelector : '#page-nav a', itemSelector : '.box', loading: { finishedMsg: 'Nothing else to load.', img: 'http://i.imgur.com/6RMhx.gif' } }, function( newElements ) { $.superbox.settings = { closeTxt: "Close this", loadTxt: "Loading your selection", nextTxt: "Next item", prevTxt: "Previous item" }; $.superbox(); var $newElems = $( newElements ).css({ opacity: 0 }); $newElems.imagesLoaded(function(){ $newElems.animate({ opacity: 1 }); $container.masonry( 'appended', $newElems, true ); }); } ); }); I've attempted to combine them so that the 2nd functions are called after .load (after doing some searching on this site and looking at given answers/examples) but nothing seems to work properly. Suggestions?

    Read the article

  • Pinvoke- to call a function with pointer to pointer to pointer parameter

    - by jambodev
    complete newbe in PInvoke. I have a function in C with this signature: int addPos(int init_array_size, int *cnt, int *array_size, PosT ***posArray, PosT ***hPtr, char *id, char *record_id, int num, char *code, char *type, char *name, char *method, char *cont1, char *cont2, char *cont_type, char *date1, char *date_day, char *date2, char *dsp, char *curr, char *contra_acc, char *np, char *ten, char *dsp2, char *covered, char *cont_subtype, char *Xcode, double strike, int version, double t_price, double long, double short, double scale, double exrcised_price, char *infoMsg); and here is how PosT looks like: typedef union pu { struct dpos d; struct epo e; struct bpos b; struct spos c; } PosT ; my questions are: 1- do I need to define a class in CSharp representing PosT? 2- how do I pass PosT ***posArray parameter across frm CSharp to C? 3- How do I specify marshaling for it all? I Do appreciate your help

    Read the article

  • [C] this code, its work fine and return what i want, but its hangs before print it ??

    - by Rami Jarrar
    I make this program :: #include<stdio.h> char *raw_input(char *msg); main() { char *s; *s = *raw_input("Message Here Is: "); printf("Return Done.."); printf(s); } char *raw_input(char *msg){ char *d; printf("%s", msg); scanf("%s",&d); return d; } What this do is, it print my message and scan for input from the user, then print it,, but whats the problem in print the input from the user ??? Update:: I need the raw_input func. call be like this without any extra *s = *raw_input("Message Here"); I dont want to use this :: raw_input("Message Here Is: ", d); .... Just want to return the string that the user will enter .

    Read the article

  • return an address of a double

    - by bks
    i'm having an issue understanding why the following works: void doubleAddr(double* source, double** dest) { *dest = source; } i get a pointer to a double and want to change the double that dest points to: //usage: int main() { double* num; double* dest; doubleAddr(num, &dest); return 0; } thanks in advance

    Read the article

  • Pass 2d array to function in C?

    - by Evelyn
    I know it's simple, but I can't seem to make this work. My function is like so: int GefMain(int array[][5]) { //do stuff return 1; } In my main: int GefMain(int array[][5]); int main(void) { int array[1800][5]; GefMain(array); return 0; } I referred to this helpful resource, but I am still getting the error "warning: passing argument 1 of GefMain from incompatible pointer type." What am I doing wrong?

    Read the article

  • [C] this code, its work fine and return what i want, but its hang before print it ??

    - by Rami Jarrar
    I make this program :: #include<stdio.h> char *raw_input(char *msg); main() { char *s; *s = *raw_input("Message Here Is: "); printf("Return Done.."); printf(s); } char *raw_input(char *msg){ char *d; printf("%s", msg); scanf("%s",&d); return d; } What this do is, it print my message and scan for input from the user, then print it,, but whats the problem in print the input from the user ???

    Read the article

  • How to approach copying objects with smart pointers as class attributes?

    - by tomislav-maric
    From the boost library documentation I read this: Conceptually, smart pointers are seen as owning the object pointed to, and thus responsible for deletion of the object when it is no longer needed. I have a very simple problem: I want to use RAII for pointer attributes of a class that is Copyable and Assignable. The copy and assignment operations should be deep: every object should have its own copy of the actual data. Also, RTTI needs to be available for the attributes (their type may also be determined at runtime). Should I be searching for an implementation of a Copyable smart pointer (the data are small, so I don't need Copy on Write pointers), or do I delegate the copy operation to the copy constructors of my objects as shown in this answer? Which smart pointer do I choose for simple RAII of a class that is copyable and assignable? (I'm thinking that the unique_ptr with delegated copy/assignment operations to the class copy constructor and assignment operator would make a proper choice, but I am not sure) Here's a pseudocode for the problem using raw pointers, it's just a problem description, not a running C++ code: // Operation interface class ModelOperation { public: virtual void operate = (); }; // Implementation of an operation called Special class SpecialModelOperation : public ModelOperation { private: // Private attributes are present here in a real implementation. public: // Implement operation void operate () {}; }; // All operations conform to ModelOperation interface // These are possible operation names: // class MoreSpecialOperation; // class DifferentOperation; // Concrete model with different operations class MyModel { private: ModelOperation* firstOperation_; ModelOperation* secondOperation_; public: MyModel() : firstOperation_(0), secondOperation_(0) { // Forgetting about run-time type definition from input files here. firstOperation_ = new MoreSpecialOperation(); secondOperation_ = new DifferentOperation(); } void operate() { firstOperation_->operate(); secondOperation_->operate(); } ~MyModel() { delete firstOperation_; firstOperation_ = 0; delete secondOperation_; secondOperation_ = 0; } }; int main() { MyModel modelOne; // Some internal scope { // I want modelTwo to have its own set of copied, not referenced // operations, and at the same time I need RAII to work for it, // as soon as it goes out of scope. MyModel modelTwo (modelOne); } return 0; }

    Read the article

  • What is wrong in this c++ code?

    - by narayanpatra
    Why this coder do not show error #include <iostream> int main() { using namespace std; unsigned short int myInt = 99; unsigned short int * pMark = 0; cout << myInt << endl; pMark = &myInt; *pMark = 11; cout << "*pMark:\t" << *pMark << "\nmyInt:\t" << myInt << endl; return 0; } But this one shows : #include<iostream> using namespace std; int addnumber(int *p, int *q){ cout << *p = 12 << endl; cout << *q = 14 << endl; } #include<iostream> using namespace std; int addnumber(int *p, int *q){ cout << *p = 12 << endl; cout << *q = 14 << endl; } int main() { int i , j; cout << "enter the value of first number"; cin >> i; cout << "enter the value of second number"; cin >> j; addnumber(&i, &j); cout << i << endl; cout << j << endl; } In both the code snippets, I am assigning *pointer=somevalue. In first code it do not show any error but it shows error in the line cout << *p = 12 << endl; cout << *q = 14 << endl; What mistake I am doing ?

    Read the article

  • Finding What You Need in R: function arguments/parameters from outside the function's package

    - by doug
    Often in R, there are a dozen functions scattered across as many packages--all of which have the same purpose but of course differ in accuracy, performance, theoretical rigor, and so on. How do you gather all of these in one place before you start your task? So for instance: the generic plot function. Setting secondary ticks is much easier (IMHO) using a function outside of the base package, minor.tick(nx=n, ny=n, tick.ratio=n), found in Hmisc. Of course, that doesn't show up in plot's docstring. Likewise, the data-input arguments to 'plot' can be supplied by an object returned from the function 'hexbin', again, from a library outside of the base installation (where 'plot' resides). What would be great obviously is a programmatic way to gather these function arguments from the various libraries and put them in a single namespace. edit: (trying to re-state my example just above more clearly:) the arguments to plot supplied in the base package for, e.g., setting the axis tick frequency are xaxp/yaxp; however, one can also set a/t/f via a function outside of the base package, again, as in the minor.tick function from the Hmisc package--but you wouldn't know that just from looking at the plot method signature. Is there a meta function in R for this? So far, as i come across them, i've been manually gathering them in a TextMate 'snippet' (along with the attendant library imports). This isn't that difficult or time consuming, but i can only update my snippet as i find out about these additional arguments/parameters. Is there a canonical R way to do this, or at least an easier way? Just in case that wasn't clear, i am not talking about the case where multiple packages provide functions directed to the same statistic or view (e.g., 'boxplot' in the base package; 'boxplot.matrix' in gplots; and 'bplots' in Rlab). What i am talking is the case in which the function name is the same across two or more packages.

    Read the article

  • Finding all Stored procedures calling a function

    - by Abhishek Jain
    Hi, How can I find out all the stored procedures that are calling a particular user defined function in SQL Server 2005. Or how to assign a defult value to a parameter in a user defined function so that when a stored procedure calls that function and does not pass any value to that parameter function assumes the default value. Regards, Abhishek jain

    Read the article

  • Javascript new object (function ) vs inline invocation

    - by Sheldon Ross
    Is there any considerations to determine which is better practice for creating an object with private members? var object = new function () { var private = "private variable"; return { method : function () { ..dosomething with private; } } } VS var object = function () { ... }(); Basically what is the difference between using NEW here, and just invoking the function immediately after we define it?

    Read the article

  • custom php function creation and install

    - by Ben Olley
    I would like to know how to create a php function that can be installed in php just like the already built in functions like : rename copy The main point I would like to achieve is a simple php function that can be called from ANY php page on the whole host without needing to have a php function within the php page / needing an include. so simply I would like to create a function that will work like this : location(); That without a given input string will output the current location of the file via echo etc

    Read the article

  • creating a JQuery function

    - by Russell Parrott
    Sorry to bother you guys & girls again on Christmas eve, but I need help creating a reusable JQuery function. I have "badly crafted" this set of code that all works. But I would really like to put it as a function so I don't have to keep repeating everything for each form. I am not too sure about how all the if statements can be combined etc. that is why I wrote it as it is. Any help much appreciated - Oh I suppose it could also be some kind of plugin but that might be the next step if I can understand how the function works. $(':input:visible').live('blur',function(){ if($(this).attr('required')) { if($(this).val() == '' ) { $(this).css({'background-color':'#FFEEEE' }); $(this).parent('form').children('input[type=submit]').hide(); $(this).next('.errormsg').html('OOPs ... '+$(this).prev('label').html()+' is required'); $(this).focus(); $(this).attr('placeholder').hide(); } else { $(this).css({'background-color':'#FFF' , 'border-color':'#999999'}); $(this).next('.errormsg').empty(); $(this).parent('form').children('input[type=submit]').show(); } } return false; }); $(':input[max]').live('blur',function(){ if($(this).attr('max') < parseInt($(this).val()) ){ $(this).next('.errormsg').html( 'OOPs ... the maximum value is '+$(this).attr('max') ); $(this).parent('form').children('input[type=submit]').hide(); $(this).focus(); } else {} return false; }); $(':input[min]').live('blur',function(){ if($(this).attr('min') > parseInt($(this).val()) ){ $(this).next('.errormsg').html( 'OOPs ... the minimum value is '+$(this).attr('min') ); $(this).parent('form').children('input[type=submit]').hide(); $(this).focus(); } else {} return false; }); $(':input[maxlength]').live('keyup',function(){ if($(this).val()==''){ } else { $(this).next('.errormsg').html( $(this).attr('maxlength')- $(this).val().length +' chars remaining'); } return false; }); As said, help much appreciated with one small (I hope) thing, how can I break out of any function IF there are no error messages to actually submit the form?

    Read the article

  • Jquery toggle function that doesn't return false?

    - by Tom
    Hi, Is it possible to stop the automatic preventDefault() from applying in a simple Jquery toggle function? $(".mydiv").toggle( function () { $(this).addClass("blue"); }, function () { $(this).removeClass("blue"); } ); The above prevents elements inside the div from responding normally to the click. It doesn't have to be the toggle() function - anything that allows toggling a class on and off AND doesn't return false would be great. Thanks.

    Read the article

  • nested function

    - by user359179
    Hi to all of you, 1.I just came across that ANSI(ISO) aint allow nesting of function.. i want to know what makes gnu c ito implemet this functionality(why such need arise). 2.If a function say(a()) is define with in another function say(b()) then the lifetime of a() would be whole prorgramme? 3.Will the storage for a() ll be created in a stack allocated to function b().?

    Read the article

  • what functions are called when passing value to function

    - by Tim
    In C++, if an object of a class is passed as a parameter into a function, the copy constructor of the class will be called. I was wondering if the object is of nonclass type, what function will be called? Similarly in C, what function is called when passing values or address of variables into a function? Thanks and regards!

    Read the article

  • Passing a filepath to a R function?

    - by Philipp
    Hi everybody, I tried to pass a filepath to a function in R, but I failed =/ I hope someone here can help me. >heat <- function(filepath) { chicks <- read.table(file=filepath, dec=",", header=TRUE, sep="\t") ... } When I call the function, nothing happens... >heat("/home/.../file.txt") ... and "chicks" is not found >chicks Error: Object 'chicks' not found What is the correct way to pass a path to a function? Best wishes from Germany, Phil

    Read the article

  • callback function for php preg_replace_callback not getting called on linux CentOS 5.4

    - by user105165
    I have used the preg_replace_callback as $string = preg_replace_callback($pattern,'CreateTemplatesController::callbackhandler',$string ); I have called the callbackhandler function with the class name as this function is a private static function. Problem is "callbackhandler" function is not getting called. Please post if any one know the reason for the same. Thanks in Advance

    Read the article

  • How to pass a function as an argument?

    - by TFerrell
    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") }); </script> Thanks in advance for any help.

    Read the article

  • Function keys on Dell laptop work double as OEM keys

    - by Factor Mystic
    I'm working with a new Dell Studio 1555, and the F1-F12 keys at the top of the keyboard are dual function with OEM keys such as volume and screen brightness. The problem is, is that the OEM keys are the default, and you have to press the Fn key to get the F- key to work. For example, this means you have to hit Alt+Fn+F4 to close a window, instead of the regular Alt+F4. This is really annoying. Is there a way to reverse the default functions of the F- keys in Windows? Ideally this is possible without some kind of third party hotkey manager.

    Read the article

  • Excel INDIRECT function and conditional formatting - highlighting a row

    - by Ehryk
    I'm having an issue with conditional formatting using the INDIRECT function. I'm doing something similar to Using INDIRECT and AND/IF for conditional formatting , but the only answer there isn't working for me. Basically, I want to highlight rows where B is not blank and F is blank. INDIRECT will work for ONE of the conditions, but = AND(INDIRECT("B"&ROW()) > 0, INDIRECT("F"&ROW()) = "") does not work at all. The answer in the question points to replacing the references with relative ones, so I'm thinking this should work: = AND ($B2 > 0, $F2 = "") But it does not, nor does ISBLANK($F@) or ISEMPTY($F2) (the cell contains a formula that sometimes will return "", I want the row highlighted in these cases but only when something is in column B). Am I missing something about relative references? Why doesn't INDIRECT work with AND/OR?

    Read the article

  • Function key taken by another program, how to default it

    - by Milox
    Everytime I press the F11 key it opens up a browser window with the same URL. This happens anywhere I press it and I need this key to have it's default behavior because I use it to program on Visual Studio (Windows 7). Any ideas why this is happening and how to go back to default function keys?, I haven't installed anything that I remember can cause this behavior. This is a standard Dell desktop key board, no multimedia keys, like this one: Firing URL is http://argos:8080/Login.jsp?jsessionid=55rh3obsahm9m seems like one of our company's internal addresses but IT guys say they have no idea about it. I don't see any suspicious software that can be causing this.

    Read the article

  • Array of pointers in C++.

    - by Theorem
    I am not understanding the output of this , #include <iostream> using namespace std; // pointers and arrays char ch1 = 'a' , ch2= 'b'; char ch3[6] = {'c', 'd', 'e', 'f', 'g' , 'h'}; char *ptr[3]; int main () { ptr[0] = &ch1 ; ptr[2] = ch3; cout << &ch1 << endl; } The out put is abcdefgh . isn't &ch1 supposed to give the address of ch1 ? I cannot make sense why the output should be abcdefgh.

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >