Search Results

Search found 116 results on 5 pages for 'mahesh more'.

Page 4/5 | < Previous Page | 1 2 3 4 5  | Next Page >

  • What is the difference between these two linq implementations?

    - by Mahesh Velaga
    I was going through Jon Skeet's Reimplemnting Linq to Objects series. In the implementation of where article, I found the following snippets, but I don't get what is the advantage that we are gettting by splitting the original method into two. Original Method: // Naive validation - broken! public static IEnumerable<TSource> Where<TSource>( this IEnumerable<TSource> source, Func<TSource, bool> predicate) { if (source == null) { throw new ArgumentNullException("source"); } if (predicate == null) { throw new ArgumentNullException("predicate"); } foreach (TSource item in source) { if (predicate(item)) { yield return item; } } } Refactored Method: public static IEnumerable<TSource> Where<TSource>( this IEnumerable<TSource> source, Func<TSource, bool> predicate) { if (source == null) { throw new ArgumentNullException("source"); } if (predicate == null) { throw new ArgumentNullException("predicate"); } return WhereImpl(source, predicate); } private static IEnumerable<TSource> WhereImpl<TSource>( this IEnumerable<TSource> source, Func<TSource, bool> predicate) { foreach (TSource item in source) { if (predicate(item)) { yield return item; } } } Jon says - Its for eager validation and then defferring for the rest of the part. But, I don't get it. Could some one please explain it in a little more detail, whats the difference between these 2 functions and why will the validations be performed in one and not in the other eagerly? Conclusion/Solution: I got confused due to my lack of understanding on which functions are determined to be iterator-generators. I assumed that, it is based on signature of a method like IEnumerable<T>. But, based on the answers, now I get it, a method is an iterator-generator if it uses yield statements.

    Read the article

  • PropertyGrid control issue in Windows7

    - by Mahesh
    I have an issue with the Windows Forms PropertyGrid control. I have customized the PropertyGrid control and override only OnPaint function. protected override void OnPaint(PaintEventArgs pe) { base.OnPaint(pe); } In my application I have few more controls (treeview, custom control and few form controls). When I mouseclick on the PropertyGrid control, the paint function in all the controls in the screen are being called continuously and the treeview starts flickering. This happens only in mouseclick event.

    Read the article

  • Doubt in clustered and non Clustered index

    - by Mahesh
    I have a doubt that if my table do n't have any constraint like Primary Key,Foreign key,Unique key etc. then can i create the clustered index on table and clustered index can have the douplicate records ? My 2nd question is where should we exectly use the non clustered index and when it is useful and benificial to create in table? My 3rd question is How can we create the 249 non clustered index in a table .Is it the meaning, Creating the non clustered index on 249 columns ? Can you anyone help me to remove my confusion in this.

    Read the article

  • Why Fragmentation is Done at IP why not for TCP/UDP.

    - by mahesh
    I am looking for the reason Why Fragmentation is Done at IP level but why not for TCP/UDP. Suppose say my frame looks like this |MAC|IP|TCP|Payload|FCS. the whole size if say for eg: 1600. PathMTU happens here, why fragmentation is implemented @ IP level is my question and why not implemented @ TCP/UDP level/code. Thank in advance.

    Read the article

  • Dynamic Object Not Creating for Privately Inherited Class.

    - by mahesh
    Hi, What is the reason for the following code that does not let me to create object. class base { public: void foo() { cout << "base::foo()"; } }; class derived : private base { public: void foo() { cout << "deived::foo()"; } }; void main() { base *d = new derived(); d->foo(); } It Gives me error : " 'type cast' : conversion from 'derived *' to 'base *' exists, but is inaccessible" Thanks in advance :)

    Read the article

  • C Struct : typedef Doubt !

    - by Mahesh
    In the given code snippet, I expected the error symbol Record not found. But it compiled and ran fine on Visual Studio 2010 Compiler. I ran it as a C program from Visual Studio 2010 Command Prompt in the manner - cl Record.c Record Now the doubt is, doesn't typedef check for symbols ? Does it work more like a forward declaration ? #include "stdio.h" #include "conio.h" typedef struct Record R; struct Record { int a; }; int main() { R obj = {10}; getch(); return 0; }

    Read the article

  • .Net Frameworks Initialization Error

    - by mahesh
    I have develop application on VS-2005 and installed it at another machine and along with application I have installed .net frameworks 2.0 version as per demand and it works well at time of installed and after some time if I try to open it it’s throw error like “ .Net Framework Initialization Error, Unable to find a version of the runtime to run this application. Client Machine : Operating System is XP sp2 How to overcome from it?.

    Read the article

  • How to join two query in SQL (Oracle)

    - by MAHESH A SONI
    How can I join these queries? SELECT RCTDT, SUM(RCTAMOUNT), COUNT(RCTAMOUNT) FROM RECEIPTS4 WHERE RCTDT BETWEEN '01-nov-2009' AND '30-nov-2009' AND RCTTYPE='CA' AND RCTAMOUNT>0 GROUP BY RCTDT --- SELECT RCTDT, SUM(RCTAMOUNT), COUNT(RCTAMOUNT) FROM RECEIPTS4 WHERE RCTDT BETWEEN '01-nov-2009' AND '30-nov-2009' AND RCTTYPE='CQ' AND RCTAMOUNT>0 GROUP BY RCTDT

    Read the article

  • crystal reports sticky problem

    - by mahesh
    hi I have a project with following sql table companymaster expbill invcarat companyId companyid companyId name invno invno address buyer srno telno consignee qty rate amount I have tried many times by the way of ADO.Dataset with multiple sql query but reports show like sticky problems. the details section repeating from diferent companyID and invno am tired don't know how to overcome from this kindly provide me better solution with good example.

    Read the article

  • How to Replace only Part of the Variable using #define

    - by mahesh
    #define C_TX_ TX_ #define C_RX_ RX_ enum Test { C_TX_MAC 0x0100, // Pre-Processor should replace C_TX_ to TX_ C_RX_MAC 0x0101 // But Not Working. }; int main(int argc, char *argv[]) { cout << TX_MAC; // HOW TO PRINT ? cout << RX_MAC; // HOW TO PRINT ? return true; } Please Help. Thanks in Advance

    Read the article

  • Getting Text From Flash

    - by mahesh kotekar
    Hi, I have a problem usint httpWebRequest httpWebResponse. The problem is am trying to fetch data from a website which contains loads of text regarding some documents and articles which are inside the flash. How can i get the text inside the flash? The httpWebResponse does not contain the full text present in the page?

    Read the article

  • Array Assignment

    - by Mahesh
    Let me explain with an example - #include <iostream> void foo( int a[2], int b[2] ) // I understand that, compiler doesn't bother about the // array index and converts them to int *a, int *b { a = b ; // At this point, how ever assignment operation is valid. } int main() { int a[] = { 1,2 }; int b[] = { 3,4 }; foo( a, b ); a = b; // Why is this invalid here. return 0; } Is it because, array decays to a pointer when passed to a function foo(..), assignment operation is possible. And in main, is it because they are of type int[] which invalidates the assignment operation. Doesn't a,b in both the cases mean the same ? Thanks. Edit 1: When I do it in a function foo, it's assigning the b's starting element location to a. So, thinking in terms of it, what made the language developers not do the same in main(). Want to know the reason.

    Read the article

  • class classname(value); & class classname=value; difference when constructor is explicit

    - by Mahesh
    When constructor is explicit, it isn't used for implicit conversions. In the given snippet, constructor is marked as explicit. Then why in case foo obj1(10.25); it is working and in foo obj2=10.25; it isn't working ? #include <iostream> class foo { int x; public: explicit foo( int x ):x(x) {} }; int main() { foo obj(10.25); // Not an error. Why ? foo obj2 = 10.25; // Error getchar(); return 0; } error: error C2440: 'initializing' : cannot convert from 'double' to 'foo'

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >