I can't find any documentation on Xunit.Runners.AssemblyRunner and it has me a bit stumped - xunit

I mean, there is sample code like:
runner.OnDiscoveryComplete = OnDiscoveryComplete;
But what does it mean? When does "OnDiscoveryComplete" happen? Also, I am not clear on the implementation. Do you simply set up all parts and then call instanceOfAssemblyTestRunner.Start()? Also in the past I used my Tests with "Dotnet test" from the shell. I guess now I have to compile and execute?
Any help is greatly appreciated.

Related

How to get Ruby interpreter callstack?

I'm trying to get the call stacks of Ruby interpreter when it gets executed. For example, I have some ruby code in foo.rb and when I execute it with some options (if any to get the call stack) by $ruby foo.rb, then I would like to get which functions of interpreter get executed.
I found this (https://programmer.help/blogs/ruby-2.x-source-code-learning-an-overview-of-interpreters.html) nice article related to my questions and provides some idea of how I should approach, but I'm not quite sure how I should do it.
Basically, the article is saying that "Open OPT_CALL_THREADED_CODE switch in vm_opts.h header file when compiling Ruby
ruby_run_node call stack" to get the call stack, but I don't really get what does it mean by "Open OPT_CALL_THREADED_CODE".
I did look at the vm_opts.h, but it does not tell much.
This issue is a very specific topic, but if anyone has any idea how I can get the call stack in anyways or with the method the article is suggesting, please please help me out here.
Thank you for all your help!

Creating calculator in abap

I've build a basic calculator in abap which is pretty simple and knows how to get 2 inputs and calculate them by pressing a push button of the operator( + - / *).
Now I want to make a calculator which gets one input like : "12+5*3-9"
But I really don't know how to start it.
Can anyone help me a little bit please?
Thank you.
You question is related with an algorithm for parsing mathematical strings rather than ABAP. One of them is Shunting-yard.
If you need to short way, you can add your expression into java script function and run it in CL_JAVA_SCRIPT class in ABAP.
Check example ABAP program DEMO_JAVA_SCRIPT_MINI_EDITOR.

Sassdash - Understanding $this-arg

I am working through the Sassdash Library, and there are numerous functions that use a argument $this-arg. I am having a lot of trouble understanding what it does. Can anyone simply explain what this does and what some simple use cases might be?
It is similar to how this works in JS.

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.

Ruby debugging and console

can anyone suggest a nice (not Netbeans) platform where i would be able to write ruby code to test?
I find irb a bit hard to follow when you want to define a method more than 3 lines long, and then test it.
Also, maybe just as a wish list item, some way where I could do follow the code step by step to monitor values in variables and make sure things are being done properly?
I'm asking because so far I've been writing in rails, but what you see is the final result of the method, and if you already expected a certain answer, then is fine, but if I need a more complicated method, i would like to be able to follow all the steps to make sure is doing what I want it to do.
Thanks a lot!
a great ide is rubymines by intellij. it is not free though. you can step through code and have the usual ide debugging features.
otherwise if the only problem you have is that you are examining code that is more than 3 lines, you can install the ruby-debug gem and then put the keyword debugger in your code and it will cause a break. So you don't need to put code into irb, just run your ruby script and it will break.
I know you said you find irb a bit hard to follow when you want to define a method more than 3 lines long, but if you use irb -rn ./(your file name here), you will get an irb output of every class, method, module, etc.
irb will walk through line by line so you can see what is working and what is not (you'll get true, false, nil, etc) for each line of code. I've found that you can skip what you already know is working and move on to where you feel the issues are.

Resources