Search Results

Search found 9 results on 1 pages for 'maxima120'.

Page 1/1 | 1 

  • Need to debug LINQ simple queries in Visual Studio 2010

    - by maxima120
    I often get in a position when I need to know why my LINQ doesnt work as intended... I use object collections and extensions. I dont want spend more than couple of minutes on it. LINQ supposed to make developer's life easier not harder. I hoped VS 2010 will have it fixed but I now use RC and it still doesnt let me type LINQ and check what is going on... Says as before "Expression cannot contain lambda expressions"... Is there some add-on for Visual Studio so I can quickly and effectively run ad-hoc queries and find out what is going on and where I am wrong?

    Read the article

  • C#. Whats the fastest way to make an integer positive

    - by maxima120
    I asked wrong question previously and was swamped with negative votes... Let me try again... What is absolutely fastest way to make an int positive (given 50/50 distribution of pos/neg over time). To be nominated for an answer I will require MSIL analysis and not a guess or measuring of time with granny's watch... P.S. as one of variations I proposed i * i not because I wanted to do Sqrt(i * i) afterwards but because i will be used only once to be compared to a const. And if i * i will win competition I simply multiply the const.. Hence the following solution is valid: int trigger = realTrigger * realTrigger; i = SomeCalcs(); i = i * i; if(i < trigger) DoSomething(); P.P.S. pointless rant is not acceptable.. like: why do you need this, its BS! C# cannot tolerate developers like you!

    Read the article

  • C#. How to pass message from unsafe callback to managed code?

    - by maxima120
    Is there a simple example of how to pass messages from unsafe callback to managed code? I have a proprietary dll which receives some messages packed in structs and all is coming to a callback function. The example of usage is as follows but it calls unsafe code too. I want to pass the messages into my application which is all managed code. *P.S. I have no experience in interop or unsafe code. I used to develop in C++ 8 yrs ago but remember very little from that nightmarish times :) P.P.S. The application is loaded as hell, the original devs claim it processes 2mil messages per sec.. I need a most efficient solution.* static unsafe int OnCoreCallback(IntPtr pSys, IntPtr pMsg) { // Alias structure pointers to the pointers passed in. CoreSystem* pCoreSys = (CoreSystem*)pSys; CoreMessage* pCoreMsg = (CoreMessage*)pMsg; // message handler function. if (pCoreMsg->MessageType == Core.MSG_STATUS) OnCoreStatus(pCoreSys, pCoreMsg); // Continue running return (int)Core.CALLBACKRETURN_CONTINUE; } Thank you.

    Read the article

  • Visual Studio 2010 : Cant change target. Gives TargetFrameworkMoniker Error.

    - by maxima120
    I have a console application which has target .NET 2.0 It is very short but full of unsafe code. I converted it to VS 2010. I run it OK. When I try to change "target framework" in properties to 3.5 or 4.0 it shows message box: TargetFrameworkMoniker: Error parsing application configuration file at line 0. XML document must have a top level element. the target then stays 2.0 anyway... Any thoughts?

    Read the article

  • C#. Where struct methods code kept in memory?

    - by maxima120
    It is somewhat known where .NET keeps value types in memory (mostly in stack but could be in heap in certain circumstances etc)... My question is - where is the code of the struct? If I have say 16 byte of data fields in the struct and a massive computation method in it - I am presuming that 16 byte will be copied in stack and the method code is stored somewhere else and is shared for all instances of the struct. Are these presumptions correct?

    Read the article

  • C#. Struct design. Why 16 byte is recommended size?

    - by maxima120
    I read Cwalina book (recommendations on development and design of .NET apps). He says that good designed struct has to be less than 16 bytes in size (for performance purpose). My questions is - why exactly is this? And (more important) can I have larger struct with same efficiency if I run my .NET 3.5 (soon to be .NET 4.0) 64-bit application on i7 under Win7 x64 (is this limitation CPU / OS based)? Just to stress again - I need as efficient struct as it is possible. I try to keep it in stack all the time, the application is heavily multi-threaded and runs on sub-millisecond intervals, the current size of the struct is 64 byte.

    Read the article

1