Suppose I have a classdef in a MyClass.m file with properties and methods like in the polynomial2 example found here https://octave.org/doc/v7.1.0/Creating-a-classdef-Class.html
I've confirmed that it's possible to set breakpoints in class methods using
dbstop in MyClass at MyClassMethod
as described here https://octave.org/doc/v7.1.0/Breakpoints.html
My questions are:
Is it possible to use a line number instead of the method name?
Is is possible to list the breakpoints in the class file?
Is it possible to clear breakpoints only in that class file?
Since all of the above are possible for functions, I would suppose it should also be possible for classes.
Thank you
Related
Is lib a special keyword for Frogatto Formula Language (FFL)? That seems to be the way of invoking class methods. For example:
where frog = lib.citadel.create_creature('Giant Frog')
Also, I am interested to know where can I find a list of all the available lib.**** library objects and how to list of all their available functions.
I wouldn't call it a keyword as such, more a symbol that appears in the standard namespace. As such it is functionally fairly close to a keyword.
When you create a class by adding a file e.g. data/classes/blah.cfg then a singleton instance of this class will be available using lib.blah. This is a convenient way of effectively creating your own namespace of functions -- create a class, add functions to it, then your functions can be accessed using lib.classname.functionname()
Is it Possible to set Nodes in the Projectexplorer for each Partialclass in Visual Studio?
Example:
Creating a Class-File in Visual Studio with 2 Classes inside, leads to a node for every class.
Creating a Class-File in VS with a Partial class, doesn't result in a new Node for each Partial class.
Is it Possible to have somehting like MurderAllHumans.Constructors and a MurderAllHumans.Methods Node?
I know it is possible to Achieve something simmular with Folders and multiple .cs files, but i am looking for a way to do this in one file.
Thanks in advance
No, this is not possible. The Class view will only show one entry for each class and as two files with a partial class is still only one class, there will only be one entry.
Generally it is advised to have only one class per file, and I am not sure I understand why you want to declare the same class partially twice in the same file either.
Maybe you could solve part of your wish but making one region for constructors and another for the methods etc. like this:
This will however not be reflected in the Class View.
I've got a small problem (maybe it isnt even a problem)
I am making an application in Ruby, and the folder/file structure goes something like this:
OrderSet/
..item.rb
..file.rb
..order_object.rb
OrderGet/
..item.rb
..files.rb
..order.rb
As you can see I got two item.rb files, they are both different in class structure. Now I need to create an OrderSet/item.rb object, how do I specify it needs to look in OrderSet and does not get the OrderGet one?
I have to make clear, all files are required in the main rb file.
I have tried doing OrderSet.Item (the class is called Item inside the item.rb) but it complains about an ininitialized constant OrderSet
Thanks in advance!
[edit]
I have also tried to make modules out of it, maybe I don't understand the concept correctly, but I have tried it with OrderSet.Item.new (OrderSet as module name)
You could use a module to create a namespace - that way each set of classes would be encapsulated to what they do (the folder name from your example). So classes in OrderSet would be wrapped in a module for example OrderSet/item.rb would become:
module OrderSet
class Item
# methods and properties
end
end
Then you could use it like
new_order_set = OrderSet::Item.new
RubyMonk has a lesson called Modules As Namespaces which has more details and examples you can run in your browser.
I want to set up a code snippet (in this case in C#) to create a property which is additionally initialized in the class constructor, which includes that code is not only inserted in the class body but also explicitly in the constructor. Is that possible with just one snipped, and if yes: how?
Thanks in advance!
I'm not sure i've completely understood your question, but you can use this tool :
http://snippeteditor.codeplex.com/
You can write a snippet for a class which contains one property set in the class constructor
Take a look at the class and prop or propfull snippets, it should help you
I am trying to implement AssemblyInitialize/AssemblyCleanup attributes in my Microsoft Visual Studio 2010 for the exact purpose as stated here. That link even describes the process which I need to follow to implement the code.
A quick summary of that purpose is to create an initial block of code which will run right before any test no matter which of the codedUITests I run in the solution and then a block of code which will run after the last codedUITest is completed. Example: I need to open up a specific application, then run a series of codedUITests which all start at that application and which are executed in any order, then close the application after everything is finished; this is more efficient than opening/closing the application for each codedUITest.
What I don't understand is where I need to place the code laid out at the bottom of that page (also shown below). I stuck all that code right under my 'public partial class UIMap' and the code runs except it runs the 'OpenApplication' and 'CloseApplication' commands before/after each CodedUITest instead of sandwiching the entire group of CodedUITests.
How do I implement the code correctly?
Update:
I discovered AssemblyI/C last night and I spent 3 hours trying to
figure out where to put the code so it works. If I put the
AssemblyInitialize at the beginning of a specific test method then:
1) It still wouldn't run - it was giving me some error saying that
UIMap.OpenWindow() and UIMap.CloseWindow() methods need to be static
and I couldn't figure out how to make them static.
2) Wouldn't the specific [TestMethod] which has the AssemblyI/C on it
need to be in the test set? In my situation I have a dozen
CodedUITests which need to run either individually or in a larger
group and I need to get the AssemblyI/C to Open/Close the window I am
testing.
You've added the methods to the wrong class. By putting then into the UIMap partial class, you are telling the runtime to run those methods every time you create a new UIMap instance, which it sounds like you're doing every test.
The point of the ClassInitialize/ClassCleanup methods is to add them to the class with your test methods in it. You should have at least one class decorated with the TestClass attribute, which has at least one method decorated with a TestMethod attribute. This is the class that needs the ClassInitialize and ClassCleanup attributes applied to it. Those methods will run one time for each separate TestClass you have in your project.
You could also use the AssemblyInitialize and AssemblyCleanup attributes instead. There can only be one of these methods in any given assembly, and they will run first and last, respectively, before and after any test methods in any classes.
UPDATE:
AssemblyInitialize/Cleanup need to be in a class that has the TestClass attribute, but it doesn't matter which one. The single method with each attribute will get run before or after any tests in the assembly run. It can't be a test method, though; it has to be a static method and will not count as a "test".