Can I check the current value in an IPython magic command (%xmode)? - ipython

I want to check the current value of a magic command %xmode. The available mode is Context, Plain, and Verbose.
If you just type in %xmode, then it automatically switches to the next value. Certainly, you can know which value it was set to, but it is a pain to run the same command two more times to set it back to the original value.
So is it possible to only chech the value, without changing it?

We can run the following line to get the current xmode from an IPython terminal
get_ipython().config['InteractiveShell']['xmode']

Related

How to make org-mode display results in real time?

Whenever I run a source block in emacs org mode, the whole block executes and then I see the results. Is there a way to see the output of the program in real time?
For instance, when installing packages with pip install, the progress bars appear all at once, and they appear one after another (so org mode is not interpreting carriage returns correctly). Is there a header argument or some variable I can set to fix this? If not, where could I insert a filter function to achieve the same result?

Eclipse - Debugging

I am very new to Selenium and Eclipse.
I have a question (actually 2 questions) about debugging.
When I am debugging in Eclipse (Version: 2021-06 (4.20.0)), so I do not get visibility of all variables I have defined in the method.
For example, (see the screen shot attached) I have added string variable testSigned and assigned a value to it. Actually the purpose is to verify the text value contained in web element table_AdditionalDocumentation.
I defined Toggle Line breakpoint at line 395.
I started to execute in debug mode, got to the line 395.
However, I do not see the value of testSigned in Variables tab.
I noticed it does show values only of the variable which would be returned by the method, correct me if I am wrong.
Please, tell me how to get those values I have defined visible.
2.Additionally, please, let me know which button to press if for example after line 395 I want not to go line by line (F6), but just to run the code to the end.
For the first question, I'm not certain, but it might be because you haven't initialized that variable with a value. Try setting it to an empty string on the declaration line.
For the second question, if you set a breakpoint on the line you want to get to, just Resume (F8), and it will stop at the next breakpoint it hits, hopefully the one at the end of your method. Alternatively, if you just want to stop at the line right after the method returns (which will show the return value), you can click "Step Out" (F7) for that.

Emacs gdb: Show variable permanently in addition to locals i

I am using emacs for programming, and recently also gdb.
The "locals" window does show local variables but not arguments to a function, which in a way also could be considered local variables. For example, if I have
void foo(char *bar)
{
int n;
....
}
then n is shown in the "locals" but not bar. Of course, I can print bar but it is not automatically updated while I step through the code and I have to print all the time.
Is there a way to add expressions that are shown in a window and constantly updated as I execute the code?
The display command will certainly fulfill your needs:
If you find that you want to print the value of an expression frequently (to see how it changes), you might want to add it to the
automatic display list so that GDB prints its value each time your
program stops.
By example, once that your are in foo body (under gdb), type:
display bar
The interactive command gud-watch will watch the expression at point and display its value in the speedbar. Prefix it with C-u to be able to enter an expression.
See the manual page Watch Expressions for more details.
At the moment there doesn't seem to be a way to display watched expressions in the locals window.

Display TTY in Emacs Shell mode dirtrack

Is there any way to display the current TTY when using Emacs shell mode? Right now I get around by having tty displayed as part of the prompt but this requires scrolling back
You can display it on the mode line.
Look at the documentation , in elisp manual, section 23.4 -- Mode Line Format. In subsection 23.4.2 there is written how you do it: you write a form that returns the value you are interested about.
`(:eval FORM)'
A list whose first element is the symbol `:eval' says to evaluate
FORM, and use the result as a string to display. Make sure this
evaluation cannot load any files, as doing so could cause infinite
recursion.

Debugging with Zend Studio / Eclipse

Is it possible to debug PHP scripts so that it keeps running until an expression is true?
For example, I want to know when $a becomes a certain value. I don't want to keep pressing step into and wait until the variable $a changes the value to it.
The solution is to set a breakpoint, right click on it and set a condition for it.
However, there are no global breakpoints, you must specify a location for every breakpoint you put. So, if you want to know where a value changes, you can't set any global conditions as they would be too CPU consuming.