Cannot evaluate expression error in ONE project for years - visual-studio

Just tired to see this error every time for years only in ONE project: "Cannot evaluate expression because a thread is stopped at a point where garbage collection is impossible, possibly because the code is optimized"
Almost every property or field displays this message. From vs2005+.net2.0 to vs2008+.net3.5 now. Does anybody know how to fix it?

This is the same problem as this StackOverfow question. In that case it seems to be an inbuilt limit to the size of structs used within the method. The answer here provides links to two discussions of the issue.

Related

Swift 6 Error: Expression requiring global actor 'MainActor' cannot appear in default-value expression of property '_api' [duplicate]

This question already has answers here:
How do I fix "Expression requiring global actor 'MainActor' cannot appear in default-value expression of property '_audioPlaybackManager'"?
(2 answers)
Closed 11 months ago.
Xcode keeps throwing a complier error that it doesn't comply with Swift 6 Which isn't obv out yet. It only started when I downloaded 13.3 Xcode.
The error reads:
Expression requiring global actor 'MainActor' cannot appear in default-value expression of property '_api'; this is an error in Swift 6
my code is doing an state object call like so:
#StateObject var api = RecipeAPI()
I have debugged and closed and reopened everything but nothing changes. Reported it to apple too.
Best,
Imran
That's a warning in Swift 5. In Swift 6, it'll be an error. It's suggesting that you fix it now, but in the future it'll break the build. You're requiring that everything (including the init be run on the MainActor, but this assignment isn't promised to run on the MainActor itself (possibly because the type it's part of isn't also marked #MainActor). You may find a lot of these in 5.6 that are extremely difficult to fix. They're still tuning the warnings. (So when you start to formulate your next question "how do I eliminate all Swift concurrency warnings when dealing with SwiftUI and Foundation," the answer may be "you can't, or at least not in any easy way." It depends on the exact problem.)

PDE Mathematica

I'm newbie with Mathematica, so probably my problem is very easy to be solved.
I want to solve a PDE:
The first problem is that the program is not substituting the values inside w[x,y] and its second derivatives, to use them as boundary conditions.
It tells me that Tag Equal in ((w1^(2,0))[x,y]==0)[x,y] is Protected
The other problem is that it gives me also another type of error:
"{NDsolve[{(w1^(0,4))[x,y]+(w1^(2,2))[x,y]+(w1^(4,0))[x,y]==0,{w1[0,y]==0,w1[5,y]==0,((w1^(2,0))[x,y]==0)[0,y]==0,((w1^(2,0))[x,y]==0)[5,y]==0},{w1[x,0]==3,w1[x,5]==3,((w1^(0,2))[x,y]==0)[x,0]==0,((w1^(0,2))[x,y]==0)[x,10]==0}},w1[x,y],{x,0,10},{y,0,5}]} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing."
Thank you in advance.
I made some changes.
First of all I fixed the boundary conditions because they had a problem.
Moreover I changed also the equation.
Now it still gives me the error:
"{NDsolve[{(w^(0,4))[x,y]+(w^(2,2))[x,y]+(w^(4,0))[x,y]==2,{w[0,y]==0,w[5,y]==0,chix[0,y]==0,chix[5,y]==0},{w[x,0]==0,w[x,10]==0,chiy[x,0]==0,chiy[x,10]==0}},w,{x,0,5},{y,0,10}]} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing."
If we succeed in fixing this problem, Mathematica should give us a non zero solution.
Thank you very much!
Rewriting it, it doesn't provide any solution. And it also gives no errors. It looks like it is not even substitutiing the boundary conditions. I decided to change them, solving in this way another kind of problem. It still doesn't work. I think that it is very strange, since if the boundary conditions were wrong it should have provided either an indeterminate condition or an impossible one. Any idea?
Thank you very much for your help!

Proper syntax of Direct2D Chroma-Key effect

I'm trying to implement a Croma-Key effect on a bitmap, and i'm following the page: https://msdn.microsoft.com/en-us/library/windows/desktop/dn890715(v=vs.85).aspx
first i noticed the syntax was incorrect in the implementation of an array as an argument, when i fixed this, the proper way to get the processed image was incorrect and needed some poling around to solve, in the end, i'm still unable to find what m_d2dContext is. i would assume it's the ID2D1HwndRenderTarget but the intelesense says there's no method definition for: CreateEffect i was wondering if anyone has had success with this, and could show and explain their code.
I do, as I already replied to the same question you posted 4 days ago: what's the proper implementation of the Chroma-key Effect in Microsoft visual studio c++?

sigabrt on filteredArrayUsingPredicate

I'm a noob and trying to convert an example from a book into an app I can use.
The sample app is a modified version of the contacts application and it works.
I've done some further modification, and the search no longer works. It sigabrts on the following line
self.filteredAnswercards = [flattenedArray
filteredArrayUsingPredicate:predicate];
I'm stumped.
my head is bloody from beating it against my keyboard.
ANY help is massively appreciated.
Thanks.
My suggestion was to wrap the line that crashes inside a #try/#catch block and, inside the catch, log the exception and the result of the exception's callStackSymbols method.
For the record, part of the problem with the 4.x versions of Xcode is that they are much worse than 3.x versions at telling you where an exception is coming from. For this reason, getting familiar with tricks that make a program or the debugger tell you what you need to know is very important.
I would guess that predicate is nil. Where did you assign it? Or did you never assign it?
Very hard to say without seeing more code. Sigabort generally means an exception has been thrown. You can put a break point in objc_exception_throwto get a back trace which should help highlight the cause.
If you get NO new info with the above, others have said that a full reboot of the computer can help... but I have not had a situation where I could verify this.
---- edit based on comments -----
It sounds like filteredAnswercards is nil, that will definitely cause a Sigabort. Allocate that array properly and you should be good to go.

How to see multi-byte strings in Xcode

Is it possible to see strings that use 16 bits chars in Xcode debugger? I use a custom string class, not NSString. The strings are NULL terminated. The only way I can see the strings is if I see them as memory, but they are hard to read.
Thank you!
You'll need to write a data formatter bundle -- just writing the data formatter expressions inside the debugger isn't enough. Viewing strings in the Xcode debugger is a black art. Even once you've written the data formatter bundle, be prepared for them not to work at least 50% of the time. We've been fighting this issue for about 5 years now. Most of the time the debugger will tell you the variable is no longer in scope when it really is, and you'll still need to drill down into the members to view the raw memory anyway.
Something that may make it easier (I haven't tried this) is to write a method in the class that returns an NSString and then you may be able to get the data formatter expressions to display something useful.
Use Data Formatting in the XCode debugger
For custom classes I always found it helpful to implement description and debugDescription methods. Maybe this approach will be sufficient in your case too.

Resources