Search Results

Search found 37874 results on 1515 pages for 'worksheet function'.

Page 16/1515 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • Go - Generic function using an interface

    - by nevalu
    Since I've a similar function for 2 different data types: func GetStatus(value uint8) (string) {...} func GetStatus(name string) (string) {...} I would want to use a way more simple like: func GetStatus(value interface{}) (string) {...} Is possible to create a generic function using an interface? The data type could be checked using reflect.Typeof(value)

    Read the article

  • Difference of function argument as (const int &) and (int & a) in C++

    - by Narek
    I know that if you write void function_name(int& a), then function will not do local copy of your variable passed as argument. Also have met in literature that you should write void function_name(const int & a) in order to say compiler, that I dont want the variable passed as argument to be copied. So my question: what is the difference with this two cases (except that "const" enshures that the variable passes will not be changed by function!!!)???

    Read the article

  • VB.NET Function Return

    - by waves
    In order to return a value from a VB.NET function one can assign a value to the "Functions Name" or use "return value." I sometimes see these inter-mixed in the same function. Personally, I prefer the return. My question is, what is the internal difference, if any, between the two?

    Read the article

  • Solr sort by function

    - by spacemonkey
    Hi, I need to sort query results by the output of some function which takes "score" and couple other fields as an input (50% of the total score comes from similarity score and 50% comes from document's popularity). Is there a way to do this without having to install "Sort by Function" patch? Thanks!

    Read the article

  • How to call DLL function in vbscript

    - by amritad
    I am writing VB script in which I have to call a function of a COM DLL. The fuction which I want to use is in structure and thus I want to create the object of that structure to access the required function. e.g. I have a dll 'BasicCom.dll', in which struct abc { bool xyz(); } Now I want to call xyz(). Is any one have any idea, how to deal with such call in Vb script.

    Read the article

  • Call c++ function pointer from c#

    - by Sam
    Is it possible to call a c(++) static function pointer like this typedef int (*MyCppFunc)(void* SomeObject); from c#? void CallFromCSharp(MyCppFunc funcptr, IntPtr param) { funcptr(param); } I need to be able to callback from c# into some old c++ classes. C++ is managed, but the classes are not ref classes (yet). So far I got no idea how to call a c++ function pointer from c#, is it possible?

    Read the article

  • js function to get filename from url

    - by Blankman
    Hi, I have a url like http://www.example.com/blah/th.html I need a javascript function to give me the 'th' value from that. All my urls have the same format (2 letter filenames, with .html extension). I want it to be a safe function, so if someone passes in an empty url it doesn't break. I know how to check for length, but I should be checking for null to right?

    Read the article

  • C++ boost function overloaded template

    - by aaa
    I cannot figure out why this segment gives unresolved overloaded function error (gcc version 4.3.4 (Debian 4.3.4-6)): #include <algorithm> #include <boost/function.hpp> int main { typedef boost::function2<const int&, const int&, const int&> max; max m(static_cast<max>(&std::max<int>)); } can you help me, thanks

    Read the article

  • Arguments to JavaScript Anonymous Function

    - by Phonethics
    for (var i = 0; i < somearray.length; i++) { myclass.foo({'arg1':somearray[i][0]}, function() { console.log(somearray[i][0]); }); } How do I pass somearray or one of its indexes into the anonymous function ? somearray is already in the global scope, but I still get somearray[i] is undefined

    Read the article

  • c++ Function pointer inlining

    - by wb
    I know I can pass a function pointer as a template parameter and get a call to it inlined but I wondered if any compilers these days can inline an 'obvious' inline-able function like: inline static void Print() { std::cout << "Hello\n"; } .... void (*func)() = Print; func(); Under Visual Studio 2008 its clever enough to get it down to a direct call instruction so it seems a shame it can't take it a step further?

    Read the article

  • TSQL, Rename column of a returning table in user Function

    - by user1433660
    I have defined function which returns table with 2 columns. Can I rename these columns so that resulting table would be like: Press name | Sum of pages ? CREATE FUNCTION F_3 (@press nvarchar(255)) RETURNS @table TABLE ( Press nvarchar(255), PagesSum int ) AS BEGIN INSERT @table SELECT @press, SUM(Books.Pages) FROM Books, Press WHERE Press.Name = @press AND Books.Id_Press = Press.Id GROUP BY Press.Name RETURN END GO SELECT * FROM F_3('BHV') GO I've tried to do it like Press AS 'Press name' nvarchar(255) but that won't work.

    Read the article

  • Passing template into boost function

    - by Ockonal
    template <class EventType> class IEvent; class IEventable; typedef boost::function<void (IEventable&, IEvent&)> behaviorRef; What is the right way for passing template class IEvent into boost function? With this code I get: error: functional cast expression list treated as compound expression error: template argument 1 is invalid error: invalid type in declaration before ‘;’ token

    Read the article

  • How to iterate over all the page breaks in an Excel 2003 worksheet via COM

    - by Martin
    I've been trying to retrieve the locations of all the page breaks on a given Excel 2003 worksheet over COM. Here's an example of the kind of thing I'm trying to do: Excel::HPageBreaksPtr pHPageBreaks = pSheet->GetHPageBreaks(); long count = pHPageBreaks->Count; for (long i=0; i < count; ++i) { Excel::HPageBreakPtr pHPageBreak = pHPageBreaks->GetItem(i+1); Excel::RangePtr pLocation = pHPageBreak->GetLocation(); printf("Page break at row %d\n", pLocation->Row); pLocation.Release(); pHPageBreak.Release(); } pHPageBreaks.Release(); I expect this to print out the row numbers of each of the horizontal page breaks in pSheet. The problem I'm having is that although count correctly indicates the number of page breaks in the worksheet, I can only ever seem to retrieve the first one. On the second run through the loop, calling pHPageBreaks->GetItem(i) throws an exception, with error number 0x8002000b, "invalid index". Attempting to use pHPageBreaks->Get_NewEnum() to get an enumerator to iterate over the collection also fails with the same error, immediately on the call to Get_NewEnum(). I've looked around for a solution, and the closest thing I've found so far is http://support.microsoft.com/kb/210663/en-us. I have tried activating various cells beyond the page breaks, including the cells just beyond the range to be printed, as well as the lower-right cell (IV65536), but it didn't help. If somebody can tell me how to get Excel to return the locations of all of the page breaks in a sheet, that would be awesome! Thank you. @Joel: Yes, I have tried displaying the user interface, and then setting ScreenUpdating to true - it produced the same results. Also, I have since tried combinations of setting pSheet->PrintArea to the entire worksheet and/or calling pSheet->ResetAllPageBreaks() before my call to get the HPageBreaks collection, which didn't help either. @Joel: I've used pSheet->UsedRange to determine the row to scroll past, and Excel does scroll past all the horizontal breaks, but I'm still having the same issue when I try to access the second one. Unfortunately, switching to Excel 2007 did not help either.

    Read the article

  • Importing an Excel WorkSheet into a Datatable

    - by Nick LaMarca
    I have been asked to create import functionality in my application. I am getting an excel worksheet as input. The worksheet has column headers followed by data. The users want to simply select an xls file from their system, click upload and the tool deletes the table in the database and adds this new data. I thought the best way would be too bring the data into a datatable object and do a foeach for every row in the datatable insert row by row into the db. My question is what can anyone give me code to open an excel file, know what line the data starts on in the file, and import the data into a datable object?

    Read the article

  • Opening MS Excel worksheet in C#

    - by topgun_ivard
    I know we can open a particular worksheet of MS Excel using C# by providing the sheet number (1,2,3..) or name (sheet1, sheet2, sheet3...) I have a excel file which has 2 sheets, 1. Values, 2. Results Is there a way to open a sheet giving the sheet name ,i.e, "Values" instead of 1 or [s|S]heet1 in C# ?? I looked thru the old posts but didnt find anything useful... so again, what I am trying to do is, open a Excel worksheet by using its user defined name (Values) instead of the system defined name(1 or [s|S]heet1) any inputs would be greatly appreciated!

    Read the article

  • Opening an Excel worksheet inside a Webbrowser.

    - by rabindrarai
    Hi, I have opened a workbook using WebBrowser. However, it opens the first worksheet in the workbook whereas I would like to open a worksheet based on a name that I provide. Following is the code I used to open the workbook: public void OpenFile(string filename) { // Check the file exists if (!System.IO.File.Exists(filename)) throw new Exception(); m_ExcelFileName = filename; // Load the workbook in the WebBrowser control this.wbMain.Navigate(filename, false); } I would like to thank you in advance for trying to help me.

    Read the article

  • Function currying in Javascript

    - by kerry
    Do you catch yourself doing something like this often? 1: Ajax.request('/my/url', {'myParam': paramVal}, function() { myCallback(paramVal); }); Creating a function which calls another function asynchronously is a bad idea because the value of paramVal may change before it is called.  Enter the curry function: 1: Function.prototype.curry = function(scope) { 2: var args = []; 3: for (var i=1, len = arguments.length; i < len; ++i) { 4: args.push(arguments[i]); 5: } 6: var m = this; 7: return function() { 8: m.apply(scope, args); 9: }; 10: } This function creates a wrapper around the function and ‘locks in’ the method parameters.  The first parameter is the scope of the function call (usually this or window).  Any remaining parameters will be passed to the method call.  Using the curry method the above call changes to: 1: Ajax.request('/my/url', {'myParam': paramVal}, myCallback.curry(window,paramVal)); Remember when passing objects to the curry method that the objects members may still change.

    Read the article

  • Compute if a function is pure

    - by Oni
    As per Wikipedia: In computer programming, a function may be described as pure if both these statements about the function hold: The function always evaluates the same result value given the same argument value(s). The function result value cannot depend on any hidden information or state that may change as program execution proceeds or between different executions of the program, nor can it depend on any external input from I/O devices. Evaluation of the result does not cause any semantically observable side effect or output, such as mutation of mutable objects or output to I/O devices. I am wondering if it is possible to write a function that compute if a function is pure or not. Example code in Javascript: function sum(a,b) { return a+b; } function say(x){ console.log(x); } isPure(sum) // True isPure(say) // False

    Read the article

  • Why to say, my function is of IFly type rather than saying it's Airplane type

    - by Vishwas Gagrani
    Say, I have two classes: Airplane and Bird, both of them fly. Both implement the interface IFly. IFly declares a function StartFlying(). Thus both Airplane and Bird have to define the function, and use it as per their requirement. Now when I make a manual for class reference, what should I write for the function StartFlying? 1) StartFlying is a function of type IFly . 2) StartFlying is a function of type Airplane 3) StartFlying is a function of type Bird. My opinion is 2 and 3 are more informative. But what i see is that class references use the 1st one. They say what interface the function is declared in. Problem is, I really don't get any usable information from knowing StartFlying is IFly type. However, knowing that StartFlying is a function inside Airplane and Bird, is more informative, as I can decide which instance (Airplane or Bird ) to use. Any lights on this: how saying StartFlying is a function of type IFly, can help a programmer understanding how to use the function?

    Read the article

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