What are the best practices for developing with the Eclipse Pydev interactive console once code migrates inside a function?
I heavily use the interactive console as my projects are typically experimental, open-ended, and not spec-driven. The interactive console works well for code in the main loop, but as soon as I migrate that code to a function, I only know to use breakpoints with the debug view. However, that seems unwieldy, and I don't need the entire stack, nor error-catching mechanisms.
Is there a way to have the vanilla pydev environment interactive console inside a function, for example on the first breakpoint, or raised error?
Without this, I typically have to copy the function back into the main loop. Then, I end up using the same variable names, which leads to occasional global variable name accidents when I copy back to a function.
Thanks in advance.
Related
I'm trying to setup a key binding in Eclipse to directly execute a background Java file. My file is called CodeChecker.java and it's sufficient for my purposes to run the main method without any arguments. I need to run it repeatedly and so I'm trying to setup a shortcut key to run it directly without having to bring up the Run... menu or having to bring up the file itself.
As far as I'm aware Eclipse is not able to offer this functionality directly. I've tried using a plugin called Practically Macro according to this answer Assigning a keyboard shortcut for a specific Eclipse build configuration. But this answer is horribly out of date and doesn't work any longer.
So I'm wondering if Practically Macro can still be used to achieve this? Any other solution, plugin, script or otherwise would be equally welcome.
everyone!
I am running Matlab R2016a on my Ubuntu 14.04.
I have a main script that calls some user-coded functions. As long as I debug the main script, the preview of the variables while hovering on them works fine and the variables shown in the workspace are accessible as usual.
As soon as I start debugging the nested functions, none of the previous aids work. The preview doesn't show up and the workspace is not updated with the local variables. Also, if I try to open any of the variables with the variable editor, the editor opens but it doesn't show anything.
Does anybody have a clue?
Thank you in advance.
Ok, I figured it out.
In the function script that I wanted to debug there were definitions of multiple functions. By placing each definition in a separate file the debugger works as fine as usual.
I guess that Matlab is not capable of debugging scripts with multiple function definitions because it becomes impossible to distinguish (or represent) the different scopes in one window, especially if the local variables have the same name.
Thanks anyway!
Sometimes I need interactive with scala console during debug. What I am doing now is: write a class with a method, and let that method return some object, then in scala console, I import that class ,create a new instance and run the method to get a object, then doing interactive thing with that object. If I need to modify that method, then I have to first change in IDE, then exit console, re-run console and import the class (since the class is change), to run the method again. This takes time, if it possible in IDE, set a breakpoint, run until that breakpoint, and then kick off a console, and doing interactive thing in that console?
The way I work within intellij is to use the terminal console, and have that in the lower third of my IDE window, and then have SBT (console) or scala just running in there. That way you can just switch between windows and evaluate expressions you need to from there. If you want to evaluate specific (in place) expressions such as those that are only in context within the currently debugged block of code, then I think that you might be able to do that via the Watch window. There is an option in Intellij 14 which pops up a separate evaluation window. (Not tried this with Scala though to be honest, but works well with Java).
I'm running Console2, which I believe is just an interface to windows cmd
I have a custom batch file that does most of my dirty work for me, but there are lot of commands in it now. Is there a way I can get a tap autocomplete working for it in the windows command prompt?
For example: my script is called rob.bat and it takes in a various number of arguments
It'd like to type rob set{Tab} and then have it cycle through
setup_envvars
setup_userprefs
setup_whateverothersetupscriptsIhave
Is there a way to do this?
Console2 has no special provisions for tab completion and instead relies on the program running within it to provide such features. Picture Console2 as little more than something that runs a console program hidden somewhere, regularly polls that hidden window for changes, and forwards all input to that window; this is, in essence, what's happening.
Note that Console2 does nothing special with cmd. You can run any shell within it. As for customizing tab completion, cmd offers nothing of that sort. You may be able to change this by installing clink, which has extension points for Lua code. Another option would be PowerShell, which has customizable tab completion out of the box, either by wrapping your program in a function that provides the necessary parameters, or by writing a custom TabExpansion or TabExpansion2 function.
I am using the Flex Builder 3 debugger almost every day and it's starting to be a real pain that the 'Variables' tab in the 'Flex Debugging' view doesn't show local variables, only 'this' is displayed.
Also I can not add Watch Expressions for local variables.
Am I forgetting something here or is the debugger just very limited?
Thanks
I have the same problem that motto described. Local variables are not displayed when debugging, "hover" method doesn't work either. You can always use trace() or Loging API.
The problem occurred to me yesterday and the only thing I noticed is that the project stopped to compile using ant script due to OutOfMemoryError (I usually build project using FB, but sometimes FlexBuilder doesn't show errors/warnings and compiling via ant script is the only way I know to find them).
To see if Flex Builder is even tracking your local variables properly, set a breakpoint somewhere in a function. Once you hit that breakpoint, you can also "hover" over a variable in your source code, and a tooltip should show the current value of that variable.
Sometimes, FB has problems if the current function is further down in a larger file. Moving the function code up solves the problem (but exposes the same for another funciton further doen then). It seems that FB can only gather a certain amount of metadata for the currently open file.